@esri/solutions-components 0.8.8 → 0.8.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. package/dist/assets/t9n/crowdsource-reporter/resources.json +11 -2
  2. package/dist/assets/t9n/crowdsource-reporter/resources_en.json +11 -2
  3. package/dist/cjs/{calcite-action-menu_2.cjs.entry.js → calcite-action-menu_3.cjs.entry.js} +114 -7
  4. package/dist/cjs/calcite-alert_4.cjs.entry.js +47 -5
  5. package/dist/cjs/{calcite-input-date-picker_3.cjs.entry.js → calcite-block_5.cjs.entry.js} +691 -13
  6. package/dist/cjs/{calcite-combobox_5.cjs.entry.js → calcite-combobox_3.cjs.entry.js} +876 -844
  7. package/dist/cjs/calcite-dropdown_4.cjs.entry.js +1023 -0
  8. package/dist/cjs/{calcite-flow_5.cjs.entry.js → calcite-flow_6.cjs.entry.js} +327 -2
  9. package/dist/cjs/card-manager_3.cjs.entry.js +5 -5
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +25 -17
  11. package/dist/cjs/crowdsource-reporter.cjs.entry.js +122 -21
  12. package/dist/cjs/{downloadUtils-8b05d7cc.js → downloadUtils-dd787ddf.js} +2 -2
  13. package/dist/cjs/{index.es-e7587227.js → index.es-29fa176d.js} +2 -2
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +8 -8
  16. package/dist/cjs/{mapViewUtils-3e0fa457.js → mapViewUtils-82018df6.js} +12 -6
  17. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  18. package/dist/cjs/solutions-components.cjs.js +1 -1
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/create-feature/create-feature.js +18 -0
  21. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +15 -0
  22. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +48 -16
  23. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +16 -0
  24. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +155 -35
  25. package/dist/collection/components/feature-details/feature-details.css +18 -0
  26. package/dist/collection/components/feature-details/feature-details.js +500 -0
  27. package/dist/collection/components/feature-details/test/feature-details.e2e.js +14 -0
  28. package/dist/collection/components/feature-details/test/feature-details.spec.js +22 -0
  29. package/dist/collection/components/feature-list/feature-list.js +14 -1
  30. package/dist/collection/components/info-card/info-card.css +15 -5
  31. package/dist/collection/components/info-card/info-card.js +179 -5
  32. package/dist/collection/components/layer-table/layer-table.js +2 -2
  33. package/dist/collection/components/map-card/map-card.js +1 -1
  34. package/dist/collection/components/map-select-tools/map-select-tools.js +5 -5
  35. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  36. package/dist/collection/demos/crowdsource-manager.html +7 -2
  37. package/dist/collection/demos/crowdsource-reporter.html +115 -1
  38. package/dist/collection/utils/mapViewUtils.js +12 -6
  39. package/dist/collection/utils/mapViewUtils.ts +14 -6
  40. package/dist/components/create-feature2.js +4 -0
  41. package/dist/components/crowdsource-manager.js +26 -18
  42. package/dist/components/crowdsource-reporter.js +270 -81
  43. package/dist/components/feature-details.d.ts +11 -0
  44. package/dist/components/feature-details.js +11 -0
  45. package/dist/components/feature-details2.js +449 -0
  46. package/dist/components/feature-list2.js +14 -1
  47. package/dist/components/info-card2.js +54 -5
  48. package/dist/components/layer-table2.js +2 -2
  49. package/dist/components/map-card2.js +1 -1
  50. package/dist/components/map-select-tools2.js +5 -5
  51. package/dist/components/mapViewUtils.js +12 -6
  52. package/dist/components/refine-selection2.js +1 -1
  53. package/dist/esm/{calcite-action-menu_2.entry.js → calcite-action-menu_3.entry.js} +118 -12
  54. package/dist/esm/calcite-alert_4.entry.js +47 -5
  55. package/dist/esm/{calcite-input-date-picker_3.entry.js → calcite-block_5.entry.js} +688 -12
  56. package/dist/esm/{calcite-combobox_5.entry.js → calcite-combobox_3.entry.js} +878 -844
  57. package/dist/esm/calcite-date-picker-day_3.entry.js +1 -1
  58. package/dist/esm/calcite-dropdown_4.entry.js +1016 -0
  59. package/dist/esm/{calcite-flow_5.entry.js → calcite-flow_6.entry.js} +327 -3
  60. package/dist/esm/card-manager_3.entry.js +5 -5
  61. package/dist/esm/crowdsource-manager.entry.js +26 -18
  62. package/dist/esm/crowdsource-reporter.entry.js +122 -21
  63. package/dist/esm/{date-5630530d.js → date-0c026a8b.js} +1 -1
  64. package/dist/esm/{downloadUtils-0c1e4d7b.js → downloadUtils-25aa808f.js} +2 -2
  65. package/dist/esm/{index.es-286e3cfa.js → index.es-a16c9db4.js} +2 -2
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/map-select-tools_3.entry.js +8 -8
  68. package/dist/esm/{mapViewUtils-253178f1.js → mapViewUtils-c83c03a4.js} +12 -6
  69. package/dist/esm/public-notification.entry.js +2 -2
  70. package/dist/esm/solutions-components.js +1 -1
  71. package/dist/solutions-components/demos/crowdsource-manager.html +7 -2
  72. package/dist/solutions-components/demos/crowdsource-reporter.html +115 -1
  73. package/dist/solutions-components/p-2f687975.entry.js +17 -0
  74. package/dist/solutions-components/{p-813fd8a4.entry.js → p-3e5085ae.entry.js} +2 -2
  75. package/dist/solutions-components/p-40039b84.entry.js +6 -0
  76. package/dist/solutions-components/p-511b1c91.entry.js +23 -0
  77. package/dist/solutions-components/{p-94de9279.js → p-5817d78c.js} +1 -1
  78. package/dist/solutions-components/{p-15f9624a.entry.js → p-58997cc1.entry.js} +1 -1
  79. package/dist/solutions-components/p-82e398cb.entry.js +17 -0
  80. package/dist/solutions-components/p-ae75d7d7.entry.js +6 -0
  81. package/dist/solutions-components/{p-331b5d1e.js → p-b1376c75.js} +2 -2
  82. package/dist/solutions-components/p-b5acfcd8.entry.js +6 -0
  83. package/dist/solutions-components/{p-212b02e7.js → p-bdd77f17.js} +1 -1
  84. package/dist/solutions-components/{p-038fcd93.entry.js → p-c273ab7a.entry.js} +1 -1
  85. package/dist/solutions-components/p-d742b915.entry.js +29 -0
  86. package/dist/solutions-components/p-d9c89479.js +36 -0
  87. package/dist/solutions-components/p-dfad61a8.entry.js +24 -0
  88. package/dist/solutions-components/p-fffc9e08.entry.js +6 -0
  89. package/dist/solutions-components/solutions-components.esm.js +1 -1
  90. package/dist/solutions-components/utils/mapViewUtils.ts +14 -6
  91. package/dist/types/components/create-feature/create-feature.d.ts +4 -4
  92. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +13 -1
  93. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +91 -10
  94. package/dist/types/components/feature-details/feature-details.d.ts +151 -0
  95. package/dist/types/components/feature-list/feature-list.d.ts +6 -0
  96. package/dist/types/components/info-card/info-card.d.ts +33 -1
  97. package/dist/types/components.d.ts +148 -12
  98. package/dist/types/preact.d.ts +9 -2
  99. package/dist/types/utils/mapViewUtils.d.ts +5 -3
  100. package/package.json +1 -1
  101. package/dist/cjs/calcite-block_2.cjs.entry.js +0 -652
  102. package/dist/cjs/calcite-graph_2.cjs.entry.js +0 -1055
  103. package/dist/cjs/calcite-scrim.cjs.entry.js +0 -125
  104. package/dist/cjs/utils-7bc7f595.js +0 -64
  105. package/dist/esm/calcite-block_2.entry.js +0 -647
  106. package/dist/esm/calcite-graph_2.entry.js +0 -1050
  107. package/dist/esm/calcite-scrim.entry.js +0 -121
  108. package/dist/esm/utils-9fb4104a.js +0 -61
  109. package/dist/solutions-components/p-04c37d69.entry.js +0 -17
  110. package/dist/solutions-components/p-0b92e4b1.entry.js +0 -11
  111. package/dist/solutions-components/p-13ca3b00.entry.js +0 -6
  112. package/dist/solutions-components/p-238d3b5f.entry.js +0 -6
  113. package/dist/solutions-components/p-3af79063.js +0 -36
  114. package/dist/solutions-components/p-80b11ec1.entry.js +0 -17
  115. package/dist/solutions-components/p-a3a11749.entry.js +0 -6
  116. package/dist/solutions-components/p-aec06ce4.entry.js +0 -18
  117. package/dist/solutions-components/p-bfdf89c2.js +0 -11
  118. package/dist/solutions-components/p-c4ff3b52.entry.js +0 -17
  119. package/dist/solutions-components/p-ced067bd.entry.js +0 -17
  120. package/dist/solutions-components/p-d136eab0.entry.js +0 -23
  121. package/dist/solutions-components/p-e0446d5b.entry.js +0 -6
