@esri/solutions-components 0.8.10 → 0.8.12

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 (35) hide show
  1. package/dist/cjs/card-manager_3.cjs.entry.js +19 -6
  2. package/dist/cjs/crowdsource-manager.cjs.entry.js +5 -5
  3. package/dist/cjs/crowdsource-reporter.cjs.entry.js +2 -2
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/solutions-components.cjs.js +1 -1
  6. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +39 -5
  7. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +4 -3
  8. package/dist/collection/components/layer-table/layer-table.js +71 -7
  9. package/dist/collection/demos/crowdsource-manager.html +0 -1
  10. package/dist/components/crowdsource-manager.js +7 -5
  11. package/dist/components/crowdsource-reporter.js +3 -3
  12. package/dist/components/feature-list2.js +1 -1
  13. package/dist/components/layer-list2.js +1 -1
  14. package/dist/components/layer-table2.js +23 -7
  15. package/dist/components/map-layer-picker2.js +1 -1
  16. package/dist/components/map-select-tools2.js +1 -1
  17. package/dist/components/mapViewUtils.js +1 -1
  18. package/dist/components/refine-selection2.js +1 -1
  19. package/dist/esm/card-manager_3.entry.js +20 -7
  20. package/dist/esm/crowdsource-manager.entry.js +5 -5
  21. package/dist/esm/crowdsource-reporter.entry.js +2 -2
  22. package/dist/esm/loader.js +1 -1
  23. package/dist/esm/solutions-components.js +1 -1
  24. package/dist/solutions-components/demos/crowdsource-manager.html +0 -1
  25. package/dist/solutions-components/p-206caa2d.entry.js +6 -0
  26. package/dist/solutions-components/p-5ce5a6ae.entry.js +6 -0
  27. package/dist/solutions-components/p-a09daea3.entry.js +6 -0
  28. package/dist/solutions-components/solutions-components.esm.js +1 -1
  29. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +8 -0
  30. package/dist/types/components/layer-table/layer-table.d.ts +14 -2
  31. package/dist/types/components.d.ts +40 -0
  32. package/package.json +1 -1
  33. package/dist/solutions-components/p-40039b84.entry.js +0 -6
  34. package/dist/solutions-components/p-ae75d7d7.entry.js +0 -6
  35. package/dist/solutions-components/p-fffc9e08.entry.js +0 -6
