@arcgis/common-components 5.2.0-next.11 → 5.2.0-next.111
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/{L2JNUMXB.js → 3UH3ZOZB.js} +1 -1
- package/dist/cdn/475SP47T.js +2 -0
- package/dist/cdn/{4W7JZPB6.js → 4JMH3KRC.js} +1 -1
- package/dist/cdn/{VQLI4IE7.js → 4LO2YSUJ.js} +1 -1
- package/dist/cdn/4TZVXSQZ.js +2 -0
- package/dist/cdn/56HK5TL6.js +2 -0
- package/dist/cdn/5IM4X2GT.js +2 -0
- package/dist/cdn/6HBX6QDQ.js +2 -0
- package/dist/cdn/{OBIWQRXY.js → 73ETIJP2.js} +1 -1
- package/dist/cdn/7EP7KDAN.js +2 -0
- package/dist/cdn/7YNFXAZI.js +2 -0
- package/dist/cdn/{GVOQ2CB7.js → AWK4HGJV.js} +1 -1
- package/dist/cdn/DG5IVKVO.js +2 -0
- package/dist/cdn/{5KS7T5BY.js → DRV7OKQT.js} +1 -1
- package/dist/cdn/EA5M73N4.js +2 -0
- package/dist/cdn/EPTZSQ77.js +2 -0
- package/dist/cdn/{3P53QRGS.js → G2LLGGQQ.js} +1 -1
- package/dist/cdn/{XRARFMJ7.js → GQ2PO4L4.js} +1 -1
- package/dist/cdn/GSQIARZL.js +2 -0
- package/dist/cdn/HJZA4ZUL.js +2 -0
- package/dist/cdn/I7CTLPWD.js +2 -0
- package/dist/cdn/{LKUOAV7B.js → ICJXMKTL.js} +1 -1
- package/dist/cdn/{L5RMOAO3.js → J6ZKTXN7.js} +1 -1
- package/dist/cdn/KMYFQIQ7.js +2 -0
- package/dist/cdn/L7XGWJZF.js +2 -0
- package/dist/cdn/LAQNGXPG.js +2 -0
- package/dist/cdn/ND7AQ3X6.js +2 -0
- package/dist/cdn/NNNE4T7L.js +2 -0
- package/dist/cdn/O4H2JR53.js +2 -0
- package/dist/cdn/{3V5M7OHL.js → OSOV6LK3.js} +3 -3
- package/dist/cdn/PMV2N3L3.js +2 -0
- package/dist/cdn/{MCZBUYS5.js → PQG3COJ4.js} +1 -1
- package/dist/cdn/PSVNG2MS.js +2 -0
- package/dist/cdn/PUNWW4GY.js +2 -0
- package/dist/cdn/PWYFUIF6.js +4 -0
- package/dist/cdn/Q3AMPMQV.js +2 -0
- package/dist/cdn/{WEKRF34E.js → QWRE6ILV.js} +1 -1
- package/dist/cdn/RC2HNFFD.js +2 -0
- package/dist/cdn/{JLPZ3OR2.js → SKLYKTDC.js} +1 -1
- package/dist/cdn/TKCEZXLC.js +2 -0
- package/dist/cdn/TWW63D32.js +2 -0
- package/dist/cdn/XMGOCO2S.js +2 -0
- package/dist/cdn/Z5QBBHLD.js +2 -0
- package/dist/cdn/{N7C4DINF.js → Z5SIZJN5.js} +1 -1
- package/dist/cdn/ZMZH3Z5A.js +2 -0
- 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 +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/element-reference-controller.js +19 -0
- package/dist/chunks/layer-utils.js +52 -40
- package/dist/chunks/locale.js +14 -6
- package/dist/chunks/strategies.js +287 -0
- package/dist/chunks/toolbar.js +9 -0
- package/dist/chunks/types.js +16 -0
- 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 +2 -2
- package/dist/components/arcgis-ckeditor5-popover/customElement.js +1 -1
- package/dist/components/arcgis-color-input/customElement.d.ts +2 -1
- package/dist/components/arcgis-color-input/customElement.js +1 -1
- package/dist/components/arcgis-coordinate-system-picker/customElement.d.ts +23 -0
- package/dist/components/arcgis-coordinate-system-picker/customElement.js +1 -1
- package/dist/components/arcgis-field-info/customElement.d.ts +1 -1
- package/dist/components/arcgis-field-info/customElement.js +248 -225
- 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 +205 -122
- 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 +105 -90
- package/dist/components/arcgis-label-input/customElement.js +18 -14
- package/dist/components/arcgis-slider/customElement.d.ts +11 -3
- package/dist/components/arcgis-slider/customElement.js +371 -348
- 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-ticks/customElement.d.ts +11 -3
- package/dist/components/arcgis-ticks/customElement.js +100 -79
- 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 +115 -95
- package/dist/components/arcgis-value-picker/customElement.js +5 -5
- 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 +2 -0
- package/dist/loader.js +13 -4
- 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/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
- /package/dist/cdn/{ECNI2A4K.js → XEK22IDA.js} +0 -0
- /package/dist/chunks/{commonFunctions.js → general.js} +0 -0
|
@@ -17,10 +17,12 @@ import type VoxelLayer from "@arcgis/core/layers/VoxelLayer.js";
|
|
|
17
17
|
import type WCSLayer from "@arcgis/core/layers/WCSLayer.js";
|
|
18
18
|
import type WFSLayer from "@arcgis/core/layers/WFSLayer.js";
|
|
19
19
|
import type CatalogLayer from "@arcgis/core/layers/CatalogLayer.js";
|
|
20
|
+
import type DimensionFeatureLayer from "@arcgis/core/layers/DimensionFeatureLayer.js";
|
|
21
|
+
import type AnnotationFeatureLayer from "@arcgis/core/layers/AnnotationFeatureLayer.js";
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* All supported layer types
|
|
23
25
|
*
|
|
24
26
|
* @internal
|
|
25
27
|
*/
|
|
26
|
-
export type FieldInfoLayer = CatalogFootprintLayer | CatalogLayer | CSVLayer | FeatureLayer | GeoJSONLayer | ImageryLayer | ImageryTileLayer | KnowledgeGraphSublayer | OGCFeatureLayer | OrientedImageryLayer | ParquetLayer | SceneLayer | StreamLayer | Sublayer | SubtypeGroupLayer | SubtypeSublayer | VoxelLayer | WCSLayer | WFSLayer;
|
|
28
|
+
export type FieldInfoLayer = AnnotationFeatureLayer | CatalogFootprintLayer | CatalogLayer | CSVLayer | DimensionFeatureLayer | FeatureLayer | GeoJSONLayer | ImageryLayer | ImageryTileLayer | KnowledgeGraphSublayer | OGCFeatureLayer | OrientedImageryLayer | ParquetLayer | SceneLayer | StreamLayer | Sublayer | SubtypeGroupLayer | SubtypeSublayer | VoxelLayer | WCSLayer | WFSLayer;
|
|
@@ -35,6 +35,7 @@ export abstract class ArcgisFieldPickList extends LitElement {
|
|
|
35
35
|
sort: string;
|
|
36
36
|
selectAll: string;
|
|
37
37
|
deselectAll: string;
|
|
38
|
+
subFieldsSelected: string;
|
|
38
39
|
noMatches: string;
|
|
39
40
|
} & T9nMeta<{
|
|
40
41
|
ok: string;
|
|
@@ -54,6 +55,7 @@ export abstract class ArcgisFieldPickList extends LitElement {
|
|
|
54
55
|
sort: string;
|
|
55
56
|
selectAll: string;
|
|
56
57
|
deselectAll: string;
|
|
58
|
+
subFieldsSelected: string;
|
|
57
59
|
noMatches: string;
|
|
58
60
|
}>;
|
|
59
61
|
/** Custom function to distinguish expressions from fields. */
|
|
@@ -73,7 +75,7 @@ export abstract class ArcgisFieldPickList extends LitElement {
|
|
|
73
75
|
accessor filterPlaceholderText: string | undefined;
|
|
74
76
|
/**
|
|
75
77
|
* @deprecated
|
|
76
|
-
* Pass in grouped lists of fields instead.
|
|
78
|
+
* Pass in grouped lists of fields instead. Removal target v6.0.0.
|
|
77
79
|
* If true, fields and expressions are placed in separate groups.
|
|
78
80
|
* @default false
|
|
79
81
|
*/
|
|
@@ -87,7 +89,7 @@ export abstract class ArcgisFieldPickList extends LitElement {
|
|
|
87
89
|
*/
|
|
88
90
|
accessor hideCancel: boolean;
|
|
89
91
|
/**
|
|
90
|
-
* If true, hides the sort menu button.
|
|
92
|
+
* If true, hides the top-level sort menu button. Sorting applies directly to any sub-fields.
|
|
91
93
|
*
|
|
92
94
|
* @default false
|
|
93
95
|
*/
|
|
@@ -95,12 +97,12 @@ export abstract class ArcgisFieldPickList extends LitElement {
|
|
|
95
97
|
/** Layer instance. */
|
|
96
98
|
accessor layer: FieldPickListLayer | undefined;
|
|
97
99
|
/**
|
|
98
|
-
* If true, renders without a popover.
|
|
100
|
+
* If true, renders without a popover (when true, groups of sub-fields are not supported).
|
|
99
101
|
*
|
|
100
102
|
* @default false
|
|
101
103
|
*/
|
|
102
104
|
accessor listOnly: boolean;
|
|
103
|
-
/** @deprecated use view instead */
|
|
105
|
+
/** @deprecated use view instead. Removal target v6.0.0. */
|
|
104
106
|
accessor mapView: View | undefined;
|
|
105
107
|
/**
|
|
106
108
|
* If true, allows for multiple selection. If false, the
|
|
@@ -116,7 +118,7 @@ export abstract class ArcgisFieldPickList extends LitElement {
|
|
|
116
118
|
/** The initially selected fields. Will use selectedFields[0] when multiple is set to false. */
|
|
117
119
|
accessor selectedFields: string[];
|
|
118
120
|
/**
|
|
119
|
-
* @deprecated use hideCancel instead
|
|
121
|
+
* @deprecated use hideCancel instead. Removal target v6.0.0.
|
|
120
122
|
* @default true
|
|
121
123
|
*/
|
|
122
124
|
accessor showCancel: boolean;
|
|
@@ -145,24 +147,25 @@ export abstract class ArcgisFieldPickList extends LitElement {
|
|
|
145
147
|
*/
|
|
146
148
|
accessor showFieldTypeIcon: boolean;
|
|
147
149
|
/**
|
|
148
|
-
*
|
|
150
|
+
* The number of selectable fields at which to display the top-level filter option. Sub-fields are included.
|
|
149
151
|
*
|
|
150
152
|
* @default 10
|
|
151
153
|
*/
|
|
152
154
|
accessor showFilterLength: number;
|
|
153
155
|
/**
|
|
154
|
-
* If true, displays a 'Select All' button
|
|
156
|
+
* If true, displays a 'Select All' button at the top level of the list. Selection applies directly to any sub-fields.
|
|
157
|
+
* Valid only if multiple is set to true.
|
|
155
158
|
*
|
|
156
159
|
* @default false
|
|
157
160
|
*/
|
|
158
161
|
accessor showSelectionAll: boolean;
|
|
159
162
|
/**
|
|
160
|
-
* @deprecated use hideSort instead
|
|
163
|
+
* @deprecated use hideSort instead. Removal target v6.0.0.
|
|
161
164
|
* @default true
|
|
162
165
|
*/
|
|
163
166
|
accessor showSort: boolean;
|
|
164
167
|
/**
|
|
165
|
-
* The initial sort order.
|
|
168
|
+
* The initial sort order. Sort order applies directly to any sub-fields.
|
|
166
169
|
*
|
|
167
170
|
* @default "default"
|
|
168
171
|
*/
|
|
@@ -187,11 +190,11 @@ export abstract class ArcgisFieldPickList extends LitElement {
|
|
|
187
190
|
readonly arcgisDeleteField: import("@arcgis/lumina").TargetedEvent<this, { fieldName: string; }>;
|
|
188
191
|
/** Emitted when the edit icon of a field has been clicked. The field must have PickListFieldInfo.showEditAction set to true. */
|
|
189
192
|
readonly arcgisEditField: import("@arcgis/lumina").TargetedEvent<this, { fieldName: string; }>;
|
|
190
|
-
/** @deprecated use arcgisChange instead */
|
|
193
|
+
/** @deprecated use arcgisChange instead. Removal target v6.0.0. */
|
|
191
194
|
readonly arcgisFieldPickListChange: import("@arcgis/lumina").TargetedEvent<this, { selectedFields: string[]; }>;
|
|
192
|
-
/** @deprecated use arcgisClose instead */
|
|
195
|
+
/** @deprecated use arcgisClose instead. Removal target v6.0.0. */
|
|
193
196
|
readonly arcgisFieldPickListDismissed: import("@arcgis/lumina").TargetedEvent<this, { selectedFields: string[]; } | void>;
|
|
194
|
-
/** @deprecated use arcgisSortByChange instead */
|
|
197
|
+
/** @deprecated use arcgisSortByChange instead. Removal target v6.0.0. */
|
|
195
198
|
readonly arcgisFieldPickListSortByChange: import("@arcgis/lumina").TargetedEvent<this, LastSortBy>;
|
|
196
199
|
/** Emitted when the field pick list sort order has changed. */
|
|
197
200
|
readonly arcgisSortByChange: import("@arcgis/lumina").TargetedEvent<this, LastSortBy>;
|
|
@@ -1,65 +1,100 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { keyed as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
import { c as b } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as v } from "lit/directives/keyed.js";
|
|
4
|
+
import { repeat as y } from "lit/directives/repeat.js";
|
|
5
|
+
import { LitElement as I, createEvent as h, renderElement as S, nothing as m, safeStyleMap as $, safeClassMap as L } from "@arcgis/lumina";
|
|
6
|
+
import { createRef as p, ref as d } from "lit/directives/ref.js";
|
|
7
|
+
import { html as n, css as x } from "lit";
|
|
8
|
+
import { Task as T } from "@lit/task";
|
|
9
|
+
import { log as w, composeMissingPropertyMessage as k } from "@arcgis/toolkit/log";
|
|
10
|
+
import { F as C } from "../../chunks/internal-types.js";
|
|
11
|
+
import { i as B } from "../../chunks/general.js";
|
|
12
|
+
import { u as E } from "../../chunks/useT9n.js";
|
|
13
|
+
const r = /* @__PURE__ */ new Map();
|
|
14
|
+
r.set("oid", "key");
|
|
15
|
+
r.set("guid", "key");
|
|
16
|
+
r.set("global-id", "key");
|
|
17
|
+
r.set("blob", "binary");
|
|
18
|
+
r.set("integer", "integer");
|
|
19
|
+
r.set("small-integer", "integer");
|
|
20
|
+
r.set("big-integer", "integer");
|
|
21
|
+
r.set("single", "number");
|
|
22
|
+
r.set("double", "number");
|
|
23
|
+
r.set("long", "number");
|
|
24
|
+
r.set("number", "number");
|
|
25
|
+
r.set("date", "date-time");
|
|
26
|
+
r.set("date-only", "calendar");
|
|
27
|
+
r.set("time-only", "clock");
|
|
28
|
+
r.set("timestamp-offset", "time-zone");
|
|
29
|
+
r.set("string", "string");
|
|
30
|
+
const N = ({ fieldType: o }) => n`<calcite-icon scale=s .icon=${r.get(o)}></calcite-icon>`;
|
|
31
|
+
function P(o) {
|
|
32
|
+
return !!o.length && "fields" in o[0];
|
|
33
|
+
}
|
|
34
|
+
function u(o) {
|
|
35
|
+
return !!o.length && "subFieldInfos" in o[0];
|
|
36
|
+
}
|
|
37
|
+
function _(o) {
|
|
38
|
+
return o.filter((e) => u(e.fields));
|
|
39
|
+
}
|
|
40
|
+
function D(o) {
|
|
41
|
+
return o.flatMap((e) => e.fields);
|
|
42
|
+
}
|
|
43
|
+
function O(o) {
|
|
44
|
+
return o.flatMap((e) => u(e.fields) ? [] : e.fields);
|
|
45
|
+
}
|
|
46
|
+
function f(o) {
|
|
47
|
+
return o.flatMap(
|
|
48
|
+
(e) => u(e.fields) ? e.fields.flatMap((t) => t.subFieldInfos) : e.fields
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function A(o, e) {
|
|
52
|
+
return o.flatMap((t) => u(t.fields) ? t.fields.flatMap(
|
|
53
|
+
(i) => i.subFieldInfos.filter((s) => g(s, e, !0))
|
|
54
|
+
) : t.fields.filter((i) => F(i, e)));
|
|
55
|
+
}
|
|
56
|
+
function F(o, e) {
|
|
57
|
+
return e ? "subFieldInfos" in o ? g(o, e) || o.subFieldInfos.some((t) => g(t, e, !0)) : g(o, e) : !0;
|
|
58
|
+
}
|
|
59
|
+
function g(o, e, t = !1) {
|
|
60
|
+
return [t ? o.name.split("/").pop() : o.name, o.alias, o.description].some(
|
|
61
|
+
(s) => s?.toLocaleLowerCase().includes(e.toLocaleLowerCase())
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
const M = x`.panel{min-height:250px}.list-wrapper{max-height:50vh;overflow:auto}.list-controls{display:grid;grid-template-columns:1fr auto}.field-icons{display:flex;align-items:center;padding:0 var(--calcite-space-sm)}.selection-button-div{padding:var(--calcite-space-2xs) var(--calcite-space-sm-plus)}.no-match-text{padding:var(--calcite-space-md)}.footer{width:100%}.add-cancel-buttons{display:flex;align-content:space-between}`;
|
|
65
|
+
class H extends I {
|
|
31
66
|
constructor() {
|
|
32
|
-
super(...arguments), this._messages =
|
|
67
|
+
super(...arguments), this._messages = E({ blocking: !0 }), this.popoverNode = p(), this.listWrapper = p(), this.listNode = p(), this.flowElement = p(), this.panelElement = p(), this.dropdownNode = p(), this.fieldInfoFlowItemEl = p(), this.allLists = [], this.filterText = "", this.panelCutOffHeight = 0, this.initialized = !1, this._propWatcherTask = new T(this, {
|
|
33
68
|
task: async ([e]) => {
|
|
34
|
-
if (!this.listOnly && !
|
|
35
|
-
throw
|
|
69
|
+
if (!this.listOnly && !B(e?.refElement))
|
|
70
|
+
throw w("error", this, k("popoverProps")), new Error();
|
|
36
71
|
this._propWatcherTask.autoRun = !1;
|
|
37
72
|
},
|
|
38
73
|
args: () => [this.popoverProps]
|
|
39
|
-
}), this.fields = [], this.selectedFields = [], this.listOnly = !1, this.showFieldInfo = !1, this.showFieldTypeIcon = !1, this.showFieldName = !1, this.showDescription = !1, this.showSelectionAll = !1, this.showCancel = !0, this.hideCancel = !1, this.showSort = !0, this.hideSort = !1, this.showFilterLength = 10, this.multiple = !1, this.sortBy = "default", this.groupFieldsAndExpressions = !1, this.arcgisChange =
|
|
74
|
+
}), this.fields = [], this.selectedFields = [], this.listOnly = !1, this.showFieldInfo = !1, this.showFieldTypeIcon = !1, this.showFieldName = !1, this.showDescription = !1, this.showSelectionAll = !1, this.showCancel = !0, this.hideCancel = !1, this.showSort = !0, this.hideSort = !1, this.showFilterLength = 10, this.multiple = !1, this.sortBy = "default", this.groupFieldsAndExpressions = !1, this.arcgisChange = h(), this.arcgisClose = h(), this.arcgisDeleteField = h(), this.arcgisEditField = h(), this.arcgisFieldPickListChange = h(), this.arcgisFieldPickListDismissed = h(), this.arcgisFieldPickListSortByChange = h(), this.arcgisSortByChange = h();
|
|
40
75
|
}
|
|
41
76
|
static {
|
|
42
77
|
this.properties = { lastSortBy: 16, filterFields: 16, mapView: 0, view: 0, layer: 0, fields: 0, selectedFields: 0, listOnly: 5, popoverProps: 0, showFieldInfo: 5, showFieldTypeIcon: 5, showFieldName: 5, showDescription: 5, showSelectionAll: 5, showCancel: 5, hideCancel: 5, showSort: 5, hideSort: 5, showFilterLength: 9, multiple: 5, heading: 1, okBtnText: 1, filterPlaceholderText: 1, filterNoResultsText: 1, sortBy: 1, groupFieldsAndExpressions: 5, fieldsGroupHeading: 1, expressionsGroupHeading: 1, customExpressionCheck: 0 };
|
|
43
78
|
}
|
|
44
79
|
static {
|
|
45
|
-
this.styles =
|
|
80
|
+
this.styles = M;
|
|
46
81
|
}
|
|
47
82
|
async reposition() {
|
|
48
83
|
await this.popoverNode.value?.reposition();
|
|
49
84
|
}
|
|
85
|
+
async setDisabled(e) {
|
|
86
|
+
this.panelElement.value && (this.panelElement.value.disabled = e);
|
|
87
|
+
}
|
|
50
88
|
async setFocus() {
|
|
51
89
|
setTimeout(() => requestAnimationFrame(() => {
|
|
52
90
|
this.listOnly ? this.listNode.value?.setFocus() : this.panelElement.value?.setFocus();
|
|
53
91
|
}), 1);
|
|
54
92
|
}
|
|
55
|
-
async setDisabled(e) {
|
|
56
|
-
this.panelElement.value && (this.panelElement.value.disabled = e);
|
|
57
|
-
}
|
|
58
93
|
load() {
|
|
59
|
-
!this.view && this.mapView && (this.view = this.mapView), !this.showCancel && !this.hideCancel && (this.hideCancel = !0), !this.showSort && !this.hideSort && (this.hideSort = !0), this.listOnly && this.showFieldInfo && (this.showFieldInfo = !1,
|
|
94
|
+
!this.view && this.mapView && (this.view = this.mapView), !this.showCancel && !this.hideCancel && (this.hideCancel = !0), !this.showSort && !this.hideSort && (this.hideSort = !0), this.listOnly && this.showFieldInfo && (this.showFieldInfo = !1, w("info", this, "showFieldInfo is not supported if listOnly is true.")), !this.multiple && this.selectedFields.length > 1 && (this.selectedFields = [this.selectedFields[0]]), this.lastSortBy = this.sortBy ?? this.lastSortBy, this.updateGroupedLists(), this.initialized = !0;
|
|
60
95
|
}
|
|
61
96
|
willUpdate(e) {
|
|
62
|
-
(e.has("fields") || e.has("lastSortBy") || e.has("customExpressionCheck")) && this.updateGroupedLists();
|
|
97
|
+
this.initialized && (e.has("fields") || e.has("sortBy") || e.has("lastSortBy") || e.has("customExpressionCheck")) && (e.has("sortBy") && (this.lastSortBy = this.sortBy ?? this.lastSortBy), this.updateGroupedLists());
|
|
63
98
|
}
|
|
64
99
|
loaded() {
|
|
65
100
|
this.setUpObserver(), this.listOnly ? this.listNode.value?.setFocus() : (this.flowElement.value?.setFocus(), this.checkMaxHeight());
|
|
@@ -81,21 +116,21 @@ class L extends w {
|
|
|
81
116
|
const e = this.panelElement.value?.getBoundingClientRect();
|
|
82
117
|
if (e && e.bottom > window.innerHeight) {
|
|
83
118
|
this.panelCutOffHeight = e.height - (e.bottom - window.innerHeight) - 5;
|
|
84
|
-
const t = this.
|
|
85
|
-
t && (this.
|
|
119
|
+
const t = this.listWrapper.value?.getBoundingClientRect();
|
|
120
|
+
t && (this.listWrapper.value.style.maxHeight = `${t.height - (e.bottom - window.innerHeight) - 5}px`);
|
|
86
121
|
}
|
|
87
122
|
}
|
|
88
123
|
}
|
|
89
124
|
getSortedList(e) {
|
|
90
125
|
let t = [...e];
|
|
91
126
|
const i = t.filter((s) => s.type === "none");
|
|
92
|
-
return t = t.filter((s) => s.type !== "none"), this.lastSortBy === "display" ? t.sort((s,
|
|
127
|
+
return t = t.filter((s) => s.type !== "none"), this.lastSortBy === "display" ? t.sort((s, l) => s.alias.localeCompare(l.alias)) : this.lastSortBy === "field" ? t.sort((s, l) => s.name.localeCompare(l.name)) : this.lastSortBy === "type" && t.sort((s, l) => s.type.localeCompare(l.type)), t = t.concat(i), t;
|
|
93
128
|
}
|
|
94
129
|
isExpression(e) {
|
|
95
|
-
return this.customExpressionCheck ? this.customExpressionCheck(e) : e.name.includes(
|
|
130
|
+
return this.customExpressionCheck ? this.customExpressionCheck(e) : e.name.includes(C.expression);
|
|
96
131
|
}
|
|
97
132
|
canDeselectAll() {
|
|
98
|
-
const e = this.
|
|
133
|
+
const e = f(this.allLists);
|
|
99
134
|
return this.filterFields?.length ? this.filterContainsAll() : this.selectedFields.length === e.length;
|
|
100
135
|
}
|
|
101
136
|
filterContainsAll() {
|
|
@@ -103,47 +138,79 @@ class L extends w {
|
|
|
103
138
|
}
|
|
104
139
|
showFieldInfoCheck(e) {
|
|
105
140
|
const { layer: t } = this;
|
|
106
|
-
return this.showFieldInfo ? !(!t || this.isExpression(e) || e.name.includes(
|
|
141
|
+
return this.showFieldInfo ? !(!t || this.isExpression(e) || e.name.includes(C.relationship) || e.type === "none") : !1;
|
|
107
142
|
}
|
|
108
143
|
updateGroupedLists() {
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
title: this.expressionsGroupHeading,
|
|
121
|
-
fields: [...this.getSortedList(this.fields)].filter((t) => this.isExpression(t))
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
title: this.fieldsGroupHeading,
|
|
125
|
-
fields: [...this.getSortedList(this.fields)].filter((t) => !this.isExpression(t))
|
|
144
|
+
if (this.fields)
|
|
145
|
+
if (this.allLists = [], P(this.fields))
|
|
146
|
+
for (const e of this.fields) {
|
|
147
|
+
if (this.listOnly && u(e.fields)) {
|
|
148
|
+
w("error", this, "subFieldInfos are not supported if listOnly is true.");
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
this.allLists.push({
|
|
152
|
+
title: e.title,
|
|
153
|
+
fields: this.getSortedGroupFields(e.fields)
|
|
154
|
+
});
|
|
126
155
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
156
|
+
else
|
|
157
|
+
this.allLists = this.groupFieldsAndExpressions ? [
|
|
158
|
+
{
|
|
159
|
+
title: this.expressionsGroupHeading,
|
|
160
|
+
fields: [...this.getSortedList(this.fields)].filter((e) => this.isExpression(e))
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
title: this.fieldsGroupHeading,
|
|
164
|
+
fields: [...this.getSortedList(this.fields)].filter((e) => !this.isExpression(e))
|
|
165
|
+
}
|
|
166
|
+
] : [
|
|
167
|
+
{
|
|
168
|
+
title: void 0,
|
|
169
|
+
fields: this.getSortedList(this.fields)
|
|
170
|
+
}
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
getSortedGroupFields(e) {
|
|
174
|
+
return u(e) ? this.getSortedList(e).map((t) => ({
|
|
175
|
+
...t,
|
|
176
|
+
subFieldInfos: this.getSortedList(t.subFieldInfos).map((i) => ({
|
|
177
|
+
...i,
|
|
178
|
+
// ensure uniqueness
|
|
179
|
+
name: `${t.name}/${i.name}`
|
|
180
|
+
}))
|
|
181
|
+
})) : this.getSortedList(e);
|
|
133
182
|
}
|
|
134
183
|
addFieldInfoFlowItem(e, t) {
|
|
135
|
-
const i = this.flowElement.value, s =
|
|
136
|
-
|
|
184
|
+
const i = this.flowElement.value, s = S(n`<calcite-flow-item selected .heading=${e.alias ?? e.name} .description=${e.name} class="panel" style=${$(this.panelCutOffHeight > 0 ? `max-height: ${this.panelCutOffHeight}px` : "max-height: 50vh")} @calciteFlowItemBack=${(l) => {
|
|
185
|
+
l.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
|
|
186
|
+
t.setFocus();
|
|
187
|
+
}, 300);
|
|
188
|
+
}} ${d(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang ?? m} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);
|
|
189
|
+
i.appendChild(s), this.panelElement.value.selected = !1, setTimeout(() => {
|
|
190
|
+
this.fieldInfoFlowItemEl?.value.setFocus();
|
|
191
|
+
}, 1);
|
|
192
|
+
}
|
|
193
|
+
addSubFieldInfoFlowItem(e, t) {
|
|
194
|
+
const i = this.flowElement.value, s = e.subFieldInfos.filter((a) => g(a, this.filterText, !0)), l = S(n`<calcite-flow-item selected .heading=${e.alias ?? e.name} .description=${e.description ?? void 0} class="panel" style=${$(this.panelCutOffHeight > 0 ? `max-height: ${this.panelCutOffHeight}px` : "max-height: 50vh")} @calciteFlowItemBack=${(a) => {
|
|
195
|
+
a.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
|
|
137
196
|
t.setFocus();
|
|
138
197
|
}, 300);
|
|
139
|
-
}} ${
|
|
140
|
-
|
|
198
|
+
}} ${d(this.fieldInfoFlowItemEl)}><calcite-list .label=${e.alias ?? e.name} .selectionMode=${this.multiple ? "multiple" : "single"} @calciteListChange=${(a) => {
|
|
199
|
+
this.updateSelectedFieldsForList(a.currentTarget, e.subFieldInfos), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields }), this.multiple || (this.arcgisClose.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields }));
|
|
200
|
+
}}>${s.map((a) => this.renderCalciteListItem(a, !1))}</calcite-list>${this.filterText && !s.length && this.filterNoResultsText?.length !== 0 ? n`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}</calcite-flow-item>`);
|
|
201
|
+
i.appendChild(l), this.panelElement.value.selected = !1, setTimeout(() => {
|
|
202
|
+
this.fieldInfoFlowItemEl.value?.setFocus();
|
|
203
|
+
}, 1);
|
|
141
204
|
}
|
|
142
|
-
|
|
143
|
-
return
|
|
205
|
+
shouldRenderSelectionButton(e) {
|
|
206
|
+
return this.multiple && this.showSelectionAll && (!e || !this.filterText || !!this.filterFields?.length);
|
|
144
207
|
}
|
|
145
|
-
|
|
146
|
-
|
|
208
|
+
handleListSelectionChange(e) {
|
|
209
|
+
this.updateSelectedFieldsForList(this.listNode.value, e), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields }), this.multiple || (this.arcgisClose.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields }));
|
|
210
|
+
}
|
|
211
|
+
updateSelectedFieldsForList(e, t) {
|
|
212
|
+
const i = new Set(t.map((c) => c.name)), s = e.selectedItems.map((c) => c.value), l = this.selectedFields.filter((c) => !i.has(c) || s.includes(c)), a = s.filter((c) => !this.selectedFields.includes(c));
|
|
213
|
+
this.selectedFields = this.multiple ? [.../* @__PURE__ */ new Set([...l, ...a])] : s, this.reorderSelectedFieldsByCurrentListOrder();
|
|
147
214
|
}
|
|
148
215
|
setSortBy(e) {
|
|
149
216
|
this.lastSortBy = e, this.updateGroupedLists(), this.arcgisSortByChange.emit(this.lastSortBy), this.arcgisFieldPickListSortByChange.emit(this.lastSortBy), this.reorderSelectedFieldsByCurrentListOrder() && (this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields }));
|
|
@@ -151,10 +218,10 @@ class L extends w {
|
|
|
151
218
|
reorderSelectedFieldsByCurrentListOrder() {
|
|
152
219
|
if (!this.selectedFields.length)
|
|
153
220
|
return !1;
|
|
154
|
-
const e = this.
|
|
221
|
+
const e = f(this.allLists).map((l) => l.name), t = new Set(this.selectedFields), i = e.filter((l) => t.has(l)), s = (
|
|
155
222
|
// adding/removing fields
|
|
156
223
|
i.length !== this.selectedFields.length || // reordering fields
|
|
157
|
-
i.some((
|
|
224
|
+
i.some((l, a) => l !== this.selectedFields[a])
|
|
158
225
|
);
|
|
159
226
|
return s && (this.selectedFields = [...i]), s;
|
|
160
227
|
}
|
|
@@ -164,64 +231,80 @@ class L extends w {
|
|
|
164
231
|
if (this.listOnly)
|
|
165
232
|
return this.renderList();
|
|
166
233
|
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.popoverProps;
|
|
167
|
-
return this.el.classList.add("js-app-flyout"),
|
|
234
|
+
return this.el.classList.add("js-app-flyout"), v(`${t.autoClose}`, n`<calcite-popover .placement=${t.placement ?? "leading-start"} open pointer-disabled .referenceElement=${t.refElement} .offsetDistance=${t.offsetDistance ?? -Math.round(t.refElement.getBoundingClientRect().width)} .offsetSkidding=${t.offsetSkidding ?? 0} .overlayPositioning=${t.overlayPositioning} trigger-disabled .autoClose=${t.autoClose} .label=${this.heading ?? (this.multiple ? this._messages.headerSelect : this._messages.header) ?? ""} @calcitePopoverClose=${() => {
|
|
168
235
|
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
169
|
-
}} ${
|
|
236
|
+
}} ${d(this.popoverNode)}><calcite-flow style=${$({
|
|
170
237
|
width: `${t.popoverWidth ?? t.refElement.getBoundingClientRect().width}px`,
|
|
171
238
|
...t.maxHeight && { maxHeight: t.maxHeight }
|
|
172
|
-
})} ${
|
|
239
|
+
})} ${d(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${() => {
|
|
173
240
|
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
174
|
-
}} ${
|
|
241
|
+
}} ${d(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple || !this.hideCancel) && n`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple && !this.hideCancel ? n`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>` : n`${this.renderAddButton()}${this.renderCancelButton()}`}</div>` || ""}</calcite-flow-item></calcite-flow></calcite-popover>`);
|
|
175
242
|
},
|
|
176
243
|
error: () => ""
|
|
177
244
|
});
|
|
178
245
|
}
|
|
179
246
|
renderList() {
|
|
180
|
-
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
247
|
+
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = O(this.allLists), i = _(this.allLists), s = f(this.allLists).length >= this.showFilterLength;
|
|
248
|
+
return t.length || i.length ? i.length ? this.renderSplitLists(t, i, s) : this.renderTopLevelOnlyFieldList(e, t, s) : n`<slot name=no-fields></slot>`;
|
|
249
|
+
}
|
|
250
|
+
renderSplitLists(e, t, i) {
|
|
251
|
+
const s = f(this.allLists), l = D(this.allLists).some((a) => F(a, this.filterText));
|
|
252
|
+
return n`${i ? n`<div class="list-controls"><calcite-filter .items=${s} .filterProps=${["name", "alias", "description"]} .placeholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteFilterChange=${(a) => {
|
|
253
|
+
this.filterText = a.currentTarget.value, this.filterFields = this.filterText ? A(this.allLists, this.filterText).map((c) => c.name) : void 0;
|
|
254
|
+
}}></calcite-filter>${this.renderSortButton()}</div>` : null}<div class=${L(this.listOnly ? "" : "list-wrapper")} ${d(this.listWrapper)}>${this.shouldRenderSelectionButton(i) ? this.renderSelectionButton() : null}${this.renderSplitSubFieldLists(t)}${e.length ? this.renderSplitTopLevelFieldList(e, !0) : null}</div>${this.filterText && !l && this.filterNoResultsText?.length !== 0 ? n`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}`;
|
|
255
|
+
}
|
|
256
|
+
renderSplitSubFieldLists(e) {
|
|
257
|
+
const t = e.map((i) => ({
|
|
258
|
+
...i,
|
|
259
|
+
fields: i.fields.filter((s) => F(s, this.filterText))
|
|
260
|
+
})).filter((i) => !!i.fields.length);
|
|
261
|
+
return y(t, (i) => i.title, (i) => n`<calcite-list selection-mode=none .label=${i.title ?? this.heading ?? ""}><calcite-list-item-group .heading=${i.title}>${y(i.fields, (s) => s.name, (s) => n`<calcite-list-item .label=${s.alias || s.name} .description=${this.multiple ? this._messages.subFieldsSelected.replace("${count}", `${s.subFieldInfos.filter((l) => this.selectedFields.includes(l.name)).length}`) : void 0} .value=${s.name} @click=${(l) => this.addSubFieldInfoFlowItem(s, l.currentTarget)} @keydown=${(l) => {
|
|
262
|
+
l.key === "Enter" && this.addSubFieldInfoFlowItem(s, l.currentTarget);
|
|
263
|
+
}}><calcite-icon slot=actions-end icon=chevron-right flip-rtl scale=s></calcite-icon></calcite-list-item>`)}</calcite-list-item-group></calcite-list>`);
|
|
264
|
+
}
|
|
265
|
+
renderSplitTopLevelFieldList(e, t) {
|
|
266
|
+
return n`<calcite-list .label=${this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header)} .selectionMode=${this.multiple ? "multiple" : "single"} @calciteListChange=${() => this.handleListSelectionChange(e)} ${d(this.listNode)}><slot name=content-center></slot>${this.renderGroupedListItems(t)}</calcite-list>`;
|
|
267
|
+
}
|
|
268
|
+
renderTopLevelOnlyFieldList(e, t, i) {
|
|
269
|
+
return n`<div class=${L(this.listOnly ? "" : "list-wrapper")} ${d(this.listWrapper)}><calcite-list .label=${e} .selectionMode=${this.multiple ? "multiple" : "single"} .filterEnabled=${i} .filterPlaceholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteListChange=${() => this.handleListSelectionChange(t)} @calciteListFilter=${(s) => {
|
|
270
|
+
s.stopPropagation(), this.filterFields = this.listNode.value.filteredItems?.map((l) => l.value), this.filterText = this.listNode.value.filterText;
|
|
271
|
+
}} ${d(this.listNode)}>${this.renderSortButton("filter-actions-end")}${this.shouldRenderSelectionButton(i) ? this.renderSelectionButton() : null}<slot name=content-center></slot>${this.renderGroupedListItems(!1)}</calcite-list></div>`;
|
|
272
|
+
}
|
|
273
|
+
renderSortButton(e) {
|
|
274
|
+
const t = f(this.allLists);
|
|
275
|
+
if (!(t.length >= this.showFilterLength && !this.hideSort))
|
|
191
276
|
return "";
|
|
192
|
-
const
|
|
193
|
-
return
|
|
277
|
+
const s = t.every((l) => !!l.type);
|
|
278
|
+
return n`<calcite-dropdown slot=${e ?? m} placement=bottom-end overlay-positioning=fixed @calciteDropdownOpen=${() => {
|
|
194
279
|
this.observer?.disconnect(), this.popoverNode.value && this.observer?.observe(this.popoverNode.value, { attributes: !0 });
|
|
195
|
-
}} @calciteDropdownClose=${() => this.observer?.disconnect()} ${
|
|
196
|
-
s.stopPropagation(), (s.key === " " || s.key === "Enter") && this.setSortBy("default");
|
|
197
|
-
}}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @click=${() => this.setSortBy("display")} @keydown=${(s) => {
|
|
198
|
-
s.stopPropagation(), (s.key === " " || s.key === "Enter") && this.setSortBy("display");
|
|
199
|
-
}}>${this._messages.displayName}</calcite-dropdown-item>${i && l`<calcite-dropdown-item .selected=${this.lastSortBy === "type"} @click=${() => this.setSortBy("type")} @keydown=${(s) => {
|
|
200
|
-
s.stopPropagation(), (s.key === " " || s.key === "Enter") && this.setSortBy("type");
|
|
201
|
-
}}>${this._messages.type}</calcite-dropdown-item>` || ""}<calcite-dropdown-item .selected=${this.lastSortBy === "field"} @click=${() => this.setSortBy("field")} @keydown=${(s) => {
|
|
202
|
-
s.stopPropagation(), (s.key === " " || s.key === "Enter") && this.setSortBy("field");
|
|
203
|
-
}}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
|
|
280
|
+
}} @calciteDropdownClose=${() => this.observer?.disconnect()} ${d(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? m}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @calciteDropdownItemSelect=${() => this.setSortBy("default")}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @calciteDropdownItemSelect=${() => this.setSortBy("display")}>${this._messages.displayName}</calcite-dropdown-item>${s && n`<calcite-dropdown-item .selected=${this.lastSortBy === "type"} @calciteDropdownItemSelect=${() => this.setSortBy("type")}>${this._messages.type}</calcite-dropdown-item>` || ""}<calcite-dropdown-item .selected=${this.lastSortBy === "field"} @calciteDropdownItemSelect=${() => this.setSortBy("field")}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
|
|
204
281
|
}
|
|
205
282
|
renderSelectionButton() {
|
|
206
|
-
return
|
|
283
|
+
return n`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${() => {
|
|
207
284
|
if (this.canDeselectAll())
|
|
208
285
|
this.selectedFields = this.filterFields?.length ? this.selectedFields.filter((e) => !this.filterFields?.includes(e)) : [];
|
|
209
286
|
else if (this.filterFields?.length)
|
|
210
287
|
this.selectedFields = [.../* @__PURE__ */ new Set([...this.selectedFields, ...this.filterFields])];
|
|
211
288
|
else {
|
|
212
|
-
const t = this.
|
|
289
|
+
const t = f(this.allLists);
|
|
213
290
|
this.selectedFields = t.map((i) => i.name);
|
|
214
291
|
}
|
|
215
292
|
this.reorderSelectedFieldsByCurrentListOrder(), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
|
|
216
293
|
}}>${this.canDeselectAll() ? this._messages.deselectAll : this._messages.selectAll}</calcite-button></div>`;
|
|
217
294
|
}
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
|
|
295
|
+
renderGroupedListItems(e) {
|
|
296
|
+
const t = this.allLists.filter((i) => !!i.fields.length && !u(i.fields)).map((i) => ({
|
|
297
|
+
...i,
|
|
298
|
+
fields: e ? i.fields.filter((s) => F(s, this.filterText)) : i.fields
|
|
299
|
+
})).filter((i) => !!i.fields.length);
|
|
300
|
+
return t.length === 1 && !t[0].title ? this.renderListItems(t[0].fields) : t.map((s) => n`<calcite-list-item-group .heading=${s.title}>${this.renderListItems(s.fields)}</calcite-list-item-group>`);
|
|
301
|
+
}
|
|
302
|
+
renderListItems(e) {
|
|
303
|
+
return e.map((t) => this.renderCalciteListItem(t));
|
|
221
304
|
}
|
|
222
|
-
renderCalciteListItem(e) {
|
|
223
|
-
const
|
|
224
|
-
return
|
|
305
|
+
renderCalciteListItem(e, t = !0) {
|
|
306
|
+
const i = t && this.showFieldInfoCheck(e), s = this.showFieldTypeIcon && !!e.type;
|
|
307
|
+
return v(e.name, n`<calcite-list-item .label=${e.alias || e.name} .description=${(() => {
|
|
225
308
|
if (this.showFieldName && e.hideFieldName !== !0)
|
|
226
309
|
return `{${e.name}}`;
|
|
227
310
|
if (this.showDescription && e.hideDescription !== !0 && e.description)
|
|
@@ -229,40 +312,40 @@ class L extends w {
|
|
|
229
312
|
})()} .value=${e.name} .selected=${!this.multiple && e.name === this.selectedFields[0] || this.multiple && this.selectedFields.includes(e.name)} .metadata=${{
|
|
230
313
|
label: e.alias,
|
|
231
314
|
fieldName: e.name
|
|
232
|
-
}}>${
|
|
315
|
+
}}>${s && n`<div slot=actions-end class="field-icons">${N({ fieldType: e.type })}</div>` || ""}${this.renderInfoAction(e, i)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`);
|
|
233
316
|
}
|
|
234
317
|
renderInfoAction(e, t) {
|
|
235
318
|
const { _messages: i } = this;
|
|
236
|
-
return t ?
|
|
319
|
+
return t ? n`<calcite-action slot=actions-end .text=${i.info} title=${i.info ?? m} scale=s icon=information @click=${(s) => {
|
|
237
320
|
s.stopPropagation();
|
|
238
|
-
const
|
|
239
|
-
this.addFieldInfoFlowItem(e,
|
|
321
|
+
const l = s.currentTarget;
|
|
322
|
+
this.addFieldInfoFlowItem(e, l);
|
|
240
323
|
}}></calcite-action>` : "";
|
|
241
324
|
}
|
|
242
325
|
renderEditAction(e) {
|
|
243
326
|
const { _messages: t } = this;
|
|
244
|
-
return e.showEditAction ?
|
|
327
|
+
return e.showEditAction ? n`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit ?? m} scale=s icon=pencil @click=${(i) => {
|
|
245
328
|
i.stopPropagation(), this.arcgisEditField.emit({ fieldName: e.name });
|
|
246
329
|
}}></calcite-action>` : "";
|
|
247
330
|
}
|
|
248
331
|
renderDeleteAction(e) {
|
|
249
332
|
const { _messages: t } = this;
|
|
250
|
-
return e.showDeleteAction ?
|
|
333
|
+
return e.showDeleteAction ? n`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete ?? m} scale=s icon=trash @click=${(i) => {
|
|
251
334
|
i.stopPropagation(), this.arcgisDeleteField.emit({ fieldName: e.name });
|
|
252
335
|
}}></calcite-action>` : "";
|
|
253
336
|
}
|
|
254
337
|
renderAddButton() {
|
|
255
|
-
return this.multiple ?
|
|
338
|
+
return this.multiple ? n`<calcite-button .appearance=${this.hideCancel ? "outline-fill" : "solid"} .width=${this.hideCancel ? "full" : "half"} @click=${() => {
|
|
256
339
|
this.arcgisClose.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
|
|
257
340
|
}}>${this.okBtnText || (this.multiple ? this._messages.done : this._messages.ok)}</calcite-button>` : "";
|
|
258
341
|
}
|
|
259
342
|
renderCancelButton() {
|
|
260
|
-
return this.hideCancel ? "" :
|
|
343
|
+
return this.hideCancel ? "" : n`<calcite-button appearance=outline-fill .width=${this.multiple ? "half" : "full"} @click=${() => {
|
|
261
344
|
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
262
345
|
}}>${this._messages.cancel}</calcite-button>`;
|
|
263
346
|
}
|
|
264
347
|
}
|
|
265
|
-
|
|
348
|
+
b("arcgis-field-pick-list", H);
|
|
266
349
|
export {
|
|
267
|
-
|
|
350
|
+
H as ArcgisFieldPickList
|
|
268
351
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import "@esri/calcite-components/components/calcite-icon";
|
|
2
2
|
import "@esri/calcite-components/components/calcite-flow-item";
|
|
3
3
|
import "../arcgis-field-info/index.js";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-list";
|
|
4
5
|
import "@esri/calcite-components/components/calcite-popover";
|
|
5
6
|
import "@esri/calcite-components/components/calcite-flow";
|
|
6
|
-
import "@esri/calcite-components/components/calcite-
|
|
7
|
+
import "@esri/calcite-components/components/calcite-filter";
|
|
8
|
+
import "@esri/calcite-components/components/calcite-list-item-group";
|
|
9
|
+
import "@esri/calcite-components/components/calcite-list-item";
|
|
7
10
|
import "@esri/calcite-components/components/calcite-dropdown";
|
|
8
11
|
import "@esri/calcite-components/components/calcite-action";
|
|
9
12
|
import "@esri/calcite-components/components/calcite-dropdown-group";
|
|
10
13
|
import "@esri/calcite-components/components/calcite-dropdown-item";
|
|
11
14
|
import "@esri/calcite-components/components/calcite-button";
|
|
12
|
-
import "@esri/calcite-components/components/calcite-list-item-group";
|
|
13
|
-
import "@esri/calcite-components/components/calcite-list-item";
|
|
14
15
|
export * from "./customElement.js";
|