@esri/solutions-components 0.8.4 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. package/dist/assets/t9n/crowdsource-reporter/resources.json +5 -6
  2. package/dist/assets/t9n/crowdsource-reporter/resources_en.json +5 -6
  3. package/dist/assets/t9n/feature-list/resources.json +1 -1
  4. package/dist/assets/t9n/feature-list/resources_en.json +1 -1
  5. package/dist/assets/t9n/public-notification/resources.json +3 -1
  6. package/dist/assets/t9n/public-notification/resources_en.json +3 -1
  7. package/dist/cjs/buffer-tools_3.cjs.entry.js +2 -2
  8. package/dist/cjs/calcite-alert_4.cjs.entry.js +2 -2
  9. package/dist/cjs/calcite-combobox_5.cjs.entry.js +2 -2
  10. package/dist/cjs/calcite-flow_5.cjs.entry.js +163 -16
  11. package/dist/cjs/card-manager_3.cjs.entry.js +41 -2
  12. package/dist/cjs/crowdsource-manager.cjs.entry.js +2 -1
  13. package/dist/cjs/crowdsource-reporter.cjs.entry.js +120 -38
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
  16. package/dist/cjs/public-notification.cjs.entry.js +110 -4
  17. package/dist/cjs/{publicNotificationStore-ef379d11.js → publicNotificationStore-e790601d.js} +2 -2
  18. package/dist/cjs/solutions-components.cjs.js +1 -1
  19. package/dist/collection/collection-manifest.json +1 -1
  20. package/dist/collection/components/create-feature/create-feature.css +9 -0
  21. package/dist/collection/components/create-feature/create-feature.js +134 -6
  22. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +19 -1
  23. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +5 -0
  24. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +120 -38
  25. package/dist/collection/components/feature-list/feature-list.js +93 -5
  26. package/dist/collection/components/info-card/info-card.css +1 -1
  27. package/dist/collection/components/info-card/info-card.js +1 -1
  28. package/dist/collection/components/layer-list/layer-list.js +6 -6
  29. package/dist/collection/components/map-card/map-card.js +27 -2
  30. package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
  31. package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
  32. package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
  33. package/dist/collection/components/public-notification/public-notification.js +110 -3
  34. package/dist/collection/demos/crowdsource-reporter.html +1 -1
  35. package/dist/collection/utils/interfaces.ts +7 -0
  36. package/dist/collection/utils/publicNotificationStore.js +2 -2
  37. package/dist/collection/utils/publicNotificationStore.ts +3 -2
  38. package/dist/components/create-feature2.js +111 -7
  39. package/dist/components/crowdsource-manager.js +3 -1
  40. package/dist/components/crowdsource-reporter.js +121 -39
  41. package/dist/components/feature-list2.js +54 -6
  42. package/dist/components/info-card2.js +2 -2
  43. package/dist/components/layer-list2.js +6 -6
  44. package/dist/components/map-card2.js +42 -2
  45. package/dist/components/map-draw-tools2.js +1 -1
  46. package/dist/components/map-layer-picker2.js +1 -1
  47. package/dist/components/map-select-tools2.js +1 -1
  48. package/dist/components/public-notification.js +110 -3
  49. package/dist/components/publicNotificationStore.js +2 -2
  50. package/dist/esm/buffer-tools_3.entry.js +2 -2
  51. package/dist/esm/calcite-alert_4.entry.js +3 -3
  52. package/dist/esm/calcite-combobox_5.entry.js +3 -3
  53. package/dist/esm/calcite-flow_5.entry.js +164 -17
  54. package/dist/esm/card-manager_3.entry.js +43 -4
  55. package/dist/esm/crowdsource-manager.entry.js +3 -2
  56. package/dist/esm/crowdsource-reporter.entry.js +121 -39
  57. package/dist/esm/{downloadUtils-0c13073b.js → downloadUtils-0c1e4d7b.js} +2 -2
  58. package/dist/esm/{index.es-ad250bc6.js → index.es-286e3cfa.js} +2 -2
  59. package/dist/esm/loader.js +1 -1
  60. package/dist/esm/map-select-tools_3.entry.js +4 -4
  61. package/dist/esm/{mapViewUtils-20504620.js → mapViewUtils-253178f1.js} +1 -1
  62. package/dist/esm/public-notification.entry.js +112 -6
  63. package/dist/esm/{publicNotificationStore-3bf4de75.js → publicNotificationStore-223faed2.js} +2 -2
  64. package/dist/esm/solutions-components.js +1 -1
  65. package/dist/solutions-components/demos/crowdsource-reporter.html +1 -1
  66. package/dist/solutions-components/p-15f9624a.entry.js +6 -0
  67. package/dist/solutions-components/{p-955647ea.entry.js → p-1ea5e061.entry.js} +2 -2
  68. package/dist/solutions-components/{p-590a2a26.js → p-212b02e7.js} +1 -1
  69. package/dist/solutions-components/p-238d3b5f.entry.js +6 -0
  70. package/dist/solutions-components/p-273d833b.entry.js +6 -0
  71. package/dist/solutions-components/{p-cc280aa1.js → p-322868ec.js} +1 -1
  72. package/dist/solutions-components/{p-1d3a1794.js → p-331b5d1e.js} +2 -2
  73. package/dist/solutions-components/{p-c897e3eb.js → p-3af79063.js} +1 -1
  74. package/dist/solutions-components/p-45ed16d5.entry.js +6 -0
  75. package/dist/solutions-components/p-80b11ec1.entry.js +17 -0
  76. package/dist/solutions-components/{p-5c7e3941.entry.js → p-813fd8a4.entry.js} +2 -2
  77. package/dist/solutions-components/{p-ff302d95.entry.js → p-d136eab0.entry.js} +2 -2
  78. package/dist/solutions-components/p-e0446d5b.entry.js +6 -0
  79. package/dist/solutions-components/solutions-components.esm.js +1 -1
  80. package/dist/solutions-components/utils/interfaces.ts +7 -0
  81. package/dist/solutions-components/utils/publicNotificationStore.ts +3 -2
  82. package/dist/types/components/create-feature/create-feature.d.ts +43 -1
  83. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +4 -0
  84. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +31 -10
  85. package/dist/types/components/feature-list/feature-list.d.ts +31 -0
  86. package/dist/types/components/layer-list/layer-list.d.ts +3 -3
  87. package/dist/types/components/map-card/map-card.d.ts +8 -0
  88. package/dist/types/components/public-notification/public-notification.d.ts +48 -0
  89. package/dist/types/components.d.ts +37 -0
  90. package/dist/types/utils/interfaces.d.ts +6 -0
  91. package/dist/types/utils/publicNotificationStore.d.ts +2 -1
  92. package/package.json +2 -1
  93. package/dist/solutions-components/p-6512dc44.entry.js +0 -6
  94. package/dist/solutions-components/p-65ad1625.entry.js +0 -6
  95. package/dist/solutions-components/p-989bf0bf.entry.js +0 -6
  96. package/dist/solutions-components/p-a0611720.entry.js +0 -6
  97. package/dist/solutions-components/p-efe1694a.entry.js +0 -17
  98. package/dist/solutions-components/p-f3467807.entry.js +0 -6