@@ -78,6 +78,8 @@ export class CrowdsourceManager {
78
78
  this.theme = "light";
79
79
  this.zoomAndScrollToSelected = false;
80
80
  this.zoomToScale = undefined;
81
+ this.sortField = undefined;
82
+ this.sortOrder = undefined;
81
83
  this._expandPopup = this.hideMapOnLoad;
82
84
  this._hideFooter = false;
83
85
  this._hideTable = false;
@@ -184,9 +186,7 @@ export class CrowdsourceManager {
184
186
  * Renders the component.
185
187
  */
186
188
  render() {
187
- const borderClass = this._isMobile && this._hideTable ? "border-width-0" :
188
- this._isMobile ? "border-bottom-width-0" : "";
189
- return (h(Host, null, h("calcite-shell", { class: "position-relative" }, h("calcite-panel", { class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
189
+ return (h(Host, null, h("calcite-shell", { class: "position-relative" }, h("calcite-panel", { class: `width-full height-full border-width-0` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
190
190
  }
191
191
  /**
192
192
  * Called after each render
@@ -356,7 +356,7 @@ export class CrowdsourceManager {
356
356
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
357
357
  const popupNodeClass = !this._expandPopup ? "height-full" : ((_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.length) === 1 || this._isMobile ? "position-absolute-0" : "position-absolute-50";
358
358
  const headerClass = this._isMobile ? "display-none height-0" : "";
359
- const headerTheme = !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
359
+ const headerTheme = this.popupHeaderColor ? "" : !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
360
360
  const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
361
361
  return (h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass}`, style: {
362
362
  '--calcite-color-foreground-1': this.popupHeaderColor,
@@ -407,7 +407,7 @@ export class CrowdsourceManager {
407
407
  ((_a = this.defaultGlobalId) === null || _a === void 0 ? void 0 : _a.indexOf(",")) > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
408
408
  const defaultOid = !this.defaultOid ? undefined :
409
409
  ((_b = this.defaultOid) === null || _b === void 0 ? void 0 : _b.indexOf(",")) > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
410
- return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
410
+ return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, sortField: this.sortField, sortOrder: this.sortOrder, zoomAndScrollToSelected: this.zoomAndScrollToSelected, zoomToScale: this.zoomToScale }))));
411
411
  }
412
412
  /**
413
413
  * Update the component layout when its size changes
@@ -1137,6 +1137,40 @@ export class CrowdsourceManager {
1137
1137
  },
1138
1138
  "attribute": "zoom-to-scale",
1139
1139
  "reflect": false
1140
+ },
1141
+ "sortField": {
1142
+ "type": "string",
1143
+ "mutable": false,
1144
+ "complexType": {
1145
+ "original": "string",
1146
+ "resolved": "string",
1147
+ "references": {}
1148
+ },
1149
+ "required": false,
1150
+ "optional": false,
1151
+ "docs": {
1152
+ "tags": [],
1153
+ "text": "string: Field using which table will be sorted"
1154
+ },
1155
+ "attribute": "sort-field",
1156
+ "reflect": false
1157
+ },
1158
+ "sortOrder": {
1159
+ "type": "string",
1160
+ "mutable": false,
1161
+ "complexType": {
1162
+ "original": "'asc' | 'desc'",
1163
+ "resolved": "\"asc\" | \"desc\"",
1164
+ "references": {}
1165
+ },
1166
+ "required": false,
1167
+ "optional": false,
1168
+ "docs": {
1169
+ "tags": [],
1170
+ "text": "string(asc/desc): Sorting order - Ascending or Descending"
1171
+ },
1172
+ "attribute": "sort-order",
1173
+ "reflect": false
1140
1174
  }
1141
1175
  };
1142
1176
  }
@@ -53,7 +53,7 @@ export class CrowdsourceReporter {
53
53
  this.theme = "light";
54
54
  this.enableZoom = true;
55
55
  this.zoomToScale = undefined;
56
- this.layerExpressions = undefined;
56
+ this.layerExpressions = [];
57
57
  this._mapInfo = undefined;
58
58
  this._flowItems = [];
59
59
  this._sidePanelCollapsed = false;
@@ -96,7 +96,7 @@ export class CrowdsourceReporter {
96
96
  this.setCurrentFeature(evt.detail.selectedFeature[0]);
97
97
  void this.highlightOnMap(evt.detail.selectedFeature[0]);
98
98
  this.selectedFeatureIndex = evt.detail.selectedFeatureIndex;
99
- //update the feature details to reflect the like dislike values
99
+ //update the feature details to reflect the like dislike values
100
100
  await this._featureDetails.refresh(evt.detail.selectedFeature[0]);
101
101
  }
102
102
  //--------------------------------------------------------------------------
@@ -1239,7 +1239,8 @@ export class CrowdsourceReporter {
1239
1239
  "docs": {
1240
1240
  "tags": [],
1241
1241
  "text": "ILayerExpression[]: Array of layer expressions for layers (filter configuration)"
1242
- }
1242
+ },
1243
+ "defaultValue": "[]"
1243
1244
  }
1244
1245
  };
1245
1246
  }
@@ -21,7 +21,7 @@
21
21
  import { Host, h } from "@stencil/core";
22
22
  import { loadModules } from "../../utils/loadModules";
23
23
  import { getLocaleComponentStrings } from "../../utils/locale";
24
- import { getLayerOrTable, goToSelection } from "../../utils/mapViewUtils";
24
+ import { getFeatureLayerView, getLayerOrTable, goToSelection } from "../../utils/mapViewUtils";
25
25
  import { queryAllIds, queryFeatureIds, queryFeaturesByGlobalID } from "../../utils/queryUtils";
26
26
  import * as downloadUtils from "../../utils/downloadUtils";
27
27
  import "@esri/instant-apps-components/dist/components/instant-apps-social-share";
@@ -80,7 +80,10 @@ export class LayerTable {
80
80
  this.shareIncludeEmbed = undefined;
81
81
  this.shareIncludeSocial = undefined;
82
82
  this.showNewestFirst = undefined;
83
+ this.sortField = undefined;
84
+ this.sortOrder = undefined;
83
85
  this.zoomAndScrollToSelected = undefined;
86
+ this.zoomToScale = undefined;
84
87
  this._allIds = [];
85
88
  this._controlsThatFit = undefined;
86
89
  this._csvExporting = false;
@@ -235,7 +238,7 @@ export class LayerTable {
235
238
  }
236
239
  });
237
240
  if (layerView) {
238
- await goToSelection([oid], layerView, this.mapView, true);
241
+ await goToSelection([oid], layerView, this.mapView, true, undefined, this.zoomToScale);
239
242
  }
240
243
  }
241
244
  }
@@ -1106,13 +1109,20 @@ export class LayerTable {
1106
1109
  this._deleteEnabled = this._layer.editingEnabled && this._layer.capabilities.operations.supportsDelete;
1107
1110
  }
1108
1111
  /**
1109
- * Sort the objectid field in descending order
1112
+ * Sort the table with the configured field in the configured sort order
1110
1113
  */
1111
1114
  async _sortTable() {
1112
- if (this._table && this._layer && this.showNewestFirst) {
1115
+ var _a, _b, _c, _d, _e, _f;
1116
+ let sortField = this.sortField ? this.sortField : this._layer.objectIdField;
1117
+ if (((_c = (_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.layerOptions) === null || _b === void 0 ? void 0 : _b.layers) === null || _c === void 0 ? void 0 : _c.length) > 0) {
1118
+ const configuredLayer = (_d = this.mapInfo.layerOptions) === null || _d === void 0 ? void 0 : _d.layers.filter((layer) => layer.id === this._layer.id);
1119
+ sortField = ((_f = (_e = configuredLayer[0]) === null || _e === void 0 ? void 0 : _e.fields) === null || _f === void 0 ? void 0 : _f.includes(this.sortField)) ? this.sortField : this._layer.objectIdField;
1120
+ }
1121
+ const sortOrder = this.sortOrder ? this.sortOrder : 'desc';
1122
+ if (this._table && this._layer) {
1113
1123
  await this._table.when();
1114
1124
  await this._layer.when(() => {
1115
- this._table.sortColumn(this._layer.objectIdField, "desc");
1125
+ this._table.sortColumn(sortField, sortOrder);
1116
1126
  });
1117
1127
  }
1118
1128
  }
@@ -1358,8 +1368,11 @@ export class LayerTable {
1358
1368
  *
1359
1369
  * @returns a promise that will resolve when the operation is complete
1360
1370
  */
1361
- _zoom() {
1362
- this._table.zoomToSelection();
1371
+ async _zoom() {
1372
+ if (this._layer) {
1373
+ const selectedLayerView = await getFeatureLayerView(this.mapView, this._layer.id);
1374
+ await goToSelection(this.selectedIds, selectedLayerView, this.mapView, true, undefined, this.zoomToScale);
1375
+ }
1363
1376
  }
1364
1377
  /**
1365
1378
  * Handles layer selection change to show new table
@@ -1757,6 +1770,40 @@ export class LayerTable {
1757
1770
  "attribute": "show-newest-first",
1758
1771
  "reflect": false
1759
1772
  },
1773
+ "sortField": {
1774
+ "type": "string",
1775
+ "mutable": false,
1776
+ "complexType": {
1777
+ "original": "string",
1778
+ "resolved": "string",
1779
+ "references": {}
1780
+ },
1781
+ "required": false,
1782
+ "optional": false,
1783
+ "docs": {
1784
+ "tags": [],
1785
+ "text": "string: Field using which table will be sorted"
1786
+ },
1787
+ "attribute": "sort-field",
1788
+ "reflect": false
1789
+ },
1790
+ "sortOrder": {
1791
+ "type": "string",
1792
+ "mutable": false,
1793
+ "complexType": {
1794
+ "original": "'asc' | 'desc'",
1795
+ "resolved": "\"asc\" | \"desc\"",
1796
+ "references": {}
1797
+ },
1798
+ "required": false,
1799
+ "optional": false,
1800
+ "docs": {
1801
+ "tags": [],
1802
+ "text": "string(asc/desc): Sorting order - Ascending or Descending"
1803
+ },
1804
+ "attribute": "sort-order",
1805
+ "reflect": false
1806
+ },
1760
1807
  "zoomAndScrollToSelected": {
1761
1808
  "type": "boolean",
1762
1809
  "mutable": false,
@@ -1773,6 +1820,23 @@ export class LayerTable {
1773
1820
  },
1774
1821
  "attribute": "zoom-and-scroll-to-selected",
1775
1822
  "reflect": false
1823
+ },
1824
+ "zoomToScale": {
1825
+ "type": "number",
1826
+ "mutable": false,
1827
+ "complexType": {
1828
+ "original": "number",
1829
+ "resolved": "number",
1830
+ "references": {}
1831
+ },
1832
+ "required": false,
1833
+ "optional": false,
1834
+ "docs": {
1835
+ "tags": [],
1836
+ "text": "number: default scale to zoom to when zooming to a single point feature"
1837
+ },
1838
+ "attribute": "zoom-to-scale",
1839
+ "reflect": false
1776
1840
  }
1777
1841
  };
1778
1842
  }
@@ -45,7 +45,6 @@
45
45
  // });
46
46
 
47
47
  function infoIconButtonClick(evt) {
48
- alert('Info button Clicked');
49
48
  }
50
49
 
51
50
  function addValues() {
@@ -126,6 +126,8 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
126
126
  this.theme = "light";
127
127
  this.zoomAndScrollToSelected = false;
128
128
  this.zoomToScale = undefined;
129
+ this.sortField = undefined;
130
+ this.sortOrder = undefined;
129
131
  this._expandPopup = this.hideMapOnLoad;
130
132
  this._hideFooter = false;
131
133
  this._hideTable = false;
@@ -232,9 +234,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
232
234
  * Renders the component.
233
235
  */
234
236
  render() {
235
- const borderClass = this._isMobile && this._hideTable ? "border-width-0" :
236
- this._isMobile ? "border-bottom-width-0" : "";
237
- return (h(Host, null, h("calcite-shell", { class: "position-relative" }, h("calcite-panel", { class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
237
+ return (h(Host, null, h("calcite-shell", { class: "position-relative" }, h("calcite-panel", { class: `width-full height-full border-width-0` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
238
238
  }
239
239
  /**
240
240
  * Called after each render
@@ -404,7 +404,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
404
404
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
405
405
  const popupNodeClass = !this._expandPopup ? "height-full" : ((_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.length) === 1 || this._isMobile ? "position-absolute-0" : "position-absolute-50";
406
406
  const headerClass = this._isMobile ? "display-none height-0" : "";
407
- const headerTheme = !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
407
+ const headerTheme = this.popupHeaderColor ? "" : !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
408
408
  const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
409
409
  return (h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass}`, style: {
410
410
  '--calcite-color-foreground-1': this.popupHeaderColor,
@@ -455,7 +455,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
455
455
  ((_a = this.defaultGlobalId) === null || _a === void 0 ? void 0 : _a.indexOf(",")) > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
456
456
  const defaultOid = !this.defaultOid ? undefined :
457
457
  ((_b = this.defaultOid) === null || _b === void 0 ? void 0 : _b.indexOf(",")) > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
458
- return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
458
+ return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, sortField: this.sortField, sortOrder: this.sortOrder, zoomAndScrollToSelected: this.zoomAndScrollToSelected, zoomToScale: this.zoomToScale }))));
459
459
  }
460
460
  /**
461
461
  * Update the component layout when its size changes
@@ -593,6 +593,8 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
593
593
  "theme": [1],
594
594
  "zoomAndScrollToSelected": [4, "zoom-and-scroll-to-selected"],
595
595
  "zoomToScale": [2, "zoom-to-scale"],
596
+ "sortField": [1, "sort-field"],
597
+ "sortOrder": [1, "sort-order"],
596
598
  "_expandPopup": [32],
597
599
  "_hideFooter": [32],
598
600
  "_hideTable": [32],
@@ -6,7 +6,7 @@
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
7
  import { g as getLocaleComponentStrings } from './locale.js';
8
8
  import { l as loadModules } from './loadModules.js';
9
- import { a as getAllLayers, e as getFeatureLayerView, h as highlightFeatures, c as getMapLayerHash, g as getLayerOrTable } from './mapViewUtils.js';
9
+ import { a as getAllLayers, c as getFeatureLayerView, h as highlightFeatures, d as getMapLayerHash, g as getLayerOrTable } from './mapViewUtils.js';
10
10
  import { q as queryFeaturesByID } from './queryUtils.js';
11
11
  import { d as defineCustomElement$K } from './action.js';
12
12
  import { d as defineCustomElement$J } from './action-menu.js';
@@ -89,7 +89,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
89
89
  this.theme = "light";
90
90
  this.enableZoom = true;
91
91
  this.zoomToScale = undefined;
92
- this.layerExpressions = undefined;
92
+ this.layerExpressions = [];
93
93
  this._mapInfo = undefined;
94
94
  this._flowItems = [];
95
95
  this._sidePanelCollapsed = false;
@@ -132,7 +132,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
132
132
  this.setCurrentFeature(evt.detail.selectedFeature[0]);
133
133
  void this.highlightOnMap(evt.detail.selectedFeature[0]);
134
134
  this.selectedFeatureIndex = evt.detail.selectedFeatureIndex;
135
- //update the feature details to reflect the like dislike values
135
+ //update the feature details to reflect the like dislike values
136
136
  await this._featureDetails.refresh(evt.detail.selectedFeature[0]);
137
137
  }
138
138
  //--------------------------------------------------------------------------
@@ -6,7 +6,7 @@
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
7
7
  import { l as loadModules } from './loadModules.js';
8
8
  import { P as PopupUtils } from './popupUtils.js';
9
- import { g as getLayerOrTable, e as getFeatureLayerView, h as highlightFeatures } from './mapViewUtils.js';
9
+ import { g as getLayerOrTable, c as getFeatureLayerView, h as highlightFeatures } from './mapViewUtils.js';
10
10
  import { g as getLocaleComponentStrings } from './locale.js';
11
11
  import { d as defineCustomElement$g } from './action.js';
12
12
  import { d as defineCustomElement$f } from './action-menu.js';
@@ -4,7 +4,7 @@
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
7
- import { c as getMapLayerHash, a as getAllLayers } from './mapViewUtils.js';
7
+ import { d as getMapLayerHash, a as getAllLayers } from './mapViewUtils.js';
8
8
  import { f as formatNumber, g as getLocaleComponentStrings } from './locale.js';
9
9
  import { d as defineCustomElement$c } from './action.js';
10
10
  import { d as defineCustomElement$b } from './filter2.js';
@@ -6,7 +6,7 @@
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
7
  import { l as loadModules } from './loadModules.js';
8
8
  import { g as getLocaleComponentStrings } from './locale.js';
9
- import { b as goToSelection, g as getLayerOrTable } from './mapViewUtils.js';
9
+ import { b as goToSelection, c as getFeatureLayerView, g as getLayerOrTable } from './mapViewUtils.js';
10
10
  import { b as queryAllIds, c as queryFeatureIds, d as queryFeaturesByGlobalID } from './queryUtils.js';
11
11
  import { d as downloadCSV } from './downloadUtils.js';
12
12
  import { d as defineCustomElement$D } from './action.js';
@@ -109,7 +109,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
109
109
  this.shareIncludeEmbed = undefined;
110
110
  this.shareIncludeSocial = undefined;
111
111
  this.showNewestFirst = undefined;
112
+ this.sortField = undefined;
113
+ this.sortOrder = undefined;
112
114
  this.zoomAndScrollToSelected = undefined;
115
+ this.zoomToScale = undefined;
113
116
  this._allIds = [];
114
117
  this._controlsThatFit = undefined;
115
118
  this._csvExporting = false;
@@ -264,7 +267,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
264
267
  }
265
268
  });
266
269
  if (layerView) {
267
- await goToSelection([oid], layerView, this.mapView, true);
270
+ await goToSelection([oid], layerView, this.mapView, true, undefined, this.zoomToScale);
268
271
  }
269
272
  }
270
273
  }
@@ -1135,13 +1138,20 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1135
1138
  this._deleteEnabled = this._layer.editingEnabled && this._layer.capabilities.operations.supportsDelete;
1136
1139
  }
1137
1140
  /**
1138
- * Sort the objectid field in descending order
1141
+ * Sort the table with the configured field in the configured sort order
1139
1142
  */
1140
1143
  async _sortTable() {
1141
- if (this._table && this._layer && this.showNewestFirst) {
1144
+ var _a, _b, _c, _d, _e, _f;
1145
+ let sortField = this.sortField ? this.sortField : this._layer.objectIdField;
1146
+ if (((_c = (_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.layerOptions) === null || _b === void 0 ? void 0 : _b.layers) === null || _c === void 0 ? void 0 : _c.length) > 0) {
1147
+ const configuredLayer = (_d = this.mapInfo.layerOptions) === null || _d === void 0 ? void 0 : _d.layers.filter((layer) => layer.id === this._layer.id);
1148
+ sortField = ((_f = (_e = configuredLayer[0]) === null || _e === void 0 ? void 0 : _e.fields) === null || _f === void 0 ? void 0 : _f.includes(this.sortField)) ? this.sortField : this._layer.objectIdField;
1149
+ }
1150
+ const sortOrder = this.sortOrder ? this.sortOrder : 'desc';
1151
+ if (this._table && this._layer) {
1142
1152
  await this._table.when();
1143
1153
  await this._layer.when(() => {
1144
- this._table.sortColumn(this._layer.objectIdField, "desc");
1154
+ this._table.sortColumn(sortField, sortOrder);
1145
1155
  });
1146
1156
  }
1147
1157
  }
@@ -1387,8 +1397,11 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1387
1397
  *
1388
1398
  * @returns a promise that will resolve when the operation is complete
1389
1399
  */
1390
- _zoom() {
1391
- this._table.zoomToSelection();
1400
+ async _zoom() {
1401
+ if (this._layer) {
1402
+ const selectedLayerView = await getFeatureLayerView(this.mapView, this._layer.id);
1403
+ await goToSelection(this.selectedIds, selectedLayerView, this.mapView, true, undefined, this.zoomToScale);
1404
+ }
1392
1405
  }
1393
1406
  /**
1394
1407
  * Handles layer selection change to show new table
@@ -1530,7 +1543,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1530
1543
  "shareIncludeEmbed": [4, "share-include-embed"],
1531
1544
  "shareIncludeSocial": [4, "share-include-social"],
1532
1545
  "showNewestFirst": [4, "show-newest-first"],
1546
+ "sortField": [1, "sort-field"],
1547
+ "sortOrder": [1, "sort-order"],
1533
1548
  "zoomAndScrollToSelected": [4, "zoom-and-scroll-to-selected"],
1549
+ "zoomToScale": [2, "zoom-to-scale"],
1534
1550
  "_allIds": [32],
1535
1551
  "_controlsThatFit": [32],
1536
1552
  "_csvExporting": [32],
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
7
  import { g as getLocaleComponentStrings } from './locale.js';
8
- import { c as getMapLayerHash, d as getMapTableHash } from './mapViewUtils.js';
8
+ import { d as getMapLayerHash, e as getMapTableHash } from './mapViewUtils.js';
9
9
  import { s as state } from './publicNotificationStore.js';
10
10
  import { d as defineCustomElement$f } from './action.js';
11
11
  import { d as defineCustomElement$e } from './button.js';
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
7
  import { l as loadModules } from './loadModules.js';
8
- import { b as goToSelection, h as highlightFeatures, e as getFeatureLayerView } from './mapViewUtils.js';
8
+ import { b as goToSelection, h as highlightFeatures, c as getFeatureLayerView } from './mapViewUtils.js';
9
9
  import { e as queryObjectIds, g as getQueryGeoms, f as queryFeaturesByGeometry } from './queryUtils.js';
10
10
  import { E as EWorkflowType } from './interfaces.js';
11
11
  import { s as state } from './publicNotificationStore.js';
@@ -264,4 +264,4 @@ async function goToSelection(ids, layerView, mapView, flashFeatures = true, feat
264
264
  }
265
265
  }
266
266
 
267
- export { getAllLayers as a, goToSelection as b, getMapLayerHash as c, getMapTableHash as d, getFeatureLayerView as e, getIdSets as f, getLayerOrTable as g, highlightFeatures as h, highlightAllFeatures as i };
267
+ export { getAllLayers as a, goToSelection as b, getFeatureLayerView as c, getMapLayerHash as d, getMapTableHash as e, getIdSets as f, getLayerOrTable as g, highlightFeatures as h, highlightAllFeatures as i };
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
7
  import { e as ESelectionMode, b as EDrawMode, E as EWorkflowType } from './interfaces.js';
8
- import { e as getFeatureLayerView, f as getIdSets, i as highlightAllFeatures } from './mapViewUtils.js';
8
+ import { c as getFeatureLayerView, f as getIdSets, i as highlightAllFeatures } from './mapViewUtils.js';
9
9
  import { f as queryFeaturesByGeometry } from './queryUtils.js';
10
10
  import { s as state } from './publicNotificationStore.js';
11
11
  import { g as getLocaleComponentStrings } from './locale.js';
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-164d485a.js';
7
7
  import { g as getLocaleComponentStrings, l as loadModules } from './locale-bcbea4ef.js';
8
- import { q as queryFeaturesByID, g as getLayerOrTable, d as goToSelection, e as queryAllIds, f as queryFeatureIds, i as queryFeaturesByGlobalID } from './mapViewUtils-c83c03a4.js';
8
+ import { q as queryFeaturesByID, g as getLayerOrTable, d as goToSelection, e as queryAllIds, f as queryFeatureIds, i as queryFeaturesByGlobalID, b as getFeatureLayerView } from './mapViewUtils-c83c03a4.js';
9
9
  import { d as downloadCSV } from './downloadUtils-25aa808f.js';
10
10
  import './esri-loader-1b324844.js';
11
11
  import './_commonjsHelpers-0f74c230.js';
@@ -161,7 +161,10 @@ const LayerTable = class {
161
161
  this.shareIncludeEmbed = undefined;
162
162
  this.shareIncludeSocial = undefined;
163
163
  this.showNewestFirst = undefined;
164
+ this.sortField = undefined;
165
+ this.sortOrder = undefined;
164
166
  this.zoomAndScrollToSelected = undefined;
167
+ this.zoomToScale = undefined;
165
168
  this._allIds = [];
166
169
  this._controlsThatFit = undefined;
167
170
  this._csvExporting = false;
@@ -316,7 +319,7 @@ const LayerTable = class {
316
319
  }
317
320
  });
318
321
  if (layerView) {
319
- await goToSelection([oid], layerView, this.mapView, true);
322
+ await goToSelection([oid], layerView, this.mapView, true, undefined, this.zoomToScale);
320
323
  }
321
324
  }
322
325
  }
@@ -1187,13 +1190,20 @@ const LayerTable = class {
1187
1190
  this._deleteEnabled = this._layer.editingEnabled && this._layer.capabilities.operations.supportsDelete;
1188
1191
  }
1189
1192
  /**
1190
- * Sort the objectid field in descending order
1193
+ * Sort the table with the configured field in the configured sort order
1191
1194
  */
1192
1195
  async _sortTable() {
1193
- if (this._table && this._layer && this.showNewestFirst) {
1196
+ var _a, _b, _c, _d, _e, _f;
1197
+ let sortField = this.sortField ? this.sortField : this._layer.objectIdField;
1198
+ if (((_c = (_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.layerOptions) === null || _b === void 0 ? void 0 : _b.layers) === null || _c === void 0 ? void 0 : _c.length) > 0) {
1199
+ const configuredLayer = (_d = this.mapInfo.layerOptions) === null || _d === void 0 ? void 0 : _d.layers.filter((layer) => layer.id === this._layer.id);
1200
+ sortField = ((_f = (_e = configuredLayer[0]) === null || _e === void 0 ? void 0 : _e.fields) === null || _f === void 0 ? void 0 : _f.includes(this.sortField)) ? this.sortField : this._layer.objectIdField;
1201
+ }
1202
+ const sortOrder = this.sortOrder ? this.sortOrder : 'desc';
1203
+ if (this._table && this._layer) {
1194
1204
  await this._table.when();
1195
1205
  await this._layer.when(() => {
1196
- this._table.sortColumn(this._layer.objectIdField, "desc");
1206
+ this._table.sortColumn(sortField, sortOrder);
1197
1207
  });
1198
1208
  }
1199
1209
  }
@@ -1439,8 +1449,11 @@ const LayerTable = class {
1439
1449
  *
1440
1450
  * @returns a promise that will resolve when the operation is complete
1441
1451
  */
1442
- _zoom() {
1443
- this._table.zoomToSelection();
1452
+ async _zoom() {
1453
+ if (this._layer) {
1454
+ const selectedLayerView = await getFeatureLayerView(this.mapView, this._layer.id);
1455
+ await goToSelection(this.selectedIds, selectedLayerView, this.mapView, true, undefined, this.zoomToScale);
1456
+ }
1444
1457
  }
1445
1458
  /**
1446
1459
  * Handles layer selection change to show new table
@@ -70,6 +70,8 @@ const CrowdsourceManager = class {
70
70
  this.theme = "light";
71
71
  this.zoomAndScrollToSelected = false;
72
72
  this.zoomToScale = undefined;
73
+ this.sortField = undefined;
74
+ this.sortOrder = undefined;
73
75
  this._expandPopup = this.hideMapOnLoad;
74
76
  this._hideFooter = false;
75
77
  this._hideTable = false;
@@ -176,9 +178,7 @@ const CrowdsourceManager = class {
176
178
  * Renders the component.
177
179
  */
178
180
  render() {
179
- const borderClass = this._isMobile && this._hideTable ? "border-width-0" :
180
- this._isMobile ? "border-bottom-width-0" : "";
181
- return (h(Host, null, h("calcite-shell", { class: "position-relative" }, h("calcite-panel", { class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
181
+ return (h(Host, null, h("calcite-shell", { class: "position-relative" }, h("calcite-panel", { class: `width-full height-full border-width-0` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
182
182
  }
183
183
  /**
184
184
  * Called after each render
@@ -348,7 +348,7 @@ const CrowdsourceManager = class {
348
348
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
349
349
  const popupNodeClass = !this._expandPopup ? "height-full" : ((_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.length) === 1 || this._isMobile ? "position-absolute-0" : "position-absolute-50";
350
350
  const headerClass = this._isMobile ? "display-none height-0" : "";
351
- const headerTheme = !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
351
+ const headerTheme = this.popupHeaderColor ? "" : !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
352
352
  const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
353
353
  return (h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass}`, style: {
354
354
  '--calcite-color-foreground-1': this.popupHeaderColor,
@@ -399,7 +399,7 @@ const CrowdsourceManager = class {
399
399
  ((_a = this.defaultGlobalId) === null || _a === void 0 ? void 0 : _a.indexOf(",")) > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
400
400
  const defaultOid = !this.defaultOid ? undefined :
401
401
  ((_b = this.defaultOid) === null || _b === void 0 ? void 0 : _b.indexOf(",")) > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
402
- return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
402
+ return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, sortField: this.sortField, sortOrder: this.sortOrder, zoomAndScrollToSelected: this.zoomAndScrollToSelected, zoomToScale: this.zoomToScale }))));
403
403
  }
404
404
  /**
405
405
  * Update the component layout when its size changes
@@ -44,7 +44,7 @@ const CrowdsourceReporter = class {
44
44
  this.theme = "light";
45
45
  this.enableZoom = true;
46
46
  this.zoomToScale = undefined;
47
- this.layerExpressions = undefined;
47
+ this.layerExpressions = [];
48
48
  this._mapInfo = undefined;
49
49
  this._flowItems = [];
50
50
  this._sidePanelCollapsed = false;
@@ -87,7 +87,7 @@ const CrowdsourceReporter = class {
87
87
  this.setCurrentFeature(evt.detail.selectedFeature[0]);
88
88
  void this.highlightOnMap(evt.detail.selectedFeature[0]);
89
89
  this.selectedFeatureIndex = evt.detail.selectedFeatureIndex;
90
- //update the feature details to reflect the like dislike values
90
+ //update the feature details to reflect the like dislike values
91
91
  await this._featureDetails.refresh(evt.detail.selectedFeature[0]);
92
92
  }
93
93
  //--------------------------------------------------------------------------