@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,253 +1,240 @@
1
- import { r as registerInstance, c as createEvent, h, a as getAssetPath, H as Host, g as getElement } from './index-74897166.js';
2
- import { a as importIntl } from './index-3d9bb67e.js';
3
- import { F, U, C } from './index-e7244815.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getAssetPath, H as Host, a as getElement } from './index-0c129ec4.js';
2
+ import { F, i as importIntl, U, C } from './index-ba4fe890.js';
4
3
 
5
4
  const fieldPickListScss = ".popover{z-index:100}.panel{min-height:300px}.content{max-height:60vh}.selection-button-div{padding:4px 10px}";
6
5
 
7
6
  var FieldInfoPrefix;
8
7
  (function (FieldInfoPrefix) {
9
- FieldInfoPrefix["expression"] = "expression/";
10
- FieldInfoPrefix["relationship"] = "relationships/";
11
- FieldInfoPrefix["raster"] = "Raster.";
8
+ FieldInfoPrefix["expression"] = "expression/";
9
+ FieldInfoPrefix["relationship"] = "relationships/";
10
+ FieldInfoPrefix["raster"] = "Raster.";
12
11
  })(FieldInfoPrefix || (FieldInfoPrefix = {}));
13
12
  var LastSortyBy;
14
13
  (function (LastSortyBy) {
15
- LastSortyBy["default"] = "default";
16
- LastSortyBy["display"] = "display";
17
- LastSortyBy["type"] = "type";
18
- LastSortyBy["field"] = "field";
14
+ LastSortyBy["default"] = "default";
15
+ LastSortyBy["display"] = "display";
16
+ LastSortyBy["type"] = "type";
17
+ LastSortyBy["field"] = "field";
19
18
  })(LastSortyBy || (LastSortyBy = {}));
