@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
@@ -12,7 +12,7 @@ import { c as connectLocalized, d as disconnectLocalized } from './locale-904407
12
12
  import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as updateMessages } from './t9n-436fb2b1.js';
13
13
  import { S as SLOTS$1 } from './resources-00983bd3.js';
14
14
  import { l as loadModules, g as getLocaleComponentStrings, f as formatNumber } from './locale-bcbea4ef.js';
15
- import { a as getAllLayers, g as getLayerOrTable, b as getFeatureLayerView, h as highlightFeatures, c as getMapLayerHash } from './mapViewUtils-253178f1.js';
15
+ import { a as getAllLayers, g as getLayerOrTable, b as getFeatureLayerView, h as highlightFeatures, c as getMapLayerHash } from './mapViewUtils-c83c03a4.js';
16
16
  import { P as PopupUtils } from './popupUtils-af124b47.js';
17
17
  import './guid-b75a5f7b.js';
18
18
  import './resources-8834f920.js';
@@ -345,6 +345,7 @@ const CreateFeature = class {
345
345
  this.fail = createEvent(this, "fail", 7);
346
346
  this.drawComplete = createEvent(this, "drawComplete", 7);
347
347
  this.editingAttachment = createEvent(this, "editingAttachment", 7);
348
+ this.progressStatus = createEvent(this, "progressStatus", 7);
348
349
  this.mapView = undefined;
349
350
  this.selectedLayerId = undefined;
350
351
  this.customizeSubmit = false;
@@ -489,6 +490,7 @@ const CreateFeature = class {
489
490
  //Add handle to watch featureTemplatesViewModel ready state and then start the creation
490
491
  const handle = this.reactiveUtils.watch(() => this._editor.viewModel.featureTemplatesViewModel.state, (state) => {
491
492
  if (state === 'ready') {
493
+ this.progressStatus.emit(0.5);
492
494
  void this.startCreate();
493
495
  }
494
496
  });
@@ -512,6 +514,7 @@ const CreateFeature = class {
512
514
  //once the feature template is selected handle the event for formSubmit and sketch complete
513
515
  //also, hide the headers and footer in the editor as we will be showing our own submit and cancel button
514
516
  this._editor.viewModel.featureTemplatesViewModel.on('select', () => {
517
+ this.progressStatus.emit(0.75);
515
518
  setTimeout(() => {
516
519
  //on form submit
517
520
  this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
@@ -519,6 +522,7 @@ const CreateFeature = class {
519
522
  this._editor.viewModel.sketchViewModel.on("create", (evt) => {
520
523
  if (evt.state === "complete") {
521
524
  this.showSearchWidget = false;
525
+ this.progressStatus.emit(1);
522
526
  this.drawComplete.emit();
523
527
  }
524
528
  });
@@ -683,6 +687,313 @@ const CreateFeature = class {
683
687
  };
684
688
  CreateFeature.style = createFeatureCss;
685
689
 
690
+ const featureDetailsCss = ":host{display:block}.buttons{align-items:center;background-color:white;display:flex;padding:10px 0 10px 15px;border-block-start:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3)}.comment-btn{display:flex;gap:5px;width:35px}";
691
+
692
+ const FeatureDetails = class {
693
+ constructor(hostRef) {
694
+ registerInstance(this, hostRef);
695
+ this.loadingStatus = createEvent(this, "loadingStatus", 7);
696
+ /**
697
+ * string[]: Valid field types for like and dislike
698
+ */
699
+ this._validFieldTypes = ["small-integer", "integer", "big-integer", "single", "long"];
700
+ this.mapView = undefined;
701
+ this.graphics = undefined;
702
+ this.reportingOptions = undefined;
703
+ this._likeFieldAvailable = false;
704
+ this._likeCount = 0;
705
+ this._disLikeCount = 0;
706
+ this._dislikeFieldAvailable = false;
707
+ this._isLikeBtnClicked = false;
708
+ this._isDislikeBtnClicked = false;
709
+ }
710
+ //--------------------------------------------------------------------------
711
+ //
712
+ // Watch handlers
713
+ //
714
+ //--------------------------------------------------------------------------
715
+ /**
716
+ * Called each time the graphics prop is changed
717
+ */
718
+ async graphicsWatchHandler() {
719
+ await this.getCompleteGraphic(this.graphics[0]);
720
+ this.checkLikeDislikeFields();
721
+ }
722
+ //--------------------------------------------------------------------------
723
+ //
724
+ // Methods (public)
725
+ /**
726
+ * Refresh the features comments which will fetch like, dislike and update the component
727
+ * @returns Promise that resolves when the operation is complete
728
+ */
729
+ async refresh(graphic) {
730
+ if (this.isLikeDislikeConfigured(graphic.layer)) {
731
+ // in case of multiple features selected fetch complete feature and update like dislike for current feature
732
+ if (graphic && this.graphics.length > 1) {
733
+ await this.getCompleteGraphic(graphic);
734
+ this.checkLikeDislikeFields();
735
+ }
736
+ }
737
+ else {
738
+ this._likeFieldAvailable = false;
739
+ this._dislikeFieldAvailable = false;
740
+ }
741
+ }
742
+ /**
743
+ * Go to the previous feature in the features widget
744
+ */
745
+ async back() {
746
+ void this._infoCard.back();
747
+ }
748
+ /**
749
+ * Go to the next feature in the features widget
750
+ */
751
+ async next() {
752
+ void this._infoCard.next();
753
+ }
754
+ /**
755
+ * Toggle the visibility of the features list view
756
+ */
757
+ async toggleListView() {
758
+ void this._infoCard.toggleListView();
759
+ }
760
+ /**
761
+ * StencilJS: Called once just after the component is first connected to the DOM.
762
+ *
763
+ * @returns Promise when complete
764
+ */
765
+ async componentWillLoad() {
766
+ await this._initModules();
767
+ await this.getCompleteGraphic(this.graphics[0]);
768
+ this.checkLikeDislikeFields();
769
+ }
770
+ render() {
771
+ var _a, _b, _c, _d;
772
+ return (h("calcite-panel", { "full-height": true }, h("info-card", { allowEditing: false, graphics: this.graphics, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, paginationEnabled: false, position: "relative", ref: el => this._infoCard = el, zoomAndScrollToSelected: true }), (this._likeFieldAvailable || this._dislikeFieldAvailable) &&
773
+ h("div", { class: 'buttons' }, this._likeFieldAvailable &&
774
+ h("calcite-button", { appearance: "transparent", iconEnd: "thumbs-up", kind: this._isLikeBtnClicked ? "brand" : "neutral", onClick: this.onLikeButtonClick.bind(this), scale: 's' }, (_b = (_a = this._likeCount) !== null && _a !== void 0 ? _a : this._selectedGraphic.attributes[this._likeField]) !== null && _b !== void 0 ? _b : 0), this._dislikeFieldAvailable &&
775
+ h("calcite-button", { appearance: "transparent", iconEnd: "thumbs-down", kind: this._isDislikeBtnClicked ? "brand" : "neutral", onClick: this.onDislikeButtonClick.bind(this), scale: 's' }, (_d = (_c = this._disLikeCount) !== null && _c !== void 0 ? _c : this._selectedGraphic.attributes[this._dislikeField]) !== null && _d !== void 0 ? _d : 0))));
776
+ }
777
+ /**
778
+ * Load esri javascript api modules
779
+ *
780
+ * @returns Promise resolving when function is done
781
+ *
782
+ * @protected
783
+ */
784
+ async _initModules() {
785
+ const [Graphic] = await loadModules([
786
+ "esri/Graphic"
787
+ ]);
788
+ this.Graphic = Graphic;
789
+ }
790
+ /**
791
+ * Get complete graphic with complete attributes
792
+ * @param graphic selected feature graphic
793
+ * @protected
794
+ */
795
+ async getCompleteGraphic(graphic) {
796
+ const layer = graphic.layer;
797
+ const query = layer.createQuery();
798
+ query.objectIds = [graphic.getObjectId()];
799
+ const completeGraphic = await layer.queryFeatures(query);
800
+ this._selectedGraphic = completeGraphic.features[0];
801
+ }
802
+ /**
803
+ * Checks if the layers is configured for like dislike or not
804
+ * @param selectedLayer Feature layer
805
+ * @returns boolean
806
+ * @protected
807
+ */
808
+ isLikeDislikeConfigured(selectedLayer) {
809
+ let likeFieldAvailable = false;
810
+ let dislikeFieldAvailable = false;
811
+ // check if reporting options are configured for the current selected feature's layer
812
+ if (this.reportingOptions && this.reportingOptions[selectedLayer.id]) {
813
+ //return false if both like and dislike are disabled for the layer
814
+ if (!this.reportingOptions[selectedLayer.id].like && !this.reportingOptions[selectedLayer.id].dislike) {
815
+ return false;
816
+ }
817
+ const likeField = this.reportingOptions[selectedLayer.id].likeField;
818
+ const dislikeField = this.reportingOptions[selectedLayer.id].dislikeField;
819
+ //if both fields are not configured return false
820
+ if (!likeField && !dislikeField) {
821
+ return false;
822
+ }
823
+ selectedLayer.fields.forEach((eachField) => {
824
+ if (this._validFieldTypes.indexOf(eachField.type) > -1) {
825
+ if (eachField.name === likeField && this.reportingOptions[selectedLayer.id].like) {
826
+ likeFieldAvailable = true;
827
+ }
828
+ else if (eachField.name === dislikeField && this.reportingOptions[selectedLayer.id].dislike) {
829
+ dislikeFieldAvailable = true;
830
+ }
831
+ }
832
+ });
833
+ }
834
+ return likeFieldAvailable || dislikeFieldAvailable;
835
+ }
836
+ /**
837
+ * Check if configured like or dislike fields are available in the selected layer
838
+ * @protected
839
+ */
840
+ checkLikeDislikeFields() {
841
+ this._likeFieldAvailable = false;
842
+ this._dislikeFieldAvailable = false;
843
+ this._isLikeBtnClicked = false;
844
+ this._isDislikeBtnClicked = false;
845
+ this._likeCount = 0;
846
+ this._disLikeCount = 0;
847
+ const selectedLayer = this._selectedGraphic.layer;
848
+ // check if reporting options are configured for the current selected feature's layer
849
+ if (this.reportingOptions && this.reportingOptions[selectedLayer.id]) {
850
+ this._likeField = this.reportingOptions[selectedLayer.id].likeField;
851
+ this._dislikeField = this.reportingOptions[selectedLayer.id].dislikeField;
852
+ //if both fields are not found return
853
+ if (!this._likeField && !this._dislikeField) {
854
+ return;
855
+ }
856
+ //Check if selected layer have the configured like and dislike fields
857
+ //also, get the current value for like and dislike field from the attributes
858
+ selectedLayer.fields.forEach((eachField) => {
859
+ if (this._validFieldTypes.indexOf(eachField.type) > -1) {
860
+ if (eachField.name === this._likeField && this.reportingOptions[this._selectedGraphic.layer.id].like) {
861
+ this._likeFieldAvailable = true;
862
+ this._likeCount = this._selectedGraphic.attributes[eachField.name];
863
+ }
864
+ else if (eachField.name === this._dislikeField && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
865
+ this._dislikeFieldAvailable = true;
866
+ this._disLikeCount = this._selectedGraphic.attributes[eachField.name];
867
+ }
868
+ }
869
+ });
870
+ this.getFromLocalStorage();
871
+ }
872
+ }
873
+ /**
874
+ * On like button click highlight the like button and update the feature
875
+ * @protected
876
+ */
877
+ onLikeButtonClick() {
878
+ this.loadingStatus.emit(true);
879
+ if (this._isDislikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
880
+ this.onDislikeButtonClick();
881
+ }
882
+ this._isLikeBtnClicked = !this._isLikeBtnClicked;
883
+ if (this._isLikeBtnClicked) {
884
+ this._likeCount++;
885
+ }
886
+ else {
887
+ this._likeCount--;
888
+ }
889
+ void this.updateFeaturesLikeDislikeField(this._likeField, this._isLikeBtnClicked);
890
+ }
891
+ /**
892
+ * On dislike button click highlight the dislike button and update the feature
893
+ * @protected
894
+ */
895
+ onDislikeButtonClick() {
896
+ this.loadingStatus.emit(true);
897
+ if (this._isLikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].like) {
898
+ this.onLikeButtonClick();
899
+ }
900
+ this._isDislikeBtnClicked = !this._isDislikeBtnClicked;
901
+ if (this._isDislikeBtnClicked) {
902
+ this._disLikeCount++;
903
+ }
904
+ else {
905
+ this._disLikeCount--;
906
+ }
907
+ void this.updateFeaturesLikeDislikeField(this._dislikeField, this._isDislikeBtnClicked);
908
+ }
909
+ /**
910
+ * Update the feature if user click on like or dislike button
911
+ * @param fieldName field name of the feature for like or dislike attribute
912
+ * @param buttonClicked is like or dislike button clicked
913
+ * @protected
914
+ */
915
+ async updateFeaturesLikeDislikeField(fieldName, buttonClicked) {
916
+ const attributesToUpdate = {};
917
+ const selectedLayer = this._selectedGraphic.layer;
918
+ //Increment the value if button is clicked or else decrement it
919
+ const selectFeatureAttr = this._selectedGraphic;
920
+ if (buttonClicked) {
921
+ selectFeatureAttr.attributes[fieldName] = Number(selectFeatureAttr.attributes[fieldName]) + 1;
922
+ }
923
+ else {
924
+ selectFeatureAttr.attributes[fieldName] = Number(selectFeatureAttr.attributes[fieldName]) - 1;
925
+ }
926
+ //use the oid and like/dislike field value to update
927
+ attributesToUpdate[selectedLayer.objectIdField] = selectFeatureAttr.attributes[selectedLayer.objectIdField];
928
+ attributesToUpdate[fieldName] = selectFeatureAttr.attributes[fieldName];
929
+ const newGraphicInstance = new this.Graphic();
930
+ newGraphicInstance.attributes = attributesToUpdate;
931
+ // Update the feature attribute in the feature layer
932
+ const param = { updateFeatures: [newGraphicInstance] };
933
+ await selectedLayer.applyEdits(param).then(() => {
934
+ this._selectedGraphic = selectFeatureAttr;
935
+ //update the current graphics in info card so that, the updated values are reflected in popup content
936
+ if (this._infoCard) {
937
+ void this._infoCard.updateCurrentGraphic(this._selectedGraphic);
938
+ }
939
+ //store the like dislike value for the current selected graphic in local storage
940
+ this.setInLocalStorage();
941
+ this.loadingStatus.emit(false);
942
+ }, (err) => {
943
+ this.loadingStatus.emit(false);
944
+ console.log(err);
945
+ });
946
+ }
947
+ /**
948
+ * Gets the like/dislike information form local storage and updates the like and dislike button states
949
+ * @protected
950
+ */
951
+ getFromLocalStorage() {
952
+ const uniqueLayerId = this._selectedGraphic.layer.id;
953
+ //get the data from local storage and check current feature is liked or disliked
954
+ const localStorageUser = localStorage[uniqueLayerId];
955
+ if (localStorageUser) {
956
+ const parseArr = JSON.parse(localStorageUser);
957
+ const res = parseArr.filter((arr) => arr.id === this._selectedGraphic.getObjectId());
958
+ if (res.length > 0) {
959
+ this._isLikeBtnClicked = res[0].like;
960
+ this._isDislikeBtnClicked = res[0].dislike;
961
+ }
962
+ }
963
+ }
964
+ /**
965
+ * Sets the like/dislike information for the current selected graphic in local storage
966
+ * @protected
967
+ */
968
+ setInLocalStorage() {
969
+ const uniqueLayerId = this._selectedGraphic.layer.id;
970
+ const localStorageInfo = localStorage[uniqueLayerId];
971
+ let information = [];
972
+ //if information for the current layer found in local storage update it
973
+ //else add new information for the current layer in the local storage
974
+ if (localStorageInfo) {
975
+ information = JSON.parse(localStorageInfo);
976
+ const index = information.findIndex((arr) => arr.id === this._selectedGraphic.getObjectId());
977
+ //if information for current objectid found delete it, so that we always have info for each oid in a layer only once
978
+ if (index >= 0) {
979
+ information.splice(index, 1);
980
+ }
981
+ }
982
+ //add the information for current selected graphic
983
+ information.push({
984
+ id: this._selectedGraphic.getObjectId(),
985
+ like: this._isLikeBtnClicked && this._likeCount !== 0,
986
+ dislike: this._isDislikeBtnClicked && this._disLikeCount !== 0
987
+ });
988
+ localStorage.setItem(uniqueLayerId, JSON.stringify(information));
989
+ }
990
+ get el() { return getElement(this); }
991
+ static get watchers() { return {
992
+ "graphics": ["graphicsWatchHandler"]
993
+ }; }
994
+ };
995
+ FeatureDetails.style = featureDetailsCss;
996
+
686
997
  const featureListCss = ":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.popup-title{font-weight:500;padding:10px 12px}";
687
998
 
688
999
  const FeatureList = class {
@@ -812,7 +1123,20 @@ const FeatureList = class {
812
1123
  const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayerId);
813
1124
  this._highlightHandle = await highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
814
1125
  }
815
- this.featureSelect.emit(selectedFeature);
1126
+ await this.emitSelectedFeature(selectedFeature);
1127
+ }
1128
+ /**
1129
+ * Emit selected feature with its complete graphics and attributes
1130
+ * @param graphic selected feature graphic
1131
+ * @protected
1132
+ */
1133
+ async emitSelectedFeature(graphic) {
1134
+ const layer = graphic.layer;
1135
+ const query = layer.createQuery();
1136
+ query.returnGeometry = true;
1137
+ query.objectIds = [graphic.getObjectId()];
1138
+ const completeGraphic = await layer.queryFeatures(query);
1139
+ this.featureSelect.emit(completeGraphic.features[0]);
816
1140
  }
817
1141
  /**
818
1142
  * On feature hover in feature list highlight the feature on the map
@@ -1095,4 +1419,4 @@ const LayerList = class {
1095
1419
  };
1096
1420
  LayerList.style = layerListCss;
1097
1421
 
1098
- export { Flow as calcite_flow, FlowItem as calcite_flow_item, CreateFeature as create_feature, FeatureList as feature_list, LayerList as layer_list };
1422
+ export { Flow as calcite_flow, FlowItem as calcite_flow_item, CreateFeature as create_feature, FeatureDetails as feature_details, FeatureList as feature_list, LayerList as layer_list };
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-164d485a.js';
7
7
  import { g as getLocaleComponentStrings, l as loadModules } from './locale-bcbea4ef.js';
8
- import { q as queryFeaturesByID, g as getLayerOrTable, d as goToSelection, e as queryAllIds, f as queryFeatureIds, i as queryFeaturesByGlobalID } from './mapViewUtils-253178f1.js';
9
- import { d as downloadCSV } from './downloadUtils-0c1e4d7b.js';
8
+ import { q as queryFeaturesByID, g as getLayerOrTable, d as goToSelection, e as queryAllIds, f as queryFeatureIds, i as queryFeaturesByGlobalID } from './mapViewUtils-c83c03a4.js';
9
+ import { d as downloadCSV } from './downloadUtils-25aa808f.js';
10
10
  import './esri-loader-1b324844.js';
11
11
  import './_commonjsHelpers-0f74c230.js';
12
12
  import './interfaces-586e863c.js';
@@ -301,7 +301,7 @@ const LayerTable = class {
301
301
  * @param evt CustomEvent the graphic for the current selection
302
302
  */
303
303
  async selectionChanged(evt) {
304
- const g = evt.detail[0];
304
+ const g = evt.detail.selectedFeature[0];
305
305
  const oid = g.getObjectId();
306
306
  if (this.zoomAndScrollToSelected) {
307
307
  const i = this._table.viewModel.getObjectIdIndex(oid);
@@ -458,7 +458,7 @@ const LayerTable = class {
458
458
  _getActionBar() {
459
459
  const containerClass = this.isMobile ? "width-full" : "";
460
460
  const mobileClass = this.isMobile ? "border-top" : "";
461
- return (h("calcite-action-bar", { class: containerClass, expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, h("div", { class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, h("map-layer-picker", { appearance: "transparent", defaultLayerId: this.defaultLayerId, display: "inline-flex", height: 50, isMobile: this.isMobile, mapView: this.mapView, onLayerSelectionChange: (evt) => this._layerSelectionChanged(evt), onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, placeholderIcon: "layers", scale: "l", showSingleLayerAsLabel: true, showTables: true, type: "dropdown" })), !this.isMobile ? this._getActions() : undefined));
461
+ return (h("calcite-action-bar", { class: containerClass, expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, h("div", { class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, h("map-layer-picker", { appearance: "transparent", defaultLayerId: this.defaultLayerId, display: "inline-flex", height: 50, isMobile: this.isMobile, mapView: this.mapView, onLayerSelectionChange: (evt) => void this._layerSelectionChanged(evt), onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, placeholderIcon: "layers", scale: "l", showSingleLayerAsLabel: true, showTables: true, type: "dropdown" })), !this.isMobile ? this._getActions() : undefined));
462
462
  }
463
463
  /**
464
464
  * Get the actions that are used for various interactions with the table
@@ -1745,7 +1745,7 @@ const MapCard = class {
1745
1745
  }
1746
1746
  else if (loadDefaultMap) {
1747
1747
  this._defaultWebmapHonored = true;
1748
- this._mapPicker.setMapByID(id);
1748
+ void this._mapPicker.setMapByID(id);
1749
1749
  }
1750
1750
  else if (mapConfigChanged) {
1751
1751
  // Map is the same so no need to reload but we need to update for any changes from the config
@@ -3,18 +3,19 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import { r as registerInstance, h, H as Host, g as getElement } from './index-164d485a.js';
6
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-164d485a.js';
7
7
  import { g as getLocaleComponentStrings } from './locale-bcbea4ef.js';
8
8
  import { E as ELayoutMode } from './interfaces-586e863c.js';
9
- import { g as getLayerOrTable } from './mapViewUtils-253178f1.js';
9
+ import { g as getLayerOrTable } from './mapViewUtils-c83c03a4.js';
10
10
  import './esri-loader-1b324844.js';
11
11
  import './_commonjsHelpers-0f74c230.js';
12
12
 
13
- const crowdsourceManagerCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}";
13
+ const crowdsourceManagerCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}";
14
14
 
15
15
  const CrowdsourceManager = class {
16
16
  constructor(hostRef) {
17
17
  registerInstance(this, hostRef);
18
+ this.infoIconButtonClick = createEvent(this, "infoIconButtonClick", 7);
18
19
  //--------------------------------------------------------------------------
19
20
  //
20
21
  // Properties (protected)
@@ -55,7 +56,7 @@ const CrowdsourceManager = class {
55
56
  this.enableSearch = true;
56
57
  this.enableShare = false;
57
58
  this.enableZoom = true;
58
- this.hideMapOnLoad = undefined;
59
+ this.hideMapOnLoad = false;
59
60
  this.mapInfos = [];
60
61
  this.onlyShowUpdatableLayers = true;
61
62
  this.popupHeaderColor = undefined;
@@ -69,7 +70,7 @@ const CrowdsourceManager = class {
69
70
  this.theme = "light";
70
71
  this.zoomAndScrollToSelected = false;
71
72
  this.zoomToScale = undefined;
72
- this._expandPopup = false;
73
+ this._expandPopup = this.hideMapOnLoad;
73
74
  this._hideFooter = false;
74
75
  this._hideTable = false;
75
76
  this._isMobile = undefined;
@@ -93,16 +94,6 @@ const CrowdsourceManager = class {
93
94
  enableZoomWatchHandler() {
94
95
  this._initMapZoom();
95
96
  }
96
- //--------------------------------------------------------------------------
97
- //
98
- // Methods (public)
99
- //
100
- //--------------------------------------------------------------------------
101
- //--------------------------------------------------------------------------
102
- //
103
- // Events (public)
104
- //
105
- //--------------------------------------------------------------------------
106
97
  /**
107
98
  * Listen for changes in feature selection and show or hide the map, popup, and table
108
99
  */
@@ -149,7 +140,6 @@ const CrowdsourceManager = class {
149
140
  async beforeMapChanged() {
150
141
  if (this._expandPopup) {
151
142
  this._shouldSetMapView = true;
152
- this._expandPopup = false;
153
143
  }
154
144
  }
155
145
  /**
@@ -162,6 +152,12 @@ const CrowdsourceManager = class {
162
152
  this._layer = layer;
163
153
  });
164
154
  }
155
+ /**
156
+ * Update the state expandPopup when mapInfoChange event occurs
157
+ */
158
+ async mapInfoChange() {
159
+ this._expandPopup = this.hideMapOnLoad;
160
+ }
165
161
  //--------------------------------------------------------------------------
166
162
  //
167
163
  // Functions (lifecycle)
@@ -301,7 +297,14 @@ const CrowdsourceManager = class {
301
297
  */
302
298
  _getBody(layoutMode, panelOpen, hideTable) {
303
299
  const contentClass = layoutMode === ELayoutMode.HORIZONTAL ? "" : "display-flex";
304
- 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))));
300
+ const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
301
+ 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" }))));
302
+ }
303
+ /**
304
+ * Emit the event when info button clicked
305
+ */
306
+ infoButtonClick() {
307
+ this.infoIconButtonClick.emit();
305
308
  }
306
309
  /**
307
310
  * Get the map and card nodes based for the current layout options
@@ -347,7 +350,12 @@ const CrowdsourceManager = class {
347
350
  const headerClass = this._isMobile ? "display-none height-0" : "";
348
351
  const headerTheme = !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
349
352
  const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
350
- 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())));
353
+ return (h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass}`, style: {
354
+ '--calcite-color-foreground-1': this.popupHeaderColor,
355
+ '--calcite-color-foreground-2': this.popupHeaderHoverColor,
356
+ '--calcite-color-text-3': this.popupHeaderHoverTextColor,
357
+ '--calcite-color-text-2': this.popupHeaderTextColor, /* font color to apply to the popup header */
358
+ } }, 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())));
351
359
  }
352
360
  /**
353
361
  * Toggle the popup information