@arcgis/common-components 4.29.0-beta.47 → 4.29.0-beta.49

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 (53) hide show
  1. package/dist/arcgis-common-components/arcgis-common-components.esm.js +1 -1
  2. package/dist/arcgis-common-components/p-6c7d2684.js +1 -0
  3. package/dist/arcgis-common-components/p-7318a1d1.entry.js +1 -0
  4. package/dist/arcgis-common-components/p-a91ab432.js +2 -0
  5. package/dist/arcgis-common-components/p-d3d1695f.entry.js +1 -0
  6. package/dist/cjs/arcgis-common-components.cjs.js +3 -3
  7. package/dist/cjs/arcgis-field-info.cjs.entry.js +903 -899
  8. package/dist/cjs/arcgis-field-pick-list.cjs.entry.js +216 -229
  9. package/dist/cjs/{index-2e4fbd31.js → index-5ec7f592.js} +5 -20
  10. package/dist/cjs/{index-ab5f2576.js → index-e0422bc8.js} +72 -77
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/components/arcgis-field-info.d.ts +2 -2
  13. package/dist/components/arcgis-field-pick-list.d.ts +2 -2
  14. package/dist/components/arcgis-field-pick-list.js +259 -272
  15. package/dist/components/field-info.js +961 -901
  16. package/dist/esm/arcgis-common-components.js +4 -4
  17. package/dist/esm/arcgis-field-info.entry.js +907 -903
  18. package/dist/esm/arcgis-field-pick-list.entry.js +216 -229
  19. package/dist/esm/{index-74897166.js → index-0c129ec4.js} +73 -78
  20. package/dist/esm/index-ba4fe890.js +59 -0
  21. package/dist/esm/loader.js +3 -3
  22. package/dist/types/components/field-info/field-info.d.ts +61 -61
  23. package/dist/types/components/field-info/t9n-types.d.ts +72 -72
  24. package/dist/types/components/field-info/utils/basic.d.ts +24 -24
  25. package/dist/types/components/field-info/utils/field.d.ts +1 -1
  26. package/dist/types/components/field-pick-list/field-pick-list.d.ts +115 -115
  27. package/dist/types/components/field-pick-list/t9n-types.d.ts +15 -15
  28. package/dist/types/components/field-pick-list/utils/types.d.ts +14 -14
  29. package/dist/types/components.d.ts +0 -86
  30. package/dist/types/stencil-public-runtime.d.ts +8 -0
  31. package/package.json +7 -7
  32. package/dist/arcgis-common-components/p-0be8fd4c.entry.js +0 -1
  33. package/dist/arcgis-common-components/p-164eb24e.entry.js +0 -1
  34. package/dist/arcgis-common-components/p-5ecf6396.js +0 -1
  35. package/dist/arcgis-common-components/p-97c7ac8d.entry.js +0 -1
  36. package/dist/arcgis-common-components/p-b23318c8.js +0 -1
  37. package/dist/arcgis-common-components/p-d66b011b.entry.js +0 -1
  38. package/dist/arcgis-common-components/p-f27af39c.js +0 -2
  39. package/dist/cjs/arcgis-api-key.cjs.entry.js +0 -51
  40. package/dist/cjs/arcgis-identity.cjs.entry.js +0 -139
  41. package/dist/cjs/index-f8bf4df6.js +0 -7
  42. package/dist/components/arcgis-api-key.d.ts +0 -11
  43. package/dist/components/arcgis-api-key.js +0 -69
  44. package/dist/components/arcgis-identity.d.ts +0 -11
  45. package/dist/components/arcgis-identity.js +0 -167
  46. package/dist/components/index2.js +0 -75
  47. package/dist/esm/arcgis-api-key.entry.js +0 -47
  48. package/dist/esm/arcgis-identity.entry.js +0 -135
  49. package/dist/esm/index-3d9bb67e.js +0 -75
  50. package/dist/esm/index-e7244815.js +0 -3
  51. package/dist/types/components/api-key/api-key.d.ts +0 -9
  52. package/dist/types/components/identity/identity.d.ts +0 -31
  53. package/dist/types/components/types.d.ts +0 -10
