@esri/solutions-components 0.7.31 → 0.7.33
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-flow_5.cjs.entry.js +94 -43
- package/dist/cjs/card-manager_3.cjs.entry.js +1 -1
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +35 -8
- package/dist/cjs/{downloadUtils-10e0de31.js → downloadUtils-6b451886.js} +2 -2
- package/dist/cjs/{index.es-72dc7ab9.js → index.es-3eaba9ef.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/basemap-gallery/basemap-gallery.css +19 -19
- package/dist/collection/components/create-feature/create-feature.css +27 -0
- package/dist/collection/components/create-feature/create-feature.js +126 -43
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +35 -8
- package/dist/collection/components/map-fullscreen/map-fullscreen.css +19 -19
- package/dist/collection/components/map-legend/map-legend.css +3 -3
- package/dist/collection/demos/create-feature.html +90 -0
- package/dist/collection/utils/downloadUtils.js +1 -1
- package/dist/collection/utils/downloadUtils.ts +1 -1
- package/dist/components/create-feature2.js +96 -44
- package/dist/components/crowdsource-reporter.js +35 -8
- package/dist/components/downloadUtils.js +1 -1
- package/dist/esm/calcite-flow_5.entry.js +95 -44
- package/dist/esm/card-manager_3.entry.js +1 -1
- package/dist/esm/crowdsource-reporter.entry.js +35 -8
- package/dist/esm/{downloadUtils-d297078f.js → downloadUtils-4577cf8b.js} +2 -2
- package/dist/esm/{index.es-3b4fa9d0.js → index.es-a28dad8e.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +1 -1
- package/dist/esm/public-notification.entry.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/create-feature.html +90 -0
- package/dist/solutions-components/{p-09ec8c8f.entry.js → p-288dfd06.entry.js} +1 -1
- package/dist/solutions-components/{p-103c5318.js → p-6c85b276.js} +2 -2
- package/dist/solutions-components/{p-57d49d15.entry.js → p-a84acc82.entry.js} +1 -1
- package/dist/solutions-components/{p-8ec25bf4.js → p-b1a5f341.js} +1 -1
- package/dist/solutions-components/p-d5263cb9.entry.js +17 -0
- package/dist/solutions-components/{p-921f21d5.entry.js → p-e22bce70.entry.js} +1 -1
- package/dist/solutions-components/p-ea17cefb.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +1 -1
- package/dist/solutions-components_commit.txt +7 -0
- package/dist/types/components/create-feature/create-feature.d.ts +21 -3
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +18 -4
- package/dist/types/components.d.ts +13 -0
- package/dist/types/preact.d.ts +2 -1
- package/package.json +1 -1
- package/dist/solutions-components/p-b4e2cac4.entry.js +0 -17
- package/dist/solutions-components/p-bb6562ab.entry.js +0 -6
@@ -79,6 +79,7 @@ const CrowdsourceReporter = class {
|
|
79
79
|
* @returns Promise when complete
|
80
80
|
*/
|
81
81
|
async componentWillLoad() {
|
82
|
+
this._urlParamsLoaded = false;
|
82
83
|
await this._initModules();
|
83
84
|
await this._getTranslations();
|
84
85
|
}
|
@@ -115,6 +116,11 @@ const CrowdsourceReporter = class {
|
|
115
116
|
setSelectedLayer(layerId, layerName) {
|
116
117
|
this._selectedLayerId = layerId;
|
117
118
|
this._selectedLayerName = layerName;
|
119
|
+
//show only current layer on map and hide other valid editable layers
|
120
|
+
//if layerId is empty then show all the layers on map
|
121
|
+
this._validLayers.forEach(layer => {
|
122
|
+
layer.set('visible', !layerId || (layer.id === layerId));
|
123
|
+
});
|
118
124
|
}
|
119
125
|
/**
|
120
126
|
* Get the reporter app functionality
|
@@ -171,15 +177,22 @@ const CrowdsourceReporter = class {
|
|
171
177
|
* @protected
|
172
178
|
*/
|
173
179
|
getFeatureCreateFlowItem() {
|
174
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "secondary", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.featureEditFormInfoMsg)), h("create-feature", { mapView: this.mapView, onDrawComplete: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onSuccess: this.
|
180
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "secondary", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.featureEditFormInfoMsg)), h("create-feature", { customizeSubmit: true, mapView: this.mapView, onDrawComplete: this.onDrawComplete.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, selectedLayerId: this._selectedLayerId }))));
|
175
181
|
}
|
176
182
|
/**
|
177
183
|
* When drawing of incident location completed on map show the submit and cancel button
|
178
184
|
* @protected
|
179
185
|
*/
|
180
|
-
|
186
|
+
onDrawComplete() {
|
181
187
|
this._showSubmitCancelButton = true;
|
182
188
|
}
|
189
|
+
/**
|
190
|
+
* When Add attachment panel is enabled hide the submit and cancel button
|
191
|
+
* @protected
|
192
|
+
*/
|
193
|
+
showSubmitCancelButton(evt) {
|
194
|
+
this._showSubmitCancelButton = !evt.detail;
|
195
|
+
}
|
183
196
|
/**
|
184
197
|
* On back from create feature, call submit editor to destroy the Editor widget instance
|
185
198
|
* @protected
|
@@ -212,11 +225,22 @@ const CrowdsourceReporter = class {
|
|
212
225
|
* On submit report navigate to the layer list home page and refresh the layer list
|
213
226
|
* @protected
|
214
227
|
*/
|
215
|
-
|
228
|
+
onReportSubmitted() {
|
216
229
|
this._reportSubmitted = true;
|
230
|
+
this.navigateToHomePage();
|
231
|
+
}
|
232
|
+
/**
|
233
|
+
* Navigates to layer-list
|
234
|
+
* @protected
|
235
|
+
*/
|
236
|
+
navigateToHomePage() {
|
237
|
+
if (this._createFeature) {
|
238
|
+
this._createFeature.close();
|
239
|
+
}
|
217
240
|
if (this._layerList) {
|
218
241
|
this._layerList.refresh();
|
219
242
|
}
|
243
|
+
this.setSelectedFeatures([]);
|
220
244
|
this._flowItems = ["layer-list"];
|
221
245
|
}
|
222
246
|
/**
|
@@ -262,7 +286,10 @@ const CrowdsourceReporter = class {
|
|
262
286
|
//update the has valid layer state
|
263
287
|
this._hasValidLayers = layersListed.length > 0;
|
264
288
|
//navigate to the feature details if URL params found
|
265
|
-
|
289
|
+
if (!this._urlParamsLoaded) {
|
290
|
+
this._urlParamsLoaded = true;
|
291
|
+
await this.loadFeatureFromURLParams();
|
292
|
+
}
|
266
293
|
}
|
267
294
|
/**On click of layer list item show feature list
|
268
295
|
* @param evt Event which has details of selected layerId and layerName
|
@@ -279,10 +306,10 @@ const CrowdsourceReporter = class {
|
|
279
306
|
backFromSelectedPanel() {
|
280
307
|
const updatedFlowItems = [...this._flowItems];
|
281
308
|
updatedFlowItems.pop();
|
282
|
-
//
|
309
|
+
//Back to layer list, and return as the flowItems will be reset in navigateToHomePage
|
283
310
|
if (updatedFlowItems.length === 1) {
|
284
|
-
this.
|
285
|
-
|
311
|
+
this.navigateToHomePage();
|
312
|
+
return;
|
286
313
|
}
|
287
314
|
this._flowItems = [...updatedFlowItems];
|
288
315
|
}
|
@@ -431,7 +458,6 @@ const CrowdsourceReporter = class {
|
|
431
458
|
}
|
432
459
|
/**
|
433
460
|
* Updates the share url for current selected feature
|
434
|
-
* @returns
|
435
461
|
* @protected
|
436
462
|
*/
|
437
463
|
_updateShareURL() {
|
@@ -460,6 +486,7 @@ const CrowdsourceReporter = class {
|
|
460
486
|
}
|
461
487
|
/**
|
462
488
|
* Navigates to selected features detail based on the URL params
|
489
|
+
* @protected
|
463
490
|
*/
|
464
491
|
async loadFeatureFromURLParams() {
|
465
492
|
if (this.layerId && this.objectId) {
|
@@ -1508,7 +1508,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
|
|
1508
1508
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1509
1509
|
* ====================================================================
|
1510
1510
|
*/
|
1511
|
-
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-
|
1511
|
+
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-a28dad8e.js')).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
|
1512
1512
|
/** ====================================================================
|
1513
1513
|
* @license
|
1514
1514
|
* jsPDF XMP metadata plugin
|
@@ -3082,7 +3082,7 @@ async function _prepareLabelsFromPattern(layer, featureSet, attributeOrigNames,
|
|
3082
3082
|
const match = arcadeExpressionMatches[i];
|
3083
3083
|
const expressionName = match.substring(match.indexOf("/") + 1, match.length - 1);
|
3084
3084
|
const value = await arcadeExecutors[expressionName].executeAsync({ "$feature": feature, "$layer": layer });
|
3085
|
-
labelPrep = labelPrep.replace(match, value);
|
3085
|
+
labelPrep = labelPrep.replace(match, value).replace(/\n/gi, "|");
|
3086
3086
|
}
|
3087
3087
|
// Replace non-Arcade fields in this feature
|
3088
3088
|
const attributeValues = (_a = feature.attributes) !== null && _a !== void 0 ? _a : feature;
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { a as commonjsGlobal, c as createCommonjsModule, g as getDefaultExportFromCjs } from './_commonjsHelpers-d5f9d613.js';
|
7
|
-
import { _ as _typeof_1 } from './downloadUtils-
|
7
|
+
import { _ as _typeof_1 } from './downloadUtils-4577cf8b.js';
|
8
8
|
import './index-7183ce4a.js';
|
9
9
|
import './locale-731e75a8.js';
|
10
10
|
import './esri-loader-eda07632.js';
|