@arcgis/map-components 5.2.0-next.43 → 5.2.0-next.45
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/{UYCPX64L.js → 35EU7G2H.js} +1 -1
- package/dist/cdn/3BU2B6F7.js +2 -0
- package/dist/cdn/3HHUVV6D.js +2 -0
- package/dist/cdn/{OENFGUIN.js → 5KMBHKTM.js} +1 -1
- package/dist/cdn/CWFOZVE7.js +2 -0
- package/dist/cdn/J6ZHNOE2.js +2 -0
- package/dist/cdn/MUAJSX4F.js +2 -0
- package/dist/cdn/MUFXNQE3.js +2 -0
- package/dist/cdn/{JXHS44R7.js → NXOZVS4Z.js} +1 -1
- package/dist/cdn/{DAEEPAST.js → OW2CJGSF.js} +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/unit-select/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/utility-network-trace-location/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/utility-network-trace-location-list/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/layer-utils.js +3 -3
- package/dist/components/arcgis-daylight/customElement.js +1 -1
- package/dist/components/arcgis-elevation-profile/customElement.d.ts +4 -2
- package/dist/components/arcgis-feature-templates/customElement.js +1 -1
- package/dist/components/arcgis-feature-utility-network-association-list/customElement.js +1 -1
- package/dist/components/arcgis-feature-utility-network-associations/customElement.js +11 -11
- package/dist/components/arcgis-unit-radio-button-group/customElement.js +10 -7
- package/dist/components/arcgis-unit-select/customElement.js +6 -3
- package/dist/components/arcgis-utility-network-aggregated-geometry/customElement.d.ts +0 -2
- package/dist/components/arcgis-utility-network-aggregated-geometry/customElement.js +15 -18
- package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +58 -59
- package/dist/components/arcgis-utility-network-trace-inputs/customElement.d.ts +17 -9
- package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +125 -126
- package/dist/components/arcgis-utility-network-trace-location/customElement.d.ts +34 -29
- package/dist/components/arcgis-utility-network-trace-location/customElement.js +128 -127
- package/dist/components/arcgis-utility-network-trace-location-list/customElement.d.ts +6 -4
- package/dist/components/arcgis-utility-network-trace-location-list/customElement.js +31 -32
- package/dist/components/arcgis-utility-network-trace-results/customElement.d.ts +10 -9
- package/dist/components/arcgis-utility-network-trace-results/customElement.js +22 -22
- 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 +3 -3
- package/dist/types/lumina.d.ts +4 -5
- package/dist/types/preact.d.ts +4 -5
- package/dist/types/react.d.ts +4 -5
- package/dist/types/stencil.d.ts +4 -5
- package/package.json +4 -4
- package/dist/cdn/3AKY7DQG.js +0 -2
- package/dist/cdn/BIZFPS3V.js +0 -2
- package/dist/cdn/CNV6ALQO.js +0 -2
- package/dist/cdn/DNSZMLAX.js +0 -2
- package/dist/cdn/HKEXPCDW.js +0 -2
- package/dist/cdn/JQ35LUF5.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
2
|
+
import { c as x } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as C, html as b } from "lit";
|
|
4
4
|
import * as G from "@arcgis/core/geometry/operators/cutOperator.js";
|
|
5
5
|
import * as T from "@arcgis/core/geometry/operators/lengthOperator.js";
|
|
6
6
|
import * as L from "@arcgis/core/geometry/operators/projectOperator.js";
|
|
@@ -10,19 +10,19 @@ import A from "@arcgis/core/Graphic.js";
|
|
|
10
10
|
import w from "@arcgis/core/rest/networks/support/TraceLocation.js";
|
|
11
11
|
import S from "@arcgis/core/symbols/SimpleMarkerSymbol.js";
|
|
12
12
|
import { LitElement as F, createEvent as _ } from "@arcgis/lumina";
|
|
13
|
-
import { log as
|
|
13
|
+
import { log as l, composeMissingPropertyMessage as m } from "@arcgis/toolkit/log";
|
|
14
14
|
import { u as N } from "../../chunks/useT9n.js";
|
|
15
|
-
import { d as k,
|
|
16
|
-
const
|
|
15
|
+
import { d as k, b as P } from "../../chunks/layer-utils.js";
|
|
16
|
+
const R = C`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}`;
|
|
17
17
|
class E extends F {
|
|
18
18
|
constructor() {
|
|
19
|
-
super(...arguments), this.
|
|
19
|
+
super(...arguments), this._messages = N({ blocking: !0 }), this.isSelectWaiting = !1, this.traceLocationType = "starting-point", this.spatialTolerance = 0.05, this.autoDestroyDisabled = !1, this.arcgisTraceLocationChange = _(), this.arcgisTraceLocationSelectEnd = _(), this.arcgisTraceLocationSelectStart = _();
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
22
|
this.properties = { isSelectWaiting: 16, beforeTraceLocationSelectStart: 0, afterHitTest: 0, view: 0, traceLocationType: 1, traceLocations: 0, filterLayers: 0, sketchViewModel: 0, spatialTolerance: 9, autoDestroyDisabled: 5, utilityNetwork: 0 };
|
|
23
23
|
}
|
|
24
24
|
static {
|
|
25
|
-
this.styles =
|
|
25
|
+
this.styles = R;
|
|
26
26
|
}
|
|
27
27
|
async destroy() {
|
|
28
28
|
this._resetCursor(), await this.manager.destroy();
|
|
@@ -30,26 +30,26 @@ class E extends F {
|
|
|
30
30
|
async load() {
|
|
31
31
|
L.isLoaded() || await L.load();
|
|
32
32
|
}
|
|
33
|
-
_calculatePercentAlong(
|
|
34
|
-
const r =
|
|
35
|
-
if (!
|
|
36
|
-
return
|
|
37
|
-
let
|
|
38
|
-
if (!
|
|
39
|
-
const h = L.execute(
|
|
33
|
+
_calculatePercentAlong(t, e) {
|
|
34
|
+
const r = t.clone(), o = r.spatialReference, i = e.spatialReference;
|
|
35
|
+
if (!o || !i)
|
|
36
|
+
return l("warn", this, "Unable to calculate percent along because geometry is missing a spatial reference."), -1;
|
|
37
|
+
let s = e;
|
|
38
|
+
if (!o.equals(i)) {
|
|
39
|
+
const h = L.execute(e, o);
|
|
40
40
|
if (!h)
|
|
41
|
-
return
|
|
42
|
-
|
|
41
|
+
return l("warn", this, "Unable to project flag point to source geometry spatial reference."), -1;
|
|
42
|
+
s = h;
|
|
43
43
|
}
|
|
44
|
-
const n = I.getNearestCoordinate(r,
|
|
44
|
+
const n = I.getNearestCoordinate(r, s);
|
|
45
45
|
if (n.isEmpty)
|
|
46
|
-
return
|
|
47
|
-
const
|
|
46
|
+
return l("warn", this, "Unable to compute nearest coordinate for polyline flag."), -1;
|
|
47
|
+
const a = n.coordinate, c = a.x - 0.5, u = a.y - 0.5, p = a.x + 0.5, d = a.y + 0.5, g = new v({
|
|
48
48
|
hasZ: !1,
|
|
49
49
|
hasM: !0,
|
|
50
50
|
paths: [
|
|
51
51
|
[
|
|
52
|
-
[
|
|
52
|
+
[c, u],
|
|
53
53
|
[p, d]
|
|
54
54
|
]
|
|
55
55
|
],
|
|
@@ -60,16 +60,16 @@ class E extends F {
|
|
|
60
60
|
let y;
|
|
61
61
|
return f[0].paths[0][0][0] === r.paths[0][0][0] ? y = T.execute(f[0], { unit: "feet" }) : f.length > 1 ? y = T.execute(f[1], { unit: "feet" }) : y = 0, y / h;
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return l("warn", this, "Unable to cut the source geometry with the flag geometry."), -1;
|
|
64
64
|
}
|
|
65
65
|
get _edgeSourceLayerIds() {
|
|
66
|
-
const
|
|
67
|
-
return
|
|
66
|
+
const t = this.utilityNetwork?.dataElement?.domainNetworks;
|
|
67
|
+
return t ? t.flatMap((e) => e.edgeSources).map((e) => e.layerId).filter(Boolean) : [];
|
|
68
68
|
}
|
|
69
69
|
async _handleAddButtonClick() {
|
|
70
|
-
const { view:
|
|
71
|
-
if (!(
|
|
72
|
-
|
|
70
|
+
const { view: t, sketchViewModel: e } = this;
|
|
71
|
+
if (!(t && e)) {
|
|
72
|
+
l("error", this, "Cannot add trace location."), e || l("error", this, m("sketchViewModel")), t || l("error", this, m("view"));
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
if (this.beforeTraceLocationSelectStart) {
|
|
@@ -80,120 +80,121 @@ class E extends F {
|
|
|
80
80
|
this.isSelectWaiting = !1;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
await this._startSketch(
|
|
83
|
+
await this._startSketch(t, e);
|
|
84
84
|
}
|
|
85
|
-
async _startSketch(
|
|
86
|
-
this.arcgisTraceLocationSelectStart.emit({ cancelSelect: () =>
|
|
85
|
+
async _startSketch(t, e) {
|
|
86
|
+
this.arcgisTraceLocationSelectStart.emit({ cancelSelect: () => e.cancel() }).defaultPrevented || (this._clickHandler?.remove(), this._clickHandler = e.on("create", (o) => this._handleSketchComplete(o, t, e)), "acquireCursor" in t && t.acquireCursor("crosshair"), e.snappingOptions.enabled = !0, e.create("point"));
|
|
87
87
|
}
|
|
88
|
-
_handleSketchComplete(
|
|
89
|
-
if (
|
|
90
|
-
r.layer.remove(
|
|
88
|
+
_handleSketchComplete(t, e, r) {
|
|
89
|
+
if (t.state === "complete" && t.graphic) {
|
|
90
|
+
r.layer.remove(t.graphic), this._performHitTest(t, e, r);
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
t.state === "cancel" && (this._resetCursor(), this.arcgisTraceLocationSelectEnd.emit());
|
|
94
94
|
}
|
|
95
|
-
async _performHitTest(
|
|
96
|
-
const { utilityNetwork:
|
|
97
|
-
if (!
|
|
98
|
-
|
|
95
|
+
async _performHitTest(t, e, r) {
|
|
96
|
+
const { utilityNetwork: o } = this, { graphic: i } = t;
|
|
97
|
+
if (!o) {
|
|
98
|
+
l("error", this, m("utilityNetwork")), this._resetCursor(), this.arcgisTraceLocationSelectEnd.emit();
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
if (
|
|
102
|
-
|
|
101
|
+
if (i?.geometry?.type !== "point") {
|
|
102
|
+
l("warn", this, "No screen point available for hit test."), this._startSketch(e, r);
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
const
|
|
105
|
+
const s = i.geometry, n = e.toScreen(s);
|
|
106
106
|
if (!n) {
|
|
107
|
-
|
|
107
|
+
l("warn", this, "No screen point available for hit test."), this._startSketch(e, r);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
const
|
|
110
|
+
const c = (await e.hitTest(n, {
|
|
111
111
|
include: this.filterLayers
|
|
112
112
|
})).results.filter((p) => p.type === "graphic" && p?.layer && p.graphic);
|
|
113
|
-
if (!
|
|
114
|
-
|
|
113
|
+
if (!c.length) {
|
|
114
|
+
l("info", this, "No usable hit test results found."), this._startSketch(e, r);
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
this._resetCursor(), await this._processHitTestResults(
|
|
117
|
+
this._resetCursor(), await this._processHitTestResults(c, s, e) ? this.arcgisTraceLocationSelectEnd.emit() : this._startSketch(e, r);
|
|
118
118
|
}
|
|
119
119
|
_resetCursor() {
|
|
120
|
-
const { view:
|
|
121
|
-
if (!
|
|
122
|
-
|
|
120
|
+
const { view: t, sketchViewModel: e } = this;
|
|
121
|
+
if (!t) {
|
|
122
|
+
l("error", this, m("view"));
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
e && (e.snappingOptions.enabled = !1), this._clickHandler?.remove(), this._clickHandler = void 0, "acquireCursor" in t && t.acquireCursor("default");
|
|
126
126
|
}
|
|
127
|
-
async _processHitTestResults(
|
|
128
|
-
if (!
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
async _processHitTestResults(t, e, r) {
|
|
128
|
+
if (!t.length)
|
|
129
|
+
return l("error", this, "There are no hit test results to process."), !1;
|
|
130
|
+
let i = t[0].graphic;
|
|
131
|
+
if (this.afterHitTest) {
|
|
132
|
+
const n = t.map((a) => {
|
|
133
|
+
const c = a, u = c.graphic;
|
|
134
|
+
return u.origin = c.layer, u.sourceLayer = c.layer, u;
|
|
135
|
+
});
|
|
136
136
|
try {
|
|
137
|
-
|
|
137
|
+
i = await this.afterHitTest(n);
|
|
138
138
|
} catch {
|
|
139
|
-
|
|
139
|
+
i = null;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
}
|
|
142
|
+
if (!i)
|
|
143
|
+
return l("error", this, "No graphic available from hit test results."), this.arcgisTraceLocationSelectEnd.emit(), !0;
|
|
144
|
+
const s = await this._getGraphicWithAttributes(i);
|
|
145
|
+
return s ? await this._addTraceLocation(s, e, r) : (l("error", this, "Unable to ensure necessary attributes on the selected graphic."), this.arcgisTraceLocationSelectEnd.emit(), !0);
|
|
145
146
|
}
|
|
146
|
-
async
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
return
|
|
150
|
-
const g =
|
|
151
|
-
return g.objectIds = [
|
|
147
|
+
async _getGraphicWithAttributes(t) {
|
|
148
|
+
const e = (k(t.layer), t.layer), r = e.geometryType === null, o = e.fieldsIndex?.get("assetgroup") ?? !1, i = e.fieldsIndex?.get("assetgroup")?.name ?? "assetgroup", s = e.fieldsIndex?.get("assettype") ?? !1, n = e.fieldsIndex?.get("assettype")?.name ?? "assettype", a = t.getGlobalId(), c = t.getObjectId(), u = o ? !!t.getAttribute(i) : !0, p = s ? !!t.getAttribute(n) : !0, d = !!t.geometry;
|
|
149
|
+
if (a && c && u && p && (d || r))
|
|
150
|
+
return t;
|
|
151
|
+
const g = e.createQuery();
|
|
152
|
+
return g.objectIds = [c], (await e.queryFeatures(g)).features[0] || null;
|
|
152
153
|
}
|
|
153
|
-
async
|
|
154
|
-
const { traceLocations:
|
|
154
|
+
async _addTraceLocation(t, e, r) {
|
|
155
|
+
const { traceLocations: o } = this, i = t.getGlobalId() ?? "", s = t.geometry?.type, n = await this._generateFlagInfo(t, e);
|
|
155
156
|
if (!n)
|
|
156
|
-
return
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
159
|
-
if (
|
|
160
|
-
return
|
|
161
|
-
if (
|
|
162
|
-
return
|
|
157
|
+
return l("error", this, "Unable to generate flag info for trace location."), !1;
|
|
158
|
+
const a = o?.filter((u) => u.spatialProperties.mapGraphic?.getGlobalId() === i) ?? [];
|
|
159
|
+
if (a.length > 0) {
|
|
160
|
+
if (s !== "polyline")
|
|
161
|
+
return l("warn", this, "A flag with the same globalId already exists."), !1;
|
|
162
|
+
if (a.some((u) => Math.abs(u.traceLocation.percentAlong - n.traceLocation.percentAlong) <= this.spatialTolerance))
|
|
163
|
+
return l("warn", this, "A flag with the same globalId already exists within tolerance."), !1;
|
|
163
164
|
}
|
|
164
|
-
const
|
|
165
|
-
return
|
|
165
|
+
const c = this._addFlagGraphicToMap(t, e, r);
|
|
166
|
+
return c ? (n.spatialProperties.flagGraphic = c, o?.add(n), !0) : (l("warn", this, "Unable to add flag graphic."), !1);
|
|
166
167
|
}
|
|
167
|
-
async _generateFlagInfo(
|
|
168
|
-
const { traceLocationType: r, utilityNetwork:
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
168
|
+
async _generateFlagInfo(t, e) {
|
|
169
|
+
const { traceLocationType: r, utilityNetwork: o } = this, i = t.getGlobalId() ?? "", s = t.geometry?.type, n = await this._generateItemTitle(t);
|
|
170
|
+
if (s === "point" || s === "polygon") {
|
|
171
|
+
const a = o?.getTerminalConfiguration(t), c = a ? a.terminals[0].id : 1;
|
|
171
172
|
return {
|
|
172
173
|
traceLocation: new w({
|
|
173
174
|
type: r,
|
|
174
175
|
isFilterBarrier: !1,
|
|
175
|
-
globalId:
|
|
176
|
-
terminalId:
|
|
176
|
+
globalId: i,
|
|
177
|
+
terminalId: c
|
|
177
178
|
}),
|
|
178
179
|
flagProperties: {
|
|
179
180
|
title: n,
|
|
180
181
|
expanded: !1,
|
|
181
|
-
terminalConfiguration:
|
|
182
|
-
selectedTerminals:
|
|
182
|
+
terminalConfiguration: a ?? void 0,
|
|
183
|
+
selectedTerminals: a ? /* @__PURE__ */ new Set([c]) : void 0
|
|
183
184
|
},
|
|
184
185
|
spatialProperties: {
|
|
185
|
-
mapPoint:
|
|
186
|
-
mapGraphic:
|
|
186
|
+
mapPoint: e,
|
|
187
|
+
mapGraphic: t
|
|
187
188
|
}
|
|
188
189
|
};
|
|
189
|
-
} else if (
|
|
190
|
-
const
|
|
191
|
-
return
|
|
190
|
+
} else if (s === "polyline") {
|
|
191
|
+
const a = this._calculatePercentAlong(t.geometry, e);
|
|
192
|
+
return a < 0 ? (l("warn", this, "Unable to calculate percent along for polyline flag."), null) : {
|
|
192
193
|
traceLocation: new w({
|
|
193
194
|
type: r,
|
|
194
195
|
isFilterBarrier: !1,
|
|
195
|
-
globalId:
|
|
196
|
-
percentAlong:
|
|
196
|
+
globalId: i,
|
|
197
|
+
percentAlong: a
|
|
197
198
|
}),
|
|
198
199
|
flagProperties: {
|
|
199
200
|
title: n,
|
|
@@ -202,17 +203,17 @@ class E extends F {
|
|
|
202
203
|
selectedTerminals: void 0
|
|
203
204
|
},
|
|
204
205
|
spatialProperties: {
|
|
205
|
-
mapPoint:
|
|
206
|
-
mapGraphic:
|
|
206
|
+
mapPoint: e,
|
|
207
|
+
mapGraphic: t
|
|
207
208
|
}
|
|
208
209
|
};
|
|
209
|
-
} else if (!
|
|
210
|
-
const
|
|
210
|
+
} else if (!s) {
|
|
211
|
+
const a = P(t.layer) ? t.layer.parent : t.layer, c = a && this._edgeSourceLayerIds.includes(a.layerId), u = o?.getTerminalConfiguration(t), p = u ? u.terminals[0].id : c ? -1 : 1, d = c ? 0.5 : -1;
|
|
211
212
|
return {
|
|
212
213
|
traceLocation: new w({
|
|
213
214
|
type: r,
|
|
214
215
|
isFilterBarrier: !1,
|
|
215
|
-
globalId:
|
|
216
|
+
globalId: i,
|
|
216
217
|
terminalId: p,
|
|
217
218
|
percentAlong: d
|
|
218
219
|
}),
|
|
@@ -223,41 +224,41 @@ class E extends F {
|
|
|
223
224
|
selectedTerminals: u ? /* @__PURE__ */ new Set([p]) : void 0
|
|
224
225
|
},
|
|
225
226
|
spatialProperties: {
|
|
226
|
-
mapPoint:
|
|
227
|
-
mapGraphic:
|
|
227
|
+
mapPoint: e,
|
|
228
|
+
mapGraphic: t
|
|
228
229
|
}
|
|
229
230
|
};
|
|
230
231
|
}
|
|
231
232
|
return null;
|
|
232
233
|
}
|
|
233
|
-
async _generateItemTitle(
|
|
234
|
-
const
|
|
235
|
-
return ("getFeatureTitle" in
|
|
234
|
+
async _generateItemTitle(t) {
|
|
235
|
+
const e = (k(t.layer), t.layer);
|
|
236
|
+
return ("getFeatureTitle" in e ? await e.getFeatureTitle(t) : null) || t.getObjectId()?.toString() || this._messages.unknown;
|
|
236
237
|
}
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
geometry:
|
|
240
|
-
symbol:
|
|
241
|
-
attributes:
|
|
238
|
+
_addFlagGraphicToMap(t, e, r) {
|
|
239
|
+
const o = t.geometry ? t.geometry.type === "point" ? t.geometry : e : null, i = this._getFlagSymbol(), s = new A({
|
|
240
|
+
geometry: o,
|
|
241
|
+
symbol: i,
|
|
242
|
+
attributes: t.attributes
|
|
242
243
|
});
|
|
243
|
-
return r.graphics.add(
|
|
244
|
+
return r.graphics.add(s), s;
|
|
244
245
|
}
|
|
245
|
-
|
|
246
|
-
const { traceLocationType:
|
|
247
|
-
return
|
|
248
|
-
color:
|
|
246
|
+
_getFlagSymbol() {
|
|
247
|
+
const { traceLocationType: t } = this, e = [244, 21, 21, 0.6], r = [21, 244, 21, 0.6];
|
|
248
|
+
return t === "stopping-point" ? new S({
|
|
249
|
+
color: e,
|
|
249
250
|
style: "x",
|
|
250
251
|
size: 12,
|
|
251
252
|
outline: {
|
|
252
|
-
color:
|
|
253
|
+
color: e,
|
|
253
254
|
width: 2
|
|
254
255
|
}
|
|
255
|
-
}) :
|
|
256
|
-
color:
|
|
256
|
+
}) : t === "barrier" ? new S({
|
|
257
|
+
color: e,
|
|
257
258
|
style: "square",
|
|
258
259
|
size: 12,
|
|
259
260
|
outline: {
|
|
260
|
-
color:
|
|
261
|
+
color: e,
|
|
261
262
|
width: 0
|
|
262
263
|
}
|
|
263
264
|
}) : new S({
|
|
@@ -271,20 +272,20 @@ class E extends F {
|
|
|
271
272
|
});
|
|
272
273
|
}
|
|
273
274
|
_handleClearButtonClick() {
|
|
274
|
-
const { view:
|
|
275
|
-
|
|
276
|
-
r.spatialProperties.flagGraphic &&
|
|
277
|
-
}),
|
|
275
|
+
const { view: t, traceLocations: e } = this;
|
|
276
|
+
e?.forEach((r) => {
|
|
277
|
+
r.spatialProperties.flagGraphic && t && t.graphics.remove(r.spatialProperties.flagGraphic);
|
|
278
|
+
}), e?.removeAll();
|
|
278
279
|
}
|
|
279
280
|
renderAddLocationBlock() {
|
|
280
|
-
const { traceLocationType:
|
|
281
|
-
return b`<calcite-block .heading=${
|
|
281
|
+
const { traceLocationType: t, _messages: e, traceLocations: r, view: o } = this, i = t === "starting-point" ? e.types.startingPoint : t === "barrier" ? e.types.barrier : e.types.stoppingPoint, s = i.heading, n = i.description, a = i.buttonText;
|
|
282
|
+
return b`<calcite-block .heading=${s} .label=${s} expanded .description=${n}>${r?.length ? b`<calcite-button slot=actions-end appearance=transparent .label=${e.buttons.clear} @click=${() => this._handleClearButtonClick()}>${e.buttons.clear}</calcite-button><arcgis-utility-network-trace-location-list .traceLocations=${r} .traceLocationType=${t} .view=${o}></arcgis-utility-network-trace-location-list>` : null}<div class="button-container"><calcite-button .loading=${this.isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${a} @click=${() => this._handleAddButtonClick()}>${a}</calcite-button></div></calcite-block>`;
|
|
282
283
|
}
|
|
283
284
|
render() {
|
|
284
285
|
return b`<div class="root">${this.renderAddLocationBlock()}</div>`;
|
|
285
286
|
}
|
|
286
287
|
}
|
|
287
|
-
|
|
288
|
+
x("arcgis-utility-network-trace-location", E);
|
|
288
289
|
export {
|
|
289
290
|
E as ArcgisUtilityNetworkTraceLocation
|
|
290
291
|
};
|
|
@@ -7,7 +7,6 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* This is a sub-component used by the **ArcgisUtilityNetworkTraceAnalysis** component.
|
|
10
|
-
*
|
|
11
10
|
* This sub-component renders a collection of trace locations as a list.
|
|
12
11
|
*
|
|
13
12
|
* @since 4.34
|
|
@@ -21,21 +20,24 @@ export abstract class ArcgisUtilityNetworkTraceLocationList extends LitElement {
|
|
|
21
20
|
labels: {
|
|
22
21
|
filterBarrier: string;
|
|
23
22
|
list: string;
|
|
24
|
-
unknown: string;
|
|
25
23
|
};
|
|
24
|
+
unknown: string;
|
|
26
25
|
} & T9nMeta<{
|
|
27
26
|
componentLabel: string;
|
|
28
27
|
errors: { noTerminalSelected: string; };
|
|
29
28
|
labels: {
|
|
30
29
|
filterBarrier: string;
|
|
31
30
|
list: string;
|
|
32
|
-
unknown: string;
|
|
33
31
|
};
|
|
32
|
+
unknown: string;
|
|
34
33
|
}>;
|
|
35
34
|
/** @required */
|
|
36
35
|
accessor traceLocations: Collection<FlagInfo>;
|
|
37
36
|
/** @default "starting-point" */
|
|
38
37
|
accessor traceLocationType: TraceLocationType;
|
|
39
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* The view associated with the component.
|
|
40
|
+
* > **Note:** The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this `view` property which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-utility-network-trace-location-list component will be associated with a map or scene component rather than using the `view` property.
|
|
41
|
+
*/
|
|
40
42
|
accessor view: MapView | undefined;
|
|
41
43
|
}
|
|
@@ -1,71 +1,70 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as m } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as h, html as
|
|
3
|
+
import { css as h, html as c } from "lit";
|
|
4
4
|
import p from "@arcgis/core/core/Collection.js";
|
|
5
5
|
import { substitute as u } from "@arcgis/core/intl.js";
|
|
6
6
|
import { LitElement as g } from "@arcgis/lumina";
|
|
7
|
-
import { log as
|
|
8
|
-
import { u as
|
|
9
|
-
const
|
|
10
|
-
class
|
|
7
|
+
import { log as l, composeEmptyPropertyMessage as b } from "@arcgis/toolkit/log";
|
|
8
|
+
import { u as v } from "../../chunks/useT9n.js";
|
|
9
|
+
const f = h`:host{padding:0 var(--calcite-spacing-sm) var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}calcite-list{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-spacing-sm) var(--calcite-spacing-md);display:flex;flex-direction:column}.filter-barrier{display:flex;justify-content:space-between;align-items:center;width:100%}`;
|
|
10
|
+
class $ extends g {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(...arguments), this._messages =
|
|
12
|
+
super(...arguments), this._messages = v({ blocking: !0 }), this.traceLocations = new p(), this.traceLocationType = "starting-point";
|
|
13
13
|
}
|
|
14
14
|
static {
|
|
15
15
|
this.properties = { traceLocations: 0, traceLocationType: 1, view: 0 };
|
|
16
16
|
}
|
|
17
17
|
static {
|
|
18
|
-
this.styles =
|
|
18
|
+
this.styles = f;
|
|
19
19
|
}
|
|
20
20
|
loaded() {
|
|
21
|
-
this.traceLocations.length ||
|
|
21
|
+
this.traceLocations.length || l("warn", this, b("traceLocations"));
|
|
22
22
|
}
|
|
23
23
|
_handleTraceLocationItemRemoved(e) {
|
|
24
24
|
const { traceLocations: i, view: t } = this;
|
|
25
25
|
e.spatialProperties.flagGraphic && t && t.graphics.remove(e.spatialProperties.flagGraphic), i?.remove(e);
|
|
26
26
|
}
|
|
27
27
|
_renderTerminal(e, i) {
|
|
28
|
-
const { flagProperties: t } = e, { selectedTerminals: r } = t;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return n`<calcite-label layout=inline><calcite-checkbox .value=${a} .checked=${o} @calciteCheckboxChange=${(l) => {
|
|
33
|
-
l.target.checked ? r?.add(a) : r?.delete(a), this.requestUpdate();
|
|
34
|
-
}}></calcite-checkbox>${c}</calcite-label>`;
|
|
28
|
+
const { flagProperties: t } = e, { selectedTerminals: r } = t, { name: s, id: a } = i, n = r?.has(a) ?? !1;
|
|
29
|
+
return c`<calcite-label layout=inline><calcite-checkbox .value=${a} .checked=${n} @calciteCheckboxChange=${(o) => {
|
|
30
|
+
o.target.checked ? r?.add(a) : r?.delete(a), this.requestUpdate();
|
|
31
|
+
}}></calcite-checkbox>${s}</calcite-label>`;
|
|
35
32
|
}
|
|
36
33
|
_renderTerminalError() {
|
|
37
|
-
|
|
38
|
-
return n`<calcite-notice kind=danger open scale=s width=auto><div slot=message>${e.errors.noTerminalSelected}</div></calcite-notice>`;
|
|
34
|
+
return c`<calcite-notice kind=danger open scale=s width=auto><div slot=message>${this._messages.errors.noTerminalSelected}</div></calcite-notice>`;
|
|
39
35
|
}
|
|
40
36
|
_renderFilterBarrier(e) {
|
|
41
|
-
const {
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
}}></calcite-switch></div></calcite-label
|
|
37
|
+
const { traceLocation: i } = e;
|
|
38
|
+
return c`<calcite-label layout=inline><div class="filter-barrier">${this._messages.labels.filterBarrier}<calcite-switch .checked=${i.isFilterBarrier} @calciteSwitchChange=${(t) => {
|
|
39
|
+
i.isFilterBarrier = t.target.checked;
|
|
40
|
+
}}></calcite-switch></div></calcite-label>`;
|
|
45
41
|
}
|
|
46
42
|
_renderContents(e) {
|
|
47
|
-
const { flagProperties: i } = e, { terminalConfiguration: t, selectedTerminals: r } = i,
|
|
48
|
-
return
|
|
43
|
+
const { flagProperties: i } = e, { terminalConfiguration: t, selectedTerminals: r } = i, s = e.traceLocation.type === "barrier", a = t && t.terminals.length > 0 && r?.size === 0;
|
|
44
|
+
return c`<calcite-action .icon=${i.expanded ? "chevron-up" : "chevron-down"} slot=actions-end scale=s text @click=${() => {
|
|
49
45
|
i.expanded = !i.expanded, this.requestUpdate();
|
|
50
|
-
}}></calcite-action>${a &&
|
|
46
|
+
}}></calcite-action>${a && c`<calcite-icon class="warning" icon=exclamation-mark-triangle scale=s slot=content-start></calcite-icon>` || ""}${i.expanded && c`<div class="terminals" slot=content-bottom>${s && this._renderFilterBarrier(e) || ""}${t && this._renderTerminals(e) || ""}${a && this._renderTerminalError() || ""}</div>` || ""}`;
|
|
51
47
|
}
|
|
52
48
|
_renderTerminals(e) {
|
|
53
49
|
const { flagProperties: i } = e, { terminalConfiguration: t } = i;
|
|
54
50
|
if (!t)
|
|
55
|
-
return
|
|
51
|
+
return l("warn", this, "One or more locations are missing the required flag property `terminalConfiguration`."), [];
|
|
56
52
|
const r = t.terminals;
|
|
57
|
-
return
|
|
53
|
+
return r.length ? r.length === 1 ? [] : r.map((a) => this._renderTerminal(e, a)) : (l("warn", this, "`terminalConfiguration.terminals` is required but either missing or empty.`"), []);
|
|
58
54
|
}
|
|
59
55
|
_renderListItem(e) {
|
|
60
|
-
const { flagProperties: i } = e, { terminalConfiguration: t, expanded: r, title:
|
|
61
|
-
return
|
|
56
|
+
const { flagProperties: i } = e, { terminalConfiguration: t, expanded: r, title: s } = i, a = t && t.id !== 0, n = e.traceLocation.type === "barrier", o = a || n, d = t?.name ?? void 0;
|
|
57
|
+
return c`<calcite-list-item .label=${s} .description=${d} .value=${s} .expanded=${r}>${o ? this._renderContents(e) : c`<div slot=content-bottom></div>`}<calcite-action icon=x slot=actions-end scale=s text @click=${() => this._handleTraceLocationItemRemoved(e)}></calcite-action></calcite-list-item>`;
|
|
62
58
|
}
|
|
63
59
|
render() {
|
|
64
|
-
const
|
|
65
|
-
|
|
60
|
+
const e = this.traceLocations.map((t) => this._renderListItem(t)).toArray();
|
|
61
|
+
if (!e.length)
|
|
62
|
+
return null;
|
|
63
|
+
const i = u(this._messages.labels.list, { traceLocationType: this.traceLocationType });
|
|
64
|
+
return c`<div><calcite-list interaction-mode=static selection-mode=none .label=${i}>${e}</calcite-list></div>`;
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
|
-
m("arcgis-utility-network-trace-location-list",
|
|
67
|
+
m("arcgis-utility-network-trace-location-list", $);
|
|
69
68
|
export {
|
|
70
|
-
|
|
69
|
+
$ as ArcgisUtilityNetworkTraceLocationList
|
|
71
70
|
};
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
import type Color from "@arcgis/core/Color.js";
|
|
3
3
|
import type EsriError from "@arcgis/core/core/Error.js";
|
|
4
4
|
import type Graphic from "@arcgis/core/Graphic.js";
|
|
5
|
-
import type FeatureLayer from "@arcgis/core/layers/FeatureLayer.js";
|
|
6
5
|
import type Layer from "@arcgis/core/layers/Layer.js";
|
|
7
|
-
import type SubtypeSublayer from "@arcgis/core/layers/support/SubtypeSublayer.js";
|
|
8
6
|
import type UtilityNetwork from "@arcgis/core/networks/UtilityNetwork.js";
|
|
9
7
|
import type TraceResult from "@arcgis/core/rest/networks/support/TraceResult.js";
|
|
10
8
|
import type MapView from "@arcgis/core/views/MapView.js";
|
|
@@ -15,9 +13,7 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
* This is a sub-component used by the **ArcgisUtilityNetworkTraceAnalysis** component.
|
|
18
|
-
*
|
|
19
|
-
* This sub-component takes a `TraceResult` instance as input.
|
|
20
|
-
* Optionally, the title of a trace configuration can be provided as a heading to display.
|
|
16
|
+
* It displays a subset of trace result types.
|
|
21
17
|
*
|
|
22
18
|
* @since 4.34
|
|
23
19
|
* @internal
|
|
@@ -100,7 +96,6 @@ export abstract class ArcgisUtilityNetworkTraceResults extends LitElement {
|
|
|
100
96
|
* @default false
|
|
101
97
|
*/
|
|
102
98
|
accessor autoDestroyDisabled: boolean;
|
|
103
|
-
accessor featuresFromSelectedLayer: Graphic[];
|
|
104
99
|
/**
|
|
105
100
|
* @default false
|
|
106
101
|
* @internal
|
|
@@ -111,6 +106,11 @@ export abstract class ArcgisUtilityNetworkTraceResults extends LitElement {
|
|
|
111
106
|
/** @default false */
|
|
112
107
|
accessor isElementsSelected: boolean;
|
|
113
108
|
accessor layers: Layer[];
|
|
109
|
+
/**
|
|
110
|
+
* Replace localized message strings with your own strings.
|
|
111
|
+
*
|
|
112
|
+
* _**Note**: Individual message keys may change between releases._
|
|
113
|
+
*/
|
|
114
114
|
accessor messageOverrides: NonNullable<ArcgisFeaturesNext["messageOverrides"]> & {
|
|
115
115
|
gettingResults?: string | undefined;
|
|
116
116
|
headings?: {
|
|
@@ -151,7 +151,6 @@ export abstract class ArcgisUtilityNetworkTraceResults extends LitElement {
|
|
|
151
151
|
* @see [Associate components with a Map or Scene component](https://developers.arcgis.com/javascript/latest/programming-patterns/#associate-components-with-a-map-or-scene-component)
|
|
152
152
|
*/
|
|
153
153
|
accessor referenceElement: ArcgisReferenceElement | string | undefined;
|
|
154
|
-
accessor selectedLayer: FeatureLayer | Layer | SubtypeSublayer | undefined;
|
|
155
154
|
/** @default "ready" */
|
|
156
155
|
accessor state: State;
|
|
157
156
|
accessor traceConfigTitle: string | undefined;
|
|
@@ -159,19 +158,21 @@ export abstract class ArcgisUtilityNetworkTraceResults extends LitElement {
|
|
|
159
158
|
accessor traceResult: TraceResult | undefined;
|
|
160
159
|
accessor traceResultFeatures: Graphic[];
|
|
161
160
|
accessor utilityNetwork: UtilityNetwork | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* The view associated with the component.
|
|
163
|
+
* > **Note:** The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this `view` property which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-utility-network-trace-results component will be associated with a map or scene component rather than using the `view` property.
|
|
164
|
+
*/
|
|
162
165
|
accessor view: MapView | undefined;
|
|
163
166
|
clearAggregatedGeometryGraphics(): void;
|
|
164
167
|
/** Permanently destroy the component. */
|
|
165
168
|
destroy(): Promise<void>;
|
|
166
169
|
readonly arcgisAggregatedGeometryGraphicsColorChange: import("@arcgis/lumina").TargetedEvent<this, string>;
|
|
167
170
|
readonly arcgisHideGraphicsChange: import("@arcgis/lumina").TargetedEvent<this, boolean>;
|
|
168
|
-
readonly arcgisSelectedLayerChange: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
169
171
|
readonly arcgisSelectedResultTypeChange: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
170
172
|
readonly arcgisTraceResultFeaturesReady: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
171
173
|
readonly "@eventTypes": {
|
|
172
174
|
arcgisAggregatedGeometryGraphicsColorChange: ArcgisUtilityNetworkTraceResults["arcgisAggregatedGeometryGraphicsColorChange"]["detail"];
|
|
173
175
|
arcgisHideGraphicsChange: ArcgisUtilityNetworkTraceResults["arcgisHideGraphicsChange"]["detail"];
|
|
174
|
-
arcgisSelectedLayerChange: ArcgisUtilityNetworkTraceResults["arcgisSelectedLayerChange"]["detail"];
|
|
175
176
|
arcgisSelectedResultTypeChange: ArcgisUtilityNetworkTraceResults["arcgisSelectedResultTypeChange"]["detail"];
|
|
176
177
|
arcgisTraceResultFeaturesReady: ArcgisUtilityNetworkTraceResults["arcgisTraceResultFeaturesReady"]["detail"];
|
|
177
178
|
};
|