@@ -1,6 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, getAssetPath, Host } from '@stencil/core/internal/client';
2
- import { b as importIntl } from './index2.js';
3
- import { F, U, C, d as defineCustomElement$2 } from './field-info.js';
2
+ import { F, i as importIntl, U, C, d as defineCustomElement$2 } from './field-info.js';
4
3
  import '@esri/calcite-components/dist/components/calcite-pick-list-item.js';
5
4
  import '@esri/calcite-components/dist/components/calcite-action.js';
6
5
  import '@esri/calcite-components/dist/components/calcite-button.js';
@@ -17,294 +16,282 @@ const fieldPickListScss = ".popover{z-index:100}.panel{min-height:300px}.content
17
16
 
18
17
  var FieldInfoPrefix;
19
18
  (function (FieldInfoPrefix) {
20
- FieldInfoPrefix["expression"] = "expression/";
21
- FieldInfoPrefix["relationship"] = "relationships/";
22
- FieldInfoPrefix["raster"] = "Raster.";
19
+ FieldInfoPrefix["expression"] = "expression/";
20
+ FieldInfoPrefix["relationship"] = "relationships/";
21
+ FieldInfoPrefix["raster"] = "Raster.";
23
22
  })(FieldInfoPrefix || (FieldInfoPrefix = {}));
24
23
  var LastSortyBy;
25
24
  (function (LastSortyBy) {
26
- LastSortyBy["default"] = "default";
27
- LastSortyBy["display"] = "display";
28
- LastSortyBy["type"] = "type";
29
- LastSortyBy["field"] = "field";
25
+ LastSortyBy["default"] = "default";
26
+ LastSortyBy["display"] = "display";
27
+ LastSortyBy["type"] = "type";
28
+ LastSortyBy["field"] = "field";
30
29
  })(LastSortyBy || (LastSortyBy = {}));
