@arcgis/map-components 5.2.0-next.164 → 5.2.0-next.166

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.
Files changed (52) hide show
  1. package/dist/cdn/2MPZWW4A.js +2 -0
  2. package/dist/cdn/3IZHAJN7.js +2 -0
  3. package/dist/cdn/73NABILZ.js +2 -0
  4. package/dist/cdn/BPTZ6LBO.js +2 -0
  5. package/dist/cdn/FGQJD346.js +2 -0
  6. package/dist/cdn/OBFJ4JUW.js +2 -0
  7. package/dist/cdn/PLNIKN6E.js +2 -0
  8. package/dist/cdn/RMKPKUPL.js +2 -0
  9. package/dist/cdn/YXFFWLE5.js +2 -0
  10. package/dist/cdn/index.js +1 -1
  11. package/dist/chunks/utils5.js +2 -2
  12. package/dist/components/arcgis-coordinate-conversion/customElement.d.ts +5 -0
  13. package/dist/components/arcgis-coordinate-conversion-next/customElement.d.ts +6 -5
  14. package/dist/components/arcgis-selection-toolbar/customElement.d.ts +8 -0
  15. package/dist/components/arcgis-selection-toolbar/customElement.js +23 -17
  16. package/dist/components/arcgis-time-bar/customElement.d.ts +3 -1
  17. package/dist/components/arcgis-time-bar-slider/customElement.js +9 -5
  18. package/dist/components/arcgis-time-slider/customElement.d.ts +1 -0
  19. package/dist/components/arcgis-time-slider/customElement.js +8 -7
  20. package/dist/components/arcgis-utility-network-trace-aggregated-geometry-result-item/customElement.d.ts +7 -0
  21. package/dist/components/arcgis-utility-network-trace-aggregated-geometry-result-item/customElement.js +8 -5
  22. package/dist/components/arcgis-utility-network-trace-analysis/customElement.d.ts +3 -0
  23. package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +10 -10
  24. package/dist/components/arcgis-utility-network-trace-configuration-picker/customElement.d.ts +125 -12
  25. package/dist/components/arcgis-utility-network-trace-elements-result-item/customElement.d.ts +9 -2
  26. package/dist/components/arcgis-utility-network-trace-elements-result-item/customElement.js +60 -57
  27. package/dist/components/arcgis-utility-network-trace-functions-result-item/customElement.d.ts +7 -0
  28. package/dist/components/arcgis-utility-network-trace-functions-result-item/customElement.js +12 -9
  29. package/dist/components/arcgis-utility-network-trace-inputs/customElement.d.ts +217 -14
  30. package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +119 -108
  31. package/dist/components/arcgis-utility-network-trace-locations/customElement.d.ts +155 -8
  32. package/dist/components/arcgis-utility-network-trace-results/customElement.d.ts +7 -3
  33. package/dist/components/arcgis-utility-network-trace-results/customElement.js +132 -125
  34. package/dist/docs/api.json +1 -1
  35. package/dist/docs/docs.json +1 -1
  36. package/dist/docs/vscode.html-custom-data.json +1 -1
  37. package/dist/docs/web-types.json +1 -1
  38. package/dist/loader.js +4 -4
  39. package/dist/types/lumina.d.ts +1 -1
  40. package/dist/types/preact.d.ts +1 -1
  41. package/dist/types/react.d.ts +1 -1
  42. package/dist/types/stencil.d.ts +1 -1
  43. package/package.json +6 -6
  44. package/dist/cdn/24P3B56P.js +0 -2
  45. package/dist/cdn/4TTVR7UK.js +0 -2
  46. package/dist/cdn/EQX7MHI6.js +0 -2
  47. package/dist/cdn/ERO6VEJC.js +0 -2
  48. package/dist/cdn/JQL6EOCO.js +0 -2
  49. package/dist/cdn/NV6GXURX.js +0 -2
  50. package/dist/cdn/RV2FLHPM.js +0 -2
  51. package/dist/cdn/SYRJ7DOA.js +0 -2
  52. package/dist/cdn/X5PDNDLF.js +0 -2
@@ -6,9 +6,42 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
6
6
  import type { T9nMeta } from "@arcgis/lumina/controllers";
7
7
 
