@esri/solutions-components 0.8.7 → 0.8.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/crowdsource-reporter/resources.json +3 -1
- package/dist/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
- package/dist/cjs/{calcite-action-menu_2.cjs.entry.js → calcite-action-menu_3.cjs.entry.js} +114 -7
- package/dist/cjs/calcite-alert_4.cjs.entry.js +46 -5
- package/dist/cjs/{calcite-input-date-picker_3.cjs.entry.js → calcite-block_5.cjs.entry.js} +691 -13
- package/dist/cjs/{calcite-combobox_5.cjs.entry.js → calcite-combobox_3.cjs.entry.js} +876 -844
- package/dist/cjs/calcite-dropdown_4.cjs.entry.js +1023 -0
- package/dist/cjs/{calcite-flow_5.cjs.entry.js → calcite-flow_6.cjs.entry.js} +327 -2
- package/dist/cjs/card-manager_3.cjs.entry.js +5 -5
- package/dist/cjs/crowdsource-manager.cjs.entry.js +5 -1
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +122 -23
- package/dist/cjs/{downloadUtils-8b05d7cc.js → downloadUtils-dc349b1a.js} +2 -2
- package/dist/cjs/{index.es-e7587227.js → index.es-1830a1e6.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +8 -8
- package/dist/cjs/{mapViewUtils-3e0fa457.js → mapViewUtils-9dc05308.js} +11 -5
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/create-feature/create-feature.js +18 -0
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +72 -0
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +16 -0
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +155 -71
- package/dist/collection/components/feature-details/feature-details.css +18 -0
- package/dist/collection/components/feature-details/feature-details.js +500 -0
- package/dist/collection/components/feature-details/test/feature-details.e2e.js +14 -0
- package/dist/collection/components/feature-details/test/feature-details.spec.js +22 -0
- package/dist/collection/components/feature-list/feature-list.js +14 -1
- package/dist/collection/components/info-card/info-card.css +15 -5
- package/dist/collection/components/info-card/info-card.js +178 -5
- package/dist/collection/components/layer-table/layer-table.js +2 -2
- package/dist/collection/components/map-card/map-card.js +1 -1
- package/dist/collection/components/map-select-tools/map-select-tools.js +5 -5
- package/dist/collection/components/refine-selection/refine-selection.js +1 -1
- package/dist/collection/demos/crowdsource-reporter.html +115 -1
- package/dist/collection/utils/interfaces.ts +4 -4
- package/dist/collection/utils/mapViewUtils.js +11 -5
- package/dist/collection/utils/mapViewUtils.ts +13 -5
- package/dist/components/create-feature2.js +4 -0
- package/dist/components/crowdsource-manager.js +8 -0
- package/dist/components/crowdsource-reporter.js +270 -85
- package/dist/components/feature-details.d.ts +11 -0
- package/dist/components/feature-details.js +11 -0
- package/dist/components/feature-details2.js +449 -0
- package/dist/components/feature-list2.js +14 -1
- package/dist/components/info-card2.js +53 -5
- package/dist/components/layer-table2.js +2 -2
- package/dist/components/map-card2.js +1 -1
- package/dist/components/map-select-tools2.js +5 -5
- package/dist/components/mapViewUtils.js +11 -5
- package/dist/components/refine-selection2.js +1 -1
- package/dist/esm/{calcite-action-menu_2.entry.js → calcite-action-menu_3.entry.js} +118 -12
- package/dist/esm/calcite-alert_4.entry.js +46 -5
- package/dist/esm/{calcite-input-date-picker_3.entry.js → calcite-block_5.entry.js} +688 -12
- package/dist/esm/{calcite-combobox_5.entry.js → calcite-combobox_3.entry.js} +878 -844
- package/dist/esm/calcite-date-picker-day_3.entry.js +1 -1
- package/dist/esm/calcite-dropdown_4.entry.js +1016 -0
- package/dist/esm/{calcite-flow_5.entry.js → calcite-flow_6.entry.js} +327 -3
- package/dist/esm/card-manager_3.entry.js +5 -5
- package/dist/esm/crowdsource-manager.entry.js +5 -1
- package/dist/esm/crowdsource-reporter.entry.js +122 -23
- package/dist/esm/{date-5630530d.js → date-0c026a8b.js} +1 -1
- package/dist/esm/{downloadUtils-0c1e4d7b.js → downloadUtils-df4f21f6.js} +2 -2
- package/dist/esm/{index.es-286e3cfa.js → index.es-904fb846.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +8 -8
- package/dist/esm/{mapViewUtils-253178f1.js → mapViewUtils-2ec19fb0.js} +11 -5
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/crowdsource-reporter.html +115 -1
- package/dist/solutions-components/{p-813fd8a4.entry.js → p-29f518fd.entry.js} +2 -2
- package/dist/solutions-components/p-452fd697.entry.js +6 -0
- package/dist/solutions-components/p-511b1c91.entry.js +23 -0
- package/dist/solutions-components/p-577efb16.js +36 -0
- package/dist/solutions-components/{p-94de9279.js → p-5817d78c.js} +1 -1
- package/dist/solutions-components/p-602cd811.entry.js +17 -0
- package/dist/solutions-components/{p-15f9624a.entry.js → p-6557b703.entry.js} +1 -1
- package/dist/solutions-components/p-7269c49b.entry.js +6 -0
- package/dist/solutions-components/p-760bd17e.entry.js +6 -0
- package/dist/solutions-components/p-95fea07a.entry.js +17 -0
- package/dist/solutions-components/{p-212b02e7.js → p-ae4d86e8.js} +1 -1
- package/dist/solutions-components/{p-038fcd93.entry.js → p-c273ab7a.entry.js} +1 -1
- package/dist/solutions-components/p-d742b915.entry.js +29 -0
- package/dist/solutions-components/p-dfad61a8.entry.js +24 -0
- package/dist/solutions-components/{p-331b5d1e.js → p-fca434c8.js} +2 -2
- package/dist/solutions-components/p-fd82a00f.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +4 -4
- package/dist/solutions-components/utils/mapViewUtils.ts +13 -5
- package/dist/types/components/create-feature/create-feature.d.ts +4 -4
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +16 -0
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +91 -18
- package/dist/types/components/feature-details/feature-details.d.ts +151 -0
- package/dist/types/components/feature-list/feature-list.d.ts +6 -0
- package/dist/types/components/info-card/info-card.d.ts +33 -1
- package/dist/types/components.d.ts +161 -28
- package/dist/types/preact.d.ts +6 -1
- package/dist/types/utils/interfaces.d.ts +4 -4
- package/dist/types/utils/mapViewUtils.d.ts +5 -3
- package/package.json +1 -1
- package/dist/cjs/calcite-block_2.cjs.entry.js +0 -652
- package/dist/cjs/calcite-graph_2.cjs.entry.js +0 -1055
- package/dist/cjs/calcite-scrim.cjs.entry.js +0 -125
- package/dist/cjs/utils-7bc7f595.js +0 -64
- package/dist/esm/calcite-block_2.entry.js +0 -647
- package/dist/esm/calcite-graph_2.entry.js +0 -1050
- package/dist/esm/calcite-scrim.entry.js +0 -121
- package/dist/esm/utils-9fb4104a.js +0 -61
- package/dist/solutions-components/p-04c37d69.entry.js +0 -17
- package/dist/solutions-components/p-0b92e4b1.entry.js +0 -11
- package/dist/solutions-components/p-238d3b5f.entry.js +0 -6
- package/dist/solutions-components/p-3af79063.js +0 -36
- package/dist/solutions-components/p-6db185bf.entry.js +0 -6
- package/dist/solutions-components/p-80b11ec1.entry.js +0 -17
- package/dist/solutions-components/p-aec06ce4.entry.js +0 -18
- package/dist/solutions-components/p-bfdf89c2.js +0 -11
- package/dist/solutions-components/p-c4ff3b52.entry.js +0 -17
- package/dist/solutions-components/p-ced067bd.entry.js +0 -17
- package/dist/solutions-components/p-d136eab0.entry.js +0 -23
- package/dist/solutions-components/p-e0446d5b.entry.js +0 -6
- package/dist/solutions-components/p-e8f13354.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-
|
15
|
+
import { a as getAllLayers, g as getLayerOrTable, b as getFeatureLayerView, h as highlightFeatures, c as getMapLayerHash } from './mapViewUtils-2ec19fb0.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.
|
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-
|
9
|
-
import { d as downloadCSV } from './downloadUtils-
|
8
|
+
import { q as queryFeaturesByID, g as getLayerOrTable, d as goToSelection, e as queryAllIds, f as queryFeatureIds, i as queryFeaturesByGlobalID } from './mapViewUtils-2ec19fb0.js';
|
9
|
+
import { d as downloadCSV } from './downloadUtils-df4f21f6.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
|
@@ -6,7 +6,7 @@
|
|
6
6
|
import { r as registerInstance, 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-
|
9
|
+
import { g as getLayerOrTable } from './mapViewUtils-2ec19fb0.js';
|
10
10
|
import './esri-loader-1b324844.js';
|
11
11
|
import './_commonjsHelpers-0f74c230.js';
|
12
12
|
|
@@ -58,6 +58,10 @@ const CrowdsourceManager = class {
|
|
58
58
|
this.hideMapOnLoad = undefined;
|
59
59
|
this.mapInfos = [];
|
60
60
|
this.onlyShowUpdatableLayers = true;
|
61
|
+
this.popupHeaderColor = undefined;
|
62
|
+
this.popupHeaderHoverColor = undefined;
|
63
|
+
this.popupHeaderHoverTextColor = undefined;
|
64
|
+
this.popupHeaderTextColor = undefined;
|
61
65
|
this.searchConfiguration = undefined;
|
62
66
|
this.shareIncludeEmbed = undefined;
|
63
67
|
this.shareIncludeSocial = undefined;
|