@arcgis/common-components 5.2.0-next.11 → 5.2.0-next.110
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/LICENSE.md +4 -2
- package/README.md +2 -2
- package/dist/cdn/24BY6E4U.js +2 -0
- package/dist/cdn/{MCZBUYS5.js → 26TPKYHY.js} +2 -2
- package/dist/cdn/2P3QKSBJ.js +2 -0
- package/dist/cdn/3ENYIWMV.js +2 -0
- package/dist/cdn/3YTGG7RF.js +2 -0
- package/dist/cdn/{VQLI4IE7.js → 6YKEQTXQ.js} +2 -2
- package/dist/cdn/{L5RMOAO3.js → 73AR55J2.js} +2 -2
- package/dist/cdn/746MUQGB.js +2 -0
- package/dist/cdn/{Y5Y7IXOV.js → 74MDECVO.js} +1 -1
- package/dist/cdn/AHWD5KV4.js +2 -0
- package/dist/cdn/ALOLCOFN.js +2 -0
- package/dist/cdn/B2QFPLR5.js +2 -0
- package/dist/cdn/{WEKRF34E.js → B6QUU35R.js} +2 -2
- package/dist/cdn/BGN6KRHS.js +2 -0
- package/dist/cdn/BQD6UQIB.js +2 -0
- package/dist/cdn/{JLPZ3OR2.js → BSSCT4Z5.js} +2 -2
- package/dist/cdn/CT3ZUD4C.js +2 -0
- package/dist/cdn/D2RCMLMS.js +2 -0
- package/dist/cdn/{5KS7T5BY.js → D2YGEFGL.js} +2 -2
- package/dist/cdn/DICEO27I.js +2 -0
- package/dist/cdn/{ECNI2A4K.js → E4NVOXNZ.js} +1 -1
- package/dist/cdn/{GVOQ2CB7.js → EY5CL247.js} +2 -2
- package/dist/cdn/EZH7L65E.js +2 -0
- package/dist/cdn/{LKUOAV7B.js → F2XLHROQ.js} +2 -2
- package/dist/cdn/F3UPNSY4.js +2 -0
- package/dist/cdn/F7ZMTKDL.js +2 -0
- package/dist/cdn/GAXWOAWM.js +2 -0
- package/dist/cdn/GV62Q7D7.js +2 -0
- package/dist/cdn/H4MYODDU.js +2 -0
- package/dist/cdn/{OBIWQRXY.js → IUQEF23H.js} +2 -2
- package/dist/cdn/KIWPQY6T.js +4 -0
- package/dist/cdn/KMWJCWRS.js +2 -0
- package/dist/cdn/{L2JNUMXB.js → KOQXEMEM.js} +2 -2
- package/dist/cdn/LE43VGSR.js +2 -0
- package/dist/cdn/NMDESY3T.js +2 -0
- package/dist/cdn/NXUTEL5Q.js +2 -0
- package/dist/cdn/P3DCEHGK.js +2 -0
- package/dist/cdn/P6IUT6XO.js +2 -0
- package/dist/cdn/P7I4EXSU.js +2 -0
- package/dist/cdn/Q7STPO4U.js +2 -0
- package/dist/cdn/QJJFF4PI.js +2 -0
- package/dist/cdn/{4W7JZPB6.js → SHMWZ2AY.js} +2 -2
- package/dist/cdn/{3P53QRGS.js → ST5VEH7P.js} +2 -2
- package/dist/cdn/U2K7ABGL.js +2 -0
- package/dist/cdn/VIUFXHPL.js +2 -0
- package/dist/cdn/{UGWLCTVM.js → YJTI6KPW.js} +1 -1
- package/dist/cdn/{XRARFMJ7.js → ZBSOCWIQ.js} +2 -2
- package/dist/cdn/{3V5M7OHL.js → ZZGYCYHP.js} +4 -4
- package/dist/cdn/assets/field-pick-list/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/slider-field/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/slider-histogram-range/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +2 -2
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/element-reference-controller.js +19 -0
- package/dist/chunks/{commonFunctions.js → general.js} +1 -1
- package/dist/chunks/internal-types.js +1 -1
- package/dist/chunks/layer-utils.js +53 -41
- package/dist/chunks/locale.js +15 -7
- package/dist/chunks/resources.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/strategies.js +287 -0
- package/dist/chunks/toolbar.js +9 -0
- package/dist/chunks/types.js +16 -0
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utils.js +59 -0
- package/dist/chunks/utils2.js +20 -0
- package/dist/chunks/utils3.js +7 -0
- package/dist/components/arcgis-ckeditor5/customElement.d.ts +23 -0
- package/dist/components/arcgis-ckeditor5/customElement.js +3 -3
- package/dist/components/arcgis-ckeditor5-popover/customElement.js +2 -2
- package/dist/components/arcgis-color-input/customElement.d.ts +2 -1
- package/dist/components/arcgis-color-input/customElement.js +2 -2
- package/dist/components/arcgis-coordinate-system-picker/customElement.d.ts +23 -0
- package/dist/components/arcgis-coordinate-system-picker/customElement.js +2 -2
- package/dist/components/arcgis-coordinate-system-picker-tree/customElement.js +1 -1
- package/dist/components/arcgis-field-info/customElement.d.ts +1 -1
- package/dist/components/arcgis-field-info/customElement.js +249 -226
- package/dist/components/arcgis-field-info/index.js +1 -0
- package/dist/components/arcgis-field-info/utils/basic.d.ts +3 -1
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +15 -12
- package/dist/components/arcgis-field-pick-list/customElement.js +206 -123
- package/dist/components/arcgis-field-pick-list/index.js +4 -3
- package/dist/components/arcgis-field-pick-list/utils/types.d.ts +3 -1
- package/dist/components/arcgis-histogram/customElement.d.ts +39 -2
- package/dist/components/arcgis-histogram/customElement.js +106 -91
- package/dist/components/arcgis-label-input/customElement.js +19 -15
- package/dist/components/arcgis-picker-input/customElement.js +1 -1
- package/dist/components/arcgis-ramp-color/customElement.js +1 -1
- package/dist/components/arcgis-ramp-color-break/customElement.js +1 -1
- package/dist/components/arcgis-ramp-opacity/customElement.js +1 -1
- package/dist/components/arcgis-slider/customElement.d.ts +11 -3
- package/dist/components/arcgis-slider/customElement.js +372 -349
- package/dist/components/arcgis-slider-field/customElement.d.ts +298 -0
- package/dist/components/arcgis-slider-field/customElement.js +96 -0
- package/dist/components/arcgis-slider-field/index.d.ts +1 -0
- package/dist/components/arcgis-slider-field/index.js +2 -0
- package/dist/components/arcgis-slider-histogram-range/customElement.d.ts +390 -0
- package/dist/components/arcgis-slider-histogram-range/customElement.js +120 -0
- package/dist/components/arcgis-slider-histogram-range/index.d.ts +1 -0
- package/dist/components/arcgis-slider-histogram-range/index.js +3 -0
- package/dist/components/arcgis-slider-histogram-range/types.d.ts +6 -0
- package/dist/components/arcgis-slider-input/customElement.js +1 -1
- package/dist/components/arcgis-ticks/customElement.d.ts +11 -3
- package/dist/components/arcgis-ticks/customElement.js +101 -80
- package/dist/components/arcgis-toolbar/customElement.d.ts +67 -0
- package/dist/components/arcgis-toolbar/customElement.js +108 -0
- package/dist/components/arcgis-toolbar/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar/index.js +2 -0
- package/dist/components/arcgis-toolbar/types.d.ts +41 -0
- package/dist/components/arcgis-toolbar-action/customElement.d.ts +97 -0
- package/dist/components/arcgis-toolbar-action/customElement.js +52 -0
- package/dist/components/arcgis-toolbar-action/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-action/index.js +3 -0
- package/dist/components/arcgis-toolbar-group/customElement.d.ts +38 -0
- package/dist/components/arcgis-toolbar-group/customElement.js +48 -0
- package/dist/components/arcgis-toolbar-group/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-group/index.js +2 -0
- package/dist/components/arcgis-toolbar-item/customElement.d.ts +83 -0
- package/dist/components/arcgis-toolbar-item/customElement.js +42 -0
- package/dist/components/arcgis-toolbar-item/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-item/index.js +4 -0
- package/dist/components/arcgis-toolbar-more-button/customElement.d.ts +52 -0
- package/dist/components/arcgis-toolbar-more-button/customElement.js +68 -0
- package/dist/components/arcgis-toolbar-more-button/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-more-button/index.js +6 -0
- package/dist/components/arcgis-toolbar-split-button/customElement.d.ts +51 -0
- package/dist/components/arcgis-toolbar-split-button/customElement.js +67 -0
- package/dist/components/arcgis-toolbar-split-button/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-split-button/index.js +6 -0
- package/dist/components/arcgis-toolbar-stack/customElement.d.ts +48 -0
- package/dist/components/arcgis-toolbar-stack/customElement.js +174 -0
- package/dist/components/arcgis-toolbar-stack/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-stack/index.js +1 -0
- package/dist/components/arcgis-unique-values-list/customElement.js +116 -96
- package/dist/components/arcgis-value-picker/customElement.js +6 -6
- package/dist/components/arcgis-value-picker-collection/customElement.js +1 -1
- package/dist/components/arcgis-value-picker-combobox/customElement.js +1 -1
- package/dist/components/arcgis-value-picker-label/customElement.js +1 -1
- package/dist/components/arcgis-value-picker-slider/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.css-custom-data.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +62 -0
- package/dist/index.js +3 -1
- package/dist/loader.js +14 -5
- package/dist/types/lumina.d.ts +58 -2
- package/dist/types/preact.d.ts +67 -2
- package/dist/types/react.d.ts +76 -2
- package/dist/types/stencil.d.ts +60 -4
- package/dist/utils/types.d.ts +14 -1
- package/package.json +6 -6
- package/dist/cdn/2XA6O2MP.js +0 -2
- package/dist/cdn/4BJYJUMR.js +0 -2
- package/dist/cdn/5U5NQ3F5.js +0 -2
- package/dist/cdn/77HZGUSC.js +0 -2
- package/dist/cdn/A3CISHRB.js +0 -2
- package/dist/cdn/AFBKMYU6.js +0 -4
- package/dist/cdn/IUJ4ILLQ.js +0 -2
- package/dist/cdn/JPD7Z3MB.js +0 -2
- package/dist/cdn/LB7I345F.js +0 -2
- package/dist/cdn/LBD3GPSD.js +0 -2
- package/dist/cdn/MCH3WQ4X.js +0 -2
- package/dist/cdn/N7C4DINF.js +0 -2
- package/dist/cdn/NKMDS2IH.js +0 -2
- package/dist/cdn/PSITQBDP.js +0 -2
- package/dist/cdn/TXYPZ6MB.js +0 -2
- package/dist/cdn/WLYFLEI6.js +0 -2
- package/dist/cdn/assets/coordinate-system-picker/t9n/messages.en-US.json +0 -1
|
@@ -1,71 +1,72 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Task as Q } from "@lit/task";
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { c as H } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as $ } from "lit/directives/keyed.js";
|
|
4
|
+
import { ref as b } from "lit/directives/ref.js";
|
|
5
|
+
import { LitElement as Q, createEvent as D, safeClassMap as C } from "@arcgis/lumina";
|
|
6
|
+
import { Task as J } from "@lit/task";
|
|
8
7
|
import { log as q, composeMissingPropertyMessage as L } from "@arcgis/toolkit/log";
|
|
9
|
-
import
|
|
8
|
+
import { css as j, html as c } from "lit";
|
|
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
|
|
13
|
-
import * as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { i as f } from "../../chunks/
|
|
17
|
-
import
|
|
18
|
-
import ee from "
|
|
19
|
-
import
|
|
20
|
-
|
|
12
|
+
import * as P from "@arcgis/core/applications/PortalApp/layerUtils.js";
|
|
13
|
+
import * as _ from "@arcgis/core/core/lang.js";
|
|
14
|
+
import B from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
15
|
+
import K from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
16
|
+
import { i as f } from "../../chunks/general.js";
|
|
17
|
+
import R from "@arcgis/core/layers/support/CodedValue.js";
|
|
18
|
+
import { i as F, a as V, b as T, c as Z, d as I, e as M, f as y, g as w, h as U, j as X, k as Y, l as ee, m as te, n as N, o as ie, p as W, q as se, r as k, s as E } 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(a) {
|
|
21
22
|
return a.associatedLayer?.url;
|
|
22
23
|
}
|
|
23
|
-
const
|
|
24
|
+
const oe = {
|
|
24
25
|
dateStyle: "short",
|
|
25
26
|
timeStyle: "short"
|
|
26
|
-
},
|
|
27
|
+
}, le = {
|
|
27
28
|
timeStyle: "medium"
|
|
28
29
|
};
|
|
29
|
-
function
|
|
30
|
+
function ue(a) {
|
|
30
31
|
const { layer: e, fieldName: t } = a;
|
|
31
32
|
let i;
|
|
32
|
-
const
|
|
33
|
+
const r = P.supportsFieldConfiguration(e);
|
|
33
34
|
let s;
|
|
34
35
|
"popupTemplate" in e && (s = e.popupTemplate);
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
const
|
|
38
|
-
/^raster.(item|service)pixelvalue/iu.test(t) && (
|
|
39
|
-
const
|
|
40
|
-
layerField:
|
|
41
|
-
label:
|
|
36
|
+
const l = s ? s.fieldInfos : [];
|
|
37
|
+
return G(a)?.filter((n) => n.name === t).forEach((n) => {
|
|
38
|
+
const d = !r && l ? l.filter((g) => g.fieldName === n.name) : void 0, o = r ? e.getFieldAlias(t) : d?.length ? d[0].label : n.alias;
|
|
39
|
+
/^raster.(item|service)pixelvalue/iu.test(t) && (n.type = "double");
|
|
40
|
+
const u = {
|
|
41
|
+
layerField: n,
|
|
42
|
+
label: o || n.name
|
|
42
43
|
};
|
|
43
|
-
|
|
44
|
+
u.codedValues = fe(t, a), me(u), u.simpleFieldType && (i = u);
|
|
44
45
|
}), i;
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function G(a) {
|
|
47
48
|
const { layer: e } = a;
|
|
48
|
-
return
|
|
49
|
+
return F(e) || V(e) || I(e) && e.rasterFields.length ? e.rasterFields : e.fields;
|
|
49
50
|
}
|
|
50
|
-
async function
|
|
51
|
+
async function A(a) {
|
|
51
52
|
a.statisticsStatus = "in-progress";
|
|
52
53
|
const { layer: e, view: t } = a;
|
|
53
|
-
if (
|
|
54
|
+
if (F(e) || V(e) || w(e) || T(e))
|
|
54
55
|
throw new Error("could not get feature count");
|
|
55
56
|
try {
|
|
56
|
-
return await
|
|
57
|
+
return await ge(e, t);
|
|
57
58
|
} catch {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
async function
|
|
62
|
-
const { layer: e, view: t, fieldName: i, fieldInfo:
|
|
63
|
-
if (
|
|
62
|
+
async function de(a) {
|
|
63
|
+
const { layer: e, view: t, fieldName: i, fieldInfo: r } = a;
|
|
64
|
+
if (F(e) || V(e) || T(e))
|
|
64
65
|
throw new Error("could not get statistics for ImageryTileLayer/WCSLayer/VoxelLayer");
|
|
65
|
-
if (!
|
|
66
|
-
return { totalCount: await
|
|
66
|
+
if (!r || r.layerField.type === "oid" || r.layerField.type === "guid" || r.layerField.type === "global-id")
|
|
67
|
+
return { totalCount: await A(a), nullcount: 0 };
|
|
67
68
|
try {
|
|
68
|
-
const s = await
|
|
69
|
+
const s = await B({
|
|
69
70
|
layer: e,
|
|
70
71
|
view: t,
|
|
71
72
|
field: i,
|
|
@@ -73,24 +74,24 @@ async function ne(a) {
|
|
|
73
74
|
});
|
|
74
75
|
if (!f(s.count))
|
|
75
76
|
throw new Error("could not get statistics");
|
|
76
|
-
const
|
|
77
|
-
if (f(s.nullcount) && !
|
|
77
|
+
const l = "sourceJSON" in e && e.sourceJSON.maxRecordCount === s.count;
|
|
78
|
+
if (f(s.nullcount) && !l)
|
|
78
79
|
return { ...s, totalCount: s.count + s.nullcount };
|
|
79
80
|
{
|
|
80
|
-
const m = await
|
|
81
|
+
const m = await A(a);
|
|
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
|
|
88
|
+
async function ce(a) {
|
|
88
89
|
const { layer: e, view: t, fieldName: i } = a;
|
|
89
|
-
if (
|
|
90
|
+
if (F(e) || V(e) || T(e))
|
|
90
91
|
throw new Error("could not get unique values for ImageryLayer/ImageryTileLayer/WCSLayer/VoxelLayer");
|
|
91
|
-
|
|
92
|
+
Z(e) && (e.outFields = ["*"]);
|
|
92
93
|
try {
|
|
93
|
-
return await
|
|
94
|
+
return await K({
|
|
94
95
|
layer: e,
|
|
95
96
|
view: t,
|
|
96
97
|
field: i
|
|
@@ -99,7 +100,7 @@ async function oe(a) {
|
|
|
99
100
|
throw new Error("could not get unique values");
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
function
|
|
103
|
+
function me(a) {
|
|
103
104
|
switch (a.layerField.type) {
|
|
104
105
|
case "string":
|
|
105
106
|
a.simpleFieldType = "string";
|
|
@@ -131,96 +132,99 @@ function le(a) {
|
|
|
131
132
|
case "long":
|
|
132
133
|
a.simpleFieldType = "number";
|
|
133
134
|
break;
|
|
135
|
+
default:
|
|
136
|
+
a.simpleFieldType = "string";
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
|
-
function
|
|
139
|
+
function fe(a, e) {
|
|
137
140
|
const { layer: t } = e;
|
|
138
|
-
if (
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
return [{ code:
|
|
141
|
+
if (M(t) && t.subtypeField === a) {
|
|
142
|
+
const d = t.parent?.subtypes?.find((o) => o.code === t.subtypeCode);
|
|
143
|
+
if (d)
|
|
144
|
+
return [new R({ code: d.code, name: d.name })];
|
|
142
145
|
}
|
|
143
|
-
if (!
|
|
146
|
+
if (!y(t) && !I(t))
|
|
144
147
|
return;
|
|
145
|
-
const i =
|
|
148
|
+
const i = y(t) ? t.typeIdField : void 0, r = y(t) ? t.types : void 0;
|
|
146
149
|
let s;
|
|
147
|
-
const m =
|
|
148
|
-
return
|
|
149
|
-
(
|
|
150
|
+
const m = G(e)?.find((d) => d.name === a), n = m?.domain;
|
|
151
|
+
return y(t) && i && r ? (i === a ? s = r.map(
|
|
152
|
+
(d) => (
|
|
150
153
|
// fake coded values
|
|
151
|
-
{
|
|
152
|
-
code:
|
|
153
|
-
name:
|
|
154
|
-
}
|
|
154
|
+
new R({
|
|
155
|
+
code: d.id,
|
|
156
|
+
name: d.name
|
|
157
|
+
})
|
|
155
158
|
)
|
|
156
|
-
) : (s = [],
|
|
157
|
-
if (!
|
|
158
|
-
const
|
|
159
|
-
|
|
159
|
+
) : (s = [], r.forEach((d) => {
|
|
160
|
+
if (!d.domains[a] || d.domains[a].type === "inherited") {
|
|
161
|
+
const o = n;
|
|
162
|
+
o?.codedValues && o.codedValues.forEach((u) => {
|
|
160
163
|
let g = !1;
|
|
161
164
|
s.forEach((p) => {
|
|
162
|
-
p.code ===
|
|
163
|
-
}), g || s.push(
|
|
165
|
+
p.code === u.code && (g = !0, `, ${p.name},`.includes(`, ${u.name},`) || (p.name += `, ${u.name}`));
|
|
166
|
+
}), g || s.push(_.clone(u));
|
|
164
167
|
});
|
|
165
|
-
} else
|
|
166
|
-
let
|
|
168
|
+
} else d.domains[a].codedValues && d.domains[a].codedValues.forEach((o) => {
|
|
169
|
+
let u = !1;
|
|
167
170
|
s.forEach((g) => {
|
|
168
|
-
g.code ===
|
|
169
|
-
}),
|
|
171
|
+
g.code === o.code && (u = !0, `, ${g.name},`.includes(`, ${o.name},`) || (g.name += `, ${o.name}`));
|
|
172
|
+
}), u || s.push(_.clone(o));
|
|
170
173
|
});
|
|
171
|
-
})), !s.length &&
|
|
174
|
+
})), !s.length && n?.codedValues && (s = _.clone(n.codedValues))) : n?.codedValues && (s = m?.domain?.codedValues), s?.length ? s : void 0;
|
|
172
175
|
}
|
|
173
|
-
async function
|
|
176
|
+
async function pe(a) {
|
|
174
177
|
const { view: e, layer: t } = a;
|
|
175
|
-
if (
|
|
178
|
+
if (I(t) || F(t) || V(t))
|
|
176
179
|
throw new Error("could not get feature");
|
|
177
|
-
if (
|
|
180
|
+
if (y(t) && !t.url || U(t)) {
|
|
178
181
|
const i = t.createQuery();
|
|
179
182
|
i.start = 0, i.num = 5, i.outFields = ["*"];
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
return
|
|
183
|
+
const r = await t.queryFeatures(i);
|
|
184
|
+
if (r.features.length)
|
|
185
|
+
return r;
|
|
183
186
|
throw new Error("could not get feature");
|
|
184
187
|
} else {
|
|
185
188
|
if (!e)
|
|
186
|
-
return await
|
|
189
|
+
return await O(a);
|
|
187
190
|
let i;
|
|
188
|
-
if (
|
|
191
|
+
if (M(t) || X(t)) {
|
|
189
192
|
let s = t.parent;
|
|
190
|
-
for (;
|
|
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
|
-
|
|
198
|
+
const r = i.availableFields.length === t.fields.length;
|
|
199
|
+
if (i && (r || (w(t) || N(t)) && i.availableFields.length > 0)) {
|
|
196
200
|
const s = i.createQuery();
|
|
197
201
|
s.start = 0, s.num = 5, s.outFields = ["*"];
|
|
198
|
-
const
|
|
199
|
-
return
|
|
202
|
+
const l = await i.queryFeatures(s);
|
|
203
|
+
return l.features?.length ? l : await O(a);
|
|
200
204
|
} else
|
|
201
|
-
return await
|
|
205
|
+
return await O(a);
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
|
-
async function
|
|
208
|
+
async function O(a) {
|
|
205
209
|
const { layer: e } = a;
|
|
206
|
-
if (
|
|
210
|
+
if (I(e) || F(e) || w(e) || N(e))
|
|
207
211
|
throw new Error("cannot get feature from service");
|
|
208
|
-
const t = new
|
|
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
|
|
216
|
-
if (
|
|
217
|
-
return await
|
|
218
|
-
if (
|
|
219
|
+
async function ge(a, e) {
|
|
220
|
+
if (Z(a))
|
|
221
|
+
return await he(a);
|
|
222
|
+
if (y(a) || ie(a) || W(a) || U(a) || se(a))
|
|
219
223
|
return await a.queryFeatureCount();
|
|
220
|
-
if (e && (
|
|
221
|
-
return await
|
|
224
|
+
if (e && (w(a) || N(a)))
|
|
225
|
+
return await ve(a, e);
|
|
222
226
|
}
|
|
223
|
-
async function
|
|
227
|
+
async function he(a) {
|
|
224
228
|
const e = a.createQuery();
|
|
225
229
|
e.outFields = ["*"];
|
|
226
230
|
const t = await a.queryFeatures(e);
|
|
@@ -228,13 +232,13 @@ async function me(a) {
|
|
|
228
232
|
return t.features.length;
|
|
229
233
|
throw new Error("could not get feature count");
|
|
230
234
|
}
|
|
231
|
-
async function
|
|
235
|
+
async function ve(a, e) {
|
|
232
236
|
return await (await e.whenLayerView(a)).queryFeatureCount();
|
|
233
237
|
}
|
|
234
|
-
const
|
|
235
|
-
class
|
|
238
|
+
const ye = j`:host{height:100%}.container{padding:var(--calcite-space-xs);background-color:var(--calcite-color-surface-2)}.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 Q {
|
|
236
240
|
constructor() {
|
|
237
|
-
super(...arguments), this._messages =
|
|
241
|
+
super(...arguments), this._messages = re({ blocking: !0 }), this.initialized = !1, 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,85 +252,91 @@ class ge extends W {
|
|
|
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 =
|
|
255
|
+
this.styles = ye;
|
|
252
256
|
}
|
|
253
257
|
async refresh() {
|
|
254
258
|
await this.processProps(), this.requestUpdate();
|
|
255
259
|
}
|
|
260
|
+
willUpdate(e) {
|
|
261
|
+
this.initialized && (e.has("fieldName") || e.has("layer")) && this.processProps();
|
|
262
|
+
}
|
|
256
263
|
disconnectedCallback() {
|
|
257
264
|
super.disconnectedCallback(), this.timeZoneHandle?.remove();
|
|
258
265
|
}
|
|
259
266
|
async processProps() {
|
|
260
|
-
const { view: e, layer: t, fieldName: i, hideStatistics:
|
|
267
|
+
const { view: e, layer: t, fieldName: i, hideStatistics: r } = this;
|
|
261
268
|
if (!t || !i)
|
|
262
269
|
return;
|
|
263
270
|
let s;
|
|
264
271
|
if (t.declaredClass === "esri.layers.support.Sublayer") {
|
|
265
|
-
const
|
|
266
|
-
e && await x.whenOnce(() => !e.updating), s = await
|
|
272
|
+
const l = t;
|
|
273
|
+
e && await x.whenOnce(() => !e.updating), s = await l.createFeatureLayer(), await s?.load();
|
|
267
274
|
}
|
|
268
|
-
this.props = {
|
|
275
|
+
if (this.oneFeatureResponseStatus = "missing", this.oneFeatureResponse = void 0, this.statisticsStatus = "missing", this.statistics = void 0, this.uniqueValuesStatus = "missing", this.uniqueValues = void 0, this.props = {
|
|
269
276
|
view: e,
|
|
270
277
|
layer: s ?? t,
|
|
271
278
|
fieldName: i,
|
|
272
|
-
hideStatistics:
|
|
273
|
-
}, this.props.fieldInfo =
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
279
|
+
hideStatistics: r
|
|
280
|
+
}, this.props.fieldInfo = ue(this.props), !this.props.fieldInfo) {
|
|
281
|
+
q("error", this, `Field ${i} does not exist in layer.`);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
W(t) && z.request.interceptors?.push({
|
|
285
|
+
urls: `${ne(t)}/${t.layerId}`,
|
|
286
|
+
before(l) {
|
|
287
|
+
l.requestOptions.authMode = "no-prompt";
|
|
277
288
|
}
|
|
278
|
-
}), this.
|
|
289
|
+
}), this.processPropsPart2();
|
|
290
|
+
}
|
|
291
|
+
async processPropsPart2() {
|
|
292
|
+
const { layer: e, hideStatistics: t } = this;
|
|
293
|
+
if (await this.requestOneFeature(), w(e) || k(e) || E(e)) {
|
|
294
|
+
this.uniqueValuesStatus = "failed", this.statisticsStatus = "failed";
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
t ? this.uniqueValuesStatus = "failed" : await this.requestUniqueValues(), t ? this.statisticsStatus = "failed" : await this.requestStatistics(), this.setUpTimeZoneHandle(), this.initialized = !0;
|
|
298
|
+
}
|
|
299
|
+
async requestOneFeature() {
|
|
300
|
+
this.oneFeatureResponseStatus = "in-progress";
|
|
279
301
|
try {
|
|
280
|
-
const
|
|
281
|
-
this.oneFeatureResponse =
|
|
302
|
+
const e = await pe(this.props);
|
|
303
|
+
this.oneFeatureResponse = e, this.oneFeatureResponseStatus = "success";
|
|
282
304
|
} catch {
|
|
283
305
|
this.oneFeatureResponseStatus = "failed";
|
|
284
306
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
307
|
+
}
|
|
308
|
+
async requestUniqueValues() {
|
|
309
|
+
this.uniqueValuesStatus = "in-progress";
|
|
310
|
+
try {
|
|
311
|
+
const e = await ce(this.props);
|
|
312
|
+
this.uniqueValues = e, e?.uniqueValueInfos?.length ? this.uniqueValuesStatus = "success" : this.uniqueValuesStatus = "failed";
|
|
313
|
+
} catch {
|
|
290
314
|
this.uniqueValuesStatus = "failed";
|
|
291
|
-
else {
|
|
292
|
-
this.uniqueValuesStatus = "in-progress";
|
|
293
|
-
try {
|
|
294
|
-
const r = await oe(this.props);
|
|
295
|
-
this.uniqueValues = r, r?.uniqueValueInfos?.length ? this.uniqueValuesStatus = "success" : this.uniqueValuesStatus = "failed";
|
|
296
|
-
} catch {
|
|
297
|
-
this.uniqueValuesStatus = "failed";
|
|
298
|
-
}
|
|
299
315
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
r.totalCount = o.count + r.count;
|
|
312
|
-
break;
|
|
313
|
-
}
|
|
316
|
+
}
|
|
317
|
+
async requestStatistics() {
|
|
318
|
+
try {
|
|
319
|
+
const e = await de(this.props);
|
|
320
|
+
if (!f(e.totalCount) && f(e.count) && this.uniqueValuesStatus === "success") {
|
|
321
|
+
const t = this.uniqueValues?.uniqueValueInfos ?? [];
|
|
322
|
+
for (let i = 0; i < t.length; i++) {
|
|
323
|
+
const r = t[i];
|
|
324
|
+
if (r.value === null) {
|
|
325
|
+
e.totalCount = r.count + e.count;
|
|
326
|
+
break;
|
|
314
327
|
}
|
|
315
|
-
r.totalCount ??= r.count;
|
|
316
328
|
}
|
|
317
|
-
|
|
318
|
-
} catch {
|
|
319
|
-
this.statisticsStatus = "failed";
|
|
329
|
+
e.totalCount ??= e.count;
|
|
320
330
|
}
|
|
331
|
+
this.statistics = e, this.statisticsStatus = "success";
|
|
332
|
+
} catch {
|
|
333
|
+
this.statisticsStatus = "failed";
|
|
321
334
|
}
|
|
322
|
-
this.setUpTimeZoneHandle();
|
|
323
335
|
}
|
|
324
336
|
setUpTimeZoneHandle() {
|
|
325
337
|
this.timeZoneHandle?.remove();
|
|
326
338
|
const { props: e } = this, { view: t, fieldInfo: i } = e;
|
|
327
|
-
["date", "timestamp-offset"].includes(this._getStatisticsType(i)) && (this.timeZoneHandle = x.watch(() => t?.timeZone, () =>
|
|
328
|
-
this.requestUpdate();
|
|
329
|
-
}));
|
|
339
|
+
["date", "timestamp-offset"].includes(this._getStatisticsType(i)) && (this.timeZoneHandle = x.watch(() => t?.timeZone, () => this.requestUpdate()));
|
|
330
340
|
}
|
|
331
341
|
_getFieldTypeLabel(e) {
|
|
332
342
|
const { _messages: t } = this, i = t.fieldTypes;
|
|
@@ -427,8 +437,8 @@ class ge extends W {
|
|
|
427
437
|
}
|
|
428
438
|
}
|
|
429
439
|
_getDisplayString(e, t) {
|
|
430
|
-
const { props: i } = this, { fieldInfo:
|
|
431
|
-
switch (
|
|
440
|
+
const { props: i } = this, { fieldInfo: r } = i;
|
|
441
|
+
switch (r.simpleFieldType) {
|
|
432
442
|
case "date":
|
|
433
443
|
return this._getDateString(e, t);
|
|
434
444
|
case "date-only":
|
|
@@ -487,8 +497,13 @@ class ge extends W {
|
|
|
487
497
|
_printNumValue(e, t) {
|
|
488
498
|
return f(e) ? this._getNumberString(e, t) : "--";
|
|
489
499
|
}
|
|
490
|
-
_setCompleteRef() {
|
|
491
|
-
this.
|
|
500
|
+
_setCompleteRef(e) {
|
|
501
|
+
if (this.completeRefHandler && clearInterval(this.completeRefHandler), e) {
|
|
502
|
+
let t = 0;
|
|
503
|
+
this.completeRefHandler = setInterval(() => {
|
|
504
|
+
(t > 130 || this.isFinished(this.uniqueValuesStatus) && this.isFinished(this.statisticsStatus)) && (clearInterval(this.completeRefHandler), this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit()), t++;
|
|
505
|
+
}, 1e3);
|
|
506
|
+
}
|
|
492
507
|
}
|
|
493
508
|
getCurrentFieldFormat() {
|
|
494
509
|
const { props: e } = this, { layer: t, fieldName: i } = e;
|
|
@@ -509,17 +524,17 @@ class ge extends W {
|
|
|
509
524
|
} : void 0;
|
|
510
525
|
if (i)
|
|
511
526
|
return i;
|
|
512
|
-
const
|
|
527
|
+
const r = this.getPopupTemplateFieldInfo();
|
|
513
528
|
return h.convertNumberFormatToIntlOptions({
|
|
514
|
-
digitSeparator:
|
|
515
|
-
places:
|
|
529
|
+
digitSeparator: r?.format?.digitSeparator ?? !0,
|
|
530
|
+
places: r?.format?.places ?? 2
|
|
516
531
|
});
|
|
517
532
|
}
|
|
518
533
|
getIntlDateTimeFormattingOptions(e, t) {
|
|
519
534
|
const i = this.getCurrentFieldFormat();
|
|
520
535
|
if (!t?.useFieldFormatting)
|
|
521
|
-
return i ? t?.isTimeOnly ?
|
|
522
|
-
const
|
|
536
|
+
return i ? t?.isTimeOnly ? le : oe : h.convertDateFormatToIntlOptions(e);
|
|
537
|
+
const r = i ? {
|
|
523
538
|
dateStyle: t?.isTimeOnly ? void 0 : i.dateStyle ?? void 0,
|
|
524
539
|
// year/month is overridden if dateStyle is set
|
|
525
540
|
year: i.dateStyle ? void 0 : i.year ?? void 0,
|
|
@@ -527,21 +542,25 @@ class ge extends W {
|
|
|
527
542
|
timeStyle: i.timeStyle ?? void 0,
|
|
528
543
|
hourCycle: i.hour12 === "never" ? "h23" : "h11"
|
|
529
544
|
} : void 0;
|
|
530
|
-
if (
|
|
531
|
-
return
|
|
545
|
+
if (r)
|
|
546
|
+
return r;
|
|
532
547
|
const s = this.getPopupTemplateFieldInfo();
|
|
533
548
|
return h.convertDateFormatToIntlOptions(s?.format?.dateFormat ?? e);
|
|
534
549
|
}
|
|
535
550
|
originalLayerSupportsFieldConfigs() {
|
|
536
551
|
const { layer: e } = this;
|
|
537
|
-
return
|
|
552
|
+
return P.supportsFieldConfiguration(e);
|
|
538
553
|
}
|
|
539
554
|
getPopupTemplateFieldInfo() {
|
|
540
555
|
const { props: e } = this, { layer: t, fieldName: i } = e;
|
|
541
556
|
return ("popupTemplate" in t ? t.popupTemplate : void 0)?.fieldInfos?.find((s) => s.fieldName === i);
|
|
542
557
|
}
|
|
558
|
+
isFinished(e) {
|
|
559
|
+
return ["success", "failed"].includes(e);
|
|
560
|
+
}
|
|
543
561
|
render() {
|
|
544
562
|
return this._propWatcherTask.render({
|
|
563
|
+
pending: () => c`<calcite-scrim loading></calcite-scrim>`,
|
|
545
564
|
complete: () => {
|
|
546
565
|
const { props: e } = this, { fieldInfo: t } = e;
|
|
547
566
|
return t ? c`<div class="container">${this.renderFieldType()}${this.renderFieldAlias()}${this.renderFieldDescription()}${this.renderFieldValueType()}${this.renderFieldSampleValue()}${this.renderFieldNumericFormat()}${this.renderFieldStatistics()}</div>` : "";
|
|
@@ -550,69 +569,73 @@ class ge extends W {
|
|
|
550
569
|
});
|
|
551
570
|
}
|
|
552
571
|
renderFieldType() {
|
|
553
|
-
const { _messages: e, props: t } = this, { fieldInfo: i } = t,
|
|
554
|
-
return c`<div class="section"><div class="title">${e.fieldType}</div><div>${
|
|
572
|
+
const { _messages: e, props: t } = this, { fieldInfo: i } = t, r = this._getFieldTypeLabel(i.layerField.type);
|
|
573
|
+
return c`<div class="section"><div class="title">${e.fieldType}</div><div>${r}</div></div>`;
|
|
555
574
|
}
|
|
556
575
|
renderFieldAlias() {
|
|
557
|
-
const { _messages: e, props: t, hideAlias: i } = this, { fieldInfo:
|
|
558
|
-
return i ? "" : c`<div class="section"><div class="title">${e.fieldAlias}</div><div>${
|
|
576
|
+
const { _messages: e, props: t, hideAlias: i } = this, { fieldInfo: r } = t;
|
|
577
|
+
return i ? "" : c`<div class="section"><div class="title">${e.fieldAlias}</div><div>${r.label}</div></div>`;
|
|
559
578
|
}
|
|
560
579
|
renderFieldDescription() {
|
|
561
580
|
const { _messages: e, props: t } = this, { layer: i } = t;
|
|
562
|
-
if (!
|
|
581
|
+
if (!y(i))
|
|
563
582
|
return "";
|
|
564
|
-
const { fieldInfo:
|
|
565
|
-
return c`<div class="section"><div class="title">${e.fieldDescription}</div><div class=${
|
|
583
|
+
const { fieldInfo: r } = t, s = r.layerField.description;
|
|
584
|
+
return c`<div class="section"><div class="title">${e.fieldDescription}</div><div class=${C({
|
|
566
585
|
missing: !s
|
|
567
586
|
})}>${s || e.fieldDescriptionNotSet}</div></div>`;
|
|
568
587
|
}
|
|
569
588
|
renderFieldValueType() {
|
|
570
589
|
const { _messages: e, props: t } = this, { layer: i } = t;
|
|
571
|
-
if (!
|
|
590
|
+
if (!y(i))
|
|
572
591
|
return "";
|
|
573
|
-
const { fieldInfo:
|
|
574
|
-
return c`<div class="section"><div class="title">${e.fieldValueType}</div><div class=${
|
|
592
|
+
const { fieldInfo: r } = t, s = this._getFieldValueTypeCamelCase(r);
|
|
593
|
+
return c`<div class="section"><div class="title">${e.fieldValueType}</div><div class=${C(s ? "" : "missing")}>${s ? e.fieldValueTypes[s] : e.fieldValueTypeNotSet}</div></div>`;
|
|
575
594
|
}
|
|
576
595
|
renderFieldSampleValue() {
|
|
577
|
-
const { oneFeatureResponse: e, oneFeatureResponseStatus: t, statisticsStatus: i, statistics:
|
|
596
|
+
const { oneFeatureResponse: e, oneFeatureResponseStatus: t, statisticsStatus: i, statistics: r, uniqueValuesStatus: s, uniqueValues: l, _messages: m, props: n } = this, { layer: d, fieldName: o, fieldInfo: u } = n, { statistics: g } = m;
|
|
578
597
|
let p;
|
|
579
|
-
if (
|
|
598
|
+
if (F(d) || T(d) || !w(d) && ["string", "oid", "guid"].includes(this._getStatisticsType(u)) && s !== "failed")
|
|
580
599
|
return "";
|
|
581
|
-
t === "success" ? e.features.forEach((
|
|
582
|
-
(p === void 0 || p === null &&
|
|
583
|
-
}) : i === "success" ? p =
|
|
584
|
-
const
|
|
585
|
-
return f(p) && (
|
|
600
|
+
t === "success" ? e.features.forEach((v) => {
|
|
601
|
+
(p === void 0 || p === null && v.attributes[o] !== null) && (p = v.attributes[o]);
|
|
602
|
+
}) : i === "success" ? p = r?.min ?? void 0 : s === "success" && (p = l?.uniqueValueInfos?.[0]?.value ?? l?.uniqueValueInfos?.[1]?.value ?? void 0);
|
|
603
|
+
const S = u.codedValues;
|
|
604
|
+
return f(p) && (S ? p = S.find((v) => p === v.code)?.name || p : p = this._getDisplayString(p, { useFieldFormatting: !0 })), c`<div class="section"><div class="title">${m.fieldSampleValue}</div><div class=${C(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
605
|
}
|
|
587
606
|
renderFieldNumericFormat() {
|
|
588
|
-
const { _messages: e, props: t, hideNumericFormat: i } = this, { fieldName:
|
|
607
|
+
const { _messages: e, props: t, hideNumericFormat: i } = this, { fieldName: r, fieldInfo: s, layer: l } = t;
|
|
589
608
|
if (i || !["double", "long", "single"].includes(s.layerField.type))
|
|
590
609
|
return "";
|
|
591
|
-
const m = this.originalLayerSupportsFieldConfigs() ?
|
|
610
|
+
const m = this.originalLayerSupportsFieldConfigs() ? l.getFieldConfiguration(r) : void 0;
|
|
592
611
|
if (m?.fieldFormat) {
|
|
593
|
-
const { minimumFractionDigits:
|
|
594
|
-
return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldMinimumFractionDigits.replace("${number}",
|
|
612
|
+
const { minimumFractionDigits: d, maximumFractionDigits: o } = m.fieldFormat;
|
|
613
|
+
return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldMinimumFractionDigits.replace("${number}", d.toString())}</div><div>${e.fieldMaximumFractionDigits.replace("${number}", o.toString())}</div></div>`;
|
|
595
614
|
}
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
600
|
-
const
|
|
601
|
-
if (f(
|
|
602
|
-
const
|
|
603
|
-
return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldNumDecimalPlaces.replace("${number}",
|
|
615
|
+
const n = "popupTemplate" in l ? l.popupTemplate : void 0;
|
|
616
|
+
if (n?.fieldInfos) {
|
|
617
|
+
const d = n.fieldInfos?.filter((o) => o.fieldName === r);
|
|
618
|
+
if (d?.length) {
|
|
619
|
+
const o = d[0];
|
|
620
|
+
if (f(o?.format?.places)) {
|
|
621
|
+
const u = o.format.places;
|
|
622
|
+
return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldNumDecimalPlaces.replace("${number}", u.toString())}</div></div>`;
|
|
604
623
|
}
|
|
605
624
|
}
|
|
606
625
|
}
|
|
607
626
|
return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div class="missing">${e.fieldDecimalPlacesNotAvailable}</div></div>`;
|
|
608
627
|
}
|
|
609
628
|
renderFieldStatistics() {
|
|
610
|
-
const { statisticsStatus: e, uniqueValuesStatus: t, hideStatistics: i, _messages:
|
|
611
|
-
return i ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") :
|
|
629
|
+
const { statisticsStatus: e, uniqueValuesStatus: t, hideStatistics: i, _messages: r, props: s } = this, { layer: l, fieldInfo: m } = s;
|
|
630
|
+
return i ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : k(l) || E(l) || w(l) || F(l) || T(l) || ["long"].includes(m.layerField.type) ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : c`<div class="section"><div class="title">${r.fieldStatistics}</div>${!this.isFinished(t) && !this.isFinished(e) ? this.renderWaitingForStatistics() : e === "failed" && t === "failed" ? this.renderNoStatistics() : this.renderStatistics()}</div>`;
|
|
631
|
+
}
|
|
632
|
+
renderWaitingForStatistics() {
|
|
633
|
+
const { _messages: e } = this;
|
|
634
|
+
return $("field-info-statistics-content", c`<div class="missing">${e.fieldStatisticsRetrieving}</div>`);
|
|
612
635
|
}
|
|
613
636
|
renderNoStatistics() {
|
|
614
637
|
const { _messages: e } = this;
|
|
615
|
-
return
|
|
638
|
+
return $("field-info-statistics-content", c`<div class="missing" ${b(this._setCompleteRef)}>${e.fieldStatisticsNotAvailable}</div>`);
|
|
616
639
|
}
|
|
617
640
|
renderStatistics() {
|
|
618
641
|
const { props: e } = this, { fieldInfo: t } = e;
|
|
@@ -633,60 +656,60 @@ class ge extends W {
|
|
|
633
656
|
}
|
|
634
657
|
}
|
|
635
658
|
renderNumberStatistics() {
|
|
636
|
-
const { statistics: e,
|
|
659
|
+
const { statistics: e, uniqueValuesStatus: t, statisticsStatus: i, _messages: r } = this;
|
|
637
660
|
if (!e)
|
|
638
|
-
return this.renderNoStatistics();
|
|
639
|
-
const { statistics:
|
|
640
|
-
return c`<div><div class="statistics-row"><div>${
|
|
661
|
+
return this.isFinished(t) && this.isFinished(i) ? this.renderNoStatistics() : this.renderWaitingForStatistics();
|
|
662
|
+
const { statistics: s } = r;
|
|
663
|
+
return $("field-info-statistics-content", c`<div ${b(this._setCompleteRef)}><div class="statistics-row"><div>${s.numberOfValues}</div><div class="data">${this._printNumValue(e.totalCount)}</div></div>${f(e.sum) ? c`<div class="statistics-row"><div>${s.sumOfValues}</div><div class="data">${this._printNumValue(e.sum)}</div></div>` : null}${f(e.min) ? c`<div class="statistics-row"><div>${s.minimum}</div><div class="data">${this._printNumValue(e.min)}</div></div>` : null}${f(e.max) ? c`<div class="statistics-row"><div>${s.maximum}</div><div class="data">${this._printNumValue(e.max)}</div></div>` : null}${f(e.avg) ? c`<div class="statistics-row"><div>${s.average}</div><div class="data">${this._printNumValue(e.avg)}</div></div>` : null}${f(e.stddev) ? c`<div class="statistics-row"><div>${s.standardDeviation}</div><div class="data">${this._printNumValue(e.stddev)}</div></div>` : null}${this.renderNullValues()}</div>`);
|
|
641
664
|
}
|
|
642
665
|
renderStringStatistics() {
|
|
643
|
-
const { statistics: e, uniqueValuesStatus: t, _messages: i } = this, { statistics:
|
|
644
|
-
return c`<div><div class="statistics-row"><div>${
|
|
666
|
+
const { statistics: e, uniqueValuesStatus: t, _messages: i } = this, { statistics: r } = i;
|
|
667
|
+
return $("field-info-statistics-content", c`<div ${b(this._setCompleteRef)}><div class="statistics-row"><div>${r.numberOfValues}</div>${t !== "success" ? c`<div class="missing">--</div>` : c`<div class="data">${this._printNumValue(e?.totalCount)}</div>`}</div>${this.renderNullValues()}${this.renderTopValues()}</div>`);
|
|
645
668
|
}
|
|
646
669
|
renderDateStatistics() {
|
|
647
|
-
const { statistics: e, view: t, props: i, _messages:
|
|
670
|
+
const { statistics: e, view: t, props: i, uniqueValuesStatus: r, statisticsStatus: s, _messages: l } = this, { fieldInfo: m } = i;
|
|
648
671
|
if (!e || !f(e.max) || !f(e.min))
|
|
649
|
-
return this.renderNoStatistics();
|
|
650
|
-
const { statistics:
|
|
651
|
-
let
|
|
652
|
-
|
|
653
|
-
let
|
|
654
|
-
|
|
655
|
-
const
|
|
656
|
-
return c`<div><div class="statistics-row"><div>${
|
|
672
|
+
return this.isFinished(r) && this.isFinished(s) ? this.renderNoStatistics() : this.renderWaitingForStatistics();
|
|
673
|
+
const { statistics: n } = l, d = e.max - e.min, o = Math.floor(d / 31536e6);
|
|
674
|
+
let u = Math.floor((d - o * 31536e6) / 2628e6), g = Math.ceil((d - u * 2628e6) / 864e5);
|
|
675
|
+
g >= 30 && (u += 1, g = 0);
|
|
676
|
+
let p = o === 1 ? n.timeSpanOptions.year : o > 1 ? n.timeSpanOptions.years.replace("${years}", o.toString()) : "";
|
|
677
|
+
p += o > 0 && (u > 0 || g > 0) ? ", " : "", p += u === 1 ? n.timeSpanOptions.month : u > 1 ? n.timeSpanOptions.months.replace("${months}", u.toString()) : "", p += u > 0 && g > 0 ? ", " : "", p += g === 1 ? n.timeSpanOptions.day : g > 1 ? n.timeSpanOptions.days.replace("${days}", g.toString()) : "";
|
|
678
|
+
const S = m.simpleFieldType !== "timestamp-offset" || !t || t.timeZone !== "unknown", v = m.simpleFieldType === "time-only";
|
|
679
|
+
return $("field-info-statistics-content", c`<div ${b(this._setCompleteRef)}><div class="statistics-row"><div>${n.numberOfValues}</div><div class="data">${this._printNumValue(e?.totalCount)}</div></div>${S && f(e.min) ? c`<div class="statistics-row"><div>${v ? n.minimumTime : n.minimumDate}</div><div class="data">${this._getDisplayString(e.min)}</div></div>` : null}${S && f(e.max) ? c`<div class="statistics-row"><div>${v ? n.maximumTime : n.maximumDate}</div><div class="data">${this._getDisplayString(e.max)}</div></div>` : null}${S && f(e.avg) ? c`<div class="statistics-row"><div>${v ? n.averageTime : n.averageDate}</div><div class="data">${this._getDisplayString(e.avg)}</div></div>` : null}${S && !v && f(e.min) && f(e.max) && d > 0 ? c`<div class="statistics-row"><div>${n.timespan}</div><div class="data">${p}</div></div>` : null}${this.renderNullValues()}</div>`);
|
|
657
680
|
}
|
|
658
681
|
renderTopValues() {
|
|
659
|
-
const { uniqueValues: e, uniqueValuesStatus: t, _messages: i, props:
|
|
682
|
+
const { uniqueValues: e, uniqueValuesStatus: t, _messages: i, props: r } = this, { fieldInfo: s } = r, { statistics: l } = i;
|
|
660
683
|
if (e?.uniqueValueInfos?.length) {
|
|
661
684
|
const m = e.uniqueValueInfos;
|
|
662
|
-
m.sort((
|
|
663
|
-
const
|
|
664
|
-
let
|
|
665
|
-
return
|
|
666
|
-
|
|
667
|
-
}) :
|
|
685
|
+
m.sort((o, u) => o.count < u.count ? 1 : o.count > u.count ? -1 : 0);
|
|
686
|
+
const n = s.codedValues, d = m.filter((o) => o.value !== null).filter((o, u) => o && u < 10).map((o) => {
|
|
687
|
+
let u = o.value;
|
|
688
|
+
return n ? n.forEach((g) => {
|
|
689
|
+
u === g.code && (u = g.name);
|
|
690
|
+
}) : u = this._getDisplayString(u), c`<div class="statistics-row"><div class="data">${`${u}`}</div><div class="count">${this._printNumValue(o.count)}</div></div>`;
|
|
668
691
|
});
|
|
669
|
-
return
|
|
692
|
+
return d.length ? c`<div><div class="statistics-row-top-values"><div>${m.length > 10 ? l.topTenValues : l.topValues}</div><div>${l.count}</div></div>${d}</div>` : "";
|
|
670
693
|
} else
|
|
671
|
-
return c`<div><div class="statistics-row-top-values"><div>${
|
|
694
|
+
return c`<div><div class="statistics-row-top-values"><div>${l.topValues}</div><div>${l.count}</div></div><div class="statistics-row"><div class="missing">${t === "failed" ? i.fieldUniqueValuesNotAvailable : i.fieldSampleRetrieving}</div></div></div>`;
|
|
672
695
|
}
|
|
673
696
|
renderNullValues() {
|
|
674
|
-
const { statistics: e, uniqueValues: t, _messages: i } = this, { statistics:
|
|
697
|
+
const { statistics: e, uniqueValues: t, _messages: i } = this, { statistics: r } = i;
|
|
675
698
|
let s = e?.nullcount;
|
|
676
699
|
if (!f(s) && t) {
|
|
677
|
-
const
|
|
678
|
-
for (let m = 0; m <
|
|
679
|
-
const
|
|
680
|
-
if (
|
|
681
|
-
s =
|
|
700
|
+
const l = t.uniqueValueInfos;
|
|
701
|
+
for (let m = 0; m < l.length; m++) {
|
|
702
|
+
const n = l[m];
|
|
703
|
+
if (n.value === null) {
|
|
704
|
+
s = n.count;
|
|
682
705
|
break;
|
|
683
706
|
}
|
|
684
707
|
}
|
|
685
708
|
}
|
|
686
|
-
return c`<div class="statistics-row"><div>${
|
|
709
|
+
return c`<div class="statistics-row"><div>${r.numberOfNulls}</div>${f(s) ? c`<div class="data">${this._printNumValue(s)}</div>` : c`<div class="missing">--</div>`}</div>`;
|
|
687
710
|
}
|
|
688
711
|
}
|
|
689
|
-
|
|
712
|
+
H("arcgis-field-info", Fe);
|
|
690
713
|
export {
|
|
691
|
-
|
|
714
|
+
Fe as ArcgisFieldInfo
|
|
692
715
|
};
|