8
8
  /**
9
- * Selects a named trace configuration from a list and displays subnetwork fields from the named trace configuration:
10
- * Domain network name, tier name, and target tier name.
9
+ * The Utility Network Trace Configuration Picker component selects a named trace configuration
10
+ * and, when applicable, a subnetwork name.
11
11
  *
12
+ * To use this component independently, set
13
+ * [utilityNetwork](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#utilityNetwork) to a loaded
14
+ * [UtilityNetwork](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/)
15
+ * and provide its named trace configurations through
16
+ * [traceConfigurations](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#traceConfigurations).
17
+ * The component displays a title for a single configuration or a picker for multiple configurations.
18
+ * Changing the list resets the selection to the first configuration backed by a
19
+ * [UNTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/core/networks/support/UNTraceConfiguration/).
20
+ *
21
+ * Read [selectedNamedTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#selectedNamedTraceConfiguration)
22
+ * for the selection and [traceConfiguration](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#traceConfiguration)
23
+ * for its editable clone. For subnetwork traces with a specified subnetwork name, users can
24
+ * select a compatible subnetwork. The component also displays available domain network,
25
+ * tier, and target tier names for subnetwork-related trace types. This component does not execute traces.
26
+ *
27
+ * Customize the display with [heading](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#heading),
28
+ * [hideSubnetworkInfo](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#hideSubnetworkInfo),
29
+ * [hideErrors](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#hideErrors), and
30
+ * [messageOverrides](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#messageOverrides).
31
+ *
32
+ * @example
33
+ * This example creates a picker that lets users choose from a list of named trace configurations.
34
+ * It assumes `utilityNetwork` is an existing, loaded
35
+ * [UtilityNetwork](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/).
36
+ *
37
+ * Set the required properties before adding the picker to the page. Use the network's
38
+ * [sharedNamedTraceConfigurations](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/#sharedNamedTraceConfigurations) to provide the options users can choose from.
39
+ * ```javascript
40
+ * const picker = document.createElement("arcgis-utility-network-trace-configuration-picker");
41
+ * picker.utilityNetwork = utilityNetwork;
42
+ * picker.traceConfigurations = namedTraceConfigurations;
43
+ * document.body.append(picker);
44
+ * ```
12
45
  * @since 5.2
13
46
  */
14
47
  export abstract class ArcgisUtilityNetworkTraceConfigurationPicker extends LitElement {
@@ -52,15 +85,40 @@ export abstract class ArcgisUtilityNetworkTraceConfigurationPicker extends LitEl
52
85
  traceConfiguration: string;
53
86
  };
54
87
  }>;
88
+ /**
89
+ * The current configuration selection error message, or `undefined` when cleared.
90
+ * The component displays this message unless
91
+ * [hideErrors](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#hideErrors) is `true`.
92
+ * A missing compatible subnetwork can also display a notice without setting this property.
93
+ */
55
94
  accessor error: string | undefined;
95
+ /**
96
+ * The heading above the
97
+ * [traceConfigurations](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#traceConfigurations) selector.
98
+ * When not set, the component uses the localized trace configuration label.
99
+ */
56
100
  accessor heading: string | undefined;
57
- /** @default false */
101
+ /**
102
+ * Indicates whether to hide error notices. Errors still update
103
+ * [error](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#error) and
104
+ * [state](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#state) and emit
105
+ * [@arcgisError](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#event-arcgisError).
106
+ *
107
+ * @default false
108
+ */
58
109
  accessor hideErrors: boolean;
59
- /** @default false */
110
+ /**
111
+ * Indicates whether to hide the domain network, tier, and target tier names from
112
+ * [selectedNamedTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#selectedNamedTraceConfiguration).
113
+ * This does not hide the subnetwork name selector.
114
+ *
115
+ * @default false
116
+ */
60
117
  accessor hideSubnetworkInfo: boolean;
61
118
  /**
62
- * Whether a the user has selected a named trace configuration that executes a
63
- * subnetwork trace with a specified subnetwork name.
119
+ * Indicates whether
120
+ * [selectedNamedTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#selectedNamedTraceConfiguration)
121
+ * executes a subnetwork trace with a specified subnetwork name.
64
122
  *
65
123
  * @default false
66
124
  * @internal
@@ -91,20 +149,75 @@ export abstract class ArcgisUtilityNetworkTraceConfigurationPicker extends LitEl
91
149
  traceConfiguration?: string | undefined;
92
150
  } | undefined;
93
151
  };
152
+ /**
153
+ * The selected
154
+ * [NamedTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/core/networks/support/NamedTraceConfiguration/).
155
+ * Set this property to a configuration from
156
+ * [traceConfigurations](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#traceConfigurations)
157
+ * to select it programmatically. Selecting a configuration creates a new
158
+ * [traceConfiguration](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#traceConfiguration) clone.
159
+ */
94
160
  accessor selectedNamedTraceConfiguration: NamedTraceConfiguration | undefined;
