@arcgis/map-components 6.0.0-next.23 → 6.0.0-next.25

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 (61) hide show
  1. package/dist/cdn/{HQXC5XLE.js → 3HI5IZSQ.js} +1 -1
  2. package/dist/cdn/3KAC2MKA.js +2 -0
  3. package/dist/cdn/6GE2WBKV.js +2 -0
  4. package/dist/cdn/{LKKCTKMQ.js → 7U2V3LDM.js} +1 -1
  5. package/dist/cdn/CVLOQWUD.js +2 -0
  6. package/dist/cdn/{NORQIOSX.js → DGXTCH6B.js} +1 -1
  7. package/dist/cdn/E5X5BYWA.js +2 -0
  8. package/dist/cdn/ECF4B24M.js +2 -0
  9. package/dist/cdn/{V7DMA5ZO.js → GZ6UBR6R.js} +1 -1
  10. package/dist/cdn/HADZXZIE.js +2 -0
  11. package/dist/cdn/HTCPPGCR.js +2 -0
  12. package/dist/cdn/LHYI2QBZ.js +2 -0
  13. package/dist/cdn/{4WZ7Y57Q.js → QBRGIFBY.js} +1 -1
  14. package/dist/cdn/QXEOEFF3.js +2 -0
  15. package/dist/cdn/{ZF7NUFAT.js → RT53VCER.js} +1 -1
  16. package/dist/cdn/{AIF4MCBB.js → RXKIZFNQ.js} +1 -1
  17. package/dist/cdn/{TKIWKCDA.js → WU4NDBMC.js} +1 -1
  18. package/dist/cdn/{V3J5GQHD.js → XKGD4N75.js} +1 -1
  19. package/dist/cdn/YITBBUPR.js +2 -0
  20. package/dist/cdn/index.js +1 -1
  21. package/dist/chunks/utils.js +17 -17
  22. package/dist/chunks/utils5.js +2 -2
  23. package/dist/components/arcgis-basemap-gallery/customElement.js +17 -17
  24. package/dist/components/arcgis-basemap-gallery-item/customElement.js +1 -1
  25. package/dist/components/arcgis-coordinate-conversion/customElement.d.ts +5 -0
  26. package/dist/components/arcgis-coordinate-conversion-next/customElement.d.ts +6 -5
  27. package/dist/components/arcgis-scale-bar/customElement.js +11 -11
  28. package/dist/components/arcgis-swipe/customElement.js +43 -43
  29. package/dist/components/arcgis-time-bar/customElement.d.ts +3 -1
  30. package/dist/components/arcgis-time-slider/customElement.d.ts +1 -0
  31. package/dist/components/arcgis-time-slider/customElement.js +8 -7
  32. package/dist/components/arcgis-utility-network-trace-aggregated-geometry-result-item/customElement.d.ts +7 -0
  33. package/dist/components/arcgis-utility-network-trace-aggregated-geometry-result-item/customElement.js +8 -5
  34. package/dist/components/arcgis-utility-network-trace-analysis/customElement.d.ts +3 -0
  35. package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +10 -10
  36. package/dist/components/arcgis-utility-network-trace-configuration-picker/customElement.d.ts +125 -12
  37. package/dist/components/arcgis-utility-network-trace-elements-result-item/customElement.d.ts +9 -2
  38. package/dist/components/arcgis-utility-network-trace-elements-result-item/customElement.js +60 -57
  39. package/dist/components/arcgis-utility-network-trace-functions-result-item/customElement.d.ts +7 -0
  40. package/dist/components/arcgis-utility-network-trace-functions-result-item/customElement.js +12 -9
  41. package/dist/components/arcgis-utility-network-trace-inputs/customElement.d.ts +217 -14
  42. package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +119 -108
  43. package/dist/components/arcgis-utility-network-trace-locations/customElement.d.ts +155 -8
  44. package/dist/components/arcgis-utility-network-trace-results/customElement.d.ts +7 -3
  45. package/dist/components/arcgis-utility-network-trace-results/customElement.js +132 -125
  46. package/dist/docs/api.json +1 -1
  47. package/dist/docs/docs.json +1 -1
  48. package/dist/docs/vscode.html-custom-data.json +1 -1
  49. package/dist/docs/web-types.json +1 -1
  50. package/dist/loader.js +3 -3
  51. package/package.json +6 -6
  52. package/dist/cdn/2WJ53TNR.js +0 -2
  53. package/dist/cdn/5A7LDBDR.js +0 -2
  54. package/dist/cdn/H4BTVLCG.js +0 -2
  55. package/dist/cdn/MNL7ONFB.js +0 -2
  56. package/dist/cdn/NQ3COROI.js +0 -2
  57. package/dist/cdn/QKNHYZYS.js +0 -2
  58. package/dist/cdn/SIT5NBLS.js +0 -2
  59. package/dist/cdn/SLWZHNVT.js +0 -2
  60. package/dist/cdn/SU2SAOBL.js +0 -2
  61. package/dist/cdn/YYCTSS52.js +0 -2
@@ -1,52 +1,55 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import { c as p } from "../../chunks/runtime.js";
2
+ import { c as g } from "../../chunks/runtime.js";
3
3
  import { ref as h } from "lit/directives/ref.js";
4
4
  import c from "@arcgis/core/core/Collection.js";
5
- import { watch as g } from "@arcgis/core/core/reactiveUtils.js";
5
+ import { watch as p } from "@arcgis/core/core/reactiveUtils.js";
6
6
  import { substitute as m } from "@arcgis/core/intl.js";
7
7
  import f from "@arcgis/core/rest/networks/support/TraceLocation.js";
8
8
  import { LitElement as y, createEvent as l } from "@arcgis/lumina";
9
9
  import { usePropertyChange as w } from "@arcgis/lumina/controllers";
