@arcgis/common-components 5.1.0-next.2 → 5.1.0-next.21
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/23DDMSOB.js +2 -0
- package/dist/cdn/3O7GAC23.js +2 -0
- package/dist/cdn/4CW7U27R.js +2 -0
- package/dist/cdn/4DCAUWTC.js +2 -0
- package/dist/cdn/EKKJN7WZ.js +2 -0
- package/dist/cdn/GAR4QMLU.js +2 -0
- package/dist/cdn/JTRO7GRS.js +2 -0
- package/dist/cdn/ZLXAKPUH.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/commonFunctions.js +3 -13
- 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-color-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-info/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-info/customElement.js +10 -10
- package/dist/components/arcgis-field-info/utils/basic.d.ts +1 -0
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-pick-list/utils/types.d.ts +5 -1
- package/dist/components/arcgis-histogram/customElement.d.ts +46 -28
- package/dist/components/arcgis-label-input/customElement.d.ts +5 -4
- package/dist/components/arcgis-picker-input/customElement.d.ts +1 -0
- 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 +269 -73
- package/dist/components/arcgis-slider/customElement.js +318 -289
- package/dist/components/arcgis-slider-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-ticks/customElement.d.ts +101 -13
- package/dist/components/arcgis-ticks/customElement.js +27 -27
- package/dist/components/arcgis-ticks/types.d.ts +23 -0
- package/dist/components/arcgis-unique-values-list/customElement.d.ts +8 -1
- package/dist/components/arcgis-unique-values-list/customElement.js +155 -149
- package/dist/components/arcgis-unique-values-list/utils/basic.d.ts +1 -0
- 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 +2 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/dist/utils/types.d.ts +24 -7
- package/package.json +3 -3
- package/dist/cdn/6MGBOM6S.js +0 -2
- package/dist/cdn/6NYYZIHB.js +0 -2
- package/dist/cdn/BAVGT3I5.js +0 -2
- package/dist/cdn/GQLKGVRX.js +0 -2
- package/dist/cdn/P45VPBNI.js +0 -2
- package/dist/cdn/S7T3XQPB.js +0 -2
- package/dist/cdn/ZP76EPVI.js +0 -2
|
@@ -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
|
|
6
|
-
import { Task as
|
|
7
|
-
import { createRef as
|
|
8
|
-
import { log as
|
|
9
|
-
import { formatDate as w, convertDateFormatToIntlOptions as
|
|
10
|
-
import
|
|
11
|
-
import { clone as
|
|
2
|
+
import { c as P } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as W, html as F } from "lit";
|
|
4
|
+
import { keyed as z } from "lit/directives/keyed.js";
|
|
5
|
+
import { LitElement as H, createEvent as D } from "@arcgis/lumina";
|
|
6
|
+
import { Task as j } from "@lit/task";
|
|
7
|
+
import { createRef as G, ref as x } from "lit/directives/ref.js";
|
|
8
|
+
import { log as S, composeMissingPropertyMessage as N } from "@arcgis/toolkit/log";
|
|
9
|
+
import { formatDate as w, convertDateFormatToIntlOptions as b, formatDateOnly as J, formatTimeOnly as K, formatTimestamp as O, 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
12
|
import { i as h } from "../../chunks/commonFunctions.js";
|
|
13
|
-
import { u as
|
|
14
|
-
function
|
|
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 = w(i, {
|
|
23
|
+
...b("short-date-short-time"),
|
|
24
24
|
timeZone: "utc",
|
|
25
25
|
timeZoneName: "shortOffset"
|
|
26
|
-
}) :
|
|
27
|
-
...
|
|
26
|
+
}) : t = w(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 = w(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" ? O(i, {
|
|
43
|
+
...b("short-date-short-time"),
|
|
44
44
|
timeZone: "utc",
|
|
45
45
|
timeZoneName: "shortOffset"
|
|
46
|
-
}) :
|
|
47
|
-
...
|
|
46
|
+
}) : O(i, {
|
|
47
|
+
...b("short-date-short-time"),
|
|
48
48
|
timeZone: e && "timeZone" in e && e.timeZone ? e.timeZone : "system"
|
|
49
49
|
}) : e && "timeZone" in e && e.timeZone === "unknown" ? w(i, {
|
|
50
|
-
...
|
|
50
|
+
...b("short-date-short-time"),
|
|
51
51
|
timeZone: "utc",
|
|
52
52
|
timeZoneName: "shortOffset"
|
|
53
53
|
}) : w(i, {
|
|
54
|
-
...
|
|
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 R(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 E(i, s).fields.forEach((p) => {
|
|
63
|
+
const l = p.name, a = "domain" in p ? p.domain : void 0;
|
|
64
|
+
if (i.type !== "imagery" && i.subtypeField === l) {
|
|
65
|
+
let c;
|
|
66
|
+
i.type === "subtype-group" || i.type === "feature" ? c = i.subtypes : c = i.parent.subtypes, c.forEach((r) => {
|
|
67
|
+
i.type === "subtype-sublayer" && i.subtypeCode !== r.code || (e.name === l && (t = t || [], t.push({ code: r.code, name: r.name })), r.domains && Object.keys(r.domains).forEach((d) => {
|
|
68
|
+
if (e.name === d) {
|
|
69
|
+
const o = r.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 === l && (i.type === "feature" || i.type === "imagery")) {
|
|
81
|
+
const c = i.type === "feature" ? i.typeIdField : void 0, r = i.type === "feature" ? i.types : void 0;
|
|
82
|
+
i.type === "feature" && c && r ? (c === l ? t = r.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 || [], r.forEach((d) => {
|
|
91
|
+
if (!d.domains?.[l] || d.domains[l].type === "inherited") {
|
|
92
|
+
const o = a;
|
|
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?.[l]?.codedValues && d.domains[l].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 &&
|
|
105
|
+
})), !t?.length && a?.codedValues && (t = I(a.codedValues))) : a?.codedValues && (t = a.codedValues);
|
|
106
106
|
}
|
|
107
107
|
}), t;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
let
|
|
113
|
-
for (let
|
|
114
|
-
const
|
|
115
|
-
|
|
109
|
+
function Z(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 k(i) {
|
|
125
125
|
switch (i.type) {
|
|
126
126
|
case "small-integer":
|
|
127
127
|
case "big-integer":
|
|
@@ -142,15 +142,21 @@ function B(i) {
|
|
|
142
142
|
return i.type;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
function E(i, e) {
|
|
146
|
+
return e === "feature-reduction" && "featureReduction" in i ? i.featureReduction : i;
|
|
147
|
+
}
|
|
148
|
+
const ne = W`: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}`;
|
|
149
|
+
class oe extends H {
|
|
147
150
|
constructor() {
|
|
148
|
-
super(...arguments), this.dropdownNode =
|
|
149
|
-
task: async ([e,
|
|
150
|
-
const
|
|
151
|
-
if (!h(
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
super(...arguments), this.dropdownNode = G(), this._messages = Y({ blocking: !0 }), this._propWatcherTask = new j(this, {
|
|
152
|
+
task: async ([e, s, t]) => {
|
|
153
|
+
const u = h(e) && h(s) || h(t);
|
|
154
|
+
if (!h(t) && !h(e) && !h(s) ? S("error", this, N("uniqueValues")) : h(t) || (h(e) || S("error", this, N("layer")), h(s) || S("error", this, N("fieldName"))), h(e) && h(s)) {
|
|
155
|
+
const { fieldSource: p } = this;
|
|
156
|
+
if (!E(e, p).fields?.filter((c) => c.name === s))
|
|
157
|
+
throw S("error", this, "Field could not be found."), new Error();
|
|
158
|
+
}
|
|
159
|
+
if (!u)
|
|
154
160
|
throw new Error();
|
|
155
161
|
await this.processProps();
|
|
156
162
|
},
|
|
@@ -158,10 +164,10 @@ class ne extends z {
|
|
|
158
164
|
}), this.initialRender = !0, this.multiple = !1, this.partialUniqueValues = !1, this.showFilterLength = 10, this.arcgisChange = D(), this.arcgisSortByChange = D(), this.arcgisLoad = D();
|
|
159
165
|
}
|
|
160
166
|
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 };
|
|
167
|
+
this.properties = { initialRender: 16, view: 0, layer: 0, fieldSource: 1, fieldName: 1, uniqueValues: 0, numberFormatOptions: 0, selectedValues: 0, sortBy: 1, multiple: 5, partialUniqueValues: 5, showFilterLength: 9, maxHeight: 9 };
|
|
162
168
|
}
|
|
163
169
|
static {
|
|
164
|
-
this.styles =
|
|
170
|
+
this.styles = ne;
|
|
165
171
|
}
|
|
166
172
|
async setFocus() {
|
|
167
173
|
this.listNode?.setFocus();
|
|
@@ -169,51 +175,51 @@ class ne extends z {
|
|
|
169
175
|
async getUniqueValues() {
|
|
170
176
|
const { fieldInfo: e } = this;
|
|
171
177
|
if (h(e?.uniqueValueInfos)) {
|
|
172
|
-
const { uniqueValueInfos:
|
|
173
|
-
return { uniqueValues:
|
|
178
|
+
const { uniqueValueInfos: s, partialUniqueValues: t } = e;
|
|
179
|
+
return { uniqueValues: s, partialUniqueValues: t };
|
|
174
180
|
}
|
|
175
181
|
}
|
|
176
182
|
loaded() {
|
|
177
183
|
this.layer && this.fieldInfo && (setTimeout(() => this.initialRender = !1, 800), this.listNode?.setFocus());
|
|
178
184
|
}
|
|
179
185
|
async processProps() {
|
|
180
|
-
const { layer: e, fieldName:
|
|
186
|
+
const { layer: e, fieldName: s, view: t, fieldSource: u } = this, l = (e ? E(e, u) : void 0)?.fields?.filter((a) => a.name === s)?.[0];
|
|
181
187
|
if (h(this.uniqueValues))
|
|
182
188
|
this.fieldInfo = {
|
|
183
|
-
layerField:
|
|
184
|
-
fieldDomains: e &&
|
|
185
|
-
simpleType: e &&
|
|
189
|
+
layerField: l,
|
|
190
|
+
fieldDomains: e && l ? R(e, l, u) : void 0,
|
|
191
|
+
simpleType: e && l ? k(l) : void 0,
|
|
186
192
|
partialUniqueValues: this.partialUniqueValues ?? !1,
|
|
187
193
|
uniqueValueInfos: this.uniqueValues
|
|
188
194
|
}, this.arcgisLoad.emit();
|
|
189
|
-
else if (e &&
|
|
195
|
+
else if (e && l) {
|
|
190
196
|
this.fieldInfo = {
|
|
191
|
-
layerField:
|
|
192
|
-
fieldDomains:
|
|
193
|
-
simpleType:
|
|
197
|
+
layerField: l,
|
|
198
|
+
fieldDomains: R(e, l, u),
|
|
199
|
+
simpleType: k(l),
|
|
194
200
|
partialUniqueValues: !1
|
|
195
201
|
};
|
|
196
|
-
const { fieldInfo:
|
|
202
|
+
const { fieldInfo: a } = this;
|
|
197
203
|
try {
|
|
198
|
-
const
|
|
204
|
+
const c = await X({
|
|
199
205
|
layer: e,
|
|
200
|
-
view:
|
|
201
|
-
field:
|
|
206
|
+
view: t,
|
|
207
|
+
field: s,
|
|
202
208
|
sqlWhere: "definitionExpression" in e ? e.definitionExpression ?? void 0 : void 0,
|
|
203
209
|
forBinning: !1
|
|
204
|
-
}),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
value:
|
|
210
|
+
}), r = B(l), d = c.uniqueValueInfos.filter((o) => h(o.value) ? l.type === "string" && !r || l.type === "guid" ? o.value !== "<Null>" && `${o.value}`.trim() !== "" : (B(l) || l.type === "oid" || r, o.value !== "<Null>" && o.value !== "") : !1);
|
|
211
|
+
d.sort((o, n) => o.count > n.count ? -1 : o.count < n.count ? 1 : 0), a.fieldDomains?.length && a.fieldDomains.forEach((o) => {
|
|
212
|
+
d.find((n) => n.value === o.code) || d.push({
|
|
213
|
+
value: o.code,
|
|
208
214
|
count: 0
|
|
209
215
|
});
|
|
210
|
-
}),
|
|
211
|
-
} catch (
|
|
212
|
-
if (
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
value:
|
|
216
|
+
}), a.uniqueValueInfos = d, a.partialUniqueValues = c.uniqueValueInfos.length === 2e3, this.arcgisLoad.emit();
|
|
217
|
+
} catch (c) {
|
|
218
|
+
if (S("error", this, `uniqueValues() - ${c.message}`), this.hasFieldDomains(a)) {
|
|
219
|
+
const d = [];
|
|
220
|
+
a.fieldDomains.forEach((o) => {
|
|
221
|
+
d.find((n) => n.value === o.code) || d.push({
|
|
222
|
+
value: o.code,
|
|
217
223
|
count: void 0
|
|
218
224
|
});
|
|
219
225
|
});
|
|
@@ -225,20 +231,20 @@ class ne extends z {
|
|
|
225
231
|
}
|
|
226
232
|
}
|
|
227
233
|
setListRef(e) {
|
|
228
|
-
const { maxHeight:
|
|
229
|
-
this.listNode = e,
|
|
234
|
+
const { maxHeight: s } = this;
|
|
235
|
+
this.listNode = e, s && e?.setAttribute("style", `max-height: ${s || 400}px`);
|
|
230
236
|
}
|
|
231
237
|
onSortMenuSelect(e) {
|
|
232
|
-
const
|
|
233
|
-
this.sortBy =
|
|
238
|
+
const t = e.currentTarget.selectedItems?.[0].getAttribute("data-value");
|
|
239
|
+
this.sortBy = t || void 0, this.arcgisSortByChange.emit(t || void 0);
|
|
234
240
|
}
|
|
235
|
-
isSameLists(e,
|
|
236
|
-
if (!e && !
|
|
241
|
+
isSameLists(e, s) {
|
|
242
|
+
if (!e && !s)
|
|
237
243
|
return !0;
|
|
238
|
-
if (!e || !
|
|
244
|
+
if (!e || !s || e?.length !== s?.length)
|
|
239
245
|
return !1;
|
|
240
|
-
for (let
|
|
241
|
-
if (e[
|
|
246
|
+
for (let t = 0; t < e.length; t++)
|
|
247
|
+
if (e[t] !== s[t])
|
|
242
248
|
return !1;
|
|
243
249
|
return !0;
|
|
244
250
|
}
|
|
@@ -248,50 +254,50 @@ class ne extends z {
|
|
|
248
254
|
render() {
|
|
249
255
|
return this._propWatcherTask.render({
|
|
250
256
|
complete: () => {
|
|
251
|
-
const { fieldInfo: e, selectedValues:
|
|
252
|
-
if (!
|
|
257
|
+
const { fieldInfo: e, selectedValues: s, sortBy: t, multiple: u, initialRender: p, showFilterLength: l, _messages: a } = this, { fieldDomains: c, uniqueValueInfos: r, partialUniqueValues: d, layerField: o } = e, n = o?.type;
|
|
258
|
+
if (!r?.length)
|
|
253
259
|
return "";
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
},
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
if (
|
|
260
|
-
return (typeof
|
|
260
|
+
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, A = (y) => {
|
|
261
|
+
y.sort(($, m) => $.count <= m.count ? 1 : -1);
|
|
262
|
+
}, C = (y) => {
|
|
263
|
+
const $ = c?.length;
|
|
264
|
+
y.sort((m, f) => {
|
|
265
|
+
if (!$ && g)
|
|
266
|
+
return (typeof m.value == "string" ? Number.parseFloat(m.value) : m.value) - (typeof f.value == "string" ? Number.parseFloat(f.value) : f.value);
|
|
261
267
|
{
|
|
262
|
-
const
|
|
263
|
-
return `${
|
|
268
|
+
const q = $ ? Z(m.value, c) : m.value, V = $ ? Z(f.value, c) : f.value;
|
|
269
|
+
return `${q}`.startsWith("_") ? 1 : `${V}`.startsWith("_") ? -1 : `${q}`.localeCompare(`${V}`);
|
|
264
270
|
}
|
|
265
271
|
});
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
return
|
|
272
|
+
}, _ = (y, $) => {
|
|
273
|
+
y.sort((m, f) => {
|
|
274
|
+
const q = $?.indexOf(m.value) ?? -1, V = $?.indexOf(f.value) ?? -1;
|
|
275
|
+
return q === V || q > -1 && V > -1 ? 0 : q > V ? -1 : 1;
|
|
270
276
|
});
|
|
271
277
|
};
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
let
|
|
275
|
-
return
|
|
276
|
-
let
|
|
277
|
-
!
|
|
278
|
+
C(r), !t || t === "count" ? A(r) : t === "selected" && _(r, s);
|
|
279
|
+
const M = r.map((y) => this.renderUniqueValue(y));
|
|
280
|
+
let T;
|
|
281
|
+
return d && !p && (T = F`<div class="unique-values-content-list-msg">${a.errors.tooManyUniqueValues}</div>`), F`<div class="container"><calcite-list .label=${a.values} class="popover-unique-list" .filterEnabled=${r.length >= l} .selectionMode=${u ? "multiple" : "single"} .filterPlaceholder=${a.searchValues} @calciteListChange=${(y) => {
|
|
282
|
+
let m = y.target.selectedItems.map((f) => f.value);
|
|
283
|
+
!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
284
|
}} @calciteListFilter=${() => {
|
|
279
285
|
this.dropdownNode.value && (this.dropdownNode.value.disabled = this.listNode.filteredItems.length < 4);
|
|
280
|
-
}} ${
|
|
286
|
+
}} ${x(this.setListRef)}>${r.length >= l && !p ? this.renderSort(g, v) : null}${M}</calcite-list>${T}</div>`;
|
|
281
287
|
},
|
|
282
288
|
error: () => ""
|
|
283
289
|
});
|
|
284
290
|
}
|
|
285
|
-
renderSort(e,
|
|
286
|
-
const { sortBy:
|
|
287
|
-
return
|
|
291
|
+
renderSort(e, s) {
|
|
292
|
+
const { sortBy: t, _messages: u } = this;
|
|
293
|
+
return F`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${x(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
294
|
}
|
|
289
295
|
renderUniqueValue(e) {
|
|
290
|
-
const { selectedValues:
|
|
291
|
-
return
|
|
296
|
+
const { selectedValues: s, initialRender: t, view: u, fieldInfo: p, numberFormatOptions: l } = this, { fieldDomains: a, uniqueValueInfos: c, simpleType: r } = p, d = u && "timeZone" in u && u.timeZone || "system", o = a?.length ? Z(e.value, a) : r === "date" ? ee(e.value, d) : r === "date-only" ? te(e.value) : r === "time-only" ? ie(e.value) : r === "timestamp-offset" ? se(e.value, u) : typeof e.value == "number" ? Q(e.value, l) : e.value, n = s ? r === "date-only" ? s.includes(a?.length ? e.value : L(e.value)) : r === "time-only" ? s.includes(a?.length ? e.value : U(e.value)) : s.includes(e.value) : !1;
|
|
297
|
+
return z(`list-item_${e.value}`, F`<calcite-list-item .label=${`${o}`} .value=${`${e.value}`} .selected=${n}>${h(e.count) && (c.length > 200 && !t || c.length <= 200) ? F`<div class="count" slot=actions-end>${`${e.count}`}</div>` : null}</calcite-list-item>`);
|
|
292
298
|
}
|
|
293
299
|
}
|
|
294
|
-
|
|
300
|
+
P("arcgis-unique-values-list", oe);
|
|
295
301
|
export {
|
|
296
|
-
|
|
302
|
+
oe as ArcgisUniqueValuesList
|
|
297
303
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
2
2
|
|
|
3
|
+
/** @internal */
|
|
3
4
|
export type SupportedLayer = __esri.CatalogFootprintLayer | __esri.CatalogLayer | __esri.CSVLayer | __esri.FeatureLayer | __esri.GeoJSONLayer | __esri.ImageryLayer | __esri.KnowledgeGraphSublayer | __esri.OrientedImageryLayer | __esri.StreamLayer | __esri.SubtypeGroupLayer | __esri.SubtypeSublayer | __esri.WFSLayer;
|