@esri/solutions-components 0.3.8 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/cjs/buffer-tools_6.cjs.entry.js +37 -33
  2. package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
  3. package/dist/cjs/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-d5d5499f.js → calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-da276a1c.js} +112 -32
  4. package/dist/cjs/calcite-input-message_5.cjs.entry.js +2 -2
  5. package/dist/cjs/{index.es-43f519b3.js → index.es-176629d8.js} +2 -2
  6. package/dist/cjs/layer-table.cjs.entry.js +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{mapViewUtils-24d1d859.js → mapViewUtils-d250b1ed.js} +11 -6
  9. package/dist/cjs/public-notification.cjs.entry.js +24 -11
  10. package/dist/cjs/solutions-components.cjs.js +1 -1
  11. package/dist/collection/components/buffer-tools/buffer-tools.js +22 -20
  12. package/dist/collection/components/map-select-tools/map-select-tools.js +78 -13
  13. package/dist/collection/components/pdf-download/pdf-download.js +9 -19
  14. package/dist/collection/components/public-notification/public-notification.js +44 -30
  15. package/dist/collection/components/refine-selection/refine-selection.js +34 -14
  16. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +47 -21
  17. package/dist/collection/demos/buffer-tools.html +1 -1
  18. package/dist/collection/demos/new-public-notification.html +1 -11
  19. package/dist/collection/utils/interfaces.ts +8 -0
  20. package/dist/collection/utils/mapViewUtils.js +11 -6
  21. package/dist/collection/utils/mapViewUtils.ts +11 -6
  22. package/dist/components/buffer-tools2.js +19 -16
  23. package/dist/components/map-layer-picker2.js +11 -6
  24. package/dist/components/map-select-tools2.js +72 -15
  25. package/dist/components/pdf-download2.js +9 -4
  26. package/dist/components/public-notification.js +23 -11
  27. package/dist/components/refine-selection-tools2.js +20 -18
  28. package/dist/components/refine-selection2.js +32 -15
  29. package/dist/esm/buffer-tools_6.entry.js +37 -33
  30. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  31. package/dist/esm/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-b60306b8.js → calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-c6f63458.js} +112 -32
  32. package/dist/esm/calcite-input-message_5.entry.js +2 -2
  33. package/dist/esm/{index.es-4a2bee8f.js → index.es-54a6f3a3.js} +2 -2
  34. package/dist/esm/layer-table.entry.js +1 -1
  35. package/dist/esm/loader.js +1 -1
  36. package/dist/esm/{mapViewUtils-c2fb048d.js → mapViewUtils-63e118f8.js} +11 -6
  37. package/dist/esm/public-notification.entry.js +24 -11
  38. package/dist/esm/solutions-components.js +1 -1
  39. package/dist/solutions-components/demos/buffer-tools.html +1 -1
  40. package/dist/solutions-components/demos/new-public-notification.html +1 -11
  41. package/dist/solutions-components/{p-21ae3f97.entry.js → p-117174e8.entry.js} +1 -1
  42. package/dist/solutions-components/{p-1b7c13f8.js → p-1e459361.js} +1 -1
  43. package/dist/solutions-components/{p-b4be1c30.entry.js → p-6d28f991.entry.js} +1 -1
  44. package/dist/solutions-components/{p-547cbe8a.js → p-80f5e33c.js} +12 -12
  45. package/dist/solutions-components/{p-c5f670fb.entry.js → p-8927862a.entry.js} +1 -1
  46. package/dist/solutions-components/{p-709c3f22.entry.js → p-8a0c0935.entry.js} +2 -2
  47. package/dist/solutions-components/p-cc2e20c8.js +36 -0
  48. package/dist/solutions-components/p-e69c58e5.entry.js +6 -0
  49. package/dist/solutions-components/solutions-components.esm.js +1 -1
  50. package/dist/solutions-components/utils/interfaces.ts +8 -0
  51. package/dist/solutions-components/utils/mapViewUtils.ts +11 -6
  52. package/dist/types/components/buffer-tools/buffer-tools.d.ts +2 -2
  53. package/dist/types/components/map-select-tools/map-select-tools.d.ts +19 -1
  54. package/dist/types/components/pdf-download/pdf-download.d.ts +0 -5
  55. package/dist/types/components/public-notification/public-notification.d.ts +11 -6
  56. package/dist/types/components/refine-selection/refine-selection.d.ts +6 -4
  57. package/dist/types/components/refine-selection-tools/refine-selection-tools.d.ts +6 -10
  58. package/dist/types/components.d.ts +24 -28
  59. package/dist/types/preact.d.ts +2 -1
  60. package/dist/types/utils/interfaces.d.ts +7 -0
  61. package/package.json +1 -1
  62. package/dist/solutions-components/p-b47d1a9a.entry.js +0 -6
  63. package/dist/solutions-components/p-cd7606eb.js +0 -36