10
- import { css as b, html as s } from "lit";
11
- import { u as k } from "../../chunks/useT9n.js";
10
+ import { css as k, html as r } from "lit";
11
+ import { u as b } from "../../chunks/useT9n.js";
12
12
  import { l as u } from "../../chunks/async-utils.js";
13
- import { q as T, i as $ } from "../../chunks/layer-utils.js";
13
+ import { q as T, i as v } from "../../chunks/layer-utils.js";
14
14
  import { ArcgisUtilityNetworkTraceLocations as d } from "../arcgis-utility-network-trace-locations/customElement.js";
15
- const v = b`:host{height:100%;flex-grow:1}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-block-group{flex-grow:1;padding-bottom:var(--calcite-spacing-md);background-color:var(--calcite-color-foreground-1)}calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}calcite-block calcite-combobox,calcite-block calcite-input{margin:0 var(--calcite-spacing-md)}calcite-block calcite-input-message{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md) 0}calcite-notice{margin:var(--calcite-spacing-md)}.subnetwork-info-block{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0}.results-limited-message{padding:var(--calcite-spacing-sm)}.inline-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.add-spatial-mode{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);margin:var(--calcite-spacing-md)}.heading{color:var(--calcite-color-text-1);margin:0 0 var(--calcite-spacing-md);font-size:var(--calcite-font-size);font-weight:var(--calcite-font-weight-medium)}`;
15
+ const $ = k`:host{height:100%;flex-grow:1}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-block-group{flex-grow:1;padding-bottom:var(--calcite-spacing-md);background-color:var(--calcite-color-foreground-1)}calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}calcite-block calcite-combobox,calcite-block calcite-input{margin:0 var(--calcite-spacing-md)}calcite-block calcite-input-message{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md) 0}calcite-notice{margin:var(--calcite-spacing-md)}.subnetwork-info-block{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0}.results-limited-message{padding:var(--calcite-spacing-sm)}.inline-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.add-spatial-mode{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);margin:var(--calcite-spacing-md)}.heading{color:var(--calcite-color-text-1);margin:0 0 var(--calcite-spacing-md);font-size:var(--calcite-font-size);font-weight:var(--calcite-font-weight-medium)}`;
16
16
  class L extends y {
17
17
  constructor() {
18
- super(...arguments), this._messages = k({ blocking: !0 }), this.#c = !0, this.#l = /* @__PURE__ */ new Map(), this.#t = new c(), this.#i = new c(), this.#a = new c(), this.#e = null, this.#s = 20, this._candidateFeatures = [], this._compatibleSubnetworkNames = [], this._namedTraceConfigurations = [], this._subnetworkNamesState = "ready", this._exceedDisplayLimit = !1, this.autoDestroyDisabled = !1, this.hideActionBar = !1, this.includeDefaultActionsDisabled = !1, this.mode = "default", this.arcgisPropertyChange = w()("mode", "selectedNamedTraceConfiguration", "selectedUtilityNetwork", "traceLocations"), this.arcgisTraceLocationSelectEnd = l(), this.arcgisTraceLocationSelectStart = l(), this.arcgisTriggerAction = l();
18
+ super(...arguments), this._messages = b({ blocking: !0 }), this.#n = !0, this.#d = /* @__PURE__ */ new Map(), this.#e = new c(), this.#i = new c(), this.#t = new c(), this.#a = null, this.#r = 20, this._candidateFeatures = [], this._compatibleSubnetworkNames = [], this._namedTraceConfigurations = [], this._subnetworkNamesState = "ready", this._exceedDisplayLimit = !1, this.autoDestroyDisabled = !1, this.hideActionBar = !1, this.includeDefaultActionsDisabled = !1, this.mode = "default", this.arcgisPropertyChange = w()("mode", "selectedNamedTraceConfiguration", "selectedUtilityNetwork", "traceLocations"), this.arcgisTraceLocationSelectEnd = l(), this.arcgisTraceLocationSelectStart = l(), this.arcgisTriggerAction = l();
19
19
  }
20
20
  static {
21
21
  this.properties = { _selectedFeature: 16, _candidateFeatures: 16, _compatibleSubnetworkNames: 16, _subnetworksTable: 16, _namedTraceConfigurations: 16, _traceConfiguration: 16, _error: 16, _subnetworkNamesState: 16, _activeTraceLocationType: 16, _exceedDisplayLimit: 16, actions: 0, beforeMapInteraction: 0, view: 0, selectedUtilityNetwork: 0, selectedNamedTraceConfiguration: 0, autoDestroyDisabled: 5, hideActionBar: 5, includeDefaultActionsDisabled: 5, traceConfiguration: 32, isSubnetworkNameTraceSelected: 32, messageOverrides: 0, referenceElement: 1, mode: 3, traceLocationDetails: 32, traceLocations: 32 };
22
22
  }
23
23
  static {
24
- this.styles = v;
24
+ this.styles = $;
25
25
  }
26
- #c;
27
- get #k() {
26
+ #n;
27
+ get #$() {
28
28
  const { view: e } = this;
29
29
  return e?.map ? e.map.allLayers.toArray().concat(e.map.allTables.toArray()) : [];
30
30
  }
31
- #n;
32
31
  #l;
33
- #t;
32
+ #d;
33
+ #e;
34
34
  #i;
35
+ #t;
35
36
  #a;
36
- #e;
37
- #r;
38
- #u;
39
- #p;
40
- #g;
41
37
  #s;
42
- get #m() {
38
+ #f;
39
+ #y;
40
+ #w;
41
+ #r;
42
+ get #h() {
43
43
  return !this.isSubnetworkNameTraceSelected;
44
44
  }
45
- get #f() {
45
+ get #u() {
46
46
  const e = this.selectedNamedTraceConfiguration?.traceType;
47
47
  return e === "path" || e === "circuit";
48
48
  }
