@arcgis/common-components 5.2.0-next.22 → 5.2.0-next.24

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.
@@ -1,71 +1,72 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as W } from "../../chunks/runtime.js";
3
- import { css as Q, html as c } from "lit";
2
+ import { c as Q } from "../../chunks/runtime.js";
3
+ import { css as H, html as c } from "lit";
4
4
  import { keyed as b } from "lit/directives/keyed.js";
5
5
  import { ref as O } from "lit/directives/ref.js";
6
- import { LitElement as H, createEvent as D, safeClassMap as V } from "@arcgis/lumina";
7
- import { Task as J } from "@lit/task";
6
+ import { LitElement as J, createEvent as D, safeClassMap as V } from "@arcgis/lumina";
7
+ import { Task as j } from "@lit/task";
8
8
  import { log as q, composeMissingPropertyMessage as L } from "@arcgis/toolkit/log";
9
- import j from "@arcgis/core/config.js";
9
+ import z from "@arcgis/core/config.js";
10
10
  import * as x from "@arcgis/core/core/reactiveUtils.js";
11
11
  import * as h from "@arcgis/core/intl.js";
12
- import * as A from "@arcgis/core/applications/PortalApp/layerUtils.js";
12
+ import * as Z from "@arcgis/core/applications/PortalApp/layerUtils.js";
13
13
  import * as I from "@arcgis/core/core/lang.js";
14
- import z from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
15
- import B from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
14
+ import B from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
15
+ import K from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
16
16
  import { i as f } from "../../chunks/commonFunctions.js";
