@esri/solutions-components 0.8.24 → 0.8.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/calcite-flow_6.cjs.entry.js +29 -15
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +4 -4
- package/dist/cjs/feature-list.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/create-feature/create-feature.js +9 -2
- package/dist/collection/components/create-related-feature/create-related-feature.js +9 -2
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +4 -4
- package/dist/collection/components/feature-details/feature-details.css +4 -4
- package/dist/collection/components/feature-details/feature-details.js +12 -11
- package/dist/collection/components/feature-list/feature-list.css +2 -0
- package/dist/components/create-feature2.js +9 -2
- package/dist/components/create-related-feature2.js +9 -2
- package/dist/components/crowdsource-reporter.js +4 -4
- package/dist/components/feature-details2.js +12 -11
- package/dist/components/feature-list2.js +1 -1
- package/dist/esm/calcite-flow_6.entry.js +29 -15
- package/dist/esm/crowdsource-reporter.entry.js +4 -4
- package/dist/esm/feature-list.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-e78be59a.entry.js → p-5b817c98.entry.js} +1 -1
- package/dist/solutions-components/{p-1251dcc6.entry.js → p-686fa7ce.entry.js} +1 -1
- package/dist/solutions-components/p-c2ec0dcc.entry.js +17 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/create-feature/create-feature.d.ts +4 -0
- package/dist/types/components/create-related-feature/create-related-feature.d.ts +4 -0
- package/dist/types/components/feature-details/feature-details.d.ts +4 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-cbf0dada.entry.js +0 -17
@@ -351,6 +351,10 @@ const CreateFeature = class {
|
|
351
351
|
this.drawComplete = index.createEvent(this, "drawComplete", 7);
|
352
352
|
this.editingAttachment = index.createEvent(this, "editingAttachment", 7);
|
353
353
|
this.progressStatus = index.createEvent(this, "progressStatus", 7);
|
354
|
+
/**
|
355
|
+
* boolean: Flag to maintain form submission using submit button
|
356
|
+
*/
|
357
|
+
this._isSubmitBtnClicked = false;
|
354
358
|
this.mapView = undefined;
|
355
359
|
this.selectedLayerId = undefined;
|
356
360
|
this.customizeSubmit = false;
|
@@ -390,6 +394,7 @@ const CreateFeature = class {
|
|
390
394
|
*/
|
391
395
|
async submit() {
|
392
396
|
if (this._editor) {
|
397
|
+
this._isSubmitBtnClicked = true;
|
393
398
|
this._editor.viewModel.featureFormViewModel.submit();
|
394
399
|
}
|
395
400
|
}
|
@@ -416,7 +421,7 @@ const CreateFeature = class {
|
|
416
421
|
*/
|
417
422
|
render() {
|
418
423
|
const showSearchWidget = this.showSearchWidget ? '' : 'display-none';
|
419
|
-
return (index.h(index.Fragment, { key: '
|
424
|
+
return (index.h(index.Fragment, { key: 'd11a16053bc5eb86a09fd3bc35c9a89cee6dd064' }, index.h("div", { key: '0320bb0ca9fc069306151078c66fbee11060fcab', id: "feature-form" }), index.h("div", { key: '8aaa13e87213a880382ca408d324beb79ba7a500', class: `search-widget ${showSearchWidget}`, id: "search-widget-ref" })));
|
420
425
|
}
|
421
426
|
//--------------------------------------------------------------------------
|
422
427
|
//
|
@@ -662,11 +667,13 @@ const CreateFeature = class {
|
|
662
667
|
var _a;
|
663
668
|
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
664
669
|
if (evt.invalid.length) {
|
670
|
+
this._isSubmitBtnClicked = false;
|
665
671
|
return;
|
666
672
|
}
|
667
673
|
//Submit only when valid attributes
|
668
674
|
//emit success or fail based on the result
|
669
|
-
if (evt.valid.length) {
|
675
|
+
if (evt.valid.length && this._isSubmitBtnClicked) {
|
676
|
+
this._isSubmitBtnClicked = false;
|
670
677
|
try {
|
671
678
|
await this._editor.activeWorkflow.commit();
|
672
679
|
//throw errors if any failures
|
@@ -701,6 +708,10 @@ const CreateRelatedFeature = class {
|
|
701
708
|
this.success = index.createEvent(this, "success", 7);
|
702
709
|
this.fail = index.createEvent(this, "fail", 7);
|
703
710
|
this.isActionPending = index.createEvent(this, "isActionPending", 7);
|
711
|
+
/**
|
712
|
+
* boolean: Flag to maintain form submission using submit button
|
713
|
+
*/
|
714
|
+
this._isSubmitBtnClicked = false;
|
704
715
|
this.mapView = undefined;
|
705
716
|
this.table = undefined;
|
706
717
|
this.selectedFeature = undefined;
|
@@ -737,6 +748,7 @@ const CreateRelatedFeature = class {
|
|
737
748
|
*/
|
738
749
|
async submit() {
|
739
750
|
if (this._editor) {
|
751
|
+
this._isSubmitBtnClicked = true;
|
740
752
|
this._editor.viewModel.featureFormViewModel.submit();
|
741
753
|
}
|
742
754
|
}
|
@@ -774,7 +786,7 @@ const CreateRelatedFeature = class {
|
|
774
786
|
this.reactiveUtils = reactiveUtils;
|
775
787
|
}
|
776
788
|
render() {
|
777
|
-
return (index.h(index.Host, { key: '
|
789
|
+
return (index.h(index.Host, { key: '8c32e05707b6e5501759caaef5d89f8da40640e4' }));
|
778
790
|
}
|
779
791
|
/**
|
780
792
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
@@ -904,11 +916,13 @@ const CreateRelatedFeature = class {
|
|
904
916
|
var _a;
|
905
917
|
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
906
918
|
if (evt.invalid.length) {
|
919
|
+
this._isSubmitBtnClicked = false;
|
907
920
|
return;
|
908
921
|
}
|
909
922
|
//Submit only when valid attributes
|
910
923
|
//emit success or fail based on the result
|
911
|
-
if (evt.valid.length) {
|
924
|
+
if (evt.valid.length && this._isSubmitBtnClicked) {
|
925
|
+
this._isSubmitBtnClicked = false;
|
912
926
|
try {
|
913
927
|
await this._editor.activeWorkflow.commit();
|
914
928
|
//throw errors if any failures
|
@@ -934,7 +948,7 @@ const CreateRelatedFeature = class {
|
|
934
948
|
};
|
935
949
|
CreateRelatedFeature.style = CreateRelatedFeatureStyle0;
|
936
950
|
|
937
|
-
const featureDetailsCss = ":host{display:block}.buttons-container{align-items:center;display:flex;padding:
|
951
|
+
const featureDetailsCss = ":host{display:block}.buttons-container{align-items:center;display:flex;padding:4px;color:var(--calcite-color-text-1) !important;background-color:var(--calcite-color-foreground-1) !important;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:10px;font-size:var(--calcite-font-size--1);align-items:center;padding:7px 0.75rem}";
|
938
952
|
const FeatureDetailsStyle0 = featureDetailsCss;
|
939
953
|
|
940
954
|
const FeatureDetails = class {
|
@@ -959,6 +973,7 @@ const FeatureDetails = class {
|
|
959
973
|
this._isLikeBtnClicked = false;
|
960
974
|
this._isDislikeBtnClicked = false;
|
961
975
|
this._relatedFeaturesOIDs = undefined;
|
976
|
+
this._updating = false;
|
962
977
|
}
|
963
978
|
//--------------------------------------------------------------------------
|
964
979
|
//
|
@@ -1030,12 +1045,12 @@ const FeatureDetails = class {
|
|
1030
1045
|
var _a, _b, _c, _d, _e;
|
1031
1046
|
//When related features found show comments list of only those features else comments list will be empty
|
1032
1047
|
const commentsListWhereClause = ((_a = this._relatedFeaturesOIDs) === null || _a === void 0 ? void 0 : _a.length) > 0 ? `objectId in(${this._relatedFeaturesOIDs})` : '1=0';
|
1033
|
-
return (index.h("calcite-panel", { key: '
|
1034
|
-
index.h("div", { key: '
|
1035
|
-
index.h("div", { key: '
|
1036
|
-
index.h("calcite-button", { key: '
|
1037
|
-
index.h("calcite-button", { key: '
|
1038
|
-
index.h("feature-list", { key: '
|
1048
|
+
return (index.h("calcite-panel", { key: '8d7069fec0df2a6217c175df6171376b4412c548', "full-height": true }, index.h("info-card", { key: '3713b783371bcb36a9b844196033326941d833f5', allowEditing: false, graphics: this.graphics, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: (e) => { this.featureSelectionChange.emit(e.detail); }, paginationEnabled: false, position: "relative", ref: el => this._infoCard = el }), (this._likeFieldAvailable || this._dislikeFieldAvailable || this._commentsAvailable) &&
|
1049
|
+
index.h("div", { key: '8c84e82708fab0d6091050672b26e6fa2de59345', class: "buttons-container" }, this._commentsAvailable &&
|
1050
|
+
index.h("div", { key: '22edb3f17ef6a2bdef67e5e94492966986d452b7', class: "comment-btn" }, index.h("span", { key: '03b7eb0aff4358aac3020b3d6d52a2d47b308a41' }, this._relatedFeaturesOIDs.length), index.h("calcite-icon", { key: '5225e156b45a15db0055a28ed21bc3511dedc706', icon: "speech-bubble", scale: 's' })), this._likeFieldAvailable &&
|
1051
|
+
index.h("calcite-button", { key: '1a291524d46c6f826813c87f781e7d6bcf5bc097', appearance: "transparent", iconEnd: "thumbs-up", kind: this._isLikeBtnClicked ? "brand" : "neutral", loading: this._updating, onClick: this.onLikeButtonClick.bind(this), scale: 'm' }, (_c = (_b = this._likeCount) !== null && _b !== void 0 ? _b : this._selectedGraphic.attributes[this._likeField]) !== null && _c !== void 0 ? _c : 0), this._dislikeFieldAvailable &&
|
1052
|
+
index.h("calcite-button", { key: 'da6bee2189565c1eb70564b340e742494bac35c9', appearance: "transparent", iconEnd: "thumbs-down", kind: this._isDislikeBtnClicked ? "brand" : "neutral", loading: this._updating, onClick: this.onDislikeButtonClick.bind(this), scale: 'm' }, (_e = (_d = this._disLikeCount) !== null && _d !== void 0 ? _d : this._selectedGraphic.attributes[this._dislikeField]) !== null && _e !== void 0 ? _e : 0)), this.relatedTableId && this._commentsAvailable &&
|
1053
|
+
index.h("feature-list", { key: 'fd6faa9f3404a2dfadb102ca7c578ffb47207729', class: "height-full", mapView: this.mapView, onFeatureSelect: (e) => { this.commentSelect.emit(e.detail); }, pageSize: 5, ref: el => this._commentsList = el, selectedLayerId: this.relatedTableId, showErrorWhenNoFeatures: false, showInitialLoading: false, textSize: "small", whereClause: commentsListWhereClause })));
|
1039
1054
|
}
|
1040
1055
|
/**
|
1041
1056
|
* Load esri javascript api modules
|
@@ -1192,7 +1207,6 @@ const FeatureDetails = class {
|
|
1192
1207
|
* @protected
|
1193
1208
|
*/
|
1194
1209
|
onLikeButtonClick() {
|
1195
|
-
this.loadingStatus.emit(true);
|
1196
1210
|
if (this._isDislikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
|
1197
1211
|
this.onDislikeButtonClick();
|
1198
1212
|
}
|
@@ -1210,7 +1224,6 @@ const FeatureDetails = class {
|
|
1210
1224
|
* @protected
|
1211
1225
|
*/
|
1212
1226
|
onDislikeButtonClick() {
|
1213
|
-
this.loadingStatus.emit(true);
|
1214
1227
|
if (this._isLikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].like) {
|
1215
1228
|
this.onLikeButtonClick();
|
1216
1229
|
}
|
@@ -1232,6 +1245,7 @@ const FeatureDetails = class {
|
|
1232
1245
|
async updateFeaturesLikeDislikeField(fieldName, buttonClicked) {
|
1233
1246
|
const attributesToUpdate = {};
|
1234
1247
|
const selectedLayer = this._selectedGraphic.layer;
|
1248
|
+
this._updating = true;
|
1235
1249
|
//Increment the value if button is clicked or else decrement it
|
1236
1250
|
const selectFeatureAttr = this._selectedGraphic;
|
1237
1251
|
if (buttonClicked) {
|
@@ -1255,9 +1269,9 @@ const FeatureDetails = class {
|
|
1255
1269
|
}
|
1256
1270
|
//store the like dislike value for the current selected graphic in local storage
|
1257
1271
|
this.setInLocalStorage();
|
1258
|
-
this.
|
1272
|
+
this._updating = false;
|
1259
1273
|
}, (err) => {
|
1260
|
-
this.
|
1274
|
+
this._updating = false;
|
1261
1275
|
console.log(err);
|
1262
1276
|
});
|
1263
1277
|
}
|
@@ -113,7 +113,7 @@ const CrowdsourceReporter = class {
|
|
113
113
|
*/
|
114
114
|
render() {
|
115
115
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
116
|
-
return (index.h(index.Host, { key: '
|
116
|
+
return (index.h(index.Host, { key: '497227745f29c2afc434349e86da19b088b1eb78' }, this._reportSubmitted && index.h("calcite-alert", { key: 'd22cceb7124073ad390cd53d97214a2983e97ea0', "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, index.h("div", { key: '1f98f71fa79cf64e65fecfbceec3862714702609', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && index.h("calcite-alert", { key: '381d3b5a3f5115782634833ad53b4494e888ea97', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, index.h("div", { key: '34371959d1272e4bc465e5f5a432d450a156c20b', slot: "title" }, this._translations.error), index.h("div", { key: '09a55e3325edde43f660a2db1621a4ffd373e09f', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && index.h("calcite-alert", { key: '33d79a67575c9a2b14e602e60b702ca82025e20f', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, index.h("div", { key: '91b9dcc26cf1f66a116a287a94e8df5c3d2f37bf', slot: "message" }, this._translations.commentSubmittedMsg)), this._addingCommentFailed && index.h("calcite-alert", { key: '758f1d465d4301fade8fd93a682bfe4b359be2ca', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, index.h("div", { key: '982424caf90e309701c62c75065d7e7e15d327b4', slot: "title" }, this._translations.error), index.h("div", { key: '1c93f9f8e1b958ccf8553560c36a32273f16a3a6', slot: "message" }, this._translations.addingCommentFailedMsg)), index.h("div", { key: '612254cf38da92cf88b90ace8136a2e0859afcae' }, index.h("calcite-shell", { key: 'bb56100b4dfc355b93d580deee929aad7cfb3f7f', "content-behind": true }, this._getReporter())), this.filterModal()));
|
117
117
|
}
|
118
118
|
//--------------------------------------------------------------------------
|
119
119
|
//
|
@@ -783,8 +783,9 @@ const CrowdsourceReporter = class {
|
|
783
783
|
*/
|
784
784
|
reduceToConfiguredLayers(hash) {
|
785
785
|
return Object.keys(hash).reduce((prev, cur) => {
|
786
|
+
var _a;
|
786
787
|
// check if reporting options exists consider the visible prop if else just check the supports Add
|
787
|
-
const showLayer = this.reportingOptions ? this._getLayersConfig(cur).visible
|
788
|
+
const showLayer = this.reportingOptions ? (_a = this._getLayersConfig(cur)) === null || _a === void 0 ? void 0 : _a.visible
|
788
789
|
: hash[cur].supportsAdd;
|
789
790
|
if (showLayer) {
|
790
791
|
prev.push(cur);
|
@@ -866,7 +867,7 @@ const CrowdsourceReporter = class {
|
|
866
867
|
const featureSet = await mapViewUtils.queryFeaturesByID([Number(this.objectId)], layer, [], true, this.mapView.spatialReference);
|
867
868
|
if (featureSet.length) {
|
868
869
|
//update the selectedFeature
|
869
|
-
this.
|
870
|
+
await this.setSelectedFeatures(featureSet);
|
870
871
|
//if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
|
871
872
|
// eslint-disable-next-line unicorn/prefer-ternary
|
872
873
|
if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
|
@@ -875,7 +876,6 @@ const CrowdsourceReporter = class {
|
|
875
876
|
else {
|
876
877
|
this._flowItems = [...this._flowItems];
|
877
878
|
}
|
878
|
-
await this.highlightOnMap(featureSet[0]);
|
879
879
|
}
|
880
880
|
}
|
881
881
|
}
|
@@ -18,7 +18,7 @@ require('./index-f64944ad.js');
|
|
18
18
|
require('./restHelpersGet-dbaa28df.js');
|
19
19
|
require('./interfaces-7cd0a48a.js');
|
20
20
|
|
21
|
-
const featureListCss = ":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px}.feature-list-popup-title-small{font-size:small;padding:10px 12px}";
|
21
|
+
const featureListCss = ":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px;white-space:pre-line}.feature-list-popup-title-small{font-size:small;padding:10px 12px;white-space:pre-line}";
|
22
22
|
const FeatureListStyle0 = featureListCss;
|
23
23
|
|
24
24
|
const FeatureList = class {
|