49
- get #T() {
49
+ get #k() {
50
+ return this._namedTraceConfigurations.length > 0 && !!this.traceConfiguration;
51
+ }
52
+ get #L() {
50
53
  const e = this.selectedUtilityNetwork?.dataElement?.domainNetworks;
51
54
  return e ? e.map((t) => t.subnetworkLayerId).filter((t) => t != null && t > -1) : [];
52
55
  }
@@ -58,60 +61,60 @@ class L extends y {
58
61
  return !!e?.traceConfiguration?.subnetworkName && e?.traceType === "subnetwork";
59
62
  }
60
63
  get traceLocationDetails() {
61
- return new c([...this.#t, ...this.#i, ...this.#a]);
64
+ return new c([...this.#e, ...this.#i, ...this.#t]);
62
65
  }
63
66
  get traceLocations() {
64
67
  const e = [];
65
- return this.#m && this.#t.forEach((t) => e.push(...this.#d(t))), this.#f && this.#a.forEach((t) => e.push(...this.#d(t))), this.#i.forEach((t) => e.push(...this.#d(t))), e;
68
+ return this.#h && this.#e.forEach((t) => e.push(...this.#g(t))), this.#u && this.#t.forEach((t) => e.push(...this.#g(t))), this.#i.forEach((t) => e.push(...this.#g(t))), e;
66
69
  }
67
70
  async destroy() {
68
- this.#w(), d.getSketchViewModel(this.view)?.cancel(), d.removeSketchGraphicsLayer(this.view);
71
+ this.#T(), d.getSketchViewModel(this.view)?.cancel(), d.removeSketchGraphicsLayer(this.view);
69
72
  const t = await Promise.allSettled([
70
- this.#r?.destroy(),
71
- this.#u?.destroy(),
72
- this.#p?.destroy(),
73
- this.#g?.destroy()
73
+ this.#s?.destroy(),
74
+ this.#f?.destroy(),
75
+ this.#y?.destroy(),
76
+ this.#w?.destroy()
74
77
  ]);
75
78
  for (const i of t)
76
79
  i.status === "rejected" && u(i.reason, this, "Error while destroying trace inputs");
77
80
  await this.manager.destroy();
78
81
  }
79
82
  load() {
80
- this.#y(), this.manager.onLifecycle(() => [
81
- g(() => this.view?.map, () => this.#y())
83
+ this.#b(), this.manager.onLifecycle(() => [
84
+ p(() => this.view?.map, () => this.#b())
82
85
  ]);
83
86
  }
84
87
  willUpdate(e) {
85
- e.has("selectedUtilityNetwork") && this.#N();
88
+ e.has("selectedUtilityNetwork") && this.#A();
86
89
  }
87
90
  disconnectedCallback() {
88
- super.disconnectedCallback(), this.#l.clear();
91
+ super.disconnectedCallback(), this.#d.clear();
89
92
  }
90
- #$(e) {
93
+ #C(e) {
91
94
  e.stopPropagation(), this.arcgisTriggerAction.emit(e.detail);
92
95
  }
93
- #v({ detail: e, target: t }) {
96
+ #S({ detail: e, target: t }) {
94
97
  (e.name === "selectedDrillInFeature" || e.name === "selectedFeature") && (this._selectedFeature = t.selectedDrillInFeature ?? t.selectedFeature ?? void 0);
95
98
  }
96
- #y() {
99
+ #b() {
97
100
  if (this._error = void 0, !this.view?.map) {
98
101
  this._error = this._messages.errors.noView;
99
102
  return;
100
103
  }
101
104
  }
102
- #L(e) {
103
- e && (this.#u = e);
105
+ #_(e) {
106
+ e && (this.#f = e);
104
107
  }
105
- #C(e) {
106
- e && (this.#p = e);
108
+ #N(e) {
109
+ e && (this.#y = e);
107
110
  }
108
- #S(e) {
109
- e && (this.#g = e);
111
+ #F(e) {
112
+ e && (this.#w = e);
110
113
  }
111
- #_(e) {
112
- e && (this.#r = e);
114
+ #P(e) {
115
+ e && (this.#s = e);
113
116
  }
114
- #d(e) {
117
+ #g(e) {
115
118
  const t = e.flagProperties.selectedTerminals;
116
119
  return e.flagProperties.terminalConfiguration && t?.size ? Array.from(t, (i) => new f({
117
120
  type: e.traceLocation.type,
@@ -121,147 +124,155 @@ class L extends y {
121
124
  terminalId: i
122
125
  })) : [e.traceLocation];
123
126
  }
124
- #w() {
125
- const { view: e } = this;
126
- this.#t.forEach((t) => {
127
- t.spatialProperties.flagGraphic && e?.graphics.remove(t.spatialProperties.flagGraphic);
128
- }), this.#t.removeAll(), this.#i.forEach((t) => {
129
- t.spatialProperties.flagGraphic && e?.graphics.remove(t.spatialProperties.flagGraphic);
130
- }), this.#i.removeAll(), this.#a.forEach((t) => {
131
- t.spatialProperties.flagGraphic && e?.graphics.remove(t.spatialProperties.flagGraphic);
132
- }), this.#a.removeAll();
133
- }
134
- async #N() {
127
+ #T() {
128
+ this.#c(new c([...this.#e, ...this.#i, ...this.#t])), this.#e.removeAll(), this.#i.removeAll(), this.#t.removeAll();
129
+ }
130
+ async #A() {
135
131
  const { selectedUtilityNetwork: e } = this;
136
132
  try {
137
133
  e && !e.loaded && await e.load();
138
134
  } catch (t) {
139
135
  u(t, this, "Error while loading the selected utility network");
140
136
  }