@@ -13,6 +13,7 @@
13
13
  "components/delete-button/delete-button.js",
14
14
  "components/edit-card/edit-card.js",
15
15
  "components/feature-comments/feature-comments.js",
16
+ "components/feature-details/feature-details.js",
16
17
  "components/feature-form-flow-item/feature-form-flow-item.js",
17
18
  "components/feature-list/feature-list.js",
18
19
  "components/features-flow-item/features-flow-item.js",
@@ -167,6 +167,7 @@ export class CreateFeature {
167
167
  //Add handle to watch featureTemplatesViewModel ready state and then start the creation
168
168
  const handle = this.reactiveUtils.watch(() => this._editor.viewModel.featureTemplatesViewModel.state, (state) => {
169
169
  if (state === 'ready') {
170
+ this.progressStatus.emit(0.5);
170
171
  void this.startCreate();
171
172
  }
172
173
  });
@@ -190,6 +191,7 @@ export class CreateFeature {
190
191
  //once the feature template is selected handle the event for formSubmit and sketch complete
191
192
  //also, hide the headers and footer in the editor as we will be showing our own submit and cancel button
192
193
  this._editor.viewModel.featureTemplatesViewModel.on('select', () => {
194
+ this.progressStatus.emit(0.75);
193
195
  setTimeout(() => {
194
196
  //on form submit
195
197
  this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
@@ -197,6 +199,7 @@ export class CreateFeature {
197
199
  this._editor.viewModel.sketchViewModel.on("create", (evt) => {
198
200
  if (evt.state === "complete") {
199
201
  this.showSearchWidget = false;
202
+ this.progressStatus.emit(1);
200
203
  this.drawComplete.emit();
201
204
  }
202
205
  });
@@ -516,6 +519,21 @@ export class CreateFeature {
516
519
  "resolved": "boolean",
517
520
  "references": {}
518
521
  }
522
+ }, {
523
+ "method": "progressStatus",
524
+ "name": "progressStatus",
525
+ "bubbles": true,
526
+ "cancelable": true,
527
+ "composed": true,
528
+ "docs": {
529
+ "tags": [],
530
+ "text": "Emitted on demand when editor panel changes"
531
+ },
532
+ "complexType": {
533
+ "original": "number",
534
+ "resolved": "number",
535
+ "references": {}
536
+ }
519
537
  }];
520
538
  }
521
539
  static get methods() {
@@ -186,3 +186,18 @@
186
186
  .border-bottom-width-0 {
187
187
  border-bottom-width: 0px;
188
188
  }
189
+
190
+ .floating-container {
191
+ position: fixed;
192
+ width: 100px;
193
+ height: 10px;
194
+ bottom: 0;
195
+ right: 0;
196
+ margin: 100px 0px;
197
+ }
198
+
199
+ .floating-container .floating-button {
200
+ box-shadow: 0 10px 25px rgb(92 93 94 / 60%);
201
+ transform: translatey(5px);
202
+ transition: all 0.3s;
203
+ }
@@ -64,7 +64,7 @@ export class CrowdsourceManager {
64
64
  this.enableSearch = true;
65
65
  this.enableShare = false;
66
66
  this.enableZoom = true;
67
- this.hideMapOnLoad = undefined;
67
+ this.hideMapOnLoad = false;
68
68
  this.mapInfos = [];
69
69
  this.onlyShowUpdatableLayers = true;
70
70
  this.popupHeaderColor = undefined;
@@ -78,7 +78,7 @@ export class CrowdsourceManager {
78
78
  this.theme = "light";
79
79
  this.zoomAndScrollToSelected = false;
80
80
  this.zoomToScale = undefined;
81
- this._expandPopup = false;
81
+ this._expandPopup = this.hideMapOnLoad;
82
82
  this._hideFooter = false;
83
83
  this._hideTable = false;
84
84
  this._isMobile = undefined;
@@ -102,16 +102,6 @@ export class CrowdsourceManager {
102
102
  enableZoomWatchHandler() {
103
103
  this._initMapZoom();
104
104
  }
105
- //--------------------------------------------------------------------------
106
- //
107
- // Methods (public)
108
- //
109
- //--------------------------------------------------------------------------
110
- //--------------------------------------------------------------------------
111
- //
112
- // Events (public)
113
- //
114
- //--------------------------------------------------------------------------
115
105
  /**
116
106
  * Listen for changes in feature selection and show or hide the map, popup, and table
117
107
  */
@@ -158,7 +148,6 @@ export class CrowdsourceManager {
158
148
  async beforeMapChanged() {
159
149
  if (this._expandPopup) {
160
150
  this._shouldSetMapView = true;
161
- this._expandPopup = false;
162
151
  }
163
152
  }
164
153
  /**
@@ -171,6 +160,12 @@ export class CrowdsourceManager {
171
160
  this._layer = layer;
172
161
  });
173
162
  }
163
+ /**
164
+ * Update the state expandPopup when mapInfoChange event occurs
165
+ */
166
+ async mapInfoChange() {
167
+ this._expandPopup = this.hideMapOnLoad;
168
+ }
174
169
  //--------------------------------------------------------------------------
175
170
  //
176
171
  // Functions (lifecycle)
@@ -310,7 +305,14 @@ export class CrowdsourceManager {
310
305
  */
311
306
  _getBody(layoutMode, panelOpen, hideTable) {
312
307
  const contentClass = layoutMode === ELayoutMode.HORIZONTAL ? "" : "display-flex";
313
- return (h("calcite-panel", { class: "width-full height-full" }, h("div", { class: `width-full height-full overflow-hidden ${contentClass}` }, this._getMapAndCard(layoutMode, panelOpen, hideTable), this._getTable(layoutMode, panelOpen, hideTable))));
308
+ const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
309
+ return (h("calcite-panel", { class: "width-full height-full" }, h("div", { class: `width-full height-full overflow-hidden ${contentClass}` }, this._getMapAndCard(layoutMode, panelOpen, hideTable), this._getTable(layoutMode, panelOpen, hideTable)), h("div", { class: "floating-container", onClick: this.infoButtonClick.bind(this) }, h("calcite-button", { appearance: "solid", class: `floating-button ${themeClass}`, "icon-start": "information-letter", kind: "neutral", label: "", round: true, scale: "l", "split-child": "primary", width: "auto" }))));
310
+ }
311
+ /**
312
+ * Emit the event when info button clicked
313
+ */
314
+ infoButtonClick() {
315
+ this.infoIconButtonClick.emit();
314
316
  }
315
317
  /**
316
318
  * Get the map and card nodes based for the current layout options
@@ -356,7 +358,12 @@ export class CrowdsourceManager {
356
358
  const headerClass = this._isMobile ? "display-none height-0" : "";
357
359
  const headerTheme = !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
358
360
  const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
359
- return (h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass}` }, h("calcite-panel", null, !this._isMobile ? (h("div", { class: `display-flex align-items-center ${headerClass}`, slot: "header-content" }, h("calcite-icon", { icon: "information", scale: "s" }), h("div", { class: "padding-inline-start-75" }, this._translations.information))) : undefined, h("calcite-action", { class: headerClass, disabled: this._tableOnly, icon: icon, id: id, onClick: () => this._togglePopup(), slot: "header-actions-end", text: "" }), !this._tableOnly ? h("calcite-tooltip", { class: themeClass, label: "", placement: "bottom", "reference-element": id }, h("span", null, tooltip)) : undefined, this._getCardNode())));
361
+ return (h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass}`, style: {
362
+ '--calcite-color-foreground-1': this.popupHeaderColor,
363
+ '--calcite-color-foreground-2': this.popupHeaderHoverColor,
364
+ '--calcite-color-text-3': this.popupHeaderHoverTextColor,
365
+ '--calcite-color-text-2': this.popupHeaderTextColor, /* font color to apply to the popup header */
366
+ } }, h("calcite-panel", null, !this._isMobile ? (h("div", { class: `display-flex align-items-center ${headerClass}`, slot: "header-content" }, h("calcite-icon", { icon: "information", scale: "s" }), h("div", { class: "padding-inline-start-75" }, this._translations.information))) : undefined, h("calcite-action", { class: headerClass, disabled: this._tableOnly, icon: icon, id: id, onClick: () => this._togglePopup(), slot: "header-actions-end", text: "" }), !this._tableOnly ? h("calcite-tooltip", { class: themeClass, label: "", placement: "bottom", "reference-element": id }, h("span", null, tooltip)) : undefined, this._getCardNode())));
360
367
  }
361
368
  /**
362
369
  * Toggle the popup information
@@ -888,7 +895,8 @@ export class CrowdsourceManager {
888
895
  "text": "boolean: when true the map will be hidden on load"
889
896
  },
890
897
  "attribute": "hide-map-on-load",
891
- "reflect": false
898
+ "reflect": false,
899
+ "defaultValue": "false"
892
900
  },
893
901
  "mapInfos": {
894
902
  "type": "unknown",
@@ -1148,6 +1156,24 @@ export class CrowdsourceManager {
1148
1156
  "_tableOnly": {}
1149
1157
  };
1150
1158
  }
1159
+ static get events() {
1160
+ return [{
1161
+ "method": "infoIconButtonClick",
1162
+ "name": "infoIconButtonClick",
1163
+ "bubbles": true,
1164
+ "cancelable": true,
1165
+ "composed": true,
1166
+ "docs": {
1167
+ "tags": [],
1168
+ "text": "Emitted on demand when a info button is clicked"
1169
+ },
1170
+ "complexType": {
1171
+ "original": "void",
1172
+ "resolved": "void",
1173
+ "references": {}
1174
+ }
1175
+ }];
1176
+ }
1151
1177
  static get elementRef() { return "el"; }
1152
1178
  static get watchers() {
1153
1179
  return [{
@@ -1198,6 +1224,12 @@ export class CrowdsourceManager {
1198
1224
  "target": "window",
1199
1225
  "capture": false,
1200
1226
  "passive": false
1227
+ }, {
1228
+ "name": "mapInfoChange",
1229
+ "method": "mapInfoChange",
1230
+ "target": "window",
1231
+ "capture": false,
1232
+ "passive": false
1201
1233
  }];
1202
1234
  }
1203
1235
  }
@@ -49,6 +49,10 @@
49
49
  width: calc(100% - 20px);
50
50
  }
51
51
 
52
+ .progress-bar {
53
+ padding: 12px;
54
+ }
55
+
52
56
  .footer-top-button {
53
57
  padding-bottom: 7px;
54
58
  }
@@ -57,6 +61,18 @@
57
61
  height: 35px;
58
62
  }
59
63
 
64
+ .feature-pagination {
65
+ align-items: center;
66
+ margin: 5% 124%;
67
+ display: flex;
68
+ }
69
+
70
+ .pagination-count {
71
+ width: 32px;
72
+ color: var(--calcite-color-brand);
73
+ border-bottom: 1px solid var(--calcite-color-brand);
74
+ }
75
+
60
76
  .report-submitted-msg {
61
77
  position: absolute;
62
78
  z-index: 1000;
@@ -34,7 +34,6 @@ export class CrowdsourceReporter {
34
34
  this.enableComments = undefined;
35
35
  this.enableLogin = undefined;
36
36
  this.enableNewReports = undefined;
37
- this.layers = undefined;
38
37
  this.loginTitle = undefined;
39
38
  this.mapView = undefined;
40
39
  this.layerId = undefined;
@@ -54,6 +53,7 @@ export class CrowdsourceReporter {
54
53
  this.theme = "light";
55
54
  this.enableZoom = true;
56
55
  this.zoomToScale = undefined;
56
+ this.layerExpressions = undefined;
57
57
  this._mapInfo = undefined;
58
58
  this._flowItems = [];
59
59
  this._sidePanelCollapsed = false;
@@ -62,7 +62,11 @@ export class CrowdsourceReporter {
62
62
  this._selectedLayerName = undefined;
63
63
  this._reportSubmitted = false;
64
64
  this._showSubmitCancelButton = false;
65
+ this._loadingFeatureDetails = undefined;
65
66
  this._featureCreationFailedErrorMsg = undefined;
67
+ this._updatedProgressBarStatus = 0.25;
68
+ this._filterOpen = false;
69
+ this._filterActive = false;
66
70
  }
67
71
  //--------------------------------------------------------------------------
68
72
  //
@@ -83,6 +87,18 @@ export class CrowdsourceReporter {
83
87
  await this.setMapView();
84
88
  });
85
89
  }
90
+ /**
91
+ * On Feature details change update the Layer title and the current selected layer id
92
+ * @param evt Event hold the details of current feature graphic in the info-card
93
+ */
94
+ async selectionChanged(evt) {
95
+ void this.updatingFeatureDetails(true);
96
+ this.setCurrentFeature(evt.detail.selectedFeature[0]);
97
+ void this.highlightOnMap(evt.detail.selectedFeature[0]);
98
+ this.selectedFeatureIndex = evt.detail.selectedFeatureIndex;
99
+ //update the feature details to reflect the like dislike values
100
+ await this._featureDetails.refresh(evt.detail.selectedFeature[0]);
101
+ }
86
102
  //--------------------------------------------------------------------------
87
103
  //
88
104
  // Functions (lifecycle)
@@ -99,6 +115,10 @@ export class CrowdsourceReporter {
99
115
  await this._initModules();
100
116
  await this._getTranslations();
101
117
  await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.when(async () => {
118
+ //set configured reporting layers array
119
+ this.layers = this.reportingOptions ? Object.keys(this.reportingOptions).filter((layerId) => {
120
+ return this.reportingOptions[layerId].reporting;
121
+ }) : [];
102
122
  await this.setMapView();
103
123
  }));
104
124
  }
@@ -107,7 +127,7 @@ export class CrowdsourceReporter {
107
127
  */
108
128
  render() {
109
129
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
110
- return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter()))));
130
+ return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter())), this.filterModal()));
111
131
  }
