@esri/solutions-components 0.7.39 → 0.7.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-combobox_5.cjs.entry.js +1 -1
  3. package/dist/cjs/calcite-flow_5.cjs.entry.js +4 -2
  4. package/dist/cjs/calcite-input-date-picker_3.cjs.entry.js +70 -31
  5. package/dist/cjs/card-manager_3.cjs.entry.js +29 -13
  6. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  7. package/dist/cjs/crowdsource-reporter.cjs.entry.js +15 -4
  8. package/dist/cjs/{downloadUtils-c22a71da.js → downloadUtils-b10e3b8c.js} +2 -2
  9. package/dist/cjs/{index.es-8d317f5e.js → index.es-b9d6eff6.js} +2 -2
  10. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +5 -4
  11. package/dist/cjs/instant-apps-export.cjs.entry.js +20 -21
  12. package/dist/cjs/instant-apps-header.cjs.entry.js +1 -1
  13. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +3 -3
  14. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +1 -1
  15. package/dist/cjs/instant-apps-splash.cjs.entry.js +2 -6
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
  18. package/dist/cjs/{mapViewUtils-cd29b129.js → mapViewUtils-290dbc9e.js} +4 -0
  19. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  20. package/dist/cjs/solutions-components.cjs.js +1 -1
  21. package/dist/collection/components/basemap-gallery/basemap-gallery.css +19 -19
  22. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +48 -3
  23. package/dist/collection/components/layer-list/layer-list.js +3 -1
  24. package/dist/collection/components/layer-table/layer-table.js +28 -11
  25. package/dist/collection/components/map-fullscreen/map-fullscreen.css +19 -19
  26. package/dist/collection/components/map-legend/map-legend.css +3 -3
  27. package/dist/collection/demos/crowdsource-reporter.html +5 -2
  28. package/dist/collection/utils/interfaces.ts +1 -0
  29. package/dist/collection/utils/queryUtils.js +4 -0
  30. package/dist/collection/utils/queryUtils.ts +5 -0
  31. package/dist/components/crowdsource-reporter.js +16 -3
  32. package/dist/components/instant-apps-export.js +20 -21
  33. package/dist/components/instant-apps-filter-list2.js +70 -31
  34. package/dist/components/instant-apps-header2.js +1 -1
  35. package/dist/components/instant-apps-language-switcher.js +3 -3
  36. package/dist/components/instant-apps-language-translator-item2.js +5 -4
  37. package/dist/components/instant-apps-language-translator2.js +1 -1
  38. package/dist/components/instant-apps-splash.js +3 -7
  39. package/dist/components/layer-list2.js +3 -1
  40. package/dist/components/layer-table2.js +28 -11
  41. package/dist/components/queryUtils.js +4 -0
  42. package/dist/esm/calcite-alert_4.entry.js +1 -1
  43. package/dist/esm/calcite-combobox_5.entry.js +1 -1
  44. package/dist/esm/calcite-flow_5.entry.js +4 -2
  45. package/dist/esm/calcite-input-date-picker_3.entry.js +70 -31
  46. package/dist/esm/card-manager_3.entry.js +29 -13
  47. package/dist/esm/crowdsource-manager.entry.js +1 -1
  48. package/dist/esm/crowdsource-reporter.entry.js +15 -4
  49. package/dist/esm/{downloadUtils-985dcd1c.js → downloadUtils-20d22198.js} +2 -2
  50. package/dist/esm/{index.es-03d8386e.js → index.es-8b85f68d.js} +2 -2
  51. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +5 -4
  52. package/dist/esm/instant-apps-export.entry.js +20 -21
  53. package/dist/esm/instant-apps-header.entry.js +1 -1
  54. package/dist/esm/instant-apps-language-switcher.entry.js +3 -3
  55. package/dist/esm/instant-apps-language-translator.entry.js +1 -1
  56. package/dist/esm/instant-apps-splash.entry.js +3 -7
  57. package/dist/esm/loader.js +1 -1
  58. package/dist/esm/map-select-tools_3.entry.js +2 -2
  59. package/dist/esm/{mapViewUtils-257bc9b3.js → mapViewUtils-a177d4f9.js} +4 -0
  60. package/dist/esm/public-notification.entry.js +2 -2
  61. package/dist/esm/solutions-components.js +1 -1
  62. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-filter-list/instant-apps-filter-list.css +8 -1
  63. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-header/instant-apps-header.css +3 -0
  64. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-splash/instant-apps-splash.css +3 -0
  65. package/dist/solutions-components/demos/crowdsource-reporter.html +5 -2
  66. package/dist/solutions-components/{p-8571c89f.entry.js → p-044cd52c.entry.js} +1 -1
  67. package/dist/solutions-components/{p-df048b47.js → p-17e328bb.js} +1 -1
  68. package/dist/solutions-components/{p-12492469.entry.js → p-2283ae14.entry.js} +1 -1
  69. package/dist/solutions-components/p-2f017ad2.entry.js +6 -0
  70. package/dist/solutions-components/{p-20b206f3.entry.js → p-32adb2cc.entry.js} +1 -1
  71. package/dist/solutions-components/p-3eedaead.js +36 -0
  72. package/dist/solutions-components/{p-2f840f08.entry.js → p-42233edc.entry.js} +1 -1
  73. package/dist/solutions-components/p-4742efa8.entry.js +6 -0
  74. package/dist/solutions-components/p-57087d57.entry.js +17 -0
  75. package/dist/solutions-components/{p-34eaca46.entry.js → p-69a1df0f.entry.js} +1 -1
  76. package/dist/solutions-components/{p-23e58d7c.entry.js → p-6c86a392.entry.js} +3 -3
  77. package/dist/solutions-components/{p-6419f8d7.entry.js → p-6fe5e1d5.entry.js} +1 -1
  78. package/dist/solutions-components/p-7480ac64.entry.js +6 -0
  79. package/dist/solutions-components/p-aecf92f4.entry.js +6 -0
  80. package/dist/solutions-components/p-c6af6407.entry.js +6 -0
  81. package/dist/solutions-components/p-cacd0307.entry.js +6 -0
  82. package/dist/solutions-components/p-e2b0b3fa.entry.js +6 -0
  83. package/dist/solutions-components/{p-00ba5a2a.js → p-f6536eae.js} +2 -2
  84. package/dist/solutions-components/solutions-components.esm.js +1 -1
  85. package/dist/solutions-components/utils/interfaces.ts +1 -0
  86. package/dist/solutions-components/utils/queryUtils.ts +5 -0
  87. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +9 -0
  88. package/dist/types/components/layer-list/layer-list.d.ts +1 -0
  89. package/dist/types/components/layer-table/layer-table.d.ts +9 -1
  90. package/dist/types/components.d.ts +16 -0
  91. package/dist/types/utils/interfaces.d.ts +1 -0
  92. package/dist/types/utils/queryUtils.d.ts +1 -0
  93. package/package.json +2 -2
  94. package/dist/solutions-components/p-09b48b1b.entry.js +0 -6
  95. package/dist/solutions-components/p-32fed23c.entry.js +0 -17
  96. package/dist/solutions-components/p-6a61c742.entry.js +0 -6
  97. package/dist/solutions-components/p-9161dca9.entry.js +0 -6
  98. package/dist/solutions-components/p-93369c9f.entry.js +0 -6
  99. package/dist/solutions-components/p-96f5be25.js +0 -36
  100. package/dist/solutions-components/p-97425481.entry.js +0 -6
  101. package/dist/solutions-components/p-ae4c8b8c.entry.js +0 -6
  102. package/dist/solutions-components/p-eb0f4ede.entry.js +0 -6