141
- this.#P(), this.#F(), this.#w();
137
+ this.#U(), this.#E(), this.#T();
138
+ }
139
+ #D() {
140
+ if (!this.#k) {
141
+ this.#c(new c([...this.#e, ...this.#i, ...this.#t]));
142
+ return;
143
+ }
144
+ this.#p(this.#i), this.#h ? this.#p(this.#e) : this.#c(this.#e), this.#u ? this.#p(this.#t) : this.#c(this.#t);
142
145
  }
143
- #P() {
146
+ #U() {
144
147
  this._traceConfiguration = void 0, this.selectedNamedTraceConfiguration = void 0, this._namedTraceConfigurations = this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.filter(Boolean).filter((e) => e.traceType !== "circuit").sort((e, t) => e.title.localeCompare(t.title)) || [];
145
148
  }
146
- #F() {
149
+ #E() {
147
150
  const { selectedUtilityNetwork: e } = this;
148
- this.#n = new c(this.#k.filter((t) => e?.isUtilityLayer(t) && !this.#T.includes(t.layerId)));
151
+ this.#l = new c(this.#$.filter((t) => e?.isUtilityLayer(t) && !this.#L.includes(t.layerId)));
149
152
  }
150
- #A(e) {
153
+ #I(e) {
151
154
  if (e.stopPropagation(), this.arcgisTraceLocationSelectStart.emit(e.detail).defaultPrevented) {
152
155
  e.preventDefault();
153
156
  return;
154
157
  }
155
158
  this._activeTraceLocationType = e?.target?.traceLocationType, this.mode = "add-spatial-instructions";
156
159
  }
157
- #D(e) {
160
+ #M(e) {
158
161
  if (e == null)
159
162
  return;
160
- const t = this.#l, i = this.#n, a = t.get(e);
163
+ const t = this.#d, i = this.#l, a = t.get(e);
161
164
  if (a)
162
165
  return a;
163
166
  if (!i)
164
167
  return;
165
- const r = i.find((o) => "layerId" in o && o.layerId === e);
166
- return r && t.set(e, r), r;
168
+ const s = i.find((o) => "layerId" in o && o.layerId === e);
169
+ return s && t.set(e, s), s;
167
170
  }
168
- async #E(e, t) {
171
+ async #x(e, t) {
169
172
  const i = e.createQuery();
170
- i.gdbVersion = this.selectedUtilityNetwork?.gdbVersion, i.objectIds = t.map((r) => r.getObjectId()), i.outFields = ["*"];
173
+ i.gdbVersion = this.selectedUtilityNetwork?.gdbVersion, i.objectIds = t.map((s) => s.getObjectId()), i.outFields = ["*"];
171
174
  const { features: a } = await T(e, i);
172
- return a.forEach((r) => {
173
- if (!r.getEffectivePopupTemplate(this.#c)) {
174
- const o = r.layer;
175
- r.popupTemplate = o.createPopupTemplate();
175
+ return a.forEach((s) => {
176
+ if (!s.getEffectivePopupTemplate(this.#n)) {
177
+ const o = s.layer;
178
+ s.popupTemplate = o.createPopupTemplate();
176
179
  }
177
180
  }), a;
178
181
  }
179
- async #U(e) {
182
+ async #B(e) {
180
183
  const t = /* @__PURE__ */ new Map(), i = [];
181
184
  return e.forEach((a) => {
182
- const r = $(a.layer) ? a.layer.parent : a.layer;
183
- if (r) {
184
- const o = this.#D(r.layerId);
185
+ const s = v(a.layer) ? a.layer.parent : a.layer;
186
+ if (s) {
187
+ const o = this.#M(s.layerId);
185
188
  if (o) {
186
189
  const n = t.get(o) || [];
187
190
  n.push(a), t.set(o, n);
188
191
  }
189
192
  }
190
193
  }), await Promise.all(Array.from(t.keys()).map(async (a) => {
191
- const r = t.get(a) ?? [], o = await this.#E(a, r);
194
+ const s = t.get(a) ?? [], o = await this.#x(a, s);
192
195
  i.push(...o);
193
196
  })), i;
194
197
  }
195
- async #I(e) {
196
- return this._exceedDisplayLimit = e.length > this.#s, this._candidateFeatures = await this.#U(e.slice(0, this.#s)), this._candidateFeatures.length === 0 ? (this.#o(), await Promise.reject(Error("No features found"))) : (this._candidateFeatures.length === 1 && (this._selectedFeature = this._candidateFeatures.at(0)), this.mode = "add-spatial-feature", this.#e?.reject(), this.#e = Promise.withResolvers(), await this.#e.promise);
198
+ async #O(e) {
199
+ return this._exceedDisplayLimit = e.length > this.#r, this._candidateFeatures = await this.#B(e.slice(0, this.#r)), this._candidateFeatures.length === 0 ? (this.#o(), await Promise.reject(Error("No features found"))) : (this._candidateFeatures.length === 1 && (this._selectedFeature = this._candidateFeatures.at(0)), this.mode = "add-spatial-feature", this.#a?.reject(), this.#a = Promise.withResolvers(), await this.#a.promise);
197
200
  }
198
- #x(e) {
201
+ #V(e) {
199
202
  e.stopPropagation(), this.arcgisTraceLocationSelectEnd.emit(), this._activeTraceLocationType = void 0, this.mode = "default", this.#o();
200
203
  }
201
204
  #o(e) {
202
- e?.stopPropagation(), this.#r?.clear(), this.#b(), (this.view ? d.getSketchViewModel(this.view) : null)?.cancel();
205
+ e?.stopPropagation(), this.#s?.clear(), this.#v(), (this.view ? d.getSketchViewModel(this.view) : null)?.cancel();
203
206
  }
204
- #b() {
205
- this.mode = "default", this._candidateFeatures = [], this._selectedFeature = void 0, this.#e?.reject(), this.#e = null;
207
+ #v() {
208
+ this.mode = "default", this._candidateFeatures = [], this._selectedFeature = void 0, this.#a?.reject(), this.#a = null;
206
209
  }