20
19
  const ArcgisFieldPickList = class {
21
- constructor(hostRef) {
22
- registerInstance(this, hostRef);
23
- this.arcgisFieldPickListDismissed = createEvent(this, "arcgisFieldPickListDismissed", 7);
24
- this.arcgisFieldPickListChange = createEvent(this, "arcgisFieldPickListChange", 7);
25
- this.arcgisFieldPickListSortByChange = createEvent(this, "arcgisFieldPickListSortByChange", 7);
26
- this.calciteValueList = (field) => (h("calcite-pick-list-item", { key: field.name, label: field.alias || field.name, description: (() => {
27
- if (this.showFieldName) {
28
- return `{${field.name}}`;
29
- }
30
- if (this.showDescription && field.description) {
31
- return field.description;
20
+ constructor(hostRef) {
21
+ registerInstance(this, hostRef);
22
+ this.arcgisFieldPickListDismissed = createEvent(this, "arcgisFieldPickListDismissed", 7);
23
+ this.arcgisFieldPickListChange = createEvent(this, "arcgisFieldPickListChange", 7);
24
+ this.arcgisFieldPickListSortByChange = createEvent(this, "arcgisFieldPickListSortByChange", 7);
25
+ this.calciteValueList = (field) => (h("calcite-pick-list-item", { key: field.name, label: field.alias || field.name, description: (() => {
26
+ if (this.showFieldName) {
27
+ return `{${field.name}}`;
28
+ }
29
+ if (this.showDescription && field.description) {
30
+ return field.description;
31
+ }
32
+ return null;
33
+ })(), value: field.name, selected: (!this.multiple && field.name === this.selectedFields[0]) ||
34
+ (this.multiple && this.selectedFields.indexOf(field.name) > -1), metadata: {
35
+ label: field.alias,
36
+ fieldName: field.name
37
+ } }, this.showFieldInfoCheck(field) && (h("calcite-action", { slot: "actions-end", text: this._t9nStrings.info, title: this._t9nStrings.info, scale: "s", icon: "information", onClick: (event) => {
38
+ event.stopPropagation();
39
+ const action = event.target;
40
+ const fieldInfoFlowItem = document.createElement("calcite-flow-item");
41
+ fieldInfoFlowItem.heading = field.alias ?? field.name;
42
+ fieldInfoFlowItem.description = field.name;
43
+ fieldInfoFlowItem.className = "panel";
44
+ const fieldInfo = document.createElement("arcgis-field-info");
45
+ fieldInfo.lang = this._lang;
46
+ fieldInfo.fieldName = field.name;
47
+ fieldInfo.layer = this.layer;
48
+ fieldInfo.view = this.mapView;
49
+ fieldInfo.classList.add("content");
50
+ fieldInfoFlowItem.appendChild(fieldInfo);
51
+ fieldInfoFlowItem.addEventListener("calciteFlowItemBack", () => setTimeout(() => requestAnimationFrame(() => action.setFocus()), 200));
52
+ this.flowElement.appendChild(fieldInfoFlowItem);
53
+ setTimeout(() => requestAnimationFrame(() => fieldInfoFlowItem.setFocus()), 200);
54
+ } }))));
55
+ this.selectedFields = [];
56
+ this.fields = undefined;
57
+ this.popoverProps = undefined;
58
+ this.layer = undefined;
59
+ this.mapView = undefined;
60
+ this.showFieldInfo = false;
61
+ this.showFieldName = false;
62
+ this.showDescription = false;
63
+ this.showSelectionAll = false;
64
+ this.showCancel = true;
65
+ this.showSort = true;
66
+ this.showFilterLength = 10;
67
+ this.multiple = false;
68
+ this.heading = undefined;
69
+ this.okBtnText = undefined;
70
+ this.filterPlaceholderText = undefined;
71
+ this.sortBy = undefined;
72
+ this.lastSortyBy = LastSortyBy.default;
73
+ this.filterFields = null;
74
+ this._lang = "";
75
+ this._t9nLocale = "";
76
+ this._t9nStrings = undefined;
77
+ }
78
+ // --------------------------------------------------------------------------
79
+ //
80
+ // Lifecycle
81
+ //
82
+ // --------------------------------------------------------------------------
83
+ async componentWillLoad() {
84
+ await F(this, getAssetPath("./assets"));
85
+ // in case more than 1 selected field and multiple is set to false
86
+ if (!this.multiple && this.selectedFields.length > 1) {
87
+ this.selectedFields = [this.selectedFields[0]];
32
88
  }
33
- return null;
34
- })(), value: field.name, selected: (!this.multiple && field.name === this.selectedFields[0]) ||
35
- (this.multiple && this.selectedFields.indexOf(field.name) > -1), metadata: {
36
- label: field.alias,
37
- fieldName: field.name
38
- } }, this.showFieldInfoCheck(field) && (h("calcite-action", { slot: "actions-end", text: this._t9nStrings.info, title: this._t9nStrings.info, scale: "s", icon: "information", onClick: (event) => {
39
- event.stopPropagation();
40
- const action = event.target;
41
- const fieldInfoFlowItem = document.createElement("calcite-flow-item");
42
- fieldInfoFlowItem.heading = field.alias ?? field.name;
43
- fieldInfoFlowItem.description = field.name;
44
- fieldInfoFlowItem.className = "panel";
45
- const fieldInfo = document.createElement("arcgis-field-info");
46
- fieldInfo.lang = this._lang;
47
- fieldInfo.fieldName = field.name;
48
- fieldInfo.layer = this.layer;
49
- fieldInfo.view = this.mapView;
50
- fieldInfo.classList.add("content");
51
- fieldInfoFlowItem.appendChild(fieldInfo);
52
- fieldInfoFlowItem.addEventListener("calciteFlowItemBack", () => setTimeout(() => requestAnimationFrame(() => action.setFocus()), 200));
53
- this.flowElement.appendChild(fieldInfoFlowItem);
54
- setTimeout(() => requestAnimationFrame(() => fieldInfoFlowItem.setFocus()), 200);
55
- } }))));
56
- this.selectedFields = [];
57
- this.fields = undefined;
58
- this.popoverProps = undefined;
59
- this.layer = undefined;
60
- this.mapView = undefined;
61
- this.showFieldInfo = false;
62
- this.showFieldName = false;
63
- this.showDescription = false;
64
- this.showSelectionAll = false;
65
- this.showCancel = true;
66
- this.showSort = true;
67
- this.showFilterLength = 10;
68
- this.multiple = false;
69
- this.heading = undefined;
70
- this.okBtnText = undefined;
71
- this.filterPlaceholderText = undefined;
72
- this.sortBy = undefined;
73
- this.lastSortyBy = LastSortyBy.default;
74
- this.filterFields = null;
75
- this._lang = "";
76
- this._t9nLocale = "";
77
- this._t9nStrings = undefined;
78
- }
79
- // --------------------------------------------------------------------------
80
- //
81
- // Lifecycle
82
- //
83
- // --------------------------------------------------------------------------
84
- async componentWillLoad() {
85
- await F(this, getAssetPath("./assets"));
86
- // in case more than 1 selected field and multiple is set to false
87
- if (!this.multiple && this.selectedFields.length > 1) {
88
- this.selectedFields = [this.selectedFields[0]];
89
+ this.lastSortyBy = this.sortBy || this.lastSortyBy;
89
90
  }
90
- this.lastSortyBy = this.sortBy || this.lastSortyBy;
91
- }
92
- async componentDidLoad() {
93
- const intl = await importIntl();
94
- intl.setLocale(this._lang);
95
- this.setUpObserver();
96
- this.popoverNode.open = true;
97
- // need timeout because of re-render
98
- setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 200);
99
- }
100
- disconnectedCallback() {
101
- U(this);
102
- this.observer?.disconnect();
103
- }
104
- // --------------------------------------------------------------------------
105
- //
106
- // Public Methods
107
- //
108
- // --------------------------------------------------------------------------
109
- async setFocus() {
110
- setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 1);
111
- }
112
- async reposition() {
113
- this.popoverNode?.reposition();
114
- }
115
- // --------------------------------------------------------------------------
116
- //
117
- // Private Methods
118
- //
119
- // --------------------------------------------------------------------------
120
- getSortedList() {
121
- const tempSorted = [...this.fields];
122
- if (this.lastSortyBy === LastSortyBy.display) {
123
- tempSorted.sort((a, b) => a.alias.localeCompare(b.alias));
91
+ async componentDidLoad() {
92
+ const intl = await importIntl();
93
+ intl.setLocale(this._lang);
94
+ this.setUpObserver();
95
+ this.popoverNode.open = true;
96
+ // need timeout because of re-render
97
+ setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 200);
124
98
  }
125
- else if (this.lastSortyBy === LastSortyBy.field) {
126
- tempSorted.sort((a, b) => a.name.localeCompare(b.name));
99
+ disconnectedCallback() {
100
+ U(this);
101
+ this.observer?.disconnect();
127
102
  }
128
- else if (this.lastSortyBy === LastSortyBy.type) {
129
- tempSorted.sort((a, b) => a.type.localeCompare(b.type));
103
+ // --------------------------------------------------------------------------
104
+ //
105
+ // Public Methods
106
+ //
107
+ // --------------------------------------------------------------------------
108
+ async setFocus() {
109
+ setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 1);
130
110
  }
131
- return tempSorted;
132
- }
133
- showFieldInfoCheck(field) {
134
- if (this.showFieldInfo) {
135
- // dont want info for arcade and relation fields
136
- if (field.name.includes(FieldInfoPrefix.expression) || field.name.includes(FieldInfoPrefix.relationship)) {
137
- return false;
138
- }
139
- else {
140
- return true;
141
- }
111
+ async reposition() {
112
+ this.popoverNode?.reposition();
142
113
  }
143
- else {
144
- return false;
114
+ // --------------------------------------------------------------------------
115
+ //
116
+ // Private Methods
117
+ //
118
+ // --------------------------------------------------------------------------
119
+ getSortedList() {
120
+ const tempSorted = [...this.fields];
121
+ if (this.lastSortyBy === LastSortyBy.display) {
122
+ tempSorted.sort((a, b) => a.alias.localeCompare(b.alias));
123
+ }
124
+ else if (this.lastSortyBy === LastSortyBy.field) {
125
+ tempSorted.sort((a, b) => a.name.localeCompare(b.name));
126
+ }
127
+ else if (this.lastSortyBy === LastSortyBy.type) {
128
+ tempSorted.sort((a, b) => a.type.localeCompare(b.type));
129
+ }
130
+ return tempSorted;
145
131
  }
146
- }
147
- // return true for deselect all, false for select all
148
- selectDeselect() {
149
- return this.filterFields?.length ? this.filterContainsAll() : this.selectedFields.length === this.fields.length;
150
- }
151
- // check if filter has all current field info
152
- filterContainsAll() {
153
- return !!this.filterFields?.every((filter) => {
154
- return this.selectedFields.some((curr) => {
155
- return curr === filter;
156
- });
157
- });
158
- }
159
- // --------------------------------------------------------------------------
160
- //
161
- // Rendor Methods
162
- //
163
- // --------------------------------------------------------------------------
164
- render() {
165
- const addBtn = (h("calcite-button", { slot: "footer", appearance: this.showCancel ? "solid" : "outline-fill", width: this.showCancel ? "half" : "full", scale: "m", onClick: () => {
166
- this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
167
- } }, this.okBtnText || (this.multiple ? this._t9nStrings.done : this._t9nStrings.ok)));
168
- const cancelBtn = (h("calcite-button", { slot: "footer", appearance: "outline-fill", width: this.multiple ? "half" : "full", scale: "m", onClick: () => this.arcgisFieldPickListDismissed.emit() }, this._t9nStrings.cancel));
169
- const hasType = this.fields.every((field) => !!field.type);
170
- const sort = (h("calcite-dropdown", { slot: "menu-actions", placement: "bottom-end", overlayPositioning: "fixed", ref: (node) => (this.dropdownNode = node), onCalciteDropdownOpen: () => {
171
- this.observer?.disconnect();
172
- this.observer?.observe(this.popoverNode, { attributes: true });
173
- }, 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: () => {
174
- this.lastSortyBy = LastSortyBy.default;
175
- this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
176
- } }, this._t9nStrings.default), h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.display, onClick: () => {
177
- this.lastSortyBy = LastSortyBy.display;
178
- this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
179
- } }, this._t9nStrings.displayName), hasType && (h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.type, onClick: () => {
180
- this.lastSortyBy = LastSortyBy.type;
181
- this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
182
- } }, this._t9nStrings.type)), h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.field, onClick: () => {
183
- this.lastSortyBy = LastSortyBy.field;
184
- this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
185
- } }, this._t9nStrings.fieldName))));
186
- const selectionBtn = (h("div", { class: "selection-button-div" }, h("calcite-button", { appearance: "transparent", scale: "s", width: "full", onClick: () => {
187
- if (this.selectDeselect()) {
188
- //deselect all
189
- this.selectedFields = this.filterFields?.length
190
- ? this.selectedFields.filter((item) => !this.filterFields?.includes(item))
191
- : [];
132
+ showFieldInfoCheck(field) {
133
+ if (this.showFieldInfo) {
134
+ // dont want info for arcade and relation fields
135
+ if (field.name.includes(FieldInfoPrefix.expression) || field.name.includes(FieldInfoPrefix.relationship)) {
136
+ return false;
137
+ }
138
+ else {
139
+ return true;
140
+ }
192
141
  }
193
142
  else {
194
- //select all
195
- this.selectedFields = this.filterFields?.length
196
- ? [...new Set([...this.selectedFields, ...this.filterFields])]
197
- : this.fields.map((field) => {
198
- return field.name;
199
- });
200
- }
201
- } }, this.selectDeselect() ? this._t9nStrings.deselectAll : this._t9nStrings.selectAll)));
202
- 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) => {
203
- this.flowElement = node;
204
- }, style: {
205
- width: `${this.popoverProps.popoverWidth || this.popoverProps.refElement.getBoundingClientRect().width}px`
206
- } }, 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) => {
207
- this.pickListNode = node;
208
- }, class: "content", filterEnabled: this.fields.length >= this.showFilterLength ? true : false, filterPlaceholder: this.filterPlaceholderText ?? this._t9nStrings.filter, onCalciteListChange: async () => {
209
- // keep original order. Add addional values at the end
210
- const tempSelectedFields = await this.pickListNode.getSelectedItems();
211
- this.selectedFields = [
212
- ...new Set([
213
- ...this.selectedFields.filter((item) => {
214
- return tempSelectedFields.has(item);
215
- }),
216
- ...tempSelectedFields.keys()
217
- ])
218
- ];
219
- this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
220
- if (!this.multiple) {
221
- this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
143
+ return false;
222
144
  }
223
- }, onCalciteListFilter: (event) => {
224
- event.stopPropagation();
225
- const node = event.target;
226
- this.filterFields = node.filteredItems?.map((item) => {
227
- return item.value;
145
+ }
146
+ // return true for deselect all, false for select all
147
+ selectDeselect() {
148
+ return this.filterFields?.length ? this.filterContainsAll() : this.selectedFields.length === this.fields.length;
149
+ }
150
+ // check if filter has all current field info
151
+ filterContainsAll() {
152
+ return !!this.filterFields?.every((filter) => this.selectedFields.some((curr) => curr === filter));
153
+ }
154
+ // --------------------------------------------------------------------------
155
+ //
156
+ // Rendor Methods
157
+ //
158
+ // --------------------------------------------------------------------------
159
+ render() {
160
+ const addBtn = (h("calcite-button", { slot: "footer", appearance: this.showCancel ? "solid" : "outline-fill", width: this.showCancel ? "half" : "full", scale: "m", onClick: () => {
161
+ this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
162
+ } }, this.okBtnText || (this.multiple ? this._t9nStrings.done : this._t9nStrings.ok)));
163
+ const cancelBtn = (h("calcite-button", { slot: "footer", appearance: "outline-fill", width: this.multiple ? "half" : "full", scale: "m", onClick: () => this.arcgisFieldPickListDismissed.emit() }, this._t9nStrings.cancel));
164
+ const hasType = this.fields.every((field) => !!field.type);
165
+ const sort = (h("calcite-dropdown", { slot: "menu-actions", placement: "bottom-end", overlayPositioning: "fixed", ref: (node) => (this.dropdownNode = node), onCalciteDropdownOpen: () => {
166
+ this.observer?.disconnect();
167
+ this.observer?.observe(this.popoverNode, { attributes: true });
168
+ }, 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: () => {
169
+ this.lastSortyBy = LastSortyBy.default;
170
+ this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
171
+ } }, this._t9nStrings.default), h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.display, onClick: () => {
172
+ this.lastSortyBy = LastSortyBy.display;
173
+ this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
174
+ } }, this._t9nStrings.displayName), hasType && (h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.type, onClick: () => {
175
+ this.lastSortyBy = LastSortyBy.type;
176
+ this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
177
+ } }, this._t9nStrings.type)), h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.field, onClick: () => {
178
+ this.lastSortyBy = LastSortyBy.field;
179
+ this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
180
+ } }, this._t9nStrings.fieldName))));
181
+ const selectionBtn = (h("div", { class: "selection-button-div" }, h("calcite-button", { appearance: "transparent", scale: "s", width: "full", onClick: () => {
182
+ if (this.selectDeselect()) {
183
+ //deselect all
184
+ this.selectedFields = this.filterFields?.length
185
+ ? this.selectedFields.filter((item) => !this.filterFields?.includes(item))
186
+ : [];
187
+ }
188
+ else {
189
+ //select all
190
+ this.selectedFields = this.filterFields?.length
191
+ ? [...new Set([...this.selectedFields, ...this.filterFields])]
192
+ : this.fields.map((field) => field.name);
193
+ }
194
+ } }, this.selectDeselect() ? this._t9nStrings.deselectAll : this._t9nStrings.selectAll)));
195
+ 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) => {
196
+ this.flowElement = node;
197
+ }, style: {
198
+ width: `${this.popoverProps.popoverWidth || this.popoverProps.refElement.getBoundingClientRect().width}px`
199
+ } }, 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) => {
200
+ this.pickListNode = node;
201
+ }, class: "content", filterEnabled: this.fields.length >= this.showFilterLength, filterPlaceholder: this.filterPlaceholderText ?? this._t9nStrings.filter, onCalciteListChange: async () => {
202
+ // keep original order. Add addional values at the end
203
+ const tempSelectedFields = await this.pickListNode.getSelectedItems();
204
+ this.selectedFields = [
205
+ ...new Set([
206
+ ...this.selectedFields.filter((item) => tempSelectedFields.has(item)),
207
+ ...tempSelectedFields.keys()
208
+ ])
209
+ ];
210
+ this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
211
+ if (!this.multiple) {
212
+ this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
213
+ }
214
+ }, onCalciteListFilter: (event) => {
215
+ event.stopPropagation();
216
+ const node = event.target;
217
+ this.filterFields = node.filteredItems?.map((item) => item.value);
218
+ } }, this.fields.length >= this.showFilterLength && this.showSort && sort, this.multiple && this.showSelectionAll && selectionBtn, [...this.getSortedList()].map((field) => this.calciteValueList(field))))))));
219
+ }
220
+ // --------------------------------------------------------------------------
221
+ //
222
+ // Private Methods
223
+ //
224
+ // --------------------------------------------------------------------------
225
+ setUpObserver() {
226
+ this.observer = new MutationObserver((mutationList /* , observer */) => {
227
+ for (const mutation of mutationList) {
228
+ if (mutation.attributeName === "style") {
229
+ if (this.popoverNode.style.visibility === "hidden") {
230
+ this.dropdownNode.open = false;
231
+ }
232
+ }
233
+ }
228
234
  });
229
- } }, this.fields.length >= this.showFilterLength && this.showSort && sort, this.multiple && this.showSelectionAll && selectionBtn, [...this.getSortedList()].map((field) => {
230
- return this.calciteValueList(field);
231
- })))))));
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
- }
247
- });
248
- }
249
- static get assetsDirs() { return ["assets"]; }
250
- get _hostElement() { return getElement(this); }
235
+ }
236
+ static get assetsDirs() { return ["assets"]; }
237
+ get _hostElement() { return getElement(this); }
251
238
  };
252
239
  ArcgisFieldPickList.style = fieldPickListScss;
253
240