@esri/solutions-components 0.4.12 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. package/dist/cjs/buffer-tools_6.cjs.entry.js +6 -9
  2. package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
  3. package/dist/cjs/calcite-input-message_5.cjs.entry.js +17 -15
  4. package/dist/cjs/{downloadUtils-415ab342.js → downloadUtils-b85476e8.js} +2 -2
  5. package/dist/cjs/{index.es-98008aa0.js → index.es-3ba50626.js} +2 -2
  6. package/dist/cjs/layer-table.cjs.entry.js +2 -2
  7. package/dist/cjs/loader.cjs.js +30 -30
  8. package/dist/cjs/{mapViewUtils-f617ae9a.js → mapViewUtils-df63bfa4.js} +2 -2
  9. package/dist/cjs/public-notification.cjs.entry.js +112 -4
  10. package/dist/cjs/solutions-components.cjs.js +31 -31
  11. package/dist/collection/components/map-draw-tools/map-draw-tools.js +5 -8
  12. package/dist/collection/components/map-select-tools/map-select-tools.js +74 -14
  13. package/dist/collection/components/public-notification/public-notification.js +180 -3
  14. package/dist/collection/utils/queryUtils.js +2 -2
  15. package/dist/collection/utils/queryUtils.ts +2 -2
  16. package/dist/components/map-draw-tools2.js +20 -23
  17. package/dist/components/map-select-tools2.js +55 -50
  18. package/dist/components/public-notification.js +171 -60
  19. package/dist/components/queryUtils.js +2 -2
  20. package/dist/esm/buffer-tools_6.entry.js +6 -9
  21. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  22. package/dist/esm/calcite-input-message_5.entry.js +17 -15
  23. package/dist/esm/{downloadUtils-606b0f0e.js → downloadUtils-f278742f.js} +2 -2
  24. package/dist/esm/{index.es-c736c805.js → index.es-6f3a1143.js} +2 -2
  25. package/dist/esm/layer-table.entry.js +2 -2
  26. package/dist/esm/loader.js +26 -26
  27. package/dist/esm/{mapViewUtils-4e945e07.js → mapViewUtils-bd1809f0.js} +2 -2
  28. package/dist/esm/public-notification.entry.js +112 -4
  29. package/dist/esm/solutions-components.js +26 -26
  30. package/dist/solutions-components/{p-72117a18.js → p-03e2c6fd.js} +1 -1
  31. package/dist/solutions-components/{p-5ee7b022.entry.js → p-045d3988.entry.js} +1 -1
  32. package/dist/solutions-components/{p-6a657ff6.js → p-40c12650.js} +2 -2
  33. package/dist/solutions-components/p-70e1d4d8.entry.js +17 -0
  34. package/dist/solutions-components/p-88e5a76d.js +36 -0
  35. package/dist/solutions-components/p-bc39f296.entry.js +6 -0
  36. package/dist/solutions-components/{p-84bbaebf.entry.js → p-c93d8e80.entry.js} +1 -1
  37. package/dist/solutions-components/{p-570b076b.entry.js → p-cbac29fb.entry.js} +2 -2
  38. package/dist/solutions-components/solutions-components.esm.js +1 -1
  39. package/dist/solutions-components/utils/queryUtils.ts +2 -2
  40. package/dist/types/components/map-select-tools/map-select-tools.d.ts +16 -1
  41. package/dist/types/components/public-notification/public-notification.d.ts +70 -0
  42. package/dist/types/components.d.ts +1601 -1553
  43. package/package.json +1 -1
  44. package/dist/solutions-components/p-308e24cc.entry.js +0 -6
  45. package/dist/solutions-components/p-88e28de2.js +0 -36
  46. package/dist/solutions-components/p-ac76d270.entry.js +0 -17
@@ -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;
@@ -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;
@@ -77,6 +80,9 @@ export class PublicNotification {
77
80
  if (s_newValue !== JSON.stringify(oldValue)) {
78
81
  this._searchConfiguration = JSON.parse(s_newValue);
79
82
  this.searchConfigurationChange.emit(this._searchConfiguration);
83
+ // force back to list page before we create Search
84
+ // https://devtopia.esri.com/WebGIS/arcgis-template-configuration/issues/3402
85
+ void this._home();
80
86
  }
81
87
  }
