@arcgis/common-components 5.2.0-next.103 → 5.2.0-next.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{KCTVPWKZ.js → 3TIDAJES.js} +1 -1
- package/dist/cdn/{MI3POVS3.js → 4DL4CQMD.js} +1 -1
- package/dist/cdn/{VILUEVNS.js → 4O3NDSCB.js} +1 -1
- package/dist/cdn/{2PEF5AVV.js → 76AEYDPR.js} +1 -1
- package/dist/cdn/{7RMMYGBW.js → 7CY3QEZW.js} +1 -1
- package/dist/cdn/{BEODRJOB.js → 7VETJO2V.js} +1 -1
- package/dist/cdn/{TXXMMPA6.js → 7XSCHHGO.js} +1 -1
- package/dist/cdn/AY6QNI6M.js +2 -0
- package/dist/cdn/{FEREAY2X.js → BOMP3AYJ.js} +1 -1
- package/dist/cdn/{DGU6DCZP.js → BQCBHDME.js} +1 -1
- package/dist/cdn/{ODCJ6CWI.js → CEXP5DLE.js} +1 -1
- package/dist/cdn/{6PGCMA3Z.js → EESAFFL6.js} +1 -1
- package/dist/cdn/{Y42WUDYP.js → EO2W4XX2.js} +1 -1
- package/dist/cdn/{LSIDKRJW.js → EQ7Q27AM.js} +1 -1
- package/dist/cdn/F55DGSXH.js +2 -0
- package/dist/cdn/{77PLMLQX.js → FQKMFVEL.js} +1 -1
- package/dist/cdn/{DJELJSO3.js → FQRP2RUU.js} +1 -1
- package/dist/cdn/{L5FYKALB.js → FRL73WUI.js} +1 -1
- package/dist/cdn/{BGE7ETFU.js → H4B7RWSC.js} +1 -1
- package/dist/cdn/{E6NBHGTX.js → IXISGCNR.js} +1 -1
- package/dist/cdn/{3NPK3XHQ.js → JH47GD45.js} +1 -1
- package/dist/cdn/{VENSWYOD.js → JLF6J4PV.js} +1 -1
- package/dist/cdn/{QSAZAXZ3.js → LLKF5IUE.js} +1 -1
- package/dist/cdn/{BJHMVEBH.js → M7RV4JOU.js} +1 -1
- package/dist/cdn/{ZLUCRCS4.js → MYCSWWIQ.js} +1 -1
- package/dist/cdn/{5PTU24YF.js → NANUDTUO.js} +1 -1
- package/dist/cdn/{3RMCUQWC.js → NUJU53OQ.js} +1 -1
- package/dist/cdn/{RP5JQ3O2.js → Q7X4435G.js} +1 -1
- package/dist/cdn/{AD4MYZ4B.js → RYAF2CEQ.js} +1 -1
- package/dist/cdn/SM5735TW.js +2 -0
- package/dist/cdn/{X3GTWZD5.js → SWYNNHSD.js} +1 -1
- package/dist/cdn/U4P7UKY3.js +2 -0
- package/dist/cdn/{HL3WXOVS.js → VL3L3YNC.js} +1 -1
- package/dist/cdn/WJZHHIWO.js +4 -0
- package/dist/cdn/{AFHSFRPM.js → XWGTFIHC.js} +1 -1
- package/dist/cdn/ZQJCCG4K.js +2 -0
- package/dist/cdn/assets/field-pick-list/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +8 -5
- package/dist/components/arcgis-field-pick-list/customElement.js +205 -118
- package/dist/components/arcgis-field-pick-list/index.js +4 -3
- 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/utils/types.d.ts +14 -1
- package/package.json +4 -4
- package/dist/cdn/56FZY46A.js +0 -2
- package/dist/cdn/7HJ55YSN.js +0 -2
- package/dist/cdn/B57H5R7I.js +0 -2
- package/dist/cdn/EWNQZP7X.js +0 -2
- package/dist/cdn/KMEK46VM.js +0 -4
- package/dist/cdn/NH4LEYDW.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"ok":"Replace","done":"Done","cancel":"Cancel","back":"Back","header":"Replace field","headerSelect":"Select fields","filter":"Search fields","info":"Info","edit":"Edit","delete":"Delete","displayName":"Display name","type":"Type","default":"Default","fieldName":"Field name","sort":"Sort","selectAll":"Select all","deselectAll":"Deselect all","noMatches":"No matches found."}
|
|
1
|
+
{"ok":"Replace","done":"Done","cancel":"Cancel","back":"Back","header":"Replace field","headerSelect":"Select fields","filter":"Search fields","info":"Info","edit":"Edit","delete":"Delete","displayName":"Display name","type":"Type","default":"Default","fieldName":"Field name","sort":"Sort","selectAll":"Select all","deselectAll":"Deselect all","subFieldsSelected":"${count} selected","noMatches":"No matches found."}
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{O as a,y as e}from"./WJZHHIWO.js";var i=e(a,{"arcgis-ckeditor5":[()=>import("./BQCBHDME.js"),"canResizeVertically,currentLanguage,customConfig,customExpressionCheck:,editorType,groupFieldsAndExpressions,intlExpressionsGroupHeading,intlFieldsGroupHeading,intlTextPlaceHolder,mentionFields:,readOnly,textData;getData,setFocus"],"arcgis-ckeditor5-popover":[()=>import("./AY6QNI6M.js"),"guid,intlCancel,intlLabel,intlOk,refElement:;reposition"],"arcgis-color-input":[()=>import("./U4P7UKY3.js"),"_messages:,clearable,color,compact,disabled,hideRecentColors,messageOverrides:,placement,popoverProps:,showTransparency,storageId;close,setFocus;isOpen"],"arcgis-coordinate-system-picker":[()=>import("./ZQJCCG4K.js"),"_messages:,autoFilterToDefault,defaultWkid,filterEnabled,hideCategories:,value:;getSRDescription"],"arcgis-coordinate-system-picker-tree":[()=>import("./RYAF2CEQ.js"),"data:,value"],"arcgis-field-info":[()=>import("./4O3NDSCB.js"),"_messages:,fieldName,hideAlias,hideNumericFormat,hideStatistics,layer:,view:;refresh"],"arcgis-field-pick-list":[()=>import("./F55DGSXH.js"),"_messages:,customExpressionCheck:,expressionsGroupHeading,fields:,fieldsGroupHeading,filterNoResultsText,filterPlaceholderText,groupFieldsAndExpressions,heading,hideCancel,hideSort,layer:,listOnly,mapView:,multiple,okBtnText,popoverProps:,selectedFields:,showCancel,showDescription,showFieldInfo,showFieldName,showFieldTypeIcon,showFilterLength,showSelectionAll,showSort,sortBy,view:;reposition,setDisabled,setFocus"],"arcgis-histogram":[()=>import("./VL3L3YNC.js"),"_messages:,average,bins:,colorBlendingEnabled,colorStops:,dataLines:,icon,label,labelFormatter:,layout,max,messageOverrides:,min,standardDeviation,standardDeviationCount"],"arcgis-label-input":[()=>import("./76AEYDPR.js"),"alignment,editing,labelFormatter:,readOnly,value;edit;getLabelBoundingClientRect"],"arcgis-picker-input":[()=>import("./4DL4CQMD.js"),"disabled,heading,iconEnd,intlDone,label,popoverProps:;close,setFocus"],"arcgis-ramp-color":[()=>import("./LLKF5IUE.js"),"layout,max,min,stops:"],"arcgis-ramp-color-break":[()=>import("./7XSCHHGO.js"),"layout,max,min,stops:"],"arcgis-ramp-opacity":[()=>import("./7CY3QEZW.js"),"fillColor,layout,max,min,stops:"],"arcgis-slider":[()=>import("./SWYNNHSD.js"),"activeValue:,allowValuesOverlap,autoDestroyDisabled,disabled,fillPlacement,fullRangeMax,fullRangeMin,keyboardLargeStep,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverDisplay,popoverLabel,popoverPlacement,precision,rangeLabelsEditingEnabled,rangeLabelsPlacement,segmentsDraggingDisabled,showRangeLabels,steps,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values;destroy"],"arcgis-slider-field":[()=>import("./M7RV4JOU.js"),"activeValue:,disabled,fieldType,fillPlacement,label,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverLabel,rangeLabelsEditingEnabled,rangeLabelsPlacement,showRangeLabels,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values,valuesAsDateOnly:,valuesAsFieldType:,valuesAsNumbers:,valuesAsTimeOnly:,valuesAsTimestampOffset:"],"arcgis-slider-histogram-range":[()=>import("./FQRP2RUU.js"),"activeValue:,average,bins:,dataLines:,excludedBarColor:,fieldType,fillPlacement,includedBarColor:,label,labelFormatter:,layout,max,min,rangeLabelsEditingEnabled,rangeLabelsPlacement,showRangeLabels,standardDeviation,standardDeviationCount,valueLabelsDisplay,valueLabelsEditingEnabled,values;destroy,generateWhereClause,updateFromHistogramResult"],"arcgis-slider-input":[()=>import("./IXISGCNR.js"),"disabled,flipLabels,label,max,min,scale,step,unitsLabel,value,withSteppers"],"arcgis-ticks":[()=>import("./CEXP5DLE.js"),"interactive,interpolationExponent,labelFormatter:,labelPlacement,layout,max,min,mirrored,mode,showBaseline,showLabels,values"],"arcgis-toolbar":[()=>import("./NANUDTUO.js"),"barElement:,layout,relativePosition,scale,toolbarKind,tooltipAppearance"],"arcgis-toolbar-action":[()=>import("./EO2W4XX2.js"),"actionElement:,active,appearance,disabled,icon,iconFlipRtl,indicator,kind,labelText,loading,textEnabled,tooltipText;;measure,proxiedRender"],"arcgis-toolbar-group":[()=>import("./NUJU53OQ.js"),"preferEndSlot,priority;;measure,proxiedRender"],"arcgis-toolbar-item":[()=>import("./EESAFFL6.js"),"actionElement:,active,disabled,icon,iconFlipRtl,labelText,lastActivated:,loading,tooltipText;;measure,proxiedRender"],"arcgis-toolbar-more-button":[()=>import("./FQKMFVEL.js"),"menuAppearance,overflowActionLabel,priority;;measure,proxiedRender"],"arcgis-toolbar-split-button":[()=>import("./Q7X4435G.js"),"menuAppearance,overflowActionLabel,priority;;measure,proxiedRender"],"arcgis-unique-values-list":[()=>import("./JH47GD45.js"),"_messages:,fieldName,layer:,maxHeight,multiple,numberFormatOptions:,partialUniqueValues,selectedValues:,showFilterLength,sortBy,uniqueValues:,view:,visualizationSource;getUniqueValues,setFocus"],"arcgis-value-picker":[()=>import("./EQ7Q27AM.js"),"autoDestroyDisabled,disabled,hideNextButton,hidePlayButton,hidePreviousButton,icon,label,layout,loop,messages:,playRate,state:;destroy;next,pause,play,previous"],"arcgis-value-picker-collection":[()=>import("./7VETJO2V.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,items:;destroy;reset,step"],"arcgis-value-picker-combobox":[()=>import("./MYCSWWIQ.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,disabled,items:,messages:;destroy;reset,step"],"arcgis-value-picker-label":[()=>import("./FRL73WUI.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,items:;destroy;reset,step"],"arcgis-value-picker-slider":[()=>import("./3TIDAJES.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue,disabled,labelFormatter:,labels:,layout,majorTicks:,max,min,minorTicks:,mirrored,steps:;destroy;reset,step"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-ckeditor5,arcgis-ckeditor5-popover,arcgis-color-input,arcgis-coordinate-system-picker,arcgis-coordinate-system-picker-tree,arcgis-field-info,arcgis-field-pick-list,arcgis-histogram,arcgis-label-input,arcgis-picker-input,arcgis-ramp-color,arcgis-ramp-color-break,arcgis-ramp-opacity,arcgis-slider,arcgis-slider-field,arcgis-slider-histogram-range,arcgis-slider-input,arcgis-ticks,arcgis-toolbar,arcgis-toolbar-action,arcgis-toolbar-group,arcgis-toolbar-item,arcgis-toolbar-more-button,arcgis-toolbar-split-button,arcgis-unique-values-list,arcgis-value-picker,arcgis-value-picker-collection,arcgis-value-picker-combobox,arcgis-value-picker-label,arcgis-value-picker-slider){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,a)
|
|
@@ -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. */
|
|
@@ -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,7 +97,7 @@ 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
|
*/
|
|
@@ -145,13 +147,14 @@ 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
|
*/
|
|
@@ -162,7 +165,7 @@ export abstract class ArcgisFieldPickList extends LitElement {
|
|
|
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
|
*/
|
|
@@ -1,48 +1,83 @@
|
|
|
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 o, 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: n }) => o`<calcite-icon scale=s .icon=${r.get(n)}></calcite-icon>`;
|
|
31
|
+
function P(n) {
|
|
32
|
+
return !!n.length && "fields" in n[0];
|
|
33
|
+
}
|
|
34
|
+
function u(n) {
|
|
35
|
+
return !!n.length && "subFieldInfos" in n[0];
|
|
36
|
+
}
|
|
37
|
+
function _(n) {
|
|
38
|
+
return n.filter((e) => u(e.fields));
|
|
39
|
+
}
|
|
40
|
+
function D(n) {
|
|
41
|
+
return n.flatMap((e) => e.fields);
|
|
42
|
+
}
|
|
43
|
+
function O(n) {
|
|
44
|
+
return n.flatMap((e) => u(e.fields) ? [] : e.fields);
|
|
45
|
+
}
|
|
46
|
+
function f(n) {
|
|
47
|
+
return n.flatMap(
|
|
48
|
+
(e) => u(e.fields) ? e.fields.flatMap((t) => t.subFieldInfos) : e.fields
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function A(n, e) {
|
|
52
|
+
return n.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(n, e) {
|
|
57
|
+
return e ? "subFieldInfos" in n ? g(n, e) || n.subFieldInfos.some((t) => g(t, e, !0)) : g(n, e) : !0;
|
|
58
|
+
}
|
|
59
|
+
function g(n, e, t = !1) {
|
|
60
|
+
return [t ? n.name.split("/").pop() : n.name, n.alias, n.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();
|
|
@@ -56,7 +91,7 @@ class I extends y {
|
|
|
56
91
|
}), 1);
|
|
57
92
|
}
|
|
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
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());
|
|
@@ -81,21 +116,21 @@ class I extends y {
|
|
|
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
|
-
const
|
|
92
|
-
return t = t.filter((
|
|
126
|
+
const i = t.filter((s) => s.type === "none");
|
|
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,75 @@ class I extends y {
|
|
|
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))
|
|
126
|
-
}
|
|
127
|
-
] : [
|
|
128
|
-
{
|
|
129
|
-
title: void 0,
|
|
130
|
-
fields: [...this.getSortedList(this.fields)]
|
|
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
|
+
});
|
|
131
155
|
}
|
|
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
|
|
136
|
-
|
|
184
|
+
const i = this.flowElement.value, s = S(o`<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(() => {
|
|
137
186
|
t.setFocus();
|
|
138
187
|
}, 300);
|
|
139
|
-
}} ${
|
|
140
|
-
|
|
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(() => this.fieldInfoFlowItemEl?.value.setFocus(), 1);
|
|
141
190
|
}
|
|
142
|
-
|
|
143
|
-
|
|
191
|
+
addSubFieldInfoFlowItem(e, t) {
|
|
192
|
+
const i = this.flowElement.value, s = e.subFieldInfos.filter((a) => g(a, this.filterText, !0)), l = S(o`<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) => {
|
|
193
|
+
a.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
|
|
194
|
+
t.setFocus();
|
|
195
|
+
}, 300);
|
|
196
|
+
}} ${d(this.fieldInfoFlowItemEl)}><calcite-list .label=${e.alias ?? e.name} .selectionMode=${this.multiple ? "multiple" : "single"} @calciteListChange=${(a) => {
|
|
197
|
+
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 }));
|
|
198
|
+
}}>${s.map((a) => this.renderCalciteListItem(a, !1))}</calcite-list>${this.filterText && !s.length && this.filterNoResultsText?.length !== 0 ? o`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}</calcite-flow-item>`);
|
|
199
|
+
i.appendChild(l), this.panelElement.value.selected = !1, setTimeout(() => this.fieldInfoFlowItemEl.value?.setFocus(), 1);
|
|
144
200
|
}
|
|
145
|
-
|
|
146
|
-
return this.
|
|
201
|
+
shouldRenderSelectionButton(e) {
|
|
202
|
+
return this.multiple && this.showSelectionAll && (!e || !this.filterText || !!this.filterFields?.length);
|
|
203
|
+
}
|
|
204
|
+
handleListSelectionChange(e) {
|
|
205
|
+
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 }));
|
|
206
|
+
}
|
|
207
|
+
updateSelectedFieldsForList(e, t) {
|
|
208
|
+
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));
|
|
209
|
+
this.selectedFields = this.multiple ? [.../* @__PURE__ */ new Set([...l, ...a])] : s, this.reorderSelectedFieldsByCurrentListOrder();
|
|
147
210
|
}
|
|
148
211
|
setSortBy(e) {
|
|
149
212
|
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,12 +214,12 @@ class I extends y {
|
|
|
151
214
|
reorderSelectedFieldsByCurrentListOrder() {
|
|
152
215
|
if (!this.selectedFields.length)
|
|
153
216
|
return !1;
|
|
154
|
-
const e = this.
|
|
217
|
+
const e = f(this.allLists).map((l) => l.name), t = new Set(this.selectedFields), i = e.filter((l) => t.has(l)), s = (
|
|
155
218
|
// adding/removing fields
|
|
156
|
-
|
|
157
|
-
|
|
219
|
+
i.length !== this.selectedFields.length || // reordering fields
|
|
220
|
+
i.some((l, a) => l !== this.selectedFields[a])
|
|
158
221
|
);
|
|
159
|
-
return
|
|
222
|
+
return s && (this.selectedFields = [...i]), s;
|
|
160
223
|
}
|
|
161
224
|
render() {
|
|
162
225
|
return this._propWatcherTask.render({
|
|
@@ -164,56 +227,80 @@ class I extends y {
|
|
|
164
227
|
if (this.listOnly)
|
|
165
228
|
return this.renderList();
|
|
166
229
|
const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.popoverProps;
|
|
167
|
-
return this.el.classList.add("js-app-flyout"),
|
|
230
|
+
return this.el.classList.add("js-app-flyout"), v(`${t.autoClose}`, o`<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
231
|
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
169
|
-
}} ${
|
|
232
|
+
}} ${d(this.popoverNode)}><calcite-flow style=${$({
|
|
170
233
|
width: `${t.popoverWidth ?? t.refElement.getBoundingClientRect().width}px`,
|
|
171
234
|
...t.maxHeight && { maxHeight: t.maxHeight }
|
|
172
|
-
})} ${
|
|
235
|
+
})} ${d(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${() => {
|
|
173
236
|
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
174
|
-
}} ${
|
|
237
|
+
}} ${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) && o`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple && !this.hideCancel ? o`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>` : o`${this.renderAddButton()}${this.renderCancelButton()}`}</div>` || ""}</calcite-flow-item></calcite-flow></calcite-popover>`);
|
|
175
238
|
},
|
|
176
239
|
error: () => ""
|
|
177
240
|
});
|
|
178
241
|
}
|
|
179
242
|
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
|
-
|
|
243
|
+
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;
|
|
244
|
+
return t.length || i.length ? i.length ? this.renderSplitLists(t, i, s) : this.renderTopLevelOnlyFieldList(e, t, s) : o`<slot name=no-fields></slot>`;
|
|
245
|
+
}
|
|
246
|
+
renderSplitLists(e, t, i) {
|
|
247
|
+
const s = f(this.allLists), l = D(this.allLists).some((a) => F(a, this.filterText));
|
|
248
|
+
return o`${i ? o`<div class="list-controls"><calcite-filter .items=${s} .filterProps=${["name", "alias", "description"]} .placeholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteFilterChange=${(a) => {
|
|
249
|
+
this.filterText = a.currentTarget.value, this.filterFields = this.filterText ? A(this.allLists, this.filterText).map((c) => c.name) : void 0;
|
|
250
|
+
}}></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 ? o`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}`;
|
|
251
|
+
}
|
|
252
|
+
renderSplitSubFieldLists(e) {
|
|
253
|
+
const t = e.map((i) => ({
|
|
254
|
+
...i,
|
|
255
|
+
fields: i.fields.filter((s) => F(s, this.filterText))
|
|
256
|
+
})).filter((i) => !!i.fields.length);
|
|
257
|
+
return y(t, (i) => i.title, (i) => o`<calcite-list selection-mode=none .label=${i.title ?? this.heading ?? ""}><calcite-list-item-group .heading=${i.title}>${y(i.fields, (s) => s.name, (s) => o`<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) => {
|
|
258
|
+
l.key === "Enter" && this.addSubFieldInfoFlowItem(s, l.currentTarget);
|
|
259
|
+
}}><calcite-icon slot=actions-end icon=chevron-right flip-rtl scale=s></calcite-icon></calcite-list-item>`)}</calcite-list-item-group></calcite-list>`);
|
|
260
|
+
}
|
|
261
|
+
renderSplitTopLevelFieldList(e, t) {
|
|
262
|
+
return o`<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>`;
|
|
263
|
+
}
|
|
264
|
+
renderTopLevelOnlyFieldList(e, t, i) {
|
|
265
|
+
return o`<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) => {
|
|
266
|
+
s.stopPropagation(), this.filterFields = this.listNode.value.filteredItems?.map((l) => l.value), this.filterText = this.listNode.value.filterText;
|
|
267
|
+
}} ${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>`;
|
|
268
|
+
}
|
|
269
|
+
renderSortButton(e) {
|
|
270
|
+
const t = f(this.allLists);
|
|
271
|
+
if (!(t.length >= this.showFilterLength && !this.hideSort))
|
|
191
272
|
return "";
|
|
192
|
-
const s =
|
|
193
|
-
return
|
|
273
|
+
const s = t.every((l) => !!l.type);
|
|
274
|
+
return o`<calcite-dropdown slot=${e ?? m} placement=bottom-end overlay-positioning=fixed @calciteDropdownOpen=${() => {
|
|
194
275
|
this.observer?.disconnect(), this.popoverNode.value && this.observer?.observe(this.popoverNode.value, { attributes: !0 });
|
|
195
|
-
}} @calciteDropdownClose=${() => this.observer?.disconnect()} ${
|
|
276
|
+
}} @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 && o`<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>`;
|
|
196
277
|
}
|
|
197
278
|
renderSelectionButton() {
|
|
198
|
-
return
|
|
279
|
+
return o`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${() => {
|
|
199
280
|
if (this.canDeselectAll())
|
|
200
281
|
this.selectedFields = this.filterFields?.length ? this.selectedFields.filter((e) => !this.filterFields?.includes(e)) : [];
|
|
201
282
|
else if (this.filterFields?.length)
|
|
202
283
|
this.selectedFields = [.../* @__PURE__ */ new Set([...this.selectedFields, ...this.filterFields])];
|
|
203
284
|
else {
|
|
204
|
-
const t = this.
|
|
205
|
-
this.selectedFields = t.map((
|
|
285
|
+
const t = f(this.allLists);
|
|
286
|
+
this.selectedFields = t.map((i) => i.name);
|
|
206
287
|
}
|
|
207
288
|
this.reorderSelectedFieldsByCurrentListOrder(), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
|
|
208
289
|
}}>${this.canDeselectAll() ? this._messages.deselectAll : this._messages.selectAll}</calcite-button></div>`;
|
|
209
290
|
}
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
|
|
291
|
+
renderGroupedListItems(e) {
|
|
292
|
+
const t = this.allLists.filter((i) => !!i.fields.length && !u(i.fields)).map((i) => ({
|
|
293
|
+
...i,
|
|
294
|
+
fields: e ? i.fields.filter((s) => F(s, this.filterText)) : i.fields
|
|
295
|
+
})).filter((i) => !!i.fields.length);
|
|
296
|
+
return t.length === 1 && !t[0].title ? this.renderListItems(t[0].fields) : t.map((s) => o`<calcite-list-item-group .heading=${s.title}>${this.renderListItems(s.fields)}</calcite-list-item-group>`);
|
|
297
|
+
}
|
|
298
|
+
renderListItems(e) {
|
|
299
|
+
return e.map((t) => this.renderCalciteListItem(t));
|
|
213
300
|
}
|
|
214
|
-
renderCalciteListItem(e) {
|
|
215
|
-
const
|
|
216
|
-
return
|
|
301
|
+
renderCalciteListItem(e, t = !0) {
|
|
302
|
+
const i = t && this.showFieldInfoCheck(e), s = this.showFieldTypeIcon && !!e.type;
|
|
303
|
+
return v(e.name, o`<calcite-list-item .label=${e.alias || e.name} .description=${(() => {
|
|
217
304
|
if (this.showFieldName && e.hideFieldName !== !0)
|
|
218
305
|
return `{${e.name}}`;
|
|
219
306
|
if (this.showDescription && e.hideDescription !== !0 && e.description)
|
|
@@ -221,40 +308,40 @@ class I extends y {
|
|
|
221
308
|
})()} .value=${e.name} .selected=${!this.multiple && e.name === this.selectedFields[0] || this.multiple && this.selectedFields.includes(e.name)} .metadata=${{
|
|
222
309
|
label: e.alias,
|
|
223
310
|
fieldName: e.name
|
|
224
|
-
}}>${s &&
|
|
311
|
+
}}>${s && o`<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>`);
|
|
225
312
|
}
|
|
226
313
|
renderInfoAction(e, t) {
|
|
227
|
-
const { _messages:
|
|
228
|
-
return t ?
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
this.addFieldInfoFlowItem(e,
|
|
314
|
+
const { _messages: i } = this;
|
|
315
|
+
return t ? o`<calcite-action slot=actions-end .text=${i.info} title=${i.info ?? m} scale=s icon=information @click=${(s) => {
|
|
316
|
+
s.stopPropagation();
|
|
317
|
+
const l = s.currentTarget;
|
|
318
|
+
this.addFieldInfoFlowItem(e, l);
|
|
232
319
|
}}></calcite-action>` : "";
|
|
233
320
|
}
|
|
234
321
|
renderEditAction(e) {
|
|
235
322
|
const { _messages: t } = this;
|
|
236
|
-
return e.showEditAction ?
|
|
237
|
-
|
|
323
|
+
return e.showEditAction ? o`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit ?? m} scale=s icon=pencil @click=${(i) => {
|
|
324
|
+
i.stopPropagation(), this.arcgisEditField.emit({ fieldName: e.name });
|
|
238
325
|
}}></calcite-action>` : "";
|
|
239
326
|
}
|
|
240
327
|
renderDeleteAction(e) {
|
|
241
328
|
const { _messages: t } = this;
|
|
242
|
-
return e.showDeleteAction ?
|
|
243
|
-
|
|
329
|
+
return e.showDeleteAction ? o`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete ?? m} scale=s icon=trash @click=${(i) => {
|
|
330
|
+
i.stopPropagation(), this.arcgisDeleteField.emit({ fieldName: e.name });
|
|
244
331
|
}}></calcite-action>` : "";
|
|
245
332
|
}
|
|
246
333
|
renderAddButton() {
|
|
247
|
-
return this.multiple ?
|
|
334
|
+
return this.multiple ? o`<calcite-button .appearance=${this.hideCancel ? "outline-fill" : "solid"} .width=${this.hideCancel ? "full" : "half"} @click=${() => {
|
|
248
335
|
this.arcgisClose.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
|
|
249
336
|
}}>${this.okBtnText || (this.multiple ? this._messages.done : this._messages.ok)}</calcite-button>` : "";
|
|
250
337
|
}
|
|
251
338
|
renderCancelButton() {
|
|
252
|
-
return this.hideCancel ? "" :
|
|
339
|
+
return this.hideCancel ? "" : o`<calcite-button appearance=outline-fill .width=${this.multiple ? "half" : "full"} @click=${() => {
|
|
253
340
|
this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
|
|
254
341
|
}}>${this._messages.cancel}</calcite-button>`;
|
|
255
342
|
}
|
|
256
343
|
}
|
|
257
|
-
|
|
344
|
+
b("arcgis-field-pick-list", H);
|
|
258
345
|
export {
|
|
259
|
-
|
|
346
|
+
H as ArcgisFieldPickList
|
|
260
347
|
};
|
|
@@ -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";
|