207
- #M() {
208
- const e = this.#e, t = this.#r, { _selectedFeature: i } = this;
210
+ #G() {
211
+ const e = this.#a, t = this.#s, { _selectedFeature: i } = this;
209
212
  if (e && t) {
210
213
  if (!i)
211
214
  return;
212
- e.resolve(i), this.#e = null;
215
+ e.resolve(i), this.#a = null;
213
216
  }
214
217
  }
215
- #B(e, t = !1, i) {
216
- return s`<calcite-notice .closable=${t} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${e}</div></calcite-notice>`;
218
+ #p(e) {
219
+ const t = e.map(({ spatialProperties: i }) => i.flagGraphic).filter((i) => i !== void 0 && !this.view?.graphics.includes(i));
220
+ this.view?.graphics.addMany(t);
221
+ }
222
+ #c(e) {
223
+ const t = e.map(({ spatialProperties: i }) => i.flagGraphic).filter((i) => i !== void 0);
224
+ this.view?.graphics.removeMany(t);
217
225
  }
218
- #O() {
226
+ #R(e, t = !1, i) {
227
+ return r`<calcite-notice .closable=${t} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${e}</div></calcite-notice>`;
228
+ }
229
+ #j() {
219
230
  const { _namedTraceConfigurations: e, selectedUtilityNetwork: t } = this;
220
- return s`<arcgis-utility-network-trace-configuration-picker .messageOverrides=${this.messageOverrides} .traceConfigurations=${e} .utilityNetwork=${t} @arcgisPropertyChange=${(i) => {
221
- i.stopPropagation(), i.detail.name === "selectedNamedTraceConfiguration" && (this.selectedNamedTraceConfiguration = i.target.selectedNamedTraceConfiguration), i.detail.name === "traceConfiguration" && (this._traceConfiguration = i.target.traceConfiguration);
231
+ return r`<arcgis-utility-network-trace-configuration-picker .messageOverrides=${this.messageOverrides} .traceConfigurations=${e} .utilityNetwork=${t} @arcgisPropertyChange=${(i) => {
232
+ i.stopPropagation(), i.detail.name === "selectedNamedTraceConfiguration" ? (this.selectedNamedTraceConfiguration = i.target.selectedNamedTraceConfiguration, this.#D()) : i.detail.name === "traceConfiguration" && (this._traceConfiguration = i.target.traceConfiguration);
222
233
  }}></arcgis-utility-network-trace-configuration-picker>`;
223
234
  }
224
- #V() {
235
+ #q() {
225
236
  const { selectedUtilityNetwork: e, view: t } = this;
226
- return s`<arcgis-utility-network-picker .messageOverrides=${this.messageOverrides} .selectedUtilityNetwork=${e} .view=${t} @arcgisPropertyChange=${(i) => {
237
+ return r`<arcgis-utility-network-picker .messageOverrides=${this.messageOverrides} .selectedUtilityNetwork=${e} .view=${t} @arcgisPropertyChange=${(i) => {
227
238
  i.detail.name === "selectedUtilityNetwork" && (this.selectedUtilityNetwork = i.target.selectedUtilityNetwork);
228
239
  }}></arcgis-utility-network-picker>`;
229
240
  }
230
- #G() {
241
+ #z() {
231
242
  const { _error: e } = this, { noView: t } = this._messages.errors;
232
243
  let i;
233
- return e === t ? i = this.#B(e, !1, "exclamation-mark-triangle") : i = this.#z(), s`<calcite-flow-item .selected=${this.mode === "default"}>${i}</calcite-flow-item>`;
244
+ return e === t ? i = this.#R(e, !1, "exclamation-mark-triangle") : i = this.#J(), r`<calcite-flow-item .selected=${this.mode === "default"}>${i}</calcite-flow-item>`;
234
245
  }
235
- #j() {
246
+ #H() {
236
247
  const { _messages: e, mode: t } = this, i = this._activeTraceLocationType === "starting-point" ? e.labels.addSpatial.startingPoint : this._activeTraceLocationType === "barrier" ? e.labels.addSpatial.barrier : e.labels.addSpatial.stoppingPoint;
237
- return s`<calcite-flow-item .selected=${t === "add-spatial-instructions"} .heading=${i} @calciteFlowItemBack=${(a) => this.#o(a)}><div class="add-spatial-mode"><div><h5 class="heading">${e.instructions.addSpatial.selectFeature.heading}</h5>${e.instructions.addSpatial.selectFeature.subheading}</div><div><h5 class="heading">${e.instructions.addSpatial.selectAssociatedFeature.heading}</h5>${e.instructions.addSpatial.selectAssociatedFeature.subheading}</div></div></calcite-flow-item>`;
248
+ return r`<calcite-flow-item .selected=${t === "add-spatial-instructions"} .heading=${i} @calciteFlowItemBack=${(a) => this.#o(a)}><div class="add-spatial-mode"><div><h5 class="heading">${e.instructions.addSpatial.selectFeature.heading}</h5>${e.instructions.addSpatial.selectFeature.subheading}</div><div><h5 class="heading">${e.instructions.addSpatial.selectAssociatedFeature.heading}</h5>${e.instructions.addSpatial.selectAssociatedFeature.subheading}</div></div></calcite-flow-item>`;
238
249
  }
239
- #q() {
250
+ #Q() {
240
251
  const { _activeTraceLocationType: e, _candidateFeatures: t, _messages: i } = this;
241
252
  if (!t.length)
242
253
  return this.mode = "default", null;
