@arcgis/common-components 5.2.0-next.18 → 5.2.0-next.19
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/33FWZXZF.js +2 -0
- package/dist/cdn/{5U5NQ3F5.js → 5URV6773.js} +1 -1
- package/dist/cdn/GTW54IOJ.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/layer-utils.js +46 -38
- package/dist/components/arcgis-field-info/customElement.js +129 -129
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +3 -3
- package/dist/cdn/4BJYJUMR.js +0 -2
- package/dist/cdn/MCH3WQ4X.js +0 -2
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
2
|
+
import { c as W } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as Q, 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
|
|
7
|
-
import { Task as
|
|
6
|
+
import { LitElement as H, 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
|
|
9
|
+
import j 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
|
|
12
|
+
import * as A from "@arcgis/core/applications/PortalApp/layerUtils.js";
|
|
13
13
|
import * as I from "@arcgis/core/core/lang.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import z from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
15
|
+
import B from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
16
16
|
import { i as f } from "../../chunks/commonFunctions.js";
|
|
17
|
-
import { i as y, a as
|
|
18
|
-
import
|
|
19
|
-
import { u as
|
|
20
|
-
function
|
|
21
|
-
return
|
|
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) {
|
|
21
|
+
return r.associatedLayer?.url;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const re = {
|
|
24
24
|
dateStyle: "short",
|
|
25
25
|
timeStyle: "short"
|
|
26
|
-
},
|
|
26
|
+
}, ne = {
|
|
27
27
|
timeStyle: "medium"
|
|
28
28
|
};
|
|
29
|
-
function
|
|
30
|
-
const { layer: e, fieldName: t } =
|
|
29
|
+
function oe(r) {
|
|
30
|
+
const { layer: e, fieldName: t } = r;
|
|
31
31
|
let i;
|
|
32
|
-
const n =
|
|
32
|
+
const n = A.supportsFieldConfiguration(e);
|
|
33
33
|
let s;
|
|
34
34
|
"popupTemplate" in e && (s = e.popupTemplate);
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
const o = !n &&
|
|
35
|
+
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
38
|
/^raster.(item|service)pixelvalue/iu.test(t) && (u.type = "double");
|
|
39
39
|
const d = {
|
|
40
40
|
layerField: u,
|
|
41
41
|
label: l || u.name
|
|
42
42
|
};
|
|
43
|
-
d.codedValues =
|
|
43
|
+
d.codedValues = ce(t, r), de(d), d.simpleFieldType && (i = d);
|
|
44
44
|
}), i;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
const { layer: e } =
|
|
48
|
-
return y(e) ||
|
|
46
|
+
function U(r) {
|
|
47
|
+
const { layer: e } = r;
|
|
48
|
+
return y(e) || w(e) || T(e) && e.rasterFields.length ? e.rasterFields : e.fields;
|
|
49
49
|
}
|
|
50
|
-
async function
|
|
51
|
-
|
|
52
|
-
const { layer: e, view: t } =
|
|
53
|
-
if (y(e) ||
|
|
50
|
+
async function R(r) {
|
|
51
|
+
r.statisticsStatus = "in-progress";
|
|
52
|
+
const { layer: e, view: t } = r;
|
|
53
|
+
if (y(e) || w(e) || F(e) || S(e))
|
|
54
54
|
throw new Error("could not get feature count");
|
|
55
55
|
try {
|
|
56
|
-
return await
|
|
56
|
+
return await fe(e, t);
|
|
57
57
|
} catch {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
async function
|
|
62
|
-
const { layer: e, view: t, fieldName: i, fieldInfo: n } =
|
|
63
|
-
if (y(e) ||
|
|
61
|
+
async function le(r) {
|
|
62
|
+
const { layer: e, view: t, fieldName: i, fieldInfo: n } = r;
|
|
63
|
+
if (y(e) || w(e) || S(e))
|
|
64
64
|
throw new Error("could not get statistics for ImageryTileLayer/WCSLayer/VoxelLayer");
|
|
65
65
|
if (!n || n.layerField.type === "oid" || n.layerField.type === "guid" || n.layerField.type === "global-id")
|
|
66
|
-
return { totalCount: await
|
|
66
|
+
return { totalCount: await R(r), nullcount: 0 };
|
|
67
67
|
try {
|
|
68
|
-
const s = await
|
|
68
|
+
const s = await z({
|
|
69
69
|
layer: e,
|
|
70
70
|
view: t,
|
|
71
71
|
field: i,
|
|
@@ -73,24 +73,24 @@ async function ne(a) {
|
|
|
73
73
|
});
|
|
74
74
|
if (!f(s.count))
|
|
75
75
|
throw new Error("could not get statistics");
|
|
76
|
-
const
|
|
77
|
-
if (f(s.nullcount) && !
|
|
76
|
+
const a = "sourceJSON" in e && e.sourceJSON.maxRecordCount === s.count;
|
|
77
|
+
if (f(s.nullcount) && !a)
|
|
78
78
|
return { ...s, totalCount: s.count + s.nullcount };
|
|
79
79
|
{
|
|
80
|
-
const m = await
|
|
80
|
+
const m = await R(r);
|
|
81
81
|
return { ...s, totalCount: m };
|
|
82
82
|
}
|
|
83
83
|
} catch {
|
|
84
84
|
throw new Error("could not get statistics");
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
async function
|
|
88
|
-
const { layer: e, view: t, fieldName: i } =
|
|
89
|
-
if (y(e) ||
|
|
87
|
+
async function ue(r) {
|
|
88
|
+
const { layer: e, view: t, fieldName: i } = r;
|
|
89
|
+
if (y(e) || w(e) || S(e))
|
|
90
90
|
throw new Error("could not get unique values for ImageryLayer/ImageryTileLayer/WCSLayer/VoxelLayer");
|
|
91
|
-
|
|
91
|
+
Z(e) && (e.outFields = ["*"]);
|
|
92
92
|
try {
|
|
93
|
-
return await
|
|
93
|
+
return await B({
|
|
94
94
|
layer: e,
|
|
95
95
|
view: t,
|
|
96
96
|
field: i
|
|
@@ -99,29 +99,29 @@ async function oe(a) {
|
|
|
99
99
|
throw new Error("could not get unique values");
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
switch (
|
|
102
|
+
function de(r) {
|
|
103
|
+
switch (r.layerField.type) {
|
|
104
104
|
case "string":
|
|
105
|
-
|
|
105
|
+
r.simpleFieldType = "string";
|
|
106
106
|
break;
|
|
107
107
|
case "date":
|
|
108
|
-
|
|
108
|
+
r.simpleFieldType = "date";
|
|
109
109
|
break;
|
|
110
110
|
case "timestamp-offset":
|
|
111
|
-
|
|
111
|
+
r.simpleFieldType = "timestamp-offset";
|
|
112
112
|
break;
|
|
113
113
|
case "date-only":
|
|
114
|
-
|
|
114
|
+
r.simpleFieldType = "date-only";
|
|
115
115
|
break;
|
|
116
116
|
case "time-only":
|
|
117
|
-
|
|
117
|
+
r.simpleFieldType = "time-only";
|
|
118
118
|
break;
|
|
119
119
|
case "oid":
|
|
120
|
-
|
|
120
|
+
r.simpleFieldType = "oid";
|
|
121
121
|
break;
|
|
122
122
|
case "guid":
|
|
123
123
|
case "global-id":
|
|
124
|
-
|
|
124
|
+
r.simpleFieldType = "guid";
|
|
125
125
|
break;
|
|
126
126
|
case "small-integer":
|
|
127
127
|
case "big-integer":
|
|
@@ -129,13 +129,13 @@ function le(a) {
|
|
|
129
129
|
case "single":
|
|
130
130
|
case "double":
|
|
131
131
|
case "long":
|
|
132
|
-
|
|
132
|
+
r.simpleFieldType = "number";
|
|
133
133
|
break;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function ce(r, e) {
|
|
137
137
|
const { layer: t } = e;
|
|
138
|
-
if (
|
|
138
|
+
if (P(t) && t.subtypeField === r) {
|
|
139
139
|
const o = t.parent?.subtypes?.find((l) => l.code === t.subtypeCode);
|
|
140
140
|
if (o)
|
|
141
141
|
return [{ code: o.code, name: o.name }];
|
|
@@ -144,8 +144,8 @@ function ue(a, e) {
|
|
|
144
144
|
return;
|
|
145
145
|
const i = v(t) ? t.typeIdField : void 0, n = v(t) ? t.types : void 0;
|
|
146
146
|
let s;
|
|
147
|
-
const m =
|
|
148
|
-
return v(t) && i && n ? (i ===
|
|
147
|
+
const m = U(e)?.find((o) => o.name === r), u = m?.domain;
|
|
148
|
+
return v(t) && i && n ? (i === r ? s = n.map(
|
|
149
149
|
(o) => (
|
|
150
150
|
// fake coded values
|
|
151
151
|
{
|
|
@@ -154,7 +154,7 @@ function ue(a, e) {
|
|
|
154
154
|
}
|
|
155
155
|
)
|
|
156
156
|
) : (s = [], n.forEach((o) => {
|
|
157
|
-
if (!o.domains[
|
|
157
|
+
if (!o.domains[r] || o.domains[r].type === "inherited") {
|
|
158
158
|
const l = u;
|
|
159
159
|
l?.codedValues && l.codedValues.forEach((d) => {
|
|
160
160
|
let g = !1;
|
|
@@ -162,7 +162,7 @@ function ue(a, e) {
|
|
|
162
162
|
p.code === d.code && (g = !0, `, ${p.name},`.includes(`, ${d.name},`) || (p.name += `, ${d.name}`));
|
|
163
163
|
}), g || s.push(I.clone(d));
|
|
164
164
|
});
|
|
165
|
-
} else o.domains[
|
|
165
|
+
} else o.domains[r].codedValues && o.domains[r].codedValues.forEach((l) => {
|
|
166
166
|
let d = !1;
|
|
167
167
|
s.forEach((g) => {
|
|
168
168
|
g.code === l.code && (d = !0, `, ${g.name},`.includes(`, ${l.name},`) || (g.name += `, ${l.name}`));
|
|
@@ -170,11 +170,11 @@ function ue(a, e) {
|
|
|
170
170
|
});
|
|
171
171
|
})), !s.length && u?.codedValues && (s = I.clone(u.codedValues))) : u?.codedValues && (s = m.domain.codedValues), s?.length ? s : void 0;
|
|
172
172
|
}
|
|
173
|
-
async function
|
|
174
|
-
const { view: e, layer: t } =
|
|
175
|
-
if (T(t) || y(t) ||
|
|
173
|
+
async function me(r) {
|
|
174
|
+
const { view: e, layer: t } = r;
|
|
175
|
+
if (T(t) || y(t) || w(t))
|
|
176
176
|
throw new Error("could not get feature");
|
|
177
|
-
if (v(t) && !t.url ||
|
|
177
|
+
if (v(t) && !t.url || M(t)) {
|
|
178
178
|
const i = t.createQuery();
|
|
179
179
|
i.start = 0, i.num = 5, i.outFields = ["*"];
|
|
180
180
|
const n = await t.queryFeatures(i);
|
|
@@ -183,11 +183,11 @@ async function de(a) {
|
|
|
183
183
|
throw new Error("could not get feature");
|
|
184
184
|
} else {
|
|
185
185
|
if (!e)
|
|
186
|
-
return await C(
|
|
186
|
+
return await C(r);
|
|
187
187
|
let i;
|
|
188
|
-
if (
|
|
188
|
+
if (P(t) || K(t)) {
|
|
189
189
|
let s = t.parent;
|
|
190
|
-
for (;
|
|
190
|
+
for (; X(s) || Y(s); )
|
|
191
191
|
s = s.parent;
|
|
192
192
|
i = await e.whenLayerView(s);
|
|
193
193
|
} else
|
|
@@ -195,46 +195,46 @@ async function de(a) {
|
|
|
195
195
|
if (i.availableFields.length === t.fields.length || (F(t) || _(t)) && i.availableFields.length > 0) {
|
|
196
196
|
const s = i.createQuery();
|
|
197
197
|
s.start = 0, s.num = 5, s.outFields = ["*"];
|
|
198
|
-
const
|
|
199
|
-
return
|
|
198
|
+
const a = await i.queryFeatures(s);
|
|
199
|
+
return a.features?.length ? a : await C(r);
|
|
200
200
|
} else
|
|
201
|
-
return await C(
|
|
201
|
+
return await C(r);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
async function C(
|
|
205
|
-
const { layer: e } =
|
|
204
|
+
async function C(r) {
|
|
205
|
+
const { layer: e } = r;
|
|
206
206
|
if (T(e) || y(e) || F(e) || _(e))
|
|
207
207
|
throw new Error("cannot get feature from service");
|
|
208
|
-
const t = new
|
|
208
|
+
const t = new ie({
|
|
209
209
|
where: "1=1",
|
|
210
210
|
outFields: ["*"],
|
|
211
211
|
returnGeometry: !1
|
|
212
212
|
});
|
|
213
213
|
return "sourceJSON" in e && e.sourceJSON?.advancedQueryCapabilities?.supportsPagination && (t.num = 1), await e.queryFeatures(t);
|
|
214
214
|
}
|
|
215
|
-
async function
|
|
216
|
-
if (
|
|
217
|
-
return await
|
|
218
|
-
if (v(
|
|
219
|
-
return await
|
|
220
|
-
if (e && (F(
|
|
221
|
-
return await
|
|
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
|
+
return await r.queryFeatureCount();
|
|
220
|
+
if (e && (F(r) || _(r)))
|
|
221
|
+
return await ge(r, e);
|
|
222
222
|
}
|
|
223
|
-
async function
|
|
224
|
-
const e =
|
|
223
|
+
async function pe(r) {
|
|
224
|
+
const e = r.createQuery();
|
|
225
225
|
e.outFields = ["*"];
|
|
226
|
-
const t = await
|
|
226
|
+
const t = await r.queryFeatures(e);
|
|
227
227
|
if (t.features.length)
|
|
228
228
|
return t.features.length;
|
|
229
229
|
throw new Error("could not get feature count");
|
|
230
230
|
}
|
|
231
|
-
async function
|
|
232
|
-
return await (await e.whenLayerView(
|
|
231
|
+
async function ge(r, e) {
|
|
232
|
+
return await (await e.whenLayerView(r)).queryFeatureCount();
|
|
233
233
|
}
|
|
234
|
-
const
|
|
235
|
-
class
|
|
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 {
|
|
236
236
|
constructor() {
|
|
237
|
-
super(...arguments), this._messages =
|
|
237
|
+
super(...arguments), this._messages = se({ blocking: !0 }), this._propWatcherTask = new J(this, {
|
|
238
238
|
task: async ([e, t]) => {
|
|
239
239
|
const i = f(e) && f(t);
|
|
240
240
|
if (f(e) || q("error", this, L("layer")), f(t) || q("error", this, L("fieldName")), !i)
|
|
@@ -248,7 +248,7 @@ class ge extends W {
|
|
|
248
248
|
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
249
|
}
|
|
250
250
|
static {
|
|
251
|
-
this.styles =
|
|
251
|
+
this.styles = he;
|
|
252
252
|
}
|
|
253
253
|
async refresh() {
|
|
254
254
|
await this.processProps(), this.requestUpdate();
|
|
@@ -262,27 +262,27 @@ class ge extends W {
|
|
|
262
262
|
return;
|
|
263
263
|
let s;
|
|
264
264
|
if (t.declaredClass === "esri.layers.support.Sublayer") {
|
|
265
|
-
const
|
|
266
|
-
e && await x.whenOnce(() => !e.updating), s = await
|
|
265
|
+
const a = t;
|
|
266
|
+
e && await x.whenOnce(() => !e.updating), s = await a.createFeatureLayer(), await s?.load();
|
|
267
267
|
}
|
|
268
268
|
this.props = {
|
|
269
269
|
view: e,
|
|
270
270
|
layer: s ?? t,
|
|
271
271
|
fieldName: i,
|
|
272
272
|
hideStatistics: n
|
|
273
|
-
}, this.props.fieldInfo =
|
|
274
|
-
urls: `${
|
|
275
|
-
before(
|
|
276
|
-
|
|
273
|
+
}, this.props.fieldInfo = oe(this.props), G(t) && j.request.interceptors?.push({
|
|
274
|
+
urls: `${ae(t)}/${t.layerId}`,
|
|
275
|
+
before(a) {
|
|
276
|
+
a.requestOptions.authMode = "no-prompt";
|
|
277
277
|
}
|
|
278
278
|
}), this.oneFeatureResponseStatus = "in-progress";
|
|
279
279
|
try {
|
|
280
|
-
const
|
|
281
|
-
this.oneFeatureResponse =
|
|
280
|
+
const a = await me(this.props);
|
|
281
|
+
this.oneFeatureResponse = a, this.oneFeatureResponseStatus = "success";
|
|
282
282
|
} catch {
|
|
283
283
|
this.oneFeatureResponseStatus = "failed";
|
|
284
284
|
}
|
|
285
|
-
if (F(t)) {
|
|
285
|
+
if (F(t) || k(t) || E(t)) {
|
|
286
286
|
this.uniqueValuesStatus = "failed", this.statisticsStatus = "failed";
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
@@ -291,8 +291,8 @@ class ge extends W {
|
|
|
291
291
|
else {
|
|
292
292
|
this.uniqueValuesStatus = "in-progress";
|
|
293
293
|
try {
|
|
294
|
-
const
|
|
295
|
-
this.uniqueValues =
|
|
294
|
+
const a = await ue(this.props);
|
|
295
|
+
this.uniqueValues = a, a?.uniqueValueInfos?.length ? this.uniqueValuesStatus = "success" : this.uniqueValuesStatus = "failed";
|
|
296
296
|
} catch {
|
|
297
297
|
this.uniqueValuesStatus = "failed";
|
|
298
298
|
}
|
|
@@ -302,19 +302,19 @@ class ge extends W {
|
|
|
302
302
|
else {
|
|
303
303
|
this.statisticsStatus = "in-progress";
|
|
304
304
|
try {
|
|
305
|
-
const
|
|
306
|
-
if (!f(
|
|
305
|
+
const a = await le(this.props);
|
|
306
|
+
if (!f(a.totalCount) && f(a.count) && this.uniqueValuesStatus === "success") {
|
|
307
307
|
const m = this.uniqueValues?.uniqueValueInfos ?? [];
|
|
308
308
|
for (let u = 0; u < m.length; u++) {
|
|
309
309
|
const o = m[u];
|
|
310
310
|
if (o.value === null) {
|
|
311
|
-
|
|
311
|
+
a.totalCount = o.count + a.count;
|
|
312
312
|
break;
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
|
|
315
|
+
a.totalCount ??= a.count;
|
|
316
316
|
}
|
|
317
|
-
this.statistics =
|
|
317
|
+
this.statistics = a, this.statisticsStatus = "success";
|
|
318
318
|
} catch {
|
|
319
319
|
this.statisticsStatus = "failed";
|
|
320
320
|
}
|
|
@@ -518,7 +518,7 @@ class ge extends W {
|
|
|
518
518
|
getIntlDateTimeFormattingOptions(e, t) {
|
|
519
519
|
const i = this.getCurrentFieldFormat();
|
|
520
520
|
if (!t?.useFieldFormatting)
|
|
521
|
-
return i ? t?.isTimeOnly ?
|
|
521
|
+
return i ? t?.isTimeOnly ? ne : re : h.convertDateFormatToIntlOptions(e);
|
|
522
522
|
const n = i ? {
|
|
523
523
|
dateStyle: t?.isTimeOnly ? void 0 : i.dateStyle ?? void 0,
|
|
524
524
|
// year/month is overridden if dateStyle is set
|
|
@@ -534,7 +534,7 @@ class ge extends W {
|
|
|
534
534
|
}
|
|
535
535
|
originalLayerSupportsFieldConfigs() {
|
|
536
536
|
const { layer: e } = this;
|
|
537
|
-
return
|
|
537
|
+
return A.supportsFieldConfiguration(e);
|
|
538
538
|
}
|
|
539
539
|
getPopupTemplateFieldInfo() {
|
|
540
540
|
const { props: e } = this, { layer: t, fieldName: i } = e;
|
|
@@ -574,26 +574,26 @@ class ge extends W {
|
|
|
574
574
|
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
575
|
}
|
|
576
576
|
renderFieldSampleValue() {
|
|
577
|
-
const { oneFeatureResponse: e, oneFeatureResponseStatus: t, statisticsStatus: i, statistics: n, uniqueValuesStatus: s, uniqueValues:
|
|
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;
|
|
578
578
|
let p;
|
|
579
|
-
if (y(o) ||
|
|
579
|
+
if (y(o) || S(o) || !F(o) && ["string", "oid", "guid"].includes(this._getStatisticsType(d)) && s !== "failed")
|
|
580
580
|
return "";
|
|
581
|
-
t === "success" ? e.features.forEach((
|
|
582
|
-
(p === void 0 || p === null &&
|
|
583
|
-
}) : i === "success" ? p = n?.min ?? void 0 : s === "success" && (p =
|
|
581
|
+
t === "success" ? e.features.forEach(($) => {
|
|
582
|
+
(p === void 0 || p === null && $.attributes[l] !== null) && (p = $.attributes[l]);
|
|
583
|
+
}) : i === "success" ? p = n?.min ?? void 0 : s === "success" && (p = a?.uniqueValueInfos?.[0]?.value ?? a?.uniqueValueInfos?.[1]?.value ?? void 0);
|
|
584
584
|
const N = d.codedValues;
|
|
585
|
-
return f(p) && (N ? p = N.find((
|
|
585
|
+
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
586
|
}
|
|
587
587
|
renderFieldNumericFormat() {
|
|
588
|
-
const { _messages: e, props: t, hideNumericFormat: i } = this, { fieldName: n, fieldInfo: s, layer:
|
|
588
|
+
const { _messages: e, props: t, hideNumericFormat: i } = this, { fieldName: n, fieldInfo: s, layer: a } = t;
|
|
589
589
|
if (i || !["double", "long", "single"].includes(s.layerField.type))
|
|
590
590
|
return "";
|
|
591
|
-
const m = this.originalLayerSupportsFieldConfigs() ?
|
|
591
|
+
const m = this.originalLayerSupportsFieldConfigs() ? a.getFieldConfiguration(n) : void 0;
|
|
592
592
|
if (m?.fieldFormat) {
|
|
593
593
|
const { minimumFractionDigits: o, maximumFractionDigits: l } = m.fieldFormat;
|
|
594
594
|
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
595
|
}
|
|
596
|
-
const u = "popupTemplate" in
|
|
596
|
+
const u = "popupTemplate" in a ? a.popupTemplate : void 0;
|
|
597
597
|
if (u?.fieldInfos) {
|
|
598
598
|
const o = u.fieldInfos?.filter((l) => l.fieldName === n);
|
|
599
599
|
if (o?.length) {
|
|
@@ -607,8 +607,8 @@ class ge extends W {
|
|
|
607
607
|
return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div class="missing">${e.fieldDecimalPlacesNotAvailable}</div></div>`;
|
|
608
608
|
}
|
|
609
609
|
renderFieldStatistics() {
|
|
610
|
-
const { statisticsStatus: e, uniqueValuesStatus: t, hideStatistics: i, _messages: n, props: s } = this, { layer:
|
|
611
|
-
return i ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") :
|
|
610
|
+
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>`;
|
|
612
612
|
}
|
|
613
613
|
renderNoStatistics() {
|
|
614
614
|
const { _messages: e } = this;
|
|
@@ -647,16 +647,16 @@ class ge extends W {
|
|
|
647
647
|
const { statistics: e, view: t, props: i, _messages: n } = this, { fieldInfo: s } = i;
|
|
648
648
|
if (!e || !f(e.max) || !f(e.min))
|
|
649
649
|
return this.renderNoStatistics();
|
|
650
|
-
const { statistics:
|
|
650
|
+
const { statistics: a } = n, m = e.max - e.min, u = Math.floor(m / 31536e6);
|
|
651
651
|
let o = Math.floor((m - u * 31536e6) / 2628e6), l = Math.ceil((m - o * 2628e6) / 864e5);
|
|
652
652
|
l >= 30 && (o += 1, l = 0);
|
|
653
|
-
let d = u === 1 ?
|
|
654
|
-
d += u > 0 && (o > 0 || l > 0) ? ", " : "", d += o === 1 ?
|
|
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()) : "";
|
|
655
655
|
const g = s.simpleFieldType !== "timestamp-offset" || !t || t.timeZone !== "unknown", p = s.simpleFieldType === "time-only";
|
|
656
|
-
return c`<div><div class="statistics-row"><div>${
|
|
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>`;
|
|
657
657
|
}
|
|
658
658
|
renderTopValues() {
|
|
659
|
-
const { uniqueValues: e, uniqueValuesStatus: t, _messages: i, props: n } = this, { fieldInfo: s } = n, { statistics:
|
|
659
|
+
const { uniqueValues: e, uniqueValuesStatus: t, _messages: i, props: n } = this, { fieldInfo: s } = n, { statistics: a } = i;
|
|
660
660
|
if (e?.uniqueValueInfos?.length) {
|
|
661
661
|
const m = e.uniqueValueInfos;
|
|
662
662
|
m.sort((l, d) => l.count < d.count ? 1 : l.count > d.count ? -1 : 0);
|
|
@@ -666,17 +666,17 @@ class ge extends W {
|
|
|
666
666
|
d === g.code && (d = g.name);
|
|
667
667
|
}) : d = this._getDisplayString(d), c`<div class="statistics-row"><div class="data">${`${d}`}</div><div class="count">${this._printNumValue(l.count)}</div></div>`;
|
|
668
668
|
});
|
|
669
|
-
return o.length ? c`<div><div class="statistics-row-top-values"><div>${m.length > 10 ?
|
|
669
|
+
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
670
|
} else
|
|
671
|
-
return c`<div><div class="statistics-row-top-values"><div>${
|
|
671
|
+
return c`<div><div class="statistics-row-top-values"><div>${a.topValues}</div><div>${a.count}</div></div><div class="statistics-row"><div class="missing">${t === "failed" ? i.fieldUniqueValuesNotAvailable : i.fieldSampleRetrieving}</div></div></div>`;
|
|
672
672
|
}
|
|
673
673
|
renderNullValues() {
|
|
674
674
|
const { statistics: e, uniqueValues: t, _messages: i } = this, { statistics: n } = i;
|
|
675
675
|
let s = e?.nullcount;
|
|
676
676
|
if (!f(s) && t) {
|
|
677
|
-
const
|
|
678
|
-
for (let m = 0; m <
|
|
679
|
-
const u =
|
|
677
|
+
const a = t.uniqueValueInfos;
|
|
678
|
+
for (let m = 0; m < a.length; m++) {
|
|
679
|
+
const u = a[m];
|
|
680
680
|
if (u.value === null) {
|
|
681
681
|
s = u.count;
|
|
682
682
|
break;
|
|
@@ -686,7 +686,7 @@ class ge extends W {
|
|
|
686
686
|
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
687
|
}
|
|
688
688
|
}
|
|
689
|
-
|
|
689
|
+
W("arcgis-field-info", ve);
|
|
690
690
|
export {
|
|
691
|
-
|
|
691
|
+
ve as ArcgisFieldInfo
|
|
692
692
|
};
|