@arcgis/map-components 5.2.0-next.50 → 5.2.0-next.52
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/README.md +2 -2
- package/dist/cdn/4JAQPYHG.js +2 -0
- package/dist/cdn/7RN4FELN.js +2 -0
- package/dist/cdn/{TXPI3GGA.js → AIVVE6PW.js} +1 -1
- package/dist/cdn/{KBQRHXQ4.js → BCDL4T34.js} +1 -1
- package/dist/cdn/H5DDBPGU.js +2 -0
- package/dist/cdn/HFJDGHMV.js +2 -0
- package/dist/cdn/HGL6PAIG.js +2 -0
- package/dist/cdn/NWUV3BTR.js +2 -0
- package/dist/cdn/{6RSIIYYJ.js → QA56535U.js} +1 -1
- package/dist/cdn/U26MQUQF.js +2 -0
- package/dist/cdn/UOXJUYC7.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/useArcgisViewReadyError.js +14 -7
- package/dist/components/arcgis-paste/customElement.js +1 -4
- package/dist/components/arcgis-unit-radio-button-group/customElement.js +1 -4
- package/dist/components/arcgis-unit-select/customElement.js +1 -4
- package/dist/components/arcgis-utility-network-aggregated-geometry/customElement.js +59 -53
- package/dist/components/arcgis-utility-network-subnetwork-info/customElement.d.ts +1 -1
- package/dist/components/arcgis-utility-network-subnetwork-info/customElement.js +12 -12
- package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +116 -105
- package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +199 -182
- package/dist/components/arcgis-utility-network-trace-location/customElement.js +68 -67
- package/dist/components/arcgis-utility-network-trace-location-list/customElement.js +26 -26
- package/dist/components/arcgis-utility-network-trace-results/customElement.js +128 -108
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cdn/3BU2B6F7.js +0 -2
- package/dist/cdn/3HHUVV6D.js +0 -2
- package/dist/cdn/4GZ7DNJF.js +0 -2
- package/dist/cdn/CWFOZVE7.js +0 -2
- package/dist/cdn/J6ZHNOE2.js +0 -2
- package/dist/cdn/MUAJSX4F.js +0 -2
- package/dist/cdn/MUFXNQE3.js +0 -2
- package/dist/cdn/NKWXCVN3.js +0 -2
|
@@ -1,46 +1,40 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as y } from "../../chunks/runtime.js";
|
|
3
3
|
import { ref as d } from "lit/directives/ref.js";
|
|
4
4
|
import c from "@arcgis/core/core/Collection.js";
|
|
5
5
|
import { watch as w } from "@arcgis/core/core/reactiveUtils.js";
|
|
6
|
-
import { substitute as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import { substitute as k } from "@arcgis/core/intl.js";
|
|
7
|
+
import S from "@arcgis/core/layers/GraphicsLayer.js";
|
|
8
|
+
import T from "@arcgis/core/networks/support/UNTraceConfiguration.js";
|
|
9
|
+
import N from "@arcgis/core/rest/networks/support/TraceLocation.js";
|
|
10
|
+
import g from "@arcgis/core/views/interactive/snapping/FeatureSnappingLayerSource.js";
|
|
11
|
+
import $ from "@arcgis/core/widgets/Sketch/SketchViewModel.js";
|
|
12
12
|
import { LitElement as C, createEvent as l } from "@arcgis/lumina";
|
|
13
13
|
import { usePropertyChange as L } from "@arcgis/lumina/controllers";
|
|
14
|
-
import { log as h, composeMissingPropertyMessage as
|
|
15
|
-
import { css as I, html as
|
|
16
|
-
import { u as
|
|
17
|
-
import { l as
|
|
18
|
-
import { a as
|
|
19
|
-
const
|
|
20
|
-
class
|
|
14
|
+
import { log as h, composeMissingPropertyMessage as _, composeEmptyPropertyMessage as v } from "@arcgis/toolkit/log";
|
|
15
|
+
import { css as I, html as s } from "lit";
|
|
16
|
+
import { u as x } from "../../chunks/useT9n.js";
|
|
17
|
+
import { l as p } from "../../chunks/async-utils.js";
|
|
18
|
+
import { a as F, i as f, c as E, q as b, b as U } from "../../chunks/layer-utils.js";
|
|
19
|
+
const P = I`: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)}`, m = `utility-network-trace-inputs-sketch-${Date.now()}`, D = 20;
|
|
20
|
+
class A extends C {
|
|
21
21
|
constructor() {
|
|
22
|
-
super(...arguments), this.
|
|
23
|
-
"subnetwork",
|
|
24
|
-
"subnetwork-controller",
|
|
25
|
-
"upstream",
|
|
26
|
-
"downstream",
|
|
27
|
-
"isolation"
|
|
28
|
-
]), this._setUpMap = () => {
|
|
22
|
+
super(...arguments), this._messages = x({ blocking: !0 }), this.#h = !0, this.#u = /* @__PURE__ */ new Map(), this.#r = new c(), this.#s = new c(), this.#o = new c(), this.#y = /* @__PURE__ */ new Set(["subnetwork", "subnetwork-controller", "upstream", "downstream", "isolation"]), this.#m = () => {
|
|
29
23
|
if (this._error = void 0, !this.view?.map) {
|
|
30
24
|
this._error = this._messages.errors.noView, this._utilityNetworks = void 0;
|
|
31
25
|
return;
|
|
32
26
|
}
|
|
33
27
|
const e = this.view.map;
|
|
34
|
-
this
|
|
35
|
-
}, this
|
|
36
|
-
e && (this
|
|
37
|
-
}, this
|
|
38
|
-
e && (this
|
|
39
|
-
}, this
|
|
40
|
-
e && (this
|
|
41
|
-
}, this
|
|
42
|
-
e && (this
|
|
43
|
-
}, this
|
|
28
|
+
this.#J(e), this.#B(e);
|
|
29
|
+
}, this.#i = null, this.#l = 20, this.#T = (e) => {
|
|
30
|
+
e && (this.#w = e);
|
|
31
|
+
}, this.#N = (e) => {
|
|
32
|
+
e && (this.#k = e);
|
|
33
|
+
}, this.#$ = (e) => {
|
|
34
|
+
e && (this.#S = e);
|
|
35
|
+
}, this.#C = (e) => {
|
|
36
|
+
e && (this.#c = e);
|
|
37
|
+
}, this.#v = ({ detail: e, target: t }) => {
|
|
44
38
|
(e.name === "selectedDrillInFeature" || e.name === "selectedFeature") && (this._selectedFeature = t.selectedDrillInFeature ?? t.selectedFeature ?? void 0);
|
|
45
39
|
}, this._candidateFeatures = [], this._compatibleSubnetworkNames = [], this._namedTraceConfigurations = [], this._subnetworkNamesState = "ready", this._exceedDisplayLimit = !1, this.autoDestroyDisabled = !1, this.hideActionBar = !1, this.mode = "default", this.arcgisPropertyChange = L()("mode"), this.arcgisSelectedNamedTraceConfigurationChange = l(), this.arcgisTraceInputsChange = l(), this.arcgisTraceLocationSelectEnd = l(), this.arcgisTraceLocationSelectStart = l(), this.arcgisUtilityNetworkChange = l();
|
|
46
40
|
}
|
|
@@ -48,29 +42,49 @@ class D extends C {
|
|
|
48
42
|
this.properties = { _selectedFeature: 16, _candidateFeatures: 16, _compatibleSubnetworkNames: 16, _subnetworksTable: 16, _namedTraceConfigurations: 16, _utilityNetworks: 16, _traceConfiguration: 16, _error: 16, _subnetworkNamesState: 16, _activeTraceLocationType: 16, _exceedDisplayLimit: 16, beforeTraceLocationSelectStart: 0, view: 0, selectedUtilityNetwork: 0, selectedNamedTraceConfiguration: 0, autoDestroyDisabled: 5, hideActionBar: 5, traceConfiguration: 32, isSubnetworkNameTraceSelected: 32, referenceElement: 1, mode: 3, traceLocationFlagInfos: 32, traceLocations: 32 };
|
|
49
43
|
}
|
|
50
44
|
static {
|
|
51
|
-
this.styles =
|
|
45
|
+
this.styles = P;
|
|
52
46
|
}
|
|
53
|
-
get
|
|
47
|
+
get #e() {
|
|
54
48
|
return this._traceConfiguration?.subnetworkName ?? void 0;
|
|
55
49
|
}
|
|
56
|
-
set
|
|
50
|
+
set #e(e) {
|
|
57
51
|
this._traceConfiguration && (this._traceConfiguration.subnetworkName = e);
|
|
58
52
|
}
|
|
59
|
-
|
|
53
|
+
#h;
|
|
54
|
+
get #E() {
|
|
60
55
|
const { view: e } = this;
|
|
61
56
|
return e?.map ? e.map.allLayers.toArray().concat(e.map.allTables.toArray()) : [];
|
|
62
57
|
}
|
|
63
|
-
|
|
58
|
+
#t;
|
|
59
|
+
#a;
|
|
60
|
+
#u;
|
|
61
|
+
#r;
|
|
62
|
+
#s;
|
|
63
|
+
#o;
|
|
64
|
+
#y;
|
|
65
|
+
#m;
|
|
66
|
+
#i;
|
|
67
|
+
#c;
|
|
68
|
+
#w;
|
|
69
|
+
#k;
|
|
70
|
+
#S;
|
|
71
|
+
#l;
|
|
72
|
+
#T;
|
|
73
|
+
#N;
|
|
74
|
+
#$;
|
|
75
|
+
#C;
|
|
76
|
+
get #L() {
|
|
64
77
|
return !this.isSubnetworkNameTraceSelected;
|
|
65
78
|
}
|
|
66
|
-
get
|
|
79
|
+
get #_() {
|
|
67
80
|
const e = this.selectedNamedTraceConfiguration?.traceType;
|
|
68
81
|
return e === "path" || e === "circuit";
|
|
69
82
|
}
|
|
70
|
-
get
|
|
83
|
+
get #U() {
|
|
71
84
|
const e = this.selectedUtilityNetwork?.dataElement?.domainNetworks;
|
|
72
85
|
return e ? e.map((t) => t.subnetworkLayerId).filter((t) => t != null && t > -1) : [];
|
|
73
86
|
}
|
|
87
|
+
#v;
|
|
74
88
|
get traceConfiguration() {
|
|
75
89
|
return this._traceConfiguration;
|
|
76
90
|
}
|
|
@@ -79,29 +93,29 @@ class D extends C {
|
|
|
79
93
|
return !!e?.traceConfiguration?.subnetworkName && e?.traceType === "subnetwork";
|
|
80
94
|
}
|
|
81
95
|
get traceLocationFlagInfos() {
|
|
82
|
-
return new c([...this
|
|
96
|
+
return new c([...this.#r, ...this.#s, ...this.#o]);
|
|
83
97
|
}
|
|
84
98
|
get traceLocations() {
|
|
85
99
|
const e = [];
|
|
86
|
-
return this
|
|
100
|
+
return this.#L && this.#r.forEach((t) => e.push(...this.#g(t))), this.#_ && this.#o.forEach((t) => e.push(...this.#g(t))), this.#s.forEach((t) => e.push(...this.#g(t))), e;
|
|
87
101
|
}
|
|
88
102
|
async destroy() {
|
|
89
|
-
this
|
|
103
|
+
this.#A(m), this.#I(), this.#t?.cancel(), this.#c?.destroy(), this.#w?.destroy(), this.#k?.destroy(), this.#S?.destroy(), await this.manager.destroy();
|
|
90
104
|
}
|
|
91
105
|
load() {
|
|
92
|
-
this
|
|
93
|
-
w(() => this.view?.map, () => this
|
|
106
|
+
this.#m(), this.manager.onLifecycle(() => [
|
|
107
|
+
w(() => this.view?.map, () => this.#m())
|
|
94
108
|
]);
|
|
95
109
|
}
|
|
96
110
|
willUpdate(e) {
|
|
97
|
-
e.has("_utilityNetworks") && this
|
|
111
|
+
e.has("_utilityNetworks") && this.#K(), e.has("selectedUtilityNetwork") && (this.arcgisUtilityNetworkChange.emit(), this.#H()), e.has("selectedNamedTraceConfiguration") && (this.arcgisTraceInputsChange.emit(), this.arcgisSelectedNamedTraceConfigurationChange.emit(), this.#z());
|
|
98
112
|
}
|
|
99
113
|
disconnectedCallback() {
|
|
100
|
-
super.disconnectedCallback(), this.
|
|
114
|
+
super.disconnectedCallback(), this.#u.clear();
|
|
101
115
|
}
|
|
102
|
-
|
|
116
|
+
#g(e) {
|
|
103
117
|
const t = e.flagProperties.selectedTerminals;
|
|
104
|
-
return e.flagProperties.terminalConfiguration && t?.size ? Array.from(t, (i) => new
|
|
118
|
+
return e.flagProperties.terminalConfiguration && t?.size ? Array.from(t, (i) => new N({
|
|
105
119
|
type: e.traceLocation.type,
|
|
106
120
|
isFilterBarrier: e.traceLocation.isFilterBarrier,
|
|
107
121
|
globalId: e.traceLocation.globalId,
|
|
@@ -109,87 +123,88 @@ class D extends C {
|
|
|
109
123
|
terminalId: i
|
|
110
124
|
})) : [e.traceLocation];
|
|
111
125
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
#I() {
|
|
127
|
+
const { view: e } = this;
|
|
128
|
+
this.#r.forEach((t) => {
|
|
129
|
+
t.spatialProperties.flagGraphic && e?.graphics.remove(t.spatialProperties.flagGraphic);
|
|
130
|
+
}), this.#r.removeAll(), this.#s.forEach((t) => {
|
|
131
|
+
t.spatialProperties.flagGraphic && e?.graphics.remove(t.spatialProperties.flagGraphic);
|
|
132
|
+
}), this.#s.removeAll(), this.#o.forEach((t) => {
|
|
133
|
+
t.spatialProperties.flagGraphic && e?.graphics.remove(t.spatialProperties.flagGraphic);
|
|
134
|
+
}), this.#o.removeAll();
|
|
135
|
+
}
|
|
136
|
+
#P(e, t) {
|
|
122
137
|
if (!e.findLayerById(t)) {
|
|
123
|
-
const a = new
|
|
138
|
+
const a = new S({
|
|
124
139
|
id: t,
|
|
125
140
|
listMode: "hide",
|
|
126
141
|
title: t
|
|
127
142
|
});
|
|
128
|
-
|
|
143
|
+
F(this.view, a);
|
|
129
144
|
}
|
|
130
145
|
}
|
|
131
|
-
|
|
146
|
+
#D(e, t) {
|
|
132
147
|
const i = e.findLayerById(t);
|
|
133
|
-
return
|
|
148
|
+
return f(i) ? (e.reorder(i, e.layers.length - 1), i) : null;
|
|
134
149
|
}
|
|
135
|
-
|
|
150
|
+
#A(e) {
|
|
136
151
|
if (!this.view?.map)
|
|
137
152
|
return;
|
|
138
153
|
const { map: t } = this.view, i = t?.findLayerById(e);
|
|
139
|
-
i &&
|
|
154
|
+
i && f(i) && t?.remove(i);
|
|
140
155
|
}
|
|
141
|
-
|
|
142
|
-
if (!this
|
|
156
|
+
#x() {
|
|
157
|
+
if (!this.#t)
|
|
143
158
|
return;
|
|
144
159
|
const e = new c();
|
|
145
|
-
this
|
|
146
|
-
|
|
147
|
-
e.add(new
|
|
160
|
+
this.#a?.forEach((t) => {
|
|
161
|
+
E(t) ? t.sublayers.forEach((i) => {
|
|
162
|
+
e.add(new g({
|
|
148
163
|
layer: i,
|
|
149
164
|
enabled: !0
|
|
150
165
|
}));
|
|
151
|
-
}) : e.add(new
|
|
166
|
+
}) : e.add(new g({
|
|
152
167
|
layer: t,
|
|
153
168
|
enabled: !0
|
|
154
169
|
}));
|
|
155
|
-
}), this.
|
|
170
|
+
}), this.#t.snappingOptions = {
|
|
156
171
|
enabled: !1,
|
|
157
172
|
featureSources: e
|
|
158
173
|
};
|
|
159
174
|
}
|
|
160
|
-
|
|
161
|
-
const { view: t } = this, i = this
|
|
162
|
-
return new
|
|
175
|
+
#M(e) {
|
|
176
|
+
const { view: t } = this, i = this.#D(e, m);
|
|
177
|
+
return new $({
|
|
163
178
|
layer: i,
|
|
164
179
|
view: t
|
|
165
180
|
});
|
|
166
181
|
}
|
|
167
|
-
|
|
168
|
-
this
|
|
182
|
+
#B(e) {
|
|
183
|
+
this.#P(e, m), this.#t = this.#M(e), this.#x();
|
|
169
184
|
}
|
|
170
|
-
|
|
171
|
-
this
|
|
185
|
+
#G() {
|
|
186
|
+
this.#e = void 0, this._subnetworksTable = void 0, this._compatibleSubnetworkNames = [];
|
|
172
187
|
}
|
|
173
|
-
async
|
|
188
|
+
async #V() {
|
|
174
189
|
this._subnetworksTable || (this._subnetworksTable = await this.selectedUtilityNetwork?.loadSubnetworksTable());
|
|
175
190
|
}
|
|
176
|
-
async
|
|
191
|
+
async #q() {
|
|
177
192
|
const { _subnetworksTable: e } = this;
|
|
178
193
|
if (!e)
|
|
179
194
|
return;
|
|
180
|
-
const t = e.fieldsIndex.get("SUBNETWORKNAME"), i = (o, n,
|
|
181
|
-
a.gdbVersion = this.selectedUtilityNetwork?.gdbVersion, a.where = this
|
|
182
|
-
const { features:
|
|
183
|
-
this._compatibleSubnetworkNames =
|
|
195
|
+
const t = e.fieldsIndex.get("SUBNETWORKNAME"), i = (o, n, u) => n === 0 || o.getAttribute(t.name) !== u[n - 1].getAttribute(t.name), a = e.createQuery();
|
|
196
|
+
a.gdbVersion = this.selectedUtilityNetwork?.gdbVersion, a.where = this.#O(), a.outFields = [t.name], a.orderByFields = [t.name];
|
|
197
|
+
const { features: r } = await b(e, a, void 0, !1);
|
|
198
|
+
this._compatibleSubnetworkNames = r.filter(i).map((o) => o.getAttribute(t.name));
|
|
184
199
|
}
|
|
185
|
-
|
|
200
|
+
#O() {
|
|
186
201
|
const e = this._traceConfiguration, t = `DOMAINNETWORKNAME = '${e.domainNetworkName}'`, i = `TIERNAME = '${e.tierName}'`;
|
|
187
202
|
return [t, i].join(" AND ");
|
|
188
203
|
}
|
|
189
|
-
async
|
|
190
|
-
await this
|
|
204
|
+
async #R(e) {
|
|
205
|
+
await this.#V(), await this.#q(), e.subnetworkName && !this._compatibleSubnetworkNames.some((t) => t === e.subnetworkName) && (this.#e = this._compatibleSubnetworkNames.at(0));
|
|
191
206
|
}
|
|
192
|
-
|
|
207
|
+
#j(e) {
|
|
193
208
|
const t = this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.find((i) => i.globalId === e);
|
|
194
209
|
if (!t) {
|
|
195
210
|
h("error", this, "`traceConfig` not found in `selectedUtilityNetwork.sharedNamedTraceConfigurations`");
|
|
@@ -197,188 +212,190 @@ class D extends C {
|
|
|
197
212
|
}
|
|
198
213
|
this.selectedNamedTraceConfiguration = t;
|
|
199
214
|
}
|
|
200
|
-
async
|
|
215
|
+
async #z() {
|
|
201
216
|
const { selectedNamedTraceConfiguration: e } = this;
|
|
202
|
-
if (!(e?.traceConfiguration instanceof
|
|
203
|
-
h("error", this,
|
|
217
|
+
if (!(e?.traceConfiguration instanceof T)) {
|
|
218
|
+
h("error", this, _("selectedNamedTraceConfiguration.traceConfiguration")), this._traceConfiguration = void 0;
|
|
204
219
|
return;
|
|
205
220
|
}
|
|
206
|
-
this._traceConfiguration = e.traceConfiguration.clone(), this.isSubnetworkNameTraceSelected && (this._subnetworkNamesState = "loading", await this
|
|
221
|
+
this._traceConfiguration = e.traceConfiguration.clone(), this.isSubnetworkNameTraceSelected && (this._subnetworkNamesState = "loading", await this.#R(this._traceConfiguration), this._subnetworkNamesState = "ready");
|
|
207
222
|
}
|
|
208
|
-
async
|
|
223
|
+
async #H() {
|
|
209
224
|
const { selectedUtilityNetwork: e } = this;
|
|
210
225
|
try {
|
|
211
226
|
e && !e.loaded && await e.load();
|
|
212
227
|
} catch (t) {
|
|
213
|
-
|
|
228
|
+
p(t, this, "Error while loading the selected utility network");
|
|
214
229
|
}
|
|
215
|
-
this
|
|
230
|
+
this.#G(), this.#W(), this.#Q(), this.#I();
|
|
216
231
|
}
|
|
217
|
-
|
|
232
|
+
#W() {
|
|
218
233
|
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)) || [], this._namedTraceConfigurations.length ? this.selectedNamedTraceConfiguration = this._namedTraceConfigurations.at(0) : h("error", this, "The selected utility network has no compatible named trace configurations.");
|
|
219
234
|
}
|
|
220
|
-
|
|
235
|
+
#Q() {
|
|
221
236
|
const { selectedUtilityNetwork: e } = this;
|
|
222
|
-
this
|
|
237
|
+
this.#a = new c(this.#E.filter((t) => e?.isUtilityLayer(t) && !this.#U.includes(t.layerId))), this.#x();
|
|
223
238
|
}
|
|
224
|
-
|
|
239
|
+
#K() {
|
|
225
240
|
const { _utilityNetworks: e, selectedUtilityNetwork: t } = this;
|
|
226
241
|
e?.length ? (!t || !e.includes(t)) && (this.selectedUtilityNetwork = e.at(0)) : (h("error", this, v("_utilityNetworks")), this.selectedUtilityNetwork = void 0, this._error = this._messages.errors.noUtilityNetwork);
|
|
227
242
|
}
|
|
228
|
-
async
|
|
243
|
+
async #J(e) {
|
|
229
244
|
try {
|
|
230
245
|
e.loaded || await e.load();
|
|
231
246
|
} catch (t) {
|
|
232
|
-
|
|
247
|
+
p(t, this, "Error while loading `view.map`");
|
|
233
248
|
} finally {
|
|
234
249
|
this._utilityNetworks = e.utilityNetworks || new c();
|
|
235
250
|
}
|
|
236
251
|
}
|
|
237
|
-
|
|
252
|
+
#p(e) {
|
|
238
253
|
if (e.stopPropagation(), this.arcgisTraceLocationSelectStart.emit(e.detail).defaultPrevented) {
|
|
239
254
|
e.preventDefault();
|
|
240
255
|
return;
|
|
241
256
|
}
|
|
242
257
|
this._activeTraceLocationType = e?.target?.traceLocationType, this.mode = "add-spatial-instructions";
|
|
243
258
|
}
|
|
244
|
-
|
|
259
|
+
#X(e) {
|
|
245
260
|
if (e == null)
|
|
246
261
|
return;
|
|
247
|
-
const
|
|
248
|
-
if (
|
|
249
|
-
return
|
|
262
|
+
const t = this.#u, i = this.#a, a = t.get(e);
|
|
263
|
+
if (a)
|
|
264
|
+
return a;
|
|
250
265
|
if (!i)
|
|
251
266
|
return;
|
|
252
|
-
const
|
|
253
|
-
return
|
|
267
|
+
const r = i.find((o) => "layerId" in o && o.layerId === e);
|
|
268
|
+
return r && t.set(e, r), r;
|
|
254
269
|
}
|
|
255
|
-
async
|
|
270
|
+
async #Y(e, t) {
|
|
256
271
|
const i = e.createQuery();
|
|
257
|
-
i.gdbVersion = this.selectedUtilityNetwork?.gdbVersion, i.objectIds = t.map((
|
|
258
|
-
const { features: a } = await
|
|
259
|
-
return a.forEach((
|
|
260
|
-
if (!
|
|
261
|
-
const o =
|
|
262
|
-
|
|
272
|
+
i.gdbVersion = this.selectedUtilityNetwork?.gdbVersion, i.objectIds = t.map((r) => r.getObjectId()), i.outFields = ["*"];
|
|
273
|
+
const { features: a } = await b(e, i);
|
|
274
|
+
return a.forEach((r) => {
|
|
275
|
+
if (!r.getEffectivePopupTemplate(this.#h)) {
|
|
276
|
+
const o = r.layer;
|
|
277
|
+
r.popupTemplate = o.createPopupTemplate();
|
|
263
278
|
}
|
|
264
279
|
}), a;
|
|
265
280
|
}
|
|
266
|
-
async
|
|
281
|
+
async #Z(e) {
|
|
267
282
|
const t = /* @__PURE__ */ new Map(), i = [];
|
|
268
283
|
return e.forEach((a) => {
|
|
269
|
-
const
|
|
270
|
-
if (
|
|
271
|
-
const o = this
|
|
284
|
+
const r = U(a.layer) ? a.layer.parent : a.layer;
|
|
285
|
+
if (r) {
|
|
286
|
+
const o = this.#X(r.layerId);
|
|
272
287
|
if (o) {
|
|
273
288
|
const n = t.get(o) || [];
|
|
274
289
|
n.push(a), t.set(o, n);
|
|
275
290
|
}
|
|
276
291
|
}
|
|
277
292
|
}), await Promise.all(Array.from(t.keys()).map(async (a) => {
|
|
278
|
-
const
|
|
293
|
+
const r = t.get(a) ?? [], o = await this.#Y(a, r);
|
|
279
294
|
i.push(...o);
|
|
280
295
|
})), i;
|
|
281
296
|
}
|
|
282
|
-
async
|
|
283
|
-
return this._exceedDisplayLimit = e.length > this
|
|
297
|
+
async #f(e) {
|
|
298
|
+
return this._exceedDisplayLimit = e.length > this.#l, this._candidateFeatures = await this.#Z(e.slice(0, this.#l)), this._candidateFeatures.length === 0 ? (this.#d(), await Promise.reject(Error("No features found"))) : (this._candidateFeatures.length === 1 && (this._selectedFeature = this._candidateFeatures.at(0)), this.mode = "add-spatial-feature", this.#i?.reject(), this.#i = Promise.withResolvers(), await this.#i.promise);
|
|
284
299
|
}
|
|
285
|
-
|
|
286
|
-
e.stopPropagation(), this.arcgisTraceLocationSelectEnd.emit(), this._activeTraceLocationType = void 0, this.mode = "default", this
|
|
300
|
+
#b(e) {
|
|
301
|
+
e.stopPropagation(), this.arcgisTraceLocationSelectEnd.emit(), this._activeTraceLocationType = void 0, this.mode = "default", this.#d();
|
|
287
302
|
}
|
|
288
|
-
|
|
289
|
-
e?.stopPropagation(), this
|
|
303
|
+
#d(e) {
|
|
304
|
+
e?.stopPropagation(), this.#c?.clear(), this.#F(), this.#t?.cancel();
|
|
290
305
|
}
|
|
291
|
-
|
|
292
|
-
this.mode = "default", this._candidateFeatures = [], this._selectedFeature = void 0, this
|
|
306
|
+
#F() {
|
|
307
|
+
this.mode = "default", this._candidateFeatures = [], this._selectedFeature = void 0, this.#i?.reject(), this.#i = null;
|
|
293
308
|
}
|
|
294
|
-
|
|
295
|
-
const
|
|
309
|
+
#ee() {
|
|
310
|
+
const e = this.#i, t = this.#c, { _selectedFeature: i } = this;
|
|
296
311
|
if (e && t) {
|
|
297
312
|
if (!i)
|
|
298
313
|
return;
|
|
299
|
-
e.resolve(i), this
|
|
314
|
+
e.resolve(i), this.#i = null;
|
|
300
315
|
}
|
|
301
316
|
}
|
|
302
|
-
|
|
303
|
-
return
|
|
317
|
+
#n(e, t = !1, i) {
|
|
318
|
+
return s`<calcite-notice .closable=${t} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${e}</div></calcite-notice>`;
|
|
304
319
|
}
|
|
305
|
-
|
|
306
|
-
return
|
|
320
|
+
#te() {
|
|
321
|
+
return s`<calcite-loader label=loading></calcite-loader>`;
|
|
307
322
|
}
|
|
308
|
-
|
|
309
|
-
const e = this._namedTraceConfigurations.map((i) =>
|
|
310
|
-
return
|
|
323
|
+
#ie() {
|
|
324
|
+
const e = this._namedTraceConfigurations.map((i) => s`<calcite-combobox-item .value=${i.globalId} .heading=${i.title} .selected=${i.globalId === this.selectedNamedTraceConfiguration?.globalId}></calcite-combobox-item>`), t = this._messages.labels.traceConfiguration;
|
|
325
|
+
return s`<calcite-block .heading=${t} .label=${t} expanded><calcite-combobox .label=${t} selection-mode=single-persist @calciteComboboxChange=${({ currentTarget: i }) => {
|
|
311
326
|
const a = i.selectedItems[0]?.value;
|
|
312
|
-
this
|
|
327
|
+
this.#j(a);
|
|
313
328
|
}}>${e}</calcite-combobox></calcite-block>`;
|
|
314
329
|
}
|
|
315
|
-
|
|
316
|
-
const e = this._messages.labels.utilityNetwork, t = this._utilityNetworks?.map((i) =>
|
|
317
|
-
return
|
|
330
|
+
#ae() {
|
|
331
|
+
const e = this._messages.labels.utilityNetwork, t = this._utilityNetworks?.map((i) => s`<calcite-combobox-item .value=${i.id} .heading=${i.title || i.id} .selected=${i.id === this.selectedUtilityNetwork?.id}></calcite-combobox-item>`);
|
|
332
|
+
return s`<calcite-block .heading=${e} .label=${e} expanded><calcite-combobox .label=${e} selection-mode=single-persist @calciteComboboxChange=${({ currentTarget: i }) => {
|
|
318
333
|
const a = i.selectedItems[0]?.value;
|
|
319
|
-
this.selectedUtilityNetwork?.id !== a && (this.selectedUtilityNetwork = this._utilityNetworks?.find((
|
|
334
|
+
this.selectedUtilityNetwork?.id !== a && (this.selectedUtilityNetwork = this._utilityNetworks?.find((r) => r.id === a));
|
|
320
335
|
}}>${t}</calcite-combobox></calcite-block>`;
|
|
321
336
|
}
|
|
322
|
-
|
|
323
|
-
const {
|
|
324
|
-
let
|
|
325
|
-
return
|
|
337
|
+
#re() {
|
|
338
|
+
const { _error: e, selectedUtilityNetwork: t } = this, { noView: i, noUtilityNetwork: a } = this._messages.errors;
|
|
339
|
+
let r;
|
|
340
|
+
return e === i || e === a ? r = this.#n(e, !1, "exclamation-mark-triangle") : !t?.loaded && !t?.loadError ? r = this.#te() : r = this.#pe(), s`<calcite-flow-item .selected=${this.mode === "default"}>${r}</calcite-flow-item>`;
|
|
326
341
|
}
|
|
327
|
-
|
|
342
|
+
#se() {
|
|
328
343
|
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;
|
|
329
|
-
return
|
|
344
|
+
return s`<calcite-flow-item .selected=${t === "add-spatial-instructions"} .heading=${i} @calciteFlowItemBack=${(a) => this.#d(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>`;
|
|
330
345
|
}
|
|
331
|
-
|
|
332
|
-
|
|
346
|
+
#oe() {
|
|
347
|
+
const { _activeTraceLocationType: e, _candidateFeatures: t, _messages: i } = this;
|
|
348
|
+
if (!t.length)
|
|
333
349
|
return this.mode = "default", null;
|
|
334
|
-
const
|
|
335
|
-
return
|
|
350
|
+
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";
|
|
351
|
+
return s`<arcgis-features-next .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#h} .features=${this._candidateFeatures} .featureMenuTitle=${a} .hideActionBar=${this.hideActionBar} hide-select-feature .initialDisplayMode=${r} @arcgisClose=${() => this.#F()} @arcgisPropertyChange=${this.#v} open .referenceElement=${this.referenceElement} .view=${this.view} ${d(this.#C)}></arcgis-features-next>`;
|
|
336
352
|
}
|
|
337
|
-
|
|
338
|
-
const { mode: e, _messages: t, _selectedFeature: i, selectedUtilityNetwork: a } = this,
|
|
339
|
-
limit: this.
|
|
353
|
+
#ne() {
|
|
354
|
+
const { mode: e, _messages: t, _selectedFeature: i, selectedUtilityNetwork: a } = this, r = e === "add-spatial-feature" && this._exceedDisplayLimit && !i, o = k(t.warnings.exceededDisplayLimit, {
|
|
355
|
+
limit: this.#l.toString()
|
|
340
356
|
}), n = i ? !(a?.isUtilityLayer(i.layer) ?? !0) : !0;
|
|
341
|
-
return
|
|
357
|
+
return s`${r && s`<calcite-input-message id=results-limited-message icon=exclamation-mark-circle status=idle>${o}</calcite-input-message>` || ""}<calcite-button appearance=outline width=full @click=${() => this.#d()} slot=footer>${t.buttons.cancel}</calcite-button>${e === "add-spatial-feature" && s`<calcite-button width=full slot=footer appearance=solid @click=${() => this.#ee()} .disabled=${n}>${t.buttons.add}</calcite-button>` || ""}`;
|
|
342
358
|
}
|
|
343
|
-
|
|
344
|
-
return
|
|
359
|
+
#ce() {
|
|
360
|
+
return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=starting-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this.#p} @arcgisTraceLocationSelectEnd=${this.#b} @arcgisTraceLocationChange=${() => this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this.#t} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#a} .traceLocations=${this.#r} .afterHitTest=${this.#f.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${d(this.#T)}></arcgis-utility-network-trace-location>`;
|
|
345
361
|
}
|
|
346
|
-
|
|
347
|
-
return
|
|
362
|
+
#le() {
|
|
363
|
+
return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=stopping-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this.#p} @arcgisTraceLocationSelectEnd=${this.#b} @arcgisTraceLocationChange=${() => this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this.#t} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#a} .traceLocations=${this.#o} .afterHitTest=${this.#f.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${d(this.#$)}></arcgis-utility-network-trace-location>`;
|
|
348
364
|
}
|
|
349
|
-
|
|
350
|
-
return
|
|
365
|
+
#de() {
|
|
366
|
+
return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=barrier .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this.#p} @arcgisTraceLocationSelectEnd=${this.#b} @arcgisTraceLocationChange=${() => this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this.#t} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#a} .traceLocations=${this.#s} .afterHitTest=${this.#f.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${d(this.#N)}></arcgis-utility-network-trace-location>`;
|
|
351
367
|
}
|
|
352
|
-
|
|
353
|
-
|
|
368
|
+
#he() {
|
|
369
|
+
const { _messages: e } = this;
|
|
370
|
+
return s`<calcite-input clearable type=text .placeholder=${e.instructions.enterSubnetworkName} max-length=64 .status=${this.#e ? "valid" : "invalid"} .value=${this.#e} @calciteInputInput=${(t) => this.#e = t.target.value}></calcite-input><calcite-input-message icon=exclamation-mark-triangle status=idle>${e.labels.tooManySubnetworks}</calcite-input-message>`;
|
|
354
371
|
}
|
|
355
|
-
|
|
356
|
-
return
|
|
372
|
+
#ue() {
|
|
373
|
+
return s`<calcite-combobox .label=${this._messages.labels.subnetworkName} selection-mode=single-persist @calciteComboboxChange=${({ currentTarget: e }) => {
|
|
357
374
|
const t = e.selectedItems[0]?.value;
|
|
358
|
-
this
|
|
359
|
-
}}>${this._compatibleSubnetworkNames.map((e) =>
|
|
375
|
+
this.#e = t;
|
|
376
|
+
}}>${this._compatibleSubnetworkNames.map((e) => s`<calcite-combobox-item .value=${e} .heading=${e} .selected=${e === this.#e}></calcite-combobox-item>`)}</calcite-combobox>`;
|
|
360
377
|
}
|
|
361
|
-
|
|
362
|
-
const e = this.
|
|
363
|
-
return this.isSubnetworkNameTraceSelected ? this._subnetworkNamesState === "loading" ?
|
|
378
|
+
#me() {
|
|
379
|
+
const { _messages: e } = this, t = e.labels.subnetworkName;
|
|
380
|
+
return this.isSubnetworkNameTraceSelected ? this._subnetworkNamesState === "loading" ? s`<calcite-loader class="inline-loader" label=loading scale=s></calcite-loader>` : this._compatibleSubnetworkNames.length ? s`<calcite-block .heading=${t} .label=${t} expanded>${this._compatibleSubnetworkNames.length > D ? this.#he() : this.#ue()}</calcite-block>` : this.#n(e.errors.noCompatibleSubnetworks, !1, "exclamation-mark-triangle") : null;
|
|
364
381
|
}
|
|
365
|
-
|
|
382
|
+
#ge() {
|
|
366
383
|
const { selectedNamedTraceConfiguration: e } = this;
|
|
367
|
-
return this._traceConfiguration && e?.traceType && this.
|
|
384
|
+
return this._traceConfiguration && e?.traceType && this.#y.has(e.traceType) ? s`<calcite-block id=subnetwork-info-block expanded .label=${this._messages.labels.subnetworkInfo}><arcgis-utility-network-subnetwork-info .namedTraceConfiguration=${e}></arcgis-utility-network-subnetwork-info></calcite-block>` : null;
|
|
368
385
|
}
|
|
369
|
-
|
|
370
|
-
const {
|
|
371
|
-
let
|
|
372
|
-
this.selectedUtilityNetwork?.loadError ?
|
|
373
|
-
const
|
|
374
|
-
return
|
|
386
|
+
#pe() {
|
|
387
|
+
const { _messages: e } = this, { noTraceConfiguration: t, noNamedTraceConfigurations: i, utilityNetworkLoadFailed: a } = e.errors, r = this._utilityNetworks && this._utilityNetworks.length > 1 ? this.#ae() : null;
|
|
388
|
+
let o;
|
|
389
|
+
this.selectedUtilityNetwork?.loadError ? o = this.#n(a, !1, "exclamation-mark-triangle") : this._namedTraceConfigurations.length || (o = this.#n(i, !1, "exclamation-mark-triangle"));
|
|
390
|
+
const n = s`${this.#ie()}${this.#ge()}${this.#me()}`, u = this.traceConfiguration ? s`${this.#L ? this.#ce() : null}${this.#_ ? this.#le() : null}${this.#de()}` : this.#n(t, !1, "exclamation-mark-triangle");
|
|
391
|
+
return s`<calcite-block-group .label=${e.labels.traceInputs}>${r}${o ?? s`${n}${u}`}</calcite-block-group>`;
|
|
375
392
|
}
|
|
376
393
|
render() {
|
|
377
394
|
const { mode: e } = this;
|
|
378
|
-
return
|
|
395
|
+
return s`<calcite-panel>${e === "add-spatial-feature" ? this.#oe() : null}<calcite-flow .hidden=${e === "add-spatial-feature"}>${this.#re()}${this.#se()}</calcite-flow>${e !== "default" ? this.#ne() : null}</calcite-panel>`;
|
|
379
396
|
}
|
|
380
397
|
}
|
|
381
|
-
|
|
398
|
+
y("arcgis-utility-network-trace-inputs", A);
|
|
382
399
|
export {
|
|
383
|
-
|
|
400
|
+
A as ArcgisUtilityNetworkTraceInputs
|
|
384
401
|
};
|