@arcgis/map-components 5.2.0-next.163 → 5.2.0-next.165
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/dist/cdn/2MPZWW4A.js +2 -0
- package/dist/cdn/3IZHAJN7.js +2 -0
- package/dist/cdn/67UW6MJM.js +2 -0
- package/dist/cdn/73NABILZ.js +2 -0
- package/dist/cdn/{VF23MMWZ.js → AALEZAW5.js} +1 -1
- package/dist/cdn/BPTZ6LBO.js +2 -0
- package/dist/cdn/FGQJD346.js +2 -0
- package/dist/cdn/OBFJ4JUW.js +2 -0
- package/dist/cdn/RMKPKUPL.js +2 -0
- package/dist/cdn/WEY7JGX2.js +2 -0
- package/dist/cdn/YXFFWLE5.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/utils5.js +2 -2
- package/dist/components/arcgis-coordinate-conversion/customElement.d.ts +5 -0
- package/dist/components/arcgis-coordinate-conversion-next/customElement.d.ts +6 -5
- package/dist/components/arcgis-feature-attachments/customElement.js +18 -18
- package/dist/components/arcgis-feature-next/customElement.d.ts +1 -1
- package/dist/components/arcgis-features-next/customElement.js +14 -15
- package/dist/components/arcgis-search/customElement.d.ts +12 -0
- package/dist/components/arcgis-search/customElement.js +3 -0
- package/dist/components/arcgis-selection-toolbar/customElement.d.ts +8 -0
- package/dist/components/arcgis-selection-toolbar/customElement.js +23 -17
- package/dist/components/arcgis-time-bar/customElement.d.ts +486 -409
- package/dist/components/arcgis-time-bar/types.d.ts +36 -15
- package/dist/components/arcgis-time-bar-slider/customElement.d.ts +179 -162
- package/dist/components/arcgis-time-slider/customElement.d.ts +1 -0
- package/dist/components/arcgis-time-slider/customElement.js +8 -7
- package/dist/components/arcgis-utility-network-trace-aggregated-geometry-result-item/customElement.d.ts +7 -0
- package/dist/components/arcgis-utility-network-trace-aggregated-geometry-result-item/customElement.js +8 -5
- package/dist/components/arcgis-utility-network-trace-analysis/customElement.d.ts +45 -2
- package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +23 -20
- package/dist/components/arcgis-utility-network-trace-configuration-picker/customElement.d.ts +125 -12
- package/dist/components/arcgis-utility-network-trace-elements-result-item/customElement.d.ts +9 -2
- package/dist/components/arcgis-utility-network-trace-elements-result-item/customElement.js +60 -57
- package/dist/components/arcgis-utility-network-trace-functions-result-item/customElement.d.ts +7 -0
- package/dist/components/arcgis-utility-network-trace-functions-result-item/customElement.js +12 -9
- package/dist/components/arcgis-utility-network-trace-inputs/customElement.d.ts +217 -14
- package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +119 -108
- package/dist/components/arcgis-utility-network-trace-locations/customElement.d.ts +155 -8
- package/dist/components/arcgis-utility-network-trace-results/customElement.d.ts +9 -73
- package/dist/components/arcgis-utility-network-trace-results/customElement.js +132 -125
- package/dist/components/arcgis-utility-network-trace-results-pane/customElement.d.ts +161 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +5 -5
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +6 -6
- package/dist/cdn/24P3B56P.js +0 -2
- package/dist/cdn/4TTVR7UK.js +0 -2
- package/dist/cdn/7PMSUAOO.js +0 -2
- package/dist/cdn/EQX7MHI6.js +0 -2
- package/dist/cdn/ERO6VEJC.js +0 -2
- package/dist/cdn/JQL6EOCO.js +0 -2
- package/dist/cdn/K664I5PA.js +0 -2
- package/dist/cdn/NV6GXURX.js +0 -2
- package/dist/cdn/S3LQLHD6.js +0 -2
- package/dist/cdn/X5PDNDLF.js +0 -2
- package/dist/components/arcgis-time-bar/TimeBarViewModel.d.ts +0 -73
|
@@ -1,52 +1,55 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
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
|
|
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
|
|
11
|
-
import { u as
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
24
|
+
this.styles = $;
|
|
25
25
|
}
|
|
26
|
-
#
|
|
27
|
-
get
|
|
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
|
-
#
|
|
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
|
-
|
|
38
|
+
#f;
|
|
39
|
+
#y;
|
|
40
|
+
#w;
|
|
41
|
+
#r;
|
|
42
|
+
get #h() {
|
|
43
43
|
return !this.isSubnetworkNameTraceSelected;
|
|
44
44
|
}
|
|
45
|
-
get #
|
|
45
|
+
get #u() {
|
|
46
46
|
const e = this.selectedNamedTraceConfiguration?.traceType;
|
|
47
47
|
return e === "path" || e === "circuit";
|
|
48
48
|
}
|
|
49
|
-
get #
|
|
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.#
|
|
64
|
+
return new c([...this.#e, ...this.#i, ...this.#t]);
|
|
62
65
|
}
|
|
63
66
|
get traceLocations() {
|
|
64
67
|
const e = [];
|
|
65
|
-
return this.#
|
|
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.#
|
|
71
|
+
this.#T(), d.getSketchViewModel(this.view)?.cancel(), d.removeSketchGraphicsLayer(this.view);
|
|
69
72
|
const t = await Promise.allSettled([
|
|
70
|
-
this.#
|
|
71
|
-
this.#
|
|
72
|
-
this.#
|
|
73
|
-
this.#
|
|
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.#
|
|
81
|
-
|
|
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.#
|
|
88
|
+
e.has("selectedUtilityNetwork") && this.#A();
|
|
86
89
|
}
|
|
87
90
|
disconnectedCallback() {
|
|
88
|
-
super.disconnectedCallback(), this.#
|
|
91
|
+
super.disconnectedCallback(), this.#d.clear();
|
|
89
92
|
}
|
|
90
|
-
|
|
93
|
+
#C(e) {
|
|
91
94
|
e.stopPropagation(), this.arcgisTriggerAction.emit(e.detail);
|
|
92
95
|
}
|
|
93
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
103
|
-
e && (this.#
|
|
105
|
+
#_(e) {
|
|
106
|
+
e && (this.#f = e);
|
|
104
107
|
}
|
|
105
|
-
#
|
|
106
|
-
e && (this.#
|
|
108
|
+
#N(e) {
|
|
109
|
+
e && (this.#y = e);
|
|
107
110
|
}
|
|
108
|
-
#
|
|
109
|
-
e && (this.#
|
|
111
|
+
#F(e) {
|
|
112
|
+
e && (this.#w = e);
|
|
110
113
|
}
|
|
111
|
-
#
|
|
112
|
-
e && (this.#
|
|
114
|
+
#P(e) {
|
|
115
|
+
e && (this.#s = e);
|
|
113
116
|
}
|
|
114
|
-
#
|
|
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
|
-
#
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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.#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
149
|
+
#E() {
|
|
147
150
|
const { selectedUtilityNetwork: e } = this;
|
|
148
|
-
this.#
|
|
151
|
+
this.#l = new c(this.#$.filter((t) => e?.isUtilityLayer(t) && !this.#L.includes(t.layerId)));
|
|
149
152
|
}
|
|
150
|
-
#
|
|
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
|
-
#
|
|
160
|
+
#M(e) {
|
|
158
161
|
if (e == null)
|
|
159
162
|
return;
|
|
160
|
-
const t = this.#
|
|
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
|
|
166
|
-
return
|
|
168
|
+
const s = i.find((o) => "layerId" in o && o.layerId === e);
|
|
169
|
+
return s && t.set(e, s), s;
|
|
167
170
|
}
|
|
168
|
-
async #
|
|
171
|
+
async #x(e, t) {
|
|
169
172
|
const i = e.createQuery();
|
|
170
|
-
i.gdbVersion = this.selectedUtilityNetwork?.gdbVersion, i.objectIds = t.map((
|
|
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((
|
|
173
|
-
if (!
|
|
174
|
-
const o =
|
|
175
|
-
|
|
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 #
|
|
182
|
+
async #B(e) {
|
|
180
183
|
const t = /* @__PURE__ */ new Map(), i = [];
|
|
181
184
|
return e.forEach((a) => {
|
|
182
|
-
const
|
|
183
|
-
if (
|
|
184
|
-
const o = this.#
|
|
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
|
|
194
|
+
const s = t.get(a) ?? [], o = await this.#x(a, s);
|
|
192
195
|
i.push(...o);
|
|
193
196
|
})), i;
|
|
194
197
|
}
|
|
195
|
-
async #
|
|
196
|
-
return this._exceedDisplayLimit = e.length > this.#
|
|
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
|
-
#
|
|
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.#
|
|
205
|
+
e?.stopPropagation(), this.#s?.clear(), this.#v(), (this.view ? d.getSketchViewModel(this.view) : null)?.cancel();
|
|
203
206
|
}
|
|
204
|
-
#
|
|
205
|
-
this.mode = "default", this._candidateFeatures = [], this._selectedFeature = void 0, this.#
|
|
207
|
+
#v() {
|
|
208
|
+
this.mode = "default", this._candidateFeatures = [], this._selectedFeature = void 0, this.#a?.reject(), this.#a = null;
|
|
206
209
|
}
|
|
207
|
-
#
|
|
208
|
-
const e = 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.#
|
|
215
|
+
e.resolve(i), this.#a = null;
|
|
213
216
|
}
|
|
214
217
|
}
|
|
215
|
-
#
|
|
216
|
-
|
|
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
|
-
#
|
|
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
|
|
221
|
-
i.stopPropagation(), i.detail.name === "selectedNamedTraceConfiguration"
|
|
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
|
-
#
|
|
235
|
+
#q() {
|
|
225
236
|
const { selectedUtilityNetwork: e, view: t } = this;
|
|
226
|
-
return
|
|
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
|
-
#
|
|
241
|
+
#z() {
|
|
231
242
|
const { _error: e } = this, { noView: t } = this._messages.errors;
|
|
232
243
|
let i;
|
|
233
|
-
return e === t ? i = this.#
|
|
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
|
-
#
|
|
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
|
|
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
|
-
#
|
|
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,
|
|
244
|
-
return
|
|
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
|
-
#
|
|
247
|
-
const { mode: e, _messages: t, _selectedFeature: i, selectedUtilityNetwork: a } = this,
|
|
248
|
-
limit: this.#
|
|
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
|
|
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
|
-
#
|
|
253
|
-
return
|
|
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
|
-
#
|
|
256
|
-
const { _messages: e } = this, t = this.#
|
|
257
|
-
return
|
|
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
|
|
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
|
-
|
|
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
|
-
*
|
|
16
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
188
|
-
*
|
|
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": {
|