@esri/solutions-components 0.5.0 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. package/dist/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
  2. package/dist/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
  3. package/dist/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
  4. package/dist/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
  5. package/dist/assets/arcgis-pdf-creator/grid.js +1 -1
  6. package/dist/assets/data/images/grid.png +0 -0
  7. package/dist/assets/data/images/horizontal.png +0 -0
  8. package/dist/assets/data/images/vertical.png +0 -0
  9. package/dist/assets/t9n/crowdsource-manager/resources.json +7 -1
  10. package/dist/assets/t9n/crowdsource-manager/resources_en.json +7 -1
  11. package/dist/cjs/buffer-tools_6.cjs.entry.js +88 -92
  12. package/dist/cjs/{calcite-block_2.cjs.entry.js → calcite-action-bar_4.cjs.entry.js} +307 -18
  13. package/dist/cjs/{calcite-action.cjs.entry.js → calcite-action_2.cjs.entry.js} +84 -1
  14. package/dist/cjs/{calcite-combobox_3.cjs.entry.js → calcite-chip_4.cjs.entry.js} +131 -5
  15. package/dist/cjs/{calcite-dropdown-group_4.cjs.entry.js → calcite-dropdown_5.cjs.entry.js} +467 -1
  16. package/dist/cjs/calcite-input-message_5.cjs.entry.js +19 -17
  17. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
  18. package/dist/cjs/{calcite-action-bar_2.cjs.entry.js → calcite-tooltip.cjs.entry.js} +2 -208
  19. package/dist/cjs/crowdsource-manager.cjs.entry.js +88 -14
  20. package/dist/cjs/{downloadUtils-415ab342.js → downloadUtils-9359e9ff.js} +135 -44
  21. package/dist/cjs/{index.es-98008aa0.js → index.es-9c0d0ed6.js} +3 -3
  22. package/dist/cjs/{interfaces-17c631bf.js → interfaces-cac36920.js} +6 -0
  23. package/dist/cjs/layer-table_2.cjs.entry.js +512 -0
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/cjs/{mapViewUtils-f617ae9a.js → mapViewUtils-090f4d4d.js} +3 -3
  26. package/dist/cjs/public-notification.cjs.entry.js +173 -48
  27. package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
  28. package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
  29. package/dist/cjs/{solution-store-b86759b2.js → solution-store-d28c332e.js} +1 -1
  30. package/dist/cjs/solutions-components.cjs.js +1 -1
  31. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
  32. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
  33. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
  34. package/dist/collection/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
  35. package/dist/collection/assets/arcgis-pdf-creator/grid.js +1 -1
  36. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +122 -0
  37. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +130 -14
  38. package/dist/collection/components/layer-table/layer-table.css +2 -70
  39. package/dist/collection/components/layer-table/layer-table.js +66 -106
  40. package/dist/collection/components/map-card/map-card.css +4 -7
  41. package/dist/collection/components/map-card/map-card.js +44 -10
  42. package/dist/collection/components/map-draw-tools/map-draw-tools.js +4 -8
  43. package/dist/collection/components/map-select-tools/map-select-tools.js +75 -15
  44. package/dist/collection/components/public-notification/public-notification.js +217 -25
  45. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +1 -1
  46. package/dist/collection/demos/crowdsource-manager.html +14 -41
  47. package/dist/collection/utils/csvDownload.js +41 -0
  48. package/dist/collection/utils/csvDownload.ts +42 -0
  49. package/dist/collection/utils/csvUtils.js +6 -23
  50. package/dist/collection/utils/csvUtils.ts +8 -27
  51. package/dist/collection/utils/downloadUtils.js +30 -14
  52. package/dist/collection/utils/downloadUtils.ts +36 -14
  53. package/dist/collection/utils/interfaces.js +6 -0
  54. package/dist/collection/utils/interfaces.ts +6 -0
  55. package/dist/collection/utils/pdfUtils.js +9 -6
  56. package/dist/collection/utils/pdfUtils.ts +13 -8
  57. package/dist/collection/utils/queryUtils.js +2 -2
  58. package/dist/collection/utils/queryUtils.ts +2 -2
  59. package/dist/collection/utils/test/csvUtils.spec.tsx +56 -0
  60. package/dist/collection/utils/test/downloadUtils.spec.tsx +133 -0
  61. package/dist/components/crowdsource-manager.js +293 -17
  62. package/dist/components/downloadUtils.js +133 -42
  63. package/dist/components/interfaces3.js +7 -1
  64. package/dist/components/layer-table.js +1 -443
  65. package/dist/components/layer-table2.js +429 -0
  66. package/dist/components/map-card.js +1 -339
  67. package/dist/{esm/map-card.entry.js → components/map-card2.js} +118 -22
  68. package/dist/components/map-draw-tools2.js +19 -23
  69. package/dist/components/map-layer-picker2.js +1 -1
  70. package/dist/components/map-select-tools2.js +21 -16
  71. package/dist/components/public-notification.js +209 -81
  72. package/dist/components/queryUtils.js +2 -2
  73. package/dist/components/refine-selection-tools2.js +3 -3
  74. package/dist/components/refine-selection2.js +1 -1
  75. package/dist/components/solution-resource-item2.js +1 -1
  76. package/dist/components/solution-store.js +1 -1
  77. package/dist/esm/buffer-tools_6.entry.js +79 -83
  78. package/dist/esm/{calcite-block_2.entry.js → calcite-action-bar_4.entry.js} +307 -20
  79. package/dist/esm/{calcite-action.entry.js → calcite-action_2.entry.js} +84 -2
  80. package/dist/esm/{calcite-combobox_3.entry.js → calcite-chip_4.entry.js} +134 -9
  81. package/dist/esm/{calcite-dropdown-group_4.entry.js → calcite-dropdown_5.entry.js} +468 -3
  82. package/dist/esm/calcite-input-message_5.entry.js +19 -17
  83. package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
  84. package/dist/esm/{calcite-action-bar_2.entry.js → calcite-tooltip.entry.js} +4 -209
  85. package/dist/esm/crowdsource-manager.entry.js +88 -14
  86. package/dist/esm/{downloadUtils-606b0f0e.js → downloadUtils-a8f139c5.js} +135 -44
  87. package/dist/esm/{index.es-c736c805.js → index.es-a75412ff.js} +3 -3
  88. package/dist/esm/{interfaces-d0d83efa.js → interfaces-cd4054e5.js} +7 -1
  89. package/dist/esm/layer-table_2.entry.js +507 -0
  90. package/dist/esm/loader.js +1 -1
  91. package/dist/esm/{mapViewUtils-4e945e07.js → mapViewUtils-8ffcd36d.js} +4 -4
  92. package/dist/esm/public-notification.entry.js +169 -44
  93. package/dist/esm/solution-configuration.entry.js +2 -2
  94. package/dist/esm/solution-contents_3.entry.js +2 -2
  95. package/dist/esm/{solution-store-477288ac.js → solution-store-1b67f2c8.js} +1 -1
  96. package/dist/esm/solutions-components.js +1 -1
  97. package/dist/solutions-components/demos/crowdsource-manager.html +14 -41
  98. package/dist/solutions-components/{p-dd11eeb2.js → p-1395b0ef.js} +1 -1
  99. package/dist/solutions-components/{p-4f5641b4.entry.js → p-1affd711.entry.js} +18 -18
  100. package/dist/solutions-components/p-30de8da1.entry.js +17 -0
  101. package/dist/solutions-components/{p-91cad71e.entry.js → p-439c878d.entry.js} +3 -9
  102. package/dist/solutions-components/{p-72117a18.js → p-765a27f3.js} +1 -1
  103. package/dist/solutions-components/p-813a04c3.entry.js +6 -0
  104. package/dist/solutions-components/{p-9e8a371f.entry.js → p-874b39a7.entry.js} +3 -3
  105. package/dist/solutions-components/p-8cece97f.js +21 -0
  106. package/dist/solutions-components/{p-dd0241fb.entry.js → p-97aa7211.entry.js} +1 -1
  107. package/dist/solutions-components/{p-0e459cc7.entry.js → p-a955a3e6.entry.js} +10 -4
  108. package/dist/solutions-components/{p-6a657ff6.js → p-bb64bd47.js} +25 -9
  109. package/dist/solutions-components/p-c392dd95.entry.js +17 -0
  110. package/dist/solutions-components/p-ca386a72.entry.js +6 -0
  111. package/dist/solutions-components/p-d47d74a6.entry.js +23 -0
  112. package/dist/solutions-components/p-db846ee2.entry.js +11 -0
  113. package/dist/solutions-components/p-dc53c9c1.js +36 -0
  114. package/dist/solutions-components/p-e1c93241.entry.js +6 -0
  115. package/dist/solutions-components/{p-4cbaf0f1.entry.js → p-e6d235d6.entry.js} +1 -1
  116. package/dist/solutions-components/solutions-components.esm.js +6 -6
  117. package/dist/solutions-components/utils/csvDownload.ts +42 -0
  118. package/dist/solutions-components/utils/csvUtils.ts +8 -27
  119. package/dist/solutions-components/utils/downloadUtils.ts +36 -14
  120. package/dist/solutions-components/utils/interfaces.ts +6 -0
  121. package/dist/solutions-components/utils/pdfUtils.ts +13 -8
  122. package/dist/solutions-components/utils/queryUtils.ts +2 -2
  123. package/dist/solutions-components/utils/test/csvUtils.spec.tsx +56 -0
  124. package/dist/solutions-components/utils/test/downloadUtils.spec.tsx +133 -0
  125. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +39 -0
  126. package/dist/types/components/layer-table/layer-table.d.ts +35 -48
  127. package/dist/types/components/map-card/map-card.d.ts +10 -6
  128. package/dist/types/components/map-select-tools/map-select-tools.d.ts +16 -1
  129. package/dist/types/components/public-notification/public-notification.d.ts +86 -4
  130. package/dist/types/components.d.ts +68 -0
  131. package/dist/types/preact.d.ts +2 -1
  132. package/dist/types/utils/csvDownload.d.ts +24 -0
  133. package/dist/types/utils/csvUtils.d.ts +2 -1
  134. package/dist/types/utils/downloadUtils.d.ts +25 -0
  135. package/dist/types/utils/interfaces.d.ts +5 -0
  136. package/dist/types/utils/pdfUtils.d.ts +2 -1
  137. package/package.json +4 -4
  138. package/dist/cjs/calcite-chip.cjs.entry.js +0 -142
  139. package/dist/cjs/calcite-dropdown.cjs.entry.js +0 -481
  140. package/dist/cjs/calcite-handle.cjs.entry.js +0 -99
  141. package/dist/cjs/calcite-loader.cjs.entry.js +0 -95
  142. package/dist/cjs/layer-table.cjs.entry.js +0 -317
  143. package/dist/cjs/map-card.cjs.entry.js +0 -252
  144. package/dist/esm/calcite-chip.entry.js +0 -138
  145. package/dist/esm/calcite-dropdown.entry.js +0 -477
  146. package/dist/esm/calcite-handle.entry.js +0 -95
  147. package/dist/esm/calcite-loader.entry.js +0 -91
  148. package/dist/esm/layer-table.entry.js +0 -313
  149. package/dist/solutions-components/p-11132485.entry.js +0 -11
  150. package/dist/solutions-components/p-15b43c29.entry.js +0 -11
  151. package/dist/solutions-components/p-5034aabc.entry.js +0 -11
  152. package/dist/solutions-components/p-5ee7b022.entry.js +0 -12
  153. package/dist/solutions-components/p-6f012424.entry.js +0 -6
  154. package/dist/solutions-components/p-7fd10eb3.entry.js +0 -11
  155. package/dist/solutions-components/p-84bbaebf.entry.js +0 -6
  156. package/dist/solutions-components/p-88e28de2.js +0 -36
  157. package/dist/solutions-components/p-a57ef371.entry.js +0 -6
  158. package/dist/solutions-components/p-ac76d270.entry.js +0 -17
  159. package/dist/solutions-components/p-dbc9a5a8.js +0 -21
  160. package/dist/solutions-components/p-e162304e.entry.js +0 -6
  161. package/dist/solutions-components/p-f5c70be2.entry.js +0 -6
  162. package/dist/solutions-components/p-f6b17cc6.entry.js +0 -11
