@arcgis/core 5.2.0-next.139 → 5.2.0-next.140
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/arcgisGlobal.d.ts +10 -10
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{86d8ccb795611cd6d071.js → 00a600c71ceebe7bfeee.js} +1 -1
- package/assets/esri/core/workers/chunks/0193df3f9fb23633da87.js +1 -0
- package/assets/esri/core/workers/chunks/{3a0b19275751a3a73cd5.js → 07aa6d36f1006b6ab7ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{a054da6cbd8ee4774a57.js → 1f3148cebee1961249a4.js} +1 -1
- package/assets/esri/core/workers/chunks/222af8522773c7dc80b1.js +1 -0
- package/assets/esri/core/workers/chunks/{a4d0df0177ac28e42219.js → 303fde8f3459dde16555.js} +1 -1
- package/assets/esri/core/workers/chunks/{51dd6df99dfe443df218.js → 350540770781b281c39a.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5f4521119d2ce2465d7.js → 3b017b718ea2d4ed498f.js} +1 -1
- package/assets/esri/core/workers/chunks/{1bf5e4b56c32a853f200.js → 3e81dfc9d621ece038fe.js} +1 -1
- package/assets/esri/core/workers/chunks/{685cef5d2245450dc695.js → 4097edb2ad522dff50ce.js} +1 -1
- package/assets/esri/core/workers/chunks/{2398d1ee310bbbc1e20c.js → 4d82db661365daa513a6.js} +1 -1
- package/assets/esri/core/workers/chunks/{544a1326c12e71b33dd8.js → 641d196a554bd07f729e.js} +1 -1
- package/assets/esri/core/workers/chunks/{dce78ea26d078d9c4667.js → 798a63653f82c0e842c5.js} +1 -1
- package/assets/esri/core/workers/chunks/84fcbf7a1d04f01685d1.js +1 -0
- package/assets/esri/core/workers/chunks/{459d5dca9c915b13cfce.js → 8e511079918e2fd9261f.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a8463fe687d3193dd8b.js → fc5a36e54929e03efa86.js} +1 -1
- package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/{layers/list/BasemapItemCollection.d.ts → layerList/BasemapLayerListModel.d.ts} +14 -14
- package/layerList/BasemapLayerListModel.js +2 -0
- package/{layers/list/CatalogItemCollection.d.ts → layerList/CatalogLayerListModel.d.ts} +15 -15
- package/layerList/CatalogLayerListModel.js +2 -0
- package/{layers/list → layerList}/Item.d.ts +22 -22
- package/layerList/Item.js +2 -0
- package/{layers/list → layerList}/ItemPanel.d.ts +3 -3
- package/layerList/ItemPanel.js +2 -0
- package/{layers/list/LayerItemCollection.d.ts → layerList/LayerListModel.d.ts} +16 -16
- package/layerList/LayerListModel.js +2 -0
- package/{layers/list → layerList}/TableItem.d.ts +11 -11
- package/layerList/TableItem.js +2 -0
- package/{layers/list → layerList}/TableItemPanel.d.ts +2 -2
- package/layerList/TableItemPanel.js +2 -0
- package/{layers/list/TableItemCollection.d.ts → layerList/TableListModel.d.ts} +15 -15
- package/layerList/TableListModel.js +2 -0
- package/{layers/list → layerList}/types.d.ts +29 -29
- package/layers/support/LabelExpressionInfo.d.ts +7 -1
- package/layers/support/LabelExpressionInfo.js +1 -1
- package/package.json +2 -2
- package/popup/{FeatureContent.d.ts → FeatureModel.d.ts} +11 -11
- package/popup/{FeatureContent.js → FeatureModel.js} +1 -1
- package/popup/{FeatureContentCollection.d.ts → FeaturesModel.d.ts} +62 -62
- package/popup/FeaturesModel.js +2 -0
- package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +2 -0
- package/widgets/DirectionalPad/types.d.ts +5 -1
- package/widgets/DirectionalPad.d.ts +1 -0
- package/widgets/Feature/FeatureViewModel.d.ts +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Features/FeaturesViewModel.d.ts +2 -2
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/LayerList/LayerListViewModel.d.ts +4 -4
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/LayerList/ListItem.d.ts +5 -5
- package/widgets/LayerList/ListItemPanel.d.ts +4 -4
- package/widgets/LayerList/types.d.ts +7 -7
- package/widgets/Popup/PopupViewModel.d.ts +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.d.ts +9 -2
- package/assets/esri/core/workers/chunks/069bd90cbb7377e2e4bc.js +0 -1
- package/assets/esri/core/workers/chunks/f3214bccb039338acadf.js +0 -1
- package/assets/esri/core/workers/chunks/fd2cea0761587adaa6c9.js +0 -1
- package/layers/list/BasemapItemCollection.js +0 -2
- package/layers/list/CatalogItemCollection.js +0 -2
- package/layers/list/Item.js +0 -2
- package/layers/list/ItemPanel.js +0 -2
- package/layers/list/LayerItemCollection.js +0 -2
- package/layers/list/TableItem.js +0 -2
- package/layers/list/TableItemCollection.js +0 -2
- package/layers/list/TableItemPanel.js +0 -2
- package/popup/FeatureContentCollection.js +0 -2
- /package/{layers/list → layerList}/support/layerListUtils.js +0 -0
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
* @beta
|
|
5
5
|
* @since 5.2
|
|
6
6
|
*/
|
|
7
|
-
import type Layer from "../Layer.js";
|
|
8
|
-
import type SubtypeGroupLayer from "../SubtypeGroupLayer.js";
|
|
9
7
|
import type Item from "./Item.js";
|
|
10
8
|
import type ItemPanel from "./ItemPanel.js";
|
|
11
|
-
import type
|
|
9
|
+
import type LayerListModel from "./LayerListModel.js";
|
|
12
10
|
import type TableItem from "./TableItem.js";
|
|
13
|
-
import type TableItemCollection from "./TableItemCollection.js";
|
|
14
11
|
import type TableItemPanel from "./TableItemPanel.js";
|
|
15
|
-
import type
|
|
16
|
-
import type
|
|
17
|
-
import type
|
|
18
|
-
import type
|
|
19
|
-
import type
|
|
20
|
-
import type
|
|
12
|
+
import type TableListModel from "./TableListModel.js";
|
|
13
|
+
import type Layer from "../layers/Layer.js";
|
|
14
|
+
import type SubtypeGroupLayer from "../layers/SubtypeGroupLayer.js";
|
|
15
|
+
import type Sublayer from "../layers/support/Sublayer.js";
|
|
16
|
+
import type SubtypeSublayer from "../layers/support/SubtypeSublayer.js";
|
|
17
|
+
import type ActionButton from "../support/actions/ActionButton.js";
|
|
18
|
+
import type ActionToggle from "../support/actions/ActionToggle.js";
|
|
19
|
+
import type LayerView from "../views/layers/LayerView.js";
|
|
20
|
+
import type { StreamLayerViewConnectionStatus } from "../views/layers/StreamLayerView.js";
|
|
21
21
|
|
|
22
22
|
/** An action element that can be associated with a list item. */
|
|
23
23
|
export type Action = ActionButton | ActionToggle;
|
|
@@ -26,7 +26,7 @@ export type Action = ActionButton | ActionToggle;
|
|
|
26
26
|
* Represents a layer view for stream layers that provides connection status information.
|
|
27
27
|
* Used to determine the current connection state of a stream layer in the view.
|
|
28
28
|
*
|
|
29
|
-
* @see [Item.connectionStatus](https://developers.arcgis.com/javascript/latest/references/core/
|
|
29
|
+
* @see [Item.connectionStatus](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#connectionStatus)
|
|
30
30
|
*/
|
|
31
31
|
export type ConnectedLayerView = LayerView
|
|
32
32
|
& {
|
|
@@ -35,13 +35,13 @@ export type ConnectedLayerView = LayerView
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* A function used to filter which [Item](https://developers.arcgis.com/javascript/latest/references/core/
|
|
38
|
+
* A function used to filter which [Item](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/) objects are included.
|
|
39
39
|
*
|
|
40
40
|
* @param item - The list item to evaluate for inclusion.
|
|
41
41
|
*/
|
|
42
42
|
export type FilterPredicate = (item: Item) => boolean;
|
|
43
43
|
|
|
44
|
-
/** Identifies the content represented by a [Item](https://developers.arcgis.com/javascript/latest/references/core/
|
|
44
|
+
/** Identifies the content represented by a [Item](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/). */
|
|
45
45
|
export type ItemContent = { type: "layer"; } | {
|
|
46
46
|
type: "track-info";
|
|
47
47
|
name: TrackInfoType;
|
|
@@ -58,7 +58,7 @@ export type ItemContent = { type: "layer"; } | {
|
|
|
58
58
|
export type ItemModifier = (event: ItemModifierEvent) => void;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* Event object passed to [ItemModifier](https://developers.arcgis.com/javascript/latest/references/core/
|
|
61
|
+
* Event object passed to [ItemModifier](https://developers.arcgis.com/javascript/latest/references/core/layerList/types/#ItemModifier).
|
|
62
62
|
* Provides access to the list item being created.
|
|
63
63
|
*/
|
|
64
64
|
export interface ItemModifierEvent {
|
|
@@ -69,21 +69,21 @@ export interface ItemModifierEvent {
|
|
|
69
69
|
/**
|
|
70
70
|
* Arbitrary data associated with the panel.
|
|
71
71
|
*
|
|
72
|
-
* @see [ItemPanel.content](https://developers.arcgis.com/javascript/latest/references/core/
|
|
72
|
+
* @see [ItemPanel.content](https://developers.arcgis.com/javascript/latest/references/core/layerList/ItemPanel/#content)
|
|
73
73
|
*/
|
|
74
74
|
export type ItemPanelContent = "legend" | HTMLElement | string;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Defines one or more panel content values.
|
|
78
78
|
*
|
|
79
|
-
* @see [ItemPanel.content](https://developers.arcgis.com/javascript/latest/references/core/
|
|
79
|
+
* @see [ItemPanel.content](https://developers.arcgis.com/javascript/latest/references/core/layerList/ItemPanel/#content)
|
|
80
80
|
*/
|
|
81
81
|
export type ItemPanelContents = ItemPanelContent | ItemPanelContent[];
|
|
82
82
|
|
|
83
|
-
/** Properties used to construct a [ItemPanel](https://developers.arcgis.com/javascript/latest/references/core/
|
|
83
|
+
/** Properties used to construct a [ItemPanel](https://developers.arcgis.com/javascript/latest/references/core/layerList/ItemPanel/). */
|
|
84
84
|
export type ItemPanelProperties = Partial<Pick<ItemPanel, "content" | "disabled" | "flowEnabled" | "icon" | "image" | "listItem" | "open" | "title" | "visible">>;
|
|
85
85
|
|
|
86
|
-
/** Properties used to construct a [Item](https://developers.arcgis.com/javascript/latest/references/core/
|
|
86
|
+
/** Properties used to construct a [Item](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/). */
|
|
87
87
|
export type ItemProperties = Partial<Pick<Item, "actionsExpanded" | "actionsOpen" | "actionsSections" | "checkPublishStatusEnabled" | "children" | "childrenSortable" | "connectionStatus" | "content" | "error" | "expanded" | "hidden" | "layer" | "layerView" | "listItemCreatedFunction" | "listModeDisabled" | "open" | "panel" | "parent" | "sortable" | "title" | "view" | "visible">>;
|
|
88
88
|
|
|
89
89
|
/**
|
|
@@ -93,19 +93,19 @@ export type ItemProperties = Partial<Pick<Item, "actionsExpanded" | "actionsOpen
|
|
|
93
93
|
* - `inherited`: Child layers inherit the visibility from their parent layer.
|
|
94
94
|
* - `exclusive`: Only one child layer can be visible at a time.
|
|
95
95
|
*
|
|
96
|
-
* @see [Item.visibilityMode](https://developers.arcgis.com/javascript/latest/references/core/
|
|
96
|
+
* @see [Item.visibilityMode](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#visibilityMode)
|
|
97
97
|
*/
|
|
98
98
|
export type ItemVisibilityMode = "independent" | "inherited" | "exclusive";
|
|
99
99
|
|
|
100
|
-
/** Properties used to construct a [
|
|
101
|
-
export type
|
|
100
|
+
/** Properties used to construct a [LayerListModel](https://developers.arcgis.com/javascript/latest/references/core/layerList/LayerListModel/). */
|
|
101
|
+
export type LayerListModelProperties = Partial<Pick<LayerListModel, "listItemCreatedFunction" | "operationalItems" | "view">>;
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
104
|
* The event object for the `trigger-action` event in the layer lists.
|
|
105
105
|
*
|
|
106
|
-
* @see [
|
|
106
|
+
* @see [LayerListModel.@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/layerList/LayerListModel/#event-trigger-action)
|
|
107
107
|
*/
|
|
108
|
-
export interface
|
|
108
|
+
export interface LayerListModelTriggerActionEvent {
|
|
109
109
|
/** The action that was clicked by the user. */
|
|
110
110
|
action: Action;
|
|
111
111
|
/** The list item associated with the action. */
|
|
@@ -116,7 +116,7 @@ export interface LayerItemCollectionTriggerActionEvent {
|
|
|
116
116
|
* Represents a layer view that supports spatial referencing. Used to indicate whether the
|
|
117
117
|
* associated layer view can operate with a spatial reference in the current view context.
|
|
118
118
|
*
|
|
119
|
-
* @see [Item.layerView](https://developers.arcgis.com/javascript/latest/references/core/
|
|
119
|
+
* @see [Item.layerView](https://developers.arcgis.com/javascript/latest/references/core/layerList/Item/#layerView)
|
|
120
120
|
*/
|
|
121
121
|
export type SpatiallyReferencedLayerView = LayerView
|
|
122
122
|
& {
|
|
@@ -128,17 +128,17 @@ export type SpatiallyReferencedLayerView = LayerView
|
|
|
128
128
|
export type State = "ready" | "loading" | "disabled";
|
|
129
129
|
|
|
130
130
|
/** @internal */
|
|
131
|
-
export type
|
|
131
|
+
export type TableListModelLayer = TableItemLayer;
|
|
132
132
|
|
|
133
133
|
/** @internal */
|
|
134
|
-
export type
|
|
134
|
+
export type TableListModelProperties = Partial<Pick<TableListModel, "listItemCreatedFunction" | "map" | "tableItems" | "tables">>;
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* The event object for the `trigger-action` event in the table list.
|
|
138
138
|
*
|
|
139
139
|
* @internal
|
|
140
140
|
*/
|
|
141
|
-
export interface
|
|
141
|
+
export interface TableListModelTriggerActionEvent {
|
|
142
142
|
/**
|
|
143
143
|
* The action clicked by the user.
|
|
144
144
|
*
|
|
@@ -182,7 +182,7 @@ export interface TableItemModifierEvent {
|
|
|
182
182
|
* The content associated with a table list item panel.
|
|
183
183
|
*
|
|
184
184
|
* @internal
|
|
185
|
-
* @see [TableItemPanel.content](https://developers.arcgis.com/javascript/latest/references/core/
|
|
185
|
+
* @see [TableItemPanel.content](https://developers.arcgis.com/javascript/latest/references/core/layerList/TableItemPanel/#content)
|
|
186
186
|
*/
|
|
187
187
|
export type TableItemPanelContent = "legend" | HTMLElement | string;
|
|
188
188
|
|
|
@@ -190,7 +190,7 @@ export type TableItemPanelContent = "legend" | HTMLElement | string;
|
|
|
190
190
|
* Defines one or more content values for a table list item panel.
|
|
191
191
|
*
|
|
192
192
|
* @internal
|
|
193
|
-
* @see [TableItemPanel.content](https://developers.arcgis.com/javascript/latest/references/core/
|
|
193
|
+
* @see [TableItemPanel.content](https://developers.arcgis.com/javascript/latest/references/core/layerList/TableItemPanel/#content)
|
|
194
194
|
*/
|
|
195
195
|
export type TableItemPanelContents = TableItemPanelContent | TableItemPanelContent[];
|
|
196
196
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
2
2
|
|
|
3
3
|
/** @since 5.0 */
|
|
4
|
-
export interface LabelExpressionInfoProperties extends Partial<Pick<LabelExpressionInfo, "expression" | "title">> {}
|
|
4
|
+
export interface LabelExpressionInfoProperties extends Partial<Pick<LabelExpressionInfo, "expression" | "name" | "title">> {}
|
|
5
5
|
|
|
6
6
|
/** @since 5.0 */
|
|
7
7
|
export default class LabelExpressionInfo extends JSONSupport {
|
|
@@ -25,6 +25,12 @@ export default class LabelExpressionInfo extends JSONSupport {
|
|
|
25
25
|
* @since 5.0
|
|
26
26
|
*/
|
|
27
27
|
accessor expression: string | null | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* A unique identifier for the label expression.
|
|
30
|
+
*
|
|
31
|
+
* @since 5.2
|
|
32
|
+
*/
|
|
33
|
+
accessor name: string | null | undefined;
|
|
28
34
|
/**
|
|
29
35
|
* The title of the label expression. This is particularly useful in the case of multiple label classes.
|
|
30
36
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{convertTemplatedStringToArcade as i}from"./labelUtils.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{writer as o}from"../../core/accessorSupport/decorators/writer.js";var s;let c=class extends t{static{s=this}constructor(e){super(e),this.expression=null,this.title=null,this.value=null}readExpression(e,t){return t.value?i(t.value):e}writeExpression(e,t,n){this.value!=null&&(e=i(this.value)),e!=null&&(t[n]=e)}clone(){return new s({expression:this.expression,title:this.title,value:this.value})}};e([n({type:String,json:{write:{writerEnsuresNonNull:!0}}})],c.prototype,`expression`,void 0),e([a(`expression`,[`expression`,`value`])],c.prototype,`readExpression`,null),e([o(`expression`)],c.prototype,`writeExpression`,null),e([n({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],c.prototype,`title`,void 0),e([n({json:{read:!1,write:!1}})],c.prototype,`value`,void 0),c=s=e([r(`esri.layers.support.LabelExpressionInfo`)],c);export{c as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{convertTemplatedStringToArcade as i}from"./labelUtils.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{writer as o}from"../../core/accessorSupport/decorators/writer.js";var s;let c=class extends t{static{s=this}constructor(e){super(e),this.name=null,this.expression=null,this.title=null,this.value=null}readExpression(e,t){return t.value?i(t.value):e}writeExpression(e,t,n){this.value!=null&&(e=i(this.value)),e!=null&&(t[n]=e)}clone(){return new s({name:this.name,expression:this.expression,title:this.title,value:this.value})}};e([n({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],c.prototype,`name`,void 0),e([n({type:String,json:{write:{writerEnsuresNonNull:!0}}})],c.prototype,`expression`,void 0),e([a(`expression`,[`expression`,`value`])],c.prototype,`readExpression`,null),e([o(`expression`)],c.prototype,`writeExpression`,null),e([n({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],c.prototype,`title`,void 0),e([n({json:{read:!1,write:!1}})],c.prototype,`value`,void 0),c=s=e([r(`esri.layers.support.LabelExpressionInfo`)],c);export{c as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.140",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.8",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.140",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.89",
|
|
26
26
|
"@vaadin/grid": "~25.3.2",
|
|
@@ -17,7 +17,7 @@ import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
|
|
|
17
17
|
import type { GraphicProperties } from "../Graphic.js";
|
|
18
18
|
import type { PointProperties } from "../geometry/Point.js";
|
|
19
19
|
|
|
20
|
-
export interface
|
|
20
|
+
export interface FeatureModelProperties extends IdentifiableMixinProperties, Partial<Pick<FeatureModel, "defaultPopupTemplateEnabled" | "includeDefaultActions" | "map" | "view">> {
|
|
21
21
|
/** Defines the specific [FeatureAbilities](https://developers.arcgis.com/javascript/latest/references/core/popup/support/FeatureAbilities/) that should be used when querying and displaying content. */
|
|
22
22
|
abilities?: FeatureAbilitiesProperties;
|
|
23
23
|
/** A collection of custom actions to include with the feature's popup actions. */
|
|
@@ -95,8 +95,8 @@ export type PopupContent = PopupTemplateContentResolved;
|
|
|
95
95
|
* @see [Arcade - expression language](https://developers.arcgis.com/javascript/latest/arcade/)
|
|
96
96
|
* @since 5.2
|
|
97
97
|
*/
|
|
98
|
-
export default class
|
|
99
|
-
constructor(properties?:
|
|
98
|
+
export default class FeatureModel extends FeatureModelSuperclass {
|
|
99
|
+
constructor(properties?: FeatureModelProperties);
|
|
100
100
|
/** Defines the specific [FeatureAbilities](https://developers.arcgis.com/javascript/latest/references/core/popup/support/FeatureAbilities/) that should be used when querying and displaying content. */
|
|
101
101
|
get abilities(): FeatureAbilities;
|
|
102
102
|
set abilities(value: FeatureAbilitiesProperties);
|
|
@@ -121,7 +121,7 @@ export default class FeatureContent extends FeatureContentSuperclass {
|
|
|
121
121
|
/** A read-only map of Arcade expression names to their evaluated values for the current feature. */
|
|
122
122
|
get expressionAttributes(): Record<string, any> | null | undefined;
|
|
123
123
|
/**
|
|
124
|
-
* The formatted attributes calculated from `fieldInfo` [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) formatting. They are obtained from the feature's [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/
|
|
124
|
+
* The formatted attributes calculated from `fieldInfo` [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) formatting. They are obtained from the feature's [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureModel/#graphic) attribute values and can be read:
|
|
125
125
|
* * [globally](https://developers.arcgis.com/javascript/latest/references/core/popup/types/#FeatureFormattedAttributes-global) using the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#fieldInfos) property directly at the root level of the [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/), or
|
|
126
126
|
* * [per an individual content element](https://developers.arcgis.com/javascript/latest/references/core/popup/types/#FeatureFormattedAttributes-content). This element is defined with a [FieldsContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/FieldsContent/) popup element set on the PopupTemplate [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#content) property.
|
|
127
127
|
*/
|
|
@@ -166,7 +166,7 @@ export default class FeatureContent extends FeatureContentSuperclass {
|
|
|
166
166
|
* @default false
|
|
167
167
|
*/
|
|
168
168
|
accessor includeDefaultActions: boolean;
|
|
169
|
-
/** Indicates whether the current [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/
|
|
169
|
+
/** Indicates whether the current [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureModel/#graphic) resides in a non-spatial table. */
|
|
170
170
|
get isFeatureFromTable(): boolean;
|
|
171
171
|
/** A read-only property containing metadata regarding the last edit performed on a feature. */
|
|
172
172
|
get lastEditInfo(): LastEditInfo | null | undefined;
|
|
@@ -183,9 +183,9 @@ export default class FeatureContent extends FeatureContentSuperclass {
|
|
|
183
183
|
get location(): Point | null | undefined;
|
|
184
184
|
set location(value: PointProperties | null | undefined);
|
|
185
185
|
/**
|
|
186
|
-
* A map is required when the input [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/
|
|
186
|
+
* A map is required when the input [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureModel/#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.
|
|
187
187
|
*
|
|
188
|
-
* Alternatively, the [view](https://developers.arcgis.com/javascript/latest/references/core/popup/
|
|
188
|
+
* Alternatively, the [view](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureModel/#view) property can be used to provide the map instance for this property.
|
|
189
189
|
*
|
|
190
190
|
* @see [Type system](https://developers.arcgis.com/arcade/guide/types/#featuresetcollection)
|
|
191
191
|
* @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
|
|
@@ -235,7 +235,7 @@ export default class FeatureContent extends FeatureContentSuperclass {
|
|
|
235
235
|
* > [!WARNING]
|
|
236
236
|
* >
|
|
237
237
|
* > A view is required if the user expects to display content in any of the following situations:
|
|
238
|
-
* > - The [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/
|
|
238
|
+
* > - The [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureModel/#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).
|
|
239
239
|
* > - 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/)).
|
|
240
240
|
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone).
|
|
241
241
|
*/
|
|
@@ -243,12 +243,12 @@ export default class FeatureContent extends FeatureContentSuperclass {
|
|
|
243
243
|
/** Indicates whether the feature is currently waiting for all of its content to finish loading. */
|
|
244
244
|
get waitingForContent(): boolean;
|
|
245
245
|
/**
|
|
246
|
-
* Fetches and updates the geometry of the [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/
|
|
247
|
-
* This method can be called to refresh the [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/
|
|
246
|
+
* Fetches and updates the geometry of the [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureModel/#graphic).
|
|
247
|
+
* This method can be called to refresh the [graphic](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureModel/#graphic)'s geometry before taking actions such as calling
|
|
248
248
|
* [View2D.goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#goTo) with the graphic as the `target`.
|
|
249
249
|
*
|
|
250
250
|
* @returns A promise that resolves when the geometry update attempt has completed.
|
|
251
251
|
*/
|
|
252
252
|
updateGeometry(): Promise<void>;
|
|
253
253
|
}
|
|
254
|
-
declare const
|
|
254
|
+
declare const FeatureModelSuperclass: typeof Accessor & typeof IdentifiableMixin
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{FeatureSetQueryInterceptor as n}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as i}from"../core/arrayUtils.js";import{createTask as a}from"../core/asyncUtils.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import{abortMaybe as c}from"../core/maybe.js";import{eachAlways as l,isAbortError as u,throwIfAborted as d}from"../core/promiseUtils.js";import{watch as f,initial as p,when as m}from"../core/reactiveUtils.js";import{throttle as h}from"../core/throttle.js";import{property as g,subclass as _}from"../core/accessorSupport/decorators.js";import v from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{ActionsCollection as b,createDefaultAggregateActions as x,createDefaultActions as S}from"./actions.js";import C from"./content/TextContent.js";import{compileExpressionInfos as w,formatArcadeValue as T}from"./support/arcadeFeatureUtils.js";import E from"./support/FeatureAbilities.js";import{preLayerQueryCallback as D,preRequestCallback as O,getPopupLayer as k,createFieldInfoMap as A,getAllFieldInfos as j,querySourceLayer as M,queryUpdatedFeature as N,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as F,formatEditInfo as I,substituteFieldsInLinksAndAttributes as L,graphicCallback as R,formatAttributes as z,isRelatedField as B}from"./support/featureUtils.js";import{queryLayerInfos as V,queryRelatedFeatures as H,setRelatedFeatures as U,getRelatedFieldInfo as W,createRelatedInfo as G,updateRelatedInfo as K}from"./support/relatedFeatureUtils.js";import{system as q}from"../time/constants.js";var J;let Y=class extends o(r){static{J=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new E,this.content=null,this.description=null,this.actions=new b,this.includeDefaultActions=!1,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading=``,this.view=null,this._graphicChangedThrottled=h(this._graphicChanged,()=>this.notifyChange(`waitingForContent`),1,this),this._isAllowedContentType=e=>{let{abilities:t}=this;return e.type===`attachments`&&!!t.attachmentsContent||e.type===`custom`&&!!t.customContent||e.type===`fields`&&!!t.fieldsContent||e.type===`media`&&!!t.mediaContent||e.type===`text`&&!!t.textContent||e.type===`expression`&&!!t.expressionContent||e.type===`relationship`&&!!t.relationshipContent||e.type===`utility-network-associations`&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=h(this._evaluateExpressionAttributes,()=>this.notifyChange(`waitingForContent`),1,this),this.addHandles([f(()=>[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(),p),m(()=>{if(!this._graphicChangedTask?.finished||this._graphicChangedTask.value==null)return null;let e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=c(this._graphicChangedTask),this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new n(D,O)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){let e=k(this.graphic);return A(j(this._effectivePopupTemplate),e)}get defaultActions(){let e=this._get(`defaultActions`)||new b;return e.removeAll(),e.addMany(this.graphic?.isAggregate?x():S()),e}get allActions(){let e=this._get(`allActions`)||new b,{actions:t,defaultPopupTemplateEnabled:n,includeDefaultActions:r,graphic:a}=this,o=[];if(a){let e=r?this.defaultActions.concat(t):t,s=typeof a.getEffectivePopupTemplate==`function`&&a.getEffectivePopupTemplate(n)||a.popupTemplate,c=s?.actions;o=(s?.overwriteActions?c:c?.concat(e)??e)?.filter(i).toArray()??[]}let s=e.toArray();return(s.length!==o.length||s.some((e,t)=>e!==o[t]))&&(e.removeAll(),e.addMany(o)),e}get isFeatureFromTable(){return k(this.graphic)?.isTable??!1}get state(){return this.graphic?this._error?`error`:this.waitingForContent?`loading`:`ready`:`disabled`}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get timeZone(){return this.view?.timeZone??q}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get map(){return this.view?.map||null}set map(e){this._override(`map`,e)}get waitingForContent(){let{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:n,_evaluateExpressionAttributesTask:r}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||n!=null&&!n.finished||r!=null&&!r.finished}async updateGeometry(){let{graphic:e,spatialReference:t}=this,n=k(e);await n?.load();let r=n?.objectIdField;if(!r||!e)return;let i=e.attributes?.[r];if(i==null)return;let a=(await M({layer:n,graphic:e,outFields:[],objectIds:[i],returnGeometry:!0,spatialReference:t}))?.geometry;a&&(e.geometry=a)}_clear(){this._set(`heading`,``),this._set(`content`,null),this._set(`formattedAttributes`,null),this._set(`expressionAttributes`,null)}_graphicChanged(){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._graphicChangedTask=c(this._graphicChangedTask),this._graphicChangedTask=a(async e=>{this._error=null,this._clear();let{graphic:t}=this;try{if(!t)return null;let{_effectivePopupTemplate:n}=this,r=k(t),i=this.spatialReference;await N({graphic:t,popupTemplate:n,layer:r,spatialReference:i},{signal:e});let[{value:a},{value:o}]=await l([this._getContent(),this._getTitle()]),[,{value:s}]=await l([this._checkForRelatedFeatures({signal:e}),w(n?.expressionInfos,t)]);return{expressionInfos:s,content:a,heading:o}}catch(e){throw u(e)||(this._error=e,s.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:t,popupTemplate:this._effectivePopupTemplate})),e}})}_compileContentElement(e){let t=k(this.graphic);return e.type===`relationship`?P(t)?e:void 0:e.type===`utility-network-associations`?F(t)?e:void 0:e}_compileContent(e){if(this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map(e=>this._compileContentElement(e)).filter(i):typeof e==`string`?new C({text:e}).text:e}_compileLastEditInfo(){let{_effectivePopupTemplate:e,graphic:t,timeZone:n}=this,r=k(t);if(!e)return;let{lastEditInfoEnabled:i}=e,a=r?.editFieldsInfo;if(i&&a)return I(a,t?.attributes,n,r)}_compileHeading(e){let{_fieldInfoMap:t,graphic:n,expressionAttributes:r}=this,i=k(n),a=n?.attributes??{},o=this.formattedAttributes?.global??{};return L({attributes:a,fieldInfoMap:t,globalAttributes:o,expressionAttributes:r,layer:i,text:e})}async _getTitle(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?R({type:`title`,value:e?.title,event:{graphic:t}}):null}async _getContent(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?R({type:`content`,value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({heading:e,content:t,expressionInfos:n}){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=a(async r=>{let{graphic:i,map:a,view:o,spatialReference:c,location:l}=this;try{if(!i)return;let s;if(n!=null){let e=[];for(let[t,s]of n.expressions.entries())s==null?e.push(Promise.resolve([t,void 0])):e.push(s.evaluate({graphic:i,interceptor:J.interceptor,location:l,map:a,options:{signal:r},spatialReference:c,view:o}).then(e=>[t,typeof e==`string`?T(e):e]).catch(()=>[t,void 0]));s=Object.fromEntries(await Promise.all(e)),d(r)}this._set(`expressionAttributes`,s??null),this._graphicExpressionAttributes={...i.attributes,...s},this._set(`formattedAttributes`,this._createFormattedAttributes(t)),this._set(`heading`,this._compileHeading(e)),this._set(`lastEditInfo`,this._compileLastEditInfo()||null),this._set(`content`,this._compileContent(t)||null)}catch(e){u(e)||(this._error=e,s.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:i,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){let{_effectivePopupTemplate:r,graphic:i,relatedInfos:a,_fieldInfoMap:o,_graphicExpressionAttributes:s,timeZone:c}=this,l=k(i);n.content[t]=z({attributes:{...s,...e.attributes},fieldInfoMap:o,fieldInfos:r?.fieldInfos,graphic:i,layer:l,relatedInfos:a,timeZone:c})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){if(e.fieldInfos){let{graphic:r,relatedInfos:i,_fieldInfoMap:a,_graphicExpressionAttributes:o,timeZone:s}=this,c=k(r);n.content[t]=z({attributes:{...o,...e.attributes},fieldInfoMap:a,fieldInfos:e.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:c,relatedInfos:i,timeZone:s})}}_createFormattedAttributes(e){let{_effectivePopupTemplate:t,graphic:n,relatedInfos:r,_fieldInfoMap:i,_graphicExpressionAttributes:a,timeZone:o}=this,s=k(n),c=t?.fieldInfos,l={global:z({attributes:a,fieldInfoMap:i,fieldInfos:c,graphic:n,layer:s,relatedInfos:r,timeZone:o}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{e.type===`fields`&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l}),e.type===`media`&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){let{graphic:t,_effectivePopupTemplate:n}=this;return this._queryRelatedInfos(t,j(n),e)}async _queryRelatedInfos(e,t,n){let{relatedInfos:r}=this,i=k(e);r.clear();let a=await i?.associatedLayer?.load(n)??i;if(!a||!e||!t.filter(e=>!!e.fieldName&&B(e.fieldName))?.length)return;t.forEach(e=>this._configureRelatedInfo(e,a));let o=await V({relatedInfos:r,layer:a},n);Object.keys(o).forEach(e=>{let t=r.get(e.toString()),n=o[e]?.value;t&&n&&(t.layerInfo=n.data)});let s=await H({graphic:e,relatedInfos:r,layer:a},n);Object.keys(s).forEach(e=>{U(s[e]?.value,r.get(e.toString()))})}_configureRelatedInfo(e,t){let{relatedInfos:n}=this,r=W(e.fieldName||``);if(!r)return;let{layerId:i,fieldName:a}=r;if(!i)return;let o=n.get(i.toString())||G(i,t);o&&(K({relatedInfo:o,fieldName:a,fieldInfo:e}),this.relatedInfos.set(i,o))}};e([g()],Y.prototype,`_error`,void 0),e([g()],Y.prototype,`_graphicChangedTask`,void 0),e([g()],Y.prototype,`_evaluateExpressionAttributesTask`,void 0),e([g({readOnly:!0})],Y.prototype,`_effectivePopupTemplate`,null),e([g({readOnly:!0})],Y.prototype,`_fieldInfoMap`,null),e([g({type:E})],Y.prototype,`abilities`,void 0),e([g({readOnly:!0})],Y.prototype,`content`,void 0),e([g()],Y.prototype,`description`,void 0),e([g({type:b,readOnly:!0})],Y.prototype,`defaultActions`,null),e([g({type:b})],Y.prototype,`actions`,void 0),e([g()],Y.prototype,`includeDefaultActions`,void 0),e([g({type:b,readOnly:!0})],Y.prototype,`allActions`,null),e([g({type:Boolean})],Y.prototype,`defaultPopupTemplateEnabled`,void 0),e([g({readOnly:!0})],Y.prototype,`expressionAttributes`,void 0),e([g({readOnly:!0})],Y.prototype,`isFeatureFromTable`,null),e([g({readOnly:!0})],Y.prototype,`state`,null),e([g({readOnly:!0})],Y.prototype,`formattedAttributes`,void 0),e([g({type:t})],Y.prototype,`graphic`,void 0),e([g({readOnly:!0})],Y.prototype,`lastEditInfo`,void 0),e([g({type:v})],Y.prototype,`location`,void 0),e([g({readOnly:!0})],Y.prototype,`relatedInfos`,void 0),e([g({type:y})],Y.prototype,`spatialReference`,null),e([g()],Y.prototype,`timeZone`,null),e([g({readOnly:!0})],Y.prototype,`heading`,void 0),e([g()],Y.prototype,`map`,null),e([g({readOnly:!0})],Y.prototype,`waitingForContent`,null),e([g()],Y.prototype,`view`,void 0),Y=J=e([_(`esri.popup.FeatureContent`)],Y);const X=Y;export{X as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{FeatureSetQueryInterceptor as n}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as i}from"../core/arrayUtils.js";import{createTask as a}from"../core/asyncUtils.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import{abortMaybe as c}from"../core/maybe.js";import{eachAlways as l,isAbortError as u,throwIfAborted as d}from"../core/promiseUtils.js";import{watch as f,initial as p,when as m}from"../core/reactiveUtils.js";import{throttle as h}from"../core/throttle.js";import{property as g,subclass as _}from"../core/accessorSupport/decorators.js";import v from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{ActionsCollection as b,createDefaultAggregateActions as x,createDefaultActions as S}from"./actions.js";import C from"./content/TextContent.js";import{compileExpressionInfos as w,formatArcadeValue as T}from"./support/arcadeFeatureUtils.js";import E from"./support/FeatureAbilities.js";import{preLayerQueryCallback as D,preRequestCallback as O,getPopupLayer as k,createFieldInfoMap as A,getAllFieldInfos as j,querySourceLayer as M,queryUpdatedFeature as N,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as F,formatEditInfo as I,substituteFieldsInLinksAndAttributes as L,graphicCallback as R,formatAttributes as z,isRelatedField as B}from"./support/featureUtils.js";import{queryLayerInfos as V,queryRelatedFeatures as H,setRelatedFeatures as U,getRelatedFieldInfo as W,createRelatedInfo as G,updateRelatedInfo as K}from"./support/relatedFeatureUtils.js";import{system as q}from"../time/constants.js";var J;let Y=class extends o(r){static{J=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new E,this.content=null,this.description=null,this.actions=new b,this.includeDefaultActions=!1,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading=``,this.view=null,this._graphicChangedThrottled=h(this._graphicChanged,()=>this.notifyChange(`waitingForContent`),1,this),this._isAllowedContentType=e=>{let{abilities:t}=this;return e.type===`attachments`&&!!t.attachmentsContent||e.type===`custom`&&!!t.customContent||e.type===`fields`&&!!t.fieldsContent||e.type===`media`&&!!t.mediaContent||e.type===`text`&&!!t.textContent||e.type===`expression`&&!!t.expressionContent||e.type===`relationship`&&!!t.relationshipContent||e.type===`utility-network-associations`&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=h(this._evaluateExpressionAttributes,()=>this.notifyChange(`waitingForContent`),1,this),this.addHandles([f(()=>[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(),p),m(()=>{if(!this._graphicChangedTask?.finished||this._graphicChangedTask.value==null)return null;let e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=c(this._graphicChangedTask),this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new n(D,O)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){let e=k(this.graphic);return A(j(this._effectivePopupTemplate),e)}get defaultActions(){let e=this._get(`defaultActions`)||new b;return e.removeAll(),e.addMany(this.graphic?.isAggregate?x():S()),e}get allActions(){let e=this._get(`allActions`)||new b,{actions:t,defaultPopupTemplateEnabled:n,includeDefaultActions:r,graphic:a}=this,o=[];if(a){let e=r?this.defaultActions.concat(t):t,s=typeof a.getEffectivePopupTemplate==`function`&&a.getEffectivePopupTemplate(n)||a.popupTemplate,c=s?.actions;o=(s?.overwriteActions?c:c?.concat(e)??e)?.filter(i).toArray()??[]}let s=e.toArray();return(s.length!==o.length||s.some((e,t)=>e!==o[t]))&&(e.removeAll(),e.addMany(o)),e}get isFeatureFromTable(){return k(this.graphic)?.isTable??!1}get state(){return this.graphic?this._error?`error`:this.waitingForContent?`loading`:`ready`:`disabled`}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get timeZone(){return this.view?.timeZone??q}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get map(){return this.view?.map||null}set map(e){this._override(`map`,e)}get waitingForContent(){let{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:n,_evaluateExpressionAttributesTask:r}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||n!=null&&!n.finished||r!=null&&!r.finished}async updateGeometry(){let{graphic:e,spatialReference:t}=this,n=k(e);await n?.load();let r=n?.objectIdField;if(!r||!e)return;let i=e.attributes?.[r];if(i==null)return;let a=(await M({layer:n,graphic:e,outFields:[],objectIds:[i],returnGeometry:!0,spatialReference:t}))?.geometry;a&&(e.geometry=a)}_clear(){this._set(`heading`,``),this._set(`content`,null),this._set(`formattedAttributes`,null),this._set(`expressionAttributes`,null)}_graphicChanged(){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._graphicChangedTask=c(this._graphicChangedTask),this._graphicChangedTask=a(async e=>{this._error=null,this._clear();let{graphic:t}=this;try{if(!t)return null;let{_effectivePopupTemplate:n}=this,r=k(t),i=this.spatialReference;await N({graphic:t,popupTemplate:n,layer:r,spatialReference:i},{signal:e});let[{value:a},{value:o}]=await l([this._getContent(),this._getTitle()]),[,{value:s}]=await l([this._checkForRelatedFeatures({signal:e}),w(n?.expressionInfos,t)]);return{expressionInfos:s,content:a,heading:o}}catch(e){throw u(e)||(this._error=e,s.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:t,popupTemplate:this._effectivePopupTemplate})),e}})}_compileContentElement(e){let t=k(this.graphic);return e.type===`relationship`?P(t)?e:void 0:e.type===`utility-network-associations`?F(t)?e:void 0:e}_compileContent(e){if(this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map(e=>this._compileContentElement(e)).filter(i):typeof e==`string`?new C({text:e}).text:e}_compileLastEditInfo(){let{_effectivePopupTemplate:e,graphic:t,timeZone:n}=this,r=k(t);if(!e)return;let{lastEditInfoEnabled:i}=e,a=r?.editFieldsInfo;if(i&&a)return I(a,t?.attributes,n,r)}_compileHeading(e){let{_fieldInfoMap:t,graphic:n,expressionAttributes:r}=this,i=k(n),a=n?.attributes??{},o=this.formattedAttributes?.global??{};return L({attributes:a,fieldInfoMap:t,globalAttributes:o,expressionAttributes:r,layer:i,text:e})}async _getTitle(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?R({type:`title`,value:e?.title,event:{graphic:t}}):null}async _getContent(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?R({type:`content`,value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({heading:e,content:t,expressionInfos:n}){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=a(async r=>{let{graphic:i,map:a,view:o,spatialReference:c,location:l}=this;try{if(!i)return;let s;if(n!=null){let e=[];for(let[t,s]of n.expressions.entries())s==null?e.push(Promise.resolve([t,void 0])):e.push(s.evaluate({graphic:i,interceptor:J.interceptor,location:l,map:a,options:{signal:r},spatialReference:c,view:o}).then(e=>[t,typeof e==`string`?T(e):e]).catch(()=>[t,void 0]));s=Object.fromEntries(await Promise.all(e)),d(r)}this._set(`expressionAttributes`,s??null),this._graphicExpressionAttributes={...i.attributes,...s},this._set(`formattedAttributes`,this._createFormattedAttributes(t)),this._set(`heading`,this._compileHeading(e)),this._set(`lastEditInfo`,this._compileLastEditInfo()||null),this._set(`content`,this._compileContent(t)||null)}catch(e){u(e)||(this._error=e,s.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:i,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){let{_effectivePopupTemplate:r,graphic:i,relatedInfos:a,_fieldInfoMap:o,_graphicExpressionAttributes:s,timeZone:c}=this,l=k(i);n.content[t]=z({attributes:{...s,...e.attributes},fieldInfoMap:o,fieldInfos:r?.fieldInfos,graphic:i,layer:l,relatedInfos:a,timeZone:c})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){if(e.fieldInfos){let{graphic:r,relatedInfos:i,_fieldInfoMap:a,_graphicExpressionAttributes:o,timeZone:s}=this,c=k(r);n.content[t]=z({attributes:{...o,...e.attributes},fieldInfoMap:a,fieldInfos:e.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:c,relatedInfos:i,timeZone:s})}}_createFormattedAttributes(e){let{_effectivePopupTemplate:t,graphic:n,relatedInfos:r,_fieldInfoMap:i,_graphicExpressionAttributes:a,timeZone:o}=this,s=k(n),c=t?.fieldInfos,l={global:z({attributes:a,fieldInfoMap:i,fieldInfos:c,graphic:n,layer:s,relatedInfos:r,timeZone:o}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{e.type===`fields`&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l}),e.type===`media`&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){let{graphic:t,_effectivePopupTemplate:n}=this;return this._queryRelatedInfos(t,j(n),e)}async _queryRelatedInfos(e,t,n){let{relatedInfos:r}=this,i=k(e);r.clear();let a=await i?.associatedLayer?.load(n)??i;if(!a||!e||!t.filter(e=>!!e.fieldName&&B(e.fieldName))?.length)return;t.forEach(e=>this._configureRelatedInfo(e,a));let o=await V({relatedInfos:r,layer:a},n);Object.keys(o).forEach(e=>{let t=r.get(e.toString()),n=o[e]?.value;t&&n&&(t.layerInfo=n.data)});let s=await H({graphic:e,relatedInfos:r,layer:a},n);Object.keys(s).forEach(e=>{U(s[e]?.value,r.get(e.toString()))})}_configureRelatedInfo(e,t){let{relatedInfos:n}=this,r=W(e.fieldName||``);if(!r)return;let{layerId:i,fieldName:a}=r;if(!i)return;let o=n.get(i.toString())||G(i,t);o&&(K({relatedInfo:o,fieldName:a,fieldInfo:e}),this.relatedInfos.set(i,o))}};e([g()],Y.prototype,`_error`,void 0),e([g()],Y.prototype,`_graphicChangedTask`,void 0),e([g()],Y.prototype,`_evaluateExpressionAttributesTask`,void 0),e([g({readOnly:!0})],Y.prototype,`_effectivePopupTemplate`,null),e([g({readOnly:!0})],Y.prototype,`_fieldInfoMap`,null),e([g({type:E})],Y.prototype,`abilities`,void 0),e([g({readOnly:!0})],Y.prototype,`content`,void 0),e([g()],Y.prototype,`description`,void 0),e([g({type:b,readOnly:!0})],Y.prototype,`defaultActions`,null),e([g({type:b})],Y.prototype,`actions`,void 0),e([g()],Y.prototype,`includeDefaultActions`,void 0),e([g({type:b,readOnly:!0})],Y.prototype,`allActions`,null),e([g({type:Boolean})],Y.prototype,`defaultPopupTemplateEnabled`,void 0),e([g({readOnly:!0})],Y.prototype,`expressionAttributes`,void 0),e([g({readOnly:!0})],Y.prototype,`isFeatureFromTable`,null),e([g({readOnly:!0})],Y.prototype,`state`,null),e([g({readOnly:!0})],Y.prototype,`formattedAttributes`,void 0),e([g({type:t})],Y.prototype,`graphic`,void 0),e([g({readOnly:!0})],Y.prototype,`lastEditInfo`,void 0),e([g({type:v})],Y.prototype,`location`,void 0),e([g({readOnly:!0})],Y.prototype,`relatedInfos`,void 0),e([g({type:y})],Y.prototype,`spatialReference`,null),e([g()],Y.prototype,`timeZone`,null),e([g({readOnly:!0})],Y.prototype,`heading`,void 0),e([g()],Y.prototype,`map`,null),e([g({readOnly:!0})],Y.prototype,`waitingForContent`,null),e([g()],Y.prototype,`view`,void 0),Y=J=e([_(`esri.popup.FeatureModel`)],Y);const X=Y;export{X as default};
|