@esri/solutions-components 0.8.0 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. package/dist/cjs/buffer-tools_3.cjs.entry.js +3 -3
  2. package/dist/cjs/consent-manager.cjs.entry.js +11 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/map-select-tools_3.cjs.entry.js +31 -20
  5. package/dist/cjs/public-notification.cjs.entry.js +24 -1
  6. package/dist/cjs/solutions-components.cjs.js +1 -1
  7. package/dist/collection/components/consent-manager/consent-manager.js +13 -4
  8. package/dist/collection/components/map-draw-tools/map-draw-tools.js +3 -3
  9. package/dist/collection/components/map-select-tools/map-select-tools.js +33 -20
  10. package/dist/collection/components/public-notification/public-notification.js +24 -1
  11. package/dist/components/consent-manager.js +11 -1
  12. package/dist/components/map-draw-tools2.js +3 -3
  13. package/dist/components/map-select-tools2.js +32 -20
  14. package/dist/components/public-notification.js +24 -1
  15. package/dist/esm/buffer-tools_3.entry.js +3 -3
  16. package/dist/esm/consent-manager.entry.js +11 -1
  17. package/dist/esm/loader.js +1 -1
  18. package/dist/esm/map-select-tools_3.entry.js +31 -20
  19. package/dist/esm/public-notification.entry.js +24 -1
  20. package/dist/esm/solutions-components.js +1 -1
  21. package/dist/solutions-components/p-0f427774.entry.js +6 -0
  22. package/dist/solutions-components/{p-0e5274bd.entry.js → p-131bcc7f.entry.js} +1 -1
  23. package/dist/solutions-components/p-52b37bad.entry.js +6 -0
  24. package/dist/solutions-components/{p-35c9256b.entry.js → p-955647ea.entry.js} +1 -1
  25. package/dist/solutions-components/solutions-components.esm.js +1 -1
  26. package/dist/types/components/consent-manager/consent-manager.d.ts +6 -0
  27. package/dist/types/components/map-select-tools/map-select-tools.d.ts +5 -1
  28. package/dist/types/components/public-notification/public-notification.d.ts +12 -0
  29. package/dist/types/components.d.ts +1 -1
  30. package/package.json +1 -1
  31. package/dist/solutions-components/p-41bc9e9d.entry.js +0 -6
  32. package/dist/solutions-components/p-df29f4c2.entry.js +0 -6
@@ -82,6 +82,14 @@ const MapSelectTools = class {
82
82
  }
83
83
  }
84
84
  }
85
+ /**
86
+ * Called each time the mapView prop is changed.
87
+ */
88
+ async mapViewWatchHandler(v, oldV) {
89
+ if (v && v !== oldV) {
90
+ await this._init();
91
+ }
92
+ }
85
93
  /**
86
94
  * Called each time the searchConfiguration prop is changed.
87
95
  *
@@ -89,7 +97,7 @@ const MapSelectTools = class {
89
97
  */
90
98
  async watchSearchConfigurationHandler(newValue, oldValue) {
91
99
  if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
92
- this._initSearchWidget();
100
+ await this._initSearchWidget();
93
101
  }
94
102
  }
95
103
  //--------------------------------------------------------------------------
@@ -173,12 +181,6 @@ const MapSelectTools = class {
173
181
  */
174
182
  async componentDidLoad() {
175
183
  await this._init();
176
- await this._searchWidget.when(() => {
177
- var _a;
178
- this._searchWidget.allPlaceholder = ((_a = this.searchConfiguration) === null || _a === void 0 ? void 0 : _a.allPlaceholder) &&
179
- this.searchConfiguration.allPlaceholder.toLowerCase() !== "find address or place" ?
180
- this.searchConfiguration.allPlaceholder : this._translations.placeholder;
181
- });
182
184
  }
183
185
  /**
184
186
  * Renders the component.
@@ -265,7 +267,7 @@ const MapSelectTools = class {
265
267
  async _init() {
266
268
  this._initGraphicsLayer();
267
269
  await this._initSelectionSet();
268
- this._initSearchWidget();
270
+ await this._initSearchWidget();
269
271
  }
270
272
  /**
271
273
  * Initialize the state of the component with any stored values in a selection set
@@ -311,7 +313,7 @@ const MapSelectTools = class {
311
313
  *
312
314
  * @protected
313
315
  */
314
- _initSearchWidget() {
316
+ async _initSearchWidget() {
315
317
  if (this.mapView && this._searchElement) {
316
318
  const searchConfiguration = this._getSearchConfig(this.searchConfiguration, this.mapView);
317
319
  const searchOptions = Object.assign({ view: this.mapView, container: this._searchElement, searchTerm: this._searchTerm }, searchConfiguration);
@@ -340,6 +342,12 @@ const MapSelectTools = class {
340
342
  void this._clearResults(false, clearLabel);
341
343
  }
342
344
  });
345
+ await this._searchWidget.when(() => {
346
+ var _a;
347
+ this._searchWidget.allPlaceholder = ((_a = this.searchConfiguration) === null || _a === void 0 ? void 0 : _a.allPlaceholder) &&
348
+ this.searchConfiguration.allPlaceholder.toLowerCase() !== "find address or place" ?
349
+ this.searchConfiguration.allPlaceholder : this._translations.placeholder;
350
+ });
343
351
  }
344
352
  }