@@ -1,5 +1,5 @@
1
1
  {
2
- "createReportHeader": "Create a Report",
2
+ "createReportButtonText": "Create a Report",
3
3
  "share": "Share",
4
4
  "sort": "Sort",
5
5
  "filter": "Filter",
@@ -12,11 +12,10 @@
12
12
  "error": "Error",
13
13
  "invalidConfigurationErrorMsg": "Invalid configuration",
14
14
  "noLayerToDisplayErrorMsg": "Configured web map don't have any editable feature layer.",
15
- "chooseCategoryMsg": "Choose a category for your report.",
16
- "featureErrorMsg": "Features not found.",
17
- "featureEditFormInfoMsg": "Please provide the details for your report.",
15
+ "chooseCategoryMsg": "Please choose a category.",
16
+ "featureErrorMsg": "No records found.",
17
+ "featureEditFormInfoMsg": "Please provide the details.",
18
18
  "currentLocationMsg": "Use my current location",
19
- "addLocationMsg": "Add the location for your report.",
20
- "reportSubmit": "Report Submitted.",
19
+ "addLocationMsg": "Please add a location.",
21
20
  "submitMsg": "Thank you! Your report was successfully submitted."
22
21
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "createReportHeader": "Create a Report",
2
+ "createReportButtonText": "Create a Report",
3
3
  "share": "Share",
4
4
  "sort": "Sort",
5
5
  "filter": "Filter",
@@ -12,11 +12,10 @@
12
12
  "error": "Error",
13
13
  "invalidConfigurationErrorMsg": "Invalid configuration",
14
14
  "noLayerToDisplayErrorMsg": "Configured web map don't have any editable feature layer.",
15
- "chooseCategoryMsg": "Choose a category for your report.",
16
- "featureErrorMsg": "Features not found.",
17
- "featureEditFormInfoMsg": "Please provide the details for your report.",
15
+ "chooseCategoryMsg": "Please choose a category.",
16
+ "featureErrorMsg": "No records found.",
17
+ "featureEditFormInfoMsg": "Please provide the details.",
18
18
  "currentLocationMsg": "Use my current location",
19
- "addLocationMsg": "Add the location for your report.",
20
- "reportSubmit": "Report Submitted.",
19
+ "addLocationMsg": "Please add a location.",
21
20
  "submitMsg": "Thank you! Your report was successfully submitted."
22
21
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "error": "Error",
3
- "featureErrorMsg": "Features not found."
3
+ "featureErrorMsg": "No records found."
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "error": "Error",
3
- "featureErrorMsg": "Features not found."
3
+ "featureErrorMsg": "No records found."
4
4
  }