@@ -39,8 +39,10 @@ import { d as defineCustomElement$1 } from './select.js';
39
39
  async function getMapLayerHash(mapView) {
40
40
  let layerHash = {};
41
41
  await mapView.when(() => {
42
- layerHash = mapView.map.layers.toArray().reduce((prev, cur) => {
43
- prev[cur.id] = cur.title;
42
+ layerHash = mapView.map.allLayers.toArray().reduce((prev, cur) => {
43
+ if (cur.type === "feature") {
44
+ prev[cur.id] = cur.title;
45
+ }
44
46
  return prev;
45
47
  }, {});
46
48
  });
@@ -57,9 +59,12 @@ async function getMapLayerHash(mapView) {
57
59
  async function getMapLayerIds(mapView) {
58
60
  let layerIds = [];
59
61
  await mapView.when(() => {
60
- layerIds = mapView.map.layers.toArray().map((l) => {
61
- return l.id;
62
- });
62
+ layerIds = mapView.map.allLayers.toArray().reduce((prev, cur) => {
63
+ if (cur.type === "feature") {
64
+ prev.push(cur.id);
65
+ }
66
+ return prev;
67
+ }, []);
63
68
  });
64
69
  return layerIds;
65
70
  }
@@ -88,7 +93,7 @@ async function getMapLayerView(mapView, id) {
88
93
  async function getMapLayer(mapView, id) {
89
94
  let layers = [];
90
95
  await mapView.when(() => {
91
- layers = mapView.map.layers.toArray().filter((l) => {
96
+ layers = mapView.map.allLayers.toArray().filter((l) => {
92
97
  return l.id === id;
93
98
  });
94
99
  });
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
7
  import { l as loadModules } from './loadModules.js';
8
- import { g as goToSelection, h as highlightFeatures, d as defineCustomElement$2 } from './map-layer-picker2.js';
8
+ import { h as highlightFeatures, g as goToSelection, d as defineCustomElement$2 } from './map-layer-picker2.js';
9
9
  import { c as queryObjectIds, d as getQueryGeoms } from './queryUtils.js';
10
10
  import { c as EWorkflowType, e as ESelectionMode, f as ERefineMode, b as ESketchType } from './interfaces3.js';
11
11
  import { s as state } from './publicNotificationStore.js';
@@ -47,6 +47,12 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
47
47
  * string: A label to help uniquely identify the selection set
48
48
  */
49
49
  this._selectionLabel = "";
50
+ /**
51
+ * boolean: When false the geometries will be used for selection
52
+ * When true a list of OIDs will be used
53
+ * see https://github.com/Esri/solutions-components/issues/148
54
+ */
55
+ this._skipGeomQuery = false;
50
56
  this.bufferColor = [227, 139, 79, 0.8];
51
57
  this.bufferOutlineColor = [255, 255, 255];
52
58
  this.enabledLayerIds = [];
@@ -77,13 +83,33 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
77
83
  async watchGeometriesHandler(newValue, oldValue) {
78
84
  if (newValue !== oldValue) {
79
85
  if (newValue.length > 0) {
80
- return this._geomQuery(this.geometries);
86
+ if (this._skipGeomQuery) {
87
+ void highlightFeatures(this._selectedIds, this.selectLayerView, this.mapView);
88
+ }
89
+ else {
90
+ return this._geomQuery(this.geometries);
91
+ }
81
92
  }
82
93
  else if (newValue.length === 0) {
83
94
  return this._clearResults(true, true);
84
95
  }
85
96
  }
86
97
  }
98
+ /**
99
+ * Called each time the searchConfiguration prop is changed.
100
+ *
101
+ * @returns Promise when complete
102
+ */
103
+ async watchSearchConfigurationHandler(newValue, oldValue) {
104
+ console.log("watchSearchConfigurationHandler");
105
+ console.log("newValue");
106
+ console.log(newValue);
107
+ console.log("oldValue");
108
+ console.log(oldValue);
109
+ if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
110
+ this._initSearchWidget();
111
+ }
112
+ }
87
113
  /**
88
114
  * Called each time the workflowType prop is changed and emits the workflowTypeChange event.
89
115
  *
@@ -132,7 +158,8 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
132
158
  selectedIds: this._selectedIds,
133
159
  layerView: this.selectLayerView,
134
160
  geometries: this.geometries,
135
- refineSelectLayers: this._refineTools.layerViews
161
+ refineSelectLayers: this._refineTools.layerViews,
162
+ skipGeomQuery: this._skipGeomQuery
136
163
  };
137
164
  }
138
165
  /**
@@ -141,22 +168,28 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
141
168
  labelChange(event) {
142
169
  this._selectionLabel = event.detail;
143
170
  }
171
+ /**
172
+ * Handle changes to the search configuration
173
+ */
174
+ searchConfigurationChangeChanged(event) {
175
+ this.searchConfiguration = event.detail;
176
+ }
144
177
  /**
145
178
  * Listen to changes in the sketch graphics
146
179
  *
147
180
  */
148
181
  sketchGraphicsChange(event) {
149
- this._updateSelection(EWorkflowType.SKETCH, event.detail, this._selectionLabel || this._translations.sketch);
182
+ this._updateSelection(EWorkflowType.SKETCH, event.detail, this._selectionLabel || this._translations.sketch, true);
150
183
  }
151
184
  /**
152
185
  * Listen to changes in the refine graphics
153
186
  *
154
187
  */
155
188
  refineSelectionGraphicsChange(event) {
156
- const graphics = event.detail;
157
- this._updateSelection(EWorkflowType.SELECT, graphics, this._selectionLabel || this._translations.select);
158
- // Using OIDs to avoid issue with points
189
+ const graphics = event.detail.graphics;
190
+ this._skipGeomQuery = event.detail.useOIDs;
159
191
  const oids = Array.isArray(graphics) ? graphics.map(g => g.attributes[g.layer.objectIdField]) : [];
192
+ this._updateSelection(EWorkflowType.SELECT, graphics, this._selectionLabel || this._translations.select, !event.detail.useOIDs, oids);
160
193
  return this._highlightFeatures(oids);
161
194
  }
162
195
  //--------------------------------------------------------------------------
@@ -189,7 +222,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
189
222
  const useSelectClass = this._layerSelectChecked && !searchEnabled ? " div-visible" : " div-not-visible";
190
223
  const useDrawClass = !this._layerSelectChecked && !searchEnabled ? " div-visible" : " div-not-visible";
191
224
  const showLayerChoiceClass = searchEnabled ? "div-not-visible" : "div-visible";
192
- 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: ((_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.workflowType) === EWorkflowType.SELECT, 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, 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: ((_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.distance) || this.defaultBufferDistance, geometries: this.geometries, onBufferComplete: (evt) => this._bufferComplete(evt), ref: (el) => this._bufferTools = el, unit: ((_c = this.selectionSet) === null || _c === void 0 ? void 0 : _c.unit) || this.defaultBufferUnit })), h("slot", null)));
225
+ 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: ((_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.workflowType) === EWorkflowType.SELECT, 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: ((_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.distance) || this.defaultBufferDistance, geometries: this.geometries, onBufferComplete: (evt) => this._bufferComplete(evt), ref: (el) => this._bufferTools = el, unit: ((_c = this.selectionSet) === null || _c === void 0 ? void 0 : _c.unit) || this.defaultBufferUnit })), h("slot", null)));
193
226
  }