82
88
  /**
@@ -90,6 +96,30 @@ export class PublicNotification {
90
96
  }
91
97
  }
92
98
  }
99
+ /**
100
+ * Called each time the sketchLineSymbol prop is changed.
101
+ */
102
+ async sketchLineSymbolWatchHandler(v, oldV) {
103
+ if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
104
+ this._setLineSymbol(v);
105
+ }
106
+ }
107
+ /**
108
+ * Called each time the sketchPointSymbol prop is changed.
109
+ */
110
+ async sketchPointSymbolWatchHandler(v, oldV) {
111
+ if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
112
+ this._setPointSymbol(v);
113
+ }
114
+ }
115
+ /**
116
+ * Called each time the sketchPolygonSymbol prop is changed.
117
+ */
118
+ async sketchPolygonSymbolWatchHandler(v, oldV) {
119
+ if (v && JSON.stringify(v) !== JSON.stringify(oldV)) {
120
+ this._setPolygonSymbol(v);
121
+ }
122
+ }
93
123
  /**
94
124
  * Called each time the pageType prop is changed.
95
125
  */
@@ -147,6 +177,7 @@ export class PublicNotification {
147
177
  async componentWillLoad() {
148
178
  await this._getTranslations();
149
179
  await this._initModules();
180
+ this._initSymbols();
150
181
  }
151
182
  /**
152
183
  * Renders the component.
@@ -167,10 +198,84 @@ export class PublicNotification {
167
198
  * @protected
168
199
  */
169
200
  async _initModules() {
170
- const [geometryEngine] = await loadModules([
171
- "esri/geometry/geometryEngine"
201
+ const [geometryEngine, jsonUtils] = await loadModules([
202
+ "esri/geometry/geometryEngine",
203
+ "esri/symbols/support/jsonUtils"
172
204
  ]);
173
205
  this._geometryEngine = geometryEngine;
206
+ this._jsonUtils = jsonUtils;
207
+ }
208
+ /**
209
+ * Initialize the default symbols that will be used when creating new graphics
210
+ *
211
+ * @protected
212
+ */
213
+ _initSymbols() {
214
+ this._setLineSymbol(this.sketchLineSymbol);
215
+ this._setPointSymbol(this.sketchPointSymbol);
216
+ this._setPolygonSymbol(this.sketchPolygonSymbol);
217
+ }
218
+ /**
219
+ * Convert a JSON representation of a line symbol and/or set the line symbol
220
+ *
221
+ * @param v SimpleLineSymbol or a JSON representation of a line symbol
222
+ *
223
+ * @protected
224
+ */
225
+ _setLineSymbol(v) {
226
+ const isSymbol = (v === null || v === void 0 ? void 0 : v.type) === 'simple-line';
227
+ this.sketchLineSymbol = isSymbol ? v : this._jsonUtils.fromJSON(v ? v : {
228
+ "type": "esriSLS",
229
+ "color": [130, 130, 130, 255],
230
+ "width": 2,
231
+ "style": "esriSLSSolid"
232
+ });
233
+ }
234
+ /**
235
+ * Convert a JSON representation of a point symbol and/or set the point symbol
236
+ *
237
+ * @param v SimpleMarkerSymbol or a JSON representation of a point symbol
238
+ *
239
+ * @protected
240
+ */
241
+ _setPointSymbol(v) {
242
+ const isSymbol = (v === null || v === void 0 ? void 0 : v.type) === 'simple-marker';
243
+ this.sketchPointSymbol = isSymbol ? v : this._jsonUtils.fromJSON(v ? v : {
244
+ "type": "esriSMS",
245
+ "color": [255, 255, 255, 255],
246
+ "angle": 0,
247
+ "xoffset": 0,
248
+ "yoffset": 0,
249
+ "size": 6,
250
+ "style": "esriSMSCircle",
251
+ "outline": {
252
+ "type": "esriSLS",
253
+ "color": [50, 50, 50, 255],
254
+ "width": 1,
255
+ "style": "esriSLSSolid"
256
+ }
257
+ });
258
+ }
259
+ /**
260
+ * Convert a JSON representation of a polygon symbol and/or set the polygon symbol
261
+ *
262
+ * @param v SimpleFillSymbol or a JSON representation of a polygon symbol
263
+ *
264
+ * @protected
265
+ */
266
+ _setPolygonSymbol(v) {
267
+ const isSymbol = (v === null || v === void 0 ? void 0 : v.type) === 'simple-fill';
268
+ this.sketchPolygonSymbol = isSymbol ? v : this._jsonUtils.fromJSON(v ? v : {
269
+ "type": "esriSFS",
270
+ "color": [150, 150, 150, 51],
271
+ "outline": {
272
+ "type": "esriSLS",
273
+ "color": [50, 50, 50, 255],
274
+ "width": 2,
275
+ "style": "esriSLSSolid"
276
+ },
277
+ "style": "esriSFSSolid"
278
+ });
174
279
  }
175
280
  /**
176
281
  * Get a calcite action group for the current action
@@ -328,7 +433,7 @@ export class PublicNotification {
328
433
  const locale = getComponentClosestLanguage(this.el);
329
434
  const selectionLoading = locale && locale === "en" ?
330
435
  `${this._translations.selectionLoading}...` : this._translations.selectionLoading;
331
- 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 :
436
+ 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 :
332
437
  this.noResultText && this._numSelected === 0 ? this.noResultText :
333
438
  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: () => {
334
439
  this.labelChange.emit(this._labelName.value);
@@ -985,6 +1090,69 @@ export class PublicNotification {
985
1090
  "attribute": "show-search-settings",
986
1091
  "reflect": false,
987
1092
  "defaultValue": "true"
1093
+ },
1094
+ "sketchLineSymbol": {
1095
+ "type": "any",
1096
+ "mutable": false,
1097
+ "complexType": {
1098
+ "original": "__esri.SimpleLineSymbol | any",
1099
+ "resolved": "any",
1100
+ "references": {
1101
+ "___esri": {
1102
+ "location": "global"
1103
+ }
1104
+ }
1105
+ },
1106
+ "required": false,
1107
+ "optional": false,
1108
+ "docs": {
1109
+ "tags": [],
1110
+ "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"
1111
+ },
1112
+ "attribute": "sketch-line-symbol",
1113
+ "reflect": false
1114
+ },
1115
+ "sketchPointSymbol": {
1116
+ "type": "any",
1117
+ "mutable": false,
1118
+ "complexType": {
1119
+ "original": "__esri.SimpleMarkerSymbol | 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/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"
1132
+ },
1133
+ "attribute": "sketch-point-symbol",
1134
+ "reflect": false
1135
+ },
1136
+ "sketchPolygonSymbol": {
1137
+ "type": "any",
1138
+ "mutable": false,
1139
+ "complexType": {
1140
+ "original": "__esri.SimpleFillSymbol | 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/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"
1153
+ },
1154
+ "attribute": "sketch-polygon-symbol",
1155
+ "reflect": false
988
1156
  }
989
1157
  };
990
1158
  }
@@ -1052,6 +1220,15 @@ export class PublicNotification {
1052
1220
  }, {
1053
1221
  "propName": "_selectionSets",
1054
1222
  "methodName": "selectionSetsWatchHandler"
1223
+ }, {
1224
+ "propName": "sketchLineSymbol",
1225
+ "methodName": "sketchLineSymbolWatchHandler"
1226
+ }, {
1227
+ "propName": "sketchPointSymbol",
1228
+ "methodName": "sketchPointSymbolWatchHandler"
1229
+ }, {
1230
+ "propName": "sketchPolygonSymbol",
1231
+ "methodName": "sketchPolygonSymbolWatchHandler"
1055
1232
  }, {
1056
1233
  "propName": "_pageType",
1057
1234
  "methodName": "pageTypeWatchHandler"
@@ -51,7 +51,7 @@ export async function queryAllFeatures(start, layer, graphics) {
51
51
  */
52
52
  export async function queryObjectIds(geometries, layer) {
53
53
  let ids = [];
54
- const queryDefs = geometries.map(g => _intersectQuery(g, layer));
54
+ const queryDefs = geometries ? geometries.map(g => _intersectQuery(g, layer)) : [Promise.resolve()];
55
55
  const results = await Promise.all(queryDefs);
56
56
  results.forEach(resultIds => {
57
57
  ids = [
@@ -157,7 +157,7 @@ export function getSelectionSetQuery(selectionSet, geometryEngine) {
157
157
  * @returns Array of single unioned geometry for the provided geometry type
158
158
  */
159
159
  function _unionGeoms(geometries, type, geometryEngine) {
160
- const geoms = geometries.filter(g => g.type === type);
160
+ const geoms = (geometries === null || geometries === void 0 ? void 0 : geometries.filter(g => g.type === type)) || [];
161
161
  return geoms.length <= 1 ? geoms : [geometryEngine.union(geoms)];
162
162
  }
163
163
  /**
@@ -61,7 +61,7 @@ export async function queryObjectIds(
61
61
  layer: __esri.FeatureLayer
62
62
  ): Promise<number[]> {
63
63
  let ids = [];
64
- const queryDefs = geometries.map(g => _intersectQuery(g, layer))
64
+ const queryDefs = geometries ? geometries.map(g => _intersectQuery(g, layer)) : [Promise.resolve()];
65
65
  const results = await Promise.all(queryDefs);
66
66
  results.forEach(resultIds => {
67
67
  ids = [
@@ -206,7 +206,7 @@ export function getSelectionSetQuery(
206
206
  type: string,
207
207
  geometryEngine: __esri.geometryEngine
208
208
  ): __esri.Geometry[] {
209
- const geoms = geometries.filter(g => g.type === type);
209
+ const geoms = geometries?.filter(g => g.type === type) || [];
210
210
  return geoms.length <= 1 ? geoms : [geometryEngine.union(geoms)];
211
211
  }
212
212
 
@@ -1,15 +1,15 @@
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
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
- import { l as loadModules } from './loadModules.js';
8
- import { s as state } from './publicNotificationStore.js';
9
- import { g as getLocaleComponentStrings } from './locale.js';
10
-
11
- const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}";
12
-
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
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
+ import { l as loadModules } from './loadModules.js';
8
+ import { s as state } from './publicNotificationStore.js';
9
+ import { g as getLocaleComponentStrings } from './locale.js';
10
+
11
+ const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}";
12
+
13
13
  const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
14
14
  constructor() {
15
15
  super();
@@ -156,9 +156,9 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
156
156
  "mode": "hybrid"
157
157
  }
158
158
  });
159
- this.pointSymbol = this._sketchWidget.viewModel.pointSymbol;
160
- this.polylineSymbol = this._sketchWidget.viewModel.polylineSymbol;
161
- this.polygonSymbol = this._sketchWidget.viewModel.polygonSymbol;
159
+ this._sketchWidget.viewModel.polylineSymbol = this.polylineSymbol;
160
+ this._sketchWidget.viewModel.pointSymbol = this.pointSymbol;
161
+ this._sketchWidget.viewModel.polygonSymbol = this.polygonSymbol;
162
162
  this._sketchWidget.visibleElements = {
163
163
  selectionTools: {
164
164
  "lasso-selection": false,
@@ -169,10 +169,6 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
169
169
  undoRedoMenu: false
170
170
  };
171
171
  this._sketchWidget.on("update", (evt) => {
172
- if (evt.state === "start") {
173
- this.graphics = evt.graphics;
174
- this.sketchGraphicsChange.emit(this.graphics);
175
- }
176
172
  if (evt.state === "active") {
177
173
  clearTimeout(this._selectionTimer);
178
174
  this._selectionTimer = setTimeout(() => {
@@ -206,8 +202,9 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
206
202
  * @protected
207
203
  */
208
204
  _clearSketch() {
205
+ var _a;
209
206
  this.graphics = [];
210
- this._sketchGraphicsLayer.removeAll();
207
+ (_a = this._sketchGraphicsLayer) === null || _a === void 0 ? void 0 : _a.removeAll();
211
208
  }
212
209
  /**
213
210
  * Fetches the component's translations
@@ -248,6 +245,6 @@ function defineCustomElement() {
248
245
  break;
249
246
  } });
250
247
  }
251
- defineCustomElement();
252
-
253
- export { MapDrawTools as M, defineCustomElement as d };
248
+ defineCustomElement();
249
+
250
+ export { MapDrawTools as M, defineCustomElement as d };