@esri/solutions-components 0.10.42 → 0.10.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. package/dist/cjs/calcite-action-pad_2.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-block_5.cjs.entry.js +25 -26
  3. package/dist/cjs/card-manager_3.cjs.entry.js +32 -4
  4. package/dist/cjs/{constants-51cf394f.js → constants-bed33322.js} +3 -11
  5. package/dist/cjs/crowdsource-reporter.cjs.entry.js +112 -49
  6. package/dist/cjs/{helpers-afcac967.js → helpers-0493759d.js} +1 -1
  7. package/dist/cjs/instant-apps-app-guide.cjs.entry.js +2 -2
  8. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +3 -3
  9. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +1 -1
  10. package/dist/cjs/instant-apps-create.cjs.entry.js +2 -2
  11. package/dist/cjs/instant-apps-export-views.cjs.entry.js +2 -2
  12. package/dist/cjs/instant-apps-export.cjs.entry.js +2 -2
  13. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +2 -2
  14. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +2 -2
  15. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +2 -2
  16. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +21 -7
  17. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +3 -3
  18. package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +2 -2
  19. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +7 -7
  20. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +6 -6
  21. package/dist/cjs/instant-apps-measurement.cjs.entry.js +2 -2
  22. package/dist/cjs/instant-apps-popover.cjs.entry.js +2 -2
  23. package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +2 -2
  24. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +2 -2
  25. package/dist/cjs/instant-apps-splash.cjs.entry.js +6 -5
  26. package/dist/cjs/instant-apps-time-filter.cjs.entry.js +2 -2
  27. package/dist/cjs/{loadModules-8567855e.js → loadModules-df8b13ca.js} +1 -1
  28. package/dist/cjs/loader.cjs.js +1 -1
  29. package/dist/cjs/{locale-4a18a858.js → locale-4b820602.js} +1 -1
  30. package/dist/cjs/solution-contents_3.cjs.entry.js +1 -1
  31. package/dist/cjs/solutions-components.cjs.js +1 -1
  32. package/dist/cjs/{utils-fa7ad44b.js → utils-3f10ea6b.js} +2 -2
  33. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +112 -49
  34. package/dist/collection/components/layer-table/layer-table.js +32 -4
  35. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +2 -2
  36. package/dist/components/crowdsource-reporter.js +112 -49
  37. package/dist/components/instant-apps-filter-list2.js +25 -26
  38. package/dist/components/instant-apps-interactive-legend-relationship2.js +19 -5
  39. package/dist/components/instant-apps-language-switcher.js +3 -3
  40. package/dist/components/instant-apps-language-translator2.js +4 -12
  41. package/dist/components/instant-apps-splash.js +4 -3
  42. package/dist/components/layer-table2.js +32 -4
  43. package/dist/components/loadModules2.js +1 -1
  44. package/dist/components/solution-spatial-ref2.js +2 -2
  45. package/dist/components/utils4.js +1 -1
  46. package/dist/esm/calcite-action-pad_2.entry.js +1 -1
  47. package/dist/esm/calcite-block_5.entry.js +25 -26
  48. package/dist/esm/card-manager_3.entry.js +32 -4
  49. package/dist/esm/{constants-886c7c2c.js → constants-637a40f5.js} +3 -11
  50. package/dist/esm/crowdsource-reporter.entry.js +112 -49
  51. package/dist/esm/{helpers-91087955.js → helpers-91ca0f44.js} +1 -1
  52. package/dist/esm/instant-apps-app-guide.entry.js +2 -2
  53. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +3 -3
  54. package/dist/esm/instant-apps-control-panel.entry.js +1 -1
  55. package/dist/esm/instant-apps-create.entry.js +2 -2
  56. package/dist/esm/instant-apps-export-views.entry.js +2 -2
  57. package/dist/esm/instant-apps-export.entry.js +2 -2
  58. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +2 -2
  59. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +2 -2
  60. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +2 -2
  61. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +21 -7
  62. package/dist/esm/instant-apps-interactive-legend.entry.js +3 -3
  63. package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +2 -2
  64. package/dist/esm/instant-apps-language-switcher.entry.js +7 -7
  65. package/dist/esm/instant-apps-language-translator.entry.js +6 -6
  66. package/dist/esm/instant-apps-measurement.entry.js +2 -2
  67. package/dist/esm/instant-apps-popover.entry.js +2 -2
  68. package/dist/esm/instant-apps-scoreboard.entry.js +2 -2
  69. package/dist/esm/instant-apps-sign-in.entry.js +2 -2
  70. package/dist/esm/instant-apps-splash.entry.js +6 -5
  71. package/dist/esm/instant-apps-time-filter.entry.js +2 -2
  72. package/dist/esm/{loadModules-03ba7abe.js → loadModules-d5a25252.js} +1 -1
  73. package/dist/esm/loader.js +1 -1
  74. package/dist/esm/{locale-ce177eb8.js → locale-77038bee.js} +1 -1
  75. package/dist/esm/solution-contents_3.entry.js +1 -1
  76. package/dist/esm/solutions-components.js +1 -1
  77. package/dist/esm/{utils-3fc29543.js → utils-0a78d3c9.js} +2 -2
  78. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-splash/instant-apps-splash.css +7 -0
  79. package/dist/solutions-components/{p-b739f26d.entry.js → p-053effee.entry.js} +1 -1
  80. package/dist/solutions-components/{p-af573e0d.js → p-09543b4e.js} +1 -1
  81. package/dist/solutions-components/p-1b1ff60a.entry.js +6 -0
  82. package/dist/solutions-components/{p-e4107150.entry.js → p-2291bf3f.entry.js} +1 -1
  83. package/dist/solutions-components/p-2cf41651.entry.js +6 -0
  84. package/dist/solutions-components/{p-fe3aea1a.entry.js → p-351c7cbf.entry.js} +1 -1
  85. package/dist/solutions-components/{p-90fc786f.entry.js → p-3d999f0f.entry.js} +1 -1
  86. package/dist/solutions-components/p-3fe6c230.entry.js +6 -0
  87. package/dist/solutions-components/p-4695cfab.js +6 -0
  88. package/dist/solutions-components/{p-43699470.entry.js → p-499489c5.entry.js} +1 -1
  89. package/dist/solutions-components/{p-5ff711ee.js → p-5104cc98.js} +1 -1
  90. package/dist/solutions-components/p-5e694bcc.entry.js +29 -0
  91. package/dist/solutions-components/{p-cbb86cf2.entry.js → p-6a3f2249.entry.js} +1 -1
  92. package/dist/solutions-components/{p-a7f56b28.entry.js → p-6e5ea1cb.entry.js} +1 -1
  93. package/dist/solutions-components/{p-9c170b30.entry.js → p-76a1236d.entry.js} +1 -1
  94. package/dist/solutions-components/{p-1e14b3d0.entry.js → p-78b6d3fe.entry.js} +1 -1
  95. package/dist/solutions-components/{p-c48be45f.entry.js → p-8a1a0f9b.entry.js} +1 -1
  96. package/dist/solutions-components/{p-5cbf3eed.entry.js → p-8d4a4498.entry.js} +1 -1
  97. package/dist/solutions-components/{p-4a02fd45.entry.js → p-9d9e0e74.entry.js} +1 -1
  98. package/dist/solutions-components/{p-50fb7f47.js → p-b49e1a78.js} +1 -1
  99. package/dist/solutions-components/{p-c551ffc5.entry.js → p-c399f2b8.entry.js} +1 -1
  100. package/dist/solutions-components/p-cb27611e.entry.js +6 -0
  101. package/dist/solutions-components/{p-4cd4cb85.js → p-d001e961.js} +1 -1
  102. package/dist/solutions-components/{p-523dcf4b.entry.js → p-d37a68f7.entry.js} +1 -1
  103. package/dist/solutions-components/{p-a2cf9fdc.entry.js → p-db7d5db8.entry.js} +1 -1
  104. package/dist/solutions-components/{p-6438d1ea.entry.js → p-e29e57db.entry.js} +1 -1
  105. package/dist/solutions-components/{p-a5b751e2.entry.js → p-e625aa69.entry.js} +1 -1
  106. package/dist/solutions-components/{p-2542d5c9.entry.js → p-e9fcc194.entry.js} +1 -1
  107. package/dist/solutions-components/p-f0509d41.entry.js +6 -0
  108. package/dist/solutions-components/{p-374ddead.entry.js → p-f4880179.entry.js} +1 -1
  109. package/dist/solutions-components/solutions-components.esm.js +1 -1
  110. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +43 -17
  111. package/dist/types/components/layer-table/layer-table.d.ts +4 -0
  112. package/package.json +7 -7
  113. package/dist/solutions-components/p-3fc18283.entry.js +0 -6
  114. package/dist/solutions-components/p-442dd59c.entry.js +0 -6
  115. package/dist/solutions-components/p-5585dcd3.entry.js +0 -6
  116. package/dist/solutions-components/p-953afbb3.entry.js +0 -29
  117. package/dist/solutions-components/p-a1d8aed8.entry.js +0 -6
  118. package/dist/solutions-components/p-ceb1030b.js +0 -6
  119. package/dist/solutions-components/p-f728af86.entry.js +0 -6
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const locale = require('./locale-4a18a858.js');
8
+ const locale = require('./locale-4b820602.js');
9
9
  const index = require('./index-2b13a4d5.js');
