@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
@@ -347,6 +347,10 @@ const CreateFeature = class {
|
|
347
347
|
this.drawComplete = createEvent(this, "drawComplete", 7);
|
348
348
|
this.editingAttachment = createEvent(this, "editingAttachment", 7);
|
349
349
|
this.progressStatus = createEvent(this, "progressStatus", 7);
|
350
|
+
/**
|
351
|
+
* boolean: Flag to maintain form submission using submit button
|
352
|
+
*/
|
353
|
+
this._isSubmitBtnClicked = false;
|
350
354
|
this.mapView = undefined;
|
351
355
|
this.selectedLayerId = undefined;
|
352
356
|
this.customizeSubmit = false;
|
@@ -386,6 +390,7 @@ const CreateFeature = class {
|
|
386
390
|
*/
|
387
391
|
async submit() {
|
388
392
|
if (this._editor) {
|
393
|
+
this._isSubmitBtnClicked = true;
|
389
394
|
this._editor.viewModel.featureFormViewModel.submit();
|
390
395
|
}
|
391
396
|
}
|
@@ -412,7 +417,7 @@ const CreateFeature = class {
|
|
412
417
|
*/
|
413
418
|
render() {
|
414
419
|
const showSearchWidget = this.showSearchWidget ? '' : 'display-none';
|
415
|
-
return (h(Fragment, { key: '
|
420
|
+
return (h(Fragment, { key: 'd11a16053bc5eb86a09fd3bc35c9a89cee6dd064' }, h("div", { key: '0320bb0ca9fc069306151078c66fbee11060fcab', id: "feature-form" }), h("div", { key: '8aaa13e87213a880382ca408d324beb79ba7a500', class: `search-widget ${showSearchWidget}`, id: "search-widget-ref" })));
|
416
421
|
}
|
417
422
|
//--------------------------------------------------------------------------
|
418
423
|
//
|
@@ -658,11 +663,13 @@ const CreateFeature = class {
|
|
658
663
|
var _a;
|
659
664
|
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
660
665
|
if (evt.invalid.length) {
|
666
|
+
this._isSubmitBtnClicked = false;
|
661
667
|
return;
|
662
668
|
}
|
663
669
|
//Submit only when valid attributes
|
664
670
|
//emit success or fail based on the result
|
665
|
-
if (evt.valid.length) {
|
671
|
+
if (evt.valid.length && this._isSubmitBtnClicked) {
|
672
|
+
this._isSubmitBtnClicked = false;
|
666
673
|
try {
|
667
674
|
await this._editor.activeWorkflow.commit();
|
668
675
|
//throw errors if any failures
|
@@ -697,6 +704,10 @@ const CreateRelatedFeature = class {
|
|
697
704
|
this.success = createEvent(this, "success", 7);
|
698
705
|
this.fail = createEvent(this, "fail", 7);
|
699
706
|
this.isActionPending = createEvent(this, "isActionPending", 7);
|
707
|
+
/**
|
708
|
+
* boolean: Flag to maintain form submission using submit button
|
709
|
+
*/
|
710
|
+
this._isSubmitBtnClicked = false;
|
700
711
|
this.mapView = undefined;
|
701
712
|
this.table = undefined;
|
702
713
|
this.selectedFeature = undefined;
|
@@ -733,6 +744,7 @@ const CreateRelatedFeature = class {
|
|
733
744
|
*/
|
734
745
|
async submit() {
|
735
746
|
if (this._editor) {
|
747
|
+
this._isSubmitBtnClicked = true;
|
736
748
|
this._editor.viewModel.featureFormViewModel.submit();
|
737
749
|
}
|
738
750
|
}
|
@@ -770,7 +782,7 @@ const CreateRelatedFeature = class {
|
|
770
782
|
this.reactiveUtils = reactiveUtils;
|
771
783
|
}
|
772
784
|
render() {
|
773
|
-
return (h(Host, { key: '
|
785
|
+
return (h(Host, { key: '8c32e05707b6e5501759caaef5d89f8da40640e4' }));
|
774
786
|
}
|
775
787
|
/**
|
776
788
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
@@ -900,11 +912,13 @@ const CreateRelatedFeature = class {
|
|
900
912
|
var _a;
|
901
913
|
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
902
914
|
if (evt.invalid.length) {
|
915
|
+
this._isSubmitBtnClicked = false;
|
903
916
|
return;
|
904
917
|
}
|
905
918
|
//Submit only when valid attributes
|
906
919
|
//emit success or fail based on the result
|
907
|
-
if (evt.valid.length) {
|
920
|
+
if (evt.valid.length && this._isSubmitBtnClicked) {
|
921
|
+
this._isSubmitBtnClicked = false;
|
908
922
|
try {
|
909
923
|
await this._editor.activeWorkflow.commit();
|
910
924
|
//throw errors if any failures
|
@@ -930,7 +944,7 @@ const CreateRelatedFeature = class {
|
|
930
944
|
};
|
931
945
|
CreateRelatedFeature.style = CreateRelatedFeatureStyle0;
|
932
946
|
|
933
|
-
const featureDetailsCss = ":host{display:block}.buttons-container{align-items:center;display:flex;padding:
|
947
|
+
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}";
|
934
948
|
const FeatureDetailsStyle0 = featureDetailsCss;
|
935
949
|
|
936
950
|
const FeatureDetails = class {
|
@@ -955,6 +969,7 @@ const FeatureDetails = class {
|
|
955
969
|
this._isLikeBtnClicked = false;
|
956
970
|
this._isDislikeBtnClicked = false;
|
957
971
|
this._relatedFeaturesOIDs = undefined;
|
972
|
+
this._updating = false;
|
958
973
|
}
|
959
974
|
//--------------------------------------------------------------------------
|
960
975
|
//
|
@@ -1026,12 +1041,12 @@ const FeatureDetails = class {
|
|
1026
1041
|
var _a, _b, _c, _d, _e;
|
1027
1042
|
//When related features found show comments list of only those features else comments list will be empty
|
1028
1043
|
const commentsListWhereClause = ((_a = this._relatedFeaturesOIDs) === null || _a === void 0 ? void 0 : _a.length) > 0 ? `objectId in(${this._relatedFeaturesOIDs})` : '1=0';
|
1029
|
-
return (h("calcite-panel", { key: '
|
1030
|
-
h("div", { key: '
|
1031
|
-
h("div", { key: '
|
1032
|
-
h("calcite-button", { key: '
|
1033
|
-
h("calcite-button", { key: '
|
1034
|
-
h("feature-list", { key: '
|
1044
|
+
return (h("calcite-panel", { key: '8d7069fec0df2a6217c175df6171376b4412c548', "full-height": true }, 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) &&
|
1045
|
+
h("div", { key: '8c84e82708fab0d6091050672b26e6fa2de59345', class: "buttons-container" }, this._commentsAvailable &&
|
1046
|
+
h("div", { key: '22edb3f17ef6a2bdef67e5e94492966986d452b7', class: "comment-btn" }, h("span", { key: '03b7eb0aff4358aac3020b3d6d52a2d47b308a41' }, this._relatedFeaturesOIDs.length), h("calcite-icon", { key: '5225e156b45a15db0055a28ed21bc3511dedc706', icon: "speech-bubble", scale: 's' })), this._likeFieldAvailable &&
|
1047
|
+
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 &&
|
1048
|
+
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 &&
|
1049
|
+
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 })));
|
1035
1050
|
}
|
1036
1051
|
/**
|
1037
1052
|
* Load esri javascript api modules
|
@@ -1188,7 +1203,6 @@ const FeatureDetails = class {
|
|
1188
1203
|
* @protected
|
1189
1204
|
*/
|
1190
1205
|
onLikeButtonClick() {
|
1191
|
-
this.loadingStatus.emit(true);
|
1192
1206
|
if (this._isDislikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
|
1193
1207
|
this.onDislikeButtonClick();
|
1194
1208
|
}
|
@@ -1206,7 +1220,6 @@ const FeatureDetails = class {
|
|
1206
1220
|
* @protected
|
1207
1221
|
*/
|
1208
1222
|
onDislikeButtonClick() {
|
1209
|
-
this.loadingStatus.emit(true);
|
1210
1223
|
if (this._isLikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].like) {
|
1211
1224
|
this.onLikeButtonClick();
|
1212
1225
|
}
|
@@ -1228,6 +1241,7 @@ const FeatureDetails = class {
|
|
1228
1241
|
async updateFeaturesLikeDislikeField(fieldName, buttonClicked) {
|
1229
1242
|
const attributesToUpdate = {};
|
1230
1243
|
const selectedLayer = this._selectedGraphic.layer;
|
1244
|
+
this._updating = true;
|
1231
1245
|
//Increment the value if button is clicked or else decrement it
|
1232
1246
|
const selectFeatureAttr = this._selectedGraphic;
|
1233
1247
|
if (buttonClicked) {
|
@@ -1251,9 +1265,9 @@ const FeatureDetails = class {
|
|
1251
1265
|
}
|
1252
1266
|
//store the like dislike value for the current selected graphic in local storage
|
1253
1267
|
this.setInLocalStorage();
|
1254
|
-
this.
|
1268
|
+
this._updating = false;
|
1255
1269
|
}, (err) => {
|
1256
|
-
this.
|
1270
|
+
this._updating = false;
|
1257
1271
|
console.log(err);
|
1258
1272
|
});
|
1259
1273
|
}
|
@@ -109,7 +109,7 @@ const CrowdsourceReporter = class {
|
|
109
109
|
*/
|
110
110
|
render() {
|
111
111
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
112
|
-
return (h(Host, { key: '
|
112
|
+
return (h(Host, { key: '497227745f29c2afc434349e86da19b088b1eb78' }, this._reportSubmitted && 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" }, h("div", { key: '1f98f71fa79cf64e65fecfbceec3862714702609', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: '381d3b5a3f5115782634833ad53b4494e888ea97', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: '34371959d1272e4bc465e5f5a432d450a156c20b', slot: "title" }, this._translations.error), h("div", { key: '09a55e3325edde43f660a2db1621a4ffd373e09f', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && 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" }, h("div", { key: '91b9dcc26cf1f66a116a287a94e8df5c3d2f37bf', slot: "message" }, this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: '758f1d465d4301fade8fd93a682bfe4b359be2ca', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: '982424caf90e309701c62c75065d7e7e15d327b4', slot: "title" }, this._translations.error), h("div", { key: '1c93f9f8e1b958ccf8553560c36a32273f16a3a6', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: '612254cf38da92cf88b90ace8136a2e0859afcae' }, h("calcite-shell", { key: 'bb56100b4dfc355b93d580deee929aad7cfb3f7f', "content-behind": true }, this._getReporter())), this.filterModal()));
|
113
113
|
}
|
114
114
|
//--------------------------------------------------------------------------
|
115
115
|
//
|
@@ -779,8 +779,9 @@ const CrowdsourceReporter = class {
|
|
779
779
|
*/
|
780
780
|
reduceToConfiguredLayers(hash) {
|
781
781
|
return Object.keys(hash).reduce((prev, cur) => {
|
782
|
+
var _a;
|
782
783
|
// check if reporting options exists consider the visible prop if else just check the supports Add
|
783
|
-
const showLayer = this.reportingOptions ? this._getLayersConfig(cur).visible
|
784
|
+
const showLayer = this.reportingOptions ? (_a = this._getLayersConfig(cur)) === null || _a === void 0 ? void 0 : _a.visible
|
784
785
|
: hash[cur].supportsAdd;
|
785
786
|
if (showLayer) {
|
786
787
|
prev.push(cur);
|
@@ -862,7 +863,7 @@ const CrowdsourceReporter = class {
|
|
862
863
|
const featureSet = await queryFeaturesByID([Number(this.objectId)], layer, [], true, this.mapView.spatialReference);
|
863
864
|
if (featureSet.length) {
|
864
865
|
//update the selectedFeature
|
865
|
-
this.
|
866
|
+
await this.setSelectedFeatures(featureSet);
|
866
867
|
//if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
|
867
868
|
// eslint-disable-next-line unicorn/prefer-ternary
|
868
869
|
if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
|
@@ -871,7 +872,6 @@ const CrowdsourceReporter = class {
|
|
871
872
|
else {
|
872
873
|
this._flowItems = [...this._flowItems];
|
873
874
|
}
|
874
|
-
await this.highlightOnMap(featureSet[0]);
|
875
875
|
}
|
876
876
|
}
|
877
877
|
}
|
@@ -14,7 +14,7 @@ import './index-a1e91462.js';
|
|
14
14
|
import './restHelpersGet-1bd54274.js';
|
15
15
|
import './interfaces-586e863c.js';
|
16
16
|
|
17
|
-
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}";
|
17
|
+
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}";
|
18
18
|
const FeatureListStyle0 = featureListCss;
|
19
19
|
|
20
20
|
const FeatureList = class {
|