112
132
  //--------------------------------------------------------------------------
113
133
  //
@@ -171,6 +191,54 @@ export class CrowdsourceReporter {
171
191
  ? h("calcite-flow", null, (renderLists === null || renderLists === void 0 ? void 0 : renderLists.length) > 0 && renderLists)
172
192
  : h("calcite-loader", { label: "", scale: "m" })));
173
193
  }
194
+ /**
195
+ * Show filter component in modal
196
+ * @returns node to interact with any configured filters for the current layer
197
+ */
198
+ filterModal() {
199
+ var _a, _b;
200
+ //get layer expression for current selected layer
201
+ const currentLayersExpressions = this.layerExpressions ? this.layerExpressions.filter((exp) => exp.id === this._selectedLayerId) : [];
202
+ return (currentLayersExpressions.length > 0 &&
203
+ h("calcite-modal", { "aria-labelledby": "modal-title", class: "modal", kind: "brand", onCalciteModalClose: () => void this._closeFilter(), open: this._filterOpen, widthScale: "s" }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, (_b = (_a = this._translations) === null || _a === void 0 ? void 0 : _a.filterLayerTitle) === null || _b === void 0 ? void 0 : _b.replace("{{title}}", this._selectedLayerName)), h("div", { slot: "content" }, h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtn: true, closeBtnOnClick: async () => this._closeFilter(), comboboxOverlayPositioning: "fixed", layerExpressions: currentLayersExpressions, onFilterListReset: () => this._handleFilterListReset(), onFilterUpdate: () => this._handleFilterUpdate(), ref: (el) => this._filterList = el, view: this.mapView, zoomBtn: false }))));
204
+ }
205
+ /**
206
+ * Close the filter modal
207
+ * @protected
208
+ */
209
+ _closeFilter() {
210
+ if (this._filterOpen) {
211
+ this._filterOpen = false;
212
+ }
213
+ }
214
+ /**
215
+ * When true the filter modal will be displayed
216
+ * @protected
217
+ */
218
+ _toggleFilter() {
219
+ this._filterOpen = !this._filterOpen;
220
+ }
221
+ /**
222
+ * Reset the filter active prop
223
+ * @protected
224
+ */
225
+ _handleFilterListReset() {
226
+ //on reset filter list reset the filter active state
227
+ this._filterActive = false;
228
+ //reset the features list to reflect the applied filters
229
+ void this._featureList.refresh();
230
+ }
231
+ /**
232
+ * Check if the layers definitionExpression has been modified
233
+ * @protected
234
+ */
235
+ _handleFilterUpdate() {
236
+ //if filter are applied the url params will be generated
237
+ //set the filter active state based on the length of applied filters
238
+ this._filterActive = this._filterList.urlParams.getAll('filter').length > 0;
239
+ //reset the features list to reflect the applied filters
240
+ void this._featureList.refresh();
241
+ }
174
242
  /**
175
243
  * Get the feature layer list
176
244
  * @returns the layer list items
@@ -187,7 +255,7 @@ export class CrowdsourceReporter {
187
255
  * @protected
188
256
  */
