@arcgis/map-components 5.1.0-next.75 → 5.1.0-next.76
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/{FM3AT2SL.js → AG7LUCV3.js} +1 -1
- package/dist/cdn/G7KHJU6J.js +2 -0
- package/dist/cdn/{ACAAYGKC.js → HL4M23YL.js} +1 -1
- package/dist/cdn/MNXYDKVS.js +2 -0
- package/dist/cdn/PP7ZT3L2.js +2 -0
- package/dist/cdn/QW4QGAIG.js +2 -0
- package/dist/cdn/SD7DMWPD.js +2 -0
- package/dist/cdn/{KGLUFWJ7.js → T66WG4I4.js} +1 -1
- package/dist/cdn/V2HLEYHF.js +3 -0
- package/dist/cdn/{3TVO5LIN.js → WO2BX7U2.js} +1 -1
- package/dist/cdn/XOTOQOK6.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/useArcgisViewReadyError.js +20 -19
- package/dist/chunks/video-utils.js +12 -0
- package/dist/components/arcgis-feature/customElement.js +75 -53
- package/dist/components/arcgis-feature-media/customElement.js +222 -211
- package/dist/components/arcgis-feature-relationship/customElement.js +69 -68
- package/dist/components/arcgis-features/customElement.d.ts +2 -2
- package/dist/components/arcgis-features/customElement.js +44 -44
- package/dist/components/arcgis-popup/customElement.d.ts +2 -2
- package/dist/components/arcgis-video-player/customElement.js +22 -21
- package/dist/components/arcgis-video-player-action-bar/customElement.js +14 -17
- 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 -1
- package/package.json +4 -4
- package/dist/cdn/2IXIUNGH.js +0 -2
- package/dist/cdn/CQCKW6L4.js +0 -2
- package/dist/cdn/EXZFAJW4.js +0 -3
- package/dist/cdn/GHSQJ4UC.js +0 -2
- package/dist/cdn/QPMWCCXQ.js +0 -2
- package/dist/cdn/YCM6SOEX.js +0 -2
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { ref as
|
|
5
|
-
import { keyed as
|
|
6
|
-
import { useDirection as
|
|
7
|
-
import { getColorsFromRenderer as
|
|
8
|
-
import { LitElement as
|
|
9
|
-
import { substitute as
|
|
10
|
-
import { watch as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { unsafeGetCalciteModeName as
|
|
14
|
-
import { renderingSanitizer as
|
|
15
|
-
import { d as A, s as R, l as z, m as X, n as
|
|
16
|
-
const oe =
|
|
2
|
+
import { c as B } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as W, html as _ } from "lit";
|
|
4
|
+
import { ref as j } from "lit/directives/ref.js";
|
|
5
|
+
import { keyed as G } from "lit/directives/keyed.js";
|
|
6
|
+
import { useDirection as q, useMedia as K } from "@arcgis/lumina/controllers";
|
|
7
|
+
import { getColorsFromRenderer as J } from "@arcgis/core/renderers/support/utils.js";
|
|
8
|
+
import { LitElement as Q, nothing as y } from "@arcgis/lumina";
|
|
9
|
+
import { substitute as Z } from "@arcgis/core/intl.js";
|
|
10
|
+
import { watch as ee } from "@arcgis/core/core/reactiveUtils.js";
|
|
11
|
+
import te from "@arcgis/core/popup/FieldInfo.js";
|
|
12
|
+
import V from "@arcgis/core/popup/content/support/ChartMediaInfoValueSeries.js";
|
|
13
|
+
import { unsafeGetCalciteModeName as ie } from "@arcgis/toolkit/dom";
|
|
14
|
+
import { renderingSanitizer as N } from "@arcgis/core/applications/Components/sanitizerUtils.js";
|
|
15
|
+
import { d as A, s as R, l as z, m as X, n as ae, o as E, i as re, p as ne, h as Y, f as se } from "../../chunks/feature-utils.js";
|
|
16
|
+
const oe = W`.container{display:flex;flex-flow:row wrap;align-items:center;margin-top:var(--calcite-spacing-xs);width:100%;min-height:150px}.container .pagination-button{display:flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;padding-block:var(--calcite-spacing-xs);padding-inline:var(--calcite-spacing-xs);color:var(--calcite-color-text-3)}.container .pagination-button:hover,.container .pagination-button:focus{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1);fill:var(--calcite-color-text-1)}.item-title{margin:0;font-size:var(--calcite-font-size-md);line-height:var(--calcite-font-line-height-relative-snug)}.item-caption{padding-block-start:var(--calcite-spacing-xxs);font-size:var(--calcite-font-size-sm);line-height:var(--calcite-font-line-height-relative-snug)}.item{display:flex;align-items:flex-start;justify-content:center;margin-block:var(--calcite-spacing-xs);width:100%;height:auto}.item-navigation{display:flex;flex:0 1 100%;align-items:flex-start;justify-content:space-between;margin-block-end:var(--calcite-spacing-xs)}.item-text{margin-inline-end:var(--calcite-spacing-xs)}.pagination{display:flex;flex:0 0 auto;align-items:center;overflow:hidden}.pagination:only-child{margin-inline-start:auto}.pagination-text{padding-inline:var(--calcite-spacing-xxs);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm);line-height:var(--calcite-font-line-height-relative-normal)}.item-container{flex:0 1 auto;width:100%}.item-container img{max-width:100%}.item-container img[src$=".SVG"],.item-container img[src$=".svg"]{width:100%}.chart{width:100%;height:155px}`;
|
|
17
17
|
function $(S) {
|
|
18
18
|
if (!A(S))
|
|
19
19
|
return null;
|
|
20
20
|
const [e, t] = S.split("/").slice(1);
|
|
21
21
|
return { layerId: e, fieldName: t };
|
|
22
22
|
}
|
|
23
|
-
const k = 15,
|
|
24
|
-
class
|
|
23
|
+
const k = 15, C = "category", w = "value", le = "rgba(50, 50, 50, 1)", ce = 250, de = 500, ue = 200;
|
|
24
|
+
class he extends Q {
|
|
25
25
|
constructor() {
|
|
26
|
-
super(...arguments), this._direction =
|
|
26
|
+
super(...arguments), this._direction = q(), this._prefersReducedMotion = K("(prefers-reduced-motion)"), this.activeMediaInfoIndex = 0, this.chartAnimationDisabled = !1, this.headingLevel = 2;
|
|
27
27
|
}
|
|
28
28
|
static {
|
|
29
|
-
this.properties = { _refreshIntervalInfo: 16, messages: 0, values: 0, activeMediaInfoIndex: 9, chartAnimationDisabled: 5, activeMediaInfo: 32, formattedMediaInfos: 32, description: 1, fieldInfoMap: 0, layer: 0, mediaInfos: 0, popupTemplate: 0, relatedInfos: 0, formattedValues: 0, heading: 1, graphic: 0, formattedMediaInfoCount: 32, headingLevel: 9 };
|
|
29
|
+
this.properties = { _refreshIntervalInfo: 16, messages: 0, values: 0, expressionValues: 0, activeMediaInfoIndex: 9, chartAnimationDisabled: 5, activeMediaInfo: 32, formattedMediaInfos: 32, description: 1, fieldInfoMap: 0, layer: 0, mediaInfos: 0, popupTemplate: 0, relatedInfos: 0, formattedValues: 0, heading: 1, graphic: 0, formattedMediaInfoCount: 32, headingLevel: 9 };
|
|
30
30
|
}
|
|
31
31
|
static {
|
|
32
32
|
this.styles = oe;
|
|
@@ -51,7 +51,7 @@ class ue extends J {
|
|
|
51
51
|
}
|
|
52
52
|
loaded() {
|
|
53
53
|
this.manager.onLifecycle(() => [
|
|
54
|
-
|
|
54
|
+
ee(() => [this.activeMediaInfo, this.activeMediaInfoIndex], () => this._setupMediaRefreshTimer(), { initial: !0 }),
|
|
55
55
|
{ remove: () => this._clearMediaRefreshTimer() }
|
|
56
56
|
]);
|
|
57
57
|
}
|
|
@@ -64,155 +64,166 @@ class ue extends J {
|
|
|
64
64
|
this._setContentElementMedia(i);
|
|
65
65
|
}
|
|
66
66
|
_formatMediaInfos() {
|
|
67
|
-
const { mediaInfos: e, layer: t } = this, i = this.values ?? {}, a = this.formattedValues ?? {},
|
|
67
|
+
const { mediaInfos: e, layer: t } = this, i = this.values ?? {}, a = this.formattedValues ?? {}, n = this.fieldInfoMap ?? /* @__PURE__ */ new Map(), s = this.expressionValues ?? {};
|
|
68
68
|
return e?.map((o) => {
|
|
69
|
-
const
|
|
70
|
-
if (!
|
|
69
|
+
const r = o?.clone();
|
|
70
|
+
if (!r)
|
|
71
71
|
return null;
|
|
72
|
-
if (
|
|
72
|
+
if (r.title = R({
|
|
73
73
|
values: i,
|
|
74
|
-
fieldInfoMap:
|
|
74
|
+
fieldInfoMap: n,
|
|
75
75
|
globalValues: a,
|
|
76
76
|
layer: t,
|
|
77
|
-
text:
|
|
78
|
-
}),
|
|
77
|
+
text: r.title
|
|
78
|
+
}), r.caption = R({
|
|
79
79
|
values: i,
|
|
80
|
-
fieldInfoMap:
|
|
80
|
+
fieldInfoMap: n,
|
|
81
81
|
globalValues: a,
|
|
82
82
|
layer: t,
|
|
83
|
-
text:
|
|
84
|
-
}),
|
|
83
|
+
text: r.caption
|
|
84
|
+
}), r.altText = R({
|
|
85
85
|
values: i,
|
|
86
|
-
fieldInfoMap:
|
|
86
|
+
fieldInfoMap: n,
|
|
87
87
|
globalValues: a,
|
|
88
88
|
layer: t,
|
|
89
|
-
text:
|
|
90
|
-
}),
|
|
91
|
-
if (!
|
|
89
|
+
text: r.altText
|
|
90
|
+
}), r.type === "image") {
|
|
91
|
+
if (!r.value)
|
|
92
92
|
return null;
|
|
93
|
-
const
|
|
93
|
+
const c = r.value;
|
|
94
94
|
return this._setImageValue({
|
|
95
|
-
value:
|
|
95
|
+
value: c,
|
|
96
96
|
formattedValues: a,
|
|
97
97
|
layer: t
|
|
98
|
-
}),
|
|
98
|
+
}), c.sourceURL ? r : void 0;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
101
|
-
if (!
|
|
100
|
+
if (r.type === "pie-chart" || r.type === "line-chart" || r.type === "column-chart" || r.type === "bar-chart") {
|
|
101
|
+
if (!r.value)
|
|
102
102
|
return null;
|
|
103
|
-
const
|
|
103
|
+
const c = r.value;
|
|
104
104
|
return this._setChartValue({
|
|
105
|
-
value:
|
|
106
|
-
chartType:
|
|
105
|
+
value: c,
|
|
106
|
+
chartType: r.type,
|
|
107
107
|
values: i,
|
|
108
|
+
expressionValues: s,
|
|
108
109
|
formattedValues: a,
|
|
109
110
|
layer: t
|
|
110
|
-
}),
|
|
111
|
+
}), r;
|
|
111
112
|
}
|
|
112
113
|
return null;
|
|
113
114
|
}).filter((o) => o != null) ?? [];
|
|
114
115
|
}
|
|
115
116
|
_setImageValue(e) {
|
|
116
|
-
const t = this.fieldInfoMap ?? /* @__PURE__ */ new Map(), { value: i, formattedValues: a, layer:
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
117
|
+
const t = this.fieldInfoMap ?? /* @__PURE__ */ new Map(), { value: i, formattedValues: a, layer: n } = e, { linkURL: s, sourceURL: o } = i;
|
|
118
|
+
if (o) {
|
|
119
|
+
const r = z(o, n);
|
|
119
120
|
i.sourceURL = X({
|
|
120
121
|
formattedValues: a,
|
|
121
|
-
template:
|
|
122
|
+
template: r,
|
|
122
123
|
fieldInfoMap: t
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
126
|
+
if (s) {
|
|
127
|
+
const r = z(s, n);
|
|
127
128
|
i.linkURL = X({
|
|
128
129
|
formattedValues: a,
|
|
129
|
-
template:
|
|
130
|
+
template: r,
|
|
130
131
|
fieldInfoMap: t
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
_setChartValue(e) {
|
|
135
|
-
const { value: t, values: i,
|
|
136
|
-
if (t.fields =
|
|
136
|
+
const { value: t, values: i, expressionValues: a, formattedValues: n, chartType: s, layer: o } = e, { popupTemplate: r, relatedInfos: c } = this, { fields: m, normalizeField: d } = t, l = o;
|
|
137
|
+
if (t.fields = ae(m, l), d && (t.normalizeField = E(d, l)), !m.some((f) => !!(n[f] != null || A(f) && c?.size)))
|
|
137
138
|
return;
|
|
138
|
-
const
|
|
139
|
-
t.series = [],
|
|
140
|
-
const
|
|
141
|
-
if (A(
|
|
139
|
+
const u = r?.fieldInfos ?? [];
|
|
140
|
+
t.series = [], m.forEach((f, h) => {
|
|
141
|
+
const g = t.colors?.[h];
|
|
142
|
+
if (A(f)) {
|
|
142
143
|
t.series = [
|
|
143
144
|
...t.series,
|
|
144
|
-
...this._getRelatedChartInfos({
|
|
145
|
+
...this._getRelatedChartInfos({
|
|
146
|
+
fieldInfos: u,
|
|
147
|
+
fieldName: f,
|
|
148
|
+
formattedValues: n,
|
|
149
|
+
expressionValues: a,
|
|
150
|
+
chartType: s,
|
|
151
|
+
value: t,
|
|
152
|
+
color: g
|
|
153
|
+
})
|
|
145
154
|
];
|
|
146
155
|
return;
|
|
147
156
|
}
|
|
148
|
-
const
|
|
157
|
+
const x = this._getChartOption({
|
|
149
158
|
value: t,
|
|
150
159
|
values: i,
|
|
151
|
-
chartType:
|
|
152
|
-
formattedValues:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
chartType: s,
|
|
161
|
+
formattedValues: n,
|
|
162
|
+
expressionValues: a,
|
|
163
|
+
fieldName: f,
|
|
164
|
+
fieldInfos: u,
|
|
165
|
+
color: g
|
|
156
166
|
});
|
|
157
|
-
t.series.push(
|
|
167
|
+
t.series.push(x);
|
|
158
168
|
});
|
|
159
169
|
}
|
|
160
170
|
_getRelatedChartInfos(e) {
|
|
161
|
-
const { fieldInfos: t, fieldName: i, formattedValues: a, chartType:
|
|
162
|
-
if (!
|
|
163
|
-
return
|
|
164
|
-
const { relatedFeatures:
|
|
165
|
-
if (!
|
|
166
|
-
return
|
|
167
|
-
const { cardinality:
|
|
168
|
-
return
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
value:
|
|
173
|
-
values:
|
|
171
|
+
const { fieldInfos: t, fieldName: i, formattedValues: a, chartType: n, value: s, color: o, expressionValues: r } = e, c = [], m = $(i), d = m && this.relatedInfos?.get(m.layerId);
|
|
172
|
+
if (!d)
|
|
173
|
+
return c;
|
|
174
|
+
const { relatedFeatures: l, relation: p } = d;
|
|
175
|
+
if (!p || !l)
|
|
176
|
+
return c;
|
|
177
|
+
const { cardinality: u } = p;
|
|
178
|
+
return l.forEach((h) => {
|
|
179
|
+
const g = h.attributes;
|
|
180
|
+
g && Object.keys(g).forEach((x) => {
|
|
181
|
+
x === m.fieldName && c.push(this._getChartOption({
|
|
182
|
+
value: s,
|
|
183
|
+
values: g,
|
|
174
184
|
formattedValues: a,
|
|
185
|
+
expressionValues: r,
|
|
175
186
|
fieldName: i,
|
|
176
|
-
chartType:
|
|
177
|
-
relatedFieldName:
|
|
178
|
-
hasMultipleRelatedFeatures:
|
|
187
|
+
chartType: n,
|
|
188
|
+
relatedFieldName: x,
|
|
189
|
+
hasMultipleRelatedFeatures: l?.length > 1,
|
|
179
190
|
fieldInfos: t,
|
|
180
|
-
color:
|
|
191
|
+
color: o
|
|
181
192
|
}));
|
|
182
193
|
});
|
|
183
|
-
}),
|
|
194
|
+
}), u && (u === "one-to-many" || u === "many-to-many") ? c : [c[0]];
|
|
184
195
|
}
|
|
185
196
|
_getTooltip({ label: e, value: t, chartType: i }) {
|
|
186
197
|
return i === "pie-chart" ? `${e}` : `${e}: ${t}`;
|
|
187
198
|
}
|
|
188
199
|
_getChartOption(e) {
|
|
189
|
-
const { value: t, values: i, formattedValues: a, fieldName:
|
|
190
|
-
fieldInfo:
|
|
200
|
+
const { value: t, values: i, formattedValues: a, expressionValues: n, fieldName: s, relatedFieldName: o, fieldInfos: r, chartType: c, hasMultipleRelatedFeatures: m, color: d } = e, { layer: l, graphic: p } = this, u = this.fieldInfoMap ?? /* @__PURE__ */ new Map(), { normalizeField: f, tooltipField: h } = t, g = f ? A(f) ? i[$(f).fieldName] : i[f] : null, x = re(s) && n?.[s] !== void 0 ? n[s] : o && i[o] !== void 0 ? i[o] : i[s] !== void 0 ? i[s] : a[s], I = x === void 0 ? null : x && g && typeof x == "number" && typeof g == "number" ? x / g : x, v = ne(r, s), M = E(s, l), b = (h && a[h] !== void 0 ? a[h] : Y({
|
|
201
|
+
fieldInfo: v || new te({ fieldName: M }),
|
|
191
202
|
expressionInfos: this.popupTemplate?.expressionInfos,
|
|
192
|
-
graphic:
|
|
193
|
-
layer:
|
|
194
|
-
})) ?? "",
|
|
195
|
-
if (A(
|
|
196
|
-
const T =
|
|
197
|
-
return new
|
|
198
|
-
fieldName:
|
|
203
|
+
graphic: p,
|
|
204
|
+
layer: l
|
|
205
|
+
})) ?? "", P = a[M] ?? "", L = I != null ? typeof I == "number" ? I : Number(I) : null;
|
|
206
|
+
if (A(s)) {
|
|
207
|
+
const T = u.get(s.toLowerCase()), U = h ? u.get(h.toLowerCase()) : null, H = T?.fieldName ?? s, F = m && h ? $(h).fieldName : U?.fieldName ?? h, D = (m && F ? i[F] : a[F] ?? (T && Y({ fieldInfo: T, layer: l, graphic: p })) ?? T?.fieldName ?? o) ?? "", O = (m && o ? i[o] : a[H]) ?? "";
|
|
208
|
+
return new V({
|
|
209
|
+
fieldName: s,
|
|
199
210
|
tooltip: this._getTooltip({
|
|
200
|
-
label:
|
|
201
|
-
value:
|
|
202
|
-
chartType:
|
|
211
|
+
label: D,
|
|
212
|
+
value: O,
|
|
213
|
+
chartType: c
|
|
203
214
|
}),
|
|
204
|
-
color:
|
|
215
|
+
color: d,
|
|
205
216
|
value: L
|
|
206
217
|
});
|
|
207
218
|
}
|
|
208
|
-
return new
|
|
209
|
-
fieldName:
|
|
219
|
+
return new V({
|
|
220
|
+
fieldName: s,
|
|
210
221
|
tooltip: this._getTooltip({
|
|
211
|
-
label:
|
|
212
|
-
value:
|
|
213
|
-
chartType:
|
|
222
|
+
label: b,
|
|
223
|
+
value: P,
|
|
224
|
+
chartType: c
|
|
214
225
|
}),
|
|
215
|
-
color:
|
|
226
|
+
color: d,
|
|
216
227
|
value: L
|
|
217
228
|
});
|
|
218
229
|
}
|
|
@@ -230,10 +241,10 @@ class ue extends J {
|
|
|
230
241
|
const { color: e } = await import("@amcharts/amcharts5/index.js"), t = /* @__PURE__ */ new Map(), i = this._getRenderer(), a = "default";
|
|
231
242
|
if (!i)
|
|
232
243
|
return t;
|
|
233
|
-
const
|
|
234
|
-
return
|
|
235
|
-
const
|
|
236
|
-
|
|
244
|
+
const n = await J(i);
|
|
245
|
+
return n.delete(a), Array.from(n.values()).every((o) => o?.length === 1) && Array.from(n.keys()).forEach((o) => {
|
|
246
|
+
const r = n.get(o)?.[0]?.toCss(!0);
|
|
247
|
+
r && t.set(o, e(r));
|
|
237
248
|
}), t;
|
|
238
249
|
}
|
|
239
250
|
async _createChart(e) {
|
|
@@ -254,47 +265,47 @@ class ue extends J {
|
|
|
254
265
|
return !this.chartAnimationDisabled && !this._prefersReducedMotion;
|
|
255
266
|
}
|
|
256
267
|
_getChartAnimationMS() {
|
|
257
|
-
return this._canAnimateChart() ?
|
|
268
|
+
return this._canAnimateChart() ? ce : 0;
|
|
258
269
|
}
|
|
259
270
|
_getChartSeriesAnimationMS() {
|
|
260
|
-
return this._canAnimateChart() ?
|
|
271
|
+
return this._canAnimateChart() ? de : 0;
|
|
261
272
|
}
|
|
262
273
|
async _customizeChartTooltip(e, t = "horizontal") {
|
|
263
274
|
const { color: i } = await import("@amcharts/amcharts5/index.js");
|
|
264
275
|
e.setAll({
|
|
265
276
|
pointerOrientation: t
|
|
266
277
|
}), e.get("background")?.setAll({
|
|
267
|
-
stroke: i(
|
|
278
|
+
stroke: i(le)
|
|
268
279
|
}), e.label.setAll({
|
|
269
280
|
direction: this._direction,
|
|
270
281
|
oversizedBehavior: "wrap",
|
|
271
|
-
maxWidth:
|
|
282
|
+
maxWidth: ue
|
|
272
283
|
});
|
|
273
284
|
}
|
|
274
285
|
async _createPieChart(e, t) {
|
|
275
|
-
const [{ Tooltip: i }, { PieChart: a, PieSeries:
|
|
286
|
+
const [{ Tooltip: i }, { PieChart: a, PieSeries: n }] = await Promise.all([
|
|
276
287
|
import("@amcharts/amcharts5/index.js"),
|
|
277
288
|
import("@amcharts/amcharts5/percent.js")
|
|
278
|
-
]), { mediaInfo:
|
|
289
|
+
]), { mediaInfo: s, root: o } = e, { title: r } = s, c = 5, m = s?.altText || s?.title || "", d = o.container.children.push(a.new(o, {
|
|
279
290
|
role: "figure",
|
|
280
|
-
ariaLabel:
|
|
291
|
+
ariaLabel: m,
|
|
281
292
|
focusable: !0,
|
|
282
293
|
paddingBottom: c,
|
|
283
294
|
paddingTop: c,
|
|
284
295
|
paddingLeft: c,
|
|
285
296
|
paddingRight: c
|
|
286
297
|
})), l = `{category}: {valuePercentTotal.formatNumber('0.00')}%
|
|
287
|
-
({value})`,
|
|
298
|
+
({value})`, p = i.new(o, {
|
|
288
299
|
labelText: l
|
|
289
|
-
}), u = d.series.push(
|
|
290
|
-
name:
|
|
300
|
+
}), u = d.series.push(n.new(o, {
|
|
301
|
+
name: r,
|
|
291
302
|
valueField: w,
|
|
292
|
-
categoryField:
|
|
293
|
-
tooltip:
|
|
303
|
+
categoryField: C,
|
|
304
|
+
tooltip: p
|
|
294
305
|
}));
|
|
295
306
|
u.ticks.template.set("forceHidden", !0), u.labels.template.set("forceHidden", !0), u.slices.template.states.create("active", {
|
|
296
307
|
shiftRadius: c
|
|
297
|
-
}), this._customizeChartTooltip(
|
|
308
|
+
}), this._customizeChartTooltip(p), u.slices.template.setAll({
|
|
298
309
|
ariaLabel: l,
|
|
299
310
|
focusable: !0,
|
|
300
311
|
templateField: "columnSettings"
|
|
@@ -305,140 +316,140 @@ class ue extends J {
|
|
|
305
316
|
return e.forEach((i) => t = Math.min(i.value, t)), t;
|
|
306
317
|
}
|
|
307
318
|
async _createColumnChart(e, t, i) {
|
|
308
|
-
const [{ Tooltip: a, Scrollbar:
|
|
319
|
+
const [{ Tooltip: a, Scrollbar: n }, { CategoryAxis: s, AxisRendererX: o, AxisRendererY: r, ValueAxis: c, ColumnSeries: m }] = await Promise.all([import("@amcharts/amcharts5/index.js"), import("@amcharts/amcharts5/xy.js")]), { mediaInfo: d, root: l } = t, { value: p, title: u } = d, { _direction: f } = this;
|
|
309
320
|
e.setAll({
|
|
310
321
|
wheelX: "panX",
|
|
311
322
|
wheelY: "zoomX"
|
|
312
323
|
});
|
|
313
|
-
const
|
|
314
|
-
renderer:
|
|
324
|
+
const h = e.xAxes.push(s.new(l, {
|
|
325
|
+
renderer: o.new(l, {
|
|
315
326
|
inversed: f === "rtl"
|
|
316
327
|
}),
|
|
317
|
-
categoryField:
|
|
328
|
+
categoryField: C
|
|
318
329
|
}));
|
|
319
|
-
|
|
330
|
+
h.get("renderer").labels.template.setAll({
|
|
320
331
|
forceHidden: !0
|
|
321
332
|
});
|
|
322
|
-
const
|
|
323
|
-
renderer:
|
|
324
|
-
min: this._getMinSeriesValue(
|
|
333
|
+
const g = e.yAxes.push(c.new(l, {
|
|
334
|
+
renderer: r.new(l, { inside: !1 }),
|
|
335
|
+
min: this._getMinSeriesValue(p.series)
|
|
325
336
|
}));
|
|
326
|
-
|
|
337
|
+
g.get("renderer").labels.template.setAll({
|
|
327
338
|
direction: f
|
|
328
339
|
});
|
|
329
|
-
const
|
|
330
|
-
labelText:
|
|
331
|
-
}),
|
|
340
|
+
const x = "{categoryX}", I = a.new(l, {
|
|
341
|
+
labelText: x
|
|
342
|
+
}), v = e.series.push(m.new(l, {
|
|
332
343
|
name: u,
|
|
333
|
-
xAxis:
|
|
334
|
-
yAxis:
|
|
344
|
+
xAxis: h,
|
|
345
|
+
yAxis: g,
|
|
335
346
|
valueYField: w,
|
|
336
|
-
categoryXField:
|
|
337
|
-
tooltip:
|
|
347
|
+
categoryXField: C,
|
|
348
|
+
tooltip: I
|
|
338
349
|
}));
|
|
339
|
-
this._customizeChartTooltip(
|
|
340
|
-
ariaLabel:
|
|
350
|
+
this._customizeChartTooltip(I), v.columns.template.setAll({
|
|
351
|
+
ariaLabel: x,
|
|
341
352
|
focusable: !0,
|
|
342
353
|
templateField: "columnSettings"
|
|
343
|
-
}),
|
|
354
|
+
}), p.series.length > k && e.set("scrollbarX", n.new(l, {
|
|
344
355
|
orientation: "horizontal"
|
|
345
|
-
})),
|
|
356
|
+
})), h.data.setAll(i), v.data.setAll(i), v.appear(this._getChartSeriesAnimationMS()), e.appear(this._getChartAnimationMS());
|
|
346
357
|
}
|
|
347
358
|
async _createBarChart(e, t, i) {
|
|
348
|
-
const [{ Tooltip: a, Scrollbar:
|
|
359
|
+
const [{ Tooltip: a, Scrollbar: n }, { CategoryAxis: s, AxisRendererX: o, AxisRendererY: r, ValueAxis: c, ColumnSeries: m }] = await Promise.all([import("@amcharts/amcharts5/index.js"), import("@amcharts/amcharts5/xy.js")]), { mediaInfo: d, root: l } = t, { value: p, title: u } = d, { _direction: f } = this;
|
|
349
360
|
e.setAll({
|
|
350
361
|
wheelX: "panY",
|
|
351
362
|
wheelY: "zoomY"
|
|
352
363
|
});
|
|
353
|
-
const
|
|
354
|
-
renderer:
|
|
364
|
+
const h = e.yAxes.push(s.new(l, {
|
|
365
|
+
renderer: r.new(l, {
|
|
355
366
|
inversed: !0
|
|
356
367
|
}),
|
|
357
|
-
categoryField:
|
|
368
|
+
categoryField: C
|
|
358
369
|
}));
|
|
359
|
-
|
|
370
|
+
h.get("renderer").labels.template.setAll({
|
|
360
371
|
forceHidden: !0
|
|
361
372
|
});
|
|
362
|
-
const
|
|
363
|
-
renderer:
|
|
373
|
+
const g = e.xAxes.push(c.new(l, {
|
|
374
|
+
renderer: o.new(l, {
|
|
364
375
|
inside: !1,
|
|
365
376
|
inversed: f === "rtl"
|
|
366
377
|
}),
|
|
367
|
-
min: this._getMinSeriesValue(
|
|
378
|
+
min: this._getMinSeriesValue(p.series)
|
|
368
379
|
}));
|
|
369
|
-
|
|
380
|
+
g.get("renderer").labels.template.setAll({
|
|
370
381
|
direction: f
|
|
371
382
|
});
|
|
372
|
-
const
|
|
373
|
-
labelText:
|
|
374
|
-
}),
|
|
383
|
+
const x = "{categoryY}", I = a.new(l, {
|
|
384
|
+
labelText: x
|
|
385
|
+
}), v = e.series.push(m.new(l, {
|
|
375
386
|
name: u,
|
|
376
|
-
xAxis:
|
|
377
|
-
yAxis:
|
|
387
|
+
xAxis: g,
|
|
388
|
+
yAxis: h,
|
|
378
389
|
valueXField: w,
|
|
379
|
-
categoryYField:
|
|
380
|
-
tooltip:
|
|
390
|
+
categoryYField: C,
|
|
391
|
+
tooltip: I
|
|
381
392
|
}));
|
|
382
|
-
this._customizeChartTooltip(
|
|
383
|
-
ariaLabel:
|
|
393
|
+
this._customizeChartTooltip(I, "vertical"), v.columns.template.setAll({
|
|
394
|
+
ariaLabel: x,
|
|
384
395
|
focusable: !0,
|
|
385
396
|
templateField: "columnSettings"
|
|
386
|
-
}),
|
|
397
|
+
}), p.series.length > k && e.set("scrollbarY", n.new(l, {
|
|
387
398
|
orientation: "vertical"
|
|
388
|
-
})),
|
|
399
|
+
})), h.data.setAll(i), v.data.setAll(i), v.appear(this._getChartSeriesAnimationMS()), e.appear(this._getChartAnimationMS());
|
|
389
400
|
}
|
|
390
401
|
async _createLineChart(e, t, i) {
|
|
391
|
-
const [{ Tooltip: a, Scrollbar:
|
|
402
|
+
const [{ Tooltip: a, Scrollbar: n }, { CategoryAxis: s, AxisRendererX: o, AxisRendererY: r, ValueAxis: c, LineSeries: m }] = await Promise.all([import("@amcharts/amcharts5/index.js"), import("@amcharts/amcharts5/xy.js")]), { root: d, mediaInfo: l } = t, { value: p, title: u } = l, { _direction: f } = this;
|
|
392
403
|
e.setAll({
|
|
393
404
|
wheelX: "panX",
|
|
394
405
|
wheelY: "zoomX"
|
|
395
406
|
});
|
|
396
|
-
const
|
|
397
|
-
renderer:
|
|
407
|
+
const h = e.xAxes.push(s.new(d, {
|
|
408
|
+
renderer: o.new(d, {
|
|
398
409
|
inversed: f === "rtl"
|
|
399
410
|
}),
|
|
400
|
-
categoryField:
|
|
411
|
+
categoryField: C
|
|
401
412
|
}));
|
|
402
|
-
|
|
413
|
+
h.get("renderer").labels.template.setAll({
|
|
403
414
|
forceHidden: !0
|
|
404
415
|
});
|
|
405
|
-
const
|
|
406
|
-
renderer:
|
|
407
|
-
min: this._getMinSeriesValue(
|
|
416
|
+
const g = e.yAxes.push(c.new(d, {
|
|
417
|
+
renderer: r.new(d, { inside: !1 }),
|
|
418
|
+
min: this._getMinSeriesValue(p.series)
|
|
408
419
|
}));
|
|
409
|
-
|
|
420
|
+
g.get("renderer").labels.template.setAll({
|
|
410
421
|
direction: f
|
|
411
422
|
});
|
|
412
|
-
const
|
|
413
|
-
getFillFromSprite: !
|
|
414
|
-
labelText:
|
|
423
|
+
const x = "{categoryX}", I = i[0]?.lineSettings?.stroke, v = a.new(d, {
|
|
424
|
+
getFillFromSprite: !I,
|
|
425
|
+
labelText: x
|
|
415
426
|
});
|
|
416
|
-
|
|
417
|
-
fill:
|
|
427
|
+
I && v.get("background")?.setAll({
|
|
428
|
+
fill: I
|
|
418
429
|
});
|
|
419
|
-
const
|
|
430
|
+
const M = e.series.push(m.new(d, {
|
|
420
431
|
name: u,
|
|
421
|
-
xAxis:
|
|
422
|
-
yAxis:
|
|
432
|
+
xAxis: h,
|
|
433
|
+
yAxis: g,
|
|
423
434
|
valueYField: w,
|
|
424
|
-
categoryXField:
|
|
425
|
-
tooltip:
|
|
435
|
+
categoryXField: C,
|
|
436
|
+
tooltip: v
|
|
426
437
|
}));
|
|
427
|
-
|
|
438
|
+
M.strokes.template.setAll({
|
|
428
439
|
templateField: "lineSettings"
|
|
429
|
-
}), this._customizeChartTooltip(
|
|
440
|
+
}), this._customizeChartTooltip(v, "vertical"), p.series.length > k && e.set("scrollbarX", n.new(d, {
|
|
430
441
|
orientation: "horizontal"
|
|
431
|
-
})),
|
|
442
|
+
})), h.data.setAll(i), M.data.setAll(i), M.appear(this._getChartSeriesAnimationMS()), e.appear(this._getChartAnimationMS());
|
|
432
443
|
}
|
|
433
444
|
async _createXYChart(e, t) {
|
|
434
|
-
const { XYChart: i, XYCursor: a } = await import("@amcharts/amcharts5/xy.js"), { root:
|
|
445
|
+
const { XYChart: i, XYCursor: a } = await import("@amcharts/amcharts5/xy.js"), { root: n, mediaInfo: s } = e, { type: o } = s, r = s?.altText || s?.title || "", c = n.container.children.push(i.new(n, {
|
|
435
446
|
role: "figure",
|
|
436
|
-
ariaLabel:
|
|
447
|
+
ariaLabel: r,
|
|
437
448
|
focusable: !0,
|
|
438
449
|
panX: !0,
|
|
439
450
|
panY: !0
|
|
440
451
|
}));
|
|
441
|
-
c.set("cursor", a.new(
|
|
452
|
+
c.set("cursor", a.new(n, {})), o === "column-chart" && await this._createColumnChart(c, e, t), o === "bar-chart" && await this._createBarChart(c, e, t), o === "line-chart" && await this._createLineChart(c, e, t), c.root.dom.classList.toggle("chart-rendered", !0);
|
|
442
453
|
}
|
|
443
454
|
_clearMediaRefreshTimer() {
|
|
444
455
|
const { _refreshTimer: e } = this;
|
|
@@ -459,24 +470,24 @@ class ue extends J {
|
|
|
459
470
|
_setRefreshTimeout(e) {
|
|
460
471
|
const { refreshInterval: t, value: i } = e, a = t * 6e4;
|
|
461
472
|
this._updateMediaInfoTimestamp(i.sourceURL);
|
|
462
|
-
const
|
|
473
|
+
const n = window.setInterval(() => {
|
|
463
474
|
this._updateMediaInfoTimestamp(i.sourceURL);
|
|
464
475
|
}, a);
|
|
465
|
-
this._refreshTimer =
|
|
476
|
+
this._refreshTimer = n;
|
|
466
477
|
}
|
|
467
478
|
_getImageSource(e, t) {
|
|
468
|
-
const i = e.includes("?") ? "&" : "?", [a,
|
|
469
|
-
return `${a}${i}timestamp=${t}${
|
|
479
|
+
const i = e.includes("?") ? "&" : "?", [a, n = ""] = e.split("#");
|
|
480
|
+
return `${a}${i}timestamp=${t}${n ? "#" : ""}${n}`;
|
|
470
481
|
}
|
|
471
482
|
_updateChartElement(e) {
|
|
472
483
|
this._chartRoot?.dispose(), this._chartRoot = void 0, e && this._createChart(e);
|
|
473
484
|
}
|
|
474
485
|
render() {
|
|
475
|
-
return
|
|
486
|
+
return _`<div class="root" @keyup=${this._handleMediaKeyup}><arcgis-feature-element-info .heading=${this.heading} .description=${this.description} .headingLevel=${this.headingLevel}></arcgis-feature-element-info>${this._renderMedia()}</div>`;
|
|
476
487
|
}
|
|
477
488
|
_renderMedia() {
|
|
478
489
|
const { formattedMediaInfoCount: e, activeMediaInfoIndex: t } = this, i = this._renderMediaText();
|
|
479
|
-
return e ?
|
|
490
|
+
return e ? _`<div class="container">${this._renderMediaInfo()}<div class="item-navigation">${i}${e > 1 ? _`<div class="pagination">${this._renderMediaPageButton("previous")}<span class="pagination-text">${Z(this.messages?.pageText ?? "", {
|
|
480
491
|
index: t + 1,
|
|
481
492
|
total: e
|
|
482
493
|
})}</span>${this._renderMediaPageButton("next")}</div>` : null}</div></div>` : null;
|
|
@@ -485,18 +496,18 @@ class ue extends J {
|
|
|
485
496
|
const { activeMediaInfo: e } = this;
|
|
486
497
|
if (!e)
|
|
487
498
|
return null;
|
|
488
|
-
const t = e?.title ?
|
|
489
|
-
return t || i ?
|
|
499
|
+
const t = e?.title ? _`<div class="item-title" .innerHTML=${N.sanitize(e.title) ?? ""}></div>` : null, i = e?.caption ? _`<div class="item-caption" .innerHTML=${N.sanitize(e.caption) ?? ""}></div>` : null;
|
|
500
|
+
return t || i ? _`<div class="item-text">${t}${i}</div>` : null;
|
|
490
501
|
}
|
|
491
502
|
_renderImageMediaInfo(e) {
|
|
492
503
|
if (!e.value)
|
|
493
504
|
return null;
|
|
494
|
-
const { _refreshIntervalInfo: t } = this, { value: i, refreshInterval: a, altText:
|
|
495
|
-
return (
|
|
505
|
+
const { _refreshIntervalInfo: t } = this, { value: i, refreshInterval: a, altText: n, title: s } = e, { sourceURL: o, linkURL: r } = i, m = se(r ?? void 0) ? "_blank" : "_self", d = m === "_blank" ? "noreferrer" : "", l = a ? t : null, p = l ? l.sourceURL : o, u = _`<img alt=${(n || s) ?? y} src=${p ?? void 0 ?? y}>`;
|
|
506
|
+
return (r ? _`<a href=${r ?? y} rel=${d ?? y} target=${m ?? y} title=${s ?? y}>${u}</a>` : null) ?? u;
|
|
496
507
|
}
|
|
497
508
|
_renderChartMediaInfo(e) {
|
|
498
509
|
const { activeMediaInfoIndex: t, formattedMediaInfoCount: i } = this;
|
|
499
|
-
return
|
|
510
|
+
return G(`media-${e.type}-${t}-${i}`, _`<div class="chart" ${j(this._updateChartElement)}></div>`);
|
|
500
511
|
}
|
|
501
512
|
_renderMediaInfoType() {
|
|
502
513
|
const { activeMediaInfo: e } = this;
|
|
@@ -504,16 +515,16 @@ class ue extends J {
|
|
|
504
515
|
}
|
|
505
516
|
_renderMediaInfo() {
|
|
506
517
|
const { activeMediaInfo: e } = this;
|
|
507
|
-
return e ?
|
|
518
|
+
return e ? _`<div class="item-container"><div class="item">${this._renderMediaInfoType()}</div></div>` : null;
|
|
508
519
|
}
|
|
509
520
|
_renderMediaPageButton(e) {
|
|
510
521
|
if (this.formattedMediaInfoCount < 2)
|
|
511
522
|
return null;
|
|
512
|
-
const t = e === "previous", i = t ? this.messages?.previous ?? "" : this.messages?.next ?? "", a = t ? "chevron-left" : "chevron-right",
|
|
513
|
-
return
|
|
523
|
+
const t = e === "previous", i = t ? this.messages?.previous ?? "" : this.messages?.next ?? "", a = t ? "chevron-left" : "chevron-right", n = t ? this.previous : this.next;
|
|
524
|
+
return _`<button .ariaLabel=${i} class="pagination-button" @click=${n} tabindex=0 title=${i ?? y} type=button><calcite-icon flip-rtl class="pagination-icon" .icon=${a} scale=s></calcite-icon></button>`;
|
|
514
525
|
}
|
|
515
526
|
async _renderChart(e) {
|
|
516
|
-
const { root: t, mediaInfo: i } = e, { value: a, type:
|
|
527
|
+
const { root: t, mediaInfo: i } = e, { value: a, type: n } = i, [{ default: s }, { default: o }, { default: r }, { esriChartColorSet: c }, { ColorSet: m, Theme: d }] = await Promise.all([
|
|
517
528
|
import("@amcharts/amcharts5/themes/Animated.js"),
|
|
518
529
|
import("@amcharts/amcharts5/themes/Dark.js"),
|
|
519
530
|
import("@amcharts/amcharts5/themes/Responsive.js"),
|
|
@@ -521,28 +532,28 @@ class ue extends J {
|
|
|
521
532
|
import("@amcharts/amcharts5/index.js")
|
|
522
533
|
]), l = d.new(t);
|
|
523
534
|
l.rule("ColorSet").set("colors", c), l.rule("ColorSet").set("reuse", !0);
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
const u = await this._getRendererColors(), f = await this._getSeriesColors(a.series),
|
|
535
|
+
const p = [r.new(t), l];
|
|
536
|
+
ie(this.el) === "dark" && p.push(o.new(t)), this._canAnimateChart() && p.push(s.new(t)), t.setThemes(p);
|
|
537
|
+
const u = await this._getRendererColors(), f = await this._getSeriesColors(a.series), h = m.new(t, {}), g = f.get(a.series[0]), x = g ? {
|
|
527
538
|
lineSettings: {
|
|
528
|
-
stroke:
|
|
539
|
+
stroke: g
|
|
529
540
|
}
|
|
530
|
-
} : void 0,
|
|
531
|
-
const b = f.get(
|
|
541
|
+
} : void 0, I = a.series.map((v, M) => {
|
|
542
|
+
const b = f.get(v) || u.get(v.fieldName) || h.getIndex(M);
|
|
532
543
|
return {
|
|
533
|
-
[
|
|
534
|
-
[w]:
|
|
544
|
+
[C]: v.tooltip,
|
|
545
|
+
[w]: v.value,
|
|
535
546
|
columnSettings: {
|
|
536
547
|
fill: b,
|
|
537
548
|
stroke: b
|
|
538
549
|
},
|
|
539
|
-
...
|
|
550
|
+
...x
|
|
540
551
|
};
|
|
541
|
-
}).filter((
|
|
542
|
-
|
|
552
|
+
}).filter((v) => n === "pie-chart" ? v.value != null && v.value > 0 : !0);
|
|
553
|
+
n === "pie-chart" ? this._createPieChart(e, I) : this._createXYChart(e, I);
|
|
543
554
|
}
|
|
544
555
|
}
|
|
545
|
-
|
|
556
|
+
B("arcgis-feature-media", he);
|
|
546
557
|
export {
|
|
547
|
-
|
|
558
|
+
he as ArcgisFeatureMedia
|
|
548
559
|
};
|