95
- /** @default "ready" */
161
+ /**
162
+ * The current configuration selection state.
163
+ *
164
+ * - `error`: A configuration selection error has set
165
+ * [error](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#error).
166
+ * - `loading`: Compatible subnetwork names are being loaded for the selected configuration.
167
+ * - `ready`: The initial state, also set when a configuration selection error is cleared
168
+ * or compatible subnetwork loading completes.
169
+ *
170
+ * @default "ready"
171
+ */
96
172
  accessor state: "error" | "loading" | "ready";
97
173
  /**
98
- * A clone of the utility network trace configuration associated with
99
- * the selected named trace configuration. Updates on this object are
100
- * used to reflect the user's changes to the named trace configuration.
174
+ * A clone of the
175
+ * [UNTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/core/networks/support/UNTraceConfiguration/)
176
+ * associated with
177
+ * [selectedNamedTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#selectedNamedTraceConfiguration).
178
+ * The component updates this mutable clone when the user changes the subnetwork name,
179
+ * without modifying the original named trace configuration. Read this object when executing
180
+ * a trace to use the current settings. It is `undefined` when no valid configuration is selected.
181
+ *
182
+ * Changes to fields on this object do not emit
183
+ * [@arcgisPropertyChange](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#event-arcgisPropertyChange).
101
184
  */
102
185
  accessor traceConfiguration: UNTraceConfiguration | undefined;
103
- /** @required */
186
+ /**
187
+ * The named trace configurations available for selection. Each configuration must contain a
188
+ * [UNTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/core/networks/support/UNTraceConfiguration/).
189
+ * Changing this array resets
190
+ * [selectedNamedTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#selectedNamedTraceConfiguration)
191
+ * to the first entry backed by a `UNTraceConfiguration`. An empty array displays an error.
192
+ *
193
+ * @required
194
+ */
104
195
  accessor traceConfigurations: NamedTraceConfiguration[];
105
- /** @required */
196
+ /**
197
+ * The loaded
198
+ * [UtilityNetwork](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/)
199
+ * associated with [traceConfigurations](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#traceConfigurations).
200
+ * The component uses its subnetworks table to query compatible subnetwork names.
201
+ * Changing the network clears the cached subnetworks and the current subnetwork name.
202
+ *
203
+ * @required
204
+ */
106
205
  accessor utilityNetwork: UtilityNetwork | undefined;
206
+ /**
207
+ * Fires when the component sets a configuration selection error. Read
208
+ * [error](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#error) for the message.
209
+ * This event has no error payload and fires even when
210
+ * [hideErrors](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#hideErrors) is `true`.
211
+ * A notice about missing compatible subnetworks does not emit this event.
212
+ */
107
213
  readonly arcgisError: import("@arcgis/lumina").TargetedEvent<this, void>;
214
+ /**
215
+ * Fires when
216
+ * [selectedNamedTraceConfiguration](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#selectedNamedTraceConfiguration)
217
+ * or [traceConfiguration](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-configuration-picker/#traceConfiguration) changes.
218
+ * Read `event.detail.name` to identify the property, then read its current value from the component.
219
+ * Changes to fields on the configuration clone, such as the subnetwork name, do not emit this event.
220
+ */
108
221
  readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "selectedNamedTraceConfiguration" | "traceConfiguration"; }>;