17
- import { i as y, a as w, b as S, c as Z, d as T, e as P, f as v, g as F, h as M, j as K, k as X, l as Y, m as _, n as ee, o as G, p as te, q as k, r as E } from "../../chunks/layer-utils.js";
18
- import ie from "@arcgis/core/rest/support/Query.js";
19
- import { u as se } from "../../chunks/useT9n.js";
20
- function ae(r) {
17
+ import k from "@arcgis/core/layers/support/CodedValue.js";
18
+ import { i as y, a as w, b as S, c as P, d as T, e as M, f as v, g as F, h as G, j as X, k as Y, l as ee, m as te, n as _, o as ie, p as U, q as se, r as E, s as R } from "../../chunks/layer-utils.js";
19
+ import ae from "@arcgis/core/rest/support/Query.js";
20
+ import { u as re } from "../../chunks/useT9n.js";
21
+ function ne(r) {
21
22
  return r.associatedLayer?.url;
22
23
  }
23
- const re = {
24
+ const oe = {
24
25
  dateStyle: "short",
25
26
  timeStyle: "short"
26
- }, ne = {
27
+ }, le = {
27
28
  timeStyle: "medium"
28
29
  };
29
- function oe(r) {
30
+ function ue(r) {
30
31
  const { layer: e, fieldName: t } = r;
31
32
  let i;
32
- const n = A.supportsFieldConfiguration(e);
33
+ const n = Z.supportsFieldConfiguration(e);
33
34
  let s;
34
35
  "popupTemplate" in e && (s = e.popupTemplate);
35
36
  const a = s ? s.fieldInfos : [];
36
- return U(r)?.filter((u) => u.name === t).forEach((u) => {
37
- const o = !n && a ? a.filter((g) => g.fieldName === u.name) : void 0, l = n ? e.getFieldAlias(t) : o?.length ? o[0].label : u.alias;
38
- /^raster.(item|service)pixelvalue/iu.test(t) && (u.type = "double");
39
- const d = {
40
- layerField: u,
41
- label: l || u.name
37
+ return W(r)?.filter((d) => d.name === t).forEach((d) => {
38
+ const o = !n && a ? a.filter((g) => g.fieldName === d.name) : void 0, l = n ? e.getFieldAlias(t) : o?.length ? o[0].label : d.alias;
39
+ /^raster.(item|service)pixelvalue/iu.test(t) && (d.type = "double");
40
+ const u = {
41
+ layerField: d,
42
+ label: l || d.name
42
43
  };
43
- d.codedValues = ce(t, r), de(d), d.simpleFieldType && (i = d);
44
+ u.codedValues = fe(t, r), me(u), u.simpleFieldType && (i = u);
44
45
  }), i;
45
46
  }
46
- function U(r) {
47
+ function W(r) {
47
48
  const { layer: e } = r;
48
49
  return y(e) || w(e) || T(e) && e.rasterFields.length ? e.rasterFields : e.fields;
49
50
  }
50
- async function R(r) {
51
+ async function A(r) {
51
52
  r.statisticsStatus = "in-progress";
52
53
  const { layer: e, view: t } = r;
53
54
  if (y(e) || w(e) || F(e) || S(e))
54
55
  throw new Error("could not get feature count");
55
56
  try {
56
- return await fe(e, t);
57
+ return await ge(e, t);
57
58
  } catch {
58
59
  return;
59
60
  }
60
61
  }
61
- async function le(r) {
62
+ async function de(r) {
62
63
  const { layer: e, view: t, fieldName: i, fieldInfo: n } = r;
63
64
  if (y(e) || w(e) || S(e))
64
65
  throw new Error("could not get statistics for ImageryTileLayer/WCSLayer/VoxelLayer");
65
66
  if (!n || n.layerField.type === "oid" || n.layerField.type === "guid" || n.layerField.type === "global-id")
66
- return { totalCount: await R(r), nullcount: 0 };
67
+ return { totalCount: await A(r), nullcount: 0 };
67
68
  try {
68
- const s = await z({
69
+ const s = await B({
69
70
  layer: e,
70
71
  view: t,
71
72
  field: i,
@@ -77,20 +78,20 @@ async function le(r) {
77
78
  if (f(s.nullcount) && !a)
78
79
  return { ...s, totalCount: s.count + s.nullcount };
79
80
  {
80
- const m = await R(r);
81
+ const m = await A(r);
81
82
  return { ...s, totalCount: m };
82
83
  }
83
84
  } catch {
84
85
  throw new Error("could not get statistics");
85
86
  }
86
87
  }
87
- async function ue(r) {
88
+ async function ce(r) {
88
89
  const { layer: e, view: t, fieldName: i } = r;
89
90
  if (y(e) || w(e) || S(e))
90
91
  throw new Error("could not get unique values for ImageryLayer/ImageryTileLayer/WCSLayer/VoxelLayer");
91
- Z(e) && (e.outFields = ["*"]);
92
+ P(e) && (e.outFields = ["*"]);
92
93
  try {
93
- return await B({
94
+ return await K({
94
95
  layer: e,
95
96
  view: t,
96
97
  field: i
@@ -99,7 +100,7 @@ async function ue(r) {
99
100
  throw new Error("could not get unique values");
100
101
  }
101
102
  }
102
- function de(r) {
103
+ function me(r) {
103
104
  switch (r.layerField.type) {
104
105
  case "string":
105
106
  r.simpleFieldType = "string";
@@ -131,50 +132,52 @@ function de(r) {
131
132
  case "long":
132
133
  r.simpleFieldType = "number";
133
134
  break;
135
+ default:
136
+ r.simpleFieldType = "string";
134
137
  }
135
138
  }
136
- function ce(r, e) {
139
+ function fe(r, e) {
137
140
  const { layer: t } = e;
138
- if (P(t) && t.subtypeField === r) {
141
+ if (M(t) && t.subtypeField === r) {
139
142
  const o = t.parent?.subtypes?.find((l) => l.code === t.subtypeCode);
140
143
  if (o)
141
- return [{ code: o.code, name: o.name }];
144
+ return [new k({ code: o.code, name: o.name })];
142
145
  }
143
146
  if (!v(t) && !T(t))
144
147
  return;
145
148
  const i = v(t) ? t.typeIdField : void 0, n = v(t) ? t.types : void 0;
146
149
  let s;
147
- const m = U(e)?.find((o) => o.name === r), u = m?.domain;
150
+ const m = W(e)?.find((o) => o.name === r), d = m?.domain;
148
151
  return v(t) && i && n ? (i === r ? s = n.map(
149
152
  (o) => (
150
153
  // fake coded values
151
- {
154
+ new k({
152
155
  code: o.id,
153
156
  name: o.name
154
- }
157
+ })
155
158
  )
156
159
  ) : (s = [], n.forEach((o) => {
157
160
  if (!o.domains[r] || o.domains[r].type === "inherited") {
158
- const l = u;
159
- l?.codedValues && l.codedValues.forEach((d) => {
161
+ const l = d;
162
+ l?.codedValues && l.codedValues.forEach((u) => {
160
163
  let g = !1;
161
164
  s.forEach((p) => {
162
- p.code === d.code && (g = !0, `, ${p.name},`.includes(`, ${d.name},`) || (p.name += `, ${d.name}`));
163
- }), g || s.push(I.clone(d));
165
+ p.code === u.code && (g = !0, `, ${p.name},`.includes(`, ${u.name},`) || (p.name += `, ${u.name}`));
166
+ }), g || s.push(I.clone(u));
164
167
  });
165
168
  } else o.domains[r].codedValues && o.domains[r].codedValues.forEach((l) => {
166
- let d = !1;
169
+ let u = !1;
167
170
  s.forEach((g) => {
168
- g.code === l.code && (d = !0, `, ${g.name},`.includes(`, ${l.name},`) || (g.name += `, ${l.name}`));
169
- }), d || s.push(I.clone(l));
171
+ g.code === l.code && (u = !0, `, ${g.name},`.includes(`, ${l.name},`) || (g.name += `, ${l.name}`));
172
+ }), u || s.push(I.clone(l));
170
173
  });
171
- })), !s.length && u?.codedValues && (s = I.clone(u.codedValues))) : u?.codedValues && (s = m.domain.codedValues), s?.length ? s : void 0;
174
+ })), !s.length && d?.codedValues && (s = I.clone(d.codedValues))) : d?.codedValues && (s = m?.domain?.codedValues), s?.length ? s : void 0;
172
175
  }
173
- async function me(r) {
176
+ async function pe(r) {
174
177
  const { view: e, layer: t } = r;
175
178
  if (T(t) || y(t) || w(t))
176
179
  throw new Error("could not get feature");
177
- if (v(t) && !t.url || M(t)) {
180
+ if (v(t) && !t.url || G(t)) {
178
181
  const i = t.createQuery();
179
182
  i.start = 0, i.num = 5, i.outFields = ["*"];
180
183
  const n = await t.queryFeatures(i);
@@ -185,14 +188,15 @@ async function me(r) {
185
188
  if (!e)
186
189
  return await C(r);
187
190
  let i;
188
- if (P(t) || K(t)) {
191
+ if (M(t) || X(t)) {
189
192
  let s = t.parent;
190
- for (; X(s) || Y(s); )
193
+ for (; Y(s) || ee(s); )
191
194
  s = s.parent;
192
- i = await e.whenLayerView(s);
195
+ te(s) && (i = await e.whenLayerView(s));
193
196
  } else
194
197
  i = await e.whenLayerView(t);
195
- if (i.availableFields.length === t.fields.length || (F(t) || _(t)) && i.availableFields.length > 0) {
198
+ const n = i.availableFields.length === t.fields.length;
199
+ if (i && (n || (F(t) || _(t)) && i.availableFields.length > 0)) {
196
200
  const s = i.createQuery();
197
201
  s.start = 0, s.num = 5, s.outFields = ["*"];
198
202
  const a = await i.queryFeatures(s);
@@ -205,22 +209,22 @@ async function C(r) {
205
209
  const { layer: e } = r;
206
210
  if (T(e) || y(e) || F(e) || _(e))
207
211
  throw new Error("cannot get feature from service");
208
- const t = new ie({
212
+ const t = new ae({
209
213
  where: "1=1",
210
214
  outFields: ["*"],
211
215
  returnGeometry: !1
212
216
  });
213
217
  return "sourceJSON" in e && e.sourceJSON?.advancedQueryCapabilities?.supportsPagination && (t.num = 1), await e.queryFeatures(t);
214
218
  }
215
- async function fe(r, e) {
216
- if (Z(r))
217
- return await pe(r);
218
- if (v(r) || ee(r) || G(r) || M(r) || te(r))
219
+ async function ge(r, e) {
220
+ if (P(r))
221
+ return await he(r);
222
+ if (v(r) || ie(r) || U(r) || G(r) || se(r))
219
223
  return await r.queryFeatureCount();
220
224
  if (e && (F(r) || _(r)))
221
- return await ge(r, e);
225
+ return await ve(r, e);
222
226
  }
223
- async function pe(r) {
227
+ async function he(r) {
224
228
  const e = r.createQuery();
225
229
  e.outFields = ["*"];
226
230
  const t = await r.queryFeatures(e);
@@ -228,13 +232,13 @@ async function pe(r) {
228
232
  return t.features.length;
229
233
  throw new Error("could not get feature count");
230
234
  }
231
- async function ge(r, e) {
235
+ async function ve(r, e) {
232
236
  return await (await e.whenLayerView(r)).queryFeatureCount();
233
237
  }
234
- const he = Q`:host{height:100%}.container{padding:var(--calcite-space-xs);background-color:var(--calcite-color-foreground-1)}.title{font-weight:700;padding:5px 0}.missing,.data{color:#a9a9a9}.count{white-space:nowrap}.section{padding:var(--calcite-space-xs) 0}.statistics-row{border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);padding:var(--calcite-space-xs) 0;display:flex;justify-content:space-between}.statistics-row-top-values{border-top:var(--calcite-border-width-sm) solid var(--calctie-color-border-2);padding:20px 0 var(--calcite-space-xs) 0;display:flex;justify-content:space-between}`;
235
- class ve extends H {
238
+ const ye = H`:host{height:100%}.container{padding:var(--calcite-space-xs);background-color:var(--calcite-color-foreground-1)}.title{font-weight:700;padding:5px 0}.missing,.data{color:#a9a9a9}.count{white-space:nowrap}.section{padding:var(--calcite-space-xs) 0}.statistics-row{border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);padding:var(--calcite-space-xs) 0;display:flex;justify-content:space-between}.statistics-row-top-values{border-top:var(--calcite-border-width-sm) solid var(--calctie-color-border-2);padding:20px 0 var(--calcite-space-xs) 0;display:flex;justify-content:space-between}`;
239
+ class Fe extends J {
236
240
  constructor() {
237
- super(...arguments), this._messages = se({ blocking: !0 }), this._propWatcherTask = new J(this, {
241
+ super(...arguments), this._messages = re({ blocking: !0 }), this._propWatcherTask = new j(this, {
238
242
  task: async ([e, t]) => {
239
243
  const i = f(e) && f(t);
240
244
  if (f(e) || q("error", this, L("layer")), f(t) || q("error", this, L("fieldName")), !i)
@@ -248,7 +252,7 @@ class ve extends H {
248
252
  this.properties = { oneFeatureResponseStatus: 16, oneFeatureResponse: 16, statisticsStatus: 16, statistics: 16, uniqueValuesStatus: 16, uniqueValues: 16, view: 0, layer: 0, fieldName: 1, hideAlias: 5, hideNumericFormat: 5, hideStatistics: 5 };
249
253
  }
250
254
  static {
251
- this.styles = he;
255
+ this.styles = ye;
252
256
  }
253
257
  async refresh() {
254
258
  await this.processProps(), this.requestUpdate();
@@ -270,19 +274,19 @@ class ve extends H {
270
274
  layer: s ?? t,
271
275
  fieldName: i,
272
276
  hideStatistics: n
273
- }, this.props.fieldInfo = oe(this.props), G(t) && j.request.interceptors?.push({
274
- urls: `${ae(t)}/${t.layerId}`,
277
+ }, this.props.fieldInfo = ue(this.props), U(t) && z.request.interceptors?.push({
278
+ urls: `${ne(t)}/${t.layerId}`,
275
279
  before(a) {
276
280
  a.requestOptions.authMode = "no-prompt";
277
281
  }
278
282
  }), this.oneFeatureResponseStatus = "in-progress";
279
283
  try {
280
- const a = await me(this.props);
284
+ const a = await pe(this.props);
281
285
  this.oneFeatureResponse = a, this.oneFeatureResponseStatus = "success";
282
286
  } catch {
283
287
  this.oneFeatureResponseStatus = "failed";
284
288
  }
285
- if (F(t) || k(t) || E(t)) {
289
+ if (F(t) || E(t) || R(t)) {
286
290
  this.uniqueValuesStatus = "failed", this.statisticsStatus = "failed";
287
291
  return;
288
292
  }
@@ -291,7 +295,7 @@ class ve extends H {
291
295
  else {
292
296
  this.uniqueValuesStatus = "in-progress";
293
297
  try {
294
- const a = await ue(this.props);
298
+ const a = await ce(this.props);
295
299
  this.uniqueValues = a, a?.uniqueValueInfos?.length ? this.uniqueValuesStatus = "success" : this.uniqueValuesStatus = "failed";
296
300
  } catch {
297
301
  this.uniqueValuesStatus = "failed";
@@ -302,11 +306,11 @@ class ve extends H {
302
306
  else {
303
307
  this.statisticsStatus = "in-progress";
304
308
  try {
305
- const a = await le(this.props);
309
+ const a = await de(this.props);
306
310
  if (!f(a.totalCount) && f(a.count) && this.uniqueValuesStatus === "success") {
307
311
  const m = this.uniqueValues?.uniqueValueInfos ?? [];
308
- for (let u = 0; u < m.length; u++) {
309
- const o = m[u];
312
+ for (let d = 0; d < m.length; d++) {
313
+ const o = m[d];
310
314
  if (o.value === null) {
311
315
  a.totalCount = o.count + a.count;
312
316
  break;
@@ -518,7 +522,7 @@ class ve extends H {
518
522
  getIntlDateTimeFormattingOptions(e, t) {
519
523
  const i = this.getCurrentFieldFormat();
520
524
  if (!t?.useFieldFormatting)
521
- return i ? t?.isTimeOnly ? ne : re : h.convertDateFormatToIntlOptions(e);
525
+ return i ? t?.isTimeOnly ? le : oe : h.convertDateFormatToIntlOptions(e);
522
526
  const n = i ? {
523
527
  dateStyle: t?.isTimeOnly ? void 0 : i.dateStyle ?? void 0,
524
528
  // year/month is overridden if dateStyle is set
@@ -534,7 +538,7 @@ class ve extends H {
534
538
  }
535
539
  originalLayerSupportsFieldConfigs() {
536
540
  const { layer: e } = this;
537
- return A.supportsFieldConfiguration(e);
541
+ return Z.supportsFieldConfiguration(e);
538
542
  }
539
543
  getPopupTemplateFieldInfo() {
540
544
  const { props: e } = this, { layer: t, fieldName: i } = e;
@@ -574,14 +578,14 @@ class ve extends H {
574
578
  return c`<div class="section"><div class="title">${e.fieldValueType}</div><div class=${V(s ? "" : "missing")}>${s ? e.fieldValueTypes[s] : e.fieldValueTypeNotSet}</div></div>`;
575
579
  }
576
580
  renderFieldSampleValue() {
577
- const { oneFeatureResponse: e, oneFeatureResponseStatus: t, statisticsStatus: i, statistics: n, uniqueValuesStatus: s, uniqueValues: a, _messages: m, props: u } = this, { layer: o, fieldName: l, fieldInfo: d } = u, { statistics: g } = m;
581
+ const { oneFeatureResponse: e, oneFeatureResponseStatus: t, statisticsStatus: i, statistics: n, uniqueValuesStatus: s, uniqueValues: a, _messages: m, props: d } = this, { layer: o, fieldName: l, fieldInfo: u } = d, { statistics: g } = m;
578
582
  let p;
579
- if (y(o) || S(o) || !F(o) && ["string", "oid", "guid"].includes(this._getStatisticsType(d)) && s !== "failed")
583
+ if (y(o) || S(o) || !F(o) && ["string", "oid", "guid"].includes(this._getStatisticsType(u)) && s !== "failed")
580
584
  return "";
581
585
  t === "success" ? e.features.forEach(($) => {
582
586
  (p === void 0 || p === null && $.attributes[l] !== null) && (p = $.attributes[l]);
583
587
  }) : i === "success" ? p = n?.min ?? void 0 : s === "success" && (p = a?.uniqueValueInfos?.[0]?.value ?? a?.uniqueValueInfos?.[1]?.value ?? void 0);
584
- const N = d.codedValues;
588
+ const N = u.codedValues;
585
589
  return f(p) && (N ? p = N.find(($) => p === $.code)?.name || p : p = this._getDisplayString(p, { useFieldFormatting: !0 })), c`<div class="section"><div class="title">${m.fieldSampleValue}</div><div class=${V(t === "failed" && i === "failed" && s === "failed" || !f(p) ? "missing" : "")}>${t === "success" || i === "success" || s === "success" ? p?.toString() ?? g.allNulls : t === "failed" && i === "failed" && s === "failed" ? m.fieldSampleNotAvailable : m.fieldSampleRetrieving}</div></div>`;
586
590
  }
587
591
  renderFieldNumericFormat() {
@@ -593,14 +597,14 @@ class ve extends H {
593
597
  const { minimumFractionDigits: o, maximumFractionDigits: l } = m.fieldFormat;
594
598
  return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldMinimumFractionDigits.replace("${number}", o.toString())}</div><div>${e.fieldMaximumFractionDigits.replace("${number}", l.toString())}</div></div>`;
595
599
  }
596
- const u = "popupTemplate" in a ? a.popupTemplate : void 0;
597
- if (u?.fieldInfos) {
598
- const o = u.fieldInfos?.filter((l) => l.fieldName === n);
600
+ const d = "popupTemplate" in a ? a.popupTemplate : void 0;
601
+ if (d?.fieldInfos) {
602
+ const o = d.fieldInfos?.filter((l) => l.fieldName === n);
599
603
  if (o?.length) {
600
604
  const l = o[0];
601
605
  if (f(l?.format?.places)) {
602
- const d = l.format.places;
603
- return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldNumDecimalPlaces.replace("${number}", d.toString())}</div></div>`;
606
+ const u = l.format.places;
607
+ return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldNumDecimalPlaces.replace("${number}", u.toString())}</div></div>`;
604
608
  }
605
609
  }
606
610
  }
@@ -608,7 +612,7 @@ class ve extends H {
608
612
  }
609
613
  renderFieldStatistics() {
610
614
  const { statisticsStatus: e, uniqueValuesStatus: t, hideStatistics: i, _messages: n, props: s } = this, { layer: a, fieldInfo: m } = s;
611
- return i ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : k(a) || E(a) || F(a) || y(a) || S(a) || ["long"].includes(m.layerField.type) ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : c`<div class="section"><div class="title">${n.fieldStatistics}</div>${!e || e === "missing" || e === "in-progress" ? b("field-info-statistics-content", c`<div class="missing">${n.fieldStatisticsRetrieving}</div>`) : e === "failed" && t !== "success" ? this.renderNoStatistics() : b("field-info-statistics-content", c`<div ${O(this._setCompleteRef)}>${this.renderStatistics()}</div>`)}</div>`;
615
+ return i ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : E(a) || R(a) || F(a) || y(a) || S(a) || ["long"].includes(m.layerField.type) ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : c`<div class="section"><div class="title">${n.fieldStatistics}</div>${!e || e === "missing" || e === "in-progress" ? b("field-info-statistics-content", c`<div class="missing">${n.fieldStatisticsRetrieving}</div>`) : e === "failed" && t !== "success" ? this.renderNoStatistics() : b("field-info-statistics-content", c`<div ${O(this._setCompleteRef)}>${this.renderStatistics()}</div>`)}</div>`;
612
616
  }
613
617
  renderNoStatistics() {
614
618
  const { _messages: e } = this;
@@ -647,24 +651,24 @@ class ve extends H {
647
651
  const { statistics: e, view: t, props: i, _messages: n } = this, { fieldInfo: s } = i;
648
652
  if (!e || !f(e.max) || !f(e.min))
649
653
  return this.renderNoStatistics();
650
- const { statistics: a } = n, m = e.max - e.min, u = Math.floor(m / 31536e6);
651
- let o = Math.floor((m - u * 31536e6) / 2628e6), l = Math.ceil((m - o * 2628e6) / 864e5);
654
+ const { statistics: a } = n, m = e.max - e.min, d = Math.floor(m / 31536e6);
655
+ let o = Math.floor((m - d * 31536e6) / 2628e6), l = Math.ceil((m - o * 2628e6) / 864e5);
652
656
  l >= 30 && (o += 1, l = 0);
653
- let d = u === 1 ? a.timeSpanOptions.year : u > 1 ? a.timeSpanOptions.years.replace("${years}", u.toString()) : "";
654
- d += u > 0 && (o > 0 || l > 0) ? ", " : "", d += o === 1 ? a.timeSpanOptions.month : o > 1 ? a.timeSpanOptions.months.replace("${months}", o.toString()) : "", d += o > 0 && l > 0 ? ", " : "", d += l === 1 ? a.timeSpanOptions.day : l > 1 ? a.timeSpanOptions.days.replace("${days}", l.toString()) : "";
657
+ let u = d === 1 ? a.timeSpanOptions.year : d > 1 ? a.timeSpanOptions.years.replace("${years}", d.toString()) : "";
658
+ u += d > 0 && (o > 0 || l > 0) ? ", " : "", u += o === 1 ? a.timeSpanOptions.month : o > 1 ? a.timeSpanOptions.months.replace("${months}", o.toString()) : "", u += o > 0 && l > 0 ? ", " : "", u += l === 1 ? a.timeSpanOptions.day : l > 1 ? a.timeSpanOptions.days.replace("${days}", l.toString()) : "";
655
659
  const g = s.simpleFieldType !== "timestamp-offset" || !t || t.timeZone !== "unknown", p = s.simpleFieldType === "time-only";
656
- return c`<div><div class="statistics-row"><div>${a.numberOfValues}</div><div class="data">${this._printNumValue(e?.totalCount)}</div></div>${g && f(e.min) ? c`<div class="statistics-row"><div>${p ? a.minimumTime : a.minimumDate}</div><div class="data">${this._getDisplayString(e.min)}</div></div>` : null}${g && f(e.max) ? c`<div class="statistics-row"><div>${p ? a.maximumTime : a.maximumDate}</div><div class="data">${this._getDisplayString(e.max)}</div></div>` : null}${g && f(e.avg) ? c`<div class="statistics-row"><div>${p ? a.averageTime : a.averageDate}</div><div class="data">${this._getDisplayString(e.avg)}</div></div>` : null}${g && !p && f(e.min) && f(e.max) && m > 0 ? c`<div class="statistics-row"><div>${a.timespan}</div><div class="data">${d}</div></div>` : null}${this.renderNullValues()}</div>`;
660
+ return c`<div><div class="statistics-row"><div>${a.numberOfValues}</div><div class="data">${this._printNumValue(e?.totalCount)}</div></div>${g && f(e.min) ? c`<div class="statistics-row"><div>${p ? a.minimumTime : a.minimumDate}</div><div class="data">${this._getDisplayString(e.min)}</div></div>` : null}${g && f(e.max) ? c`<div class="statistics-row"><div>${p ? a.maximumTime : a.maximumDate}</div><div class="data">${this._getDisplayString(e.max)}</div></div>` : null}${g && f(e.avg) ? c`<div class="statistics-row"><div>${p ? a.averageTime : a.averageDate}</div><div class="data">${this._getDisplayString(e.avg)}</div></div>` : null}${g && !p && f(e.min) && f(e.max) && m > 0 ? c`<div class="statistics-row"><div>${a.timespan}</div><div class="data">${u}</div></div>` : null}${this.renderNullValues()}</div>`;
657
661
  }
658
662
  renderTopValues() {
659
663
  const { uniqueValues: e, uniqueValuesStatus: t, _messages: i, props: n } = this, { fieldInfo: s } = n, { statistics: a } = i;
660
664
  if (e?.uniqueValueInfos?.length) {
661
665
  const m = e.uniqueValueInfos;
662
- m.sort((l, d) => l.count < d.count ? 1 : l.count > d.count ? -1 : 0);
663
- const u = s.codedValues, o = m.filter((l) => l.value !== null).filter((l, d) => l && d < 10).map((l) => {
664
- let d = l.value;
665
- return u ? u.forEach((g) => {
666
- d === g.code && (d = g.name);
667
- }) : d = this._getDisplayString(d), c`<div class="statistics-row"><div class="data">${`${d}`}</div><div class="count">${this._printNumValue(l.count)}</div></div>`;
666
+ m.sort((l, u) => l.count < u.count ? 1 : l.count > u.count ? -1 : 0);
667
+ const d = s.codedValues, o = m.filter((l) => l.value !== null).filter((l, u) => l && u < 10).map((l) => {
668
+ let u = l.value;
669
+ return d ? d.forEach((g) => {
670
+ u === g.code && (u = g.name);
671
+ }) : u = this._getDisplayString(u), c`<div class="statistics-row"><div class="data">${`${u}`}</div><div class="count">${this._printNumValue(l.count)}</div></div>`;
668
672
  });
669
673
  return o.length ? c`<div><div class="statistics-row-top-values"><div>${m.length > 10 ? a.topTenValues : a.topValues}</div><div>${a.count}</div></div>${o}</div>` : "";
670
674
  } else
@@ -676,9 +680,9 @@ class ve extends H {
676
680
  if (!f(s) && t) {
677
681
  const a = t.uniqueValueInfos;
678
682
  for (let m = 0; m < a.length; m++) {
679
- const u = a[m];
680
- if (u.value === null) {
681
- s = u.count;
683
+ const d = a[m];
684
+ if (d.value === null) {
685
+ s = d.count;
682
686
  break;
683
687
  }
684
688
  }
@@ -686,7 +690,7 @@ class ve extends H {
686
690
  return c`<div class="statistics-row"><div>${n.numberOfNulls}</div>${f(s) ? c`<div class="data">${this._printNumValue(s)}</div>` : c`<div class="missing">--</div>`}</div>`;
687
691
  }
688
692
  }
689
- W("arcgis-field-info", ve);
693
+ Q("arcgis-field-info", Fe);
690
694
  export {
691
- ve as ArcgisFieldInfo
695
+ Fe as ArcgisFieldInfo
692
696
  };
@@ -6,10 +6,10 @@ import { LitElement as K, createEvent as I } from "@arcgis/lumina";
6
6
  import { Task as Q } from "@lit/task";
7
7
  import { createRef as X, ref as L } from "lit/directives/ref.js";
8
8
  import { log as D, composeMissingPropertyMessage as N } from "@arcgis/toolkit/log";
9
- import { formatDate as F, convertDateFormatToIntlOptions as b, formatDateOnly as Y, formatTimeOnly as ee, formatTimestamp as U, formatNumber as te } from "@arcgis/core/intl.js";
9
+ import { formatDate as F, convertDateFormatToIntlOptions as $, formatDateOnly as Y, formatTimeOnly as ee, formatTimestamp as U, formatNumber as te } from "@arcgis/core/intl.js";
10
10
  import ie from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
11
11
  import { clone as O } from "@arcgis/core/core/lang.js";
12
- import { g as T, i as h } from "../../chunks/commonFunctions.js";
12
+ import { g as E, i as h } from "../../chunks/commonFunctions.js";
13
13
  import { f as S, e as z, k as B, d as Z } from "../../chunks/layer-utils.js";
14
14
  import { u as se } from "../../chunks/useT9n.js";
15
15
  function k(i) {
@@ -21,38 +21,38 @@ function R(i) {
21
21
  function ne(i, e, s) {
22
22
  let t;
23
23
  return e === "unknown" ? t = F(i, {
24
- ...b("short-date-short-time"),
24
+ ...$("short-date-short-time"),
25
25
  timeZone: "utc",
26
26
  timeZoneName: "shortOffset"
27
27
  }) : t = F(i, {
28
- ...b("short-date-short-time"),
28
+ ...$("short-date-short-time"),
29
29
  timeZone: e
30
30
  }), t;
31
31
  }
32
32
  function oe(i) {
33
- return i ? Y(i, b("short-date")) : "";
33
+ return i ? Y(i, $("short-date")) : "";
34
34
  }
35
35
  function ae(i) {
36
36
  let e;
37
- return typeof i == "string" ? e = ee(i, b("short-date-long-time")) : e = F(i, {
38
- ...b("long-time"),
37
+ return typeof i == "string" ? e = ee(i, $("short-date-long-time")) : e = F(i, {
38
+ ...$("long-time"),
39
39
  timeZone: "utc"
40
40
  }), e;
41
41
  }
42
42
  function le(i, e) {
43
43
  return typeof i == "string" ? e && "timeZone" in e && e.timeZone === "unknown" ? U(i, {
44
- ...b("short-date-short-time"),
44
+ ...$("short-date-short-time"),
45
45
  timeZone: "utc",
46
46
  timeZoneName: "shortOffset"
47
47
  }) : U(i, {
48
- ...b("short-date-short-time"),
48
+ ...$("short-date-short-time"),
49
49
  timeZone: e && "timeZone" in e && e.timeZone ? e.timeZone : "system"
50
50
  }) : e && "timeZone" in e && e.timeZone === "unknown" ? F(i, {
51
- ...b("short-date-short-time"),
51
+ ...$("short-date-short-time"),
52
52
  timeZone: "utc",
53
53
  timeZoneName: "shortOffset"
54
54
  }) : F(i, {
55
- ...b("short-date-short-time"),
55
+ ...$("short-date-short-time"),
56
56
  timeZone: e && "timeZone" in e && e.timeZone ? e.timeZone : "system"
57
57
  });
58
58
  }
@@ -60,7 +60,7 @@ function A(i, e, s) {
60
60
  if (!S(i) && !z(i) && !B(i) && !Z(i))
61
61
  return;
62
62
  let t;
63
- return T(i, s).fields.forEach((p) => {
63
+ return E(i, s).fields.forEach((p) => {
64
64
  const a = p.name, r = "domain" in p ? p.domain : void 0;
65
65
  if (!Z(i) && i.subtypeField === a) {
66
66
  let c;
@@ -107,7 +107,7 @@ function A(i, e, s) {
107
107
  }
108
108
  }), t;
109
109
  }
110
- function E(i, e) {
110
+ function T(i, e) {
111
111
  const s = e;
112
112
  if (s) {
113
113
  let t = "";
@@ -151,7 +151,7 @@ class ue extends K {
151
151
  const u = h(e) && h(s) || h(t);
152
152
  if (!h(t) && !h(e) && !h(s) ? D("error", this, N("uniqueValues")) : h(t) || (h(e) || D("error", this, N("layer")), h(s) || D("error", this, N("fieldName"))), h(e) && h(s)) {
153
153
  const { visualizationSource: p } = this;
154
- if (!T(e, p).fields?.filter((c) => c.name === s))
154
+ if (!E(e, p).fields?.filter((c) => c.name === s))
155
155
  throw D("error", this, "Field could not be found."), new Error();
156
156
  }
157
157
  if (!u)
@@ -185,7 +185,7 @@ class ue extends K {
185
185
  this.layer && this.fieldInfo && (setTimeout(() => this.initialRender = !1, 800), this.listNode?.setFocus());
186
186
  }
187
187
  async processProps() {
188
- const { layer: e, fieldName: s, view: t, visualizationSource: u } = this, a = (e ? T(e, u) : void 0)?.fields?.filter((r) => r.name === s)?.[0];
188
+ const { layer: e, fieldName: s, view: t, visualizationSource: u } = this, a = (e ? E(e, u) : void 0)?.fields?.filter((r) => r.name === s)?.[0];
189
189
  if (h(this.uniqueValues))
190
190
  this.fieldInfo = {
191
191
  layerField: a,
@@ -260,20 +260,20 @@ class ue extends K {
260
260
  if (!l?.length)
261
261
  return "";
262
262
  const g = n ? ["small-integer", "big-integer", "integer", "single", "double", "long", "oid"].includes(n) : !1, v = n ? ["date", "date-only", "time-only"].includes(n) : !1, _ = (y) => {
263
- y.sort(($, m) => $.count <= m.count ? 1 : -1);
263
+ y.sort((m, f) => m.count <= f.count ? 1 : -1);
264
264
  }, M = (y) => {
265
- const $ = c?.length;
266
- y.sort((m, f) => {
267
- if (!$ && g)
268
- return (typeof m.value == "string" ? Number.parseFloat(m.value) : m.value) - (typeof f.value == "string" ? Number.parseFloat(f.value) : f.value);
265
+ const m = c?.length;
266
+ y.sort((f, b) => {
267
+ if (!m && g)
268
+ return (typeof f.value == "string" ? Number.parseFloat(f.value) : f.value) - (typeof b.value == "string" ? Number.parseFloat(b.value) : b.value);
269
269
  {
270
- const q = $ ? E(m.value, c) : m.label ?? m.value, V = $ ? E(f.value, c) : f.label ?? f.value;
270
+ const q = m ? T(f.value, c) : f.label ?? f.value, V = m ? T(b.value, c) : b.label ?? b.value;
271
271
  return `${q}`.startsWith("_") ? 1 : `${V}`.startsWith("_") ? -1 : `${q}`.localeCompare(`${V}`);
272
272
  }
273
273
  });
274
- }, P = (y, $) => {
275
- y.sort((m, f) => {
276
- const q = $?.indexOf(m.value) ?? -1, V = $?.indexOf(f.value) ?? -1;
274
+ }, P = (y, m) => {
275
+ y.sort((f, b) => {
276
+ const q = m?.indexOf(f.value) ?? -1, V = m?.indexOf(b.value) ?? -1;
277
277
  return q === V || q > -1 && V > -1 ? 0 : q > V ? -1 : 1;
278
278
  });
279
279
  };
@@ -281,7 +281,7 @@ class ue extends K {
281
281
  const W = l.map((y) => this.renderUniqueValue(y));
282
282
  let x;
283
283
  return d && !p && (x = w`<div class="unique-values-content-list-msg">${r.errors.tooManyUniqueValues}</div>`), w`<div class="container"><calcite-list .label=${r.values} class="popover-unique-list" .filterEnabled=${l.length >= a} .selectionMode=${u ? "multiple" : "single"} .filterPlaceholder=${r.searchValues} @calciteListChange=${(y) => {
284
- let m = y.target.selectedItems.map((f) => f.value);
284
+ let m = y.currentTarget.selectedItems.map((f) => f.value);
285
285
  !c && n === "date-only" ? m = m?.map((f) => R(f)) : !c && n === "time-only" ? m = m?.map((f) => k(f)) : n && ["date", "oid", "small-integer", "big-integer", "integer", "long"].includes(n) ? m = m?.map((f) => Number.parseInt(f)) : n && ["single", "double"].includes(n) && (m = m?.map((f) => Number.parseFloat(f))), !this.isSameLists(m, this.selectedValues) && (this.selectedValues = m, this.arcgisChange.emit(m));
286
286
  }} @calciteListFilter=${() => {
287
287
  this.dropdownNode.value && (this.dropdownNode.value.disabled = this.listNode.filteredItems.length < 4);
@@ -295,7 +295,7 @@ class ue extends K {
295
295
  return w`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${L(this.dropdownNode)}><calcite-action slot=trigger .label=${u.sortValues} text><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${t === "count" || !h(t)} data-value=count>${u.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${t === "name"} data-value=name>${e || s ? u.sortAscending : u.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${t === "selected"} data-value=selected>${u.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
296
296
  }
297
297
  renderUniqueValue(e) {
298
- const { selectedValues: s, initialRender: t, view: u, fieldInfo: p, numberFormatOptions: a } = this, { fieldDomains: r, uniqueValueInfos: c, simpleType: l } = p, d = u && "timeZone" in u && u.timeZone || "system", o = r?.length ? E(e.value, r) : l === "date" ? ne(e.value, d) : l === "date-only" ? oe(e.value) : l === "time-only" ? ae(e.value) : l === "timestamp-offset" ? le(e.value, u) : typeof e.value == "number" ? te(e.value, a) : e.label ?? e.value, n = s ? l === "date-only" ? s.includes(r?.length ? e.value : R(e.value)) : l === "time-only" ? s.includes(r?.length ? e.value : k(e.value)) : s.includes(e.value) : !1;
298
+ const { selectedValues: s, initialRender: t, view: u, fieldInfo: p, numberFormatOptions: a } = this, { fieldDomains: r, uniqueValueInfos: c, simpleType: l } = p, d = u && "timeZone" in u && u.timeZone || "system", o = r?.length ? T(e.value, r) : l === "date" ? ne(e.value, d) : l === "date-only" ? oe(e.value) : l === "time-only" ? ae(e.value) : l === "timestamp-offset" ? le(e.value, u) : typeof e.value == "number" ? te(e.value, a) : e.label ?? e.value, n = s ? l === "date-only" ? s.includes(r?.length ? e.value : R(e.value)) : l === "time-only" ? s.includes(r?.length ? e.value : k(e.value)) : s.includes(e.value) : !1;
299
299
  return J(`list-item_${e.value}`, w`<calcite-list-item .label=${`${o}`} .value=${`${e.value}`} .selected=${n}>${h(e.count) && (c.length > 200 && !t || c.length <= 200) ? w`<div class="count" slot=actions-end>${`${e.count}`}</div>` : null}</calcite-list-item>`);
300
300
  }
301
301
  }