31
30
  const ArcgisFieldPickList$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisFieldPickList extends HTMLElement {
32
- constructor() {
33
- super();
34
- this.__registerHost();
35
- this.__attachShadow();
36
- this.arcgisFieldPickListDismissed = createEvent(this, "arcgisFieldPickListDismissed", 7);
37
- this.arcgisFieldPickListChange = createEvent(this, "arcgisFieldPickListChange", 7);
38
- this.arcgisFieldPickListSortByChange = createEvent(this, "arcgisFieldPickListSortByChange", 7);
39
- this.calciteValueList = (field) => (h("calcite-pick-list-item", { key: field.name, label: field.alias || field.name, description: (() => {
40
- if (this.showFieldName) {
41
- return `{${field.name}}`;
42
- }
43
- if (this.showDescription && field.description) {
44
- return field.description;
31
+ constructor() {
32
+ super();
33
+ this.__registerHost();
34
+ this.__attachShadow();
35
+ this.arcgisFieldPickListDismissed = createEvent(this, "arcgisFieldPickListDismissed", 7);
36
+ this.arcgisFieldPickListChange = createEvent(this, "arcgisFieldPickListChange", 7);
37
+ this.arcgisFieldPickListSortByChange = createEvent(this, "arcgisFieldPickListSortByChange", 7);
38
+ this.calciteValueList = (field) => (h("calcite-pick-list-item", { key: field.name, label: field.alias || field.name, description: (() => {
39
+ if (this.showFieldName) {
40
+ return `{${field.name}}`;
41
+ }
42
+ if (this.showDescription && field.description) {
43
+ return field.description;
44
+ }
45
+ return null;
46
+ })(), value: field.name, selected: (!this.multiple && field.name === this.selectedFields[0]) ||
47
+ (this.multiple && this.selectedFields.indexOf(field.name) > -1), metadata: {
48
+ label: field.alias,
49
+ fieldName: field.name
50
+ } }, this.showFieldInfoCheck(field) && (h("calcite-action", { slot: "actions-end", text: this._t9nStrings.info, title: this._t9nStrings.info, scale: "s", icon: "information", onClick: (event) => {
51
+ event.stopPropagation();
52
+ const action = event.target;
53
+ const fieldInfoFlowItem = document.createElement("calcite-flow-item");
54
+ fieldInfoFlowItem.heading = field.alias ?? field.name;
55
+ fieldInfoFlowItem.description = field.name;
56
+ fieldInfoFlowItem.className = "panel";
57
+ const fieldInfo = document.createElement("arcgis-field-info");
58
+ fieldInfo.lang = this._lang;
59
+ fieldInfo.fieldName = field.name;
60
+ fieldInfo.layer = this.layer;
61
+ fieldInfo.view = this.mapView;
62
+ fieldInfo.classList.add("content");
63
+ fieldInfoFlowItem.appendChild(fieldInfo);
64
+ fieldInfoFlowItem.addEventListener("calciteFlowItemBack", () => setTimeout(() => requestAnimationFrame(() => action.setFocus()), 200));
65
+ this.flowElement.appendChild(fieldInfoFlowItem);
66
+ setTimeout(() => requestAnimationFrame(() => fieldInfoFlowItem.setFocus()), 200);
67
+ } }))));
68
+ this.selectedFields = [];
69
+ this.fields = undefined;
70
+ this.popoverProps = undefined;
71
+ this.layer = undefined;
72
+ this.mapView = undefined;
73
+ this.showFieldInfo = false;
74
+ this.showFieldName = false;
75
+ this.showDescription = false;
76
+ this.showSelectionAll = false;
77
+ this.showCancel = true;
78
+ this.showSort = true;
79
+ this.showFilterLength = 10;
80
+ this.multiple = false;
81
+ this.heading = undefined;
82
+ this.okBtnText = undefined;
83
+ this.filterPlaceholderText = undefined;
84
+ this.sortBy = undefined;
85
+ this.lastSortyBy = LastSortyBy.default;
86
+ this.filterFields = null;
87
+ this._lang = "";
88
+ this._t9nLocale = "";
89
+ this._t9nStrings = undefined;
90
+ }
91
+ // --------------------------------------------------------------------------
92
+ //
93
+ // Lifecycle
94
+ //
95
+ // --------------------------------------------------------------------------
96
+ async componentWillLoad() {
97
+ await F(this, getAssetPath("./assets"));
98
+ // in case more than 1 selected field and multiple is set to false
99
+ if (!this.multiple && this.selectedFields.length > 1) {
100
+ this.selectedFields = [this.selectedFields[0]];
45
101
  }
46
- return null;
47
- })(), value: field.name, selected: (!this.multiple && field.name === this.selectedFields[0]) ||
48
- (this.multiple && this.selectedFields.indexOf(field.name) > -1), metadata: {
49
- label: field.alias,
50
- fieldName: field.name
51
- } }, this.showFieldInfoCheck(field) && (h("calcite-action", { slot: "actions-end", text: this._t9nStrings.info, title: this._t9nStrings.info, scale: "s", icon: "information", onClick: (event) => {
52
- event.stopPropagation();
53
- const action = event.target;
54
- const fieldInfoFlowItem = document.createElement("calcite-flow-item");
55
- fieldInfoFlowItem.heading = field.alias ?? field.name;
56
- fieldInfoFlowItem.description = field.name;
57
- fieldInfoFlowItem.className = "panel";
58
- const fieldInfo = document.createElement("arcgis-field-info");
59
- fieldInfo.lang = this._lang;
60
- fieldInfo.fieldName = field.name;
61
- fieldInfo.layer = this.layer;
62
- fieldInfo.view = this.mapView;
63
- fieldInfo.classList.add("content");
64
- fieldInfoFlowItem.appendChild(fieldInfo);
65
- fieldInfoFlowItem.addEventListener("calciteFlowItemBack", () => setTimeout(() => requestAnimationFrame(() => action.setFocus()), 200));
66
- this.flowElement.appendChild(fieldInfoFlowItem);
67
- setTimeout(() => requestAnimationFrame(() => fieldInfoFlowItem.setFocus()), 200);
68
- } }))));
69
- this.selectedFields = [];
70
- this.fields = undefined;
71
- this.popoverProps = undefined;
72
- this.layer = undefined;
73
- this.mapView = undefined;
74
- this.showFieldInfo = false;
75
- this.showFieldName = false;
76
- this.showDescription = false;
77
- this.showSelectionAll = false;
78
- this.showCancel = true;
79
- this.showSort = true;
80
- this.showFilterLength = 10;
81
- this.multiple = false;
82
- this.heading = undefined;
83
- this.okBtnText = undefined;
84
- this.filterPlaceholderText = undefined;
85
- this.sortBy = undefined;
86
- this.lastSortyBy = LastSortyBy.default;
87
- this.filterFields = null;
88
- this._lang = "";
89
- this._t9nLocale = "";
90
- this._t9nStrings = undefined;
91
- }
92
- // --------------------------------------------------------------------------
93
- //
94
- // Lifecycle
95
- //
96
- // --------------------------------------------------------------------------
97
- async componentWillLoad() {
98
- await F(this, getAssetPath("./assets"));
99
- // in case more than 1 selected field and multiple is set to false
100
- if (!this.multiple && this.selectedFields.length > 1) {
101
- this.selectedFields = [this.selectedFields[0]];
102
+ this.lastSortyBy = this.sortBy || this.lastSortyBy;
102
103
  }
103
- this.lastSortyBy = this.sortBy || this.lastSortyBy;
104
- }
105
- async componentDidLoad() {
106
- const intl = await importIntl();
107
- intl.setLocale(this._lang);
108
- this.setUpObserver();
109
- this.popoverNode.open = true;
110
- // need timeout because of re-render
111
- setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 200);
112
- }
113
- disconnectedCallback() {
114
- U(this);
115
- this.observer?.disconnect();
116
- }
117
- // --------------------------------------------------------------------------
118
- //
119
- // Public Methods
120
- //
121
- // --------------------------------------------------------------------------
122
- async setFocus() {
123
- setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 1);
124
- }
125
- async reposition() {
126
- this.popoverNode?.reposition();
127
- }
128
- // --------------------------------------------------------------------------
129
- //
130
- // Private Methods
131
- //
132
- // --------------------------------------------------------------------------
133
- getSortedList() {
134
- const tempSorted = [...this.fields];
135
- if (this.lastSortyBy === LastSortyBy.display) {
136
- tempSorted.sort((a, b) => a.alias.localeCompare(b.alias));
104
+ async componentDidLoad() {
105
+ const intl = await importIntl();
106
+ intl.setLocale(this._lang);
107
+ this.setUpObserver();
108
+ this.popoverNode.open = true;
109
+ // need timeout because of re-render
110
+ setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 200);
137
111
  }
138
- else if (this.lastSortyBy === LastSortyBy.field) {
139
- tempSorted.sort((a, b) => a.name.localeCompare(b.name));
112
+ disconnectedCallback() {
113
+ U(this);
114
+ this.observer?.disconnect();
140
115
  }
141
- else if (this.lastSortyBy === LastSortyBy.type) {
142
- tempSorted.sort((a, b) => a.type.localeCompare(b.type));
116
+ // --------------------------------------------------------------------------
117
+ //
118
+ // Public Methods
119
+ //
120
+ // --------------------------------------------------------------------------
121
+ async setFocus() {
122
+ setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 1);
143
123
  }
144
- return tempSorted;
145
- }
146
- showFieldInfoCheck(field) {
147
- if (this.showFieldInfo) {
148
- // dont want info for arcade and relation fields
149
- if (field.name.includes(FieldInfoPrefix.expression) || field.name.includes(FieldInfoPrefix.relationship)) {
150
- return false;
151
- }
152
- else {
153
- return true;
154
- }
124
+ async reposition() {
125
+ this.popoverNode?.reposition();
155
126
  }
156
- else {
157
- return false;
127
+ // --------------------------------------------------------------------------
128
+ //
129
+ // Private Methods
130
+ //
131
+ // --------------------------------------------------------------------------
132
+ getSortedList() {
133
+ const tempSorted = [...this.fields];
134
+ if (this.lastSortyBy === LastSortyBy.display) {
135
+ tempSorted.sort((a, b) => a.alias.localeCompare(b.alias));
136
+ }
137
+ else if (this.lastSortyBy === LastSortyBy.field) {
138
+ tempSorted.sort((a, b) => a.name.localeCompare(b.name));
139
+ }
140
+ else if (this.lastSortyBy === LastSortyBy.type) {
141
+ tempSorted.sort((a, b) => a.type.localeCompare(b.type));
142
+ }
143
+ return tempSorted;
158
144
  }
159
- }
160
- // return true for deselect all, false for select all
161
- selectDeselect() {
162
- return this.filterFields?.length ? this.filterContainsAll() : this.selectedFields.length === this.fields.length;
163
- }
164
- // check if filter has all current field info
165
- filterContainsAll() {
166
- return !!this.filterFields?.every((filter) => {
167
- return this.selectedFields.some((curr) => {
168
- return curr === filter;
169
- });
170
- });
171
- }
172
- // --------------------------------------------------------------------------
173
- //
174
- // Rendor Methods
175
- //
176
- // --------------------------------------------------------------------------
177
- render() {
178
- const addBtn = (h("calcite-button", { slot: "footer", appearance: this.showCancel ? "solid" : "outline-fill", width: this.showCancel ? "half" : "full", scale: "m", onClick: () => {
179
- this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
180
- } }, this.okBtnText || (this.multiple ? this._t9nStrings.done : this._t9nStrings.ok)));
181
- const cancelBtn = (h("calcite-button", { slot: "footer", appearance: "outline-fill", width: this.multiple ? "half" : "full", scale: "m", onClick: () => this.arcgisFieldPickListDismissed.emit() }, this._t9nStrings.cancel));
182
- const hasType = this.fields.every((field) => !!field.type);
183
- const sort = (h("calcite-dropdown", { slot: "menu-actions", placement: "bottom-end", overlayPositioning: "fixed", ref: (node) => (this.dropdownNode = node), onCalciteDropdownOpen: () => {
184
- this.observer?.disconnect();
185
- this.observer?.observe(this.popoverNode, { attributes: true });
186
- }, onCalciteDropdownClose: () => this.observer?.disconnect() }, h("calcite-action", { slot: "trigger", text: this._t9nStrings.sort, title: this._t9nStrings.sort }, h("calcite-icon", { scale: "s", icon: "sortDescending" })), h("calcite-dropdown-group", null, h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.default, onClick: () => {
187
- this.lastSortyBy = LastSortyBy.default;
188
- this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
189
- } }, this._t9nStrings.default), h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.display, onClick: () => {
190
- this.lastSortyBy = LastSortyBy.display;
191
- this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
192
- } }, this._t9nStrings.displayName), hasType && (h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.type, onClick: () => {
193
- this.lastSortyBy = LastSortyBy.type;
194
- this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
195
- } }, this._t9nStrings.type)), h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.field, onClick: () => {
196
- this.lastSortyBy = LastSortyBy.field;
197
- this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
198
- } }, this._t9nStrings.fieldName))));
199
- const selectionBtn = (h("div", { class: "selection-button-div" }, h("calcite-button", { appearance: "transparent", scale: "s", width: "full", onClick: () => {
200
- if (this.selectDeselect()) {
201
- //deselect all
202
- this.selectedFields = this.filterFields?.length
203
- ? this.selectedFields.filter((item) => !this.filterFields?.includes(item))
204
- : [];
145
+ showFieldInfoCheck(field) {
146
+ if (this.showFieldInfo) {
147
+ // dont want info for arcade and relation fields
148
+ if (field.name.includes(FieldInfoPrefix.expression) || field.name.includes(FieldInfoPrefix.relationship)) {
149
+ return false;
150
+ }
151
+ else {
152
+ return true;
153
+ }
205
154
  }
206
155
  else {
207
- //select all
208
- this.selectedFields = this.filterFields?.length
209
- ? [...new Set([...this.selectedFields, ...this.filterFields])]
210
- : this.fields.map((field) => {
211
- return field.name;
212
- });
156
+ return false;
213
157
  }
214
- } }, this.selectDeselect() ? this._t9nStrings.deselectAll : this._t9nStrings.selectAll)));
215
- return (h(Host, { class: "js-app-flyout" }, h("calcite-popover", { dir: C(this._hostElement), class: "popover", placement: this.popoverProps.placement || "leading-start", open: false, pointerDisabled: true, referenceElement: this.popoverProps.refElement, offsetDistance: this.popoverProps.offsetDistance || -Math.round(this.popoverProps.refElement.getBoundingClientRect().width), offsetSkidding: this.popoverProps.offsetSkidding || 0, overlayPositioning: this.popoverProps.overlayPositioning, triggerDisabled: this.popoverProps.triggerDisabled, autoClose: this.popoverProps.autoClose, label: this.heading || (this.multiple ? this._t9nStrings.headerSelect : this._t9nStrings.header), onCalcitePopoverClose: () => this.arcgisFieldPickListDismissed.emit(), ref: (node) => (this.popoverNode = node) }, h("calcite-flow", { ref: (node) => {
216
- this.flowElement = node;
217
- }, style: {
218
- width: `${this.popoverProps.popoverWidth || this.popoverProps.refElement.getBoundingClientRect().width}px`
219
- } }, h("calcite-flow-item", { ref: (el) => (this.panelElement = el), class: "panel", heading: this.heading || (this.multiple ? this._t9nStrings.headerSelect : this._t9nStrings.header), closable: true, onCalciteFlowItemClose: () => this.arcgisFieldPickListDismissed.emit() }, this.multiple && addBtn, this.showCancel && cancelBtn, h("calcite-pick-list", { multiple: this.multiple, ref: (node) => {
220
- this.pickListNode = node;
221
- }, class: "content", filterEnabled: this.fields.length >= this.showFilterLength ? true : false, filterPlaceholder: this.filterPlaceholderText ?? this._t9nStrings.filter, onCalciteListChange: async () => {
222
- // keep original order. Add addional values at the end
223
- const tempSelectedFields = await this.pickListNode.getSelectedItems();
224
- this.selectedFields = [
225
- ...new Set([
226
- ...this.selectedFields.filter((item) => {
227
- return tempSelectedFields.has(item);
228
- }),
229
- ...tempSelectedFields.keys()
230
- ])
231
- ];
232
- this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
233
- if (!this.multiple) {
234
- this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
235
- }
236
- }, onCalciteListFilter: (event) => {
237
- event.stopPropagation();
238
- const node = event.target;
239
- this.filterFields = node.filteredItems?.map((item) => {
240
- return item.value;
158
+ }
159
+ // return true for deselect all, false for select all
160
+ selectDeselect() {
161
+ return this.filterFields?.length ? this.filterContainsAll() : this.selectedFields.length === this.fields.length;
162
+ }
163
+ // check if filter has all current field info
164
+ filterContainsAll() {
165
+ return !!this.filterFields?.every((filter) => this.selectedFields.some((curr) => curr === filter));
166
+ }
167
+ // --------------------------------------------------------------------------
168
+ //
169
+ // Rendor Methods
170
+ //
171
+ // --------------------------------------------------------------------------
172
+ render() {
173
+ const addBtn = (h("calcite-button", { slot: "footer", appearance: this.showCancel ? "solid" : "outline-fill", width: this.showCancel ? "half" : "full", scale: "m", onClick: () => {
174
+ this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
175
+ } }, this.okBtnText || (this.multiple ? this._t9nStrings.done : this._t9nStrings.ok)));
176
+ const cancelBtn = (h("calcite-button", { slot: "footer", appearance: "outline-fill", width: this.multiple ? "half" : "full", scale: "m", onClick: () => this.arcgisFieldPickListDismissed.emit() }, this._t9nStrings.cancel));
177
+ const hasType = this.fields.every((field) => !!field.type);
178
+ const sort = (h("calcite-dropdown", { slot: "menu-actions", placement: "bottom-end", overlayPositioning: "fixed", ref: (node) => (this.dropdownNode = node), onCalciteDropdownOpen: () => {
179
+ this.observer?.disconnect();
180
+ this.observer?.observe(this.popoverNode, { attributes: true });
181
+ }, onCalciteDropdownClose: () => this.observer?.disconnect() }, h("calcite-action", { slot: "trigger", text: this._t9nStrings.sort, title: this._t9nStrings.sort }, h("calcite-icon", { scale: "s", icon: "sortDescending" })), h("calcite-dropdown-group", null, h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.default, onClick: () => {
182
+ this.lastSortyBy = LastSortyBy.default;
183
+ this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
184
+ } }, this._t9nStrings.default), h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.display, onClick: () => {
185
+ this.lastSortyBy = LastSortyBy.display;
186
+ this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
187
+ } }, this._t9nStrings.displayName), hasType && (h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.type, onClick: () => {
188
+ this.lastSortyBy = LastSortyBy.type;
189
+ this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
190
+ } }, this._t9nStrings.type)), h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.field, onClick: () => {
191
+ this.lastSortyBy = LastSortyBy.field;
192
+ this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
193
+ } }, this._t9nStrings.fieldName))));
194
+ const selectionBtn = (h("div", { class: "selection-button-div" }, h("calcite-button", { appearance: "transparent", scale: "s", width: "full", onClick: () => {
195
+ if (this.selectDeselect()) {
196
+ //deselect all
197
+ this.selectedFields = this.filterFields?.length
198
+ ? this.selectedFields.filter((item) => !this.filterFields?.includes(item))
199
+ : [];
200
+ }
201
+ else {
202
+ //select all
203
+ this.selectedFields = this.filterFields?.length
204
+ ? [...new Set([...this.selectedFields, ...this.filterFields])]
205
+ : this.fields.map((field) => field.name);
206
+ }
207
+ } }, this.selectDeselect() ? this._t9nStrings.deselectAll : this._t9nStrings.selectAll)));
208
+ return (h(Host, { class: "js-app-flyout" }, h("calcite-popover", { dir: C(this._hostElement), class: "popover", placement: this.popoverProps.placement || "leading-start", open: false, pointerDisabled: true, referenceElement: this.popoverProps.refElement, offsetDistance: this.popoverProps.offsetDistance || -Math.round(this.popoverProps.refElement.getBoundingClientRect().width), offsetSkidding: this.popoverProps.offsetSkidding || 0, overlayPositioning: this.popoverProps.overlayPositioning, triggerDisabled: this.popoverProps.triggerDisabled, autoClose: this.popoverProps.autoClose, label: this.heading || (this.multiple ? this._t9nStrings.headerSelect : this._t9nStrings.header), onCalcitePopoverClose: () => this.arcgisFieldPickListDismissed.emit(), ref: (node) => (this.popoverNode = node) }, h("calcite-flow", { ref: (node) => {
209
+ this.flowElement = node;
210
+ }, style: {
211
+ width: `${this.popoverProps.popoverWidth || this.popoverProps.refElement.getBoundingClientRect().width}px`
212
+ } }, h("calcite-flow-item", { ref: (el) => (this.panelElement = el), class: "panel", heading: this.heading || (this.multiple ? this._t9nStrings.headerSelect : this._t9nStrings.header), closable: true, onCalciteFlowItemClose: () => this.arcgisFieldPickListDismissed.emit() }, this.multiple && addBtn, this.showCancel && cancelBtn, h("calcite-pick-list", { multiple: this.multiple, ref: (node) => {
213
+ this.pickListNode = node;
214
+ }, class: "content", filterEnabled: this.fields.length >= this.showFilterLength, filterPlaceholder: this.filterPlaceholderText ?? this._t9nStrings.filter, onCalciteListChange: async () => {
215
+ // keep original order. Add addional values at the end
216
+ const tempSelectedFields = await this.pickListNode.getSelectedItems();
217
+ this.selectedFields = [
218
+ ...new Set([
219
+ ...this.selectedFields.filter((item) => tempSelectedFields.has(item)),
220
+ ...tempSelectedFields.keys()
221
+ ])
222
+ ];
223
+ this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
224
+ if (!this.multiple) {
225
+ this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
226
+ }
227
+ }, onCalciteListFilter: (event) => {
228
+ event.stopPropagation();
229
+ const node = event.target;
230
+ this.filterFields = node.filteredItems?.map((item) => item.value);
231
+ } }, this.fields.length >= this.showFilterLength && this.showSort && sort, this.multiple && this.showSelectionAll && selectionBtn, [...this.getSortedList()].map((field) => this.calciteValueList(field))))))));
232
+ }
233
+ // --------------------------------------------------------------------------
234
+ //
235
+ // Private Methods
236
+ //
237
+ // --------------------------------------------------------------------------
238
+ setUpObserver() {
239
+ this.observer = new MutationObserver((mutationList /* , observer */) => {
240
+ for (const mutation of mutationList) {
241
+ if (mutation.attributeName === "style") {
242
+ if (this.popoverNode.style.visibility === "hidden") {
243
+ this.dropdownNode.open = false;
244
+ }
245
+ }
246
+ }
241
247
  });
242
- } }, this.fields.length >= this.showFilterLength && this.showSort && sort, this.multiple && this.showSelectionAll && selectionBtn, [...this.getSortedList()].map((field) => {
243
- return this.calciteValueList(field);
244
- })))))));
245
- }
246
- // --------------------------------------------------------------------------
247
- //
248
- // Private Methods
249
- //
250
- // --------------------------------------------------------------------------
251
- setUpObserver() {
252
- this.observer = new MutationObserver((mutationList /* , observer */) => {
253
- for (const mutation of mutationList) {
254
- if (mutation.attributeName === "style") {
255
- if (this.popoverNode.style.visibility === "hidden") {
256
- this.dropdownNode.open = false;
257
- }
258
- }
259
- }
260
- });
261
- }
262
- static get assetsDirs() { return ["assets"]; }
263
- get _hostElement() { return this; }
264
- static get style() { return fieldPickListScss; }
248
+ }
249
+ static get assetsDirs() { return ["assets"]; }
250
+ get _hostElement() { return this; }
251
+ static get style() { return fieldPickListScss; }
265
252
  }, [1, "arcgis-field-pick-list", {
266
- "selectedFields": [1040],
267
- "fields": [16],
268
- "popoverProps": [16],
269
- "layer": [16],
270
- "mapView": [16],
271
- "showFieldInfo": [4, "show-field-info"],
272
- "showFieldName": [4, "show-field-name"],
273
- "showDescription": [4, "show-description"],
274
- "showSelectionAll": [4, "show-selection-all"],
275
- "showCancel": [4, "show-cancel"],
276
- "showSort": [4, "show-sort"],
277
- "showFilterLength": [2, "show-filter-length"],
278
- "multiple": [4],
279
- "heading": [1],
280
- "okBtnText": [1, "ok-btn-text"],
281
- "filterPlaceholderText": [1, "filter-placeholder-text"],
282
- "sortBy": [1, "sort-by"],
283
- "lastSortyBy": [32],
284
- "filterFields": [32],
285
- "_lang": [32],
286
- "_t9nLocale": [32],
287
- "_t9nStrings": [32],
288
- "setFocus": [64],
289
- "reposition": [64]
290
- }]);
253
+ "selectedFields": [1040],
254
+ "fields": [16],
255
+ "popoverProps": [16],
256
+ "layer": [16],
257
+ "mapView": [16],
258
+ "showFieldInfo": [4, "show-field-info"],
259
+ "showFieldName": [4, "show-field-name"],
260
+ "showDescription": [4, "show-description"],
261
+ "showSelectionAll": [4, "show-selection-all"],
262
+ "showCancel": [4, "show-cancel"],
263
+ "showSort": [4, "show-sort"],
264
+ "showFilterLength": [2, "show-filter-length"],
265
+ "multiple": [4],
266
+ "heading": [1],
267
+ "okBtnText": [1, "ok-btn-text"],
268
+ "filterPlaceholderText": [1, "filter-placeholder-text"],
269
+ "sortBy": [1, "sort-by"],
270
+ "lastSortyBy": [32],
271
+ "filterFields": [32],
272
+ "_lang": [32],
273
+ "_t9nLocale": [32],
274
+ "_t9nStrings": [32],
275
+ "setFocus": [64],
276
+ "reposition": [64]
277
+ }]);
291
278
  function defineCustomElement$1() {
292
- if (typeof customElements === "undefined") {
293
- return;
294
- }
295
- const components = ["arcgis-field-pick-list", "arcgis-field-info"];
296
- components.forEach(tagName => { switch (tagName) {
297
- case "arcgis-field-pick-list":
298
- if (!customElements.get(tagName)) {
299
- customElements.define(tagName, ArcgisFieldPickList$1);
300
- }
301
- break;
302
- case "arcgis-field-info":
303
- if (!customElements.get(tagName)) {
304
- defineCustomElement$2();
305
- }
306
- break;
307
- } });
279
+ if (typeof customElements === "undefined") {
280
+ return;
281
+ }
282
+ const components = ["arcgis-field-pick-list", "arcgis-field-info"];
283
+ components.forEach(tagName => { switch (tagName) {
284
+ case "arcgis-field-pick-list":
285
+ if (!customElements.get(tagName)) {
286
+ customElements.define(tagName, ArcgisFieldPickList$1);
287
+ }
288
+ break;
289
+ case "arcgis-field-info":
290
+ if (!customElements.get(tagName)) {
291
+ defineCustomElement$2();
292
+ }
293
+ break;
294
+ } });
308
295
  }
309
296
  defineCustomElement$1();
310
297