194
227
  //--------------------------------------------------------------------------
195
228
  //
@@ -233,17 +266,19 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
233
266
  * @protected
234
267
  */
235
268
  _initSelectionSet() {
236
- var _a, _b, _c, _d, _e, _f, _g;
269
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
237
270
  if (this.selectionSet) {
238
271
  this._searchTerm = (_b = (_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.searchResult) === null || _b === void 0 ? void 0 : _b.name;
239
272
  this._workflowType = (_c = this.selectionSet) === null || _c === void 0 ? void 0 : _c.workflowType;
240
273
  this._searchResult = (_d = this.selectionSet) === null || _d === void 0 ? void 0 : _d.searchResult;
241
274
  this._refineSelectLayers = (_e = this.selectionSet) === null || _e === void 0 ? void 0 : _e.refineSelectLayers;
275
+ this._selectedIds = (_f = this.selectionSet) === null || _f === void 0 ? void 0 : _f.selectedIds;
276
+ this._skipGeomQuery = (_g = this.selectionSet) === null || _g === void 0 ? void 0 : _g.skipGeomQuery;
242
277
  this.geometries = [
243
- ...(_f = this.selectionSet) === null || _f === void 0 ? void 0 : _f.geometries
278
+ ...((_h = this.selectionSet) === null || _h === void 0 ? void 0 : _h.geometries) || []
244
279
  ];
245
280
  // reset selection label base
246
- this._selectionLabel = ((_g = this.selectionSet) === null || _g === void 0 ? void 0 : _g.label) || this._getSelectionBaseLabel();
281
+ this._selectionLabel = ((_j = this.selectionSet) === null || _j === void 0 ? void 0 : _j.label) || this._getSelectionBaseLabel();
247
282
  void goToSelection(this.selectionSet.selectedIds, this.selectionSet.layerView, this.mapView, false);
248
283
  }
249
284
  else {
@@ -268,8 +303,16 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
268
303
  * @protected
269
304
  */
270
305
  _initSearchWidget() {
306
+ console.log("_initSearchWidget");
307
+ console.log("this.mapView");
308
+ console.log(this.mapView);
309
+ console.log("this._searchElement");
310
+ console.log(this._searchElement);
271
311
  if (this.mapView && this._searchElement) {
312
+ console.log("this._getSearchConfig");
272
313
  const searchConfiguration = this._getSearchConfig(this.searchConfiguration, this.mapView);
314
+ console.log("searchConfiguration");
315
+ console.log(searchConfiguration);
273
316
  const searchOptions = Object.assign({ view: this.mapView, container: this._searchElement, searchTerm: this._searchTerm }, searchConfiguration);
274
317
  this._searchWidget = new this.Search(searchOptions);
275
318
  this._searchWidget.on("search-clear", () => {
@@ -280,9 +323,10 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
280
323
  void this._clearResults(false);
281
324
  if (searchResults.result) {
282
325
  this._searchResult = searchResults.result;
283
- this._updateSelection(EWorkflowType.SEARCH, [searchResults.result.feature], (_a = searchResults === null || searchResults === void 0 ? void 0 : searchResults.result) === null || _a === void 0 ? void 0 : _a.name);
326
+ this._updateSelection(EWorkflowType.SEARCH, [searchResults.result.feature], (_a = searchResults === null || searchResults === void 0 ? void 0 : searchResults.result) === null || _a === void 0 ? void 0 : _a.name, true);
284
327
  }
285
328
  });
329
+ console.log("END search widget init");
286
330
  }
287
331
  }
288
332
  /**
@@ -408,6 +452,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
408
452
  * @protected
409
453
  */
410
454
  async _bufferComplete(evt) {
455
+ var _a, _b;
411
456
  this._bufferGeometry = Array.isArray(evt.detail) ?
412
457
  evt.detail[0] : evt.detail;
413
458
  if (this._bufferGeometry) {
@@ -434,7 +479,13 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
434
479
  if (this._bufferGraphicsLayer) {
435
480
  this._bufferGraphicsLayer.removeAll();
436
481
  }
437
- void this._geomQuery(this.geometries);
482
+ if (this._skipGeomQuery || ((_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.skipGeomQuery)) {
483
+ this._selectedIds = (_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.selectedIds;
484
+ void this._highlightFeatures(this._selectedIds);
485
+ }
486
+ else {
487
+ void this._geomQuery(this.geometries);
488
+ }
438
489
  }
439
490
  }
440
491
  /**
@@ -482,10 +533,15 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
482
533
  * @param type worflow type
483
534
  * @param graphics graphics to be used for selection
484
535
  * @param label selection label
536
+ * @param useGeoms indicates if the geometries should be used directly for selections
537
+ * @param oids list of IDs to select when useGeoms is false
485
538
  *
486
539
  * @protected
487
540
  */
488
- _updateSelection(type, graphics, label) {
541
+ _updateSelection(type, graphics, label, useGeoms, oids) {
542
+ this._selectedIds = oids ? oids : this._selectedIds;
543
+ // see https://github.com/Esri/solutions-components/issues/148
544
+ this._skipGeomQuery = !useGeoms;
489
545
  this.geometries = Array.isArray(graphics) ? graphics.map(g => g.geometry) : this.geometries;
490
546
  this._workflowType = type;
491
547
  this._selectionLabel = label;
@@ -502,6 +558,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
502
558
  get el() { return this; }
503
559
  static get watchers() { return {
504
560
  "geometries": ["watchGeometriesHandler"],
561
+ "searchConfiguration": ["watchSearchConfigurationHandler"],
505
562
  "_workflowType": ["workflowTypeHandler"]
506
563
  }; }
507
564
  static get style() { return mapSelectToolsCss; }
@@ -524,7 +581,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
524
581
  "_workflowType": [32],
525
582
  "clearSelection": [64],
526
583
  "getSelection": [64]
527
- }, [[8, "labelChange", "labelChange"], [8, "sketchGraphicsChange", "sketchGraphicsChange"], [8, "refineSelectionGraphicsChange", "refineSelectionGraphicsChange"]]]);
584
+ }, [[8, "labelChange", "labelChange"], [8, "searchConfigurationChange", "searchConfigurationChangeChanged"], [8, "sketchGraphicsChange", "sketchGraphicsChange"], [8, "refineSelectionGraphicsChange", "refineSelectionGraphicsChange"]]]);
528
585
  function defineCustomElement() {
529
586
  if (typeof customElements === "undefined") {
530
587
  return;
@@ -2262,7 +2262,6 @@ const PdfDownload = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
2262
2262
  this.__registerHost();
2263
2263
  this.__attachShadow();
2264
2264
  this.disabled = false;
2265
- this.enabledSizeValues = [];
2266
2265
  this.layerView = undefined;
2267
2266
  this._translations = undefined;
2268
2267
  }
@@ -2352,8 +2351,15 @@ const PdfDownload = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
2352
2351
  _convertPopupToLabelSpec(popupInfo) {
2353
2352
  // Replace <br>, <br/> with |
2354
2353
  popupInfo = popupInfo.replace(/<br\s*\/?>/gi, "|");
2355
- // Remove remaining HTML tags and replace 0xA0 that popup uses for spaces
2356
- let labelSpec = popupInfo.replace(/<[\s.]*[^<>]*\/?>/gi, "").replace(/\xA0/gi, " ").split("|");
2354
+ // Remove remaining HTML tags, replace 0xA0 that popup uses for spaces, replace some char representations,
2355
+ // and split the label back into individual lines
2356
+ let labelSpec = popupInfo
2357
+ .replace(/<[\s.]*[^<>]*\/?>/gi, "")
2358
+ .replace(/\xA0/gi, " ")
2359
+ .replace(/&lt;/gi, "<")
2360
+ .replace(/&gt;/gi, ">")
2361
+ .replace(/&nbsp;/gi, " ")
2362
+ .split("|");
2357
2363
  // Trim lines and remove empties
2358
2364
  labelSpec = labelSpec.map(line => line.trim()).filter(line => line.length > 0);
2359
2365
  return labelSpec;
@@ -2444,7 +2450,6 @@ const PdfDownload = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
2444
2450
  static get style() { return pdfDownloadCss; }
2445
2451
  }, [1, "pdf-download", {
2446
2452
  "disabled": [4],
2447
- "enabledSizeValues": [16],
2448
2453
  "layerView": [16],
2449
2454
  "_translations": [32],
2450
2455
  "downloadCSV": [64],
@@ -54,13 +54,13 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
54
54
  super();
55
55
  this.__registerHost();
56
56
  this.labelChange = createEvent(this, "labelChange", 7);
57
+ this.searchConfigurationChange = createEvent(this, "searchConfigurationChange", 7);
57
58
  this.addresseeLayerIds = [];
58
59
  this.bufferColor = [227, 139, 79, 0.8];
59
60
  this.bufferOutlineColor = [255, 255, 255];
60
61
  this.customLabelEnabled = undefined;
61
62
  this.defaultBufferDistance = undefined;
62
63
  this.defaultBufferUnit = undefined;
63
- this.exportOptions = undefined;
64
64
  this.featureEffect = undefined;
65
65
  this.featureHighlightEnabled = undefined;
66
66
  this.mapView = undefined;
@@ -93,6 +93,25 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
93
93
  this._popupsEnabled = v === null || v === void 0 ? void 0 : v.popup.autoOpenEnabled;
94
94
  }
95
95
  }
96
+ /**
97
+ * Called each time the searchConfiguration prop is changed.
98
+ *
99
+ * @returns Promise when complete
100
+ */
101
+ async watchSearchConfigurationHandler(newValue, oldValue) {
102
+ //TODO adding this here to see if its any different than having in map-select-tools
103
+ // I would have thought that the prop would have made it through on the next render of map-select-tools
104
+ // however we are still seeing a broken search...need to understand why and don't see a clean way to debug in devext
105
+ console.log("PN watchSearchConfigurationHandler");
106
+ console.log("PN newValue");
107
+ console.log(newValue);
108
+ console.log("PN oldValue");
109
+ console.log(oldValue);
110
+ if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
111
+ console.log("Emit event from parent");
112
+ this.searchConfigurationChange.emit(newValue);
113
+ }
114
+ }
96
115
  /**
97
116
  * Called each time the selectionSets prop is changed.
98
117
  */
@@ -160,13 +179,8 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
160
179
  * Renders the component.
161
180
  */
162
181
  render() {
163
- var _a, _b, _c, _d, _e, _f;
164
182
  const hasSelections = this._selectionSets.length > 0;
165
- const csvEnabled = typeof ((_b = (_a = this.exportOptions) === null || _a === void 0 ? void 0 : _a.csvOptions) === null || _b === void 0 ? void 0 : _b.enabled) === "boolean" ?
166
- (_c = this.exportOptions) === null || _c === void 0 ? void 0 : _c.csvOptions.enabled : true;
167
- const pdfEnabled = typeof ((_e = (_d = this.exportOptions) === null || _d === void 0 ? void 0 : _d.pdfOptions) === null || _e === void 0 ? void 0 : _e.enabled) === "boolean" ?
168
- (_f = this.exportOptions) === null || _f === void 0 ? void 0 : _f.pdfOptions.enabled : true;
169
- return (h(Host, null, h("calcite-shell", null, h("calcite-action-bar", { class: "border-bottom-1 action-bar-size", "expand-disabled": true, layout: "horizontal", slot: "header" }, this._getActionGroup("list-check", false, EPageType.LIST, this._translations.myLists), this.showRefineSelection ? this._getActionGroup("test-data", !hasSelections, EPageType.REFINE, this._translations.refineSelection) : undefined, pdfEnabled ? this._getActionGroup("file-pdf", !hasSelections, EPageType.PDF, this._translations.downloadPDF) : undefined, csvEnabled ? this._getActionGroup("file-csv", !hasSelections, EPageType.CSV, this._translations.downloadCSV) : undefined), this._getPage(this._pageType))));
183
+ return (h(Host, null, h("calcite-shell", null, h("calcite-action-bar", { class: "border-bottom-1 action-bar-size", "expand-disabled": true, layout: "horizontal", slot: "header" }, this._getActionGroup("list-check", false, EPageType.LIST, this._translations.myLists), this.showRefineSelection ? this._getActionGroup("test-data", !hasSelections, EPageType.REFINE, this._translations.refineSelection) : undefined, this._getActionGroup("file-pdf", !hasSelections, EPageType.PDF, this._translations.downloadPDF), this._getActionGroup("file-csv", !hasSelections, EPageType.CSV, this._translations.downloadCSV)), this._getPage(this._pageType))));
170
184
  }
171
185
  //--------------------------------------------------------------------------
172
186
  //
@@ -370,10 +384,8 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
370
384
  * @protected
371
385
  */
372
386
  _getDownloadPage(type) {
373
- var _a, _b;
374
387
  const isPdf = type === EExportType.PDF;
375
- const multiPdfOptions = ((_a = this.exportOptions) === null || _a === void 0 ? void 0 : _a.pdfOptions.enabledSizeValues.length) > 1;
376
- return (h("calcite-panel", null, h("div", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "font-bold" }, isPdf ? this._translations.pdfDownloads : this._translations.csvDownloads), 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", { layout: "inline" }, h("calcite-checkbox", { disabled: !this._downloadActive, ref: (el) => { this._removeDuplicates = el; } }), this._translations.removeDuplicate)), h("div", { class: isPdf && multiPdfOptions ? "" : "display-none" }, this._getLabel(this._translations.selectPDFLabelOption, false), h("div", { class: "padding-sides-1" }, h("pdf-download", { disabled: !this._downloadActive, enabledSizeValues: (_b = this.exportOptions) === null || _b === void 0 ? void 0 : _b.pdfOptions.enabledSizeValues, 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)))));
388
+ return (h("calcite-panel", null, h("div", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "font-bold" }, isPdf ? this._translations.pdfDownloads : this._translations.csvDownloads), 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", { layout: "inline" }, h("calcite-checkbox", { disabled: !this._downloadActive, ref: (el) => { this._removeDuplicates = 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)))));
377
389
  }
378
390
  /**
379
391
  * Create the stacked navigation buttons for a page
@@ -720,6 +732,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
720
732
  get el() { return this; }
721
733
  static get watchers() { return {
722
734
  "mapView": ["mapViewWatchHandler"],
735
+ "searchConfiguration": ["watchSearchConfigurationHandler"],
723
736
  "_selectionSets": ["selectionSetsWatchHandler"],
724
737
  "_pageType": ["pageTypeWatchHandler"]
725
738
  }; }
@@ -731,7 +744,6 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
731
744
  "customLabelEnabled": [4, "custom-label-enabled"],
732
745
  "defaultBufferDistance": [2, "default-buffer-distance"],
733
746
  "defaultBufferUnit": [1, "default-buffer-unit"],
734
- "exportOptions": [16],
735
747
  "featureEffect": [16],
736
748
  "featureHighlightEnabled": [4, "feature-highlight-enabled"],
737
749
  "mapView": [16],
@@ -32,14 +32,6 @@ const RefineSelectionTools = /*@__PURE__*/ proxyCustomElement(class extends HTML
32
32
  * {<layer id>: Graphic[]}: Collection of graphics returned from queries to the layer
33
33
  */
34
34
  this._featuresCollection = {};
35
- /**
36
- * IRefineOperation[]: Array to maintain the possible redo operations
37
- */
38
- this._redoStack = [];
39
- /**
40
- * IRefineOperation[]: Array to maintain the possible undo operations
41
- */
42
- this._undoStack = [];
43
35
  this.active = false;
44
36
  this.border = false;
45
37
  this.enabledLayerIds = [];
@@ -50,6 +42,7 @@ const RefineSelectionTools = /*@__PURE__*/ proxyCustomElement(class extends HTML
50
42
  this.mapView = undefined;
51
43
  this.mode = undefined;
52
44
  this.refineMode = undefined;
45
+ this.refineSelectionSet = undefined;
53
46
  this.useLayerPicker = true;
54
47
  this._selectEnabled = false;
55
48
  this._selectionMode = undefined;
@@ -130,10 +123,11 @@ const RefineSelectionTools = /*@__PURE__*/ proxyCustomElement(class extends HTML
130
123
  * Renders the component.
131
124
  */
132
125
  render() {
126
+ var _a, _b;
133
127
  const showLayerPickerClass = this.useLayerPicker ? "div-visible" : "div-not-visible";
134
128
  const drawClass = this.border ? " border" : "";
135
129
  const showUndoRedo = this.refineMode === ERefineMode.ALL ? "div-visible" : "div-not-visible";
136
- return (h(Host, null, h("div", null, h("map-layer-picker", { class: showLayerPickerClass, enabledLayerIds: this.enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, selectedLayerIds: this.layerViews.map(l => l.layer.id), selectionMode: "single" }), h("div", { class: "margin-top-1" + drawClass }, h("div", { class: "esri-sketch esri-widget" }, h("div", { class: "esri-sketch__panel" }, h("div", { class: "esri-sketch__tool-section esri-sketch__section" }, h("calcite-action", { disabled: !this._selectEnabled, icon: "select", onClick: () => this._setSelectionMode(ESelectionType.POINT), scale: "s", text: this._translations.select })), h("div", { class: "esri-sketch__tool-section esri-sketch__section" }, h("calcite-action", { disabled: !this._selectEnabled, icon: "line", onClick: () => this._setSelectionMode(ESelectionType.LINE), scale: "s", text: this._translations.selectLine }), h("calcite-action", { disabled: !this._selectEnabled, icon: "polygon", onClick: () => this._setSelectionMode(ESelectionType.POLY), scale: "s", text: this._translations.selectPolygon }), h("calcite-action", { disabled: !this._selectEnabled, icon: "rectangle", onClick: () => this._setSelectionMode(ESelectionType.RECT), scale: "s", text: this._translations.selectRectangle })), h("div", { class: showUndoRedo + " esri-sketch__tool-section esri-sketch__section" }, h("calcite-action", { disabled: this._undoStack.length === 0, icon: "undo", onClick: () => this._undo(), scale: "s", text: this._translations.undo }), h("calcite-action", { disabled: this._redoStack.length === 0, icon: "redo", onClick: () => this._redo(), scale: "s", text: this._translations.redo }))))))));
130
+ return (h(Host, null, h("div", null, h("map-layer-picker", { class: showLayerPickerClass, enabledLayerIds: this.enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, selectedLayerIds: this.layerViews.map(l => l.layer.id), selectionMode: "single" }), h("div", { class: "margin-top-1" + drawClass }, h("div", { class: "esri-sketch esri-widget" }, h("div", { class: "esri-sketch__panel" }, h("div", { class: "esri-sketch__tool-section esri-sketch__section" }, h("calcite-action", { disabled: !this._selectEnabled, icon: "pin", onClick: () => this._setSelectionMode(ESelectionType.POINT), scale: "s", text: this._translations.select }), h("calcite-action", { disabled: !this._selectEnabled, icon: "line", onClick: () => this._setSelectionMode(ESelectionType.LINE), scale: "s", text: this._translations.selectLine }), h("calcite-action", { disabled: !this._selectEnabled, icon: "polygon", onClick: () => this._setSelectionMode(ESelectionType.POLY), scale: "s", text: this._translations.selectPolygon }), h("calcite-action", { disabled: !this._selectEnabled, icon: "rectangle", onClick: () => this._setSelectionMode(ESelectionType.RECT), scale: "s", text: this._translations.selectRectangle })), h("div", { class: showUndoRedo + " esri-sketch__tool-section esri-sketch__section" }, h("calcite-action", { disabled: ((_a = this.refineSelectionSet) === null || _a === void 0 ? void 0 : _a.undoStack) ? this.refineSelectionSet.undoStack.length === 0 : true, icon: "undo", onClick: () => this._undo(), scale: "s", text: this._translations.undo }), h("calcite-action", { disabled: ((_b = this.refineSelectionSet) === null || _b === void 0 ? void 0 : _b.redoStack) ? this.refineSelectionSet.redoStack.length === 0 : true, icon: "redo", onClick: () => this._redo(), scale: "s", text: this._translations.redo }))))))));
137
131
  }
138
132
  //--------------------------------------------------------------------------
139
133
  //
@@ -245,7 +239,7 @@ const RefineSelectionTools = /*@__PURE__*/ proxyCustomElement(class extends HTML
245
239
  return prev;
246
240
  }, []);
247
241
  }
248
- this.refineSelectionGraphicsChange.emit(graphics);
242
+ this.refineSelectionGraphicsChange.emit({ graphics, useOIDs: false });
249
243
  this._clear();
250
244
  });
251
245
  });