@@ -1,19 +1,19 @@
1
- /** @license
2
- * Copyright 2022 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- :host {
18
- display: block;
19
- }
1
+ /** @license
2
+ * Copyright 2022 Esri
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ :host {
18
+ display: block;
19
+ }
@@ -25,6 +25,8 @@ import { getAllLayers, getFeatureLayerView, getLayerOrTable, highlightFeatures }
25
25
  import { queryFeaturesByID } from "../../utils/queryUtils";
26
26
  export class CrowdsourceReporter {
27
27
  constructor() {
28
+ //HARDCODED IN EN
29
+ this._noLayerToDisplayErrorMsg = "Web map does not contain any editable layers.";
28
30
  this.description = undefined;
29
31
  this.isMobile = undefined;
30
32
  this.enableAnonymousAccess = undefined;
@@ -37,6 +39,8 @@ export class CrowdsourceReporter {
37
39
  this.mapView = undefined;
38
40
  this.layerId = undefined;
39
41
  this.objectId = undefined;
42
+ this.center = undefined;
43
+ this.level = undefined;
40
44
  this.reportButtonText = undefined;
41
45
  this.reportsHeader = undefined;
42
46
  this.reportSubmittedMessage = undefined;
@@ -168,7 +172,7 @@ export class CrowdsourceReporter {
168
172
  */