@@ -38,5 +38,7 @@
38
38
  "refineTip": "Refine and finalize your lists by using sketch tools to add or remove selected features.",
39
39
  "refineTipNoSelections": "There are no selections to refine. Go to My lists to create a list of features.",
40
40
  "duplicatesTip": "Duplicate features are always removed. When enabled, pop-ups from each layer will be compared and any duplicate pop-up information will be removed.",
41
- "exportListsLabel": "My lists"
41
+ "exportListsLabel": "My lists",
42
+ "listGraphics": "List graphics",
43
+ "listGraphicsTip": "Include any graphics like search buffers or graphics from the sketch tools in the map export."
42
44
  }
@@ -38,5 +38,7 @@
38
38
  "refineTip": "Refine and finalize your lists by using sketch tools to add or remove selected features.",
39
39
  "refineTipNoSelections": "There are no selections to refine. Go to My lists to create a list of features.",
40
40
  "duplicatesTip": "Duplicate features are always removed. When enabled, pop-ups from each layer will be compared and any duplicate pop-up information will be removed.",
41
- "exportListsLabel": "My lists"
41
+ "exportListsLabel": "My lists",
42
+ "listGraphics": "List graphics",
43
+ "listGraphicsTip": "Include any graphics like search buffers or graphics from the sketch tools in the map export."
42
44
  }
@@ -11,7 +11,7 @@ const index = require('./index-105cf2b9.js');
11
11
  const locale = require('./locale-3d0a4bc2.js');
12
12
  const dom = require('./dom-c9c2c835.js');
13
13
  const interfaces = require('./interfaces-7cd0a48a.js');
14
- const publicNotificationStore = require('./publicNotificationStore-ef379d11.js');
14
+ const publicNotificationStore = require('./publicNotificationStore-e790601d.js');
15
15
  require('./esri-loader-ce6c3d3d.js');
16
16
  require('./_commonjsHelpers-480c2e77.js');
17
17
  require('./guid-ae73cd27.js');
@@ -468,7 +468,7 @@ const MapDrawTools = class {
468
468
  }
469
469
  else {
470
470
  this._sketchGraphicsLayer = new this.GraphicsLayer({ title, listMode: "hide" });
471
- publicNotificationStore.state.managedLayers.push(title);
471
+ publicNotificationStore.state.managedLayers[title] = "sketch";
472
472
  this.mapView.map.layers.add(this._sketchGraphicsLayer);
473
473
  }
474
474
  if (this.graphics && this.graphics.length > 0) {
@@ -668,7 +668,7 @@ const EditCard = class {
668
668
  };
669
669
  EditCard.style = editCardCss;
670
670
 
671
- const infoCardCss = ":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}";
671
+ const infoCardCss = ":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}";
672
672
 
673
673
  const InfoCard = class {
674
674
  constructor(hostRef) {
@@ -791,7 +791,7 @@ const InfoCard = class {
791
791
  const id = (_d = (_c = this._features) === null || _c === void 0 ? void 0 : _c.selectedFeature) === null || _d === void 0 ? void 0 : _d.getObjectId();
792
792
  const ids = parseInt(id === null || id === void 0 ? void 0 : id.toString(), 10) > -1 ? [id] : [];
793
793
  const deleteEnabled = ((_e = this._layer) === null || _e === void 0 ? void 0 : _e.editingEnabled) && ((_h = (_g = (_f = this._layer) === null || _f === void 0 ? void 0 : _f.capabilities) === null || _g === void 0 ? void 0 : _g.operations) === null || _h === void 0 ? void 0 : _h.supportsDelete);
794
- return (index.h(index.Host, null, index.h("calcite-shell", null, this._getHeader(), index.h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData }), index.h("div", { class: "esri-widget " + featureNodeClass, id: "features-node" }), index.h("div", { class: `${editButtonClass} width-100`, slot: "footer" }, this.allowEditing &&
794
+ return (index.h(index.Host, null, index.h("calcite-shell", null, this._getHeader(), index.h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData }), index.h("div", { class: "esri-widget feature-node " + featureNodeClass, id: "features-node" }), index.h("div", { class: `${editButtonClass} width-100`, slot: "footer" }, this.allowEditing &&
795
795
  index.h("div", { class: "display-flex top-border padding-1-2" }, index.h("calcite-button", { appearance: "solid", id: "solutions-edit", onClick: () => this._openEditRecord(), width: "full" }, this._translations.edit), this.isMobile && deleteEnabled ? (index.h("delete-button", { class: "padding-inline-start-1 width-100", id: "solutions-delete", ids: ids, layer: this._layer, onEditsComplete: () => this._closePopup() })) : undefined, index.h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "solutions-edit" }, index.h("span", null, this._translations.edit)), this.isMobile ? (index.h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "solutions-delete" }, index.h("span", null, this._translations.delete))) : undefined), !nextBackDisabled && index.h("div", { class: `display-flex padding-1-2 button-container top-border ${nextBackClass}` }, index.h("div", { class: "min-width-100" }, index.h("calcite-button", { appearance: "outline", disabled: nextBackDisabled, id: "solutions-back", onClick: () => this._back(), width: "full" }, this._translations.back), index.h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-back" }, index.h("span", null, this._translations.back))), index.h("div", null, index.h("calcite-action", { icon: "list", onClick: () => this._toggleListView(), scale: "s", text: this._count, textEnabled: true })), index.h("div", { class: "min-width-100" }, index.h("calcite-button", { appearance: "outline", disabled: nextBackDisabled, id: "solutions-next", onClick: () => this._next(), width: "full" }, this._translations.next), index.h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-next" }, index.h("span", null, this._translations.next))))), index.h("edit-card", { class: editClass, graphicIndex: (_j = this._features) === null || _j === void 0 ? void 0 : _j.selectedFeatureIndex, graphics: this.graphics, mapView: this.mapView, open: this._editRecordOpen }), index.h("calcite-alert", { icon: "layer-broken", kind: "warning", label: "", onCalciteAlertClose: () => this._alertClosed(), open: this._alertOpen, placement: "top" }, index.h("div", { slot: "title" }, this._translations.editDisabled), index.h("div", { slot: "message" }, this._translations.enableEditing)))));
