@arcgis/common-components 5.1.0-next.6 → 5.1.0-next.60
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/README.md +24 -1
- package/dist/cdn/{4DCAUWTC.js → 5EKB3CUO.js} +1 -1
- package/dist/cdn/7AMLQYVM.js +4 -0
- package/dist/cdn/7JIHCVH3.js +2 -0
- package/dist/cdn/{YVSTPEPS.js → ALWVIWUC.js} +1 -1
- package/dist/cdn/{AXTSUI2Q.js → DLNJ7OOB.js} +1 -1
- package/dist/cdn/{7CI55VCH.js → DWXXQFPQ.js} +1 -1
- package/dist/cdn/{J5X5TNVW.js → DX3WIISQ.js} +1 -1
- package/dist/cdn/{C6JAR4IN.js → DYZ3HBS2.js} +1 -1
- package/dist/cdn/{7HQMPKZO.js → E4EVLDYS.js} +1 -1
- package/dist/cdn/{ZOWIFVL3.js → HEQCNDQR.js} +1 -1
- package/dist/cdn/MB7UDGWW.js +2 -0
- package/dist/cdn/MIIXLLQJ.js +2 -0
- package/dist/cdn/{3O7GAC23.js → N4R5SMWN.js} +1 -1
- package/dist/cdn/SDI7RS6X.js +2 -0
- package/dist/cdn/{XEB2RUND.js → SF2NJOD3.js} +1 -1
- package/dist/cdn/{ZLXAKPUH.js → SW77BUCP.js} +1 -1
- package/dist/cdn/V5Y3VGWN.js +2 -0
- package/dist/cdn/{7PB2GGQH.js → W2DRQHS5.js} +1 -1
- package/dist/cdn/{4CW7U27R.js → WOLQO3JI.js} +1 -1
- package/dist/cdn/{7Y42J3JI.js → YOEHJTF2.js} +1 -1
- package/dist/cdn/{23DDMSOB.js → ZCGHCFFN.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/commonFunctions.js +7 -3
- package/dist/components/arcgis-ckeditor5/customElement.d.ts +1 -0
- package/dist/components/arcgis-ckeditor5/types.d.ts +9 -0
- package/dist/components/arcgis-ckeditor5-popover/customElement.d.ts +1 -0
- package/dist/components/arcgis-ckeditor5-popover/customElement.js +1 -1
- package/dist/components/arcgis-color-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-info/customElement.d.ts +3 -2
- package/dist/components/arcgis-field-info/utils/basic.d.ts +21 -2
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +4 -3
- package/dist/components/arcgis-field-pick-list/customElement.js +1 -1
- package/dist/components/arcgis-field-pick-list/utils/types.d.ts +25 -3
- package/dist/components/arcgis-histogram/customElement.d.ts +21 -21
- package/dist/components/arcgis-histogram/customElement.js +81 -90
- package/dist/components/arcgis-histogram/types.d.ts +1 -3
- package/dist/components/arcgis-label-input/customElement.d.ts +6 -6
- package/dist/components/arcgis-label-input/customElement.js +22 -17
- package/dist/components/arcgis-picker-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-picker-input/customElement.js +11 -11
- package/dist/components/arcgis-ramp-color/customElement.d.ts +2 -0
- package/dist/components/arcgis-ramp-color-break/customElement.d.ts +2 -0
- package/dist/components/arcgis-ramp-opacity/customElement.d.ts +1 -0
- package/dist/components/arcgis-slider/customElement.d.ts +52 -51
- package/dist/components/arcgis-slider/customElement.js +382 -343
- package/dist/components/arcgis-slider-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-ticks/customElement.d.ts +8 -14
- package/dist/components/arcgis-ticks/customElement.js +1 -1
- package/dist/components/arcgis-ticks/types.d.ts +23 -0
- package/dist/components/arcgis-unique-values-list/customElement.d.ts +14 -5
- package/dist/components/arcgis-unique-values-list/customElement.js +158 -151
- package/dist/components/arcgis-unique-values-list/utils/basic.d.ts +14 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/dist/utils/types.d.ts +24 -7
- package/package.json +5 -5
- package/dist/cdn/2BDHDUXG.js +0 -2
- package/dist/cdn/57I35HLF.js +0 -2
- package/dist/cdn/6DQVLQL6.js +0 -2
- package/dist/cdn/EKKJN7WZ.js +0 -2
- package/dist/cdn/UTXWKXMT.js +0 -4
- package/dist/cdn/ZL3E4ZGE.js +0 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
|
-
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
3
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
+
import type { Layout, TickMode, TickValues } from "./types.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The ticks component displays visual markers along a line to indicate scale, intervals, or specific values. It is often used in conjunction with the
|
|
7
|
-
* [Slider component](https://developers.arcgis.com/javascript/latest/references/common-components/arcgis-slider/). Ticks help users understand the
|
|
7
|
+
* [Slider component](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/). Ticks help users understand the
|
|
8
8
|
* slider’s range and make more precise selections.
|
|
9
9
|
*
|
|
10
|
-
* Tick placement is controlled by the [mode](
|
|
11
|
-
* line. Tick positions are derived from the component’s [min](
|
|
12
|
-
* [interpolationExponent](
|
|
13
|
-
* The component can also be made [interactive](
|
|
10
|
+
* Tick placement is controlled by the [mode](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#mode), which defines how the [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) are parsed and translated into positions along the
|
|
11
|
+
* line. Tick positions are derived from the component’s [min](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#min) and [max](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#max) range, with optional none-linear scaling via
|
|
12
|
+
* [interpolationExponent](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#interpolationExponent). Ticks can be displayed in vertical or horizontal [layout](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#layout), with optional [showLabels](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#showLabels) and a [showBaseline](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#showBaseline).
|
|
13
|
+
* The component can also be made [interactive](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#interactive) to respond to user clicks on individual ticks. The [labelFormatter](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#labelFormatter) property allows customization of tick label formatting.
|
|
14
14
|
*
|
|
15
15
|
* @cssproperty [--arcgis-ticks-tick-length] - Specifies the length of the ticks.
|
|
16
16
|
* @cssproperty [--arcgis-ticks-tick-color] - Specifies the color of the ticks.
|
|
@@ -65,7 +65,7 @@ export abstract class ArcgisTicks extends LitElement {
|
|
|
65
65
|
* };
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
|
-
accessor labelFormatter: (
|
|
68
|
+
accessor labelFormatter: (value: number, defaultFormatter: (value: number) => string) => string | null | undefined;
|
|
69
69
|
/**
|
|
70
70
|
* Determines whether the labels are placed before or after the ticks.
|
|
71
71
|
*
|
|
@@ -186,10 +186,4 @@ export abstract class ArcgisTicks extends LitElement {
|
|
|
186
186
|
readonly "@eventTypes": {
|
|
187
187
|
arcgisTickClick: ArcgisTicks["arcgisTickClick"]["detail"];
|
|
188
188
|
};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export type Layout = "horizontal" | "vertical";
|
|
192
|
-
|
|
193
|
-
export type TickMode = "count" | "percent" | "value";
|
|
194
|
-
|
|
195
|
-
export type TickValues = number[] | number;
|
|
189
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as $ } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as M, html as c } from "lit";
|
|
4
|
-
import { LitElement as _, createEvent as C, safeClassMap as h,
|
|
4
|
+
import { LitElement as _, createEvent as C, safeClassMap as h, nothing as v, safeStyleMap as u } from "@arcgis/lumina";
|
|
5
5
|
import { formatNumber as z } from "@arcgis/core/intl.js";
|
|
6
6
|
const n = {
|
|
7
7
|
container: "container",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The layout of the [arcgis-ticks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/) component, which determines the orientation of the ticks.
|
|
3
|
+
*
|
|
4
|
+
* @since 5.0
|
|
5
|
+
*/
|
|
6
|
+
export type Layout = "horizontal" | "vertical";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The mode of positioning ticks along the [arcgis-ticks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/) component. It drives how [arcgis-ticks.values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is interpreted.
|
|
10
|
+
* - `count`: Places a fixed number of ticks (provided in the [arcgis-ticks.values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) property) at equal distances from each other.
|
|
11
|
+
* - `percent`: [arcgis-ticks.values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is interpreted as percentage. If [arcgis-ticks.values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is a number, it indicates the interval between ticks. If it is an array, it indicates the percentage values at which to place the ticks.
|
|
12
|
+
* - `value`: Indicates that ticks will only be placed at the values specified in the property.
|
|
13
|
+
*
|
|
14
|
+
* @since 5.0
|
|
15
|
+
*/
|
|
16
|
+
export type TickMode = "count" | "percent" | "value";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Indicates where ticks will be rendered along the [arcgis-ticks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/) component.
|
|
20
|
+
*
|
|
21
|
+
* @since 5.0
|
|
22
|
+
*/
|
|
23
|
+
export type TickValues = number[] | number;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
|
-
|
|
2
|
+
import type SceneView from "@arcgis/core/views/SceneView.js";
|
|
3
|
+
import type MapView from "@arcgis/core/views/MapView.js";
|
|
3
4
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
5
|
+
import type { UniqueValueCountInfo } from "@arcgis/core/smartMapping/statistics/types.js";
|
|
4
6
|
import type { SupportedLayer } from "./utils/basic.js";
|
|
7
|
+
import type { VisualizationSource } from "../../utils/types.js";
|
|
5
8
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
6
9
|
|
|
7
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Displays a list of unique values taking into account field type formatting and field domains.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
8
15
|
export abstract class ArcgisUniqueValuesList extends LitElement {
|
|
9
16
|
/** @internal */
|
|
10
17
|
protected _messages: {
|
|
@@ -81,15 +88,17 @@ export abstract class ArcgisUniqueValuesList extends LitElement {
|
|
|
81
88
|
* List of all unique values. If not provided component will get the unique values from the layer.
|
|
82
89
|
* An empty list would mean that there are no unique values for this field on the layer. The component renders nothing then.
|
|
83
90
|
*/
|
|
84
|
-
accessor uniqueValues:
|
|
91
|
+
accessor uniqueValues: UniqueValueCountInfo[] | undefined;
|
|
85
92
|
/** MapView instance, required if uniqueValues is not provided and/or to display dates in the correct timezone */
|
|
86
|
-
accessor view:
|
|
93
|
+
accessor view: MapView | SceneView | undefined;
|
|
94
|
+
/** Optional, specify visualization source other than the layer itself. */
|
|
95
|
+
accessor visualizationSource: VisualizationSource | undefined;
|
|
87
96
|
/**
|
|
88
97
|
* Get all unique values.
|
|
89
98
|
* E.g. to be used to limit how often these unique values need to be requested from the layer.
|
|
90
99
|
*/
|
|
91
100
|
getUniqueValues(): Promise<{
|
|
92
|
-
uniqueValues:
|
|
101
|
+
uniqueValues: UniqueValueCountInfo[];
|
|
93
102
|
partialUniqueValues: boolean;
|
|
94
103
|
} | undefined>;
|
|
95
104
|
/** Sets focus on component */
|
|
@@ -1,127 +1,127 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { keyed as
|
|
5
|
-
import { LitElement as
|
|
2
|
+
import { c as _ } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as M, html as S } from "lit";
|
|
4
|
+
import { keyed as P } from "lit/directives/keyed.js";
|
|
5
|
+
import { LitElement as W, createEvent as F } from "@arcgis/lumina";
|
|
6
6
|
import { Task as H } from "@lit/task";
|
|
7
|
-
import { createRef as
|
|
8
|
-
import { log as
|
|
9
|
-
import { formatDate as
|
|
10
|
-
import
|
|
11
|
-
import { clone as
|
|
12
|
-
import { i as h } from "../../chunks/commonFunctions.js";
|
|
13
|
-
import { u as
|
|
14
|
-
function
|
|
7
|
+
import { createRef as G, ref as T } from "lit/directives/ref.js";
|
|
8
|
+
import { log as w, composeMissingPropertyMessage as N } from "@arcgis/toolkit/log";
|
|
9
|
+
import { formatDate as D, convertDateFormatToIntlOptions as b, formatDateOnly as J, formatTimeOnly as K, formatTimestamp as x, formatNumber as Q } from "@arcgis/core/intl.js";
|
|
10
|
+
import X from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
11
|
+
import { clone as I } from "@arcgis/core/core/lang.js";
|
|
12
|
+
import { g as Z, i as h } from "../../chunks/commonFunctions.js";
|
|
13
|
+
import { u as Y } from "../../chunks/useT9n.js";
|
|
14
|
+
function U(i) {
|
|
15
15
|
return (/* @__PURE__ */ new Date(`1970-01-01T${i}Z`)).getTime();
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function L(i) {
|
|
18
18
|
return (/* @__PURE__ */ new Date(`${i} 00:00:00`)).getTime();
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
let
|
|
22
|
-
return e === "unknown" ?
|
|
23
|
-
...
|
|
20
|
+
function ee(i, e, s) {
|
|
21
|
+
let t;
|
|
22
|
+
return e === "unknown" ? t = D(i, {
|
|
23
|
+
...b("short-date-short-time"),
|
|
24
24
|
timeZone: "utc",
|
|
25
25
|
timeZoneName: "shortOffset"
|
|
26
|
-
}) :
|
|
27
|
-
...
|
|
26
|
+
}) : t = D(i, {
|
|
27
|
+
...b("short-date-short-time"),
|
|
28
28
|
timeZone: e
|
|
29
|
-
}),
|
|
30
|
-
}
|
|
31
|
-
function ee(i) {
|
|
32
|
-
return i ? G(i, v("short-date")) : "";
|
|
29
|
+
}), t;
|
|
33
30
|
}
|
|
34
31
|
function te(i) {
|
|
32
|
+
return i ? J(i, b("short-date")) : "";
|
|
33
|
+
}
|
|
34
|
+
function ie(i) {
|
|
35
35
|
let e;
|
|
36
|
-
return typeof i == "string" ? e =
|
|
37
|
-
...
|
|
36
|
+
return typeof i == "string" ? e = K(i, b("short-date-long-time")) : e = D(i, {
|
|
37
|
+
...b("long-time"),
|
|
38
38
|
timeZone: "utc"
|
|
39
39
|
}), e;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return typeof i == "string" ? e && "timeZone" in e && e.timeZone === "unknown" ?
|
|
43
|
-
...
|
|
41
|
+
function se(i, e) {
|
|
42
|
+
return typeof i == "string" ? e && "timeZone" in e && e.timeZone === "unknown" ? x(i, {
|
|
43
|
+
...b("short-date-short-time"),
|
|
44
44
|
timeZone: "utc",
|
|
45
45
|
timeZoneName: "shortOffset"
|
|
46
|
-
}) :
|
|
47
|
-
...
|
|
46
|
+
}) : x(i, {
|
|
47
|
+
...b("short-date-short-time"),
|
|
48
48
|
timeZone: e && "timeZone" in e && e.timeZone ? e.timeZone : "system"
|
|
49
|
-
}) : e && "timeZone" in e && e.timeZone === "unknown" ?
|
|
50
|
-
...
|
|
49
|
+
}) : e && "timeZone" in e && e.timeZone === "unknown" ? D(i, {
|
|
50
|
+
...b("short-date-short-time"),
|
|
51
51
|
timeZone: "utc",
|
|
52
52
|
timeZoneName: "shortOffset"
|
|
53
|
-
}) :
|
|
54
|
-
...
|
|
53
|
+
}) : D(i, {
|
|
54
|
+
...b("short-date-short-time"),
|
|
55
55
|
timeZone: e && "timeZone" in e && e.timeZone ? e.timeZone : "system"
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function z(i, e, s) {
|
|
59
59
|
if (i.type !== "feature" && i.type !== "subtype-group" && i.type !== "subtype-sublayer" && i.type !== "imagery")
|
|
60
60
|
return;
|
|
61
61
|
let t;
|
|
62
|
-
return i.fields.forEach((
|
|
63
|
-
const
|
|
64
|
-
if (i.type !== "imagery" && i.subtypeField ===
|
|
65
|
-
let
|
|
66
|
-
i.type === "subtype-group" || i.type === "feature" ?
|
|
67
|
-
i.type === "subtype-sublayer" && i.subtypeCode !==
|
|
68
|
-
if (e.name ===
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
t = t || [], t.forEach((
|
|
73
|
-
|
|
74
|
-
}),
|
|
62
|
+
return Z(i, s).fields.forEach((p) => {
|
|
63
|
+
const a = p.name, r = "domain" in p ? p.domain : void 0;
|
|
64
|
+
if (i.type !== "imagery" && i.subtypeField === a) {
|
|
65
|
+
let c;
|
|
66
|
+
i.type === "subtype-group" || i.type === "feature" ? c = i.subtypes : c = i.parent.subtypes, c.forEach((l) => {
|
|
67
|
+
i.type === "subtype-sublayer" && i.subtypeCode !== l.code || (e.name === a && (t = t || [], t.push({ code: l.code, name: l.name })), l.domains && Object.keys(l.domains).forEach((d) => {
|
|
68
|
+
if (e.name === d) {
|
|
69
|
+
const o = l.domains[d];
|
|
70
|
+
o?.type === "coded-value" && o?.codedValues && o.codedValues.forEach((n) => {
|
|
71
|
+
let g = !1;
|
|
72
|
+
t = t || [], t.forEach((v) => {
|
|
73
|
+
v.code === n.code && (g = !0, `| ${v.name} |`.includes(`| ${n.name} |`) || (v.name += ` | ${n.name}`));
|
|
74
|
+
}), g || t.push({ code: n.code, name: n.name });
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
}));
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
if (e.name ===
|
|
81
|
-
const
|
|
82
|
-
i.type === "feature" &&
|
|
83
|
-
(
|
|
80
|
+
if (e.name === a && (i.type === "feature" || i.type === "imagery")) {
|
|
81
|
+
const c = i.type === "feature" ? i.typeIdField : void 0, l = i.type === "feature" ? i.types : void 0;
|
|
82
|
+
i.type === "feature" && c && l ? (c === a ? t = l.map(
|
|
83
|
+
(d) => (
|
|
84
84
|
// fake coded Values
|
|
85
85
|
{
|
|
86
|
-
code:
|
|
87
|
-
name:
|
|
86
|
+
code: d.id,
|
|
87
|
+
name: d.name
|
|
88
88
|
}
|
|
89
89
|
)
|
|
90
|
-
) : (t = t || [],
|
|
91
|
-
if (!
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
let
|
|
95
|
-
t.forEach((
|
|
96
|
-
|
|
97
|
-
}),
|
|
90
|
+
) : (t = t || [], l.forEach((d) => {
|
|
91
|
+
if (!d.domains?.[a] || d.domains[a].type === "inherited") {
|
|
92
|
+
const o = r;
|
|
93
|
+
o?.codedValues && o.codedValues.forEach((n) => {
|
|
94
|
+
let g = !1;
|
|
95
|
+
t.forEach((v) => {
|
|
96
|
+
v.code === n.code && (g = !0, `| ${v.name} |`.includes(`| ${n.name} |`) || (v.name += ` | ${n.name}`));
|
|
97
|
+
}), g || t.push(I(n));
|
|
98
98
|
});
|
|
99
|
-
} else
|
|
100
|
-
let
|
|
101
|
-
t.forEach((
|
|
102
|
-
|
|
103
|
-
}),
|
|
99
|
+
} else d.domains?.[a]?.codedValues && d.domains[a].codedValues.forEach((o) => {
|
|
100
|
+
let n = !1;
|
|
101
|
+
t.forEach((g) => {
|
|
102
|
+
g.code === o.code && (n = !0, `| ${g.name} |`.includes(`| ${o.name} |`) || (g.name += ` | ${o.name}`));
|
|
103
|
+
}), n || t.push(I(o));
|
|
104
104
|
});
|
|
105
|
-
})), !t?.length && r?.codedValues && (t =
|
|
105
|
+
})), !t?.length && r?.codedValues && (t = I(r.codedValues))) : r?.codedValues && (t = r.codedValues);
|
|
106
106
|
}
|
|
107
107
|
}), t;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
let
|
|
113
|
-
for (let
|
|
114
|
-
const
|
|
115
|
-
|
|
109
|
+
function O(i, e) {
|
|
110
|
+
const s = e;
|
|
111
|
+
if (s) {
|
|
112
|
+
let t = "";
|
|
113
|
+
for (let u = 0; u < s.length; u++) {
|
|
114
|
+
const p = s[u];
|
|
115
|
+
p.code == i && (t += (t.length ? " | " : "") + p.name);
|
|
116
116
|
}
|
|
117
|
-
return
|
|
117
|
+
return t.length || (t = `${i}`), t;
|
|
118
118
|
}
|
|
119
119
|
return i;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function B(i) {
|
|
122
122
|
return ["small-integer", "big-integer", "integer", "single", "double", "long"].includes(i.type);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function R(i) {
|
|
125
125
|
switch (i.type) {
|
|
126
126
|
case "small-integer":
|
|
127
127
|
case "big-integer":
|
|
@@ -142,26 +142,33 @@ function B(i) {
|
|
|
142
142
|
return i.type;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
const
|
|
146
|
-
class
|
|
145
|
+
const ne = M`:host{width:100%}.container{min-height:30px}.popover-unique-list{width:100%;overflow-y:auto}.unique-values-content-list-msg{font-size:75%;margin:5px}.count{padding:0 6px;font-size:smaller;white-space:nowrap}`;
|
|
146
|
+
class oe extends W {
|
|
147
147
|
constructor() {
|
|
148
|
-
super(...arguments), this.dropdownNode =
|
|
149
|
-
task: async ([e,
|
|
150
|
-
const
|
|
151
|
-
if (!h(
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
super(...arguments), this.dropdownNode = G(), this._messages = Y({ blocking: !0 }), this._propWatcherTask = new H(this, {
|
|
149
|
+
task: async ([e, s, t]) => {
|
|
150
|
+
const u = h(e) && h(s) || h(t);
|
|
151
|
+
if (!h(t) && !h(e) && !h(s) ? w("error", this, N("uniqueValues")) : h(t) || (h(e) || w("error", this, N("layer")), h(s) || w("error", this, N("fieldName"))), h(e) && h(s)) {
|
|
152
|
+
const { visualizationSource: p } = this;
|
|
153
|
+
if (!Z(e, p).fields?.filter((c) => c.name === s))
|
|
154
|
+
throw w("error", this, "Field could not be found."), new Error();
|
|
155
|
+
}
|
|
156
|
+
if (!u)
|
|
154
157
|
throw new Error();
|
|
155
158
|
await this.processProps();
|
|
156
159
|
},
|
|
157
|
-
args: () => [
|
|
158
|
-
|
|
160
|
+
args: () => [
|
|
161
|
+
this.layer,
|
|
162
|
+
this.fieldName,
|
|
163
|
+
this.uniqueValues
|
|
164
|
+
]
|
|
165
|
+
}), this.initialRender = !0, this.multiple = !1, this.partialUniqueValues = !1, this.showFilterLength = 10, this.arcgisChange = F(), this.arcgisSortByChange = F(), this.arcgisLoad = F();
|
|
159
166
|
}
|
|
160
167
|
static {
|
|
161
|
-
this.properties = { initialRender: 16, view: 0, layer: 0, fieldName: 1, uniqueValues: 0, numberFormatOptions: 0, selectedValues: 0, sortBy: 1, multiple: 5, partialUniqueValues: 5, showFilterLength: 9, maxHeight: 9 };
|
|
168
|
+
this.properties = { initialRender: 16, view: 0, layer: 0, visualizationSource: 1, fieldName: 1, uniqueValues: 0, numberFormatOptions: 0, selectedValues: 0, sortBy: 1, multiple: 5, partialUniqueValues: 5, showFilterLength: 9, maxHeight: 9 };
|
|
162
169
|
}
|
|
163
170
|
static {
|
|
164
|
-
this.styles =
|
|
171
|
+
this.styles = ne;
|
|
165
172
|
}
|
|
166
173
|
async setFocus() {
|
|
167
174
|
this.listNode?.setFocus();
|
|
@@ -169,51 +176,51 @@ class ne extends z {
|
|
|
169
176
|
async getUniqueValues() {
|
|
170
177
|
const { fieldInfo: e } = this;
|
|
171
178
|
if (h(e?.uniqueValueInfos)) {
|
|
172
|
-
const { uniqueValueInfos:
|
|
173
|
-
return { uniqueValues:
|
|
179
|
+
const { uniqueValueInfos: s, partialUniqueValues: t } = e;
|
|
180
|
+
return { uniqueValues: s, partialUniqueValues: t };
|
|
174
181
|
}
|
|
175
182
|
}
|
|
176
183
|
loaded() {
|
|
177
184
|
this.layer && this.fieldInfo && (setTimeout(() => this.initialRender = !1, 800), this.listNode?.setFocus());
|
|
178
185
|
}
|
|
179
186
|
async processProps() {
|
|
180
|
-
const { layer: e, fieldName:
|
|
187
|
+
const { layer: e, fieldName: s, view: t, visualizationSource: u } = this, a = (e ? Z(e, u) : void 0)?.fields?.filter((r) => r.name === s)?.[0];
|
|
181
188
|
if (h(this.uniqueValues))
|
|
182
189
|
this.fieldInfo = {
|
|
183
|
-
layerField:
|
|
184
|
-
fieldDomains: e &&
|
|
185
|
-
simpleType: e &&
|
|
190
|
+
layerField: a,
|
|
191
|
+
fieldDomains: e && a ? z(e, a, u) : void 0,
|
|
192
|
+
simpleType: e && a ? R(a) : void 0,
|
|
186
193
|
partialUniqueValues: this.partialUniqueValues ?? !1,
|
|
187
194
|
uniqueValueInfos: this.uniqueValues
|
|
188
195
|
}, this.arcgisLoad.emit();
|
|
189
|
-
else if (e &&
|
|
196
|
+
else if (e && a) {
|
|
190
197
|
this.fieldInfo = {
|
|
191
|
-
layerField:
|
|
192
|
-
fieldDomains:
|
|
193
|
-
simpleType:
|
|
198
|
+
layerField: a,
|
|
199
|
+
fieldDomains: z(e, a, u),
|
|
200
|
+
simpleType: R(a),
|
|
194
201
|
partialUniqueValues: !1
|
|
195
202
|
};
|
|
196
203
|
const { fieldInfo: r } = this;
|
|
197
204
|
try {
|
|
198
|
-
const
|
|
205
|
+
const c = await X({
|
|
199
206
|
layer: e,
|
|
200
|
-
view:
|
|
201
|
-
field:
|
|
207
|
+
view: t,
|
|
208
|
+
field: s,
|
|
202
209
|
sqlWhere: "definitionExpression" in e ? e.definitionExpression ?? void 0 : void 0,
|
|
203
210
|
forBinning: !1
|
|
204
|
-
}),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
value:
|
|
211
|
+
}), l = B(a), d = c.uniqueValueInfos.filter((o) => h(o.value) ? a.type === "string" && !l || a.type === "guid" ? o.value !== "<Null>" && `${o.value}`.trim() !== "" : (B(a) || a.type === "oid" || l, o.value !== "<Null>" && o.value !== "") : !1);
|
|
212
|
+
d.sort((o, n) => o.count > n.count ? -1 : o.count < n.count ? 1 : 0), r.fieldDomains?.length && r.fieldDomains.forEach((o) => {
|
|
213
|
+
d.find((n) => n.value === o.code) || d.push({
|
|
214
|
+
value: o.code,
|
|
208
215
|
count: 0
|
|
209
216
|
});
|
|
210
|
-
}), r.uniqueValueInfos =
|
|
211
|
-
} catch (
|
|
212
|
-
if (
|
|
213
|
-
const
|
|
214
|
-
r.fieldDomains.forEach((
|
|
215
|
-
|
|
216
|
-
value:
|
|
217
|
+
}), r.uniqueValueInfos = d, r.partialUniqueValues = c.uniqueValueInfos.length === 2e3, this.arcgisLoad.emit();
|
|
218
|
+
} catch (c) {
|
|
219
|
+
if (w("error", this, `uniqueValues() - ${c.message}`), this.hasFieldDomains(r)) {
|
|
220
|
+
const d = [];
|
|
221
|
+
r.fieldDomains.forEach((o) => {
|
|
222
|
+
d.find((n) => n.value === o.code) || d.push({
|
|
223
|
+
value: o.code,
|
|
217
224
|
count: void 0
|
|
218
225
|
});
|
|
219
226
|
});
|
|
@@ -225,20 +232,20 @@ class ne extends z {
|
|
|
225
232
|
}
|
|
226
233
|
}
|
|
227
234
|
setListRef(e) {
|
|
228
|
-
const { maxHeight:
|
|
229
|
-
this.listNode = e,
|
|
235
|
+
const { maxHeight: s } = this;
|
|
236
|
+
this.listNode = e, s && e?.setAttribute("style", `max-height: ${s || 400}px`);
|
|
230
237
|
}
|
|
231
238
|
onSortMenuSelect(e) {
|
|
232
|
-
const
|
|
233
|
-
this.sortBy =
|
|
239
|
+
const t = e.currentTarget.selectedItems?.[0].getAttribute("data-value");
|
|
240
|
+
this.sortBy = t || void 0, this.arcgisSortByChange.emit(t || void 0);
|
|
234
241
|
}
|
|
235
|
-
isSameLists(e,
|
|
236
|
-
if (!e && !
|
|
242
|
+
isSameLists(e, s) {
|
|
243
|
+
if (!e && !s)
|
|
237
244
|
return !0;
|
|
238
|
-
if (!e || !
|
|
245
|
+
if (!e || !s || e?.length !== s?.length)
|
|
239
246
|
return !1;
|
|
240
|
-
for (let
|
|
241
|
-
if (e[
|
|
247
|
+
for (let t = 0; t < e.length; t++)
|
|
248
|
+
if (e[t] !== s[t])
|
|
242
249
|
return !1;
|
|
243
250
|
return !0;
|
|
244
251
|
}
|
|
@@ -248,50 +255,50 @@ class ne extends z {
|
|
|
248
255
|
render() {
|
|
249
256
|
return this._propWatcherTask.render({
|
|
250
257
|
complete: () => {
|
|
251
|
-
const { fieldInfo: e, selectedValues:
|
|
252
|
-
if (!
|
|
258
|
+
const { fieldInfo: e, selectedValues: s, sortBy: t, multiple: u, initialRender: p, showFilterLength: a, _messages: r } = this, { fieldDomains: c, uniqueValueInfos: l, partialUniqueValues: d, layerField: o } = e, n = o?.type;
|
|
259
|
+
if (!l?.length)
|
|
253
260
|
return "";
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
}, A = (
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
if (
|
|
260
|
-
return (typeof
|
|
261
|
+
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, k = (y) => {
|
|
262
|
+
y.sort(($, m) => $.count <= m.count ? 1 : -1);
|
|
263
|
+
}, A = (y) => {
|
|
264
|
+
const $ = c?.length;
|
|
265
|
+
y.sort((m, f) => {
|
|
266
|
+
if (!$ && g)
|
|
267
|
+
return (typeof m.value == "string" ? Number.parseFloat(m.value) : m.value) - (typeof f.value == "string" ? Number.parseFloat(f.value) : f.value);
|
|
261
268
|
{
|
|
262
|
-
const
|
|
263
|
-
return `${
|
|
269
|
+
const q = $ ? O(m.value, c) : m.label ?? m.value, V = $ ? O(f.value, c) : f.label ?? f.value;
|
|
270
|
+
return `${q}`.startsWith("_") ? 1 : `${V}`.startsWith("_") ? -1 : `${q}`.localeCompare(`${V}`);
|
|
264
271
|
}
|
|
265
272
|
});
|
|
266
|
-
}, C = (
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
return
|
|
273
|
+
}, C = (y, $) => {
|
|
274
|
+
y.sort((m, f) => {
|
|
275
|
+
const q = $?.indexOf(m.value) ?? -1, V = $?.indexOf(f.value) ?? -1;
|
|
276
|
+
return q === V || q > -1 && V > -1 ? 0 : q > V ? -1 : 1;
|
|
270
277
|
});
|
|
271
278
|
};
|
|
272
|
-
A(
|
|
273
|
-
const
|
|
279
|
+
A(l), !t || t === "count" ? k(l) : t === "selected" && C(l, s);
|
|
280
|
+
const j = l.map((y) => this.renderUniqueValue(y));
|
|
274
281
|
let E;
|
|
275
|
-
return
|
|
276
|
-
let
|
|
277
|
-
!
|
|
282
|
+
return d && !p && (E = S`<div class="unique-values-content-list-msg">${r.errors.tooManyUniqueValues}</div>`), S`<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) => {
|
|
283
|
+
let m = y.target.selectedItems.map((f) => f.value);
|
|
284
|
+
!c && n === "date-only" ? m = m?.map((f) => L(f)) : !c && n === "time-only" ? m = m?.map((f) => U(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));
|
|
278
285
|
}} @calciteListFilter=${() => {
|
|
279
286
|
this.dropdownNode.value && (this.dropdownNode.value.disabled = this.listNode.filteredItems.length < 4);
|
|
280
|
-
}} ${
|
|
287
|
+
}} ${T(this.setListRef)}>${l.length >= a && !p ? this.renderSort(g, v) : null}${j}</calcite-list>${E}</div>`;
|
|
281
288
|
},
|
|
282
289
|
error: () => ""
|
|
283
290
|
});
|
|
284
291
|
}
|
|
285
|
-
renderSort(e,
|
|
286
|
-
const { sortBy:
|
|
287
|
-
return
|
|
292
|
+
renderSort(e, s) {
|
|
293
|
+
const { sortBy: t, _messages: u } = this;
|
|
294
|
+
return S`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${T(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>`;
|
|
288
295
|
}
|
|
289
296
|
renderUniqueValue(e) {
|
|
290
|
-
const { selectedValues:
|
|
291
|
-
return
|
|
297
|
+
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 ? O(e.value, r) : l === "date" ? ee(e.value, d) : l === "date-only" ? te(e.value) : l === "time-only" ? ie(e.value) : l === "timestamp-offset" ? se(e.value, u) : typeof e.value == "number" ? Q(e.value, a) : e.label ?? e.value, n = s ? l === "date-only" ? s.includes(r?.length ? e.value : L(e.value)) : l === "time-only" ? s.includes(r?.length ? e.value : U(e.value)) : s.includes(e.value) : !1;
|
|
298
|
+
return P(`list-item_${e.value}`, S`<calcite-list-item .label=${`${o}`} .value=${`${e.value}`} .selected=${n}>${h(e.count) && (c.length > 200 && !t || c.length <= 200) ? S`<div class="count" slot=actions-end>${`${e.count}`}</div>` : null}</calcite-list-item>`);
|
|
292
299
|
}
|
|
293
300
|
}
|
|
294
|
-
|
|
301
|
+
_("arcgis-unique-values-list", oe);
|
|
295
302
|
export {
|
|
296
|
-
|
|
303
|
+
oe as ArcgisUniqueValuesList
|
|
297
304
|
};
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import type WFSLayer from "@arcgis/core/layers/WFSLayer.js";
|
|
2
|
+
import type SubtypeSublayer from "@arcgis/core/layers/support/SubtypeSublayer.js";
|
|
3
|
+
import type SubtypeGroupLayer from "@arcgis/core/layers/SubtypeGroupLayer.js";
|
|
4
|
+
import type StreamLayer from "@arcgis/core/layers/StreamLayer.js";
|
|
5
|
+
import type OrientedImageryLayer from "@arcgis/core/layers/OrientedImageryLayer.js";
|
|
6
|
+
import type KnowledgeGraphSublayer from "@arcgis/core/layers/knowledgeGraph/KnowledgeGraphSublayer.js";
|
|
7
|
+
import type ImageryLayer from "@arcgis/core/layers/ImageryLayer.js";
|
|
8
|
+
import type GeoJSONLayer from "@arcgis/core/layers/GeoJSONLayer.js";
|
|
9
|
+
import type FeatureLayer from "@arcgis/core/layers/FeatureLayer.js";
|
|
10
|
+
import type CSVLayer from "@arcgis/core/layers/CSVLayer.js";
|
|
11
|
+
import type CatalogLayer from "@arcgis/core/layers/CatalogLayer.js";
|
|
12
|
+
import type CatalogFootprintLayer from "@arcgis/core/layers/catalog/CatalogFootprintLayer.js";
|
|
2
13
|
|
|
3
|
-
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type SupportedLayer = CatalogFootprintLayer | CatalogLayer | CSVLayer | FeatureLayer | GeoJSONLayer | ImageryLayer | KnowledgeGraphSublayer | OrientedImageryLayer | StreamLayer | SubtypeGroupLayer | SubtypeSublayer | WFSLayer;
|