@arcgis/map-components 5.2.0-next.105 → 5.2.0-next.106
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/2W7OTZWE.js +2 -0
- package/dist/cdn/{CB564G7T.js → 3Q5ZNKFA.js} +1 -1
- package/dist/cdn/54ST7ZFM.js +2 -0
- package/dist/cdn/5IWPAMQX.js +2 -0
- package/dist/cdn/{PXSNOIDS.js → 5VFOV7OL.js} +1 -1
- package/dist/cdn/{L4DWZT4V.js → 6CXH46LW.js} +1 -1
- package/dist/cdn/{6PKJBJML.js → 6FNDBTL7.js} +1 -1
- package/dist/cdn/BTDEIRWG.js +2 -0
- package/dist/cdn/{WLGR4IHZ.js → GTGJEBPK.js} +1 -1
- package/dist/cdn/{KGFMFLEB.js → HUPYGWUJ.js} +1 -1
- package/dist/cdn/J7ZMGZ6U.js +2 -0
- package/dist/cdn/{SHMHGYVB.js → KDM7EERW.js} +1 -1
- package/dist/cdn/{RC2T53I5.js → KXGRFYAN.js} +1 -1
- package/dist/cdn/{5FWT3N7B.js → N4ECCRHC.js} +1 -1
- package/dist/cdn/{EHMCN2NS.js → NG4IEHMS.js} +1 -1
- package/dist/cdn/P5JRSGJG.js +2 -0
- package/dist/cdn/{CKO4VE36.js → Q4VMXDGI.js} +1 -1
- package/dist/cdn/{72HH6FSN.js → RFAICLUF.js} +1 -1
- package/dist/cdn/{BNZQH6YD.js → T7L5Q45E.js} +1 -1
- package/dist/cdn/WJKXUGQQ.js +2 -0
- package/dist/cdn/{6SEM26SM.js → XYIEHNTE.js} +1 -1
- package/dist/cdn/{R2WAEZ4G.js → Y4XJQ6Z7.js} +1 -1
- package/dist/cdn/{BR6D5EO4.js → Y6UJT3A4.js} +1 -1
- package/dist/cdn/{EYHS3JDR.js → YBXUZO5Y.js} +1 -1
- package/dist/cdn/assets/layer-list-next/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/utility-network-trace-locations/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/utils2.js +36 -28
- package/dist/components/arcgis-basemap-layer-list-next/customElement.js +25 -25
- package/dist/components/arcgis-coordinate-conversion-next/customElement.js +1 -1
- package/dist/components/arcgis-directional-pad/customElement.js +10 -10
- package/dist/components/arcgis-features/customElement.js +1 -1
- package/dist/components/arcgis-features-next/customElement.d.ts +2 -0
- package/dist/components/arcgis-features-next/customElement.js +2 -2
- package/dist/components/arcgis-layer-list-item-panel/customElement.js +1 -1
- package/dist/components/arcgis-layer-list-next/customElement.d.ts +27 -0
- package/dist/components/arcgis-layer-list-next/customElement.js +22 -22
- package/dist/components/arcgis-layer-list-next/layer-list-item/customElement.js +44 -44
- package/dist/components/arcgis-layer-list-next/types.d.ts +9 -0
- package/dist/components/arcgis-link-chart-layout-switcher/customElement.js +5 -5
- package/dist/components/arcgis-navigation-toggle/customElement.js +1 -1
- package/dist/components/arcgis-paste/customElement.js +1 -1
- package/dist/components/arcgis-popup/customElement.d.ts +2 -0
- package/dist/components/arcgis-print-layout-panel/customElement.js +1 -1
- package/dist/components/arcgis-print-map-only-panel/customElement.js +1 -1
- package/dist/components/arcgis-reverse-geocode-list/customElement.js +1 -1
- package/dist/components/arcgis-scene/customElement.d.ts +10 -0
- package/dist/components/arcgis-time-bar/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-trace-analysis/customElement.d.ts +1 -1
- package/dist/components/arcgis-utility-network-trace-analysis-next/customElement.d.ts +2 -2
- package/dist/components/arcgis-utility-network-trace-analysis-next/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-trace-inputs-next/customElement.d.ts +2 -2
- package/dist/components/arcgis-utility-network-trace-inputs-next/customElement.js +101 -161
- package/dist/components/arcgis-utility-network-trace-inputs-next/index.js +1 -1
- package/dist/components/{arcgis-utility-network-trace-location-next → arcgis-utility-network-trace-locations}/customElement.d.ts +47 -26
- package/dist/components/arcgis-utility-network-trace-locations/customElement.js +397 -0
- package/dist/components/{arcgis-utility-network-trace-location-list-next → arcgis-utility-network-trace-locations}/index.js +2 -0
- package/dist/components/arcgis-utility-network-validate-network-topology/customElement.d.ts +1 -1
- package/dist/components/arcgis-utility-network-validate-network-topology/customElement.js +1 -1
- 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/index.d.ts +7 -11
- package/dist/loader.js +2 -3
- package/dist/types/lumina.d.ts +6 -11
- package/dist/types/preact.d.ts +7 -13
- package/dist/types/react.d.ts +8 -15
- package/dist/types/stencil.d.ts +6 -11
- package/package.json +5 -5
- package/dist/cdn/5LGT6I7Y.js +0 -2
- package/dist/cdn/GH2RPE3P.js +0 -2
- package/dist/cdn/JHWTX3YJ.js +0 -2
- package/dist/cdn/NRT2ZCWC.js +0 -2
- package/dist/cdn/R5GMCIAH.js +0 -2
- package/dist/cdn/VZXCU47M.js +0 -2
- package/dist/cdn/YELCBIGX.js +0 -2
- package/dist/cdn/assets/utility-network-trace-location-list-next/t9n/messages.en.json +0 -1
- package/dist/cdn/assets/utility-network-trace-location-next/t9n/messages.en.json +0 -1
- package/dist/components/arcgis-utility-network-trace-location-list-next/customElement.d.ts +0 -43
- package/dist/components/arcgis-utility-network-trace-location-list-next/customElement.js +0 -70
- package/dist/components/arcgis-utility-network-trace-location-next/customElement.js +0 -292
- package/dist/components/arcgis-utility-network-trace-location-next/index.d.ts +0 -1
- package/dist/components/arcgis-utility-network-trace-location-next/index.js +0 -4
- /package/dist/components/{arcgis-utility-network-trace-location-list-next → arcgis-utility-network-trace-locations}/index.d.ts +0 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { c as C } from "../../chunks/runtime.js";
|
|
3
|
+
import L from "@arcgis/core/core/Collection.js";
|
|
4
|
+
import { cutExecute as I } from "@arcgis/core/geometry/operators/cutOperator.js";
|
|
5
|
+
import { lengthExecute as w } from "@arcgis/core/geometry/operators/lengthOperator.js";
|
|
6
|
+
import { projectIsLoaded as E, projectLoad as M, projectExecute as P } from "@arcgis/core/geometry/operators/projectOperator.js";
|
|
7
|
+
import { proximityGetNearestCoordinate as _ } from "@arcgis/core/geometry/operators/proximityOperator.js";
|
|
8
|
+
import A from "@arcgis/core/geometry/Polyline.js";
|
|
9
|
+
import F from "@arcgis/core/Graphic.js";
|
|
10
|
+
import R from "@arcgis/core/layers/GraphicsLayer.js";
|
|
11
|
+
import T from "@arcgis/core/rest/networks/support/TraceLocation.js";
|
|
12
|
+
import k from "@arcgis/core/symbols/SimpleMarkerSymbol.js";
|
|
13
|
+
import B from "@arcgis/core/widgets/Sketch/SketchViewModel.js";
|
|
14
|
+
import { LitElement as N, createEvent as S } from "@arcgis/lumina";
|
|
15
|
+
import { log as d, composeMissingPropertyMessage as b } from "@arcgis/toolkit/log";
|
|
16
|
+
import { u as q } from "../../chunks/useT9n.js";
|
|
17
|
+
import { a as D, c as j, d as G, b as H } from "../../chunks/layer-utils.js";
|
|
18
|
+
import { css as O, html as p } from "lit";
|
|
19
|
+
import v from "@arcgis/core/views/interactive/snapping/FeatureSnappingLayerSource.js";
|
|
20
|
+
import { substitute as U } from "@arcgis/core/intl.js";
|
|
21
|
+
const W = O`calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}.add-location-button{--calcite-button-border-color: var(--calcite-color-border-1);--calcite-button-icon-color: var(--calcite-color-text-1);--calcite-button-text-color: var(--calcite-color-text-1)}.button-container{display:flex;justify-content:center}calcite-list{padding:0 var(--calcite-space-sm) var(--calcite-space-sm);background-color:var(--calcite-color-surface-2);border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);overflow:hidden}calcite-list-item[selected] [slot=content-bottom]{display:block}.warning{color:var(--calcite-color-status-danger)}.terminals{padding:var(--calcite-space-sm) var(--calcite-space-md);display:flex;flex-direction:column}.filter-barrier{display:flex;justify-content:space-between;align-items:center;width:100%}`, $ = `utility-network-trace-locations-sketch-${Date.now()}`;
|
|
22
|
+
class x extends N {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments), this._messages = q({ blocking: !0 }), this._isSelectWaiting = !1, this.traceLocationType = "starting-point", this.traceLocations = new L(), this.filterLayers = new L(), this.spatialTolerance = 0.05, this.autoDestroyDisabled = !1, this.arcgisTraceLocationSelectEnd = S(), this.arcgisTraceLocationSelectStart = S(), this.arcgisError = S();
|
|
25
|
+
}
|
|
26
|
+
static {
|
|
27
|
+
this.properties = { _isSelectWaiting: 16, beforeTraceLocationSelectStart: 0, afterMapInteraction: 0, view: 0, traceLocationType: 1, traceLocations: 0, filterLayers: 0, spatialTolerance: 9, error: 1, autoDestroyDisabled: 5, utilityNetwork: 0, heading: 1, sketchViewModel: 32 };
|
|
28
|
+
}
|
|
29
|
+
static {
|
|
30
|
+
this.styles = W;
|
|
31
|
+
}
|
|
32
|
+
static {
|
|
33
|
+
this.sketchViewModelMap = /* @__PURE__ */ new Map();
|
|
34
|
+
}
|
|
35
|
+
static getSketchViewModel(e) {
|
|
36
|
+
if (!this.sketchViewModelMap.has(e)) {
|
|
37
|
+
const t = this.#a(e, $);
|
|
38
|
+
t && this.sketchViewModelMap.set(e, new B({ view: e, layer: t }));
|
|
39
|
+
}
|
|
40
|
+
return this.sketchViewModelMap.get(e) ?? null;
|
|
41
|
+
}
|
|
42
|
+
static #a(e, t) {
|
|
43
|
+
if (!e?.map)
|
|
44
|
+
return null;
|
|
45
|
+
const r = e.map.findLayerById(t);
|
|
46
|
+
if (!r) {
|
|
47
|
+
const i = new R({
|
|
48
|
+
id: t,
|
|
49
|
+
listMode: "hide",
|
|
50
|
+
title: t
|
|
51
|
+
});
|
|
52
|
+
return D(e, i), i;
|
|
53
|
+
}
|
|
54
|
+
return r;
|
|
55
|
+
}
|
|
56
|
+
static removeSketchGraphicsLayer(e) {
|
|
57
|
+
if (e?.map) {
|
|
58
|
+
const t = e.map.findLayerById($);
|
|
59
|
+
t && e.map.remove(t), this.sketchViewModelMap.delete(e);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
#r;
|
|
63
|
+
get sketchViewModel() {
|
|
64
|
+
return this.view ? x.getSketchViewModel(this.view) : null;
|
|
65
|
+
}
|
|
66
|
+
async destroy() {
|
|
67
|
+
this.#i(), await this.manager.destroy();
|
|
68
|
+
}
|
|
69
|
+
async load() {
|
|
70
|
+
E() || await M();
|
|
71
|
+
}
|
|
72
|
+
willUpdate(e) {
|
|
73
|
+
e.has("filterLayers") && this.#o();
|
|
74
|
+
}
|
|
75
|
+
#e(e, t) {
|
|
76
|
+
this.error = t, d(e, this, t), this.arcgisError.emit();
|
|
77
|
+
}
|
|
78
|
+
#s(e) {
|
|
79
|
+
const { traceLocations: t, view: r } = this;
|
|
80
|
+
e.spatialProperties.flagGraphic && r && r.graphics.remove(e.spatialProperties.flagGraphic), t?.remove(e);
|
|
81
|
+
}
|
|
82
|
+
#o() {
|
|
83
|
+
if (!this.sketchViewModel)
|
|
84
|
+
return;
|
|
85
|
+
const e = new L();
|
|
86
|
+
this.filterLayers?.forEach((t) => {
|
|
87
|
+
j(t) ? t.sublayers.forEach((r) => {
|
|
88
|
+
e.add(new v({
|
|
89
|
+
layer: r,
|
|
90
|
+
enabled: !0
|
|
91
|
+
}));
|
|
92
|
+
}) : e.add(new v({
|
|
93
|
+
layer: t,
|
|
94
|
+
enabled: !0
|
|
95
|
+
}));
|
|
96
|
+
}), this.sketchViewModel.snappingOptions = {
|
|
97
|
+
enabled: !1,
|
|
98
|
+
featureSources: e
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
#n(e, t) {
|
|
102
|
+
const r = e.clone(), i = r.spatialReference, s = t.spatialReference;
|
|
103
|
+
if (!i || !s)
|
|
104
|
+
return d("warn", this, "Unable to calculate percent along because geometry is missing a spatial reference."), -1;
|
|
105
|
+
let a = t;
|
|
106
|
+
if (!i.equals(s)) {
|
|
107
|
+
const f = P(t, i);
|
|
108
|
+
if (!f)
|
|
109
|
+
return d("warn", this, "Unable to project flag point to source geometry spatial reference."), -1;
|
|
110
|
+
a = f;
|
|
111
|
+
}
|
|
112
|
+
const n = _(r, a);
|
|
113
|
+
if (n.isEmpty)
|
|
114
|
+
return d("warn", this, "Unable to compute nearest coordinate for polyline flag."), -1;
|
|
115
|
+
const o = n.coordinate, c = o.x - 0.5, l = o.y - 0.5, u = o.x + 0.5, m = o.y + 0.5, g = new A({
|
|
116
|
+
hasZ: !1,
|
|
117
|
+
hasM: !0,
|
|
118
|
+
paths: [
|
|
119
|
+
[
|
|
120
|
+
[c, l],
|
|
121
|
+
[u, m]
|
|
122
|
+
]
|
|
123
|
+
],
|
|
124
|
+
spatialReference: r.spatialReference
|
|
125
|
+
}), h = I(r, g);
|
|
126
|
+
if (h.length > 0) {
|
|
127
|
+
const f = w(r, { unit: "feet" });
|
|
128
|
+
let y;
|
|
129
|
+
return h[0].paths[0][0][0] === r.paths[0][0][0] ? y = w(h[0], { unit: "feet" }) : h.length > 1 ? y = w(h[1], { unit: "feet" }) : y = 0, y / f;
|
|
130
|
+
}
|
|
131
|
+
return d("warn", this, "Unable to cut the source geometry with the flag geometry."), -1;
|
|
132
|
+
}
|
|
133
|
+
get #c() {
|
|
134
|
+
const e = this.utilityNetwork?.dataElement?.domainNetworks;
|
|
135
|
+
return e ? e.flatMap((t) => t.edgeSources).map((t) => t.layerId).filter(Boolean) : [];
|
|
136
|
+
}
|
|
137
|
+
async #l() {
|
|
138
|
+
const { view: e, sketchViewModel: t } = this;
|
|
139
|
+
if (!(e && t)) {
|
|
140
|
+
d("error", this, "Cannot add trace location."), t || d("error", this, b("sketchViewModel")), e || d("error", this, b("view"));
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (this.beforeTraceLocationSelectStart) {
|
|
144
|
+
this._isSelectWaiting = !0;
|
|
145
|
+
try {
|
|
146
|
+
await this.beforeTraceLocationSelectStart();
|
|
147
|
+
} finally {
|
|
148
|
+
this._isSelectWaiting = !1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
await this.#t(e, t);
|
|
152
|
+
}
|
|
153
|
+
async #t(e, t) {
|
|
154
|
+
this.arcgisTraceLocationSelectStart.emit({ cancelSelect: () => t.cancel() }).defaultPrevented || (this.#r?.remove(), this.#r = t.on("create", (i) => this.#d(i, e, t)), "acquireCursor" in e && e.acquireCursor("crosshair"), t.snappingOptions.enabled = !0, t.create("point"));
|
|
155
|
+
}
|
|
156
|
+
#d(e, t, r) {
|
|
157
|
+
if (e.state === "complete" && e.graphic) {
|
|
158
|
+
r.layer.remove(e.graphic), this.#u(e, t, r);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
e.state === "cancel" && (this.#i(), this.arcgisTraceLocationSelectEnd.emit());
|
|
162
|
+
}
|
|
163
|
+
async #u(e, t, r) {
|
|
164
|
+
const { utilityNetwork: i } = this, { graphic: s } = e;
|
|
165
|
+
if (!i) {
|
|
166
|
+
d("error", this, b("utilityNetwork")), this.#i(), this.arcgisTraceLocationSelectEnd.emit();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (s?.geometry?.type !== "point") {
|
|
170
|
+
this.#e("warn", this._messages.errors.noHitResult), this.#t(t, r);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const a = s.geometry, n = t.toScreen(a);
|
|
174
|
+
if (!n) {
|
|
175
|
+
this.#e("warn", this._messages.errors.noHitResult), this.#t(t, r);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const c = (await t.hitTest(n, {
|
|
179
|
+
include: this.filterLayers
|
|
180
|
+
})).results.filter((u) => u.type === "graphic" && u?.layer && u.graphic);
|
|
181
|
+
if (!c.length) {
|
|
182
|
+
this.#e("info", this._messages.errors.noHitResult), this.#t(t, r);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.#i(), await this.#p(c, a, t) ? this.arcgisTraceLocationSelectEnd.emit() : this.#t(t, r);
|
|
186
|
+
}
|
|
187
|
+
#i() {
|
|
188
|
+
const { view: e, sketchViewModel: t } = this;
|
|
189
|
+
if (!e) {
|
|
190
|
+
d("error", this, b("view"));
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
t && (t.snappingOptions.enabled = !1), this.#r?.remove(), this.#r = void 0, "acquireCursor" in e && e.acquireCursor("default");
|
|
194
|
+
}
|
|
195
|
+
async #p(e, t, r) {
|
|
196
|
+
if (!e.length)
|
|
197
|
+
return this.#e("error", this._messages.errors.noHitResult), !1;
|
|
198
|
+
let s = e[0].graphic;
|
|
199
|
+
if (this.afterMapInteraction) {
|
|
200
|
+
const n = e.map((o) => {
|
|
201
|
+
const c = o, l = c.graphic;
|
|
202
|
+
return l.origin = c.layer, l.sourceLayer = c.layer, l;
|
|
203
|
+
});
|
|
204
|
+
try {
|
|
205
|
+
s = await this.afterMapInteraction(n);
|
|
206
|
+
} catch {
|
|
207
|
+
s = null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (!s)
|
|
211
|
+
return d("error", this, "No graphic available from hit test results."), this.arcgisTraceLocationSelectEnd.emit(), !0;
|
|
212
|
+
const a = await this.#h(s);
|
|
213
|
+
return a ? await this.#m(a, t, r) : (this.#e("error", this._messages.errors.missingAttributes), this.arcgisTraceLocationSelectEnd.emit(), !0);
|
|
214
|
+
}
|
|
215
|
+
async #h(e) {
|
|
216
|
+
const t = (G(e.layer), e.layer), r = t.geometryType === null, i = t.fieldsIndex?.get("assetgroup") ?? !1, s = t.fieldsIndex?.get("assetgroup")?.name ?? "assetgroup", a = t.fieldsIndex?.get("assettype") ?? !1, n = t.fieldsIndex?.get("assettype")?.name ?? "assettype", o = e.getGlobalId(), c = e.getObjectId(), l = i ? !!e.getAttribute(s) : !0, u = a ? !!e.getAttribute(n) : !0, m = !!e.geometry;
|
|
217
|
+
if (o && c && l && u && (m || r))
|
|
218
|
+
return e;
|
|
219
|
+
const g = t.createQuery();
|
|
220
|
+
return g.objectIds = [c], (await t.queryFeatures(g)).features[0] || null;
|
|
221
|
+
}
|
|
222
|
+
async #m(e, t, r) {
|
|
223
|
+
const { traceLocations: i } = this, s = e.getGlobalId() ?? "", a = e.geometry?.type, n = await this.#f(e, t);
|
|
224
|
+
if (!n)
|
|
225
|
+
return this.#e("error", this._messages.errors.errorGeneratingTraceLocationDetails), !1;
|
|
226
|
+
const o = i?.filter((l) => l.spatialProperties.mapGraphic?.getGlobalId() === s) ?? [];
|
|
227
|
+
if (o.length > 0) {
|
|
228
|
+
if (a !== "polyline")
|
|
229
|
+
return this.#e("warn", this._messages.errors.duplicateTraceLocationDetails), !1;
|
|
230
|
+
if (o.some((l) => Math.abs(l.traceLocation.percentAlong - n.traceLocation.percentAlong) <= this.spatialTolerance))
|
|
231
|
+
return this.#e("warn", this._messages.errors.duplicateTraceLocationDetailsWithinTolerance), !1;
|
|
232
|
+
}
|
|
233
|
+
const c = this.#y(e, t, r);
|
|
234
|
+
return c ? (n.spatialProperties.flagGraphic = c, i?.add(n), !0) : (this.#e("warn", this._messages.errors.errorAdding), !1);
|
|
235
|
+
}
|
|
236
|
+
async #f(e, t) {
|
|
237
|
+
const { traceLocationType: r, utilityNetwork: i } = this, s = e.getGlobalId() ?? "", a = e.geometry?.type, n = await this.#g(e);
|
|
238
|
+
if (a === "point" || a === "polygon") {
|
|
239
|
+
const o = i?.getTerminalConfiguration(e), c = o ? o.terminals[0].id : 1;
|
|
240
|
+
return {
|
|
241
|
+
traceLocation: new T({
|
|
242
|
+
type: r,
|
|
243
|
+
isFilterBarrier: !1,
|
|
244
|
+
globalId: s,
|
|
245
|
+
terminalId: c
|
|
246
|
+
}),
|
|
247
|
+
flagProperties: {
|
|
248
|
+
title: n,
|
|
249
|
+
expanded: !1,
|
|
250
|
+
terminalConfiguration: o ?? void 0,
|
|
251
|
+
selectedTerminals: o ? /* @__PURE__ */ new Set([c]) : void 0
|
|
252
|
+
},
|
|
253
|
+
spatialProperties: {
|
|
254
|
+
mapPoint: t,
|
|
255
|
+
mapGraphic: e
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
} else if (a === "polyline") {
|
|
259
|
+
const o = this.#n(e.geometry, t);
|
|
260
|
+
return o < 0 ? (d("warn", this, "Unable to calculate percent along for polyline flag."), null) : {
|
|
261
|
+
traceLocation: new T({
|
|
262
|
+
type: r,
|
|
263
|
+
isFilterBarrier: !1,
|
|
264
|
+
globalId: s,
|
|
265
|
+
percentAlong: o
|
|
266
|
+
}),
|
|
267
|
+
flagProperties: {
|
|
268
|
+
title: n,
|
|
269
|
+
expanded: !1,
|
|
270
|
+
terminalConfiguration: void 0,
|
|
271
|
+
selectedTerminals: void 0
|
|
272
|
+
},
|
|
273
|
+
spatialProperties: {
|
|
274
|
+
mapPoint: t,
|
|
275
|
+
mapGraphic: e
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
} else if (!a) {
|
|
279
|
+
const o = H(e.layer) ? e.layer.parent : e.layer, c = o && this.#c.includes(o.layerId), l = i?.getTerminalConfiguration(e), u = l ? l.terminals[0].id : c ? -1 : 1, m = c ? 0.5 : -1;
|
|
280
|
+
return {
|
|
281
|
+
traceLocation: new T({
|
|
282
|
+
type: r,
|
|
283
|
+
isFilterBarrier: !1,
|
|
284
|
+
globalId: s,
|
|
285
|
+
terminalId: u,
|
|
286
|
+
percentAlong: m
|
|
287
|
+
}),
|
|
288
|
+
flagProperties: {
|
|
289
|
+
title: n,
|
|
290
|
+
expanded: !1,
|
|
291
|
+
terminalConfiguration: l ?? void 0,
|
|
292
|
+
selectedTerminals: l ? /* @__PURE__ */ new Set([u]) : void 0
|
|
293
|
+
},
|
|
294
|
+
spatialProperties: {
|
|
295
|
+
mapPoint: t,
|
|
296
|
+
mapGraphic: e
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
async #g(e) {
|
|
303
|
+
const t = (G(e.layer), e.layer);
|
|
304
|
+
return ("getFeatureTitle" in t ? await t.getFeatureTitle(e) : null) || e.getObjectId()?.toString() || this._messages.unknown;
|
|
305
|
+
}
|
|
306
|
+
#y(e, t, r) {
|
|
307
|
+
const i = e.geometry ? e.geometry.type === "point" ? e.geometry : t : null, s = this.#b(), a = new F({
|
|
308
|
+
geometry: i,
|
|
309
|
+
symbol: s,
|
|
310
|
+
attributes: e.attributes
|
|
311
|
+
});
|
|
312
|
+
return r.graphics.add(a), a;
|
|
313
|
+
}
|
|
314
|
+
#b() {
|
|
315
|
+
const { traceLocationType: e } = this, t = [244, 21, 21, 0.6], r = [21, 244, 21, 0.6];
|
|
316
|
+
return e === "stopping-point" ? new k({
|
|
317
|
+
color: t,
|
|
318
|
+
style: "x",
|
|
319
|
+
size: 12,
|
|
320
|
+
outline: {
|
|
321
|
+
color: t,
|
|
322
|
+
width: 2
|
|
323
|
+
}
|
|
324
|
+
}) : e === "barrier" ? new k({
|
|
325
|
+
color: t,
|
|
326
|
+
style: "square",
|
|
327
|
+
size: 12,
|
|
328
|
+
outline: {
|
|
329
|
+
color: t,
|
|
330
|
+
width: 0
|
|
331
|
+
}
|
|
332
|
+
}) : new k({
|
|
333
|
+
color: r,
|
|
334
|
+
style: "circle",
|
|
335
|
+
size: 12,
|
|
336
|
+
outline: {
|
|
337
|
+
color: r,
|
|
338
|
+
width: 0
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
#L() {
|
|
343
|
+
const { view: e, traceLocations: t } = this;
|
|
344
|
+
t?.forEach((r) => {
|
|
345
|
+
r.spatialProperties.flagGraphic && e && e.graphics.remove(r.spatialProperties.flagGraphic);
|
|
346
|
+
}), t?.removeAll();
|
|
347
|
+
}
|
|
348
|
+
#w(e, t) {
|
|
349
|
+
const { flagProperties: r } = e, { selectedTerminals: i } = r, { name: s, id: a } = t, n = i?.has(a) ?? !1;
|
|
350
|
+
return p`<calcite-label layout=inline><calcite-checkbox .value=${a} .checked=${n} @calciteCheckboxChange=${(o) => {
|
|
351
|
+
o.target.checked ? i?.add(a) : i?.delete(a), this.requestUpdate();
|
|
352
|
+
}}></calcite-checkbox>${s}</calcite-label>`;
|
|
353
|
+
}
|
|
354
|
+
#T() {
|
|
355
|
+
return p`<calcite-notice kind=danger open scale=s width=auto><div slot=message>${this._messages.errors.noTerminalSelected}</div></calcite-notice>`;
|
|
356
|
+
}
|
|
357
|
+
#k(e) {
|
|
358
|
+
const { traceLocation: t } = e;
|
|
359
|
+
return p`<calcite-label layout=inline><div class="filter-barrier">${this._messages.labels.filterBarrier}<calcite-switch .checked=${t.isFilterBarrier} @calciteSwitchChange=${(r) => {
|
|
360
|
+
t.isFilterBarrier = r.target.checked;
|
|
361
|
+
}}></calcite-switch></div></calcite-label>`;
|
|
362
|
+
}
|
|
363
|
+
#S(e) {
|
|
364
|
+
const { flagProperties: t } = e, { terminalConfiguration: r, selectedTerminals: i } = t, s = e.traceLocation.type === "barrier", a = r && r.terminals.length > 0 && i?.size === 0;
|
|
365
|
+
return p`<calcite-action .icon=${t.expanded ? "chevron-up" : "chevron-down"} slot=actions-end scale=s text @click=${() => {
|
|
366
|
+
t.expanded = !t.expanded, this.requestUpdate();
|
|
367
|
+
}}></calcite-action>${a && p`<calcite-icon class="warning" icon=exclamation-mark-triangle scale=s slot=content-start></calcite-icon>` || ""}${t.expanded && p`<div class="terminals" slot=content-bottom>${s && this.#k(e) || ""}${r && this.#x(e) || ""}${a && this.#T() || ""}</div>` || ""}`;
|
|
368
|
+
}
|
|
369
|
+
#x(e) {
|
|
370
|
+
const { flagProperties: t } = e, { terminalConfiguration: r } = t;
|
|
371
|
+
if (!r)
|
|
372
|
+
return d("warn", this, "One or more locations are missing the required flag property `terminalConfiguration`."), [];
|
|
373
|
+
const i = r.terminals;
|
|
374
|
+
return i.length ? i.length === 1 ? [] : i.map((a) => this.#w(e, a)) : (d("warn", this, "`terminalConfiguration.terminals` is required but either missing or empty.`"), []);
|
|
375
|
+
}
|
|
376
|
+
#G(e) {
|
|
377
|
+
const { flagProperties: t } = e, { terminalConfiguration: r, expanded: i, title: s } = t, a = r && r.id !== 0, n = e.traceLocation.type === "barrier", o = a || n, c = r?.name ?? void 0;
|
|
378
|
+
return p`<calcite-list-item .label=${s} .description=${c} .value=${s} .expanded=${i}>${o ? this.#S(e) : p`<div slot=content-bottom></div>`}<calcite-action icon=x slot=actions-end scale=s text @click=${() => this.#s(e)}></calcite-action></calcite-list-item>`;
|
|
379
|
+
}
|
|
380
|
+
#v(e) {
|
|
381
|
+
if (!e.length)
|
|
382
|
+
return null;
|
|
383
|
+
const { traceLocationType: t } = this, r = e.map((s) => this.#G(s)).toArray(), i = U(this._messages.labels.list, { type: t });
|
|
384
|
+
return p`<div><calcite-list interaction-mode=static selection-mode=none .label=${i}>${r}</calcite-list></div>`;
|
|
385
|
+
}
|
|
386
|
+
#$() {
|
|
387
|
+
const { traceLocationType: e, _messages: t, traceLocations: r, heading: i } = this, s = e === "starting-point" ? t.types.startingPoint : e === "barrier" ? t.types.barrier : t.types.stoppingPoint, a = i ?? s.heading, n = s.description, o = s.buttonText;
|
|
388
|
+
return p`<calcite-block .heading=${a} .label=${a} expanded .description=${n}>${r?.length ? p`<calcite-button slot=actions-end appearance=transparent .label=${t.buttons.clear} @click=${() => this.#L()}>${t.buttons.clear}</calcite-button>${this.#v(r)}` : null}<div class="button-container"><calcite-button .loading=${this._isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${o} @click=${() => this.#l()}>${o}</calcite-button></div></calcite-block>`;
|
|
389
|
+
}
|
|
390
|
+
render() {
|
|
391
|
+
return this.#$();
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
C("arcgis-utility-network-trace-locations", x);
|
|
395
|
+
export {
|
|
396
|
+
x as ArcgisUtilityNetworkTraceLocations
|
|
397
|
+
};
|
|
@@ -6,4 +6,6 @@ import "@esri/calcite-components/components/calcite-action";
|
|
|
6
6
|
import "@esri/calcite-components/components/calcite-icon";
|
|
7
7
|
import "@esri/calcite-components/components/calcite-list-item";
|
|
8
8
|
import "@esri/calcite-components/components/calcite-list";
|
|
9
|
+
import "@esri/calcite-components/components/calcite-block";
|
|
10
|
+
import "@esri/calcite-components/components/calcite-button";
|
|
9
11
|
export * from "./customElement.js";
|
|
@@ -84,7 +84,7 @@ export type State = Disabled | Executing | Loading | Ready | Success | ValidateN
|
|
|
84
84
|
*
|
|
85
85
|
* ```html
|
|
86
86
|
* <calcite-shell>
|
|
87
|
-
* <calcite-shell-panel slot="panel-start" position="start" width
|
|
87
|
+
* <calcite-shell-panel slot="panel-start" position="start" width="l">
|
|
88
88
|
* <arcgis-utility-network-validate-network-topology reference-element="#map-element"></arcgis-utility-network-validate-network-topology>
|
|
89
89
|
* </calcite-shell-panel>
|
|
90
90
|
* <arcgis-map id="map-element" item-id="471eb0bf37074b1fbb972b1da70fb310"></arcgis-map>
|
|
@@ -240,7 +240,7 @@ class z extends U {
|
|
|
240
240
|
}
|
|
241
241
|
render() {
|
|
242
242
|
const e = this._renderStatusIcon(), t = this._renderValidateNetworkTopologyAction(), i = this._renderValidateNetworkTopologyActionTooltip(), a = this._renderUtilityNetworkCombobox(), o = this._renderExtentToValidateCombobox(), s = this._renderInfoNotice();
|
|
243
|
-
return r`<calcite-panel .loading=${this.state.type === "loading"}><calcite-block
|
|
243
|
+
return r`<calcite-panel .loading=${this.state.type === "loading"}><calcite-block expandable expanded .heading=${this.label}>${e}${t}${a}${o}${s}</calcite-block>${i}</calcite-panel>`;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
N("arcgis-utility-network-validate-network-topology", z);
|