10
10
 
11
11
  exports.EInputType = void 0;
@@ -131,7 +131,7 @@ function initExternalCKEditorStyles() {
131
131
  document.head.appendChild(style);
132
132
  }
133
133
  async function updateLastSave(resource) {
134
- const data = await resource.fetch();
134
+ const data = store.get('portalItemResourceT9n');
135
135
  const lastSave = Date.now();
136
136
  store.set('lastSave', lastSave);
137
137
  const dataStr = JSON.stringify(Object.assign(Object.assign({}, data), { lastSave }));
@@ -213,17 +213,17 @@ export class CrowdsourceReporter {
213
213
  */
214
214
  _formElements = [];
215
215
  /**
216
- * string[]: URL params set by using filters.
216
+ * string: Previous selected layer id
217
217
  */
218
- _filterUrlParams;
218
+ _prevSelectedLayerId;
219
219
  /**
220
- * FilterInitState: filter's init state
220
+ * ILayerExpression[]: current LayerExpressions based on the selected layer
221
221
  */
222
- _filterInitState;
222
+ _currentLayerExpressions;
223
223
  /**
224
- * string: Previous selected layer id
224
+ * { [key: string]: string }: definitionExpressions for each layer
225
225
  */
226
- _prevSelectedLayerId;
226
+ _initDefExpressions;
227
227
  //--------------------------------------------------------------------------
228
228
  //
229
229
  // Watch handlers
@@ -248,6 +248,7 @@ export class CrowdsourceReporter {
248
248
  */
249
249
  async mapViewWatchHandler() {
250
250
  await this.mapView.when(async () => {
251
+ this.setInitExpressions();
251
252
  await this.setMapView();
252
253
  });
253
254
  }
@@ -326,15 +327,25 @@ export class CrowdsourceReporter {
326
327
  this._layers = this.reportingOptions ? Object.keys(this.reportingOptions).filter((layerId) => {
327
328
  return this.reportingOptions[layerId].visible;
328
329
  }) : [];
330
+ this.setInitExpressions();
329
331
  await this.setMapView();
330
332
  });
331
333
  }
334
+ /**
335
+ * StencilJS: Called before every render().
336
+ * Update the filter list's initial definition expressions when the filter list component is available
337
+ */
338
+ componentWillRender() {
339
+ if (this._flowItems.includes('filter-panel')) {
340
+ void this._filterList?.updateInitDefExpressions({ initDefExpressions: this._initDefExpressions });
341
+ }
342
+ }
332
343
  /**
333
344
  * Renders the component.
334
345
  */
335
346
  render() {
336
347
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
337
- return (h(Host, { key: 'fbe7fdc13c462e0fe155107ac784f03b3922d624' }, this._reportSubmitted && h("calcite-alert", { key: '9bcf7856ad01e7bc59142a862c50b9d84c443268', "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '7b81a7c8b3d66159a790ab3d13be9f1b65a6202e', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: 'ee2f17e3326ef7c60fb2ee06ed313fd28cf7084a', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: 'b356832ee6d4d16a84cdea0abb6b1c677f9ca1f6', slot: "title" }, this._translations.error), h("div", { key: '8aa16df1114b75b6a3e2a76de7fb5c7cbc5d3632', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && h("calcite-alert", { key: 'e99693c23ef18b62daf892fccaacbbfe2486702d', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '58ccda0d3782dbe70d346b973b7648f8ae4c8c8f', slot: "message" }, this.commentSubmittedMessage || this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: 'e49e9e3b33df17dd90b3263bec6c17566f6f7b1b', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: 'cfb88dd323ead1398cd73849f68a9c2846ef9d14', slot: "title" }, this._translations.error), h("div", { key: 'b27e8983a74c8613e569400b7c7ad0b14d43f323', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: '7ac3d49d6383d2a88e54d91fa00e2c81aa91a890' }, h("calcite-shell", { key: '709e673f4e9261b4283c7593926d605c8a049abd', "content-behind": true }, this._getReporter()))));
348
+ return (h(Host, { key: 'f1dd6d85210210a73fff30a5d98370da1834be7b' }, this._reportSubmitted && h("calcite-alert", { key: 'b84760fcbf4bfcf0f038be272f74eda97ce17bd9', "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '27aa04dd8575ad27898f7848bc2733a03a33e70f', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: '3fc2721bed573ad10bbb1c81af126e2e8ca90b12', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: '4993e5c5b52d650b094c2890d0e4516cc87ffb69', slot: "title" }, this._translations.error), h("div", { key: '272b17f4c0239d8b295d6f2c0c02f1ba236d840d', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && h("calcite-alert", { key: '5b9e1a2bd129888ec0764ad9b05e5056653d3c33', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, h("div", { key: 'bd428297f5fe85cbf7edc42c61c64c299d7954b7', slot: "message" }, this.commentSubmittedMessage || this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: '2aa1927ca27f9ec15a16f8e68905a1cf203ef833', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: '4bff5fb03586edf0f9ea21649d1de4c34034e539', slot: "title" }, this._translations.error), h("div", { key: '7ea6c71dbbac15c2f43242ba00c9e461177051a1', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: '3aa6bfc19a1e82ab90d2ab42aa9a577b3a2b6d8f' }, h("calcite-shell", { key: 'f27355d4f655c0a0931158f38f0be3eb28f6c4d4', "content-behind": true }, this._getReporter()))));
338
349
  }
339
350
  //--------------------------------------------------------------------------
340
351
  //
@@ -398,7 +409,6 @@ export class CrowdsourceReporter {
398
409
  break;
399
410
  case "filter-panel":
400
411
  renderLists.push(this.getFilterPanel());
401
- void this._restoreFilters();
402
412
  break;
403
413
  case "feature-details":
404
414
  renderLists.push(this.getFeatureDetailsFlowItem());
@@ -445,20 +455,6 @@ export class CrowdsourceReporter {
445
455
  return (h("calcite-popover", { autoClose: true, label: "", offsetDistance: 0, placement: this.isMobile ? "leading-start" : "bottom-start", pointerDisabled: true, referenceElement: "sort-popover" }, h("calcite-list", { "selection-mode": "single" }, h("calcite-list-item", { label: this._translations.sortNewest, onCalciteListItemSelect: () => { void this.sortOptionClick(this._selectedLayer.objectIdField, "desc", "sortNewest"); }, selected: this._updatedSortOption === "sortNewest", value: "sortNewest" }), h("calcite-list-item", { label: this._translations.sortOldest, onCalciteListItemSelect: () => { void this.sortOptionClick(this._selectedLayer.objectIdField, "asc", "sortOldest"); }, selected: this._updatedSortOption === "sortOldest", value: "sortOldest" }), canSortByVotes &&
446
456
  h(Fragment, null, h("calcite-list-item", { label: this._translations.sortHighestVoted, onCalciteListItemSelect: () => { void this.sortOptionClick(this.reportingOptions[this._selectedLayerId].likeField, "desc", "sortHighestVoted"); }, selected: this._updatedSortOption === "sortHighestVoted", value: "sortHighestVoted" }), h("calcite-list-item", { label: this._translations.sortLowestVoted, onCalciteListItemSelect: () => { void this.sortOptionClick(this.reportingOptions[this._selectedLayerId].likeField, "asc", "sortLowestVoted"); }, selected: this._updatedSortOption === "sortLowestVoted", value: "sortLowestVoted" })))));
447
457
  }
448
- /**
449
- * Restores the applied filters
450
- * @protected
451
- */
452
- _restoreFilters() {
453
- // call the restore function when instant-apps-filter-list is ready
454
- setTimeout(() => {
455
- const canRestoreFilter = this._filterList && this._filterUrlParams && this._filterInitState;
456
- if (canRestoreFilter) {
457
- void this._filterList.restoreFilters(this._filterUrlParams[0], this._filterInitState);
458
- }
459
- this._filterInitState = null;
460
- }, 200);
461
- }
462
458
  /**
463
459
  * Reset the filter
464
460
  * @protected
@@ -466,8 +462,6 @@ export class CrowdsourceReporter {
466
462
  async _handleFilterListReset() {
467
463
  //on reset filter list reset the filter states
468
464
  this._filterActive = false;
469
- this._filterUrlParams = null;
470
- this._filterInitState = null;
471
465
  }
472
466
  /**
473
467
  * Check if the layers definitionExpression has been modified and update the feature list depending on the applied filters
@@ -475,9 +469,7 @@ export class CrowdsourceReporter {
475
469
  */
476
470
  async _handleFilterUpdate(active) {
477
471
  this._showLoadingIndicator = true;
478
- //if filters are applied the url params will be generated
479
472
  this._filterActive = active;
480
- this._filterUrlParams = this._filterList.urlParams.getAll('filter');
481
473
  await this._featureList.refresh();
482
474
  this._showLoadingIndicator = false;
483
475
  }
@@ -644,10 +636,6 @@ export class CrowdsourceReporter {
644
636
  if (evt.detail.layerId && evt.detail.layerName) {
645
637
  await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
646
638
  }
647
- // reset the applied filter when switching to another layer
648
- if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
649
- await this.resetFilter();
650
- }
651
639
  void this.updateNonVisibleLayersOnMap(true);
652
640
  // get the form template elements to pass in create-feature to create a LEVELID field in feature-form
653
641
  this._getFormElements();
@@ -719,28 +707,18 @@ export class CrowdsourceReporter {
719
707
  };
720
708
  this._updatedSortOption = "sortNewest";
721
709
  await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
710
+ void this.handleSelectedLayersFilter();
722
711
  this._flowItems = [...this._flowItems, "feature-list"];
723
- // reset the applied filter when switching to another layer
724
- if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
725
- await this.resetFilter();
726
- }
727
712
  this._prevSelectedLayerId = this._selectedLayerId;
728
713
  }
729
- /**
730
- * Reset's the applied filter
731
- * @protected
732
- */
733
- async resetFilter() {
734
- const prevLayer = await getLayerOrTable(this.mapView, this._prevSelectedLayerId);
735
- prevLayer.definitionExpression = this._filterInitState.initDefExpressions[this._prevSelectedLayerId];
736
- void this._handleFilterListReset();
737
- }
738
714
  /**
739
715
  * On back from filter panel get the filter's init state
740
716
  * @protected
741
717
  */
742
718
  async backFromFilterPanel() {
743
- this._filterInitState = await this._filterList.getFilterInitState();
719
+ if (this._filterList != null) {
720
+ this._currentLayerExpressions = await this._filterList.getCurrentLayerExpressions();
721
+ }
744
722
  await this._featureList.refresh();
745
723
  this.backFromSelectedPanel();
746
724
  }
@@ -855,9 +833,8 @@ export class CrowdsourceReporter {
855
833
  * @protected
856
834
  */
857
835
  getFeatureListFlowItem(layerId, layerName) {
858
- const layerExpressions = this.layerExpressions?.filter((exp) => exp.id === this._selectedLayerId);
859
836
  const canCreateReports = this._getLayersConfig(this._selectedLayerId)?.reporting && this._layerItemsHash[this._selectedLayerId].supportsAdd;
860
- const showFilterIcon = layerExpressions?.length > 0;
837
+ const showFilterIcon = this._currentLayerExpressions?.length > 0;
861
838
  return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this._toggleSort(), h("calcite-action", { icon: "sort-ascending-arrow", id: "sort-popover", slot: "header-actions-end", text: this._translations.sort, title: this._translations.sort }), showFilterIcon && h("calcite-action", { icon: "filter", indicator: this._filterActive, onClick: () => { this._flowItems = [...this._flowItems, "filter-panel"]; }, slot: "header-actions-end", text: this._translations.filter, title: this._translations.filter }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports && canCreateReports &&
862
839
  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", { applyLayerViewFilter: this.showMyReportsOnly, class: "height-full", highlightOnHover: true, locale: this.locale, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, ref: el => this._featureList = el, reportingOptions: this.reportingOptions, selectedLayerId: layerId, showFeatureSymbol: this.showFeatureSymbol, sortingInfo: this._updatedSorting }))));
863
840
  }
@@ -867,8 +844,7 @@ export class CrowdsourceReporter {
867
844
  * @protected
868
845
  */
869
846
  getFilterPanel() {
870
- const currentLayersExpressions = this.layerExpressions ? this.layerExpressions.filter((exp) => exp.id === this._selectedLayerId) : [];
871
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName), loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromFilterPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("div", { class: "width-full", slot: "footer" }, h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", disabled: !this._filterActive, onClick: () => { void this._filterList?.forceReset(); }, width: "full" }, this._translations.resetFilter), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromFilterPanel.bind(this), width: "full" }, this._translations.close))), h("calcite-panel", { "full-height": true }, h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtnOnClick: () => undefined, comboboxOverlayPositioning: "fixed", layerExpressions: currentLayersExpressions, onFilterListReset: () => this._handleFilterListReset(), onFilterUpdate: () => this._handleFilterUpdate(this._filterList.filterCount > 0), ref: (el) => this._filterList = el, resetBtn: false, resetFiltersOnDisconnect: false, view: this.mapView, zoomBtn: false }))));
847
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName), loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromFilterPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("div", { class: "width-full", slot: "footer" }, h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", disabled: !this._filterActive, onClick: this.resetFilterList.bind(this), width: "full" }, this._translations.resetFilter), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromFilterPanel.bind(this), width: "full" }, this._translations.close))), h("calcite-panel", { "full-height": true }, h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtnOnClick: () => undefined, comboboxOverlayPositioning: "fixed", layerExpressions: this._currentLayerExpressions, onFilterListReset: () => this._handleFilterListReset(), onFilterUpdate: () => this._handleFilterUpdate(this._filterList.filterCount > 0), ref: (el) => this._filterList = el, resetBtn: false, resetFiltersOnDisconnect: false, view: this.mapView, zoomBtn: false }))));
872
848
  }
873
849
  /**
874
850
  * Returns the calcite-flow item for feature details
@@ -928,6 +904,7 @@ export class CrowdsourceReporter {
928
904
  else {
929
905
  if (this._editableLayerIds.length > 1) {
930
906
  void this.setSelectedLayer('', '');
907
+ void this.handlePrevLayersFilter();
931
908
  }
932
909
  this._currentFeatureId = '';
933
910
  }
@@ -1184,7 +1161,8 @@ export class CrowdsourceReporter {
1184
1161
  detail: this._editableLayerIds
1185
1162
  };
1186
1163
  await this.layerListLoaded(evt);
1187
- void this.setSelectedLayer(this._validLayers[0].id, this._validLayers[0].title);
1164
+ await this.setSelectedLayer(this._validLayers[0].id, this._validLayers[0].title);
1165
+ void this.handleSelectedLayersFilter();
1188
1166
  }
1189
1167
  /**
1190
1168
  * Updates the share url for current selected feature
@@ -1244,6 +1222,91 @@ export class CrowdsourceReporter {
1244
1222
  }
1245
1223
  }
1246
1224
  }
1225
+ /**
1226
+ * Handles updating the current layer expressions and definition expression for the selected layer
1227
+ * @protected
1228
+ */
1229
+ async handleSelectedLayersFilter() {
1230
+ if (this._selectedLayer) {
1231
+ this._currentLayerExpressions = this.layerExpressions ? this.layerExpressions.filter(exp => exp.id === this._selectedLayerId) : [];
1232
+ this.setActiveDefinitionExpressions();
1233
+ }
1234
+ }
1235
+ /**
1236
+ * Handles updating the previous layer's definition expression to it's initial definition expression
1237
+ * @protected
1238
+ */
1239
+ async handlePrevLayersFilter() {
1240
+ if (this._prevSelectedLayerId) {
1241
+ const prevLayer = await getLayerOrTable(this.mapView, this._prevSelectedLayerId);
1242
+ if (prevLayer) {
1243
+ prevLayer.definitionExpression = this._initDefExpressions[this._prevSelectedLayerId];
1244
+ }
1245
+ }
1246
+ }
1247
+ /**
1248
+ * Resets the selected layer's definition expression with the initial definition expression
1249
+ * @protected
1250
+ */
1251
+ resetFilterList() {
1252
+ void this._filterList?.forceReset();
1253
+ if (this._selectedLayer != null) {
1254
+ this._selectedLayer.definitionExpression = this._initDefExpressions[this._selectedLayerId];
1255
+ this._filterActive = false;
1256
+ }
1257
+ }
1258
+ /**
1259
+ * Sets the active definition expressions for the selected layer
1260
+ * @protected
1261
+ */
1262
+ setActiveDefinitionExpressions() {
1263
+ if (this._selectedLayer == null) {
1264
+ return;
1265
+ }
1266
+ const defExpressions = [];
1267
+ if (this._currentLayerExpressions?.length > 0) {
1268
+ const layerExpression = this._currentLayerExpressions[0];
1269
+ for (const expression of layerExpression.expressions) {
1270
+ const { active, definitionExpression } = expression;
1271
+ if (active && definitionExpression) {
1272
+ defExpressions.push(`(${definitionExpression})`);
1273
+ }
1274
+ }
1275
+ this._filterActive = defExpressions.length > 0;
1276
+ this.updateFilterLayerDefExpression(defExpressions, layerExpression.operator);
1277
+ }
1278
+ }
1279
+ /**
1280
+ * Updates the selected layer's definition expression based on the active expressions
1281
+ * @protected
1282
+ */
1283
+ updateFilterLayerDefExpression(defExpressions, operator) {
1284
+ const initDefExpression = this._initDefExpressions[this._selectedLayerId];
1285
+ const combinedExpressions = defExpressions?.length > 0 && initDefExpression != null
1286
+ ? `(${defExpressions.join(operator)}) AND (${initDefExpression})`
1287
+ : defExpressions.length > 0
1288
+ ? defExpressions.join(operator)
1289
+ : initDefExpression;
1290
+ this._selectedLayer.definitionExpression = combinedExpressions;
1291
+ }
1292
+ /**
1293
+ * Sets the initial definition expressions for all the feature layers
1294
+ * @protected
1295
+ */
1296
+ setInitExpressions() {
1297
+ this._initDefExpressions = {};
1298
+ if (this.mapView == null) {
1299
+ return;
1300
+ }
1301
+ const map = this.mapView.map;
1302
+ map.allLayers.concat(map.allTables).forEach(layer => {
1303
+ if (layer.type !== "feature") {
1304
+ return;
1305
+ }
1306
+ const fl = layer;
1307
+ this._initDefExpressions[fl.id] = fl.definitionExpression;
1308
+ });
1309
+ }
1247
1310
  static get is() { return "crowdsource-reporter"; }
1248
1311
  static get originalStyleUrls() {
1249
1312
  return {
@@ -233,6 +233,10 @@ export class LayerTable {
233
233
  * string the current search expression
234
234
  */
235
235
  _searchExpression;
236
+ /**
237
+ * number[]: selected features from table
238
+ */
239
+ _tempSelectedIds;
236
240
  //--------------------------------------------------------------------------
237
241
  //
238
242
  // Watch handlers
@@ -538,10 +542,10 @@ export class LayerTable {
538
542
  const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
539
543
  const showSearch = this._canShowFullTextSearch();
540
544
  this._validateActiveActions();
541
- return (h(Host, { key: 'f56462fd5d5afa71052cf2557069bb2fee15aaeb' }, h("calcite-shell", { key: '92ccfa2235269aad6da5f918f79ec8ae100e99ca' }, this._getTableControlRow("header"), h("div", { key: 'e5b8fe5e4236e1a7b7e9d31ad784d9bb52a6918d', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: 'eca933d832e5b6efddb025211c253bf09e41ab22', class: "height-full width-full" }, showSearch &&
542
- h("div", { key: 'e819896c4264db3ee95d10194b67da65997b541d', class: "search-container" }, h("calcite-input", { key: 'e979c7962205caf072057332280b9e04ecd233c4', class: "search", clearable: true, icon: "search", onCalciteInputChange: (evt) => void this._searchTextChanged(evt), placeholder: this._searchPlaceHolder, title: this._searchPlaceHolder, type: "search" })), h("calcite-loader", { key: 'ee715472a4f819dd1e9328e75022439e9bba1334', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '8085821dea31de1fcbb1119e5791c0dea744e470', class: tableNodeClass, ref: this.onTableNodeCreate }))), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
545
+ return (h(Host, { key: '0998f68ec5ab3fe8c2e7a21aa832137730faf94f' }, h("calcite-shell", { key: 'a6f00f0280358c318cbed1afc48d54ae0ffae465' }, this._getTableControlRow("header"), h("div", { key: '744786c1915fd86e81c278ecc75c862312c1ec6f', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: 'b59b7bcf0f6e3f5411ff0ecf5de8e6bd747fbe4a', class: "height-full width-full" }, showSearch &&
546
+ h("div", { key: '6c62638d97156a2101764bf620b0f48b70f906ad', class: "search-container" }, h("calcite-input", { key: '8ff64d0529b5e3fe281490917ba44a829567cb0c', class: "search", clearable: true, icon: "search", onCalciteInputChange: (evt) => void this._searchTextChanged(evt), placeholder: this._searchPlaceHolder, title: this._searchPlaceHolder, type: "search" })), h("calcite-loader", { key: '7f673a2fd30a5828dec0400d01c581440a3adf6b', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '39c0801b1992db5f8782d6b3569fa89ba47ce8ce', class: tableNodeClass, ref: this.onTableNodeCreate }))), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
543
547
  .replace("{{total}}", total)
544
- .replace("{{selected}}", selected))) : undefined), this.createFilterModal && this._filterModal(), h("delete-dialog", { key: '20c9a06c3f0d44433d9442755d25658c249e102c', id: "deleteDialogId", ids: this._getIds(), layer: this._layer, locale: this.locale, onDeleteDialogClose: () => this._deleteDialogOpen = false, open: this._deleteDialogOpen, ref: (el) => this._deleteDialog = el })));
548
+ .replace("{{selected}}", selected))) : undefined), this.createFilterModal && this._filterModal(), h("delete-dialog", { key: '6bf4038662260c566d304a63d8f118265a1bf69e', id: "deleteDialogId", ids: this._getIds(), layer: this._layer, locale: this.locale, onDeleteDialogClose: () => this._deleteDialogOpen = false, open: this._deleteDialogOpen, ref: (el) => this._deleteDialog = el })));
545
549
  }
546
550
  _deleteDialog;
547
551
  /**
@@ -601,18 +605,37 @@ export class LayerTable {
601
605
  *
602
606
  */
603
607
  async _searchFullText() {
608
+ let selectedIds = [];
609
+ let showSelected = false;
610
+ if (this._showOnlySelected) {
611
+ selectedIds = this._tempSelectedIds;
612
+ showSelected = true;
613
+ }
614
+ else {
615
+ this._clearSelection();
616
+ this._tempSelectedIds = [];
617
+ }
604
618
  //always clear previous search definition
605
619
  if (this._searchExpression) {
606
620
  this._clearSearchDefinitionExpression();
607
621
  }
622
+ let searchedIds = [];
608
623
  if (this._fullTextSearchInfo.length) {
609
624
  if (this._fullTextSearchInfo[0].searchTerm) {
610
625
  const searchQueryParams = this._layer.createQuery();
611
626
  searchQueryParams.fullText = this._fullTextSearchInfo;
612
- const searchedIds = await this._layer.queryObjectIds(searchQueryParams);
627
+ searchedIds = await this._layer.queryObjectIds(searchQueryParams);
628
+ if (showSelected && selectedIds?.length) {
629
+ searchedIds = searchedIds.filter((id) => selectedIds.includes(id));
630
+ }
613
631
  await this._updateSearchDefinitionExpression(searchedIds?.length ? searchedIds : [-1]);
614
632
  }
615
633
  }
634
+ // highlight the feature only when selected feature is present in applied filter
635
+ if (showSelected && searchedIds?.length) {
636
+ this._showOnlySelected = true;
637
+ this._table.highlightIds.addMany(searchedIds.reverse());
638
+ }
616
639
  //Added timeout and table.refresh() to avoid the issue in which we see empty table records after searching in combination to filter/reset filter
617
640
  await new Promise(resolve => setTimeout(resolve, 800));
618
641
  await this._updateAllIds();
@@ -1232,6 +1255,7 @@ export class LayerTable {
1232
1255
  highlightEnabled: true,
1233
1256
  multiSortEnabled: false,
1234
1257
  visibleElements: {
1258
+ columnDescriptions: false,
1235
1259
  header: false,
1236
1260
  menu: false
1237
1261
  },
@@ -1262,6 +1286,7 @@ export class LayerTable {
1262
1286
  // only readd in specific case where we have multiple selected and then click one of the currently selected
1263
1287
  const reAdd = this.selectedIds.length > 1 && evt.removed.length === 1;
1264
1288
  const newIds = reAdd ? evt.removed : ids.filter(id => this.selectedIds.indexOf(id) < 0);
1289
+ this._tempSelectedIds = newIds.length ? [...newIds] : [...this.selectedIds];
1265
1290
  this._clearSelection();
1266
1291
  this.selectedIds = [...newIds];
1267
1292
  if (newIds.length > 0) {
@@ -1274,10 +1299,12 @@ export class LayerTable {
1274
1299
  else {
1275
1300
  // https://github.com/Esri/solutions-components/issues/365
1276
1301
  this.selectedIds = ids.reverse();
1302
+ this._tempSelectedIds = [...this.selectedIds];
1277
1303
  }
1278
1304
  }
1279
1305
  else if (this._ctrlIsPressed) {
1280
1306
  this.selectedIds = ids.reverse();
1307
+ this._tempSelectedIds = [...this.selectedIds];
1281
1308
  }
1282
1309
  else if (this._shiftIsPressed && ids?.length > 0) {
1283
1310
  this._skipOnChange = true;
@@ -1314,6 +1341,7 @@ export class LayerTable {
1314
1341
  }, []);
1315
1342
  const selectedIds = _start < _end ? idsInRange.reverse() : idsInRange;
1316
1343
  this.selectedIds = [...new Set([...selectedIds, ...this.selectedIds])];
1344
+ this._tempSelectedIds = [...this.selectedIds];
1317
1345
  this._table.highlightIds.addMany(this.selectedIds.filter(i => ids.indexOf(i) < 0));
1318
1346
  }
1319
1347
  }
@@ -75,7 +75,7 @@ export class SolutionSpatialRef {
75
75
  }
76
76
  render() {
77
77
  this._updateUIFromStore();
78
- return (h(Host, { key: 'c4d6b7debb3852da999002bd1d9394ba4a4f2da8' }, h("label", { key: 'e16a28157db4c3aece6a00460816c3394f1f9198', class: "switch-label" }, h("calcite-switch", { key: '48d3b1c12aa93c50ccf424ccaf0a810855227b8d', checked: this.enabled, class: "spatial-ref-switch", onCalciteSwitchChange: (event) => this.enabled = event.target.checked, scale: "m" }), this._translations.enableSpatialReference), h("br", { key: '0e7eb35accdccef9f17e0a24b17180d25c4f054a' }), h("div", { key: '257e130fdda5e42a8c40662f21c3d315f91562c7', class: "spatial-ref-component", id: "spatialRefDefn" }, this._renderFeatureServicesList(this.featureServices)), h("label", { key: 'd7581971bb310c6c4b0fb1015db59a359da54b90', class: "switch-label spatial-ref-component" }, h("calcite-switch", { key: '3045b179955101fc5baff8ca09cb10d0077e35ca', checked: this.enableDefault, class: "spatial-ref-switch", disabled: !this.enabled, onCalciteSwitchChange: (event) => this.enableDefault = event.target.checked, scale: "m" }), this._translations.enableDefaultSpatialReference)));
78
+ return (h(Host, { key: 'b8775ad1a6a18c0b32d020c02d6f9fe13f5d578a' }, h("label", { key: 'd10fa03d4d127579eed4fec2c6c907dc46166bdf', class: "switch-label" }, h("calcite-switch", { key: 'ce47d98234008f377d674851ce77c68ebaa4fd71', checked: this.enabled, class: "spatial-ref-switch", onCalciteSwitchChange: (event) => this.enabled = event.target.checked, scale: "m" }), this._translations.enableSpatialReference), h("br", { key: '54dc5ccf3fec55650f62d8dbeb09071c8e88805c' }), h("div", { key: '03257e474d254e4d5a0dd10ac7ab6e8b88f85d54', class: "spatial-ref-component", id: "spatialRefDefn" }, this._renderFeatureServicesList(this.featureServices)), h("label", { key: 'fac415766affa3b1620ce6a5c3d5ef900b25944f', class: "switch-label spatial-ref-component" }, h("calcite-switch", { key: '611b69b0895267702a69a70436033274d3d28892', checked: this.enableDefault, class: "spatial-ref-switch", disabled: !this.enabled, onCalciteSwitchChange: (event) => this.enableDefault = event.target.checked, scale: "m" }), this._translations.enableDefaultSpatialReference)));
79
79
  }
80
80
  //--------------------------------------------------------------------------
81
81
  //
@@ -345,7 +345,7 @@ export class SolutionSpatialRef {
345
345
  },
346
346
  "locale": {
347
347
  "type": "string",
348
- "mutable": false,
348
+ "mutable": true,
349
349
  "complexType": {
350
350
  "original": "string",
351
351
  "resolved": "string",