109
222
  readonly "@eventTypes": {
110
223
  arcgisError: ArcgisUtilityNetworkTraceConfigurationPicker["arcgisError"]["detail"];
@@ -135,6 +135,13 @@ export abstract class ArcgisUtilityNetworkTraceElementsResultItem extends LitEle
135
135
  * Elements without a matching query layer are not included.
136
136
  */
137
137
  get features(): Graphic[];
138
+ /**
139
+ * Whether the component has content to render.
140
+ *
141
+ * @default false
142
+ * @internal
143
+ */
144
+ get hasContent(): boolean;
138
145
  /**
139
146
  * The label of the elements result item that opens the features list.
140
147
  * If not specified or empty, the component uses its localized default label.
@@ -210,7 +217,7 @@ export abstract class ArcgisUtilityNetworkTraceElementsResultItem extends LitEle
210
217
  resultFeaturesAreHidden?: string | undefined;
211
218
  };
212
219
  /**
213
- * The number of successfully queried features plus unique trace elements without a matching query layer.
220
+ * The number of successfully queried features.
214
221
  *
215
222
  * This value can be lower than the number of elements returned by the trace. For example:
216
223
  * - Trace result elements that only differ by a terminal ID are treated as one feature.
@@ -261,7 +268,7 @@ export abstract class ArcgisUtilityNetworkTraceElementsResultItem extends LitEle
261
268
  /** Permanently destroy the component. */
262
269
  destroy(): Promise<void>;
263
270
  /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
264
- readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "features" | "isFeaturesListShown" | "selectedResultFeature" | "state"; }>;
271
+ readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "features" | "hasContent" | "isFeaturesListShown" | "selectedResultFeature" | "state"; }>;
265
272
  /**
266
273
  * Fires when processing the current trace result finishes, including when a query fails.
267
274
  * The [features](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-elements-result-item/#features) property contains the features
@@ -1,28 +1,27 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as F } from "../../chunks/runtime.js";
2
+ import { c as b } from "../../chunks/runtime.js";
3
3
  import { ref as E } from "lit/directives/ref.js";
4
4
  import { getOrCreateMapValue as v } from "@arcgis/core/applications/Components/featureUtils.js";
5
5
  import { LitElement as L, createEvent as y } from "@arcgis/lumina";
6
- import { usePropertyChange as T, bypassReadOnly as o } from "@arcgis/lumina/controllers";
6
+ import { usePropertyChange as C, bypassReadOnly as o } from "@arcgis/lumina/controllers";
7
7
  import { log as d, composeMissingPropertyMessage as m } from "@arcgis/toolkit/log";
8
- import { css as k, html as f } from "lit";
9
- import { u as I } from "../../chunks/useT9n.js";
10
- import { i as g, l as p, t as c, c as A } from "../../chunks/async-utils.js";
11
- import { c as S, q as P, d as w, e as $ } from "../../chunks/layer-utils.js";
8
+ import { css as T, html as f } from "lit";
9
+ import { u as k } from "../../chunks/useT9n.js";
10
+ import { i as g, l as p, t as u, c as I } from "../../chunks/async-utils.js";
11
+ import { c as A, q as P, d as w, e as S } from "../../chunks/layer-utils.js";
12
12
  import { i as R } from "../../chunks/utils5.js";
13
- const C = k`arcgis-features-next{height:100%}.elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm)}.features-hidden{color:var(--calcite-color-text-3);font-size:var(--calcite-font-size);overflow-wrap:anywhere}`;
13
+ const $ = T`arcgis-features-next{height:100%}.elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm)}.features-hidden{color:var(--calcite-color-text-3);font-size:var(--calcite-font-size);overflow-wrap:anywhere}`;
14
14
  class D extends L {
15
15
  constructor() {
16
- super(...arguments), this._messages = I({ blocking: !0 }), this.#n = !0, this.#i = [], this.#t = [], this.#r = /* @__PURE__ */ new Map(), this.#a = /* @__PURE__ */ new Map(), this.#h = !1, this.#l = /* @__PURE__ */ new Map(), this.#o = /* @__PURE__ */ new Map(), this.#e = [], this._isFeaturesSelected = !1, this.autoDestroyDisabled = !1, this.disableHighlight = !1, this.emitsArcgisResultReady = !0, this.features = [], this.hideActionBar = !1, this.hideFeatureResults = !1, this.hidePlaceholder = !1, this.includeDefaultActionsDisabled = !1, this.layers = [], this.state = "ready", this.arcgisPropertyChange = T()("features", "isFeaturesListShown", "selectedResultFeature", "state"), this.arcgisResultReady = y(), this.arcgisTriggerAction = y();
16
+ super(...arguments), this._messages = k({ blocking: !0 }), this.#o = !0, this.#t = [], this.#i = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#n = !1, this.#h = !1, this.#a = /* @__PURE__ */ new Map(), this.#l = /* @__PURE__ */ new Map(), this.#e = [], this._isFeaturesSelected = !1, this.autoDestroyDisabled = !1, this.disableHighlight = !1, this.emitsArcgisResultReady = !0, this.features = [], this.hideActionBar = !1, this.hideFeatureResults = !1, this.hidePlaceholder = !1, this.includeDefaultActionsDisabled = !1, this.layers = [], this.state = "ready", this.arcgisPropertyChange = C()("features", "hasContent", "isFeaturesListShown", "selectedResultFeature", "state"), this.arcgisResultReady = y(), this.arcgisTriggerAction = y();
17
17
  }
18
18
  static {
19
- this.properties = { _featuresComponentElement: 16, _isFeaturesSelected: 16, actions: 0, autoDestroyDisabled: 5, disableHighlight: 5, emitsArcgisResultReady: 32, features: 32, heading: 1, hideActionBar: 5, hideFeatureResults: 5, hidePlaceholder: 5, includeDefaultActionsDisabled: 5, isFeaturesListShown: 32, layers: 0, messageOverrides: 0, numResults: 32, referenceElement: 1, selectedResultFeature: 32, state: 32, traceResult: 32, utilityNetwork: 32, view: 32 };
19
+ this.properties = { _featuresComponentElement: 16, _isFeaturesSelected: 16, actions: 0, autoDestroyDisabled: 5, disableHighlight: 5, emitsArcgisResultReady: 32, features: 32, hasContent: 32, heading: 1, hideActionBar: 5, hideFeatureResults: 5, hidePlaceholder: 5, includeDefaultActionsDisabled: 5, isFeaturesListShown: 32, layers: 0, messageOverrides: 0, numResults: 32, referenceElement: 1, selectedResultFeature: 32, state: 32, traceResult: 32, utilityNetwork: 32, view: 32 };
20
20
  }