189
257
  getChooseCategoryFlowItem() {
190
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.navigateToCreateFeature.bind(this), showFeatureCount: false, showNextIcon: false }))));
258
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("calcite-panel", { "full-height": true, "full-width": true }, h("div", { class: "progress-bar" }, h("calcite-progress", { type: "determinate", value: this._updatedProgressBarStatus })), h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.navigateToCreateFeature.bind(this), showFeatureCount: false, showNextIcon: false }))));
191
259
  }
192
260
  /**
193
261
  * Get Feature create form of the selected feature layer
@@ -195,7 +263,15 @@ export class CrowdsourceReporter {
195
263
  * @protected
196
264
  */
197
265
  getFeatureCreateFlowItem() {
198
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.featureEditFormInfoMsg)), h("create-feature", { customizeSubmit: true, mapView: this.mapView, onDrawComplete: this.onDrawComplete.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, searchConfiguration: this.searchConfiguration, selectedLayerId: this._selectedLayerId }))));
266
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("div", { class: "progress-bar" }, h("calcite-progress", { type: "determinate", value: this._updatedProgressBarStatus })), h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.featureEditFormInfoMsg)), h("create-feature", { customizeSubmit: true, mapView: this.mapView, onDrawComplete: this.onDrawComplete.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onProgressStatus: this.updatedProgressStatus.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, searchConfiguration: this.searchConfiguration, selectedLayerId: this._selectedLayerId }))));
267
+ }
268
+ /**
269
+ * Update the progress bar status when editor panel changes
270
+ * @param evt Event which has progress bar status
271
+ * @protected
272
+ */
273
+ updatedProgressStatus(evt) {
274
+ this._updatedProgressBarStatus = evt.detail;
199
275
  }