169
173
  getLayerListFlowItem() {
170
174
  return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
171
- h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._translations.noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
175
+ h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
172
176
  }
173
177
  /**
174
178
  * Get the layer list for creating a report
@@ -176,7 +180,7 @@ export class CrowdsourceReporter {
176
180
  * @protected
177
181
  */
178
182
  getChooseCategoryFlowItem() {
179
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations.createReportHeader, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", disabled: !this._selectedLayerId, onClick: this.navigateToCreateFeature.bind(this), width: "full" }, this._translations.next), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromSelectedPanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._translations.noLayerToDisplayErrorMsg, onLayerSelect: this.highlightSelectedLayer.bind(this), showFeatureCount: false, showNextIcon: false }))));
183
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations.createReportHeader, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", disabled: !this._selectedLayerId, onClick: this.navigateToCreateFeature.bind(this), width: "full" }, this._translations.next), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromSelectedPanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.highlightSelectedLayer.bind(this), showFeatureCount: false, showNextIcon: false }))));
180
184
  }
181
185
  /**
182
186
  * Get Feature create form of the selected feature layer
@@ -522,11 +526,17 @@ export class CrowdsourceReporter {
522
526
  * @protected
523
527
  */
524
528
  async loadFeatureFromURLParams() {
529
+ if (this.center && this.level) {
530
+ await this.mapView.goTo({
531
+ center: this.center.split(';').map(Number),
532
+ zoom: this.level
533
+ });
534
+ }
525
535
  if (this.layerId && this.objectId) {
526
536
  const layer = await getLayerOrTable(this.mapView, this.layerId);
527
537
  if (layer) {
528
538
  // only query if we have some ids...query with no ids will result in all features being returned
529
- const featureSet = await queryFeaturesByID([Number(this.objectId)], layer, [], false, this.mapView.spatialReference);
539
+ const featureSet = await queryFeaturesByID([Number(this.objectId)], layer, [], true, this.mapView.spatialReference);
530
540
  if (featureSet.length) {
531
541
  //update the selectedFeature
532
542
  this._selectedFeature = featureSet;
@@ -538,6 +548,7 @@ export class CrowdsourceReporter {
538
548
  else {
539
549
  this._flowItems = [...this._flowItems];
540
550
  }
551
+ await this.highlightOnMap(featureSet[0]);
541
552
  }
542
553
  }
543
554
  }
@@ -760,6 +771,40 @@ export class CrowdsourceReporter {
760
771
  "attribute": "object-id",
761
772
  "reflect": false
762
773
  },
774
+ "center": {
775
+ "type": "string",
776
+ "mutable": false,
777
+ "complexType": {
778
+ "original": "string",
779
+ "resolved": "string",
780
+ "references": {}
781
+ },
782
+ "required": false,
783
+ "optional": false,
784
+ "docs": {
785
+ "tags": [],
786
+ "text": "string: Semicolon delimited numbers that will be used as the maps center point from URL params"
787
+ },
788
+ "attribute": "center",
789
+ "reflect": false
790
+ },
791
+ "level": {
792
+ "type": "string",
793
+ "mutable": false,
794
+ "complexType": {
795
+ "original": "string",
796
+ "resolved": "string",
797
+ "references": {}
798
+ },
799
+ "required": false,
800
+ "optional": false,
801
+ "docs": {
802
+ "tags": [],
803
+ "text": "string: Id of the zoom level from URL params"
804
+ },
805
+ "attribute": "level",
806
+ "reflect": false
807
+ },
763
808
  "reportButtonText": {
764
809
  "type": "string",
765
810
  "mutable": false,
@@ -24,6 +24,8 @@ import { getLocaleComponentStrings } from "../../utils/locale";
24
24
  import { formatNumber } from "../../utils/languageUtil";
25
25
  export class LayerList {
26
26
  constructor() {
27
+ //HARDCODED IN EN
28
+ this._noLayerToDisplayErrorMsg = "Web map does not contain any editable layers.";
27
29
  this.mapView = undefined;
28
30
  this.layers = undefined;
29
31
  this.noLayerErrorMsg = undefined;
@@ -76,7 +78,7 @@ export class LayerList {
76
78
  */
77
79
  render() {
78
80
  return (h(Fragment, null, this._isLoading && h("calcite-loader", { label: "", scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
79
- h("calcite-notice", { class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this.noLayerErrorMsg ? this.noLayerErrorMsg : this._translations.noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
81
+ h("calcite-notice", { class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this.noLayerErrorMsg ? this.noLayerErrorMsg : this._noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
80
82
  h("calcite-list", { "selection-appearance": "border", "selection-mode": this.showNextIcon ? "none" : "single-persist" }, this.renderLayerList())));
81
83
  }
82
84
  //--------------------------------------------------------------------------
@@ -91,6 +91,7 @@ export class LayerTable {
91
91
  this.showNewestFirst = undefined;
92
92
  this.zoomAndScrollToSelected = undefined;
93
93
  this._controlsThatFit = undefined;
94
+ this._csvExporting = false;
94
95
  this._fetchingData = false;
95
96
  this._filterActive = false;
96
97
  this._filterOpen = false;
@@ -367,8 +368,8 @@ export class LayerTable {
367
368
  if (cur && !cur.isOverflow) {
368
369
  prev.push(cur.isDanger ?
369
370
  this._getDangerAction(cur.icon, cur.label, cur.func, cur.disabled) :
370
- cur.isSublist ? (h("calcite-dropdown", { closeOnSelectDisabled: true, id: this._getId(cur.icon), onCalciteDropdownBeforeClose: () => this._forceShowHide(), ref: (el) => this._showHideDropdown = el }, this._getAction(cur.active, this._showHideOpen ? "chevron-down" : cur.icon, cur.indicator, cur.label, cur.func, cur.disabled, "trigger"), this._showHideOpen ? this._getFieldlist() : undefined)) :
371
- this._getAction(cur.active, cur.icon, cur.indicator, cur.label, cur.func, cur.disabled));
371
+ cur.isSublist ? (h("calcite-dropdown", { closeOnSelectDisabled: true, id: this._getId(cur.icon), onCalciteDropdownBeforeClose: () => this._forceShowHide(), ref: (el) => this._showHideDropdown = el }, this._getAction(cur.active, this._showHideOpen ? "chevron-down" : cur.icon, cur.indicator, cur.label, cur.func, cur.disabled, cur.loading, "trigger"), this._showHideOpen ? this._getFieldlist() : undefined)) :
372
+ this._getAction(cur.active, cur.icon, cur.indicator, cur.label, cur.func, cur.disabled, cur.loading));
372
373
  }
373
374
  return prev;
374
375
  }, []);
@@ -520,6 +521,7 @@ export class LayerTable {
520
521
  indicator: false,
521
522
  func: () => void this._exportToCSV(),
522
523
  label: this._translations.exportCSV,
524
+ loading: this._csvExporting,
523
525
  disabled: featuresEmpty,
524
526
  isOverflow: false
525
527
  } : undefined, {
@@ -704,7 +706,7 @@ export class LayerTable {
704
706
  _getDropdown(id) {
705
707
  const dropdownItems = this._getDropdownItems();
706
708
  return dropdownItems.length > 0 ? (h("calcite-dropdown", { closeOnSelectDisabled: true, disabled: this._layer === undefined, id: "solutions-more", onCalciteDropdownBeforeClose: () => this._forceShowHide(), ref: (el) => this._moreDropdown = el }, h("calcite-action", { appearance: "solid", id: id, label: "", onClick: () => this._closeShowHide(), slot: "trigger", text: "" }, h("calcite-button", { appearance: "transparent", iconEnd: "chevron-down", kind: "neutral" }, this._translations.more)), h("calcite-dropdown-group", { "selection-mode": "none" }, dropdownItems.map(item => {
707
- return (h("calcite-dropdown-group", { class: item.disabled ? "disabled" : "", selectionMode: item.disabled ? "none" : "single" }, h("calcite-dropdown-item", { iconStart: item.isSublist && this._showHideOpen ? "chevron-down" : item.icon, id: "solutions-subset-list", onClick: item.func }, item.label)));
709
+ return (h("calcite-dropdown-group", { class: item.disabled ? "disabled" : "", selectionMode: item.disabled ? "none" : "single" }, h("calcite-dropdown-item", { disabled: item.loading, iconStart: item.isSublist && this._showHideOpen ? "chevron-down" : item.loading ? "" : item.icon, id: "solutions-subset-list", onClick: item.func }, item.loading ? (h("div", { class: "display-flex" }, h("calcite-loader", { inline: true, label: item.label, scale: "m" }), item.label)) : item.label)));
708
710
  })), this._showHideOpen ? this._getFieldlist() : undefined)) : undefined;
709
711
  }
710
712
  /**
@@ -726,9 +728,9 @@ export class LayerTable {
726
728
  *
727
729
  * @returns VNode The node representing the DOM element that will contain the action
728
730
  */
729
- _getAction(active, icon, indicator, label, func, disabled, slot) {
731
+ _getAction(active, icon, indicator, label, func, disabled, loading, slot) {
730
732
  const _disabled = this._layer === undefined ? true : disabled;
731
- return (h("div", { class: "display-flex", id: this._getId(icon), slot: slot }, h("calcite-action", { active: active, appearance: "solid", disabled: _disabled, icon: icon, id: icon, indicator: indicator, label: label, onClick: func, text: label, textEnabled: true }), this._getToolTip("bottom", icon, label)));
733
+ return (h("div", { class: "display-flex", id: this._getId(icon), slot: slot }, h("calcite-action", { active: active, appearance: "solid", disabled: _disabled, icon: icon, id: icon, indicator: indicator, label: label, loading: loading, onClick: func, text: label, textEnabled: true }), this._getToolTip("bottom", icon, label)));
732
734
  }
733
735
  /**
734
736
  * Get an action and tooltip for share
@@ -1182,13 +1184,9 @@ export class LayerTable {
1182
1184
  const hitTestResult = await this.mapView.hitTest(evt.screenPoint, opts);
1183
1185
  if (hitTestResult.results.length > 0) {
1184
1186
  hitTestResult.results.forEach((result) => {
1185
- this._clearSelection();
1186
1187
  const id = result.graphic.getObjectId();
1187
1188
  const index = this._table.highlightIds.indexOf(id);
1188
- if (index > -1) {
1189
- this._table.highlightIds.removeAt(index);
1190
- }
1191
- else {
1189
+ if (index < 0) {
1192
1190
  this._table.highlightIds.add(id);
1193
1191
  }
1194
1192
  });
@@ -1196,6 +1194,9 @@ export class LayerTable {
1196
1194
  this._table.filterBySelection();
1197
1195
  }
1198
1196
  }
1197
+ else {
1198
+ this._clearSelection();
1199
+ }
1199
1200
  }
1200
1201
  /**
1201
1202
  * Select or deselect all rows
@@ -1284,11 +1285,26 @@ export class LayerTable {
1284
1285
  }
1285
1286
  return prev;
1286
1287
  }, []);
1287
- void downloadUtils.downloadCSV(null, //???
1288
+ this._updateToolInfoLoading("export", true);
1289
+ this._csvExporting = true;
1290
+ await downloadUtils.downloadCSV(null, //???
1288
1291
  exportInfos, false, // formatUsingLayerPopup
1289
1292
  false, // removeDuplicates
1290
1293
  true, // addColumnTitle
1291
1294
  fields, true);
1295
+ this._updateToolInfoLoading("export", false);
1296
+ this._csvExporting = false;
1297
+ }
1298
+ /**
1299
+ * Set the loading prop in the stored toolInfos
1300
+ */
1301
+ _updateToolInfoLoading(name, isLoading) {
1302
+ this._toolInfos.some(tool => {
1303
+ if ((tool === null || tool === void 0 ? void 0 : tool.icon) === name) {
1304
+ tool.loading = isLoading;
1305
+ return true;
1306
+ }
1307
+ });
1292
1308
  }
1293
1309
  /**
1294
1310
  * Refreshes the table and maintains the curent scroll position
@@ -1744,6 +1760,7 @@ export class LayerTable {
1744
1760
  static get states() {
1745
1761
  return {
1746
1762
  "_controlsThatFit": {},
1763
+ "_csvExporting": {},
1747
1764
  "_fetchingData": {},
1748
1765
  "_filterActive": {},
1749
1766
  "_filterOpen": {},
@@ -1,19 +1,19 @@
1
- /** @license
2
- * Copyright 2022 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- :host {
18
- display: block;
19
- }
1
+ /** @license
2
+ * Copyright 2022 Esri
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ :host {
18
+ display: block;
19
+ }
@@ -1,3 +1,3 @@
1
- :host {
2
- display: block;
3
- }
1
+ :host {
2
+ display: block;
3
+ }
@@ -115,8 +115,11 @@
115
115
  break;
116
116
  case 'oid':
117
117
  demo.objectId = value;
118
- case 'center' || 'level':
119
- demo[key] = value;
118
+ case 'center':
119
+ demo.center = value;
120
+ break;
121
+ case 'level':
122
+ demo.level = value;
120
123
  break;
121
124
  }
122
125
  }
@@ -503,6 +503,7 @@ export interface IToolInfo {
503
503
  isDanger?: boolean;
504
504
  isOverflow: boolean;
505
505
  isSublist?: boolean;
506
+ loading?: boolean;
506
507
  }
507
508
 
508
509
  export interface IToolSizeInfo {
@@ -95,6 +95,7 @@ export async function queryObjectIds(geometries, layer) {
95
95
  }
96
96
  /**
97
97
  * Query the layer for features that have the provided OIDs
98
+ * If no ids are provided all features will be returned
98
99
  *
99
100
  * @param ids array of ObjectIDs to be used to query for features in a layer
100
101
  * @param layer the layer to retrieve features from
@@ -119,6 +120,9 @@ export async function queryFeaturesByID(ids, layer, graphics, returnGeometry, ou
119
120
  if (fields) {
120
121
  q.outFields = fields;
121
122
  }
123
+ if (ids.length === 0) {
124
+ ids = await layer.queryObjectIds();
125
+ }
122
126
  const result = await layer.queryFeatures(q);
123
127
  graphics = graphics.concat(result.features);
124
128
  const remainingIds = ids.slice(num, ids.length);
@@ -114,6 +114,7 @@ export async function queryObjectIds(
114
114
 
115
115
  /**
116
116
  * Query the layer for features that have the provided OIDs
117
+ * If no ids are provided all features will be returned
117
118
  *
118
119
  * @param ids array of ObjectIDs to be used to query for features in a layer
119
120
  * @param layer the layer to retrieve features from
@@ -146,6 +147,10 @@ export async function queryFeaturesByID(
146
147
  q.outFields = fields;
147
148
  }
148
149
 
150
+ if (ids.length === 0) {
151
+ ids = await layer.queryObjectIds();
152
+ }
153
+
149
154
  const result = await layer.queryFeatures(q);
150
155
 
151
156
  graphics = graphics.concat(
@@ -47,6 +47,8 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
47
47
  super();
48
48
  this.__registerHost();
49
49
  this.togglePanel = createEvent(this, "togglePanel", 7);
50
+ //HARDCODED IN EN
51
+ this._noLayerToDisplayErrorMsg = "Web map does not contain any editable layers.";
50
52
  this.description = undefined;
51
53
  this.isMobile = undefined;
52
54
  this.enableAnonymousAccess = undefined;
@@ -59,6 +61,8 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
59
61
  this.mapView = undefined;
60
62
  this.layerId = undefined;
61
63
  this.objectId = undefined;
64
+ this.center = undefined;
65
+ this.level = undefined;
62
66
  this.reportButtonText = undefined;
63
67
  this.reportsHeader = undefined;
64
68
  this.reportSubmittedMessage = undefined;
@@ -190,7 +194,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
190
194
  */
191
195
  getLayerListFlowItem() {
192
196
  return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
193
- h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._translations.noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
197
+ h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
194
198
  }
195
199
  /**
196
200
  * Get the layer list for creating a report
@@ -198,7 +202,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
198
202
  * @protected
199
203
  */
200
204
  getChooseCategoryFlowItem() {
201
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations.createReportHeader, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", disabled: !this._selectedLayerId, onClick: this.navigateToCreateFeature.bind(this), width: "full" }, this._translations.next), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromSelectedPanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._translations.noLayerToDisplayErrorMsg, onLayerSelect: this.highlightSelectedLayer.bind(this), showFeatureCount: false, showNextIcon: false }))));
205
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations.createReportHeader, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", disabled: !this._selectedLayerId, onClick: this.navigateToCreateFeature.bind(this), width: "full" }, this._translations.next), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromSelectedPanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.highlightSelectedLayer.bind(this), showFeatureCount: false, showNextIcon: false }))));
202
206
  }
203
207
  /**
204
208
  * Get Feature create form of the selected feature layer
@@ -544,11 +548,17 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
544
548
  * @protected
545
549
  */
546
550
  async loadFeatureFromURLParams() {
551
+ if (this.center && this.level) {
552
+ await this.mapView.goTo({
553
+ center: this.center.split(';').map(Number),
554
+ zoom: this.level
555
+ });
556
+ }
547
557
  if (this.layerId && this.objectId) {
548
558
  const layer = await getLayerOrTable(this.mapView, this.layerId);
549
559
  if (layer) {
550
560
  // only query if we have some ids...query with no ids will result in all features being returned
551
- const featureSet = await queryFeaturesByID([Number(this.objectId)], layer, [], false, this.mapView.spatialReference);
561
+ const featureSet = await queryFeaturesByID([Number(this.objectId)], layer, [], true, this.mapView.spatialReference);
552
562
  if (featureSet.length) {
553
563
  //update the selectedFeature
554
564
  this._selectedFeature = featureSet;
@@ -560,6 +570,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
560
570
  else {
561
571
  this._flowItems = [...this._flowItems];
562
572
  }
573
+ await this.highlightOnMap(featureSet[0]);
563
574
  }
564
575
  }
565
576
  }
@@ -583,6 +594,8 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
583
594
  "mapView": [16],
584
595
  "layerId": [1, "layer-id"],
585
596
  "objectId": [1, "object-id"],
597
+ "center": [1],
598
+ "level": [1],
586
599
  "reportButtonText": [1, "report-button-text"],
587
600
  "reportsHeader": [1, "reports-header"],
588
601
  "reportSubmittedMessage": [1, "report-submitted-message"],
@@ -115,7 +115,7 @@ const printStyling = `
115
115
  flex-flow: row wrap;
116
116
  }
117
117
 
118
- .instant-apps-export-print .esri-widget > *:not(.instant-apps-export-print__scale-bar-container > *) {
118
+ .instant-apps-export-print .esri-widget > *:not(.esri-scale-bar.esri-widget > *) {
119
119
  background: #fff;
120
120
  color: #323232;
121
121
  }
@@ -200,6 +200,10 @@ const printStyling = `
200
200
  left: 15px;
201
201
  }
202
202
 
203
+ .instant-apps-export-print__scale-bar-container .esri-scale-bar__label {
204
+ font-size: 10px;
205
+ }
206
+
203
207
  .instant-apps-export-print__scale-bar-container .esri-scale-bar__bar-container:nth-child(1n+3) {
204
208
  display: none;
205
209
  }
@@ -436,8 +440,7 @@ const InstantAppsExport$1 = /*@__PURE__*/ proxyCustomElement(class InstantAppsEx
436
440
  return (h("div", { ref: (el) => (this.printContainerEl = el) }, h("div", { class: CSS.print.base, ref: (el) => (this.printEl = el) }, printMap, legend, h("div", { class: CSS.print.contentContainer }, popup, extraContent))));
437
441
  }
438
442
  renderPrintMap() {
439
- const scaleBar = this.renderScaleBar();
440
- return (h("div", { class: CSS.print.viewContainer, ref: (el) => (this.viewContainerEl = el) }, h("div", { class: CSS.print.viewWrapper, ref: (el) => (this.viewWrapperEl = el) }, this.headerTitle ? h("instant-apps-header", { titleText: this.headerTitle, backgroundColor: "#fff", textColor: "#323232" }) : null, h("img", { class: CSS.print.view, ref: (el) => (this.viewEl = el) }), scaleBar)));
443
+ return (h("div", { class: CSS.print.viewContainer, ref: (el) => (this.viewContainerEl = el) }, h("div", { class: CSS.print.viewWrapper, ref: (el) => (this.viewWrapperEl = el) }, this.headerTitle ? h("instant-apps-header", { titleText: this.headerTitle, backgroundColor: "#fff", textColor: "#323232" }) : null, h("img", { class: CSS.print.view, ref: (el) => (this.viewEl = el) }), h("div", { class: CSS.print.scaleBarContainer, ref: this.handleScaleBarContainerEl.bind(this) }))));
441
444
  }
442
445
  renderLegend() {
443
446
  return h("div", { class: CSS.print.legendContainer, ref: (el) => (this.legendContainerEl = el) });
@@ -445,9 +448,6 @@ const InstantAppsExport$1 = /*@__PURE__*/ proxyCustomElement(class InstantAppsEx
445
448
  renderCompass() {
446
449
  return h("div", { class: CSS.print.compassContainer, ref: (el) => (this.compassContainerEl = el) });
447
450
  }
448
- renderScaleBar() {
449
- return h("div", { class: CSS.print.scaleBarContainer, ref: (el) => (this.scaleBarContainerEl = el) });
450
- }
451
451
  renderPopup() {
452
452
  return (h("div", { class: CSS.print.popupContainer, ref: (el) => (this.popupContainerEl = el) }, h("div", { ref: (el) => (this.popupTitleEl = el), class: CSS.print.popupTitle }), h("div", { ref: (el) => (this.popupContentEl = el), class: CSS.print.popupContent })));
453
453
  }
@@ -591,7 +591,6 @@ const InstantAppsExport$1 = /*@__PURE__*/ proxyCustomElement(class InstantAppsEx
591
591
  handleWidgetCreation() {
592
592
  this.handleLegendCreation();
593
593
  this.handleCompassCreation();
594
- this.handleScaleBarCreation();
595
594
  }
596
595
  handleLegendCreation() {
597
596
  var _a, _b;
@@ -646,24 +645,12 @@ const InstantAppsExport$1 = /*@__PURE__*/ proxyCustomElement(class InstantAppsEx
646
645
  this.compass = new Compass({ container, view });
647
646
  });
648
647
  }
649
- handleScaleBarCreation() {
650
- var _a, _b;
651
- if (this.showScaleBar && this.includeMap && this.view != null && this.view.type === '2d' && this.scaleBarContainerEl != null) {
652
- const map = this.view.map;
653
- const scaleBarMap = (_b = (_a = this.scaleBar) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.map;
654
- const checkId = (map === null || map === void 0 ? void 0 : map.portalItem.id) === (scaleBarMap === null || scaleBarMap === void 0 ? void 0 : scaleBarMap.portalItem.id) && this.scaleBarContainerEl.innerHTML;
655
- if (!checkId) {
656
- this.updateScaleBar();
657
- }
658
- }
659
- }
660
648
  updateScaleBar() {
661
649
  var _a;
662
650
  (_a = this.view) === null || _a === void 0 ? void 0 : _a.when(async (view) => {
663
651
  var _a;
664
652
  (_a = this.scaleBar) === null || _a === void 0 ? void 0 : _a.destroy();
665
653
  this.scaleBar = null;
666
- this.scaleBarContainerEl.innerHTML = '';
667
654
  const [ScaleBar] = await loadModules(['esri/widgets/ScaleBar']);
668
655
  this.scaleBar = new ScaleBar({ container: this.scaleBarContainerEl, unit: 'dual', view });
669
656
  });
@@ -844,7 +831,7 @@ const InstantAppsExport$1 = /*@__PURE__*/ proxyCustomElement(class InstantAppsEx
844
831
  }
845
832
  handleScaleBarSize() {
846
833
  var _a;
847
- if (((_a = this.view) === null || _a === void 0 ? void 0 : _a.type) === '2d') {
834
+ if (this.showScaleBar && ((_a = this.view) === null || _a === void 0 ? void 0 : _a.type) === '2d') {
848
835
  if (this.scaleBarContainerEl != null) {
849
836
  const topBar = this.scaleBarContainerEl.querySelector('.esri-scale-bar__line--top');
850
837
  const bottomBar = this.scaleBarContainerEl.querySelector('.esri-scale-bar__line--bottom');
@@ -854,7 +841,7 @@ const InstantAppsExport$1 = /*@__PURE__*/ proxyCustomElement(class InstantAppsEx
854
841
  }
855
842
  }
856
843
  setScalebarWidth(bar, position) {
857
- if (this.view != null && bar != null && this.screenshot != null) {
844
+ if (bar != null && this.screenshot != null) {
858
845
  const width = this.screenshot.data.width / 2;
859
846
  const barWidth = Number(bar.style.width.replace('px', ''));
860
847
  const widthPercentage = (barWidth / width) * 100;
@@ -866,6 +853,18 @@ const InstantAppsExport$1 = /*@__PURE__*/ proxyCustomElement(class InstantAppsEx
866
853
  (_a = this.screenshotPreview) === null || _a === void 0 ? void 0 : _a.remove();
867
854
  (_b = this.screenshotStyle) === null || _b === void 0 ? void 0 : _b.remove();
868
855
  }
856
+ handleScaleBarContainerEl(el) {
857
+ var _a, _b, _c;
858
+ if (this.showScaleBar && ((_a = this.view) === null || _a === void 0 ? void 0 : _a.type) === '2d') {
859
+ const map = this.view.map;
860
+ const scaleBarMap = (_c = (_b = this.scaleBar) === null || _b === void 0 ? void 0 : _b.view) === null || _c === void 0 ? void 0 : _c.map;
861
+ this.scaleBarContainerEl = el;
862
+ const checkId = (map === null || map === void 0 ? void 0 : map.portalItem.id) === (scaleBarMap === null || scaleBarMap === void 0 ? void 0 : scaleBarMap.portalItem.id);
863
+ if (!checkId) {
864
+ this.updateScaleBar();
865
+ }
866
+ }
867
+ }
869
868
  get el() { return this; }
870
869
  static get watchers() { return {
871
870
  "includeMap": ["watchIncludeMap"]