@@ -40,13 +40,16 @@ export class MapSelectTools {
40
40
  this.enabledLayerIds = [];
41
41
  this.defaultBufferDistance = undefined;
42
42
  this.defaultBufferUnit = undefined;
43
- this.geometries = undefined;
43
+ this.geometries = [];
44
44
  this.isUpdate = false;
45
45
  this.mapView = undefined;
46
46
  this.searchConfiguration = undefined;
47
47
  this.selectionSet = undefined;
48
48
  this.selectLayerView = undefined;
49
49
  this.showBufferTools = true;
50
+ this.sketchLineSymbol = undefined;
51
+ this.sketchPointSymbol = undefined;
52
+ this.sketchPolygonSymbol = undefined;
50
53
  this._layerSelectChecked = undefined;
51
54
  this._searchTerm = undefined;
52
55
  this._translations = undefined;
@@ -193,7 +196,7 @@ export class MapSelectTools {
193
196
  const useDrawClass = !this._layerSelectChecked && !searchEnabled ? " div-visible" : " div-not-visible";
194
197
  const showLayerChoiceClass = searchEnabled ? "div-not-visible" : "div-visible";
195
198
  const bufferDistance = typeof ((_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.distance) === "number" ? this.selectionSet.distance : this.defaultBufferDistance;
196
- return (h(Host, null, h("div", { class: "padding-bottom-1" }, h("calcite-radio-group", { class: "w-100", onCalciteRadioGroupChange: (evt) => this._workflowChange(evt) }, h("calcite-radio-group-item", { checked: searchEnabled, class: "w-50 end-border", value: EWorkflowType.SEARCH }, this._translations.search), h("calcite-radio-group-item", { checked: drawEnabled, class: "w-50", value: EWorkflowType.SKETCH }, this._translations.sketch))), h("div", { class: showSearchClass }, h("div", { class: "search-widget", ref: (el) => { this._searchElement = el; } })), h("div", { class: showLayerChoiceClass }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { checked: this._layerSelectChecked, onCalciteCheckboxChange: () => this._layerSelectChanged(), ref: (el) => this._selectFromLayerElement = el }), "Use layer features")), h("div", { class: useDrawClass }, h("map-draw-tools", { active: true, border: true, mapView: this.mapView, ref: (el) => { this._drawTools = el; } })), h("div", { class: useSelectClass }, h("refine-selection-tools", { active: true, border: true, enabledLayerIds: this.enabledLayerIds, layerView: this.selectLayerView, layerViews: this._refineSelectLayers, mapView: this.mapView, mode: ESelectionMode.ADD, ref: (el) => { this._refineTools = el; }, refineMode: ERefineMode.SUBSET })), h("calcite-label", { class: showBufferToolsClass }, this._translations.searchDistance, h("buffer-tools", { distance: bufferDistance, geometries: this.geometries, onBufferComplete: (evt) => this._bufferComplete(evt), ref: (el) => this._bufferTools = el, unit: ((_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.unit) || this.defaultBufferUnit })), h("slot", null)));
199
+ return (h(Host, null, h("div", { class: "padding-bottom-1" }, h("calcite-radio-group", { class: "w-100", onCalciteRadioGroupChange: (evt) => this._workflowChange(evt) }, h("calcite-radio-group-item", { checked: searchEnabled, class: "w-50 end-border", value: EWorkflowType.SEARCH }, this._translations.search), h("calcite-radio-group-item", { checked: drawEnabled, class: "w-50", value: EWorkflowType.SKETCH }, this._translations.sketch))), h("div", { class: showSearchClass }, h("div", { class: "search-widget", ref: (el) => { this._searchElement = el; } })), h("div", { class: showLayerChoiceClass }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { checked: this._layerSelectChecked, onCalciteCheckboxChange: () => this._layerSelectChanged(), ref: (el) => this._selectFromLayerElement = el }), "Use layer features")), h("div", { class: useDrawClass }, h("map-draw-tools", { active: true, border: true, mapView: this.mapView, pointSymbol: this.sketchPointSymbol, polygonSymbol: this.sketchPolygonSymbol, polylineSymbol: this.sketchLineSymbol, ref: (el) => { this._drawTools = el; } })), h("div", { class: useSelectClass }, h("refine-selection-tools", { active: true, border: true, enabledLayerIds: this.enabledLayerIds, layerView: this.selectLayerView, layerViews: this._refineSelectLayers, mapView: this.mapView, mode: ESelectionMode.ADD, ref: (el) => { this._refineTools = el; }, refineMode: ERefineMode.SUBSET })), h("calcite-label", { class: showBufferToolsClass }, this._translations.searchDistance, h("buffer-tools", { distance: bufferDistance, geometries: this.geometries, onBufferComplete: (evt) => this._bufferComplete(evt), ref: (el) => this._bufferTools = el, unit: ((_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.unit) || this.defaultBufferUnit })), h("slot", null)));
197
200
  }