243
- const a = e === "starting-point" ? i.labels.addSpatial.startingPoint : e === "barrier" ? i.labels.addSpatial.barrier : i.labels.addSpatial.stoppingPoint, r = t.length === 1 ? "feature" : "list";
244
- return s`<arcgis-features-next .actions=${this.actions} .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#c} .features=${this._candidateFeatures} .featureMenuTitle=${a} .hideActionBar=${this.hideActionBar} hide-select-feature .includeDefaultActionsDisabled=${this.includeDefaultActionsDisabled} .initialDisplayMode=${r} .messageOverrides=${this.messageOverrides} @arcgisClose=${() => this.#b()} @arcgisPropertyChange=${this.#v} @arcgisTriggerAction=${this.#$} open .referenceElement=${this.referenceElement} .view=${this.view} ${h(this.#_)}></arcgis-features-next>`;
254
+ const a = e === "starting-point" ? i.labels.addSpatial.startingPoint : e === "barrier" ? i.labels.addSpatial.barrier : i.labels.addSpatial.stoppingPoint, s = t.length === 1 ? "feature" : "list";
255
+ return r`<arcgis-features-next .actions=${this.actions} .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#n} .features=${this._candidateFeatures} .featureMenuTitle=${a} .hideActionBar=${this.hideActionBar} hide-select-feature .includeDefaultActionsDisabled=${this.includeDefaultActionsDisabled} .initialDisplayMode=${s} .messageOverrides=${this.messageOverrides} @arcgisClose=${() => this.#v()} @arcgisPropertyChange=${this.#S} @arcgisTriggerAction=${this.#C} open .referenceElement=${this.referenceElement} .view=${this.view} ${h(this.#P)}></arcgis-features-next>`;
245
256
  }
246
- #R() {
247
- const { mode: e, _messages: t, _selectedFeature: i, selectedUtilityNetwork: a } = this, r = e === "add-spatial-feature" && this._exceedDisplayLimit && !i, o = m(t.warnings.exceededDisplayLimit, {
248
- limit: this.#s.toString()
257
+ #W() {
258
+ const { mode: e, _messages: t, _selectedFeature: i, selectedUtilityNetwork: a } = this, s = e === "add-spatial-feature" && this._exceedDisplayLimit && !i, o = m(t.warnings.exceededDisplayLimit, {
259
+ limit: this.#r.toString()
249
260
  }), n = i ? !(a?.isUtilityLayer(i.layer) ?? !0) : !0;
250
- return s`${r && s`<calcite-input-message class="results-limited-message" icon=exclamation-mark-circle status=idle>${o}</calcite-input-message>` || ""}<calcite-button appearance=outline width=full @click=${() => this.#o()} slot=footer>${t.buttons.cancel}</calcite-button>${e === "add-spatial-feature" && s`<calcite-button width=full slot=footer appearance=solid @click=${() => this.#M()} .disabled=${n}>${t.buttons.add}</calcite-button>` || ""}`;
261
+ return r`${s && r`<calcite-input-message class="results-limited-message" icon=exclamation-mark-circle status=idle>${o}</calcite-input-message>` || ""}<calcite-button appearance=outline width=full @click=${() => this.#o()} slot=footer>${t.buttons.cancel}</calcite-button>${e === "add-spatial-feature" && r`<calcite-button width=full slot=footer appearance=solid @click=${() => this.#G()} .disabled=${n}>${t.buttons.add}</calcite-button>` || ""}`;
251
262
  }
252
- #h(e, t, i) {
253
- return s`<arcgis-utility-network-trace-locations .messageOverrides=${this.messageOverrides} .view=${this.view} .traceLocationType=${e} .beforeMapInteraction=${this.beforeMapInteraction} @arcgisTraceLocationSelectStart=${this.#A} @arcgisTraceLocationSelectEnd=${this.#x} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#n} .traceLocations=${t} .afterMapInteraction=${this.#I.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(i)}></arcgis-utility-network-trace-locations>`;
263
+ #m(e, t, i) {
264
+ return r`<arcgis-utility-network-trace-locations .messageOverrides=${this.messageOverrides} .view=${this.view} .traceLocationType=${e} .beforeMapInteraction=${this.beforeMapInteraction} @arcgisTraceLocationSelectStart=${this.#I} @arcgisTraceLocationSelectEnd=${this.#V} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#l} .traceLocations=${t} .afterMapInteraction=${this.#O.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(i)}></arcgis-utility-network-trace-locations>`;
254
265
  }
255
- #z() {
256
- const { _messages: e } = this, t = this.#V(), i = this.#O(), a = this._namedTraceConfigurations.length && this.traceConfiguration ? s`${this.#m ? this.#h("starting-point", this.#t, this.#L) : null}${this.#f ? this.#h("stopping-point", this.#a, this.#S) : null}${this.#h("barrier", this.#i, this.#C)}` : null, r = this.selectedUtilityNetwork?.loaded ? s`${i}${a}` : null;
257
- return s`<calcite-block-group .label=${e.labels.traceInputs}>${t}${r}</calcite-block-group>`;
266
+ #J() {
267
+ const { _messages: e } = this, t = this.#q(), i = this.#j(), a = this.#k ? r`${this.#h ? this.#m("starting-point", this.#e, this.#_) : null}${this.#u ? this.#m("stopping-point", this.#t, this.#F) : null}${this.#m("barrier", this.#i, this.#N)}` : null, s = this.selectedUtilityNetwork?.loaded ? r`${i}${a}` : null;
268
+ return r`<calcite-block-group .label=${e.labels.traceInputs}>${t}${s}</calcite-block-group>`;
258
269
  }
259
270
  render() {
260
271
  const { mode: e } = this;
261
- return s`<calcite-panel>${e === "add-spatial-feature" ? this.#q() : null}<calcite-flow .hidden=${e === "add-spatial-feature"}>${this.#G()}${this.#j()}</calcite-flow>${e !== "default" ? this.#R() : null}</calcite-panel>`;
272
+ return r`<calcite-panel>${e === "add-spatial-feature" ? this.#Q() : null}<calcite-flow .hidden=${e === "add-spatial-feature"}>${this.#z()}${this.#H()}</calcite-flow>${e !== "default" ? this.#W() : null}</calcite-panel>`;
262
273
  }
263
274
  }