@@ -319,11 +313,14 @@ const RefineSelectionTools = /*@__PURE__*/ proxyCustomElement(class extends HTML
319
313
  });
320
314
  });
321
315
  if (this.refineMode === ERefineMode.SUBSET) {
322
- this.refineSelectionGraphicsChange.emit(graphics);
316
+ this.refineSelectionGraphicsChange.emit({
317
+ graphics,
318
+ useOIDs: this.layerViews[0].layer.title === this.layerView.layer.title
319
+ });
323
320
  }
324
321
  else {
325
322
  const oids = Array.isArray(graphics) ? graphics.map(g => { var _a; return g.attributes[(_a = g === null || g === void 0 ? void 0 : g.layer) === null || _a === void 0 ? void 0 : _a.objectIdField]; }) : [];
326
- await this._updateIds(oids, this.mode, this._undoStack, this.mode);
323
+ await this._updateIds(oids, this.mode, this.refineSelectionSet.undoStack, this.mode);
327
324
  }
328
325
  this._clear();
329
326
  });
@@ -366,12 +363,16 @@ const RefineSelectionTools = /*@__PURE__*/ proxyCustomElement(class extends HTML
366
363
  if (mode === ESelectionMode.ADD) {
367
364
  idUpdates.addIds = oids.filter(id => this.ids.indexOf(id) < 0);
368
365
  this.ids = [...this.ids, ...idUpdates.addIds];
369
- operationStack.push({ mode: operationMode, ids: idUpdates.addIds });
366
+ if (idUpdates.addIds.length > 0) {
367
+ operationStack.push({ mode: operationMode, ids: idUpdates.addIds });
368
+ }
370
369
  }
371
370
  else {
372
371
  idUpdates.removeIds = oids.filter(id => this.ids.indexOf(id) > -1);
373
372
  this.ids = this.ids.filter(id => idUpdates.removeIds.indexOf(id) < 0);
374
- operationStack.push({ mode: operationMode, ids: idUpdates.removeIds });
373
+ if (idUpdates.removeIds.length > 0) {
374
+ operationStack.push({ mode: operationMode, ids: idUpdates.removeIds });
375
+ }
375
376
  }
376
377
  await this._highlightFeatures(this.ids).then(() => {
377
378
  this.refineSelectionIdsChange.emit(idUpdates);
@@ -385,8 +386,8 @@ const RefineSelectionTools = /*@__PURE__*/ proxyCustomElement(class extends HTML
385
386
  * @protected
386
387
  */
387
388
  _undo() {
388
- const undoOp = this._undoStack.pop();
389
- void this._updateIds(undoOp.ids, undoOp.mode === ESelectionMode.ADD ? ESelectionMode.REMOVE : ESelectionMode.ADD, this._redoStack, undoOp.mode);
389
+ const undoOp = this.refineSelectionSet.undoStack.pop();
390
+ void this._updateIds(undoOp.ids, undoOp.mode === ESelectionMode.ADD ? ESelectionMode.REMOVE : ESelectionMode.ADD, this.refineSelectionSet.redoStack, undoOp.mode);
390
391
  }
391
392
  /**
392
393
  * Redo the most current ADD or REMOVE operation
@@ -396,8 +397,8 @@ const RefineSelectionTools = /*@__PURE__*/ proxyCustomElement(class extends HTML
396
397
  * @protected
397
398
  */
398
399
  _redo() {
399
- const redoOp = this._redoStack.pop();
400
- void this._updateIds(redoOp.ids, redoOp.mode, this._undoStack, redoOp.mode);
400
+ const redoOp = this.refineSelectionSet.redoStack.pop();
401
+ void this._updateIds(redoOp.ids, redoOp.mode, this.refineSelectionSet.undoStack, redoOp.mode);
401
402
  }
402
403
  /**
403
404
  * Fetches the component's translations
@@ -424,6 +425,7 @@ const RefineSelectionTools = /*@__PURE__*/ proxyCustomElement(class extends HTML
424
425
  "mapView": [16],
425
426
  "mode": [1],
426
427
  "refineMode": [1, "refine-mode"],
428
+ "refineSelectionSet": [1040],
427
429
  "useLayerPicker": [4, "use-layer-picker"],
428
430
  "_selectEnabled": [32],
429
431
  "_selectionMode": [32],
@@ -4,7 +4,7 @@
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
- import { e as ESelectionMode, f as ERefineMode, c as EWorkflowType } from './interfaces3.js';
7
+ import { c as EWorkflowType, e as ESelectionMode, f as ERefineMode } from './interfaces3.js';
8
8
  import { g as getLocaleComponentStrings } from './locale.js';
9
9
  import { d as defineCustomElement$e } from './action.js';
10
10
  import { d as defineCustomElement$d } from './chip.js';
@@ -72,6 +72,19 @@ const RefineSelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
72
72
  this.SketchViewModel = undefined;
73
73
  this._translations = undefined;
74
74
  }
75
+ //--------------------------------------------------------------------------
76
+ //
77
+ // Watch handlers
78
+ //
79
+ //--------------------------------------------------------------------------
80
+ /**
81
+ * Called each time the addresseeLayer is changed.
82
+ * Add a new clean refine set for the new addressee layer.
83
+ */
84
+ addresseeLayerWatchHandler() {
85
+ const selectionSets = this.selectionSets.filter(ss => ss.workflowType !== EWorkflowType.REFINE);
86
+ this.selectionSets = this._initRefineSelectionSet(selectionSets);
87
+ }
75
88
  /**
76
89
  * Handles changes to refine selection ids.
77
90
  *
@@ -93,12 +106,16 @@ const RefineSelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
93
106
  */
94
107
  async componentWillLoad() {
95
108
  await this._getTranslations();
109
+ const refineSet = this._getRefineSelectionSet(this.selectionSets);
110
+ if (!refineSet) {
111
+ this.selectionSets = this._initRefineSelectionSet(this.selectionSets);
112
+ }
96
113
  }
97
114
  /**
98
115
  * Renders the component.
99
116
  */
100
117
  render() {
101
- return (h(Host, null, h("div", { class: "padding-1" }, h("div", null, h("calcite-radio-group", { class: "w-100", onCalciteRadioGroupChange: (evt) => this._modeChanged(evt) }, h("calcite-radio-group-item", { checked: this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.ADD), value: ESelectionMode.ADD }, this._translations.add), h("calcite-radio-group-item", { checked: !this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.REMOVE), value: ESelectionMode.REMOVE }, this._translations.remove)), h("refine-selection-tools", { border: true, enabledLayerIds: this.enabledLayerIds, ids: getSelectionIds(this.selectionSets), layerViews: [this.addresseeLayer], mapView: this.mapView, mode: this._addEnabled ? ESelectionMode.ADD : ESelectionMode.REMOVE, ref: (el) => { this._refineTools = el; }, refineMode: ERefineMode.ALL, useLayerPicker: false })), h("br", null), (h("calcite-list", { class: "list-border" }, this._getRefineSelectionSetList())))));
118
+ return (h(Host, null, h("div", { class: "padding-1" }, h("div", null, h("calcite-radio-group", { class: "w-100", onCalciteRadioGroupChange: (evt) => this._modeChanged(evt) }, h("calcite-radio-group-item", { checked: this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.ADD), value: ESelectionMode.ADD }, this._translations.add), h("calcite-radio-group-item", { checked: !this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.REMOVE), value: ESelectionMode.REMOVE }, this._translations.remove)), h("refine-selection-tools", { border: true, enabledLayerIds: this.enabledLayerIds, ids: getSelectionIds(this.selectionSets), layerViews: [this.addresseeLayer], mapView: this.mapView, mode: this._addEnabled ? ESelectionMode.ADD : ESelectionMode.REMOVE, ref: (el) => { this._refineTools = el; }, refineMode: ERefineMode.ALL, refineSelectionSet: this._getRefineSelectionSet(this.selectionSets), useLayerPicker: false })), h("br", null), (h("calcite-list", { class: "list-border" }, this._getRefineSelectionSetList())))));
102
119
  }
103
120
  //--------------------------------------------------------------------------
104
121
  //
@@ -164,7 +181,7 @@ const RefineSelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
164
181
  if (removeIds.length > 0) {
165
182
  this.selectionSets = this.selectionSets.reduce((prev, cur) => {
166
183
  cur.selectedIds = cur.selectedIds.filter(id => removeIds.indexOf(id) < 0);
167
- if (cur.selectedIds.length > 0) {
184
+ if (cur.selectedIds.length > 0 || cur.workflowType === EWorkflowType.REFINE) {
168
185
  prev.push(cur);
169
186
  }
170
187
  return prev;
@@ -183,9 +200,7 @@ const RefineSelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
183
200
  */
184
201
  _updateRefineSelectionSet(addIds, removeIds) {
185
202
  const selectionSet = this._getRefineSelectionSet(this.selectionSets);
186
- this.selectionSets = selectionSet ?
187
- this._updateRefineIds(selectionSet, addIds, removeIds) :
188
- this._addRefineSelectionSet(addIds, removeIds);
203
+ this._updateRefineIds(selectionSet, addIds, removeIds);
189
204
  this.selectionSetsChanged.emit(this.selectionSets);
190
205
  }
191
206
  /**
@@ -218,15 +233,12 @@ const RefineSelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
218
233
  /**
219
234
  * Add a new refine selection set
220
235
  *
221
- * @param addIds any ids to add
222
- * @param removeIds any ids to remove
223
- *
224
236
  * @returns updated selection sets
225
237
  * @protected
226
238
  */
227
- _addRefineSelectionSet(addIds, removeIds) {
239
+ _initRefineSelectionSet(selectionSets) {
228
240
  return [
229
- ...this.selectionSets,
241
+ ...selectionSets,
230
242
  ({
231
243
  buffer: undefined,
232
244
  distance: 0,
@@ -237,13 +249,15 @@ const RefineSelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
237
249
  layerView: this.addresseeLayer,
238
250
  refineSelectLayers: [],
239
251
  searchResult: undefined,
240
- selectedIds: addIds,
252
+ selectedIds: [],
241
253
  unit: "feet",
242
254
  workflowType: EWorkflowType.REFINE,
243
255
  refineIds: {
244
- addIds: addIds,
245
- removeIds: removeIds
246
- }
256
+ addIds: [],
257
+ removeIds: []
258
+ },
259
+ redoStack: [],
260
+ undoStack: []
247
261
  })
248
262
  ];
249
263
  }
@@ -284,6 +298,9 @@ const RefineSelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
284
298
  return null;
285
299
  }
286
300
  get el() { return this; }
301
+ static get watchers() { return {
302
+ "addresseeLayer": ["addresseeLayerWatchHandler"]
303
+ }; }
287
304
  static get style() { return refineSelectionCss; }
288
305
  }, [0, "refine-selection", {
289
306
  "addresseeLayer": [16],