@arcgis/map-components 6.0.0-next.26 → 6.0.0-next.27
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/27VBOPFN.js +2 -0
- package/dist/cdn/{6K4IASNK.js → 2JXK3AW7.js} +1 -1
- package/dist/cdn/{EZHYSI6R.js → 4HCQOJIM.js} +1 -1
- package/dist/cdn/{FZGMIIBX.js → CPWIRCCP.js} +1 -1
- package/dist/cdn/IJ7EV66N.js +2 -0
- package/dist/cdn/JNNI75UW.js +2 -0
- package/dist/cdn/KJISACOI.js +2 -0
- package/dist/cdn/{TTERKXN5.js → LP4ETJF7.js} +1 -1
- package/dist/cdn/{55VX76T5.js → PD4ELTMF.js} +1 -1
- package/dist/cdn/R5PT7JNG.js +2 -0
- package/dist/cdn/RSKBANQ5.js +2 -0
- package/dist/cdn/{PRUHLC54.js → TDQYO6FQ.js} +1 -1
- package/dist/cdn/{6DRXFSTW.js → UI5E3MX7.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/print-exports-panel-item-popover.js +1 -1
- package/dist/components/arcgis-directional-pad/customElement.js +53 -58
- package/dist/components/arcgis-expand/customElement.d.ts +47 -1
- package/dist/components/arcgis-expand/customElement.js +47 -47
- package/dist/components/arcgis-selection-toolbar/customElement.d.ts +8 -0
- package/dist/components/arcgis-selection-toolbar/customElement.js +23 -17
- package/dist/components/arcgis-utility-network-picker/customElement.d.ts +170 -6
- package/dist/components/arcgis-utility-network-picker/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-trace-aggregated-geometry-result-item/customElement.d.ts +5 -4
- package/dist/components/arcgis-utility-network-trace-aggregated-geometry-result-item/customElement.js +19 -15
- package/dist/components/arcgis-utility-network-trace-analysis/customElement.d.ts +0 -6
- package/dist/components/arcgis-utility-network-trace-elements-result-item/customElement.d.ts +5 -4
- package/dist/components/arcgis-utility-network-trace-elements-result-item/customElement.js +50 -46
- package/dist/components/arcgis-utility-network-trace-functions-result-item/customElement.d.ts +1 -1
- package/dist/components/arcgis-utility-network-trace-functions-result-item/customElement.js +9 -8
- package/dist/components/arcgis-utility-network-trace-results/customElement.d.ts +2 -4
- package/dist/components/arcgis-utility-network-trace-results/customElement.js +12 -12
- package/dist/components/arcgis-utility-network-trace-results-pane/customElement.d.ts +0 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +2 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +7 -7
- package/dist/cdn/CVLOQWUD.js +0 -2
- package/dist/cdn/HADZXZIE.js +0 -2
- package/dist/cdn/HTCPPGCR.js +0 -2
- package/dist/cdn/LHYI2QBZ.js +0 -2
- package/dist/cdn/PPGKQRNY.js +0 -2
- package/dist/cdn/PW3QCZXY.js +0 -2
- /package/dist/cdn/{ROHGHCK6.js → WFTJ4E4F.js} +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import { c as v } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as
|
|
3
|
+
import { css as y, html as s } from "lit";
|
|
4
4
|
import { keyed as p } from "lit/directives/keyed.js";
|
|
5
|
-
import { substitute as h, formatNumber as
|
|
6
|
-
import
|
|
7
|
-
import { LitElement as
|
|
5
|
+
import { substitute as h, formatNumber as T } from "@arcgis/core/intl.js";
|
|
6
|
+
import b from "@arcgis/core/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js";
|
|
7
|
+
import { LitElement as m, createEvent as u, nothing as a } from "@arcgis/lumina";
|
|
8
8
|
import { usePropertyChange as w } from "@arcgis/lumina/controllers";
|
|
9
9
|
import { reEmitEvent as d } from "@arcgis/lumina-toolkit/reEmitEvent";
|
|
10
10
|
import { u as M } from "../../chunks/useT9n.js";
|
|
11
11
|
import { m as O } from "../../chunks/useViewModel.js";
|
|
12
|
-
const C =
|
|
12
|
+
const C = y`:host{width:100%;display:flex;>*{align-items:center;align-self:center;height:100%;width:100%}}.root{display:flex;flex-direction:column}calcite-action-bar[layout=horizontal]{width:100%;calcite-chip{margin-inline-start:auto}}calcite-action-bar[layout=vertical]{height:100%;calcite-chip{margin-block-start:auto}}calcite-action-bar slot{align-items:center}calcite-dropdown:has(calcite-action:not([text-enabled])){align-self:center}calcite-action:not([text-enabled]){align-self:center}calcite-chip{display:flex;align-self:center;line-height:initial}calcite-dropdown{calcite-icon{margin-inline-start:var(--calcite-space-2xs)}}calcite-chip[closed]{display:inline-flex}calcite-progress{--calcite-progress-background-color: transparent}`, g = {
|
|
13
13
|
replace: "overwrite-features",
|
|
14
14
|
add: "cursor-plus",
|
|
15
15
|
remove: "cursor-minus"
|
|
16
|
-
}, S = O(
|
|
17
|
-
class $ extends
|
|
16
|
+
}, S = O(b);
|
|
17
|
+
class $ extends m {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments), this.viewModel = S(this), this.messages = M(), this.autoDestroyDisabled = !1, this.disabled = !1, this.icon = "selection-set", this.view = this.viewModel.view, this.activeOperation = this.viewModel.activeOperation, this.availableOperationTypes = ["replace", "add", "remove"], this.continuousSelectionEnabled = this.viewModel.continuousSelectionEnabled, this.defaultLassoToolOptions = this.viewModel.defaultLassoToolOptions, this.defaultOperationType = this.viewModel.defaultOperationType, this.defaultPolygonToolOptions = this.viewModel.defaultPolygonToolOptions, this.defaultPointToolOptions = this.viewModel.defaultPointToolOptions, this.defaultRectangleToolOptions = this.viewModel.defaultRectangleToolOptions, this.effectiveSelectionManager = this.viewModel.effectiveSelectionManager, this.effectiveSources = this.viewModel.effectiveSources, this.hideChip = !1, this.hideChipCloseButton = !1, this.hideLassoTool = !1, this.hideOperationTypeControls = !1, this.hidePanTool = !1, this.hidePolygonTool = !1, this.hidePointTool = !1, this.hideProgress = !1, this.hideRectangleTool = !1, this.layout = "horizontal", this.returnFeatureTitleFields = this.viewModel.returnFeatureTitleFields, this.selectionManager = this.viewModel.selectionManager, this.showTextLabels = !1, this.sources = this.viewModel.sources, this.toolConfigs = this.viewModel.toolConfigs, this.visualScale = "m", this.arcgisBeforeActivate = d(() => this.viewModel, "before-activate"), this.arcgisClear = u(), this.arcgisComplete = d(() => this.viewModel, "complete"), this.arcgisPropertyChange = w()("activeOperation", "state"), this.arcgisReady = u(), this.arcgisSelectionChange = d(() => this.viewModel, "selection-change");
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
|
-
this.properties = { _effectiveDisabled: 16, _effectiveOperationType: 16, _processing: 16, autoDestroyDisabled: 5, disabled: 7, icon: 1, label: 1, referenceElement: 1, view: 0, activeOperation: 32, availableOperationTypes: 0, continuousSelectionEnabled: 5, defaultLassoToolOptions: 0, defaultOperationType: 1, defaultPolygonToolOptions: 0, defaultPointToolOptions: 0, defaultRectangleToolOptions: 0, effectiveSelectionManager: 32, effectiveSources: 32, hideChip: 5, hideChipCloseButton: 5, hideLassoTool: 5, hideOperationTypeControls: 5, hidePanTool: 5, hidePolygonTool: 5, hidePointTool: 5, hideProgress: 5, hideRectangleTool: 5, layerPreferenceEnabled: 5, layout: 1, returnFeatureTitleFields: 5, returnGeometryDisabled: 5, selectionManager: 0, showTextLabels: 5, sources: 0, state: 32, syncResultsDisabled: 5, syncWhileDrawing: 5, toolConfigs: 0, visualScale: 1 };
|
|
22
|
+
this.properties = { _effectiveDisabled: 16, _effectiveOperationType: 16, _processing: 16, autoDestroyDisabled: 5, disabled: 7, icon: 1, label: 1, referenceElement: 1, view: 0, activeOperation: 32, availableOperationTypes: 0, continuousSelectionEnabled: 5, defaultLassoToolOptions: 0, defaultOperationType: 1, defaultPolygonToolOptions: 0, defaultPointToolOptions: 0, defaultRectangleToolOptions: 0, effectiveSelectionManager: 32, effectiveSources: 32, hideChip: 5, hideChipCloseButton: 5, hideLassoTool: 5, hideOperationTypeControls: 5, hidePanTool: 5, hidePolygonTool: 5, hidePointTool: 5, hideProgress: 5, hideRectangleTool: 5, ignoreLayerVisibility: 5, layerPreferenceEnabled: 5, layout: 1, returnFeatureTitleFields: 5, returnGeometryDisabled: 5, selectionManager: 0, showTextLabels: 5, sources: 0, state: 32, syncResultsDisabled: 5, syncWhileDrawing: 5, toolConfigs: 0, visualScale: 1 };
|
|
23
23
|
}
|
|
24
24
|
static {
|
|
25
25
|
this.styles = C;
|
|
@@ -33,6 +33,12 @@ class $ extends b {
|
|
|
33
33
|
get _processing() {
|
|
34
34
|
return !!this.activeOperation?.processingFinalSelection;
|
|
35
35
|
}
|
|
36
|
+
get ignoreLayerVisibility() {
|
|
37
|
+
return this.viewModel.ignoreLayerVisibility;
|
|
38
|
+
}
|
|
39
|
+
set ignoreLayerVisibility(e) {
|
|
40
|
+
this.viewModel.ignoreLayerVisibility = e;
|
|
41
|
+
}
|
|
36
42
|
get layerPreferenceEnabled() {
|
|
37
43
|
return !this.viewModel.layerViewPreferenceEnabled;
|
|
38
44
|
}
|
|
@@ -110,7 +116,7 @@ class $ extends b {
|
|
|
110
116
|
const { layout: t, messages: i, visualScale: o } = this, l = o === "l" ? 999 : 99;
|
|
111
117
|
return i.countTruncated && e > l && t === "vertical" ? h(i.countTruncated, {
|
|
112
118
|
count: l
|
|
113
|
-
}) :
|
|
119
|
+
}) : T(e);
|
|
114
120
|
}
|
|
115
121
|
_getTooltipForChip(e) {
|
|
116
122
|
const { messages: t } = this;
|
|
@@ -128,7 +134,7 @@ class $ extends b {
|
|
|
128
134
|
#s() {
|
|
129
135
|
return [
|
|
130
136
|
this.#a(),
|
|
131
|
-
this.#
|
|
137
|
+
this.#n(),
|
|
132
138
|
this.#c(),
|
|
133
139
|
this.#d(),
|
|
134
140
|
this.#h()
|
|
@@ -152,13 +158,13 @@ class $ extends b {
|
|
|
152
158
|
title: e
|
|
153
159
|
});
|
|
154
160
|
}
|
|
155
|
-
#
|
|
161
|
+
#r() {
|
|
156
162
|
if (this.hideChip)
|
|
157
163
|
return;
|
|
158
164
|
const { effectiveSelectionManager: e } = this, t = e?.count ?? 0, i = this._getTextForChip(t), o = !this.hideChipCloseButton && t > 0;
|
|
159
165
|
return s`<calcite-chip appearance=outline .closable=${o} .disabled=${this._effectiveDisabled || t === 0} .label=${i} .scale=${this.visualScale} title=${this._getTooltipForChip(t) ?? a} @calciteChipClose=${this._handleClearSelection}>${i}</calcite-chip>`;
|
|
160
166
|
}
|
|
161
|
-
#
|
|
167
|
+
#n() {
|
|
162
168
|
if (this.hidePointTool)
|
|
163
169
|
return;
|
|
164
170
|
const { messages: e } = this;
|
|
@@ -186,8 +192,8 @@ class $ extends b {
|
|
|
186
192
|
const { availableOperationTypes: e } = this;
|
|
187
193
|
if (this.hideOperationTypeControls || !e.length)
|
|
188
194
|
return;
|
|
189
|
-
const { _effectiveOperationType: t, showTextLabels: i, visualScale: o } = this, l = g[t],
|
|
190
|
-
return p("toggle-group", s`<calcite-action-group><calcite-dropdown overlay-positioning=fixed placement=bottom-start .scale=${o}><calcite-action class=tool-button .disabled=${this._effectiveDisabled} .icon=${l} .scale=${o} slot=trigger .text=${
|
|
195
|
+
const { _effectiveOperationType: t, showTextLabels: i, visualScale: o } = this, l = g[t], r = this._getTextForSelectionOperationType(t), n = this._getLabelForSelectionOperationType(t);
|
|
196
|
+
return p("toggle-group", s`<calcite-action-group><calcite-dropdown overlay-positioning=fixed placement=bottom-start .scale=${o}><calcite-action class=tool-button .disabled=${this._effectiveDisabled} .icon=${l} .scale=${o} slot=trigger .text=${r ?? ""} .textEnabled=${i} title=${n ?? a}><calcite-icon icon=chevron-down scale=s></calcite-icon></calcite-action><calcite-dropdown-group>${e.map((c) => this.#u(c))}</calcite-dropdown-group></calcite-dropdown></calcite-action-group>`);
|
|
191
197
|
}
|
|
192
198
|
#u(e) {
|
|
193
199
|
return s`<calcite-dropdown-item .iconStart=${g[e]} .selected=${this.defaultOperationType === e} @calciteDropdownItemSelect=${() => this.defaultOperationType = e}>${this._getLabelForSelectionOperationType(e)}</calcite-dropdown-item>`;
|
|
@@ -205,11 +211,11 @@ class $ extends b {
|
|
|
205
211
|
});
|
|
206
212
|
}
|
|
207
213
|
#t(e) {
|
|
208
|
-
const { active: t, disabled: i, icon: o, onclick: l, text:
|
|
209
|
-
return s`<calcite-action .active=${t} class=tool-button .disabled=${i} .icon=${o} @click=${l} .text=${
|
|
214
|
+
const { active: t, disabled: i, icon: o, onclick: l, text: r, title: n } = e, { showTextLabels: c, visualScale: f } = this;
|
|
215
|
+
return s`<calcite-action .active=${t} class=tool-button .disabled=${i} .icon=${o} @click=${l} .text=${r} .textEnabled=${c} title=${n ?? a} .scale=${f}></calcite-action>`;
|
|
210
216
|
}
|
|
211
217
|
render() {
|
|
212
|
-
return s`<div><calcite-action-bar expand-toggle-disabled .layout=${this.layout} overflow-mode=none .scale=${this.visualScale}>${this.#p()}${this.#o()}${this.#
|
|
218
|
+
return s`<div><calcite-action-bar expand-toggle-disabled .layout=${this.layout} overflow-mode=none .scale=${this.visualScale}>${this.#p()}${this.#o()}${this.#r()}</calcite-action-bar>${this.#i()}</div>`;
|
|
213
219
|
}
|
|
214
220
|
}
|
|
215
221
|
v("arcgis-selection-toolbar", $);
|
|
@@ -5,9 +5,81 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
5
5
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* It
|
|
8
|
+
* The Utility Network Picker component selects a utility network from a web map.
|
|
9
|
+
* It is used by the [arcgis-utility-network-trace-analysis](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-analysis/) component
|
|
10
|
+
* and can also be used independently.
|
|
10
11
|
*
|
|
12
|
+
* Set [view](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#view) to a
|
|
13
|
+
* [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/)
|
|
14
|
+
* whose web map contains utility networks. The component loads the map and the selected network.
|
|
15
|
+
* The component displays the network's [title](https://developers.arcgis.com/javascript/latest/references/core/networks/Network/#title)
|
|
16
|
+
* when the map contains one utility network, or a [Combobox](https://developers.arcgis.com/calcite-design-system/components/combobox/)
|
|
17
|
+
* for multiple utility networks.
|
|
18
|
+
*
|
|
19
|
+
* When the map's networks are loaded, the first network is selected if the current selection
|
|
20
|
+
* is missing or does not belong to the map. Selecting a network does not execute a trace.
|
|
21
|
+
* Access the selected utility network with the [selectedUtilityNetwork](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#selectedUtilityNetwork) property.
|
|
22
|
+
*
|
|
23
|
+
* Changing the selected utility network loads the new selected utility network
|
|
24
|
+
* if it is not already [loaded](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/#loaded).
|
|
25
|
+
* Before using the new selected `UtilityNetwork`, await its
|
|
26
|
+
* [load()](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/#load)
|
|
27
|
+
* method, which resolves with the loaded instance, including when it is already loaded.
|
|
28
|
+
* `componentOnReady()` waits for component initialization, not for the selected network to load.
|
|
29
|
+
*
|
|
30
|
+
* Customize what this component displays with
|
|
31
|
+
* [heading](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#heading),
|
|
32
|
+
* [hideErrors](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#hideErrors), and
|
|
33
|
+
* [hideLoader](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#hideLoader).
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* Place a standalone picker in a pane next to a web map containing utility networks.
|
|
37
|
+
* Configure [authentication](https://developers.arcgis.com/javascript/latest/authentication/access-tokens/)
|
|
38
|
+
* for secured resources before loading the map.
|
|
39
|
+
* ```html
|
|
40
|
+
* <calcite-shell>
|
|
41
|
+
* <calcite-shell-panel slot="panel-start">
|
|
42
|
+
* <calcite-panel heading="Utility networks">
|
|
43
|
+
* <arcgis-utility-network-picker></arcgis-utility-network-picker>
|
|
44
|
+
* </calcite-panel>
|
|
45
|
+
* </calcite-shell-panel>
|
|
46
|
+
* <arcgis-map item-id="471eb0bf37074b1fbb972b1da70fb310"></arcgis-map>
|
|
47
|
+
* </calcite-shell>
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* ```js
|
|
51
|
+
* import "@arcgis/map-components/components/arcgis-map";
|
|
52
|
+
* import "@arcgis/map-components/components/arcgis-utility-network-picker";
|
|
53
|
+
*
|
|
54
|
+
* const mapElement = document.querySelector("arcgis-map");
|
|
55
|
+
* await mapElement.viewOnReady();
|
|
56
|
+
*
|
|
57
|
+
* const picker = document.querySelector("arcgis-utility-network-picker");
|
|
58
|
+
* picker.view = mapElement.view;
|
|
59
|
+
* picker.addEventListener("arcgisError", (event) => {
|
|
60
|
+
* console.error(event.type, picker.error);
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* picker.addEventListener("arcgisPropertyChange", async (event) => {
|
|
64
|
+
* if (event.detail.name !== "selectedUtilityNetwork") {
|
|
65
|
+
* return;
|
|
66
|
+
* }
|
|
67
|
+
*
|
|
68
|
+
* const network = picker.selectedUtilityNetwork;
|
|
69
|
+
* if (!network) {
|
|
70
|
+
* return;
|
|
71
|
+
* }
|
|
72
|
+
*
|
|
73
|
+
* try {
|
|
74
|
+
* const loadedNetwork = await network.load();
|
|
75
|
+
* if (picker.selectedUtilityNetwork === loadedNetwork) {
|
|
76
|
+
* console.log(loadedNetwork.dataElement);
|
|
77
|
+
* }
|
|
78
|
+
* } catch (error) {
|
|
79
|
+
* console.error(error);
|
|
80
|
+
* }
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
11
83
|
* @since 5.2
|
|
12
84
|
*/
|
|
13
85
|
export abstract class ArcgisUtilityNetworkPicker extends LitElement {
|
|
@@ -31,11 +103,47 @@ export abstract class ArcgisUtilityNetworkPicker extends LitElement {
|
|
|
31
103
|
};
|
|
32
104
|
labels: { utilityNetwork: string; };
|
|
33
105
|
}>;
|
|
106
|
+
/**
|
|
107
|
+
* The current error message, or `undefined` when cleared. Errors can occur when
|
|
108
|
+
* the view has no map, the map cannot be loaded, the map has no utility networks,
|
|
109
|
+
* or the selected network cannot be loaded. The component displays this message
|
|
110
|
+
* unless [hideErrors](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#hideErrors) is `true`.
|
|
111
|
+
*
|
|
112
|
+
* The error message is cleared when map setup starts or a selected network becomes ready.
|
|
113
|
+
* Selecting another network that loads successfully recovers from a network-load error.
|
|
114
|
+
* While a new network is loading, the previous error can remain; check
|
|
115
|
+
* [state](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#state) to distinguish loading from an active error.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* Read the error message when the component emits `arcgisError`.
|
|
119
|
+
* ```js
|
|
120
|
+
* const picker = document.querySelector("arcgis-utility-network-picker");
|
|
121
|
+
* picker.addEventListener("arcgisError", () => {
|
|
122
|
+
* console.error(picker.error);
|
|
123
|
+
* });
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
34
126
|
accessor error: string | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* The heading above the utility network title or selector.
|
|
129
|
+
* When not set or empty, the component uses the localized utility network label.
|
|
130
|
+
*/
|
|
35
131
|
accessor heading: string | undefined;
|
|
36
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* Whether to hide error notices. Errors still update
|
|
134
|
+
* [error](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#error) and
|
|
135
|
+
* [state](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#state) and emit
|
|
136
|
+
* [@arcgisError](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#event-arcgisError).
|
|
137
|
+
*
|
|
138
|
+
* @default false
|
|
139
|
+
*/
|
|
37
140
|
accessor hideErrors: boolean;
|
|
38
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* Whether to hide the loading indicator. This does not prevent the
|
|
143
|
+
* component from loading the map or the selected utility network.
|
|
144
|
+
*
|
|
145
|
+
* @default false
|
|
146
|
+
*/
|
|
39
147
|
accessor hideLoader: boolean;
|
|
40
148
|
/**
|
|
41
149
|
* Replace localized message strings with your own strings.
|
|
@@ -52,16 +160,72 @@ export abstract class ArcgisUtilityNetworkPicker extends LitElement {
|
|
|
52
160
|
} | undefined;
|
|
53
161
|
labels?: { utilityNetwork?: string | undefined; } | undefined;
|
|
54
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* The selected
|
|
165
|
+
* [UtilityNetwork](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/).
|
|
166
|
+
* Set this property to a network from the view's web map to select it programmatically.
|
|
167
|
+
* The component loads the selected network if needed.
|
|
168
|
+
*
|
|
169
|
+
* When the map's networks are loaded, the component selects the first network if
|
|
170
|
+
* this property is unset or refers to a network outside the map's collection.
|
|
171
|
+
* The same selection rule applies when the view or its map is replaced.
|
|
172
|
+
* The selection is cleared when the map has no utility networks.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* Select a network before adding the picker to the page. Here, `mapView`
|
|
176
|
+
* is a MapView backed by a WebMap containing utility networks.
|
|
177
|
+
* Replace `"your-network-id"` with the ID of a network in that map.
|
|
178
|
+
* ```js
|
|
179
|
+
* const map = mapView.map;
|
|
180
|
+
* await map.load();
|
|
181
|
+
* const network = map.utilityNetworks.find((network) => network.id === "your-network-id");
|
|
182
|
+
* if (!network) {
|
|
183
|
+
* throw new Error("The requested utility network is not in this web map.");
|
|
184
|
+
* }
|
|
185
|
+
*
|
|
186
|
+
* const picker = document.createElement("arcgis-utility-network-picker");
|
|
187
|
+
* picker.view = mapView;
|
|
188
|
+
* picker.selectedUtilityNetwork = network;
|
|
189
|
+
* document.body.append(picker);
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
55
192
|
accessor selectedUtilityNetwork: UtilityNetwork | undefined;
|
|
56
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* The current component state.
|
|
195
|
+
*
|
|
196
|
+
* - `error`: The component could not set up the map, find a utility network, or load the selected network.
|
|
197
|
+
* See [error](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#error) for details.
|
|
198
|
+
* - `loading`: The component is setting up the map or loading the selected utility network.
|
|
199
|
+
* - `ready`: Setup is complete and no loading error occurred.
|
|
200
|
+
*
|
|
201
|
+
* Selecting an unloaded network returns the component to `loading` until that
|
|
202
|
+
* network loads successfully (`ready`) or fails to load (`error`).
|
|
203
|
+
*
|
|
204
|
+
* @default "loading"
|
|
205
|
+
*/
|
|
57
206
|
accessor state: "error" | "loading" | "ready";
|
|
58
207
|
/**
|
|
59
208
|
* The view associated with the component.
|
|
60
209
|
* > **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-picker component will be associated with a map or scene component rather than using the `view` property.
|
|
61
210
|
*/
|
|
62
211
|
accessor view: MapView | undefined;
|
|
63
|
-
/**
|
|
212
|
+
/**
|
|
213
|
+
* Fires when an error occurs while setting up the map or loading a utility network.
|
|
214
|
+
* Read [error](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#error) for the message and
|
|
215
|
+
* [state](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#state) for the current state.
|
|
216
|
+
* This event has no detail payload and fires even when
|
|
217
|
+
* [hideErrors](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-picker/#hideErrors) is `true`.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```js
|
|
221
|
+
* const picker = document.querySelector("arcgis-utility-network-picker");
|
|
222
|
+
* picker.addEventListener("arcgisError", () => {
|
|
223
|
+
* console.error(picker.error);
|
|
224
|
+
* });
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
64
227
|
readonly arcgisError: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
228
|
+
/** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
|
|
65
229
|
readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "selectedUtilityNetwork" | "state"; }>;
|
|
66
230
|
readonly "@eventTypes": {
|
|
67
231
|
arcgisError: ArcgisUtilityNetworkPicker["arcgisError"]["detail"];
|
|
@@ -57,7 +57,7 @@ class u extends n {
|
|
|
57
57
|
async #o() {
|
|
58
58
|
const { selectedUtilityNetwork: t } = this;
|
|
59
59
|
try {
|
|
60
|
-
t && !t.loaded && await t.load(), this.#i();
|
|
60
|
+
t && !t.loaded && (this.state = "loading", await t.load()), this.#i();
|
|
61
61
|
} catch (e) {
|
|
62
62
|
l(e, this, this._messages.errors.utilityNetworkLoadFailed), this.#t(this._messages.errors.utilityNetworkLoadFailed);
|
|
63
63
|
}
|
|
@@ -191,13 +191,14 @@ export abstract class ArcgisUtilityNetworkTraceAggregatedGeometryResultItem exte
|
|
|
191
191
|
/**
|
|
192
192
|
* Removes the aggregated geometry graphics from the
|
|
193
193
|
* [graphicsLayer](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-aggregated-geometry-result-item/#graphicsLayer).
|
|
194
|
-
* If the layer was created by the component, it is also removed from the map.
|
|
194
|
+
* If the layer was created by the component, it is also removed from the map.
|
|
195
|
+
*
|
|
196
|
+
* The method also clears
|
|
197
|
+
* [traceResult](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-aggregated-geometry-result-item/#traceResult) and
|
|
195
198
|
* [geometryGraphics](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-aggregated-geometry-result-item/#geometryGraphics) and resets
|
|
196
199
|
* [state](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-aggregated-geometry-result-item/#state) to `"ready"`.
|
|
197
200
|
*
|
|
198
|
-
*
|
|
199
|
-
* [traceResult](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-aggregated-geometry-result-item/#traceResult) or emit
|
|
200
|
-
* [@arcgisResultReady](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-aggregated-geometry-result-item/#event-arcgisResultReady).
|
|
201
|
+
* Does not emit [@arcgisResultReady](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-aggregated-geometry-result-item/#event-arcgisResultReady).
|
|
201
202
|
*/
|
|
202
203
|
clearResult(): void;
|
|
203
204
|
/** Permanently destroy the component. */
|
|
@@ -44,9 +44,7 @@ class M extends G {
|
|
|
44
44
|
return !!this.traceResult?.aggregatedGeometry;
|
|
45
45
|
}
|
|
46
46
|
clearResult() {
|
|
47
|
-
|
|
48
|
-
const { graphicsLayer: e } = this;
|
|
49
|
-
e && (e.removeMany(this.geometryGraphics), e === this.#t && (this.view?.map?.remove(e), this.graphicsLayer = void 0, this.#t = void 0)), r(() => this.geometryGraphics = []), r(() => this.state = "ready");
|
|
47
|
+
r(() => this.traceResult = void 0), this.#h();
|
|
50
48
|
}
|
|
51
49
|
async destroy() {
|
|
52
50
|
try {
|
|
@@ -65,7 +63,7 @@ class M extends G {
|
|
|
65
63
|
h("warn", this, "This component must be used as a child of `arcgis-utility-network-trace-results`.");
|
|
66
64
|
return;
|
|
67
65
|
}
|
|
68
|
-
const t = (i) => this.#
|
|
66
|
+
const t = (i) => this.#c(i);
|
|
69
67
|
return e.addEventListener("arcgisPropertyChange", t), r(() => {
|
|
70
68
|
this.traceResult = e.traceResult, this.view = e.view;
|
|
71
69
|
}), () => {
|
|
@@ -78,7 +76,7 @@ class M extends G {
|
|
|
78
76
|
const t = e.get("view");
|
|
79
77
|
t?.map && this.graphicsLayer && t.map.remove(this.graphicsLayer), this.#r();
|
|
80
78
|
}
|
|
81
|
-
e.has("graphicsLayer") && this.#
|
|
79
|
+
e.has("graphicsLayer") && this.#m(e.get("graphicsLayer")), e.has("hideGraphics") && this.#p(), (e.has("graphicsColor") || e.has("selectionSize")) && this.#d();
|
|
82
80
|
}
|
|
83
81
|
loaded() {
|
|
84
82
|
this.traceResult && (this.traceResult.aggregatedGeometry || h("warn", this, c("traceResult.aggregatedGeometry")), this.view ? this.view.map || h("error", this, c("The property `view` was provided, but `view.map` is null. Cannot draw aggregated geometry.")) : h("error", this, c("view")));
|
|
@@ -89,7 +87,7 @@ class M extends G {
|
|
|
89
87
|
const e = this.geometryGraphics.filter((t) => !this.graphicsLayer.graphics.includes(t));
|
|
90
88
|
this.graphicsLayer.addMany(e);
|
|
91
89
|
}
|
|
92
|
-
#
|
|
90
|
+
#c(e) {
|
|
93
91
|
if (e.target !== this.#a)
|
|
94
92
|
return;
|
|
95
93
|
const { target: t } = e;
|
|
@@ -102,13 +100,13 @@ class M extends G {
|
|
|
102
100
|
break;
|
|
103
101
|
}
|
|
104
102
|
}
|
|
105
|
-
#
|
|
103
|
+
#l(e) {
|
|
106
104
|
const { line: t, multipoint: i, polygon: s } = e;
|
|
107
105
|
r(() => {
|
|
108
|
-
this.geometryGraphics = [t, i, s].filter((a) => a != null).map((a) => this.#
|
|
106
|
+
this.geometryGraphics = [t, i, s].filter((a) => a != null).map((a) => this.#g(a));
|
|
109
107
|
});
|
|
110
108
|
}
|
|
111
|
-
#
|
|
109
|
+
#n(e) {
|
|
112
110
|
const t = this.#s, i = e.map?.findLayerById(t);
|
|
113
111
|
return i && x(i) ? i : new u({
|
|
114
112
|
id: t,
|
|
@@ -116,7 +114,7 @@ class M extends G {
|
|
|
116
114
|
title: t
|
|
117
115
|
});
|
|
118
116
|
}
|
|
119
|
-
#
|
|
117
|
+
#g(e) {
|
|
120
118
|
return new y({
|
|
121
119
|
geometry: e,
|
|
122
120
|
symbol: this.#o(e)
|
|
@@ -149,14 +147,20 @@ class M extends G {
|
|
|
149
147
|
});
|
|
150
148
|
}
|
|
151
149
|
}
|
|
152
|
-
#
|
|
150
|
+
#p() {
|
|
153
151
|
this.hideGraphics ? (this.graphicsLayer?.removeMany(this.geometryGraphics), this.#e.value?.open && (this.#e.value.open = !1)) : this.#i();
|
|
154
152
|
}
|
|
155
|
-
#
|
|
153
|
+
#m(e) {
|
|
156
154
|
e?.removeMany(this.geometryGraphics), this.hideGraphics || this.#i();
|
|
157
155
|
}
|
|
156
|
+
#h() {
|
|
157
|
+
this.#e.value && (this.#e.value.open = !1);
|
|
158
|
+
const { graphicsLayer: e } = this;
|
|
159
|
+
e && (e.removeMany(this.geometryGraphics), e === this.#t && (this.view?.map?.remove(e), this.graphicsLayer = void 0, this.#t = void 0)), r(() => this.geometryGraphics = []), r(() => this.state = "ready");
|
|
160
|
+
}
|
|
158
161
|
#r() {
|
|
159
|
-
this
|
|
162
|
+
if (this.#h(), !this.traceResult)
|
|
163
|
+
return;
|
|
160
164
|
const e = () => {
|
|
161
165
|
r(() => this.state = "ready"), this.arcgisResultReady.emit();
|
|
162
166
|
};
|
|
@@ -164,9 +168,9 @@ class M extends G {
|
|
|
164
168
|
e();
|
|
165
169
|
return;
|
|
166
170
|
}
|
|
167
|
-
r(() => this.state = "loading"), this.#
|
|
171
|
+
r(() => this.state = "loading"), this.#l(this.traceResult.aggregatedGeometry), this.graphicsLayer || (this.graphicsLayer = this.#n(this.view), this.#t = this.graphicsLayer, g(this.view, this.graphicsLayer)), this.hideGraphics || this.#i(), e();
|
|
168
172
|
}
|
|
169
|
-
#
|
|
173
|
+
#d() {
|
|
170
174
|
this.geometryGraphics.forEach((e) => {
|
|
171
175
|
const t = e.geometry;
|
|
172
176
|
e.symbol = this.#o(t);
|
|
@@ -19,12 +19,6 @@ import type { UtilityNetworkTraceAnalysisState } from "@arcgis/core/networks/Uti
|
|
|
19
19
|
/**
|
|
20
20
|
* ## Overview
|
|
21
21
|
*
|
|
22
|
-
* > [!WARNING]
|
|
23
|
-
* > This component is the successor to the `utility-network-trace-analysis` component.
|
|
24
|
-
* > The `utility-network-trace-analysis` component is being substantially refactored to expose public trace sub-components in release 5.2 and 6.0.
|
|
25
|
-
* > To avoid destabilizing the public version of `utility-network-trace-analysis`, the refactoring work is being performed in this component.
|
|
26
|
-
* > At release, this "next" component will replace the original.
|
|
27
|
-
*
|
|
28
22
|
* The Utility Network Trace Analysis component allows users to run traces and view trace results in a utility network.
|
|
29
23
|
*
|
|
30
24
|
* - The component supports selecting a utility network and a named trace configuration in that utility network. Both the utility network and trace configuration must be [stored in the map](https://developers.arcgis.com/javascript/latest/references/core/WebMap/#utilityNetworks).
|
package/dist/components/arcgis-utility-network-trace-elements-result-item/customElement.d.ts
CHANGED
|
@@ -258,11 +258,12 @@ export abstract class ArcgisUtilityNetworkTraceElementsResultItem extends LitEle
|
|
|
258
258
|
get view(): MapView | undefined;
|
|
259
259
|
/**
|
|
260
260
|
* Cancels feature queries in progress, removes trace-element highlights from the map,
|
|
261
|
-
* clears [features](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-elements-result-item/#features),
|
|
262
|
-
* and
|
|
261
|
+
* clears [features](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-elements-result-item/#features),
|
|
262
|
+
* and [traceResult](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-elements-result-item/#traceResult),
|
|
263
|
+
* closes the features list, and resets
|
|
264
|
+
* [state](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-elements-result-item/#state) to `"ready"`.
|
|
263
265
|
*
|
|
264
|
-
* Does not
|
|
265
|
-
* or emit [@arcgisResultReady](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-elements-result-item/#event-arcgisResultReady).
|
|
266
|
+
* Does not emit [@arcgisResultReady](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-elements-result-item/#event-arcgisResultReady).
|
|
266
267
|
*/
|
|
267
268
|
clearResult(): void;
|
|
268
269
|
/** Permanently destroy the component. */
|