@arcgis/common-components 5.1.0-next.101 → 5.1.0-next.103

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.
Files changed (79) hide show
  1. package/dist/cdn/3P3NRZ2D.js +2 -0
  2. package/dist/cdn/{H74W6KYI.js → 53LIKT4M.js} +1 -1
  3. package/dist/cdn/{O6ZASYX6.js → 5KIT22UZ.js} +1 -1
  4. package/dist/cdn/ALH2AARB.js +2 -0
  5. package/dist/cdn/BPEHBFXY.js +2 -0
  6. package/dist/cdn/CLPCPWPE.js +2 -0
  7. package/dist/cdn/J7JP7Q3W.js +2 -0
  8. package/dist/cdn/{MHJWVKG5.js → QYF3665A.js} +1 -1
  9. package/dist/cdn/{LVSH5I3Q.js → UQQWSK4Z.js} +1 -1
  10. package/dist/cdn/W2BLCMKI.js +2 -0
  11. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.ar.json +1 -0
  12. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.bg.json +1 -0
  13. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.bs.json +1 -0
  14. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.ca.json +1 -0
  15. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.cs.json +1 -0
  16. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.da.json +1 -0
  17. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.de.json +1 -0
  18. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.el.json +1 -0
  19. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.en-US.json +1 -0
  20. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.en.json +1 -0
  21. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.es.json +1 -0
  22. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.et.json +1 -0
  23. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.fi.json +1 -0
  24. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.fr.json +1 -0
  25. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.he.json +1 -0
  26. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.hr.json +1 -0
  27. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.hu.json +1 -0
  28. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.id.json +1 -0
  29. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.it.json +1 -0
  30. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.ja.json +1 -0
  31. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.ko.json +1 -0
  32. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.lt.json +1 -0
  33. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.lv.json +1 -0
  34. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.nl.json +1 -0
  35. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.no.json +1 -0
  36. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.pl.json +1 -0
  37. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.pt-BR.json +1 -0
  38. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.pt-PT.json +1 -0
  39. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.ro.json +1 -0
  40. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.ru.json +1 -0
  41. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.sk.json +1 -0
  42. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.sl.json +1 -0
  43. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.sr.json +1 -0
  44. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.sv.json +1 -0
  45. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.th.json +1 -0
  46. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.tr.json +1 -0
  47. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.uk.json +1 -0
  48. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.vi.json +1 -0
  49. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.zh-CN.json +1 -0
  50. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.zh-HK.json +1 -0
  51. package/dist/cdn/assets/coordinate-system-picker/t9n/messages.zh-TW.json +1 -0
  52. package/dist/cdn/index.js +1 -1
  53. package/dist/cdn/main.css +1 -1
  54. package/dist/chunks/spatial-references.js +7598 -0
  55. package/dist/components/arcgis-coordinate-system-picker/customElement.d.ts +327 -0
  56. package/dist/components/arcgis-coordinate-system-picker/customElement.js +110 -0
  57. package/dist/components/arcgis-coordinate-system-picker/index.d.ts +1 -0
  58. package/dist/components/arcgis-coordinate-system-picker/index.js +3 -0
  59. package/dist/components/arcgis-coordinate-system-picker-tree/customElement.d.ts +35 -0
  60. package/dist/components/arcgis-coordinate-system-picker-tree/customElement.js +77 -0
  61. package/dist/components/arcgis-coordinate-system-picker-tree/index.d.ts +1 -0
  62. package/dist/components/arcgis-coordinate-system-picker-tree/index.js +3 -0
  63. package/dist/components/arcgis-field-pick-list/customElement.js +91 -86
  64. package/dist/components/arcgis-spatial-reference-picker/customElement.js +43 -7635
  65. package/dist/components/arcgis-ticks/customElement.js +21 -21
  66. package/dist/docs/api.json +1 -1
  67. package/dist/docs/docs.json +1 -1
  68. package/dist/docs/vscode.html-custom-data.json +1 -1
  69. package/dist/docs/web-types.json +1 -1
  70. package/dist/index.d.ts +20 -0
  71. package/dist/loader.js +4 -2
  72. package/dist/types/lumina.d.ts +12 -0
  73. package/dist/types/preact.d.ts +14 -0
  74. package/dist/types/react.d.ts +16 -0
  75. package/dist/types/stencil.d.ts +12 -0
  76. package/package.json +4 -4
  77. package/dist/cdn/43KGVFBF.js +0 -2
  78. package/dist/cdn/B43M633Q.js +0 -2
  79. package/dist/cdn/QEPJM6XG.js +0 -2