345
353
  /**
@@ -407,19 +415,21 @@ const MapSelectTools = class {
407
415
  */
408
416
  _initGraphicsLayer() {
409
417
  const title = this._translations.bufferLayer;
410
- const bufferIndex = this.mapView.map.layers.findIndex((l) => l.title === title);
411
- if (bufferIndex > -1) {
412
- this._bufferGraphicsLayer = this.mapView.map.layers.getItemAt(bufferIndex);
413
- }
414
- else {
415
- this._bufferGraphicsLayer = new this.GraphicsLayer({ title, listMode: "hide" });
416
- state.managedLayers.push(title);
417
- const sketchIndex = this.mapView.map.layers.findIndex((l) => l.title === this._translations.sketchLayer);
418
- if (sketchIndex > -1) {
419
- this.mapView.map.layers.add(this._bufferGraphicsLayer, sketchIndex);
418
+ if (this.mapView) {
419
+ const bufferIndex = this.mapView.map.layers.findIndex((l) => l.title === title);
420
+ if (bufferIndex > -1) {
421
+ this._bufferGraphicsLayer = this.mapView.map.layers.getItemAt(bufferIndex);
420
422
  }
421
423
  else {
422
- this.mapView.map.layers.add(this._bufferGraphicsLayer);
424
+ this._bufferGraphicsLayer = new this.GraphicsLayer({ title, listMode: "hide" });
425
+ state.managedLayers.push(title);
426
+ const sketchIndex = this.mapView.map.layers.findIndex((l) => l.title === this._translations.sketchLayer);
427
+ if (sketchIndex > -1) {
428
+ this.mapView.map.layers.add(this._bufferGraphicsLayer, sketchIndex);
429
+ }
430
+ else {
431
+ this.mapView.map.layers.add(this._bufferGraphicsLayer);
432
+ }
423
433
  }
424
434
  }
425
435
  }
@@ -777,6 +787,7 @@ const MapSelectTools = class {
777
787
  get el() { return getElement(this); }
778
788
  static get watchers() { return {
779
789
  "geometries": ["watchGeometriesHandler"],
790
+ "mapView": ["mapViewWatchHandler"],
780
791
  "searchConfiguration": ["watchSearchConfigurationHandler"]
781
792
  }; }
782
793
  };
@@ -78,6 +78,7 @@ const PublicNotification = class {
78
78
  if (v === null || v === void 0 ? void 0 : v.popup) {
79
79
  this._popupsEnabled = v === null || v === void 0 ? void 0 : v.popup.autoOpenEnabled;
80
80
  }
81
+ this._initSearchConfiguration(this.searchConfiguration);
81
82
  }
82
83
  /**
83
84
  * Called each time the searchConfiguration prop is changed.
@@ -86,7 +87,7 @@ const PublicNotification = class {
86
87
  */
87
88
  async watchSearchConfigurationHandler(newValue, oldValue) {
88
89
  const s_newValue = JSON.stringify(newValue);
89
- if (s_newValue !== JSON.stringify(oldValue)) {
90
+ if (this.mapView && (s_newValue !== JSON.stringify(oldValue) || (s_newValue && !this._searchConfiguration))) {
90
91
  this._searchConfiguration = JSON.parse(s_newValue);
91
92
  this.searchConfigurationChange.emit(this._searchConfiguration);
92
93
  // force back to list page before we create Search
@@ -175,6 +176,12 @@ const PublicNotification = class {
175
176
  const headerSlot = this._isMobile ? "footer" : "header";
176
177
  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: headerSlot }, this._getActionGroup("list-check", EPageType.LIST, this._translations.myLists), this.showRefineSelection ? this._getActionGroup("test-data", EPageType.REFINE, this._translations.refineSelection) : null, this._getActionGroup("export", EPageType.EXPORT, this._translations.export)), this._getPage(this._pageType))));
177
178
  }
179
+ /**
180
+ * StencilJS: Called once just after the component is first loaded.
181
+ */
182
+ async componentDidLoad() {
183
+ this._initSearchConfiguration(this.searchConfiguration);
184
+ }
178
185
  /**
179
186
  * StencilJS: Called every time the component is disconnected from the DOM
180
187
  */
@@ -201,6 +208,22 @@ const PublicNotification = class {
201
208
  this._geometryEngine = geometryEngine;
202
209
  this._jsonUtils = jsonUtils;
203
210
  }
211
+ /**
212
+ * Load the search configuration
213
+ *
214
+ * @returns Promise resolving when function is done
215
+ *
216
+ * @protected
217
+ */
218
+ _initSearchConfiguration(v) {
219
+ if (this.searchConfiguration && !this._searchConfiguration && this.mapView) {
220
+ this._searchConfiguration = v;
221
+ this.searchConfigurationChange.emit(this._searchConfiguration);
222
+ // force back to list page before we create Search
223
+ // https://devtopia.esri.com/WebGIS/arcgis-template-configuration/issues/3402
224
+ void this._home();
225
+ }
226
+ }
204
227
  /**
205
228
  * Initialize the default symbols that will be used when creating new graphics
206
229
  *