264
- p("arcgis-utility-network-trace-inputs", L);
275
+ g("arcgis-utility-network-trace-inputs", L);
265
276
  export {
266
277
  L as ArcgisUtilityNetworkTraceInputs
267
278
  };
@@ -12,9 +12,59 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
12
12
  import type { T9nMeta } from "@arcgis/lumina/controllers";
13
13
 
14
14
  /**
15
- * This is a sub-component used by the **ArcgisUtilityNetworkTraceAnalysis** component.
16
- * It allows users to select locations on the map to use as trace inputs.
15
+ * The Utility Network Trace Locations component selects and manages trace locations.
16
+ * Users can add locations from the map, remove individual locations, clear the list, select
17
+ * terminals, and configure filter barriers where applicable. This component does not execute traces.
17
18
  *
19
+ * To use this component independently, set
20
+ * [view](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#view) to a ready map view,
21
+ * [utilityNetwork](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#utilityNetwork) to its loaded utility network,
22
+ * and [filterLayers](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#filterLayers) to the network layers
23
+ * available for selection. Use
24
+ * [traceLocationType](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#traceLocationType) to choose starting points,
25
+ * barriers, or stopping points. Selected locations and their display information are stored in
26
+ * [traceLocations](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#traceLocations).
27
+ *
28
+ * Use [heading](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#heading) to customize the heading and
29
+ * [messageOverrides](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#messageOverrides) to customize messages.
30
+ * [spatialTolerance](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#spatialTolerance) controls duplicate
31
+ * detection along the same line feature. Listen for
32
+ * [@arcgisError](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#event-arcgisError) and read
33
+ * [error](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#error) for selection errors.
34
+ * [autoDestroyDisabled](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#autoDestroyDisabled) controls automatic
35
+ * destruction when the component is removed from the DOM.
36
+ *
37
+ * @example
38
+ * Display starting-point controls for a web map containing a utility network and its layers.
39
+ * ```html
40
+ * <arcgis-map id="trace-map" item-id="471eb0bf37074b1fbb972b1da70fb310"></arcgis-map>
41
+ * <arcgis-utility-network-trace-locations heading="Starting points">
42
+ * </arcgis-utility-network-trace-locations>
43
+ * ```
44
+ *
45
+ * After importing the map and trace locations components, initialize the controls with the
46
+ * web map's utility network and its feature layers. The web map may require authentication.
47
+ * ```js
48
+ * const mapElement = document.getElementById("trace-map");
49
+ * const locations = document.querySelector("arcgis-utility-network-trace-locations");
50
+ * await Promise.all([mapElement.viewOnReady(), locations.componentOnReady()]);
51
+ *
52
+ * const utilityNetwork = mapElement.map.utilityNetworks.at(0);
53
+ * await utilityNetwork.load();
54
+ *
55
+ * locations.view = mapElement.view;
56
+ * locations.utilityNetwork = utilityNetwork;
57
+ * locations.filterLayers = mapElement.map.allLayers.filter(
58
+ * (layer) =>
59
+ * utilityNetwork.isUtilityLayer(layer) &&
60
+ * (layer.type === "feature" || layer.type === "subtype-group"),
61
+ * );
62
+ * locations.traceLocationType = "starting-point";
63
+ *
64
+ * locations.addEventListener("arcgisTraceLocationSelectEnd", () => {
65
+ * console.log("Current trace location details:", locations.traceLocations.toArray());
66
+ * });
67
+ * ```
18
68
  * @since 5.2
19
69
  */