@@ -1,48 +1,48 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as y } from "../../chunks/runtime.js";
3
- import { keyed as F } from "lit/directives/keyed.js";
4
- import { LitElement as w, createEvent as n, renderElement as $, nothing as d, safeStyleMap as g, safeClassMap as S } from "@arcgis/lumina";
5
- import { createRef as r, ref as h } from "lit/directives/ref.js";
2
+ import { c as F } from "../../chunks/runtime.js";
3
+ import { keyed as y } from "lit/directives/keyed.js";
4
+ import { LitElement as w, createEvent as r, renderElement as $, nothing as h, safeStyleMap as u, safeClassMap as v } from "@arcgis/lumina";
5
+ import { createRef as a, ref as c } from "lit/directives/ref.js";
6
6
  import { html as l, css as C } from "lit";
7
- import { Task as v } from "@lit/task";
8
- import { log as u, composeMissingPropertyMessage as k } from "@arcgis/toolkit/log";
9
- import { F as f } from "../../chunks/internal-types.js";
10
- import { i as B } from "../../chunks/commonFunctions.js";
11
- import { u as x } from "../../chunks/useT9n.js";
12
- const o = /* @__PURE__ */ new Map();
13
- o.set("oid", "key");
14
- o.set("guid", "key");
15
- o.set("global-id", "key");
16
- o.set("blob", "binary");
17
- o.set("integer", "integer");
18
- o.set("small-integer", "integer");
19
- o.set("big-integer", "integer");
20
- o.set("single", "number");
21
- o.set("double", "number");
22
- o.set("long", "number");
23
- o.set("number", "number");
24
- o.set("date", "date-time");
25
- o.set("date-only", "calendar");
26
- o.set("time-only", "clock");
27
- o.set("timestamp-offset", "time-zone");
28
- o.set("string", "string");
29
- const b = ({ fieldType: p }) => l`<calcite-icon scale=s .icon=${o.get(p)}></calcite-icon>`, L = C`.panel{min-height:250px}.content{max-height:50vh}.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}`;
30
- class E extends w {
7
+ import { Task as k } from "@lit/task";
8
+ import { log as f, composeMissingPropertyMessage as S } from "@arcgis/toolkit/log";
9
+ import { F as g } from "../../chunks/internal-types.js";
10
+ import { i as x } from "../../chunks/commonFunctions.js";
11
+ import { u as b } from "../../chunks/useT9n.js";
12
+ const n = /* @__PURE__ */ new Map();
13
+ n.set("oid", "key");
14
+ n.set("guid", "key");
15
+ n.set("global-id", "key");
16
+ n.set("blob", "binary");
17
+ n.set("integer", "integer");
18
+ n.set("small-integer", "integer");
19
+ n.set("big-integer", "integer");
20
+ n.set("single", "number");
21
+ n.set("double", "number");
22
+ n.set("long", "number");
23
+ n.set("number", "number");
24
+ n.set("date", "date-time");
25
+ n.set("date-only", "calendar");
26
+ n.set("time-only", "clock");
27
+ n.set("timestamp-offset", "time-zone");
28
+ n.set("string", "string");
29
+ const B = ({ fieldType: m }) => l`<calcite-icon scale=s .icon=${n.get(m)}></calcite-icon>`, E = C`.panel{min-height:250px}.content{max-height:50vh}.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}`;
30
+ class L extends w {
31
31
  constructor() {
32
- super(...arguments), this._messages = x({ blocking: !0 }), this.popoverNode = r(), this.listNode = r(), this.flowElement = r(), this.panelElement = r(), this.dropdownNode = r(), this.fieldInfoFlowItemEl = r(), this.allLists = [], this.filterText = "", this.panelCutOffHeight = 0, this._propWatcherTask = new v(this, {
32
+ super(...arguments), this._messages = b({ blocking: !0 }), this.popoverNode = a(), this.listNode = a(), this.flowElement = a(), this.panelElement = a(), this.dropdownNode = a(), this.fieldInfoFlowItemEl = a(), this.allLists = [], this.filterText = "", this.panelCutOffHeight = 0, this._propWatcherTask = new k(this, {
33
33
  task: async ([e]) => {
34
- if (!this.listOnly && !B(e?.refElement))
35
- throw u("error", this, k("popoverProps")), new Error();
34
+ if (!this.listOnly && !x(e?.refElement))
35
+ throw f("error", this, S("popoverProps")), new Error();
36
36
  this._propWatcherTask.autoRun = !1;
37
37
  },
38
38
  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 = n(), this.arcgisClose = n(), this.arcgisFieldPickListChange = n(), this.arcgisFieldPickListDismissed = n(), this.arcgisFieldPickListSortByChange = n(), this.arcgisSortByChange = n(), this.arcgisEditField = n(), this.arcgisDeleteField = n();
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 = r(), this.arcgisClose = r(), this.arcgisFieldPickListChange = r(), this.arcgisFieldPickListDismissed = r(), this.arcgisFieldPickListSortByChange = r(), this.arcgisSortByChange = r(), this.arcgisEditField = r(), this.arcgisDeleteField = r();
40
40
  }
41
41
  static {
42
42
  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
43
  }
44
44
  static {
45
- this.styles = L;
45
+ this.styles = E;
46
46
  }
47
47
  async reposition() {
48
48
  await this.popoverNode.value?.reposition();
@@ -56,7 +56,7 @@ class E extends w {
56
56
  this.panelElement.value && (this.panelElement.value.disabled = e);
57
57
  }
58
58
  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, u("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();
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, f("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();
60
60
  }
61
61
  willUpdate(e) {
62
62
  (e.has("fields") || e.has("lastSortBy") || e.has("customExpressionCheck")) && this.updateGroupedLists();
@@ -88,11 +88,11 @@ class E extends w {
88
88
  }
89
89
  getSortedList(e) {
90
90
  let t = [...e];
91
- const s = t.filter((i) => i.type === "none");
92
- return t = t.filter((i) => i.type !== "none"), this.lastSortBy === "display" ? t.sort((i, a) => i.alias.localeCompare(a.alias)) : this.lastSortBy === "field" ? t.sort((i, a) => i.name.localeCompare(a.name)) : this.lastSortBy === "type" && t.sort((i, a) => i.type.localeCompare(a.type)), t = t.concat(s), t;
91
+ const i = t.filter((s) => s.type === "none");
92
+ return t = t.filter((s) => s.type !== "none"), this.lastSortBy === "display" ? t.sort((s, o) => s.alias.localeCompare(o.alias)) : this.lastSortBy === "field" ? t.sort((s, o) => s.name.localeCompare(o.name)) : this.lastSortBy === "type" && t.sort((s, o) => s.type.localeCompare(o.type)), t = t.concat(i), t;
93
93
  }
94
94
  isExpression(e) {
95
- return this.customExpressionCheck ? this.customExpressionCheck(e) : e.name.includes(f.expression);
95
+ return this.customExpressionCheck ? this.customExpressionCheck(e) : e.name.includes(g.expression);
96
96
  }
97
97
  canDeselectAll() {
98
98
  const e = this.getAllFields();
@@ -103,7 +103,7 @@ class E extends w {
103
103
  }
104
104
  showFieldInfoCheck(e) {
105
105
  const { layer: t } = this;
106
- return this.showFieldInfo ? !(!t || this.isExpression(e) || e.name.includes(f.relationship) || e.type === "none") : !1;
106
+ return this.showFieldInfo ? !(!t || this.isExpression(e) || e.name.includes(g.relationship) || e.type === "none") : !1;
107
107
  }
108
108
  updateGroupedLists() {
109
109
  if (!this.fields)
@@ -132,12 +132,12 @@ class E extends w {
132
132
  ];
133
133
  }
134
134
  addFieldInfoFlowItem(e, t) {
135
- const s = this.flowElement.value, i = $(l`<calcite-flow-item selected .heading=${e.alias ?? e.name} .description=${e.name} class="panel" style=${g(this.panelCutOffHeight > 0 ? `max-height: ${this.panelCutOffHeight}px` : "max-height: 50vh")} @calciteFlowItemBack=${(a) => {
136
- a.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
135
+ const i = this.flowElement.value, s = $(l`<calcite-flow-item selected .heading=${e.alias ?? e.name} .description=${e.name} class="panel" style=${u(this.panelCutOffHeight > 0 ? `max-height: ${this.panelCutOffHeight}px` : "max-height: 50vh")} @calciteFlowItemBack=${(o) => {
136
+ o.currentTarget.remove(), this.fieldInfoFlowItemEl.value.selected = !1, this.panelElement.value.selected = !0, setTimeout(() => {
137
137
  t.setFocus();
138
138
  }, 300);
139
- }} ${h(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang ?? d} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);
140
- s.appendChild(i), this.panelElement.value.selected = !1, this.fieldInfoFlowItemEl?.value.setFocus();
139
+ }} ${c(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang ?? h} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);
140
+ i.appendChild(s), this.panelElement.value.selected = !1, this.fieldInfoFlowItemEl?.value.setFocus();
141
141
  }
142
142
  usingCustomGroups() {
143
143
  return !!this.fields.length && "fields" in this.fields[0];
@@ -145,6 +145,19 @@ class E extends w {
145
145
  getAllFields() {
146
146
  return this.allLists.map((e) => e.fields).flat();
147
147
  }
148
+ setSortBy(e) {
149
+ 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 }));
150
+ }
151
+ reorderSelectedFieldsByCurrentListOrder() {
152
+ if (!this.selectedFields.length)
153
+ return !1;
154
+ const e = this.getAllFields().map((o) => o.name), t = new Set(this.selectedFields), i = e.filter((o) => t.has(o)), s = (
155
+ // adding/removing fields
156
+ i.length !== this.selectedFields.length || // reordering fields
157
+ i.some((o, p) => o !== this.selectedFields[p])
158
+ );
159
+ return s && (this.selectedFields = [...i]), s;
160
+ }
148
161
  render() {
149
162
  return this._propWatcherTask.render({
150
163
  complete: () => {
@@ -153,48 +166,40 @@ class E extends w {
153
166
  const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.popoverProps;
154
167
  return this.el.classList.add("js-app-flyout"), l`<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=${() => {
155
168
  this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
156
- }} ${h(this.popoverNode)}><calcite-flow style=${g({
169
+ }} ${c(this.popoverNode)}><calcite-flow style=${u({
157
170
  width: `${t.popoverWidth ?? t.refElement.getBoundingClientRect().width}px`,
158
171
  ...t.maxHeight && { maxHeight: t.maxHeight }
159
- })} ${h(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${() => {
172
+ })} ${c(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${() => {
160
173
  this.arcgisClose.emit(), this.arcgisFieldPickListDismissed.emit();
161
- }} ${h(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple || !this.hideCancel) && l`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple && !this.hideCancel ? l`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>` : l`${this.renderAddButton()}${this.renderCancelButton()}`}</div>` || ""}</calcite-flow-item></calcite-flow></calcite-popover>`;
174
+ }} ${c(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple || !this.hideCancel) && l`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple && !this.hideCancel ? l`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>` : l`${this.renderAddButton()}${this.renderCancelButton()}`}</div>` || ""}</calcite-flow-item></calcite-flow></calcite-popover>`;
162
175
  },
163
176
  error: () => ""
164
177
  });
165
178
  }
166
179
  renderList() {
167
- const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.getAllFields(), s = t.length >= this.showFilterLength;
168
- return l`${t.length ? l`<calcite-list .label=${e} .selectionMode=${this.multiple ? "multiple" : "single"} class=${S(this.listOnly ? "" : "content")} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteListChange=${() => {
169
- const i = this.listNode.value.selectedItems.map((c) => c.value), a = this.selectedFields.filter((c) => i.includes(c)), m = i.filter((c) => !this.selectedFields.includes(c));
170
- this.selectedFields = [.../* @__PURE__ */ new Set([...a, ...m])], 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 }));
171
- }} @calciteListFilter=${(i) => {
172
- i.stopPropagation(), this.filterFields = this.listNode.value.filteredItems?.map((a) => a.value), this.filterText = this.listNode.value.filterText;
173
- }} ${h(this.listNode)}>${this.renderSortButton()}<slot name=content-center></slot>${this.multiple && this.showSelectionAll && (!s || !this.filterText || this.filterFields?.length) ? this.renderSelectionButton() : null}${this.renderListItems()}</calcite-list>` : l`<slot name=no-fields></slot>`}${this.filterFields && !this.filterFields.length && this.listNode.value && this.filterNoResultsText?.length !== 0 ? l`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}`;
180
+ const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = this.getAllFields(), i = t.length >= this.showFilterLength;
181
+ return l`${t.length ? l`<calcite-list .label=${e} .selectionMode=${this.multiple ? "multiple" : "single"} class=${v(this.listOnly ? "" : "content")} .filterEnabled=${i} .filterPlaceholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteListChange=${() => {
182
+ const s = this.listNode.value.selectedItems.map((d) => d.value), o = this.selectedFields.filter((d) => s.includes(d)), p = s.filter((d) => !this.selectedFields.includes(d));
183
+ this.selectedFields = [.../* @__PURE__ */ new Set([...o, ...p])], this.reorderSelectedFieldsByCurrentListOrder(), 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 }));
184
+ }} @calciteListFilter=${(s) => {
185
+ s.stopPropagation(), this.filterFields = this.listNode.value.filteredItems?.map((o) => o.value), this.filterText = this.listNode.value.filterText;
186
+ }} ${c(this.listNode)}>${this.renderSortButton()}<slot name=content-center></slot>${this.multiple && this.showSelectionAll && (!i || !this.filterText || this.filterFields?.length) ? this.renderSelectionButton() : null}${this.renderListItems()}</calcite-list>` : l`<slot name=no-fields></slot>`}${this.filterFields && !this.filterFields.length && this.listNode.value && this.filterNoResultsText?.length !== 0 ? l`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}`;
174
187
  }
175
188
  renderSortButton() {
176
189
  const e = this.getAllFields();
177
190
  if (!(e.length >= this.showFilterLength && !this.hideSort))
178
191
  return "";
179
- const s = e.every((i) => !!i.type);
192
+ const i = e.every((s) => !!s.type);
180
193
  return l`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed .disabled=${this.filterFields ? this.filterFields.length < 4 : !1} @calciteDropdownOpen=${() => {
181
194
  this.observer?.disconnect(), this.popoverNode.value && this.observer?.observe(this.popoverNode.value, { attributes: !0 });
182
- }} @calciteDropdownClose=${() => this.observer?.disconnect()} ${h(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? d}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @click=${() => {
183
- this.lastSortBy = "default", this.arcgisSortByChange.emit(this.lastSortBy), this.arcgisFieldPickListSortByChange.emit(this.lastSortBy);
184
- }} @keydown=${(i) => {
185
- i.stopPropagation(), (i.key === " " || i.key === "Enter") && (this.lastSortBy = "default", this.arcgisSortByChange.emit(this.lastSortBy), this.arcgisFieldPickListSortByChange.emit(this.lastSortBy));
186
- }}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @click=${() => {
187
- this.lastSortBy = "display", this.arcgisSortByChange.emit(this.lastSortBy), this.arcgisFieldPickListSortByChange.emit(this.lastSortBy);
188
- }} @keydown=${(i) => {
189
- i.stopPropagation(), (i.key === " " || i.key === "Enter") && (this.lastSortBy = "display", this.arcgisSortByChange.emit(this.lastSortBy), this.arcgisFieldPickListSortByChange.emit(this.lastSortBy));
190
- }}>${this._messages.displayName}</calcite-dropdown-item>${s && l`<calcite-dropdown-item .selected=${this.lastSortBy === "type"} @click=${() => {
191
- this.lastSortBy = "type", this.arcgisSortByChange.emit(this.lastSortBy), this.arcgisFieldPickListSortByChange.emit(this.lastSortBy);
192
- }} @keydown=${(i) => {
193
- i.stopPropagation(), (i.key === " " || i.key === "Enter") && (this.lastSortBy = "type", this.arcgisSortByChange.emit(this.lastSortBy), this.arcgisFieldPickListSortByChange.emit(this.lastSortBy));
194
- }}>${this._messages.type}</calcite-dropdown-item>` || ""}<calcite-dropdown-item .selected=${this.lastSortBy === "field"} @click=${() => {
195
- this.lastSortBy = "field", this.arcgisSortByChange.emit(this.lastSortBy), this.arcgisFieldPickListSortByChange.emit(this.lastSortBy);
196
- }} @keydown=${(i) => {
197
- i.stopPropagation(), (i.key === " " || i.key === "Enter") && (this.lastSortBy = "field", this.arcgisSortByChange.emit(this.lastSortBy), this.arcgisFieldPickListSortByChange.emit(this.lastSortBy));
195
+ }} @calciteDropdownClose=${() => this.observer?.disconnect()} ${c(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? h}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @click=${() => this.setSortBy("default")} @keydown=${(s) => {
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");
198
203
  }}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
199
204
  }
200
205
  renderSelectionButton() {
@@ -205,18 +210,18 @@ class E extends w {
205
210
  this.selectedFields = [.../* @__PURE__ */ new Set([...this.selectedFields, ...this.filterFields])];
206
211
  else {
207
212
  const t = this.getAllFields();
208
- this.selectedFields = t.map((s) => s.name);
213
+ this.selectedFields = t.map((i) => i.name);
209
214
  }
210
- this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
215
+ this.reorderSelectedFieldsByCurrentListOrder(), this.arcgisChange.emit({ selectedFields: this.selectedFields }), this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
211
216
  }}>${this.canDeselectAll() ? this._messages.deselectAll : this._messages.selectAll}</calcite-button></div>`;
212
217
  }
213
218
  renderListItems() {
214
219
  const e = this.allLists.filter((t) => !!t.fields.length);
215
- return e.length === 1 && !e[0].title ? e[0].fields.map((t) => this.renderCalciteListItem(t)) : e.map((s) => l`<calcite-list-item-group .heading=${s.title}>${s.fields.map((i) => this.renderCalciteListItem(i))}</calcite-list-item-group>`);
220
+ return e.length === 1 && !e[0].title ? e[0].fields.map((t) => this.renderCalciteListItem(t)) : e.map((i) => l`<calcite-list-item-group .heading=${i.title}>${i.fields.map((s) => this.renderCalciteListItem(s))}</calcite-list-item-group>`);
216
221
  }
217
222
  renderCalciteListItem(e) {
218
- const t = this.showFieldInfoCheck(e), s = this.showFieldTypeIcon && !!e.type;
219
- return F(e.name, l`<calcite-list-item .label=${e.alias || e.name} .description=${(() => {
223
+ const t = this.showFieldInfoCheck(e), i = this.showFieldTypeIcon && !!e.type;
224
+ return y(e.name, l`<calcite-list-item .label=${e.alias || e.name} .description=${(() => {
220
225
  if (this.showFieldName && e.hideFieldName !== !0)
221
226
  return `{${e.name}}`;
222
227
  if (this.showDescription && e.hideDescription !== !0 && e.description)
@@ -224,26 +229,26 @@ class E extends w {
224
229
  })()} .value=${e.name} .selected=${!this.multiple && e.name === this.selectedFields[0] || this.multiple && this.selectedFields.includes(e.name)} .metadata=${{
225
230
  label: e.alias,
226
231
  fieldName: e.name
227
- }}>${s && l`<div slot=actions-end class="field-icons">${b({ fieldType: e.type })}</div>` || ""}${this.renderInfoAction(e, t)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`);
232
+ }}>${i && l`<div slot=actions-end class="field-icons">${B({ fieldType: e.type })}</div>` || ""}${this.renderInfoAction(e, t)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`);
228
233
  }
229
234
  renderInfoAction(e, t) {
230
- const { _messages: s } = this;
231
- return t ? l`<calcite-action slot=actions-end .text=${s.info} title=${s.info ?? d} scale=s icon=information @click=${(i) => {
232
- i.stopPropagation();
233
- const a = i.currentTarget;
234
- this.addFieldInfoFlowItem(e, a);
235
+ const { _messages: i } = this;
236
+ return t ? l`<calcite-action slot=actions-end .text=${i.info} title=${i.info ?? h} scale=s icon=information @click=${(s) => {
237
+ s.stopPropagation();
238
+ const o = s.currentTarget;
239
+ this.addFieldInfoFlowItem(e, o);
235
240
  }}></calcite-action>` : "";
236
241
  }
237
242
  renderEditAction(e) {
238
243
  const { _messages: t } = this;
239
- return e.showEditAction ? l`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit ?? d} scale=s icon=pencil @click=${(s) => {
240
- s.stopPropagation(), this.arcgisEditField.emit({ fieldName: e.name });
244
+ return e.showEditAction ? l`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit ?? h} scale=s icon=pencil @click=${(i) => {
245
+ i.stopPropagation(), this.arcgisEditField.emit({ fieldName: e.name });
241
246
  }}></calcite-action>` : "";
242
247
  }
243
248
  renderDeleteAction(e) {
244
249
  const { _messages: t } = this;
245
- return e.showDeleteAction ? l`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete ?? d} scale=s icon=trash @click=${(s) => {
246
- s.stopPropagation(), this.arcgisDeleteField.emit({ fieldName: e.name });
250
+ return e.showDeleteAction ? l`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete ?? h} scale=s icon=trash @click=${(i) => {
251
+ i.stopPropagation(), this.arcgisDeleteField.emit({ fieldName: e.name });
247
252
  }}></calcite-action>` : "";
248
253
  }
249
254
  renderAddButton() {
@@ -257,7 +262,7 @@ class E extends w {
257
262
  }}>${this._messages.cancel}</calcite-button>`;
258
263
  }
259
264
  }
260
- y("arcgis-field-pick-list", E);
265
+ F("arcgis-field-pick-list", L);
261
266
  export {
262
- E as ArcgisFieldPickList
267
+ L as ArcgisFieldPickList
263
268
  };