198
201
  //--------------------------------------------------------------------------
199
202
  //
@@ -228,7 +231,7 @@ export class MapSelectTools {
228
231
  */
229
232
  async _init() {
230
233
  this._initGraphicsLayer();
231
- this._initSelectionSet();
234
+ await this._initSelectionSet();
232
235
  this._initSearchWidget();
233
236
  }
234
237
  /**
@@ -236,7 +239,7 @@ export class MapSelectTools {
236
239
  *
237
240
  * @protected
238
241
  */
239
- _initSelectionSet() {
242
+ async _initSelectionSet() {
240
243
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
241
244
  if (this.selectionSet) {
242
245
  this._searchTerm = (_b = (_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.searchResult) === null || _b === void 0 ? void 0 : _b.name;
@@ -251,7 +254,7 @@ export class MapSelectTools {
251
254
  ];
252
255
  // reset selection label base
253
256
  this._selectionLabel = ((_k = this.selectionSet) === null || _k === void 0 ? void 0 : _k.label) || this._getSelectionBaseLabel();
254
- void goToSelection(this.selectionSet.selectedIds, this.selectionSet.layerView, this.mapView, false);
257
+ await goToSelection(this.selectionSet.selectedIds, this.selectionSet.layerView, this.mapView, false);
255
258
  }
256
259
  else {
257
260
  this._workflowType = EWorkflowType.SEARCH;
@@ -358,7 +361,7 @@ export class MapSelectTools {
358
361
  this._bufferGraphicsLayer = this.mapView.map.layers.getItemAt(bufferIndex);
359
362
  }
360
363
  else {
361
- this._bufferGraphicsLayer = new this.GraphicsLayer({ title });
364
+ this._bufferGraphicsLayer = new this.GraphicsLayer({ title, listMode: "hide" });
362
365
  state.managedLayers.push(title);
363
366
  const sketchIndex = this.mapView.map.layers.findIndex((l) => l.title === this._translations.sketchLayer);
364
367
  if (sketchIndex > -1) {
@@ -427,17 +430,16 @@ export class MapSelectTools {
427
430
  this.selectionLoadingChange.emit(false);
428
431
  // Add geometries used for selecting features as graphics
429
432
  this._drawTools.graphics = this.geometries.map(geom => {
430
- var _a, _b, _c;
431
433
  const props = {
432
434
  "geometry": geom,
433
435
  "symbol": geom.type === "point" ?
434
- (_a = this._drawTools) === null || _a === void 0 ? void 0 : _a.pointSymbol : geom.type === "polyline" ?
435
- (_b = this._drawTools) === null || _b === void 0 ? void 0 : _b.polylineSymbol : geom.type === "polygon" ?
436
- (_c = this._drawTools) === null || _c === void 0 ? void 0 : _c.polygonSymbol : undefined
436
+ this.sketchPointSymbol : geom.type === "polyline" ?
437
+ this.sketchLineSymbol : geom.type === "polygon" ?
438
+ this.sketchPolygonSymbol : undefined
437
439
  };
438
440
  return new this.Graphic(props);
439
441
  });
440
- void this._highlightFeatures(this._selectedIds);
442
+ await this._highlightFeatures(this._selectedIds);
441
443
  }
442
444
  /**
443
445
  * Query the selectLayerView based on any user drawn geometries or buffers
@@ -466,8 +468,8 @@ export class MapSelectTools {
466
468
  });
467
469
  this._bufferGraphicsLayer.removeAll();
468
470
  this._bufferGraphicsLayer.add(polygonGraphic);
469
- void this._selectFeatures([this._bufferGeometry]);
470
- void this.mapView.goTo(polygonGraphic.geometry.extent);
471
+ await this._selectFeatures([this._bufferGeometry]);
472
+ await this.mapView.goTo(polygonGraphic.geometry.extent);
471
473
  }
472
474
  else {
473
475
  if (this._bufferGraphicsLayer) {
@@ -511,7 +513,7 @@ export class MapSelectTools {
511
513
  // for sketch
512
514
  // checking for clear as it would throw off tests
513
515
  if ((_b = this._drawTools) === null || _b === void 0 ? void 0 : _b.clear) {
514
- void this._drawTools.clear();
516
+ await this._drawTools.clear();
515
517
  }
516
518
  this.selectionSetChange.emit(this._selectedIds.length);
517
519
  }
@@ -664,7 +666,8 @@ export class MapSelectTools {
664
666
  "docs": {
665
667
  "tags": [],
666
668
  "text": "esri/geometry: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html"
667
- }
669
+ },
670
+ "defaultValue": "[]"
668
671
  },
669
672
  "isUpdate": {
670
673
  "type": "boolean",
@@ -779,6 +782,63 @@ export class MapSelectTools {
779
782
  "attribute": "show-buffer-tools",
780
783
  "reflect": false,
781
784
  "defaultValue": "true"
785
+ },
786
+ "sketchLineSymbol": {
787
+ "type": "unknown",
788
+ "mutable": false,
789
+ "complexType": {
790
+ "original": "__esri.SimpleLineSymbol",
791
+ "resolved": "SimpleLineSymbol",
792
+ "references": {
793
+ "___esri": {
794
+ "location": "global"
795
+ }
796
+ }
797
+ },
798
+ "required": false,
799
+ "optional": false,
800
+ "docs": {
801
+ "tags": [],
802
+ "text": "esri/symbols/SimpleLineSymbol | JSON representation : https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html"
803
+ }
804
+ },
805
+ "sketchPointSymbol": {
806
+ "type": "unknown",
807
+ "mutable": false,
808
+ "complexType": {
809
+ "original": "__esri.SimpleMarkerSymbol",
810
+ "resolved": "SimpleMarkerSymbol",
811
+ "references": {
812
+ "___esri": {
813
+ "location": "global"
814
+ }
815
+ }
816
+ },
817
+ "required": false,
818
+ "optional": false,
819
+ "docs": {
820
+ "tags": [],
821
+ "text": "esri/symbols/SimpleMarkerSymbol | JSON representation: https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html"
822
+ }
823
+ },
824
+ "sketchPolygonSymbol": {
825
+ "type": "unknown",
826
+ "mutable": false,
827
+ "complexType": {
828
+ "original": "__esri.SimpleFillSymbol",
829
+ "resolved": "SimpleFillSymbol",
830
+ "references": {
831
+ "___esri": {
832
+ "location": "global"
833
+ }
834
+ }
835
+ },
836
+ "required": false,
837
+ "optional": false,
838
+ "docs": {
839
+ "tags": [],
840
+ "text": "esri/symbols/SimpleFillSymbol | JSON representation: https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html"
841
+ }
782
842
  }
783
843
  };
784
844
  }
@@ -42,6 +42,9 @@ export class PublicNotification {
42
42
  this.selectionLayerIds = [];
43
43
  this.showRefineSelection = false;
44
44
  this.showSearchSettings = true;
45
+ this.sketchLineSymbol = undefined;
46
+ this.sketchPointSymbol = undefined;
47
+ this.sketchPolygonSymbol = undefined;
45
48
  this.addresseeLayer = undefined;
46
49
  this._downloadActive = true;
47
50
  this._numSelected = 0;
@@ -83,14 +86,27 @@ export class PublicNotification {
83
86
  }
84
87
  }
85
88
  /**
86
- * Called each time the selectionSets prop is changed.
89
+ * Called each time the sketchLineSymbol prop is changed.
87
90
  */
88
- async selectionSetsWatchHandler(v, oldV) {
89
- if (v && v !== oldV && v.length > 0) {
90
- const nonRefineSets = v.filter(ss => ss.workflowType !== EWorkflowType.REFINE);
91
- if (nonRefineSets.length === 0) {
92
- this._selectionSets = [];
93
- }
91
+ async sketchLineSymbolWatchHandler(v, oldV) {
92
+ if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
93
+ this._setLineSymbol(v);
94
+ }
95
+ }
96
+ /**
97
+ * Called each time the sketchPointSymbol prop is changed.
98
+ */
99
+ async sketchPointSymbolWatchHandler(v, oldV) {
100
+ if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
101
+ this._setPointSymbol(v);
102
+ }
103
+ }
104
+ /**
105
+ * Called each time the sketchPolygonSymbol prop is changed.
106
+ */
107
+ async sketchPolygonSymbolWatchHandler(v, oldV) {
108
+ if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
109
+ this._setPolygonSymbol(v);
94
110
  }
95
111
  }
96
112
  /**
@@ -150,6 +166,7 @@ export class PublicNotification {
150
166
  async componentWillLoad() {
151
167
  await this._getTranslations();
152
168
  await this._initModules();
169
+ this._initSymbols();
153
170
  }
154
171
  /**
155
172
  * Renders the component.
@@ -170,10 +187,84 @@ export class PublicNotification {
170
187
  * @protected
171
188
  */
172
189
  async _initModules() {
173
- const [geometryEngine] = await loadModules([
174
- "esri/geometry/geometryEngine"
190
+ const [geometryEngine, jsonUtils] = await loadModules([
191
+ "esri/geometry/geometryEngine",
192
+ "esri/symbols/support/jsonUtils"
175
193
  ]);
176
194
  this._geometryEngine = geometryEngine;
195
+ this._jsonUtils = jsonUtils;
196
+ }
197
+ /**
198
+ * Initialize the default symbols that will be used when creating new graphics
199
+ *
200
+ * @protected
201
+ */
202
+ _initSymbols() {
203
+ this._setLineSymbol(this.sketchLineSymbol);
204
+ this._setPointSymbol(this.sketchPointSymbol);
205
+ this._setPolygonSymbol(this.sketchPolygonSymbol);
206
+ }
207
+ /**
208
+ * Convert a JSON representation of a line symbol and/or set the line symbol
209
+ *
210
+ * @param v SimpleLineSymbol or a JSON representation of a line symbol
211
+ *
212
+ * @protected
213
+ */
214
+ _setLineSymbol(v) {
215
+ const isSymbol = (v === null || v === void 0 ? void 0 : v.type) === 'simple-line';
216
+ this.sketchLineSymbol = isSymbol ? v : this._jsonUtils.fromJSON(v ? v : {
217
+ "type": "esriSLS",
218
+ "color": [130, 130, 130, 255],
219
+ "width": 2,
220
+ "style": "esriSLSSolid"
221
+ });
222
+ }
223
+ /**
224
+ * Convert a JSON representation of a point symbol and/or set the point symbol
225
+ *
226
+ * @param v SimpleMarkerSymbol or a JSON representation of a point symbol
227
+ *
228
+ * @protected
229
+ */
230
+ _setPointSymbol(v) {
231
+ const isSymbol = (v === null || v === void 0 ? void 0 : v.type) === 'simple-marker';
232
+ this.sketchPointSymbol = isSymbol ? v : this._jsonUtils.fromJSON(v ? v : {
233
+ "type": "esriSMS",
234
+ "color": [255, 255, 255, 255],
235
+ "angle": 0,
236
+ "xoffset": 0,
237
+ "yoffset": 0,
238
+ "size": 6,
239
+ "style": "esriSMSCircle",
240
+ "outline": {
241
+ "type": "esriSLS",
242
+ "color": [50, 50, 50, 255],
243
+ "width": 1,
244
+ "style": "esriSLSSolid"
245
+ }
246
+ });
247
+ }
248
+ /**
249
+ * Convert a JSON representation of a polygon symbol and/or set the polygon symbol
250
+ *
251
+ * @param v SimpleFillSymbol or a JSON representation of a polygon symbol
252
+ *
253
+ * @protected
254
+ */
255
+ _setPolygonSymbol(v) {
256
+ const isSymbol = (v === null || v === void 0 ? void 0 : v.type) === 'simple-fill';
257
+ this.sketchPolygonSymbol = isSymbol ? v : this._jsonUtils.fromJSON(v ? v : {
258
+ "type": "esriSFS",
259
+ "color": [150, 150, 150, 51],
260
+ "outline": {
261
+ "type": "esriSLS",
262
+ "color": [50, 50, 50, 255],
263
+ "width": 2,
264
+ "style": "esriSLSSolid"
265
+ },
266
+ "style": "esriSFSSolid"
267
+ });
177
268
  }
178
269
  /**
179
270
  * Get a calcite action group for the current action
@@ -236,7 +327,7 @@ export class PublicNotification {
236
327
  * @protected
237
328
  */
238
329
  _getListPage() {
239
- const hasSets = this._selectionSets.filter(ss => ss.workflowType !== EWorkflowType.REFINE).length > 0;
330
+ const hasSets = this._hasSelections();
240
331
  const total = utils.getTotal(this._selectionSets);
241
332
  return hasSets ? (h("calcite-panel", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "font-bold" }, this._translations.myLists)), this._getNotice(this._translations.listHasSetsTip, "padding-sides-1 padding-bottom-1"), this._getMapLayerPicker(), h("div", { class: "display-block padding-sides-1 height-1-1-2" }, h("div", { class: "display-block float-left" }, h("calcite-label", { alignment: "start", class: "font-bold" }, this._translations.notifications)), h("div", { class: "display-block float-right" }, h("calcite-input-message", { active: true, class: "info-blue margin-top-0", scale: "m" }, this._translations.uniqueCout.replace("{{n}}", total.toString())))), hasSets ? this._getSelectionSetList() : (h("div", { class: "info-message" }, h("calcite-input-message", { active: true, class: "info-blue", scale: "m" }, this._translations.noNotifications))), h("div", { class: "display-flex padding-1" }, h("calcite-button", { onClick: () => { this._setPageType(EPageType.SELECT); }, width: "full" }, this._translations.add)), this._showModal(this._showLayerSelectionChangeModal))) : (h("calcite-panel", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "font-bold" }, this._translations.myLists)), h("div", { class: "padding-sides-1" }, h("calcite-label", null, this._translations.notifications)), h("div", { class: "info-message padding-bottom-1" }, h("calcite-input-message", { active: true, class: "info-blue", scale: "m" }, this._translations.noNotifications)), this._getNotice(this._translations.selectLayerAndAdd, "padding-sides-1 padding-bottom-1"), this._getMapLayerPicker(), h("div", { class: "display-flex padding-1" }, h("calcite-button", { onClick: () => { this._setPageType(EPageType.SELECT); }, width: "full" }, this._translations.add))));
242
333
  }
@@ -261,7 +352,8 @@ export class PublicNotification {
261
352
  // REFINE is handled seperately from the core selection sets
262
353
  // You can only access after clicking the refine action
263
354
  this._selectionSets.reduce((prev, cur, i) => {
264
- if (cur.workflowType !== EWorkflowType.REFINE) {
355
+ const validSet = this._isValidSet(cur);
356
+ if (validSet) {
265
357
  prev.push((h("calcite-list-item", { description: this._translations.selectedFeatures.replace("{{n}}", cur.selectedIds.length.toString()), label: cur.label, onClick: () => this._gotoSelection(cur, this.mapView) }, this._getAction(true, "pencil", "", (evt) => this._openSelection(cur, evt), false, "actions-end"), this._getAction(true, "x", "", (evt) => this._deleteSelection(i, evt), false, "actions-end"))));
266
358
  }
267
359
  return prev;
@@ -302,14 +394,38 @@ export class PublicNotification {
302
394
  await this._updateAddresseeLayer(id);
303
395
  }
304
396
  /**
305
- * Check if any selection sets exist.
397
+ * Check if any valid selection sets exist.
306
398
  *
307
- * @returns true if selection sets exist
399
+ * @returns true if valid selection sets exist
308
400
  *
309
401
  * @protected
310
402
  */
311
403
  _hasSelections() {
312
- return this._selectionSets.length > 0;
404
+ return this._selectionSets.filter(ss => this._isValidSet(ss)).length > 0;
405
+ }
406
+ /**
407
+ * Check if any duplicates exist
408
+ *
409
+ * @returns true if duplicates are found
410
+ *
411
+ * @protected
412
+ */
413
+ _hasDuplicates() {
414
+ const selectedIds = this._selectionSets.reduce((prev, cur) => {
415
+ return prev.concat(cur.download ? cur.selectedIds : []);
416
+ }, []);
417
+ return selectedIds.length > new Set(selectedIds).size;
418
+ }
419
+ /**
420
+ * Check if a selection set is valid (exists or has at least one added if its a refine set)
421
+ *
422
+ * @returns true if selection set is valid
423
+ *
424
+ * @protected
425
+ */
426
+ _isValidSet(ss) {
427
+ var _a, _b;
428
+ return ss.workflowType === EWorkflowType.REFINE ? ((_b = (_a = ss === null || ss === void 0 ? void 0 : ss.refineIds) === null || _a === void 0 ? void 0 : _a.addIds) === null || _b === void 0 ? void 0 : _b.length) > 0 : true;
313
429
  }
314
430
  /**
315
431
  * Create the Select page that shows the selection workflows
@@ -331,7 +447,7 @@ export class PublicNotification {
331
447
  const locale = getComponentClosestLanguage(this.el);
332
448
  const selectionLoading = locale && locale === "en" ?
333
449
  `${this._translations.selectionLoading}...` : this._translations.selectionLoading;
334
- return (h("calcite-panel", null, this._getLabel(this._translations.stepTwoFull.replace("{{layer}}", (_a = this.addresseeLayer) === null || _a === void 0 ? void 0 : _a.layer.title)), this._getNotice(noticeText), h("div", { class: "padding-top-sides-1" }, h("map-select-tools", { bufferColor: this.bufferColor, bufferOutlineColor: this.bufferOutlineColor, class: "font-bold", defaultBufferDistance: this.defaultBufferDistance, defaultBufferUnit: this.defaultBufferUnit, enabledLayerIds: this.selectionLayerIds, isUpdate: !!this._activeSelection, mapView: this.mapView, onSelectionSetChange: (evt) => this._updateForSelection(evt), onWorkflowTypeChange: (evt) => this._updateForWorkflowType(evt), ref: (el) => { this._selectTools = el; }, searchConfiguration: this._searchConfiguration, selectLayerView: this.addresseeLayer, selectionSet: this._activeSelection, showBufferTools: this.showSearchSettings })), h("div", { class: "padding-sides-1 padding-bottom-1", style: { "align-items": "end", "display": "flex" } }, this._selectionLoading ? (h("div", null, h("calcite-loader", { active: true, class: "info-blue", inline: true, label: selectionLoading, scale: "m", type: "indeterminate" }))) : (h("calcite-icon", { class: "info-blue padding-end-1-2", icon: "feature-layer", scale: "s" })), h("calcite-input-message", { active: true, class: "info-blue", scale: "m" }, this._selectionLoading ? selectionLoading :
450
+ return (h("calcite-panel", null, this._getLabel(this._translations.stepTwoFull.replace("{{layer}}", (_a = this.addresseeLayer) === null || _a === void 0 ? void 0 : _a.layer.title)), this._getNotice(noticeText), h("div", { class: "padding-top-sides-1" }, h("map-select-tools", { bufferColor: this.bufferColor, bufferOutlineColor: this.bufferOutlineColor, class: "font-bold", defaultBufferDistance: this.defaultBufferDistance, defaultBufferUnit: this.defaultBufferUnit, enabledLayerIds: this.selectionLayerIds, isUpdate: !!this._activeSelection, mapView: this.mapView, onSelectionSetChange: (evt) => this._updateForSelection(evt), onWorkflowTypeChange: (evt) => this._updateForWorkflowType(evt), ref: (el) => { this._selectTools = el; }, searchConfiguration: this._searchConfiguration, selectLayerView: this.addresseeLayer, selectionSet: this._activeSelection, showBufferTools: this.showSearchSettings, sketchLineSymbol: this.sketchLineSymbol, sketchPointSymbol: this.sketchPointSymbol, sketchPolygonSymbol: this.sketchPolygonSymbol })), h("div", { class: "padding-sides-1 padding-bottom-1", style: { "align-items": "end", "display": "flex" } }, this._selectionLoading ? (h("div", null, h("calcite-loader", { active: true, class: "info-blue", inline: true, label: selectionLoading, scale: "m", type: "indeterminate" }))) : (h("calcite-icon", { class: "info-blue padding-end-1-2", icon: "feature-layer", scale: "s" })), h("calcite-input-message", { active: true, class: "info-blue", scale: "m" }, this._selectionLoading ? selectionLoading :
335
451
  this.noResultText && this._numSelected === 0 ? this.noResultText :
336
452
  this._translations.selectedAddresses.replace("{{n}}", this._numSelected.toString()).replace("{{layer}}", ((_b = this.addresseeLayer) === null || _b === void 0 ? void 0 : _b.layer.title) || ""))), h("div", { class: "padding-sides-1 " + nameLabelClass }, h("calcite-label", { class: "font-bold" }, "List name", h("calcite-input", { onInput: () => {
337
453
  this.labelChange.emit(this._labelName.value);
@@ -378,7 +494,8 @@ export class PublicNotification {
378
494
  _getDownloadPage(type) {
379
495
  const isPdf = type === EExportType.PDF;
380
496
  const hasSelections = this._hasSelections();
381
- return (h("calcite-panel", null, h("div", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "font-bold" }, isPdf ? this._translations.downloadPDF : this._translations.downloadCSV)), hasSelections ? (h("div", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", null, this._translations.notifications)), this._getSelectionLists(), h("div", { class: "margin-side-1 padding-top-1 border-bottom" }), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: isPdf ? "display-none" : "", layout: "inline" }, h("calcite-checkbox", { disabled: !this._downloadActive, ref: (el) => { this._removeDuplicatesCSV = el; } }), this._translations.removeDuplicate), h("calcite-label", { class: isPdf ? "" : "display-none", layout: "inline" }, h("calcite-checkbox", { disabled: !this._downloadActive, ref: (el) => { this._removeDuplicatesPDF = el; } }), this._translations.removeDuplicate)), h("div", { class: isPdf ? "" : "display-none" }, this._getLabel(this._translations.selectPDFLabelOption, false), h("div", { class: "padding-sides-1" }, h("pdf-download", { disabled: !this._downloadActive, layerView: this.addresseeLayer, ref: (el) => { this._downloadTools = el; } }))), h("div", { class: "padding-1 display-flex" }, h("calcite-button", { disabled: !this._downloadActive, onClick: isPdf ? () => this._downloadPDF() : () => this._downloadCSV(), width: "full" }, isPdf ? this._translations.downloadPDF : this._translations.downloadCSV)))) : (this._getNotice(this._translations.downloadNoLists, "padding-sides-1 padding-bottom-1")))));
497
+ const hasDuplicates = this._hasDuplicates();
498
+ return (h("calcite-panel", null, h("div", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "font-bold" }, isPdf ? this._translations.downloadPDF : this._translations.downloadCSV)), hasSelections ? (h("div", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", null, this._translations.notifications)), this._getSelectionLists(), h("div", { class: "margin-side-1 padding-top-1 border-bottom" }), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: isPdf ? "display-none" : "", disabled: !hasDuplicates, layout: "inline" }, h("calcite-checkbox", { disabled: !hasDuplicates, ref: (el) => { this._removeDuplicatesCSV = el; } }), this._translations.removeDuplicate), h("calcite-label", { class: isPdf ? "" : "display-none", disabled: !hasDuplicates, layout: "inline" }, h("calcite-checkbox", { disabled: !hasDuplicates, ref: (el) => { this._removeDuplicatesPDF = el; } }), this._translations.removeDuplicate)), h("div", { class: isPdf ? "" : "display-none" }, this._getLabel(this._translations.selectPDFLabelOption, false), h("div", { class: "padding-sides-1" }, h("pdf-download", { disabled: !this._downloadActive, layerView: this.addresseeLayer, ref: (el) => { this._downloadTools = el; } }))), h("div", { class: "padding-1 display-flex" }, h("calcite-button", { disabled: !this._downloadActive, onClick: isPdf ? () => this._downloadPDF() : () => this._downloadCSV(), width: "full" }, isPdf ? this._translations.downloadPDF : this._translations.downloadCSV)))) : (this._getNotice(this._translations.downloadNoLists, "padding-sides-1 padding-bottom-1")))));
382
499
  }
383
500
  /**
384
501
  * Create the stacked navigation buttons for a page
@@ -428,7 +545,8 @@ export class PublicNotification {
428
545
  */
429
546
  _getSelectionLists() {
430
547
  return this._selectionSets.reduce((prev, cur) => {
431
- if (cur.workflowType !== EWorkflowType.REFINE) {
548
+ const validSet = this._isValidSet(cur);
549
+ if (validSet) {
432
550
  if (!this._downloadActive && cur.download) {
433
551
  this._downloadActive = true;
434
552
  }
@@ -591,7 +709,7 @@ export class PublicNotification {
591
709
  * @protected
592
710
  */
593
711
  async _updateSelectionSets(layerView) {
594
- const _selectionSets = this._selectionSets.filter(selectionSet => selectionSet.workflowType !== EWorkflowType.REFINE);
712
+ const _selectionSets = this._selectionSets;
595
713
  const oidDefs = [];
596
714
  _selectionSets.forEach(selectionSet => {
597
715
  selectionSet.layerView = layerView;
@@ -675,11 +793,16 @@ export class PublicNotification {
675
793
  */
676
794
  _openSelection(selectionSet, evt) {
677
795
  evt.stopPropagation();
678
- this._activeSelection = selectionSet;
679
- this._distance = this._activeSelection.distance;
680
- this._unit = this._activeSelection.unit;
681
- this._customLabel = this._activeSelection.label;
682
- this._pageType = EPageType.SELECT;
796
+ if (selectionSet.workflowType === EWorkflowType.REFINE) {
797
+ this._pageType = EPageType.REFINE;
798
+ }
799
+ else {
800
+ this._activeSelection = selectionSet;
801
+ this._distance = this._activeSelection.distance;
802
+ this._unit = this._activeSelection.unit;
803
+ this._customLabel = this._activeSelection.label;
804
+ this._pageType = EPageType.SELECT;
805
+ }
683
806
  }
684
807
  /**
685
808
  * Highlight any selected features in the map
@@ -988,6 +1111,69 @@ export class PublicNotification {
988
1111
  "attribute": "show-search-settings",
989
1112
  "reflect": false,
990
1113
  "defaultValue": "true"
1114
+ },
1115
+ "sketchLineSymbol": {
1116
+ "type": "any",
1117
+ "mutable": false,
1118
+ "complexType": {
1119
+ "original": "__esri.SimpleLineSymbol | any",
1120
+ "resolved": "any",
1121
+ "references": {
1122
+ "___esri": {
1123
+ "location": "global"
1124
+ }
1125
+ }
1126
+ },
1127
+ "required": false,
1128
+ "optional": false,
1129
+ "docs": {
1130
+ "tags": [],
1131
+ "text": "esri/symbols/SimpleLineSymbol | JSON representation : https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html\r\n\r\nA JSON representation of the instance in the ArcGIS format.\r\nSee the ArcGIS REST API documentation for examples of the structure of various input JSON objects.\r\nhttps://developers.arcgis.com/documentation/common-data-types/symbol-objects.htm"
1132
+ },
1133
+ "attribute": "sketch-line-symbol",
1134
+ "reflect": false
1135
+ },
1136
+ "sketchPointSymbol": {
1137
+ "type": "any",
1138
+ "mutable": false,
1139
+ "complexType": {
1140
+ "original": "__esri.SimpleMarkerSymbol | any",
1141
+ "resolved": "any",
1142
+ "references": {
1143
+ "___esri": {
1144
+ "location": "global"
1145
+ }
1146
+ }
1147
+ },
1148
+ "required": false,
1149
+ "optional": false,
1150
+ "docs": {
1151
+ "tags": [],
1152
+ "text": "esri/symbols/SimpleMarkerSymbol | JSON representation: https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html\r\n\r\nA JSON representation of the instance in the ArcGIS format.\r\nSee the ArcGIS REST API documentation for examples of the structure of various input JSON objects.\r\nhttps://developers.arcgis.com/documentation/common-data-types/symbol-objects.htm"
1153
+ },
1154
+ "attribute": "sketch-point-symbol",
1155
+ "reflect": false
1156
+ },
1157
+ "sketchPolygonSymbol": {
1158
+ "type": "any",
1159
+ "mutable": false,
1160
+ "complexType": {
1161
+ "original": "__esri.SimpleFillSymbol | any",
1162
+ "resolved": "any",
1163
+ "references": {
1164
+ "___esri": {
1165
+ "location": "global"
1166
+ }
1167
+ }
1168
+ },
1169
+ "required": false,
1170
+ "optional": false,
1171
+ "docs": {
1172
+ "tags": [],
1173
+ "text": "esri/symbols/SimpleFillSymbol | JSON representation: https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html\r\n\r\nA JSON representation of the instance in the ArcGIS format.\r\nSee the ArcGIS REST API documentation for examples of the structure of various input JSON objects.\r\nhttps://developers.arcgis.com/documentation/common-data-types/symbol-objects.htm"
1174
+ },
1175
+ "attribute": "sketch-polygon-symbol",
1176
+ "reflect": false
991
1177
  }
992
1178
  };
993
1179
  }
@@ -1053,8 +1239,14 @@ export class PublicNotification {
1053
1239
  "propName": "searchConfiguration",
1054
1240
  "methodName": "watchSearchConfigurationHandler"
1055
1241
  }, {
1056
- "propName": "_selectionSets",
1057
- "methodName": "selectionSetsWatchHandler"
1242
+ "propName": "sketchLineSymbol",
1243
+ "methodName": "sketchLineSymbolWatchHandler"
1244
+ }, {
1245
+ "propName": "sketchPointSymbol",
1246
+ "methodName": "sketchPointSymbolWatchHandler"
1247
+ }, {
1248
+ "propName": "sketchPolygonSymbol",
1249
+ "methodName": "sketchPolygonSymbolWatchHandler"
1058
1250
  }, {
1059
1251
  "propName": "_pageType",
1060
1252
  "methodName": "pageTypeWatchHandler"
@@ -205,7 +205,7 @@ export class RefineSelectionTools {
205
205
  this._sketchGraphicsLayer = this.mapView.map.layers.getItemAt(sketchIndex);
206
206
  }
207
207
  else {
208
- this._sketchGraphicsLayer = new this.GraphicsLayer({ title });
208
+ this._sketchGraphicsLayer = new this.GraphicsLayer({ title, listMode: "hide" });
209
209
  state.managedLayers.push(title);
210
210
  this.mapView.map.layers.add(this._sketchGraphicsLayer);
211
211
  }
@@ -22,26 +22,9 @@
22
22
  | limitations under the License.
23
23
  -->
24
24
  <style>
25
- #viewDiv {
26
- padding: 0;
27
- margin: 0;
28
- height: 100%;
29
- width: 100%;
30
- }
31
- .over-map {
32
- position: absolute;
33
- right: 0px;
34
- background-color: var(--calcite-ui-foreground-1);
35
- }
36
- .column {
37
- min-width: 300px;
38
- padding: 1rem;
39
- border: 1px solid var(--calcite-ui-border-2);
40
- height: -webkit-fill-available;
41
- height: 100%;
42
- }
43
- .column[dir="rtl"] {
44
- float: left;
25
+ .crowdsource {
26
+ height: 100vh;
27
+ width: 100vw;
45
28
  }
46
29
  </style>
47
30
 
@@ -56,30 +39,20 @@
56
39
  <script type="module" src="../solutions-components.esm.js"></script>
57
40
 
58
41
  <script>
59
- require(["esri/WebMap", "esri/views/MapView"], (
60
- WebMap,
61
- MapView
62
- ) => {
63
- var webMap = new WebMap({
64
- portalItem: {
65
- // solutions
66
- // id: "3715f4899bea4b2a948347c5c2357e58"
67
- // InstantApps
68
- id: "863e4f6f2a7840db896cc1b1606d552d"
69
- }
70
- });
71
-
42
+ function addValues() {
72
43
  const demo = document.getElementById("demo");
73
- demo.mapView = new MapView({
74
- container: "viewDiv",
75
- map: webMap
76
- });
77
- });
44
+ demo.mapInfos = [{
45
+ id: "863e4f6f2a7840db896cc1b1606d552d",
46
+ name: "Name of map 1"
47
+ }, {
48
+ id: "3715f4899bea4b2a948347c5c2357e58",
49
+ name: "Name of map 2"
50
+ }];
51
+ }
78
52
  </script>
79
53
  </head>
80
54
 
81
- <body>
82
- <div id="viewDiv"></div>
83
- <crowdsource-manager id="demo" class="over-map column"></crowdsource-manager>
55
+ <body onload="addValues()">
56
+ <crowdsource-manager id="demo" class="crowdsource"/>
84
57
  </body>
85
58
  </html>
@@ -0,0 +1,41 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ /** @license
7
+ * Copyright 2022 Esri
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+ //#region Public functions
22
+ /**
23
+ * Download the CSV file
24
+ *
25
+ * @param title Title (without file extension) to use for file; defaults to "export"
26
+ * @param outputLines Lines of output to write to file
27
+ *
28
+ * @see {@link https://medium.com/@danny.pule/export-json-to-csv-file-using-javascript-a0b7bc5b00d2}
29
+ */
30
+ export function downloadCSVFile(title, outputLines) {
31
+ const link = document.createElement("a");
32
+ if (link.download !== undefined) {
33
+ link.href = URL.createObjectURL(new Blob(outputLines, { type: "text/csv;charset=utf-8;" }));
34
+ link.download = `${title}.csv` || "export.csv";
35
+ link.style.visibility = "hidden";
36
+ document.body.appendChild(link);
37
+ link.click();
38
+ document.body.removeChild(link);
39
+ }
40
+ }
41
+ //#endregion