200
276
  /**
201
277
  * When drawing of incident location completed on map show the submit and cancel button
@@ -217,7 +293,7 @@ export class CrowdsourceReporter {
217
293
  */
218
294
  onSubmitButtonClick() {
219
295
  if (this._createFeature) {
220
- this._createFeature.submit();
296
+ void this._createFeature.submit();
221
297
  }
222
298
  }
223
299
  /**
@@ -226,7 +302,7 @@ export class CrowdsourceReporter {
226
302
  */
227
303
  backFromCreateFeaturePanel() {
228
304
  if (this._createFeature) {
229
- this._createFeature.close();
305
+ void this._createFeature.close();
230
306
  }
231
307
  this.backFromSelectedPanel();
232
308
  }
@@ -253,10 +329,10 @@ export class CrowdsourceReporter {
253
329
  */
254
330
  async navigateToHomePage() {
255
331
  if (this._createFeature) {
256
- this._createFeature.close();
332
+ void this._createFeature.close();
257
333
  }
258
334
  if (this._layerList) {
259
- this._layerList.refresh();
335
+ void this._layerList.refresh();
260
336
  }
261
337
  this.setSelectedFeatures([]);
262
338
  if (this._editableLayerIds.length === 1) {
@@ -324,6 +400,7 @@ export class CrowdsourceReporter {
324
400
  * @protected
325
401
  */
326
402
  backFromSelectedPanel() {
403
+ this._updatedProgressBarStatus = 0.25;
327
404
  const updatedFlowItems = [...this._flowItems];
328
405
  updatedFlowItems.pop();
329
406
  this.clearHighlights();
@@ -350,6 +427,13 @@ export class CrowdsourceReporter {
350
427
  this.setSelectedFeatures([evt.detail]);
351
428
  this._flowItems = [...this._flowItems, "feature-details"];
352
429
  }
430
+ /**
431
+ * Show loading indicator while updating the feature details component
432
+ * @param isLoading is feature detail component loading
433
+ */
434
+ async updatingFeatureDetails(isLoading) {
435
+ this._loadingFeatureDetails = isLoading;
436
+ }
353
437
  /**
354
438
  * Get feature list of the selected feature layer
355
439
  * @param layerId Layer id
@@ -358,7 +442,10 @@ export class CrowdsourceReporter {
358
442
  * @protected
359
443
  */
360
444
  getFeatureListFlowItem(layerId, layerName) {
361
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
445
+ var _a;
446
+ const layerExpressions = (_a = this.layerExpressions) === null || _a === void 0 ? void 0 : _a.filter((exp) => exp.id === this._selectedLayerId);
447
+ const showFilterIcon = layerExpressions.length > 0;
448
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, showFilterIcon && h("calcite-action", { icon: "filter", indicator: this._filterActive, onClick: this._toggleFilter.bind(this), slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
362
449
  h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", highlightOnHover: true, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, ref: el => this._featureList = el, selectedLayerId: layerId }))));
363
450
  }
364
451
  /**
@@ -366,7 +453,15 @@ export class CrowdsourceReporter {
366
453
  * @returns Node
367
454
  */
368
455
  getFeatureDetailsFlowItem() {
369
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), h("calcite-panel", { "full-height": true }, h("info-card", { allowEditing: false, graphics: this._selectedFeature, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: this.featureDetailsChanged.bind(this), zoomAndScrollToSelected: true }))));
456
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._loadingFeatureDetails, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), h("calcite-panel", null, this._selectedFeature.length > 1 && this.getFeaturesPagination(), h("feature-details", { class: 'full-height', graphics: this._selectedFeature, mapView: this.mapView, onLoadingStatus: (evt) => { void this.updatingFeatureDetails(evt.detail); }, ref: el => this._featureDetails = el, reportingOptions: this.reportingOptions }))));
457
+ }
458
+ /**
459
+ * Returns the pagination for the multiple features
460
+ * Create pagination to avoid the overlap of like, dislike and comment section
461
+ * @returns Node
462
+ */
463
+ getFeaturesPagination() {
464
+ return (h("div", { class: "feature-pagination", slot: "header-actions-start" }, h("div", null, h("calcite-button", { appearance: 'transparent', disabled: false, iconStart: "chevron-left", id: "solutions-back", onClick: () => void this._featureDetails.back(), scale: "s", width: "full" }), h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-back" }, h("span", null, this._translations.back))), h("calcite-button", { appearance: 'transparent', class: 'pagination-action', onClick: () => void this._featureDetails.toggleListView(), scale: "s" }, h("span", { class: "pagination-count" }, this._getCount())), h("div", null, h("calcite-button", { appearance: "transparent", disabled: false, iconStart: "chevron-right", id: "solutions-next", onClick: () => void this._featureDetails.next(), scale: "s", width: "full" }), h("calcite-tooltip", { placement: "top", "reference-element": "solutions-next" }, h("span", null, this._translations.next)))));
370
465
  }
371
466
  /**
372
467
  * Sets the selected features and updates the first feature as the current selected feature
@@ -394,14 +489,6 @@ export class CrowdsourceReporter {
394
489
  }
395
490
  this._updateShareURL();
396
491
  }
397
- /**
398
- * On Feature details change update the Layer title and the current selected layer id
399
- * @param evt Event hold the details of current feature graphic in the info-card
400
- */
401
- featureDetailsChanged(evt) {
402
- this.setCurrentFeature(evt.detail[0]);
403
- void this.highlightOnMap(evt.detail[0]);
404
- }
405
492
  /**
406
493
  * Highlights the feature on map
407
494
  * @param selectedFeature Graphic currently shown in feature details
@@ -414,8 +501,9 @@ export class CrowdsourceReporter {
414
501
  const selectedLayerView = await getFeatureLayerView(this.mapView, selectedFeature.layer.id);
415
502
  // remove previous highlight options (if any) to highlight the feature by default color
416
503
  selectedLayerView.highlightOptions = null;
417
- this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true);
504
+ this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true, this.zoomToScale);
418
505
  }
506
+ void this.updatingFeatureDetails(false);
419
507
  }
420
508
  /**
421
509
  * Clears the highlight
@@ -521,6 +609,19 @@ export class CrowdsourceReporter {
521
609
  }
522
610
  }
523
611
  }
612
+ /**
613
+ * Get the current index of total string
614
+ *
615
+ * @returns the index of total string
616
+ * @protected
617
+ */
618
+ _getCount() {
619
+ const index = (this.selectedFeatureIndex + 1).toString();
620
+ const total = this._selectedFeature.length.toString();
621
+ return this._translations.indexOfTotal
622
+ .replace("{{index}}", index)
623
+ .replace("{{total}}", total);
624
+ }
524
625
  /**
525
626
  * Fetches the component's translations
526
627
  * @returns Promise when complete
@@ -769,21 +870,6 @@ export class CrowdsourceReporter {
769
870
  "attribute": "enable-new-reports",
770
871
  "reflect": false
771
872
  },
772
- "layers": {
773
- "type": "unknown",
774
- "mutable": false,
775
- "complexType": {
776
- "original": "string[]",
777
- "resolved": "string[]",
778
- "references": {}
779
- },
780
- "required": false,
781
- "optional": false,
782
- "docs": {
783
- "tags": [],
784
- "text": "string[]: list of layer ids"
785
- }
786
- },
787
873
  "loginTitle": {
788
874
  "type": "string",
789
875
  "mutable": false,
@@ -1133,6 +1219,27 @@ export class CrowdsourceReporter {
1133
1219
  },
1134
1220
  "attribute": "zoom-to-scale",
1135
1221
  "reflect": false
1222
+ },
1223
+ "layerExpressions": {
1224
+ "type": "unknown",
1225
+ "mutable": false,
1226
+ "complexType": {
1227
+ "original": "ILayerExpression[]",
1228
+ "resolved": "ILayerExpression[]",
1229
+ "references": {
1230
+ "ILayerExpression": {
1231
+ "location": "import",
1232
+ "path": "../../utils/interfaces",
1233
+ "id": "src/utils/interfaces.ts::ILayerExpression"
1234
+ }
1235
+ }
1236
+ },
1237
+ "required": false,
1238
+ "optional": false,
1239
+ "docs": {
1240
+ "tags": [],
1241
+ "text": "ILayerExpression[]: Array of layer expressions for layers (filter configuration)"
1242
+ }
1136
1243
  }
1137
1244
  };
1138
1245
  }
@@ -1146,7 +1253,11 @@ export class CrowdsourceReporter {
1146
1253
  "_selectedLayerName": {},
1147
1254
  "_reportSubmitted": {},
1148
1255
  "_showSubmitCancelButton": {},
1149
- "_featureCreationFailedErrorMsg": {}
1256
+ "_loadingFeatureDetails": {},
1257
+ "_featureCreationFailedErrorMsg": {},
1258
+ "_updatedProgressBarStatus": {},
1259
+ "_filterOpen": {},
1260
+ "_filterActive": {}
1150
1261
  };
1151
1262
  }
1152
1263
  static get events() {
@@ -1177,4 +1288,13 @@ export class CrowdsourceReporter {
1177
1288
  "methodName": "mapViewWatchHandler"
1178
1289
  }];
1179
1290
  }
1291
+ static get listeners() {
1292
+ return [{
1293
+ "name": "selectionChanged",
1294
+ "method": "selectionChanged",
1295
+ "target": "window",
1296
+ "capture": false,
1297
+ "passive": false
1298
+ }];
1299
+ }
1180
1300
  }
@@ -0,0 +1,18 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .buttons{
6
+ align-items: center;
7
+ background-color: white;
8
+ display: flex;
9
+ padding: 10px 0 10px 15px;
10
+ border-block-start: 1px solid var(--calcite-color-border-3);
11
+ border-block-end: 1px solid var(--calcite-color-border-3);
12
+ }
13
+
14
+ .comment-btn{
15
+ display: flex;
16
+ gap: 5px;
17
+ width: 35px;
18
+ }