21
21
  static {
22
- this.styles = C;
22
+ this.styles = $;
23
23
  }
24
- #n;
25
- #i;
24
+ #o;
26
25
  get #f() {
27
26
  if (!this.traceResult)
28
27
  return !1;
@@ -30,13 +29,14 @@ class D extends L {
30
29
  return e.length > 0 && !t?.length && !s;
31
30
  }
32
31
  #t;
32
+ #i;
33
33
  #r;
34
- #a;
35
34
  #s;
35
+ #n;
36
36
  #h;
37
+ #a;
37
38
  #l;
38
- #o;
39
- get #c() {
39
+ get #u() {
40
40
  const { parentElement: e } = this.el;
41
41
  if (e && R(e))
42
42
  return e;
@@ -45,24 +45,27 @@ class D extends L {
45
45
  return t.host;
46
46
  }
47
47
  #e;
48
+ get hasContent() {
49
+ return this.numResults > 0 && !this.manager.destroyed && !(this.hideFeatureResults && this.hidePlaceholder);
50
+ }
48
51
  get isFeaturesListShown() {
49
- return this._isFeaturesSelected && !this.hideFeatureResults;
52
+ return this._isFeaturesSelected && !this.hideFeatureResults && this.numResults > 0;
50
53
  }
51
54
  get numResults() {
52
- return this.features.length + this.#i.length;
55
+ return this.features.length;
53
56
  }
54
57
  get selectedResultFeature() {
55
58
  return this._featuresComponentElement?.selectedDrillInFeature ?? this._featuresComponentElement?.selectedFeature ?? void 0;
56
59
  }
57
60
  clearResult() {
58
- this._isFeaturesSelected = !1, this.#s?.abort(), this.#m(), o(() => this.features = []), this.#e = [], this.#i = [], this.#r.clear(), this.#a.clear(), this.#o.clear(), this.#l.clear(), o(() => this.state = "ready");
61
+ this._isFeaturesSelected = !1, this.#s?.abort(), this.#m(), o(() => this.features = []), this.#e = [], this.#i.clear(), this.#r.clear(), this.#l.clear(), this.#a.clear(), o(() => this.state = "ready");
59
62
  }
60
63
  async destroy() {
61
64
  this.clearResult(), await this.manager.destroy(), await this._featuresComponentElement?.destroy();
62
65
  }