796
796
  }
797
797
  //--------------------------------------------------------------------------
@@ -27,7 +27,7 @@ const debounce = require('./debounce-30afab47.js');
27
27
  const key = require('./key-c5504030.js');
28
28
  const locale$1 = require('./locale-3d0a4bc2.js');
29
29
  const mapViewUtils = require('./mapViewUtils-3e0fa457.js');
30
- const publicNotificationStore = require('./publicNotificationStore-ef379d11.js');
30
+ const publicNotificationStore = require('./publicNotificationStore-e790601d.js');
31
31
  require('./resources-9447c777.js');
32
32
  require('./browser-d08a5f99.js');
33
33
  require('./esri-loader-ce6c3d3d.js');
@@ -2069,7 +2069,7 @@ const MapLayerPicker = class {
2069
2069
  _validLayer(id) {
2070
2070
  var _a;
2071
2071
  const name = (_a = this._layerNameHash[id]) === null || _a === void 0 ? void 0 : _a.name;
2072
- return name && publicNotificationStore.state.managedLayers.indexOf(name) < 0 && (this.enabledLayerIds.length > 0 ?
2072
+ return name && Object.keys(publicNotificationStore.state.managedLayers).indexOf(name) < 0 && (this.enabledLayerIds.length > 0 ?
2073
2073
  this.enabledLayerIds.indexOf(id) > -1 : true);
2074
2074
  }
2075
2075
  /**
@@ -340,7 +340,7 @@ const FlowItem = class {
340
340
  };
341
341
  FlowItem.style = flowItemCss;
342
342
 
343
- const createFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__update-actions{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}";
343
+ const createFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__update-actions{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 0 20px 14px}.display-none{display:none !important}";
344
344
 
345
345
  const CreateFeature = class {
346
346
  constructor(hostRef) {
@@ -352,6 +352,8 @@ const CreateFeature = class {
352
352
  this.mapView = undefined;
353
353
  this.selectedLayerId = undefined;
354
354
  this.customizeSubmit = false;
355
+ this.searchConfiguration = undefined;
356
+ this.showSearchWidget = undefined;
355
357
  }
356
358
  //--------------------------------------------------------------------------
357
359
  //
@@ -411,7 +413,8 @@ const CreateFeature = class {
411
413
  * Renders the component.
412
414
  */
413
415
  render() {
414
- return (index.h(index.Host, { id: "feature-form" }));
416
+ const showSearchWidget = this.showSearchWidget ? '' : 'display-none';
417
+ return (index.h(index.Fragment, null, index.h("div", { id: "feature-form" }), index.h("div", { class: `search-widget ${showSearchWidget}`, id: "search-widget-ref" })));
415
418
  }
416
419
  //--------------------------------------------------------------------------
417
420
  //
@@ -419,11 +422,12 @@ const CreateFeature = class {
419
422
  //
420
423
  //--------------------------------------------------------------------------
421
424
  /**
422
- * Init Editor widget and starts the create workflow
425
+ * Init Editor widget and Search widget
423
426
  */
424
427
  async init() {
425
428
  if (this.mapView && this.selectedLayerId) {
426
429
  await this.createEditorWidget();
430
+ await this.createSearchWidget();
427
431
  }
428
432
  }
429
433
  /**
@@ -432,12 +436,14 @@ const CreateFeature = class {
432
436
  * @protected
433
437
  */
434
438
  async initModules() {
435
- const [Editor, reactiveUtils] = await locale$1.loadModules([
439
+ const [Editor, reactiveUtils, Search] = await locale$1.loadModules([
436
440
  "esri/widgets/Editor",
437
- "esri/core/reactiveUtils"
441
+ "esri/core/reactiveUtils",
442
+ "esri/widgets/Search"
438
443
  ]);
439
444
  this.Editor = Editor;
440
445
  this.reactiveUtils = reactiveUtils;
446
+ this.Search = Search;
441
447
  }
442
448
  /**
443
449
  * Display editor widget to create the new feature
@@ -491,6 +497,13 @@ const CreateFeature = class {
491
497
  }
492
498
  });
493
499
  this._editor.viewModel.addHandles(handle);
500
+ //Add handle to watch editor viewmodel state and then show the search widget
501
+ const formHandle = this.reactiveUtils.watch(() => this._editor.viewModel.state, (state) => {
502
+ if (state === 'creating-features') {
503
+ this.showSearchWidget = true;
504
+ }
505
+ });
506
+ this._editor.viewModel.addHandles(formHandle);
494
507
  }
495
508
  /**
496
509
  * Start creating the feature
@@ -509,6 +522,7 @@ const CreateFeature = class {
509
522
  //on sketch complete emit the event
510
523
  this._editor.viewModel.sketchViewModel.on("create", (evt) => {
511
524
  if (evt.state === "complete") {
525
+ this.showSearchWidget = false;
512
526
  this.drawComplete.emit();
513
527
  }
514
528
  });
@@ -525,6 +539,94 @@ const CreateFeature = class {
525
539
  this.hideEditorsElements();
526
540
  }
527
541
  }
542
+ /**
543
+ * Display search widget to search location
544
+ * @protected
545
+ */
546
+ async createSearchWidget() {
547
+ let searchOptions = {
548
+ view: this.mapView,
549
+ };
550
+ if (this.searchConfiguration) {
551
+ const searchConfiguration = this._getSearchConfig(this.searchConfiguration, this.mapView);
552
+ searchOptions = Object.assign({}, searchConfiguration);
553
+ }
554
+ this._search = new this.Search(searchOptions);
555
+ this._search.container = 'search-widget-ref';
556
+ this._search.popupEnabled = false;
557
+ this._search.resultGraphicEnabled = false;
558
+ const layer = await mapViewUtils.getLayerOrTable(this.mapView, this.selectedLayerId);
559
+ let pointGeometry = null;
560
+ // on search get the geometry of the searched location and pass it in sketchViewModel and go to featureForm page
561
+ this._search.on('search-complete', (e) => {
562
+ var _a;
563
+ void this.mapView.goTo(e.results[0].results[0].extent);
564
+ if (layer.geometryType === 'point') {
565
+ pointGeometry = (_a = e.results[0].results[0]) === null || _a === void 0 ? void 0 : _a.feature.geometry;
566
+ }
567
+ });
568
+ //Add handle to watch if search viewModel state is ready
569
+ const createFeatureHandle = this.reactiveUtils.watch(() => this._search.viewModel.state, (state) => {
570
+ if (state === 'ready') {
571
+ setTimeout(() => {
572
+ if (this._editor.viewModel.sketchViewModel.createGraphic && pointGeometry) {
573
+ this._editor.viewModel.sketchViewModel.createGraphic.set('geometry', pointGeometry);
574
+ this._editor.viewModel.sketchViewModel.complete();
575
+ this.hideEditorsElements();
576
+ }
577
+ }, 100);
578
+ }
579
+ });
580
+ this._search.viewModel.addHandles(createFeatureHandle);
581
+ }
582
+ /**
583
+ * Initialize the search widget based on user defined configuration
584
+ *
585
+ * @param searchConfiguration search configuration defined by the user
586
+ * @param view the current map view
587
+ *
588
+ * @protected
589
+ */
590
+ _getSearchConfig(searchConfiguration, view) {
591
+ const INCLUDE_DEFAULT_SOURCES = "includeDefaultSources";
592
+ const sources = searchConfiguration.sources;
593
+ if ((sources === null || sources === void 0 ? void 0 : sources.length) > 0) {
594
+ searchConfiguration[INCLUDE_DEFAULT_SOURCES] = false;
595
+ sources.forEach((source) => {
596
+ var _a, _b;
597
+ const isLayerSource = source.hasOwnProperty("layer");
598
+ if (isLayerSource) {
599
+ const layerSource = source;
600
+ const layerId = (_a = layerSource.layer) === null || _a === void 0 ? void 0 : _a.id;
601
+ const layerFromMap = layerId ? view.map.findLayerById(layerId) : null;
602
+ const layerUrl = (_b = layerSource === null || layerSource === void 0 ? void 0 : layerSource.layer) === null || _b === void 0 ? void 0 : _b.url;
603
+ if (layerFromMap) {
604
+ layerSource.layer = layerFromMap;
605
+ }
606
+ else if (layerUrl) {
607
+ layerSource.layer = new this.FeatureLayer(layerUrl);
608
+ }
609
+ }
610
+ });
611
+ sources === null || sources === void 0 ? void 0 : sources.forEach((source) => {
612
+ const isLocatorSource = source.hasOwnProperty("locator");
613
+ if (isLocatorSource) {
614
+ const locatorSource = source;
615
+ if ((locatorSource === null || locatorSource === void 0 ? void 0 : locatorSource.name) === "ArcGIS World Geocoding Service") {
616
+ const outFields = locatorSource.outFields || ["Addr_type", "Match_addr", "StAddr", "City"];
617
+ locatorSource.outFields = outFields;
618
+ locatorSource.singleLineFieldName = "SingleLine";
619
+ }
620
+ locatorSource.url = locatorSource.url;
621
+ delete locatorSource.url;
622
+ }
623
+ });
624
+ }
625
+ else {
626
+ searchConfiguration = Object.assign(Object.assign({}, searchConfiguration), { includeDefaultSources: true });
627
+ }
628
+ return searchConfiguration;
629
+ }
528
630
  /**
529
631
  * Hides the elements of editor widget
530
632
  * @protected
@@ -596,6 +698,7 @@ const FeatureList = class {
596
698
  this.noFeaturesFoundMsg = undefined;
597
699
  this.pageSize = 100;
598
700
  this.highlightOnMap = false;
701
+ this.highlightOnHover = false;
599
702
  this._featureItems = [];
600
703
  this._featuresCount = 0;
601
704
  this._isLoading = false;
@@ -615,6 +718,16 @@ const FeatureList = class {
615
718
  }
616
719
  //--------------------------------------------------------------------------
617
720
  //
721
+ // Methods (public)
722
+ /**
723
+ * Refresh the feature list which will fetch the latest features and update the features list
724
+ * @returns Promise that resolves when the operation is complete
725
+ */
726
+ async refresh() {
727
+ await this.initializeFeatureItems();
728
+ }
729
+ //--------------------------------------------------------------------------
730
+ //
618
731
  // Functions (lifecycle)
619
732
  //
620
733
  //--------------------------------------------------------------------------
@@ -623,6 +736,7 @@ const FeatureList = class {
623
736
  * @returns Promise when complete
624
737
  */
625
738
  async componentWillLoad() {
739
+ await this.initModules();
626
740
  await this._getTranslations();
627
741
  this._isLoading = true;
628
742
  this._popupUtils = new popupUtils.PopupUtils();
@@ -649,6 +763,17 @@ const FeatureList = class {
649
763
  // Functions (protected)
650
764
  //
651
765
  //--------------------------------------------------------------------------
766
+ /**
767
+ * Load esri javascript api modules
768
+ * @returns Promise resolving when function is done
769
+ * @protected
770
+ */
771
+ async initModules() {
772
+ const [Color] = await locale$1.loadModules([
773
+ "esri/Color"
774
+ ]);
775
+ this.Color = Color;
776
+ }
652
777
  /**
653
778
  * Initialize the features list using the selected layer
654
779
  * @protected
@@ -684,10 +809,7 @@ const FeatureList = class {
684
809
  */
685
810
  async featureClicked(event, selectedFeature) {
686
811
  //clear previous highlight and remove the highlightHandle
687
- if (this.highlightOnMap && this._highlightHandle) {
688
- this._highlightHandle.remove();
689
- this._highlightHandle = null;
690
- }
812
+ this.clearHighlights();
691
813
  //highlight on map only if it is selected item
692
814
  if (this.highlightOnMap) {
693
815
  const selectedFeatureObjectId = Number(event.target.value);
@@ -696,6 +818,31 @@ const FeatureList = class {
696
818
  }
697
819
  this.featureSelect.emit(selectedFeature);
698
820
  }
821
+ /**
822
+ * On feature hover in feature list highlight the feature on the map
823
+ * @param selectedFeature mouseovered feature graphic
824
+ * @protected
825
+ */
826
+ async onFeatureHover(selectedFeature) {
827
+ //clear previous highlight and remove the highlightHandle
828
+ this.clearHighlights();
829
+ if (this.highlightOnHover) {
830
+ const oId = selectedFeature.getObjectId();
831
+ const selectedLayerView = await mapViewUtils.getFeatureLayerView(this.mapView, this.selectedLayerId);
832
+ selectedLayerView.highlightOptions = { color: new this.Color("#FFFF00") };
833
+ this._highlightHandle = selectedLayerView.highlight([oId]);
834
+ }
835
+ }
836
+ /**
837
+ * Clears the highlight
838
+ * @protected
839
+ */
840
+ clearHighlights() {
841
+ //if a feature is already highlighted, then remove the highlight
842
+ if (this._highlightHandle) {
843
+ this._highlightHandle.remove();
844
+ }
845
+ }
699
846
  /**
700
847
  * Query the selected feature layer, in descending order of object id's
701
848
  * @param page 0th page number in the pagination item
@@ -746,7 +893,7 @@ const FeatureList = class {
746
893
  const oId = selectedFeature.attributes[this._selectedLayer.objectIdField].toString();
747
894
  //use object id if popupTitle is null or undefined
748
895
  popupTitle = popupTitle !== null && popupTitle !== void 0 ? popupTitle : oId;
749
- return (index.h("calcite-list-item", { onCalciteListItemSelect: (e) => { void this.featureClicked(e, selectedFeature); }, value: oId }, index.h("div", { class: "popup-title", slot: "content-start" }, popupTitle), index.h("calcite-icon", { icon: "chevron-right", scale: "s", slot: "content-end" })));
896
+ return (index.h("calcite-list-item", { onCalciteListItemSelect: (e) => { void this.featureClicked(e, selectedFeature); }, onMouseLeave: () => { void this.clearHighlights(); }, onMouseOver: () => { void this.onFeatureHover(selectedFeature); }, value: oId }, index.h("div", { class: "popup-title", slot: "content-start" }, popupTitle), index.h("calcite-icon", { icon: "chevron-right", scale: "s", slot: "content-end" })));
750
897
  }
751
898
  /**
752
899
  * Fetches the component's translations
@@ -826,7 +973,7 @@ const LayerList = class {
826
973
  render() {
827
974
  return (index.h(index.Fragment, null, this._isLoading && index.h("calcite-loader", { label: "", scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
828
975
  index.h("calcite-notice", { class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, index.h("div", { slot: "title" }, this._translations.error), index.h("div", { slot: "message" }, this.noLayerErrorMsg ? this.noLayerErrorMsg : this._noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
829
- index.h("calcite-list", { "selection-appearance": "border", "selection-mode": this.showNextIcon ? "none" : "single-persist" }, this.renderLayerList())));
976
+ index.h("calcite-list", { "selection-appearance": "border", "selection-mode": "none" }, this.renderLayerList())));
830
977
  }
831
978
  //--------------------------------------------------------------------------
832
979
  //
@@ -874,7 +1021,7 @@ const LayerList = class {
874
1021
  }
875
1022
  });
876
1023
  await Promise.all(def).then(() => {
877
- const editableLayerIds = this.getEditableIds(this._layerItemsHash);
1024
+ const editableLayerIds = this.getLayersToBeShownInList(this._layerItemsHash);
878
1025
  this._mapLayerIds = editableLayerIds.reverse();
879
1026
  this.handleNoLayersToDisplay();
880
1027
  }, () => {
@@ -890,17 +1037,17 @@ const LayerList = class {
890
1037
  this.layersListLoaded.emit(this._mapLayerIds);
891
1038
  }
892
1039
  /**
893
- * Returns the ids of all OR configured layers that support edits with the update capability
1040
+ * Returns the ids of all OR configured layers that needs to be shown in the list
894
1041
  * @param hash each layer item details
895
1042
  * @returns array of layer ids
896
1043
  */
897
- getEditableIds(hash) {
1044
+ getLayersToBeShownInList(hash) {
898
1045
  var _a;
899
1046
  const configuredLayers = ((_a = this.layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.layers : [];
900
1047
  return Object.keys(hash).reduce((prev, cur) => {
901
- let showLayer = hash[cur].supportsAdd;
1048
+ let showLayer = true;
902
1049
  if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
903
- showLayer = configuredLayers.indexOf(cur) > -1 ? hash[cur].supportsAdd : false;
1050
+ showLayer = configuredLayers.indexOf(cur) > -1;
904
1051
  }
905
1052
  if (showLayer) {
906
1053
  prev.push(cur);
@@ -1571,6 +1571,38 @@ const LayerTable = class {
1571
1571
  };
1572
1572
  LayerTable.style = layerTableCss;
1573
1573
 
1574
+ function joinAppProxies(map, config, appProxies) {
1575
+ if (appProxies) {
1576
+ appProxies.forEach((proxy) => {
1577
+ map.allLayers.forEach((layer) => {
1578
+ if (layer && layer.url === proxy.sourceUrl) {
1579
+ // directly change the layer url to the proxy url
1580
+ layer.url = proxy.proxyUrl;
1581
+ // Replace the layer's portalItem's url with the proxy url too, otherwise anonymous viewers get a sign-in prompt.
1582
+ if (layer.portalItem) {
1583
+ layer.portalItem.when(() => {
1584
+ // layer.portalItem exists, see above. Not sure why typescript thinks it could be undefined here.
1585
+ layer.portalItem.url = proxy.proxyUrl;
1586
+ });
1587
+ }
1588
+ // also add a request interceptor in case we missed any requests to the original url, or the jsapi team adds new requests in the future.
1589
+ config.request?.interceptors?.push({
1590
+ // this interceptor only applies to requests made to this proxy's sourceUrl (the layer's original url).
1591
+ urls: proxy.sourceUrl,
1592
+ before: (params) => {
1593
+ // change requests from the original url to the proxy url
1594
+ if (params.url && params.url === proxy.sourceUrl) {
1595
+ params.url = proxy.proxyUrl;
1596
+ }
1597
+ },
1598
+ });
1599
+ }
1600
+ });
1601
+ });
1602
+ }
1603
+ return map;
1604
+ }
1605
+
1574
1606
  const mapCardCss = ":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.box-shadow{box-shadow:none !important}.visibility-hidden-1{visibility:hidden;height:1px;}.display-none{display:none}";
1575
1607
 
1576
1608
  const MapCard = class {
@@ -1586,6 +1618,7 @@ const MapCard = class {
1586
1618
  * string: the id of map currently displayed
1587
1619
  */
1588
1620
  this._loadedId = "";
1621
+ this.appProxies = undefined;
1589
1622
  this.defaultWebmapId = "";
1590
1623
  this.enableHome = undefined;
1591
1624
  this.enableLegend = undefined;
@@ -1662,14 +1695,16 @@ const MapCard = class {
1662
1695
  * @protected
1663
1696
  */
1664
1697
  async _initModules() {
1665
- const [WebMap, MapView, Home] = await locale.loadModules([
1698
+ const [WebMap, MapView, Home, esriConfig] = await locale.loadModules([
1666
1699
  "esri/WebMap",
1667
1700
  "esri/views/MapView",
1668
- "esri/widgets/Home"
1701
+ "esri/widgets/Home",
1702
+ "esri/config"
1669
1703
  ]);
1670
1704
  this.WebMap = WebMap;
1671
1705
  this.MapView = MapView;
1672
1706
  this.Home = Home;
1707
+ this.esriConfig = esriConfig;
1673
1708
  }
1674
1709
  /**
1675
1710
  * Load the webmap for the provided webMapInfo
@@ -1690,6 +1725,10 @@ const MapCard = class {
1690
1725
  const webMap = new this.WebMap({
1691
1726
  portalItem: { id }
1692
1727
  });
1728
+ if (this.appProxies) {
1729
+ await webMap.load();
1730
+ await joinAppProxies(webMap, this.esriConfig, this.appProxies);
1731
+ }
1693
1732
  this.mapView = new this.MapView({
1694
1733
  container: this._mapDiv,
1695
1734
  map: webMap,
@@ -39,6 +39,7 @@ const CrowdsourceManager = class {
39
39
  * MapView.when is not fired when mapView is not currently visible
40
40
  */
41
41
  this._shouldSetMapView = false;
42
+ this.appProxies = undefined;
42
43
  this.defaultCenter = "";
43
44
  this.defaultGlobalId = "";
44
45
  this.defaultLayer = "";
@@ -326,7 +327,7 @@ const CrowdsourceManager = class {
326
327
  _getMapNode(panelOpen) {
327
328
  var _a;
328
329
  const mapContainerClass = this._layoutMode === interfaces.ELayoutMode.HORIZONTAL && (!this._isMobile || panelOpen) ? "" : "adjusted-height-50";
329
- return (index.h("div", { class: `${mapContainerClass} overflow-hidden` }, index.h("map-card", { basemapConfig: this.basemapConfig, class: "width-full", defaultWebmapId: this.defaultWebmap, enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableHome: this.enableHome, enableLegend: this.enableLegend, enableSearch: this.enableSearch, enableSingleExpand: true, hidden: this._expandPopup && !this._isMobile, homeZoomIndex: 3, homeZoomPosition: "top-left", homeZoomToolsSize: "s", mapInfos: (_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.filter(mapInfo => mapInfo.visible !== false), mapWidgetsIndex: 0, mapWidgetsPosition: "top-right", mapWidgetsSize: "m", stackTools: true, theme: this.theme, toolOrder: ["legend", "search", "fullscreen", "basemap", "floorfilter"] })));
330
+ return (index.h("div", { class: `${mapContainerClass} overflow-hidden` }, index.h("map-card", { appProxies: this.appProxies, basemapConfig: this.basemapConfig, class: "width-full", defaultWebmapId: this.defaultWebmap, enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableHome: this.enableHome, enableLegend: this.enableLegend, enableSearch: this.enableSearch, enableSingleExpand: true, hidden: this._expandPopup && !this._isMobile, homeZoomIndex: 3, homeZoomPosition: "top-left", homeZoomToolsSize: "s", mapInfos: (_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.filter(mapInfo => mapInfo.visible !== false), mapWidgetsIndex: 0, mapWidgetsPosition: "top-right", mapWidgetsSize: "m", stackTools: true, theme: this.theme, toolOrder: ["legend", "search", "fullscreen", "basemap", "floorfilter"] })));
330
331
  }
331
332
  /**
332
333
  * Get the expand node for the popup information