@arcgis/map-components 5.2.0-next.54 → 5.2.0-next.55

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.
@@ -6,35 +6,18 @@ import "@arcgis/core/Graphic.js";
6
6
  import { LitElement as f, createEvent as d } from "@arcgis/lumina";
7
7
  import { log as o, composeMissingPropertyMessage as g, composeEmptyPropertyMessage as v } from "@arcgis/toolkit/log";
8
8
  import { css as b, html as l } from "lit";
9
- import { createRef as $, ref as h } from "lit/directives/ref.js";
9
+ import { createRef as $, ref as u } from "lit/directives/ref.js";
10
10
  import { u as w } from "../../chunks/useT9n.js";
11
11
  import { l as C } from "../../chunks/async-utils.js";
12
12
  import { q as R, c as E } from "../../chunks/layer-utils.js";
13
- const F = b`:host{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}arcgis-features-next{height:100%}calcite-table{--calcite-table-border-color: none}calcite-table-row{--calcite-table-row-border-color: var(--calcite-color-border-3)}.white-panel-background{--calcite-panel-background-color: var(--calcite-color-foreground-1)}.aggregated-geometry-container{display:flex;justify-content:space-between;margin:0 var(--calcite-spacing-md) var(--calcite-spacing-md)}#elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);margin:0 var(--calcite-spacing-sm)}.no-selectable-results{margin:0 var(--calcite-spacing-md);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size)}.results-heading{display:flex;flex-direction:column;margin:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.functions-heading{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-xxs);font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:var(--calcite-spacing-sm) var(--calcite-spacing-xl) var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`, u = {
13
+ const F = b`:host{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}arcgis-features-next{height:100%}calcite-table{--calcite-table-border-color: none}calcite-table-row{--calcite-table-row-border-color: var(--calcite-color-border-3)}.white-panel-background{--calcite-panel-background-color: var(--calcite-color-foreground-1)}.aggregated-geometry-container{display:flex;justify-content:space-between;margin:0 var(--calcite-spacing-md) var(--calcite-spacing-md)}#elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);margin:0 var(--calcite-spacing-sm)}.no-selectable-results{margin:0 var(--calcite-spacing-md);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size)}.results-heading{display:flex;flex-direction:column;margin:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.functions-heading{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-xxs);font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:var(--calcite-spacing-sm) var(--calcite-spacing-xl) var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`, h = {
14
14
  dirtyAreasDiscovered: -2147208511,
15
15
  noValidControllers: -2147208935,
16
16
  pathNotFound: -2147208444
17
17
  };
18
18
  class k extends f {
19
19
  constructor() {
20
- super(...arguments), this._messages = w({ blocking: !0 }), this.#c = !0, this.#t = [], this.#s = $(), this.#a = /* @__PURE__ */ new Map(), this.#o = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#l = [], this.#d = async ([e, t]) => {
21
- const s = this.utilityNetwork?.getLayerIdBySourceId(e), a = this.#p(s), i = this.#y(t);
22
- if (s == null || !a) {
23
- this.#t.push(...i);
24
- return;
25
- }
26
- const r = a.createQuery();
27
- r.gdbVersion = this.utilityNetwork?.gdbVersion, r.objectIds = i.map((c) => c.objectId), r.outFields = ["*"];
28
- const { features: n } = await R(a, r);
29
- n.forEach((c) => {
30
- const m = c.layer;
31
- c.getEffectivePopupTemplate(this.#c) || (c.popupTemplate = m.createPopupTemplate());
32
- }), E(a) ? n.forEach((c) => this.#g(this.#i, c.layer.subtypeCode, c)) : this.#a.set(s, n);
33
- }, this.#h = (e) => {
34
- e && (this.#n = e);
35
- }, this.#u = (e) => {
36
- e && (this._featuresComponentElement = e);
37
- }, this._aggregatedGeometryDisabled = !1, this.aggregatedGeometryGraphicsColor = new y([255, 255, 0, 0.6]), this.hideActionBar = !1, this.hideFeatureResults = !1, this.isElementsSelected = !1, this.layers = [], this.state = "ready", this.traceResultFeatures = [], this.autoDestroyDisabled = !1, this.arcgisAggregatedGeometryGraphicsColorChange = d(), this.arcgisHideGraphicsChange = d(), this.arcgisSelectedResultTypeChange = d(), this.arcgisTraceResultFeaturesReady = d();
20
+ super(...arguments), this._messages = w({ blocking: !0 }), this.#c = !0, this.#t = [], this.#s = $(), this.#a = /* @__PURE__ */ new Map(), this.#o = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#l = [], this._aggregatedGeometryDisabled = !1, this.aggregatedGeometryGraphicsColor = new y([255, 255, 0, 0.6]), this.hideActionBar = !1, this.hideFeatureResults = !1, this.isElementsSelected = !1, this.layers = [], this.state = "ready", this.traceResultFeatures = [], this.autoDestroyDisabled = !1, this.arcgisAggregatedGeometryGraphicsColorChange = d(), this.arcgisHideGraphicsChange = d(), this.arcgisSelectedResultTypeChange = d(), this.arcgisTraceResultFeaturesReady = d();
38
21
  }
39
22
  static {
40
23
  this.properties = { _aggregatedGeometryDisabled: 16, _featuresComponentElement: 16, aggregatedGeometryGraphicsColor: 0, hideActionBar: 5, hideFeatureResults: 5, isElementsSelected: 5, layers: 0, messageOverrides: 0, numResults: 32, referenceElement: 1, state: 1, traceConfigTitle: 1, traceError: 0, traceResult: 0, traceResultFeatures: 0, utilityNetwork: 0, view: 0, autoDestroyDisabled: 5 };
@@ -51,9 +34,6 @@ class k extends f {
51
34
  #i;
52
35
  #r;
53
36
  #l;
54
- #d;
55
- #h;
56
- #u;
57
37
  get numResults() {
58
38
  return this.traceResultFeatures.length + this.#t.length;
59
39
  }
@@ -77,7 +57,27 @@ class k extends f {
77
57
  disconnectedCallback() {
78
58
  super.disconnectedCallback(), this.#o.clear();
79
59
  }
80
- #g(e, t, s) {
60
+ #h(e) {
61
+ e && (this.#n = e);
62
+ }
63
+ #g(e) {
64
+ e && (this._featuresComponentElement = e);
65
+ }
66
+ async #m([e, t]) {
67
+ const s = this.utilityNetwork?.getLayerIdBySourceId(e), a = this.#p(s), i = this.#y(t);
68
+ if (s == null || !a) {
69
+ this.#t.push(...i);
70
+ return;
71
+ }
72
+ const r = a.createQuery();
73
+ r.gdbVersion = this.utilityNetwork?.gdbVersion, r.objectIds = i.map((c) => c.objectId), r.outFields = ["*"];
74
+ const { features: n } = await R(a, r);
75
+ n.forEach((c) => {
76
+ const m = c.layer;
77
+ c.getEffectivePopupTemplate(this.#c) || (c.popupTemplate = m.createPopupTemplate());
78
+ }), E(a) ? n.forEach((c) => this.#d(this.#i, c.layer.subtypeCode, c)) : this.#a.set(s, n);
79
+ }
80
+ #d(e, t, s) {
81
81
  const a = e.get(t);
82
82
  a == null ? e.set(t, [s]) : a.push(s);
83
83
  }
@@ -120,7 +120,7 @@ class k extends f {
120
120
  if (!e.length)
121
121
  return;
122
122
  this.state = "loading";
123
- const t = e.map(this.#d);
123
+ const t = e.map((r) => this.#m(r));
124
124
  (await Promise.allSettled(t)).forEach((r, n) => {
125
125
  if (r.status === "rejected") {
126
126
  const [c] = e[n];
@@ -131,7 +131,7 @@ class k extends f {
131
131
  this.traceResultFeatures = a.concat(i).flat();
132
132
  }
133
133
  #$() {
134
- this.traceResult.elements?.forEach((e) => this.#g(this.#r, e.networkSourceId, e));
134
+ this.traceResult.elements?.forEach((e) => this.#d(this.#r, e.networkSourceId, e));
135
135
  }
136
136
  render() {
137
137
  const { traceError: e, traceResult: t } = this;
@@ -140,26 +140,26 @@ class k extends f {
140
140
  if (!t)
141
141
  return this.#L();
142
142
  const { elements: s, globalFunctionResults: a, aggregatedGeometry: i } = t, r = !s.length && !a.length && !i, n = s.length > 0 && !a.length && !i;
143
- return r ? this.#T() : this.state === "loading" ? this.#w() : this.hideFeatureResults && n ? this.#E() : this.isElementsSelected || n ? l`<arcgis-features-next .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#c} .features=${this.traceResultFeatures} .hideActionBar=${this.hideActionBar} .hideCloseButton=${n} hide-select-feature initial-display-mode=list .messageOverrides=${this.messageOverrides} @arcgisClose=${() => this.isElementsSelected = !1} open .referenceElement=${this.referenceElement} .view=${this.view} ${h(this.#u)}></arcgis-features-next>` : this.#C(t);
143
+ return r ? this.#T() : this.state === "loading" ? this.#w() : this.hideFeatureResults && n ? this.#E() : this.isElementsSelected || n ? l`<arcgis-features-next .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#c} .features=${this.traceResultFeatures} .hideActionBar=${this.hideActionBar} .hideCloseButton=${n} hide-select-feature initial-display-mode=list .messageOverrides=${this.messageOverrides} @arcgisClose=${() => this.isElementsSelected = !1} open .referenceElement=${this.referenceElement} .view=${this.view} ${u(this.#g)}></arcgis-features-next>` : this.#C(t);
144
144
  }
145
145
  #w() {
146
146
  return l`<calcite-panel class="white-panel-background"><calcite-loader .label=${this._messages.gettingResults} .text=${this._messages.gettingResults}></calcite-loader></calcite-panel>`;
147
147
  }
148
148
  #C(e) {
149
149
  const { elements: t, globalFunctionResults: s, aggregatedGeometry: a } = e;
150
- return l`<calcite-panel class="white-panel-background">${this.#e()}${a != null ? this.#R(a) : null}${a != null && !t.length ? this.#F() : null}${t.length > 0 ? this.hideFeatureResults ? this.#m() : this.#k() : null}${s.length > 0 ? this.#G(s) : null}</calcite-panel>`;
150
+ return l`<calcite-panel class="white-panel-background">${this.#e()}${a != null ? this.#R(a) : null}${a != null && !t.length ? this.#F() : null}${t.length > 0 ? this.hideFeatureResults ? this.#u() : this.#k() : null}${s.length > 0 ? this.#G(s) : null}</calcite-panel>`;
151
151
  }
152
152
  #R(e) {
153
153
  const { _aggregatedGeometryDisabled: t, aggregatedGeometryGraphicsColor: s, _messages: a } = this;
154
- return l`<div class="aggregated-geometry-container"><arcgis-utility-network-aggregated-geometry .graphicsColor=${s} .geometry=${e} .view=${this.view} @arcgisHideGraphicsChange=${this.#f} auto-destroy-disabled ${h(this.#h)}></arcgis-utility-network-aggregated-geometry><calcite-swatch id=geometry-color-swatch .label=${a.labels.aggregatedGeometryGraphicsColor} .color=${s.toCss()} .disabled=${t}></calcite-swatch><calcite-popover .heading=${a.headings.setColor} .label=${a.headings.setColor} reference-element=geometry-color-swatch closable ${h(this.#s)}><calcite-color-picker alpha-channel channels-disabled clearable hex-disabled saved-disabled .value=${s} @calciteColorPickerChange=${(i) => {
154
+ return l`<div class="aggregated-geometry-container"><arcgis-utility-network-aggregated-geometry .graphicsColor=${s} .geometry=${e} .view=${this.view} @arcgisHideGraphicsChange=${this.#f} auto-destroy-disabled ${u(this.#h)}></arcgis-utility-network-aggregated-geometry><calcite-swatch id=geometry-color-swatch .label=${a.labels.aggregatedGeometryGraphicsColor} .color=${s.toCss()} .disabled=${t}></calcite-swatch><calcite-popover .heading=${a.headings.setColor} .label=${a.headings.setColor} reference-element=geometry-color-swatch closable ${u(this.#s)}><calcite-color-picker alpha-channel channels-disabled clearable hex-disabled saved-disabled .value=${s} @calciteColorPickerChange=${(i) => {
155
155
  const r = i.target.value;
156
156
  this.arcgisAggregatedGeometryGraphicsColorChange.emit(r);
157
157
  }} .disabled=${t}></calcite-color-picker></calcite-popover></div>`;
158
158
  }
159
159
  #E() {
160
- return l`<calcite-panel class="white-panel-background">${this.#e()}${this.#m()}</calcite-panel>`;
160
+ return l`<calcite-panel class="white-panel-background">${this.#e()}${this.#u()}</calcite-panel>`;
161
161
  }
162
- #m() {
162
+ #u() {
163
163
  return l`<div class="no-selectable-results">${this._messages.resultFeaturesAreHidden}</div>`;
164
164
  }
165
165
  #F() {
@@ -183,13 +183,13 @@ class k extends f {
183
183
  const { _messages: t } = this;
184
184
  let s = e.message;
185
185
  switch (e.details?.raw?.extendedCode) {
186
- case u.dirtyAreasDiscovered:
186
+ case h.dirtyAreasDiscovered:
187
187
  s = t.traceErrors.dirtyAreasDiscovered;
188
188
  break;
189
- case u.noValidControllers:
189
+ case h.noValidControllers:
190
190
  s = t.traceErrors.noValidControllers;
191
191
  break;
192
- case u.pathNotFound:
192
+ case h.pathNotFound:
193
193
  s = t.traceErrors.pathNotFound;
194
194
  break;
195
195
  }