63
66
  load() {
64
67
  this.manager.onLifecycle(() => {
65
- const e = this.#c;
68
+ const e = this.#u;
66
69
  if (!e) {
67
70
  d("warn", this, "This component must be used as a child of `arcgis-utility-network-trace-results`.");
68
71
  return;
@@ -76,15 +79,17 @@ class D extends L {
76
79
  }), this.traceResult && this.#d();
77
80
  }
78
81
  willUpdate(e) {
79
- e.has("traceResult") && this.#d(), e.has("disableHighlight") && this.#u();
80
- const t = this.isFeaturesListShown;
81
- t !== this.#h && this.arcgisPropertyChange.emit({ name: "isFeaturesListShown" }), this.#h = t;
82
+ e.has("traceResult") && this.#d(), e.has("disableHighlight") && this.#c();
83
+ const t = this.hasContent;
84
+ t !== this.#n && this.el.isConnected && this.arcgisPropertyChange.emit({ name: "hasContent" }), this.#n = t;
85
+ const s = this.isFeaturesListShown;
86
+ s !== this.#h && this.arcgisPropertyChange.emit({ name: "isFeaturesListShown" }), this.#h = s;
82
87
  }
83
88
  loaded() {
84
89
  this.traceResult && (this.traceResult.elements || d("error", this, m("traceResult.elements")), this.utilityNetwork || d("error", this, m("utilityNetwork")));
85
90
  }
86
91
  #y(e) {
87
- if (e.target !== this.#c)
92
+ if (e.target !== this.#u)
88
93
  return;
89
94
  const { target: t } = e;
90
95
  switch (e.detail.name) {
@@ -102,7 +107,7 @@ class D extends L {
102
107
  #m() {
103
108
  this.#t.forEach(({ handle: e }) => e?.remove()), this.#t = [];
104
109
  }
105
- #u() {
110
+ #c() {
106
111
  this.#t.forEach((e) => {
107
112
  this.disableHighlight ? (e.handle?.remove(), e.handle = void 0) : e.handle = e.layerView.highlight(e.objectIds);
108
113
  });
@@ -116,23 +121,23 @@ class D extends L {
116
121
  #w(e) {
117
122
  if (e == null || !this.#e.length)
118
123
  return;
119
- const t = this.#a.get(e);
124
+ const t = this.#r.get(e);
120
125
  if (t)
121
126
  return t;
122
127
  const s = this.#e.find((r) => "layerId" in r && r.layerId === e);
123
- return s && this.#a.set(e, s), s;
128
+ return s && this.#r.set(e, s), s;
124
129
  }
125
130
  #R() {
126
131
  const { traceResult: e, utilityNetwork: t, view: s } = this;
127
132
  if (!t || !e?.elements?.length || !s)
128
133
  return;
129
- const r = (i) => ($(i.layer) || w(i.layer)) && t.isUtilityLayer(i.layer), n = t.getObjectIdsFromElements(e.elements), h = s.allLayerViews.filter(r);
134
+ const r = (i) => (S(i.layer) || w(i.layer)) && t.isUtilityLayer(i.layer), n = t.getObjectIdsFromElements(e.elements), h = s.allLayerViews.filter(r);
130
135
  n.forEach(({ layerUrl: i, objectIds: l }) => {
131
- const a = Number(i.split("/").pop()), u = h.find(({ layer: b }) => b.layerId === a);
132
- u && this.#t.push({ layerView: u, objectIds: l });
133
- }), this.#u();
136
+ const a = Number(i.split("/").pop()), c = h.find(({ layer: F }) => F.layerId === a);
137
+ c && this.#t.push({ layerView: c, objectIds: l });
138
+ }), this.#c();
134
139
  }
135
- async #b(e) {
140
+ async #F(e) {
136
141
  const { layers: t, utilityNetwork: s, view: r } = this;
137
142
  if (!r || !s)
138
143
  return;
@@ -143,11 +148,11 @@ class D extends L {
143
148
  throw i;
144
149
  p(i, this, "Error while loading the selected utility network");
145
150
  }
146
- c(e), this.#e = t.length ? t.filter((i) => s.isUtilityLayer(i)) : S(r, s);
151
+ u(e), this.#e = t.length ? t.filter((i) => s.isUtilityLayer(i)) : A(r, s);
147
152
  const h = this.#e.filter((i) => !i.loaded).map((i) => i.load({ signal: e }));
148
153
  if (h.length > 0) {
149
154
  const i = await Promise.allSettled(h);
150
- c(e), i.forEach((l) => {
155
+ u(e), i.forEach((l) => {
151
156
  l.status === "rejected" && d("error", this, `Failed to load layer. Reason: ${l.reason}`);
152
157
  });
153
158
  }
@@ -156,13 +161,13 @@ class D extends L {
156
161
  this.clearResult(), this._isFeaturesSelected = this.#f;
157
162
  const e = () => {
158
163
  o(() => this.state = "ready"), this.arcgisResultReady.emit();
159
- }, t = A(async (s) => {
164
+ }, t = I(async (s) => {
160
165
  const r = this.traceResult?.elements;
161
166
  if (!r?.length) {
162
167
  e();
163
168
  return;
164
169
  }
165
- o(() => this.state = "loading"), this.#v(r), await this.#b(s), await this.#E(s), c(s), this.#R(), e();
170
+ o(() => this.state = "loading"), this.#v(r), await this.#F(s), await this.#E(s), u(s), this.#R(), e();
166
171
  });
167
172
  this.#s = t;
168
173
  try {
@@ -173,59 +178,57 @@ class D extends L {
173
178
  this.#s === t && (this.#s = void 0, o(() => this.state = "ready"));
174
179
  }
175
180
  }
176
- async #F([e, t], s) {
177
- c(s);
178
- const r = this.utilityNetwork?.getLayerIdBySourceId(e), n = this.#w(r), h = this.#p(t);
179
- if (r == null || !n) {
180
- this.#i.push(...h);
181
+ async #b([e, t], s) {
182
+ u(s);
183
+ const r = this.utilityNetwork?.getLayerIdBySourceId(e), n = this.#w(r);
184
+ if (r == null || !n)
181
185
  return;
182
- }
183
- const i = n.createQuery();
186
+ const h = this.#p(t), i = n.createQuery();
184
187
  i.gdbVersion = this.utilityNetwork?.gdbVersion, i.objectIds = h.map((a) => a.objectId), i.outFields = ["*"];
185
188
  const { features: l } = await P(n, i, { signal: s });
186
- c(s), l.forEach((a) => {
187
- const u = a.layer;
188
- a.getEffectivePopupTemplate(this.#n) || (a.popupTemplate = u.createPopupTemplate());
189
+ u(s), l.forEach((a) => {
190
+ const c = a.layer;
191
+ a.getEffectivePopupTemplate(this.#o) || (a.popupTemplate = c.createPopupTemplate());
189
192
  }), w(n) ? l.forEach((a) => {
190
- v(this.#o, a.layer.subtypeCode, () => []).push(a);
191
- }) : this.#r.set(r, l);
193
+ v(this.#l, a.layer.subtypeCode, () => []).push(a);
194
+ }) : this.#i.set(r, l);
192
195
  }
193
196
  async #E(e) {
194
- const t = Array.from(this.#l.entries());
197
+ const t = Array.from(this.#a.entries());
195
198
  if (!t.length)
196
199
  return;
197
- const s = t.map((i) => this.#F(i, e)), r = await Promise.allSettled(s);
198
- c(e), r.forEach((i, l) => {
200
+ const s = t.map((i) => this.#b(i, e)), r = await Promise.allSettled(s);
201
+ u(e), r.forEach((i, l) => {
199
202
  if (i.status === "rejected") {
200
203
  const [a] = t[l];
201
204
  d("error", this, `Failed to query features for source ${a}. Reason: ${i.reason}`);
202
205
  }
203
206
  });
204
- const n = Array.from(this.#r.values()), h = Array.from(this.#o.values());
207
+ const n = Array.from(this.#i.values()), h = Array.from(this.#l.values());
205
208
  o(() => this.features = n.concat(h).flat());
206
209
  }
207
210
  #v(e) {
208
- this.#l = Map.groupBy(e, ({ networkSourceId: t }) => t);
211
+ this.#a = Map.groupBy(e, ({ networkSourceId: t }) => t);
209
212
  }
210
213
  #L(e) {
211
214
  const { detail: t } = e;
212
215
  (t.name === "selectedDrillInFeature" || t.name === "selectedFeature") && (e.stopPropagation(), this.arcgisPropertyChange.emit({ name: "selectedResultFeature" }));
213
216
  }
214
- #T(e) {
217
+ #C(e) {
215
218
  e.stopPropagation(), this.arcgisTriggerAction.emit(e.detail);
216
219
  }
217
- #k() {
220
+ #T() {
218
221
  return f`<div class="features-hidden">${this._messages.resultFeaturesAreHidden}</div>`;
219
222
  }
220
- #I() {
223
+ #k() {
221
224
  const { heading: e, _messages: t } = this;
222
225
  return f`<calcite-list .label=${t.headings.features}><calcite-list-item class="elements-list-item" .label=${e || t.headings.features} @calciteListItemSelect=${() => this._isFeaturesSelected = !0}><calcite-chip .label=${t.labels.numFeatures} scale=s slot=content-end>${this.numResults}</calcite-chip><calcite-icon flip-rtl icon=chevron-right slot=content-end></calcite-icon></calcite-list-item></calcite-list>`;
223
226
  }
224
227
  render() {
225
- return !this.traceResult?.elements.length || this.manager.destroyed ? null : this.hideFeatureResults ? this.hidePlaceholder ? null : this.#k() : this.isFeaturesListShown ? f`<arcgis-features-next .actions=${this.actions} .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#n} .features=${this.features} .hideActionBar=${this.hideActionBar} hide-select-feature .includeDefaultActionsDisabled=${this.includeDefaultActionsDisabled} initial-display-mode=list .messageOverrides=${this.messageOverrides} open .referenceElement=${this.referenceElement} .view=${this.view} @arcgisClose=${() => this._isFeaturesSelected = !1} @arcgisPropertyChange=${this.#L} @arcgisTriggerAction=${this.#T} ${E(this.#g)}></arcgis-features-next>` : this.#I();
228
+ return this.hasContent ? this.hideFeatureResults ? this.#T() : this.isFeaturesListShown ? f`<arcgis-features-next .actions=${this.actions} .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#o} .features=${this.features} .hideActionBar=${this.hideActionBar} hide-select-feature .includeDefaultActionsDisabled=${this.includeDefaultActionsDisabled} initial-display-mode=list .messageOverrides=${this.messageOverrides} open .referenceElement=${this.referenceElement} .view=${this.view} @arcgisClose=${() => this._isFeaturesSelected = !1} @arcgisPropertyChange=${this.#L} @arcgisTriggerAction=${this.#C} ${E(this.#g)}></arcgis-features-next>` : this.#k() : null;
226
229
  }
227
230
  }
228
- F("arcgis-utility-network-trace-elements-result-item", D);
231
+ b("arcgis-utility-network-trace-elements-result-item", D);
229
232
  export {
230
233
  D as ArcgisUtilityNetworkTraceElementsResultItem
231
234
  };
@@ -85,6 +85,13 @@ export abstract class ArcgisUtilityNetworkTraceFunctionsResultItem extends LitEl
85
85
  * @default false
86
86
  */
87
87
  get emitsArcgisResultReady(): true;
88
+ /**
89
+ * Whether the component has content to render.
90
+ *
91
+ * @default false
92
+ * @internal
93
+ */
94
+ get hasContent(): boolean;
88
95
  /**
89
96
  * The heading displayed above the function results table.
90
97
  * If not specified or empty, the component uses its localized default heading.
@@ -1,7 +1,7 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { c as g } from "../../chunks/runtime.js";
3
3
  import { LitElement as d, createEvent as R } from "@arcgis/lumina";
4
- import { usePropertyChange as f, bypassReadOnly as a } from "@arcgis/lumina/controllers";
4
+ import { usePropertyChange as f, bypassReadOnly as r } from "@arcgis/lumina/controllers";
5
5
  import { log as i, composeEmptyPropertyMessage as p } from "@arcgis/toolkit/log";
6
6
  import { css as b, html as l } from "lit";
7
7
  import { u as y } from "../../chunks/useT9n.js";
@@ -12,7 +12,7 @@ class v extends d {
12
12
  super(...arguments), this._messages = y({ blocking: !0 }), this.autoDestroyDisabled = !1, this.emitsArcgisResultReady = !0, this.state = "ready", this.arcgisPropertyChange = f()("state"), this.arcgisResultReady = R();
13
13
  }
14
14
  static {
15
- this.properties = { autoDestroyDisabled: 5, emitsArcgisResultReady: 32, heading: 1, messageOverrides: 0, state: 32, traceResult: 32 };
15
+ this.properties = { autoDestroyDisabled: 5, emitsArcgisResultReady: 32, hasContent: 32, heading: 1, messageOverrides: 0, state: 32, traceResult: 32 };
16
16
  }
17
17
  static {
18
18
  this.styles = w;
@@ -25,6 +25,9 @@ class v extends d {
25
25
  if (e instanceof ShadowRoot && c(e.host))
26
26
  return e.host;
27
27
  }
28
+ get hasContent() {
29
+ return !!this.traceResult?.globalFunctionResults.length;
30
+ }
28
31
  clearResult() {
29
32
  }
30
33
  async destroy() {
@@ -37,8 +40,8 @@ class v extends d {
37
40
  i("warn", this, "This component must be used as a child of `arcgis-utility-network-trace-results`.");
38
41
  return;
39
42
  }
40
- const e = (r) => this.#s(r);
41
- return t.addEventListener("arcgisPropertyChange", e), a(() => {
43
+ const e = (a) => this.#s(a);
44
+ return t.addEventListener("arcgisPropertyChange", e), r(() => {
42
45
  this.traceResult = t.traceResult;
43
46
  }), () => {
44
47
  t.removeEventListener("arcgisPropertyChange", e);
@@ -55,16 +58,16 @@ class v extends d {
55
58
  if (t.target !== this.#t)
56
59
  return;
57
60
  const { target: e } = t;
58
- t.detail.name === "traceResult" && a(() => this.traceResult = e.traceResult);
61
+ t.detail.name === "traceResult" && r(() => this.traceResult = e.traceResult);
59
62
  }
60
63
  #e() {
61
- a(() => this.state = "ready"), this.arcgisResultReady.emit();
64
+ r(() => this.state = "ready"), this.arcgisResultReady.emit();
62
65
  }
63
66
  render() {
64
- if (!this.traceResult?.globalFunctionResults.length)
67
+ if (!this.hasContent)
65
68
  return null;
66
- const { heading: t, _messages: e } = this, { globalFunctionResults: r } = this.traceResult;
67
- return l`<div class="functions-heading">${t || e.functions}</div><calcite-table .caption=${e.labels.functionResults}>${r.filter((s) => s.networkAttributeName != null && s.result != null && s.functionType != null).map((s) => {
69
+ const { heading: t, _messages: e } = this, { globalFunctionResults: a } = this.traceResult;
70
+ return l`<div class="functions-heading">${t || e.functions}</div><calcite-table .caption=${e.labels.functionResults}>${a.filter((s) => s.networkAttributeName != null && s.result != null && s.functionType != null).map((s) => {
68
71
  const { functionName: o, networkAttributeName: n, functionType: u, result: h } = s, m = o || `${n} ${u}`;
69
72
  return l`<calcite-table-row><calcite-table-cell>${m}</calcite-table-cell><calcite-table-cell>${h}</calcite-table-cell></calcite-table-row>`;
70
73
  })}</calcite-table>`;