20
70
  export abstract class ArcgisUtilityNetworkTraceLocations extends LitElement {
@@ -121,8 +171,36 @@ export abstract class ArcgisUtilityNetworkTraceLocations extends LitElement {
121
171
  * @internal
122
172
  */
123
173
  accessor beforeMapInteraction: (() => Promise<void>) | undefined;
174
+ /**
175
+ * The most recent selection error or warning reported through
176
+ * [@arcgisError](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#event-arcgisError).
177
+ * Read this property when the event fires to display feedback to users or
178
+ * record it for troubleshooting, such as explaining why a trace location could not be added.
179
+ *
180
+ * This message is not rendered by the component and is not automatically cleared after
181
+ * a successful selection. It is `undefined` until a message is assigned.
182
+ *
183
+ * @since 5.2
184
+ */
124
185
  accessor error: string | undefined;
186
+ /**
187
+ * The utility network layers users can select trace locations from. These layers also provide features
188
+ * for snapping, helping users select locations accurately.
189
+ *
190
+ * Set this collection to the network's feature layers or subtype group
191
+ * layers before users start selecting locations. For subtype group layers, the component uses their
192
+ * sublayers for snapping. The collection is initially empty.
193
+ *
194
+ * @since 5.2
195
+ */
125
196
  accessor filterLayers: Collection<Layer>;
197
+ /**
198
+ * The heading displayed above the location controls. When `undefined`, the component uses
199
+ * a localized heading for the current
200
+ * [traceLocationType](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#traceLocationType).
201
+ *
202
+ * @since 5.2
203
+ */
126
204
  accessor heading: string | undefined;
127
205
  /**
128
206
  * Replace localized message strings with your own strings.
@@ -166,12 +244,62 @@ export abstract class ArcgisUtilityNetworkTraceLocations extends LitElement {
166
244
  };
167
245
  /** @internal */
168
246
  get sketchViewModel(): SketchViewModel | null;
169
- /** @default 0.05 */
247
+ /**
248
+ * Controls how close two trace locations can be along the same polyline feature before they are
249
+ * treated as duplicates. Use a smaller value to allow locations closer together, or a larger value
250
+ * to keep them farther apart.
251
+ *
252
+ * This value is a fraction of the polyline's length, not a distance in map units. With the default
253
+ * value of `0.05`, an attempt to add a new trace location is rejected if another trace location is
254
+ * found within five percent of the polyline's total length, measured along the same polyline.
255
+ * Trace locations placed exactly at that distance are also rejected.
256
+ *
257
+ * Locations are compared using their
258
+ * [percentAlong](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TraceLocation/#percentAlong)
259
+ * values. This tolerance does not apply to point or polygon features, for which a second location
260
+ * on the same feature is rejected.
261
+ *
262
+ * @default 0.05
263
+ * @since 5.2
264
+ */
170
265
  accessor spatialTolerance: number;
266
+ /**
267
+ * The selected trace locations and the information used to display them.
268
+ * Use this collection to read the trace locations users have selected, prepare inputs for a trace,
269
+ * or display details about those locations.
270
+ *
271
+ * The collection is initially empty. Each entry contains a
272
+ * [TraceLocation](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TraceLocation/),
273
+ * display properties such as the title and selected terminal IDs, and spatial information such as
274
+ * the selected feature and its map marker.
275
+ *
276
+ * Adding or removing locations through the component's UI updates this collection and the map markers.
277
+ *
278
+ * When a user selects terminals, these choices are stored in `flagProperties.selectedTerminals`; they do not
279
+ * . create a separate `traceLocation` for each selected terminal. When constructing trace inputs, account for
280
+ * the selected terminals rather than using only each entry's `traceLocation.terminalId`.
281
+ *
282
+ * @since 5.2
283
+ */
171
284
  accessor traceLocations: Collection<TraceLocationDetails>;
172
- /** @default "starting-point" */
285
+ /**
286
+ * The type assigned to newly selected trace locations. Also determines the default heading,
287
+ * selection button text, and map marker symbol. Changing this property does not change the
288
+ * type of locations already in [traceLocations](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#traceLocations).
289
+ *
290
+ * @default "starting-point"
291
+ * @since 5.2
292
+ */
173
293
  accessor traceLocationType: TraceLocationType;
174
- /** @required */
294
+ /**
295
+ * The utility network used to obtain terminal configurations and identify network sources
296
+ * when creating trace locations. Set this property to a loaded
297
+ * [UtilityNetwork](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/)
298
+ * before selecting locations. The component does not load the utility network.
299
+ *
300
+ * @required
301
+ * @since 5.2
302
+ */
175
303
  accessor utilityNetwork: UtilityNetwork | undefined;
176
304
  /**
177
305
  * The view associated with the component.
@@ -180,12 +308,31 @@ export abstract class ArcgisUtilityNetworkTraceLocations extends LitElement {
180
308
  accessor view: MapView | undefined;
181
309
  /** Permanently destroy the component. */
182
310
  destroy(): Promise<void>;
311
+ /**
312
+ * Fires when the component reports a selection error or warning, such as a duplicate location
313
+ * or a map hit test with no usable results. Read
314
+ * [error](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#error) for the message.
315
+ * The event does not include error details and does not report every failure logged by the component.
316
+ *
317
+ * @since 5.2
318
+ */
183
319
  readonly arcgisError: import("@arcgis/lumina").TargetedEvent<this, void>;
184
- /** Fires when the user completes the selection of a trace location. */
320
+ /**
321
+ * Fires when map selection ends, including when a location is added or selection is canceled.
322
+ * It can also fire when selection ends without adding a location because no usable feature
323
+ * is available. Read [traceLocations](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-locations/#traceLocations)
324
+ * for the current locations; this event does not guarantee that a location was added.
325
+ *
326
+ * @since 5.2
327
+ */
185
328
  readonly arcgisTraceLocationSelectEnd: import("@arcgis/lumina").TargetedEvent<this, void>;
186
329
  /**
187
- * Fires when the user begins selection of a trace location.
188
- * Can be prevented to stop the selection.
330
+ * Fires before starting map selection for a trace location. Call `preventDefault()` on the
331
+ * event to prevent selection from starting. The event's `detail.cancelSelect` callback
332
+ * cancels the sketch after selection has started. This event also fires when the component
333
+ * restarts selection after an unsuccessful attempt.
334
+ *
335
+ * @since 5.2
189
336
  */
190
337
  readonly arcgisTraceLocationSelectStart: import("@arcgis/lumina").TargetedEvent<this, SelectStartPayload>;
191
338
  readonly "@eventTypes": {
@@ -217,10 +217,12 @@ export abstract class ArcgisUtilityNetworkTraceResults extends LitElement {
217
217
  /** The description displayed below the component's localized trace results heading. */
218
218
  accessor heading: string | undefined;
219
219
  /**
220
- * Whether to hide the action bar when viewing trace result features.
221
- * The action bar contains the feature's [actions](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features-next/#actions).
220
+ * Whether to hide the action bar that holds the feature's
221
+ * [arcgis-features-next.actions](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features-next/#actions) when viewing trace result features.
222
222
  *
223
223
  * @default false
224
+ * @see [arcgis-features-next.actions](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features-next/#actions)
225
+ * @see [arcgis-features-next.hideActionBar](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features-next/#hideActionBar)
224
226
  */
225
227
  accessor hideActionBar: boolean;
226
228
  /**
@@ -254,9 +256,11 @@ export abstract class ArcgisUtilityNetworkTraceResults extends LitElement {
254
256
  */
255
257
  accessor hidePlaceholder: boolean;
256
258
  /**
257
- * Whether to hide the default actions when viewing trace result features.
259
+ * Whether default actions are disabled (hidden) when viewing trace result features.
260
+ * This property must be set to `true` to disable default actions.
258
261
  *
259
262
  * @default false
263
+ * @see [arcgis-features-next.includeDefaultActionsDisabled](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features-next/#includeDefaultActionsDisabled)
260
264
  */
261
265
  accessor includeDefaultActionsDisabled: boolean;
262
266
  /**