@arcgis/map-components 5.2.0-next.101 → 5.2.0-next.103
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/CX3ID4GM.js +2 -0
- package/dist/cdn/{IPT3YBSG.js → HJ7TFEPK.js} +1 -1
- package/dist/cdn/{ASVNFERZ.js → ZDGZMFCR.js} +1 -1
- package/dist/cdn/assets/feature-form-utility-network-association-settings/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-feature-form-utility-network-association-settings/customElement.js +171 -0
- package/dist/components/arcgis-feature-form-utility-network-association-settings/index.js +7 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -0
- package/package.json +5 -5
- /package/dist/cdn/{TDGEDT35.js → ZABYV3VA.js} +0 -0
package/dist/components/arcgis-feature-form-utility-network-association-settings/customElement.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { c as h } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as l } from "lit/directives/keyed.js";
|
|
4
|
+
import { getGraphicLayer as b } from "@arcgis/core/applications/Components/graphicOriginUtils.js";
|
|
5
|
+
import { LitElement as y } from "@arcgis/lumina";
|
|
6
|
+
import { log as d, composeMissingPropertyMessage as u } from "@arcgis/toolkit/log";
|
|
7
|
+
import { css as f, html as c } from "lit";
|
|
8
|
+
import { u as v } from "../../chunks/useT9n.js";
|
|
9
|
+
function g(r, e, t) {
|
|
10
|
+
const { associationType: i } = r;
|
|
11
|
+
switch (i) {
|
|
12
|
+
case "attachment":
|
|
13
|
+
return e === "to" ? t.attachment : t.structure;
|
|
14
|
+
case "containment":
|
|
15
|
+
return e === "to" ? t.content : t.container;
|
|
16
|
+
case "junction-edge-from-connectivity":
|
|
17
|
+
case "junction-edge-to-connectivity":
|
|
18
|
+
case "junction-edge-midspan-connectivity":
|
|
19
|
+
case "junction-junction-connectivity":
|
|
20
|
+
case "connectivity":
|
|
21
|
+
return t.connectivity;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function p(r, e) {
|
|
25
|
+
const t = b(r);
|
|
26
|
+
return t && "globalIdField" in t && t.globalIdField && e.fromNetworkElement ? r.getGlobalId() === e.fromNetworkElement.globalId : !1;
|
|
27
|
+
}
|
|
28
|
+
const $ = f`:host{--calcite-block-padding: 0;display:flex;flex-direction:column;background-color:transparent}calcite-block{margin-block:0;border:1px solid var(--calcite-color-border-3)}calcite-block:first-of-type{border-radius:var(--calcite-spacing-sm) var(--calcite-spacing-sm) 0 0}calcite-block:last-of-type{margin-block-end:var(--calcite-spacing-md);border-top:none;border-radius:0 0 var(--calcite-spacing-sm) var(--calcite-spacing-sm)}calcite-block calcite-label{margin-inline:var(--calcite-spacing-md)}.info-container{display:flex;flex-direction:column}.info-container>*{margin-block-end:var(--calcite-spacing-md)}`;
|
|
29
|
+
class k extends y {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments), this._messages = v({ blocking: !0 }), this.#e = 50, this.topLayerDisabled = !1;
|
|
32
|
+
}
|
|
33
|
+
static {
|
|
34
|
+
this.properties = { association: 0, associationType: 1, percentAlong: 9, sourceFeature: 0, targetFeature: 0, topLayerDisabled: 5, utilityNetwork: 0 };
|
|
35
|
+
}
|
|
36
|
+
static {
|
|
37
|
+
this.styles = $;
|
|
38
|
+
}
|
|
39
|
+
get #o() {
|
|
40
|
+
return !this.association || !this.sourceFeature || !this.targetFeature || !this.utilityNetwork;
|
|
41
|
+
}
|
|
42
|
+
#e;
|
|
43
|
+
get associationType() {
|
|
44
|
+
return this.association?.associationType;
|
|
45
|
+
}
|
|
46
|
+
set associationType(e) {
|
|
47
|
+
const { association: t } = this;
|
|
48
|
+
!t || e === void 0 || (t.associationType = e, (e === "junction-edge-from-connectivity" || e === "junction-edge-to-connectivity") && (t.percentAlong = void 0));
|
|
49
|
+
}
|
|
50
|
+
get percentAlong() {
|
|
51
|
+
return this.#e;
|
|
52
|
+
}
|
|
53
|
+
set percentAlong(e) {
|
|
54
|
+
this.#e = e, this.association?.associationType === "junction-edge-midspan-connectivity" && (this.association.percentAlong = e / 100);
|
|
55
|
+
}
|
|
56
|
+
loaded() {
|
|
57
|
+
this.association || d("error", this, u("association")), this.sourceFeature || d("error", this, u("sourceFeature")), this.targetFeature || d("error", this, u("targetFeature")), this.utilityNetwork || d("error", this, u("utilityNetwork"));
|
|
58
|
+
}
|
|
59
|
+
willUpdate(e) {
|
|
60
|
+
e.has("association") && (this.percentAlong = (this.association?.percentAlong ?? 0.5) * 100);
|
|
61
|
+
}
|
|
62
|
+
#c(e) {
|
|
63
|
+
const t = b(e);
|
|
64
|
+
return t != null && typeof t == "object" && "geometryType" in t && t.geometryType == null;
|
|
65
|
+
}
|
|
66
|
+
#s() {
|
|
67
|
+
const { _messages: e, associationType: t } = this;
|
|
68
|
+
if (!t)
|
|
69
|
+
return null;
|
|
70
|
+
switch (t) {
|
|
71
|
+
case "attachment":
|
|
72
|
+
case "connectivity":
|
|
73
|
+
case "containment":
|
|
74
|
+
case "junction-junction-connectivity":
|
|
75
|
+
return null;
|
|
76
|
+
case "junction-edge-midspan-connectivity":
|
|
77
|
+
case "junction-edge-from-connectivity":
|
|
78
|
+
case "junction-edge-to-connectivity": {
|
|
79
|
+
const i = t === "junction-edge-midspan-connectivity" ? t : "junction-edge-from-connectivity", n = [
|
|
80
|
+
this.#i("junction-edge-midspan-connectivity", i, e.associations.midspanEdge),
|
|
81
|
+
this.#i("junction-edge-from-connectivity", i, e.associations.endpointEdge)
|
|
82
|
+
];
|
|
83
|
+
return c`<div class="info-container">${l("additional-content", c`<calcite-label>${e.associations.connectTo}<calcite-combobox .label=${e.associations.edgeConnectionComboboxLabel} overlay-positioning=fixed selection-mode=single-persist .topLayerDisabled=${this.topLayerDisabled} @calciteComboboxChange=${({ currentTarget: o }) => {
|
|
84
|
+
this.associationType = o.value;
|
|
85
|
+
}}>${n}</calcite-combobox></calcite-label>`)}${i === "junction-edge-midspan-connectivity" ? this.#u() : this.#l()}</div>`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
#t(e, t, i) {
|
|
90
|
+
return c`<calcite-block .description=${t} expanded .heading=${e}>${i}</calcite-block>`;
|
|
91
|
+
}
|
|
92
|
+
#a(e, t, i) {
|
|
93
|
+
return l(`#${e}`, c`<calcite-combobox-item .heading=${i} .selected=${t === e} .value=${`${e}`}></calcite-combobox-item>`);
|
|
94
|
+
}
|
|
95
|
+
#i(e, t, i) {
|
|
96
|
+
return l(`#${e}`, c`<calcite-combobox-item .heading=${i} .selected=${t === e} .value=${e}></calcite-combobox-item>`);
|
|
97
|
+
}
|
|
98
|
+
#n(e, t) {
|
|
99
|
+
const { _messages: i, utilityNetwork: n } = this;
|
|
100
|
+
if (!n)
|
|
101
|
+
return null;
|
|
102
|
+
const a = n.getTerminalConfiguration(e)?.terminals.map((s) => this.#a(s.id, t.terminalId, s.name)) || [];
|
|
103
|
+
return c`<calcite-label>${i.associations.terminal}<calcite-combobox .label=${i.associations.terminalComboboxLabel} overlay-positioning=fixed selection-mode=single-persist .topLayerDisabled=${this.topLayerDisabled} @calciteComboboxChange=${({ currentTarget: s }) => {
|
|
104
|
+
t.terminalId = Number.parseInt(s.value, 10);
|
|
105
|
+
}}>${a}</calcite-combobox></calcite-label>`;
|
|
106
|
+
}
|
|
107
|
+
#r() {
|
|
108
|
+
const { _messages: e, association: t } = this;
|
|
109
|
+
if (!t)
|
|
110
|
+
return null;
|
|
111
|
+
const i = t.isContentVisible ?? !1;
|
|
112
|
+
return c`<calcite-label layout=inline>${e.associations.visible}<calcite-switch .checked=${i} @calciteSwitchChange=${({ currentTarget: n }) => {
|
|
113
|
+
t.isContentVisible = n.checked;
|
|
114
|
+
}}></calcite-switch></calcite-label>`;
|
|
115
|
+
}
|
|
116
|
+
#l() {
|
|
117
|
+
const { _messages: e, associationType: t } = this, i = t === "junction-edge-to-connectivity";
|
|
118
|
+
return l("endpoint-edge", c`<calcite-label>${e.associations.edgeSide}<calcite-label layout=inline>${e.associations.fromSide}<calcite-switch .checked=${i} @calciteSwitchChange=${({ currentTarget: n }) => {
|
|
119
|
+
const a = n.checked ? "junction-edge-to-connectivity" : "junction-edge-from-connectivity";
|
|
120
|
+
this.associationType = a;
|
|
121
|
+
}}></calcite-switch>${e.associations.toSide}</calcite-label></calcite-label>`);
|
|
122
|
+
}
|
|
123
|
+
#d() {
|
|
124
|
+
const { association: e, associationType: t, sourceFeature: i, targetFeature: n } = this;
|
|
125
|
+
if (!e || !t || !i || !n)
|
|
126
|
+
return null;
|
|
127
|
+
const o = p(i.feature, e) ? i : n, a = o.label, s = g(e, "from", this._messages.associationTypes);
|
|
128
|
+
switch (t) {
|
|
129
|
+
case "connectivity":
|
|
130
|
+
case "junction-edge-from-connectivity":
|
|
131
|
+
case "junction-edge-midspan-connectivity":
|
|
132
|
+
case "junction-edge-to-connectivity":
|
|
133
|
+
case "junction-junction-connectivity":
|
|
134
|
+
return this.#t(a, s, this.#n(o.feature, e.fromNetworkElement));
|
|
135
|
+
case "attachment":
|
|
136
|
+
case "containment":
|
|
137
|
+
return this.#t(a, s);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
#u() {
|
|
141
|
+
const { _messages: e, percentAlong: t } = this;
|
|
142
|
+
return l("midspan-edge", c`<calcite-label>${e.associations.midspanLocation}<calcite-input-number max=100 min=0 number-button-type=vertical suffix-text=% .value=${`${t}`} @calciteInputNumberInput=${({ currentTarget: i }) => {
|
|
143
|
+
const n = Number.parseFloat(i.value);
|
|
144
|
+
Number.isNaN(n) || (this.percentAlong = n);
|
|
145
|
+
}}></calcite-input-number></calcite-label>`);
|
|
146
|
+
}
|
|
147
|
+
#m() {
|
|
148
|
+
const { association: e, associationType: t, sourceFeature: i, targetFeature: n } = this;
|
|
149
|
+
if (!e || !t || !i || !n)
|
|
150
|
+
return null;
|
|
151
|
+
const o = p(i.feature, e) ? n : i, a = o.label, s = g(e, "to", this._messages.associationTypes);
|
|
152
|
+
let m;
|
|
153
|
+
switch (t) {
|
|
154
|
+
case "connectivity":
|
|
155
|
+
case "junction-junction-connectivity":
|
|
156
|
+
m = this.#n(o.feature, e.toNetworkElement);
|
|
157
|
+
break;
|
|
158
|
+
case "containment":
|
|
159
|
+
m = this.#c(o.feature) ? void 0 : this.#r();
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
return this.#t(a, s, m);
|
|
163
|
+
}
|
|
164
|
+
render() {
|
|
165
|
+
return this.#o ? null : c`${this.#d()}${this.#m()}${this.#s()}`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
h("arcgis-feature-form-utility-network-association-settings", k);
|
|
169
|
+
export {
|
|
170
|
+
k as FeatureFormUtilityNetworkAssociationSettings
|
|
171
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "@esri/calcite-components/components/calcite-label";
|
|
2
|
+
import "@esri/calcite-components/components/calcite-combobox";
|
|
3
|
+
import "@esri/calcite-components/components/calcite-block";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-combobox-item";
|
|
5
|
+
import "@esri/calcite-components/components/calcite-switch";
|
|
6
|
+
import "@esri/calcite-components/components/calcite-input-number";
|
|
7
|
+
export * from "./customElement.js";
|