@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
@@ -16,7 +16,7 @@ const locale = require('./locale-d237c9d5.js');
16
16
  const t9n = require('./t9n-993a84de.js');
17
17
  const resources = require('./resources-3e593312.js');
18
18
  const locale$1 = require('./locale-3d0a4bc2.js');
19
- const mapViewUtils = require('./mapViewUtils-3e0fa457.js');
19
+ const mapViewUtils = require('./mapViewUtils-82018df6.js');
20
20
  const popupUtils = require('./popupUtils-6be3588c.js');
21
21
  require('./guid-ae73cd27.js');
22
22
  require('./resources-9447c777.js');
@@ -349,6 +349,7 @@ const CreateFeature = class {
349
349
  this.fail = index.createEvent(this, "fail", 7);
350
350
  this.drawComplete = index.createEvent(this, "drawComplete", 7);
351
351
  this.editingAttachment = index.createEvent(this, "editingAttachment", 7);
352
+ this.progressStatus = index.createEvent(this, "progressStatus", 7);
352
353
  this.mapView = undefined;
353
354
  this.selectedLayerId = undefined;
354
355
  this.customizeSubmit = false;
@@ -493,6 +494,7 @@ const CreateFeature = class {
493
494
  //Add handle to watch featureTemplatesViewModel ready state and then start the creation
494
495
  const handle = this.reactiveUtils.watch(() => this._editor.viewModel.featureTemplatesViewModel.state, (state) => {
495
496
  if (state === 'ready') {
497
+ this.progressStatus.emit(0.5);
496
498
  void this.startCreate();
497
499
  }
498
500
  });
@@ -516,6 +518,7 @@ const CreateFeature = class {
516
518
  //once the feature template is selected handle the event for formSubmit and sketch complete
517
519
  //also, hide the headers and footer in the editor as we will be showing our own submit and cancel button
518
520
  this._editor.viewModel.featureTemplatesViewModel.on('select', () => {
521
+ this.progressStatus.emit(0.75);
519
522
  setTimeout(() => {
520
523
  //on form submit
521
524
  this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
@@ -523,6 +526,7 @@ const CreateFeature = class {
523
526
  this._editor.viewModel.sketchViewModel.on("create", (evt) => {
524
527
  if (evt.state === "complete") {
525
528
  this.showSearchWidget = false;
529
+ this.progressStatus.emit(1);
526
530
  this.drawComplete.emit();
527
531
  }
528
532
  });
@@ -687,6 +691,313 @@ const CreateFeature = class {
687
691
  };
688
692
  CreateFeature.style = createFeatureCss;
689
693
 
694
+ 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}";
695
+
696
+ const FeatureDetails = class {
697
+ constructor(hostRef) {
698
+ index.registerInstance(this, hostRef);
699
+ this.loadingStatus = index.createEvent(this, "loadingStatus", 7);
700
+ /**
701
+ * string[]: Valid field types for like and dislike
702
+ */
703
+ this._validFieldTypes = ["small-integer", "integer", "big-integer", "single", "long"];
704
+ this.mapView = undefined;
705
+ this.graphics = undefined;
706
+ this.reportingOptions = undefined;
707
+ this._likeFieldAvailable = false;
708
+ this._likeCount = 0;
709
+ this._disLikeCount = 0;
710
+ this._dislikeFieldAvailable = false;
711
+ this._isLikeBtnClicked = false;
712
+ this._isDislikeBtnClicked = false;
713
+ }
714
+ //--------------------------------------------------------------------------
715
+ //
716
+ // Watch handlers
717
+ //
718
+ //--------------------------------------------------------------------------
719
+ /**
720
+ * Called each time the graphics prop is changed
721
+ */
722
+ async graphicsWatchHandler() {
723
+ await this.getCompleteGraphic(this.graphics[0]);
724
+ this.checkLikeDislikeFields();
725
+ }
726
+ //--------------------------------------------------------------------------
727
+ //
728
+ // Methods (public)
729
+ /**
730
+ * Refresh the features comments which will fetch like, dislike and update the component
731
+ * @returns Promise that resolves when the operation is complete
732
+ */
733
+ async refresh(graphic) {
734
+ if (this.isLikeDislikeConfigured(graphic.layer)) {
735
+ // in case of multiple features selected fetch complete feature and update like dislike for current feature
736
+ if (graphic && this.graphics.length > 1) {
737
+ await this.getCompleteGraphic(graphic);
738
+ this.checkLikeDislikeFields();
739
+ }
740
+ }
741
+ else {
742
+ this._likeFieldAvailable = false;
743
+ this._dislikeFieldAvailable = false;
744
+ }
745
+ }
746
+ /**
747
+ * Go to the previous feature in the features widget
748
+ */
749
+ async back() {
750
+ void this._infoCard.back();
751
+ }
752
+ /**
753
+ * Go to the next feature in the features widget
754
+ */
755
+ async next() {
756
+ void this._infoCard.next();
757
+ }
758
+ /**
759
+ * Toggle the visibility of the features list view
760
+ */
761
+ async toggleListView() {
762
+ void this._infoCard.toggleListView();
763
+ }
764
+ /**
765
+ * StencilJS: Called once just after the component is first connected to the DOM.
766
+ *
767
+ * @returns Promise when complete
768
+ */
769
+ async componentWillLoad() {
770
+ await this._initModules();
771
+ await this.getCompleteGraphic(this.graphics[0]);
772
+ this.checkLikeDislikeFields();
773
+ }
774
+ render() {
775
+ var _a, _b, _c, _d;
776
+ return (index.h("calcite-panel", { "full-height": true }, index.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) &&
777
+ index.h("div", { class: 'buttons' }, this._likeFieldAvailable &&
778
+ index.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 &&
779
+ index.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))));
780
+ }
781
+ /**
782
+ * Load esri javascript api modules
783
+ *
784
+ * @returns Promise resolving when function is done
785
+ *
786
+ * @protected
787
+ */
788
+ async _initModules() {
789
+ const [Graphic] = await locale$1.loadModules([
790
+ "esri/Graphic"
791
+ ]);
792
+ this.Graphic = Graphic;
793
+ }
794
+ /**
795
+ * Get complete graphic with complete attributes
796
+ * @param graphic selected feature graphic
797
+ * @protected
798
+ */
799
+ async getCompleteGraphic(graphic) {
800
+ const layer = graphic.layer;
801
+ const query = layer.createQuery();
802
+ query.objectIds = [graphic.getObjectId()];
803
+ const completeGraphic = await layer.queryFeatures(query);
804
+ this._selectedGraphic = completeGraphic.features[0];
805
+ }
806
+ /**
807
+ * Checks if the layers is configured for like dislike or not
808
+ * @param selectedLayer Feature layer
809
+ * @returns boolean
810
+ * @protected
811
+ */
812
+ isLikeDislikeConfigured(selectedLayer) {
813
+ let likeFieldAvailable = false;
814
+ let dislikeFieldAvailable = false;
815
+ // check if reporting options are configured for the current selected feature's layer
816
+ if (this.reportingOptions && this.reportingOptions[selectedLayer.id]) {
817
+ //return false if both like and dislike are disabled for the layer
818
+ if (!this.reportingOptions[selectedLayer.id].like && !this.reportingOptions[selectedLayer.id].dislike) {
819
+ return false;
820
+ }
821
+ const likeField = this.reportingOptions[selectedLayer.id].likeField;
822
+ const dislikeField = this.reportingOptions[selectedLayer.id].dislikeField;
823
+ //if both fields are not configured return false
824
+ if (!likeField && !dislikeField) {
825
+ return false;
826
+ }
827
+ selectedLayer.fields.forEach((eachField) => {
828
+ if (this._validFieldTypes.indexOf(eachField.type) > -1) {
829
+ if (eachField.name === likeField && this.reportingOptions[selectedLayer.id].like) {
830
+ likeFieldAvailable = true;
831
+ }
832
+ else if (eachField.name === dislikeField && this.reportingOptions[selectedLayer.id].dislike) {
833
+ dislikeFieldAvailable = true;
834
+ }
835
+ }
836
+ });
837
+ }
838
+ return likeFieldAvailable || dislikeFieldAvailable;
839
+ }
840
+ /**
841
+ * Check if configured like or dislike fields are available in the selected layer
842
+ * @protected
843
+ */
844
+ checkLikeDislikeFields() {
845
+ this._likeFieldAvailable = false;
846
+ this._dislikeFieldAvailable = false;
847
+ this._isLikeBtnClicked = false;
848
+ this._isDislikeBtnClicked = false;
849
+ this._likeCount = 0;
850
+ this._disLikeCount = 0;
851
+ const selectedLayer = this._selectedGraphic.layer;
852
+ // check if reporting options are configured for the current selected feature's layer
853
+ if (this.reportingOptions && this.reportingOptions[selectedLayer.id]) {
854
+ this._likeField = this.reportingOptions[selectedLayer.id].likeField;
855
+ this._dislikeField = this.reportingOptions[selectedLayer.id].dislikeField;
856
+ //if both fields are not found return
857
+ if (!this._likeField && !this._dislikeField) {
858
+ return;
859
+ }
860
+ //Check if selected layer have the configured like and dislike fields
861
+ //also, get the current value for like and dislike field from the attributes
862
+ selectedLayer.fields.forEach((eachField) => {
863
+ if (this._validFieldTypes.indexOf(eachField.type) > -1) {
864
+ if (eachField.name === this._likeField && this.reportingOptions[this._selectedGraphic.layer.id].like) {
865
+ this._likeFieldAvailable = true;
866
+ this._likeCount = this._selectedGraphic.attributes[eachField.name];
867
+ }
868
+ else if (eachField.name === this._dislikeField && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
869
+ this._dislikeFieldAvailable = true;
870
+ this._disLikeCount = this._selectedGraphic.attributes[eachField.name];
871
+ }
872
+ }
873
+ });
874
+ this.getFromLocalStorage();
875
+ }
876
+ }
877
+ /**
878
+ * On like button click highlight the like button and update the feature
879
+ * @protected
880
+ */
881
+ onLikeButtonClick() {
882
+ this.loadingStatus.emit(true);
883
+ if (this._isDislikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
884
+ this.onDislikeButtonClick();
885
+ }
886
+ this._isLikeBtnClicked = !this._isLikeBtnClicked;
887
+ if (this._isLikeBtnClicked) {
888
+ this._likeCount++;
889
+ }
890
+ else {
891
+ this._likeCount--;
892
+ }
893
+ void this.updateFeaturesLikeDislikeField(this._likeField, this._isLikeBtnClicked);
894
+ }
895
+ /**
896
+ * On dislike button click highlight the dislike button and update the feature
897
+ * @protected
898
+ */
899
+ onDislikeButtonClick() {
900
+ this.loadingStatus.emit(true);
901
+ if (this._isLikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].like) {
902
+ this.onLikeButtonClick();
903
+ }
904
+ this._isDislikeBtnClicked = !this._isDislikeBtnClicked;
905
+ if (this._isDislikeBtnClicked) {
906
+ this._disLikeCount++;
907
+ }
908
+ else {
909
+ this._disLikeCount--;
910
+ }
911
+ void this.updateFeaturesLikeDislikeField(this._dislikeField, this._isDislikeBtnClicked);
912
+ }
913
+ /**
914
+ * Update the feature if user click on like or dislike button
915
+ * @param fieldName field name of the feature for like or dislike attribute
916
+ * @param buttonClicked is like or dislike button clicked
917
+ * @protected
918
+ */
919
+ async updateFeaturesLikeDislikeField(fieldName, buttonClicked) {
920
+ const attributesToUpdate = {};
921
+ const selectedLayer = this._selectedGraphic.layer;
922
+ //Increment the value if button is clicked or else decrement it
923
+ const selectFeatureAttr = this._selectedGraphic;
924
+ if (buttonClicked) {
925
+ selectFeatureAttr.attributes[fieldName] = Number(selectFeatureAttr.attributes[fieldName]) + 1;
926
+ }
927
+ else {
928
+ selectFeatureAttr.attributes[fieldName] = Number(selectFeatureAttr.attributes[fieldName]) - 1;
929
+ }
930
+ //use the oid and like/dislike field value to update
931
+ attributesToUpdate[selectedLayer.objectIdField] = selectFeatureAttr.attributes[selectedLayer.objectIdField];
932
+ attributesToUpdate[fieldName] = selectFeatureAttr.attributes[fieldName];
933
+ const newGraphicInstance = new this.Graphic();
934
+ newGraphicInstance.attributes = attributesToUpdate;
935
+ // Update the feature attribute in the feature layer
936
+ const param = { updateFeatures: [newGraphicInstance] };
937
+ await selectedLayer.applyEdits(param).then(() => {
938
+ this._selectedGraphic = selectFeatureAttr;
939
+ //update the current graphics in info card so that, the updated values are reflected in popup content
940
+ if (this._infoCard) {
941
+ void this._infoCard.updateCurrentGraphic(this._selectedGraphic);
942
+ }
943
+ //store the like dislike value for the current selected graphic in local storage
944
+ this.setInLocalStorage();
945
+ this.loadingStatus.emit(false);
946
+ }, (err) => {
947
+ this.loadingStatus.emit(false);
948
+ console.log(err);
949
+ });
950
+ }
951
+ /**
952
+ * Gets the like/dislike information form local storage and updates the like and dislike button states
953
+ * @protected
954
+ */
955
+ getFromLocalStorage() {
956
+ const uniqueLayerId = this._selectedGraphic.layer.id;
957
+ //get the data from local storage and check current feature is liked or disliked
958
+ const localStorageUser = localStorage[uniqueLayerId];
959
+ if (localStorageUser) {
960
+ const parseArr = JSON.parse(localStorageUser);
961
+ const res = parseArr.filter((arr) => arr.id === this._selectedGraphic.getObjectId());
962
+ if (res.length > 0) {
963
+ this._isLikeBtnClicked = res[0].like;
964
+ this._isDislikeBtnClicked = res[0].dislike;
965
+ }
966
+ }
967
+ }
968
+ /**
969
+ * Sets the like/dislike information for the current selected graphic in local storage
970
+ * @protected
971
+ */
972
+ setInLocalStorage() {
973
+ const uniqueLayerId = this._selectedGraphic.layer.id;
974
+ const localStorageInfo = localStorage[uniqueLayerId];
975
+ let information = [];
976
+ //if information for the current layer found in local storage update it
977
+ //else add new information for the current layer in the local storage
978
+ if (localStorageInfo) {
979
+ information = JSON.parse(localStorageInfo);
980
+ const index = information.findIndex((arr) => arr.id === this._selectedGraphic.getObjectId());
981
+ //if information for current objectid found delete it, so that we always have info for each oid in a layer only once
982
+ if (index >= 0) {
983
+ information.splice(index, 1);
984
+ }
985
+ }
986
+ //add the information for current selected graphic
987
+ information.push({
988
+ id: this._selectedGraphic.getObjectId(),
989
+ like: this._isLikeBtnClicked && this._likeCount !== 0,
990
+ dislike: this._isDislikeBtnClicked && this._disLikeCount !== 0
991
+ });
992
+ localStorage.setItem(uniqueLayerId, JSON.stringify(information));
993
+ }
994
+ get el() { return index.getElement(this); }
995
+ static get watchers() { return {
996
+ "graphics": ["graphicsWatchHandler"]
997
+ }; }
998
+ };
999
+ FeatureDetails.style = featureDetailsCss;
1000
+
690
1001
  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}";
691
1002
 
692
1003
  const FeatureList = class {
@@ -816,7 +1127,20 @@ const FeatureList = class {
816
1127
  const selectedLayerView = await mapViewUtils.getFeatureLayerView(this.mapView, this.selectedLayerId);
817
1128
  this._highlightHandle = await mapViewUtils.highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
818
1129
  }
819
- this.featureSelect.emit(selectedFeature);
1130
+ await this.emitSelectedFeature(selectedFeature);
1131
+ }
1132
+ /**
1133
+ * Emit selected feature with its complete graphics and attributes
1134
+ * @param graphic selected feature graphic
1135
+ * @protected
1136
+ */
1137
+ async emitSelectedFeature(graphic) {
1138
+ const layer = graphic.layer;
1139
+ const query = layer.createQuery();
1140
+ query.returnGeometry = true;
1141
+ query.objectIds = [graphic.getObjectId()];
1142
+ const completeGraphic = await layer.queryFeatures(query);
1143
+ this.featureSelect.emit(completeGraphic.features[0]);
820
1144
  }
821
1145
  /**
822
1146
  * On feature hover in feature list highlight the feature on the map
@@ -1102,5 +1426,6 @@ LayerList.style = layerListCss;
1102
1426
  exports.calcite_flow = Flow;
1103
1427
  exports.calcite_flow_item = FlowItem;
1104
1428
  exports.create_feature = CreateFeature;
1429
+ exports.feature_details = FeatureDetails;
1105
1430
  exports.feature_list = FeatureList;
1106
1431
  exports.layer_list = LayerList;
@@ -9,8 +9,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  const index = require('./index-105cf2b9.js');
11
11
  const locale = require('./locale-3d0a4bc2.js');
12
- const mapViewUtils = require('./mapViewUtils-3e0fa457.js');
13
- const downloadUtils = require('./downloadUtils-8b05d7cc.js');
12
+ const mapViewUtils = require('./mapViewUtils-82018df6.js');
13
+ const downloadUtils = require('./downloadUtils-dd787ddf.js');
14
14
  require('./esri-loader-ce6c3d3d.js');
15
15
  require('./_commonjsHelpers-480c2e77.js');
16
16
  require('./interfaces-7cd0a48a.js');
@@ -305,7 +305,7 @@ const LayerTable = class {
305
305
  * @param evt CustomEvent the graphic for the current selection
306
306
  */
307
307
  async selectionChanged(evt) {
308
- const g = evt.detail[0];
308
+ const g = evt.detail.selectedFeature[0];
309
309
  const oid = g.getObjectId();
310
310
  if (this.zoomAndScrollToSelected) {
311
311
  const i = this._table.viewModel.getObjectIdIndex(oid);
@@ -462,7 +462,7 @@ const LayerTable = class {
462
462
  _getActionBar() {
463
463
  const containerClass = this.isMobile ? "width-full" : "";
464
464
  const mobileClass = this.isMobile ? "border-top" : "";
465
- return (index.h("calcite-action-bar", { class: containerClass, expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, index.h("div", { class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, index.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));
465
+ return (index.h("calcite-action-bar", { class: containerClass, expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, index.h("div", { class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, index.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));
466
466
  }
467
467
  /**
468
468
  * Get the actions that are used for various interactions with the table
@@ -1749,7 +1749,7 @@ const MapCard = class {
1749
1749
  }
1750
1750
  else if (loadDefaultMap) {
1751
1751
  this._defaultWebmapHonored = true;
1752
- this._mapPicker.setMapByID(id);
1752
+ void this._mapPicker.setMapByID(id);
1753
1753
  }
1754
1754
  else if (mapConfigChanged) {
1755
1755
  // Map is the same so no need to reload but we need to update for any changes from the config
@@ -10,15 +10,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
10
10
  const index = require('./index-105cf2b9.js');
11
11
  const locale = require('./locale-3d0a4bc2.js');
12
12
  const interfaces = require('./interfaces-7cd0a48a.js');
13
- const mapViewUtils = require('./mapViewUtils-3e0fa457.js');
13
+ const mapViewUtils = require('./mapViewUtils-82018df6.js');
14
14
  require('./esri-loader-ce6c3d3d.js');
15
15
  require('./_commonjsHelpers-480c2e77.js');
16
16
 
17
- 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}";
17
+ 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}";
18
18
 
19
19
  const CrowdsourceManager = class {
20
20
  constructor(hostRef) {
21
21
  index.registerInstance(this, hostRef);
22
+ this.infoIconButtonClick = index.createEvent(this, "infoIconButtonClick", 7);
22
23
  //--------------------------------------------------------------------------
23
24
  //
24
25
  // Properties (protected)
@@ -59,7 +60,7 @@ const CrowdsourceManager = class {
59
60
  this.enableSearch = true;
60
61
  this.enableShare = false;
61
62
  this.enableZoom = true;
62
- this.hideMapOnLoad = undefined;
63
+ this.hideMapOnLoad = false;
63
64
  this.mapInfos = [];
64
65
  this.onlyShowUpdatableLayers = true;
65
66
  this.popupHeaderColor = undefined;
@@ -73,7 +74,7 @@ const CrowdsourceManager = class {
73
74
  this.theme = "light";
74
75
  this.zoomAndScrollToSelected = false;
75
76
  this.zoomToScale = undefined;
76
- this._expandPopup = false;
77
+ this._expandPopup = this.hideMapOnLoad;
77
78
  this._hideFooter = false;
78
79
  this._hideTable = false;
79
80
  this._isMobile = undefined;
@@ -97,16 +98,6 @@ const CrowdsourceManager = class {
97
98
  enableZoomWatchHandler() {
98
99
  this._initMapZoom();
99
100
  }
100
- //--------------------------------------------------------------------------
101
- //
102
- // Methods (public)
103
- //
104
- //--------------------------------------------------------------------------
105
- //--------------------------------------------------------------------------
106
- //
107
- // Events (public)
108
- //
109
- //--------------------------------------------------------------------------
110
101
  /**
111
102
  * Listen for changes in feature selection and show or hide the map, popup, and table
112
103
  */
@@ -153,7 +144,6 @@ const CrowdsourceManager = class {
153
144
  async beforeMapChanged() {
154
145
  if (this._expandPopup) {
155
146
  this._shouldSetMapView = true;
156
- this._expandPopup = false;
157
147
  }
158
148
  }
159
149
  /**
@@ -166,6 +156,12 @@ const CrowdsourceManager = class {
166
156
  this._layer = layer;
167
157
  });
168
158
  }
159
+ /**
160
+ * Update the state expandPopup when mapInfoChange event occurs
161
+ */
162
+ async mapInfoChange() {
163
+ this._expandPopup = this.hideMapOnLoad;
164
+ }
169
165
  //--------------------------------------------------------------------------
170
166
  //
171
167
  // Functions (lifecycle)
@@ -305,7 +301,14 @@ const CrowdsourceManager = class {
305
301
  */
306
302
  _getBody(layoutMode, panelOpen, hideTable) {
307
303
  const contentClass = layoutMode === interfaces.ELayoutMode.HORIZONTAL ? "" : "display-flex";
308
- return (index.h("calcite-panel", { class: "width-full height-full" }, index.h("div", { class: `width-full height-full overflow-hidden ${contentClass}` }, this._getMapAndCard(layoutMode, panelOpen, hideTable), this._getTable(layoutMode, panelOpen, hideTable))));
304
+ const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
305
+ return (index.h("calcite-panel", { class: "width-full height-full" }, index.h("div", { class: `width-full height-full overflow-hidden ${contentClass}` }, this._getMapAndCard(layoutMode, panelOpen, hideTable), this._getTable(layoutMode, panelOpen, hideTable)), index.h("div", { class: "floating-container", onClick: this.infoButtonClick.bind(this) }, index.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" }))));
306
+ }
307
+ /**
308
+ * Emit the event when info button clicked
309
+ */
310
+ infoButtonClick() {
311
+ this.infoIconButtonClick.emit();
309
312
  }
310
313
  /**
311
314
  * Get the map and card nodes based for the current layout options
@@ -351,7 +354,12 @@ const CrowdsourceManager = class {
351
354
  const headerClass = this._isMobile ? "display-none height-0" : "";
352
355
  const headerTheme = !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
353
356
  const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
354
- return (index.h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass}` }, index.h("calcite-panel", null, !this._isMobile ? (index.h("div", { class: `display-flex align-items-center ${headerClass}`, slot: "header-content" }, index.h("calcite-icon", { icon: "information", scale: "s" }), index.h("div", { class: "padding-inline-start-75" }, this._translations.information))) : undefined, index.h("calcite-action", { class: headerClass, disabled: this._tableOnly, icon: icon, id: id, onClick: () => this._togglePopup(), slot: "header-actions-end", text: "" }), !this._tableOnly ? index.h("calcite-tooltip", { class: themeClass, label: "", placement: "bottom", "reference-element": id }, index.h("span", null, tooltip)) : undefined, this._getCardNode())));
357
+ return (index.h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass}`, style: {
358
+ '--calcite-color-foreground-1': this.popupHeaderColor,
359
+ '--calcite-color-foreground-2': this.popupHeaderHoverColor,
360
+ '--calcite-color-text-3': this.popupHeaderHoverTextColor,
361
+ '--calcite-color-text-2': this.popupHeaderTextColor, /* font color to apply to the popup header */
362
+ } }, index.h("calcite-panel", null, !this._isMobile ? (index.h("div", { class: `display-flex align-items-center ${headerClass}`, slot: "header-content" }, index.h("calcite-icon", { icon: "information", scale: "s" }), index.h("div", { class: "padding-inline-start-75" }, this._translations.information))) : undefined, index.h("calcite-action", { class: headerClass, disabled: this._tableOnly, icon: icon, id: id, onClick: () => this._togglePopup(), slot: "header-actions-end", text: "" }), !this._tableOnly ? index.h("calcite-tooltip", { class: themeClass, label: "", placement: "bottom", "reference-element": id }, index.h("span", null, tooltip)) : undefined, this._getCardNode())));
355
363
  }
356
364
  /**
357
365
  * Toggle the popup information