@esri/solutions-components 0.10.35 → 0.10.36
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/basemap-gallery_7.cjs.entry.js +1 -0
- package/dist/cjs/calcite-alert_5.cjs.entry.js +3 -3
- package/dist/cjs/card-manager_3.cjs.entry.js +2 -2
- package/dist/cjs/crowdsource-manager.cjs.entry.js +25 -29
- package/dist/cjs/{downloadUtils-20637f89.js → downloadUtils-76bc7e30.js} +6 -5
- package/dist/cjs/feature-list.cjs.entry.js +3 -3
- package/dist/cjs/{index.es-a242cb45.js → index.es-8336efed.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/{popupUtils-d477705b.js → popupUtils-bc762034.js} +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +27 -29
- package/dist/collection/components/map-legend/map-legend.js +1 -0
- package/dist/collection/utils/downloadUtils.js +5 -3
- package/dist/collection/utils/downloadUtils.ts +6 -3
- package/dist/collection/utils/test/downloadUtils.spec.tsx +10 -12
- package/dist/components/crowdsource-manager.js +26 -29
- package/dist/components/downloadUtils.js +5 -4
- package/dist/components/map-legend2.js +1 -0
- package/dist/esm/basemap-gallery_7.entry.js +1 -0
- package/dist/esm/calcite-alert_5.entry.js +3 -3
- package/dist/esm/card-manager_3.entry.js +2 -2
- package/dist/esm/crowdsource-manager.entry.js +25 -29
- package/dist/esm/{downloadUtils-e266e98d.js → downloadUtils-bc7a4ba1.js} +6 -5
- package/dist/esm/feature-list.entry.js +3 -3
- package/dist/esm/{index.es-c5f258e2.js → index.es-0d189a34.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +2 -2
- package/dist/esm/{popupUtils-4570096e.js → popupUtils-03dc398a.js} +1 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-cb3199f9.entry.js → p-04ab956c.entry.js} +1 -1
- package/dist/solutions-components/{p-a568af9f.js → p-6f606cdb.js} +1 -1
- package/dist/solutions-components/p-720de4db.entry.js +6 -0
- package/dist/solutions-components/p-97fe6ec5.entry.js +6 -0
- package/dist/solutions-components/{p-b4c49411.entry.js → p-9c4fef09.entry.js} +1 -1
- package/dist/solutions-components/{p-89046451.entry.js → p-aac0c89c.entry.js} +1 -1
- package/dist/solutions-components/p-cd482a33.js +21 -0
- package/dist/solutions-components/{p-b86b2664.entry.js → p-d2612c30.entry.js} +1 -1
- package/dist/solutions-components/{p-588adf13.entry.js → p-e345f9c4.entry.js} +1 -1
- package/dist/solutions-components/{p-46c8015c.js → p-ff9e28d1.js} +30 -30
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +6 -3
- package/dist/solutions-components/utils/test/downloadUtils.spec.tsx +10 -12
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +4 -7
- package/package.json +2 -1
- package/dist/solutions-components/p-2360802a.js +0 -21
- package/dist/solutions-components/p-5eb9a413.entry.js +0 -6
- package/dist/solutions-components/p-ecf642c2.entry.js +0 -6
@@ -142,6 +142,22 @@ export class CrowdsourceManager {
|
|
142
142
|
// Watch handlers
|
143
143
|
//
|
144
144
|
//--------------------------------------------------------------------------
|
145
|
+
/**
|
146
|
+
* Adjust layout based on current appLayout value
|
147
|
+
*/
|
148
|
+
appLayoutWatchHandler(newAppLayout, oldAppLayout) {
|
149
|
+
if (newAppLayout !== oldAppLayout) {
|
150
|
+
this._setActiveLayout(newAppLayout);
|
151
|
+
// update the layer if table selected while switching to map view
|
152
|
+
if (this.appLayout === "mapView" && this._layer.isTable) {
|
153
|
+
void this._mapCard.updateLayer();
|
154
|
+
}
|
155
|
+
if (this._isMapViewOnLoad) {
|
156
|
+
void this._layerTable.refresh();
|
157
|
+
this._isMapViewOnLoad = false;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
145
161
|
/**
|
146
162
|
* When true the map zoom tools will be available
|
147
163
|
*/
|
@@ -210,7 +226,7 @@ export class CrowdsourceManager {
|
|
210
226
|
layer && await layer.when(() => {
|
211
227
|
// on render if no layer is present and only one table is present in map and app is in map view layer then change it to split layout
|
212
228
|
if (this._layerIds.length === 0 && this.appLayout === 'mapView' && layer.isTable) {
|
213
|
-
this.
|
229
|
+
this.appLayout = "splitView";
|
214
230
|
}
|
215
231
|
this._layer = layer;
|
216
232
|
this._initLayerExpressions();
|
@@ -243,7 +259,7 @@ export class CrowdsourceManager {
|
|
243
259
|
render() {
|
244
260
|
// only avoid border when we have a header color that is not white
|
245
261
|
const borderClass = this.popupHeaderColor && this.popupHeaderColor !== "#FFFFFF" ? "border-width-0" : "";
|
246
|
-
return (h(Host, { key: '
|
262
|
+
return (h(Host, { key: 'ace73bfa1aa7d460f1cba60d13e94c4f47f77bd0' }, h("calcite-shell", { key: 'f14e70be762bf236be566111b45e40a42f0997f7', class: "position-relative" }, h("calcite-panel", { key: '0dde9426295a780b6a12cd98513f655914c0dab5', class: `width-full height-full ${borderClass}`, loading: this._isLoading }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter()), this._filterModal()));
|
247
263
|
}
|
248
264
|
/**
|
249
265
|
* Called after each render
|
@@ -476,10 +492,9 @@ export class CrowdsourceManager {
|
|
476
492
|
const cardManagerHeight = isTableLayout && this.mapInfos?.length > 1 ? "adjusted-height-100-51" : isMapLayout || isTableLayout ? "height-full" : (this._numSelected > 0 && !this._isMobile) ? "height-50" : !this._showInformationHeader ? "adjusted-height-50_25" : !this._isPortraitMobile ? "height-50" : "height-full";
|
477
493
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
478
494
|
return (h("div", { class: `width-50 height-full ${themeClass}` }, h("card-manager", { class: `${cardManagerHeight} width-full`, customInfoText: this.customInfoText, enableCreateFeatures: this._enableCreateFeatures && !this._isMobile, enableEditGeometry: this?._mapInfo?.enableEditGeometry, isMobile: this._isPortraitMobile, layer: this._layer, mapView: this?._mapView, onBackFromCreateWorkFlow: () => {
|
479
|
-
this._changeLayout(this.appLayout);
|
480
495
|
this._showInformationHeader = true;
|
481
496
|
}, onCreateWorkFlowStarted: () => {
|
482
|
-
this.
|
497
|
+
this.appLayout = this._layer.isTable ? "tableView" : "mapView";
|
483
498
|
this._showInformationHeader = false;
|
484
499
|
}, onFeatureOrRecordSubmitted: () => void this._layerTable.refresh(), selectedFeaturesIds: this._layerTable?.selectedIds, selectingFeatureFromMap: this.appLayout === "mapView", zoomAndScrollToSelected: this.zoomAndScrollToSelected })));
|
485
500
|
}
|
@@ -517,7 +532,7 @@ export class CrowdsourceManager {
|
|
517
532
|
const icon = this._getDividerIcon(layoutMode, panelOpen);
|
518
533
|
const tooltip = panelOpen ? this._translations.close : this._translations.open;
|
519
534
|
const id = "toggle-layout";
|
520
|
-
return (h(Fragment, null, h("calcite-action", { active: this.appLayout === 'splitView', class: "toggle-node", icon: "browser", id: "browser-action", onClick: () => { this.
|
535
|
+
return (h(Fragment, null, h("calcite-action", { active: this.appLayout === 'splitView', class: "toggle-node", icon: "browser", id: "browser-action", onClick: () => { this.appLayout = "splitView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "browser-action" }, h("span", null, this._translations.splitView)), h("calcite-action", { active: this.appLayout === 'tableView', class: "toggle-node", icon: "dock-left", id: "dock-left-action", onClick: () => { this.appLayout = "tableView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "dock-left-action" }, h("span", null, this._translations.tableView)), h("calcite-action", { active: this.appLayout === 'mapView', class: "toggle-node", disabled: this._layerIds?.length === 0, icon: "browser-map", id: "browser-map-action", onClick: () => { this.appLayout = "mapView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "browser-map-action" }, h("span", null, this._translations.mapView)), h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), slot: "actions-end", text: "" }), h("calcite-tooltip", { placement: "bottom", "reference-element": id }, h("span", null, tooltip))));
|
521
536
|
}
|
522
537
|
/**
|
523
538
|
* Show filter component in modal
|
@@ -590,7 +605,7 @@ export class CrowdsourceManager {
|
|
590
605
|
if (this._isMobile) {
|
591
606
|
this.showHideMapPopupAndTable(!this._isMobile);
|
592
607
|
this._isPortraitMobile = !!window.matchMedia("(orientation: portrait)").matches;
|
593
|
-
this.
|
608
|
+
this.appLayout = "splitView";
|
594
609
|
}
|
595
610
|
else {
|
596
611
|
this._isPortraitMobile = false;
|
@@ -606,34 +621,14 @@ export class CrowdsourceManager {
|
|
606
621
|
_toggleLayout() {
|
607
622
|
this._panelOpen = !this._panelOpen;
|
608
623
|
}
|
609
|
-
/**
|
610
|
-
* Changes the layout mode
|
611
|
-
* @param appLayout selected active app layout
|
612
|
-
*
|
613
|
-
* @protected
|
614
|
-
*/
|
615
|
-
_changeLayout(appLayout) {
|
616
|
-
if (this.appLayout !== appLayout) {
|
617
|
-
this._setActiveLayout(appLayout);
|
618
|
-
this.appLayout = appLayout;
|
619
|
-
// update the layer if table selected while switching to map view
|
620
|
-
if (this.appLayout === "mapView" && this._layer.isTable) {
|
621
|
-
void this._mapCard.updateLayer();
|
622
|
-
}
|
623
|
-
if (this._isMapViewOnLoad) {
|
624
|
-
void this._layerTable.refresh();
|
625
|
-
this._isMapViewOnLoad = false;
|
626
|
-
}
|
627
|
-
}
|
628
|
-
}
|
629
624
|
/**
|
630
625
|
* shows the map in card view
|
631
626
|
*
|
632
627
|
* @protected
|
633
628
|
*/
|
634
629
|
_showMapInCardView() {
|
635
|
-
if (this.appLayout
|
636
|
-
const fullMapView = document.getElementById('full-map-view')
|
630
|
+
if (this.appLayout !== "mapView") {
|
631
|
+
const fullMapView = document.getElementById('full-map-view')?.childNodes[0];
|
637
632
|
const splitMapClass = document.getElementById('card-mapView');
|
638
633
|
if (fullMapView) {
|
639
634
|
splitMapClass.appendChild(fullMapView);
|
@@ -646,7 +641,7 @@ export class CrowdsourceManager {
|
|
646
641
|
* @protected
|
647
642
|
*/
|
648
643
|
_showMapInFullView() {
|
649
|
-
const splitMap = document.getElementById('card-mapView')
|
644
|
+
const splitMap = document.getElementById('card-mapView')?.childNodes[0];
|
650
645
|
const fullMapViewClass = document.getElementById('full-map-view');
|
651
646
|
if (splitMap) {
|
652
647
|
fullMapViewClass.appendChild(splitMap);
|
@@ -1501,6 +1496,9 @@ export class CrowdsourceManager {
|
|
1501
1496
|
static get elementRef() { return "el"; }
|
1502
1497
|
static get watchers() {
|
1503
1498
|
return [{
|
1499
|
+
"propName": "appLayout",
|
1500
|
+
"methodName": "appLayoutWatchHandler"
|
1501
|
+
}, {
|
1504
1502
|
"propName": "enableZoom",
|
1505
1503
|
"methodName": "enableZoomWatchHandler"
|
1506
1504
|
}, {
|
@@ -23,6 +23,7 @@ import { exportCSV } from "./csvUtils";
|
|
23
23
|
import { exportPDF } from "./pdfUtils";
|
24
24
|
import { loadModules } from "./loadModules";
|
25
25
|
import { queryFeaturesByID } from "./queryUtils";
|
26
|
+
import { Sanitizer } from "@esri/arcgis-html-sanitizer";
|
26
27
|
import * as common from "@esri/solution-common";
|
27
28
|
const lineSeparatorChar = "|";
|
28
29
|
import { queryRelated } from "@esri/arcgis-rest-feature-layer";
|
@@ -145,12 +146,13 @@ export function _cleanupLabel(labelText) {
|
|
145
146
|
labelText = labelText.replace(/<\/p>/gi, "");
|
146
147
|
// Replace \n with the line separator character
|
147
148
|
labelText = labelText.replace(/\n/gi, "|");
|
148
|
-
// Remove
|
149
|
+
// Remove tricky stuff
|
150
|
+
const sanitizer = new Sanitizer();
|
151
|
+
labelText = sanitizer.sanitize(labelText);
|
152
|
+
// Remove remaining HTML tags, replace 0xA0 that popup uses for spaces, and replace
|
149
153
|
labelText = labelText
|
150
154
|
.replace(/<[\s.]*[^<>]*\/?>/gi, "")
|
151
155
|
.replace(/\xA0/gi, " ")
|
152
|
-
.replace(/</gi, "<")
|
153
|
-
.replace(/>/gi, ">")
|
154
156
|
.replace(/ /gi, " ");
|
155
157
|
// Trim each line
|
156
158
|
labelText = labelText.replace(/\s*\|\s*/g, "|");
|
@@ -21,6 +21,7 @@ import { ILabel, exportPDF } from "./pdfUtils";
|
|
21
21
|
import { loadModules } from "./loadModules";
|
22
22
|
import { queryFeaturesByID } from "./queryUtils";
|
23
23
|
import { IExportInfo, IExportInfos } from "../utils/interfaces";
|
24
|
+
import { Sanitizer } from "@esri/arcgis-html-sanitizer";
|
24
25
|
import * as common from "@esri/solution-common";
|
25
26
|
|
26
27
|
export { ILabel } from "./pdfUtils";
|
@@ -277,12 +278,14 @@ export function _cleanupLabel(
|
|
277
278
|
// Replace \n with the line separator character
|
278
279
|
labelText = labelText.replace(/\n/gi, "|");
|
279
280
|
|
280
|
-
// Remove
|
281
|
+
// Remove tricky stuff
|
282
|
+
const sanitizer = new Sanitizer();
|
283
|
+
labelText = sanitizer.sanitize(labelText);
|
284
|
+
|
285
|
+
// Remove remaining HTML tags, replace 0xA0 that popup uses for spaces, and replace
|
281
286
|
labelText = labelText
|
282
287
|
.replace(/<[\s.]*[^<>]*\/?>/gi, "")
|
283
288
|
.replace(/\xA0/gi, " ")
|
284
|
-
.replace(/</gi, "<")
|
285
|
-
.replace(/>/gi, ">")
|
286
289
|
.replace(/ /gi, " ");
|
287
290
|
|
288
291
|
// Trim each line
|
@@ -93,8 +93,16 @@ describe("downloadUtils", () => {
|
|
93
93
|
|
94
94
|
it("handles some special characters", () => {
|
95
95
|
const labelText =
|
96
|
-
"<div style='text-align: left;'><{NAME}><br />{STREET}<br/>{CITY}, {STATE}
|
97
|
-
const expectedCleanedText = "
|
96
|
+
"<div style='text-align: left;'><{NAME}><br />{STREET}<br/>{CITY}, {STATE}\xA0{ZIP}<br></div>";
|
97
|
+
const expectedCleanedText = "<{NAME}>|{STREET}|{CITY}, {STATE} {ZIP}";
|
98
|
+
|
99
|
+
const result: string = downloadUtils._cleanupLabel(labelText);
|
100
|
+
expect(result).toEqual(expectedCleanedText);
|
101
|
+
});
|
102
|
+
|
103
|
+
it("handles embedded script tag", () => {
|
104
|
+
const labelText = "<scrip<script>is removed</script>t>alert(123)</script>";
|
105
|
+
const expectedCleanedText = "<scrip<script>is removed</script>t>alert(123)</script>";
|
98
106
|
|
99
107
|
const result: string = downloadUtils._cleanupLabel(labelText);
|
100
108
|
expect(result).toEqual(expectedCleanedText);
|
@@ -188,16 +196,6 @@ describe("downloadUtils", () => {
|
|
188
196
|
expect(result.format).toEqual(expectedLabelSpec);
|
189
197
|
});
|
190
198
|
|
191
|
-
it("handles some special characters", () => {
|
192
|
-
const popupInfo =
|
193
|
-
"<div style='text-align: left;'><{NAME}><br />{STREET}<br/>{CITY}, {STATE} {ZIP}<br></div>";
|
194
|
-
const expectedLabelSpec = "<{NAME}>|{STREET}|{CITY}, {STATE} {ZIP}";
|
195
|
-
|
196
|
-
const result: downloadUtils.ILabelFormat = downloadUtils._convertPopupTextToLabelSpec(popupInfo);
|
197
|
-
expect(result.type).toEqual("pattern");
|
198
|
-
expect(result.format).toEqual(expectedLabelSpec);
|
199
|
-
});
|
200
|
-
|
201
199
|
});
|
202
200
|
|
203
201
|
describe("_convertPopupArcadeToLabelSpec", () => {
|
@@ -190,6 +190,22 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
190
190
|
// Watch handlers
|
191
191
|
//
|
192
192
|
//--------------------------------------------------------------------------
|
193
|
+
/**
|
194
|
+
* Adjust layout based on current appLayout value
|
195
|
+
*/
|
196
|
+
appLayoutWatchHandler(newAppLayout, oldAppLayout) {
|
197
|
+
if (newAppLayout !== oldAppLayout) {
|
198
|
+
this._setActiveLayout(newAppLayout);
|
199
|
+
// update the layer if table selected while switching to map view
|
200
|
+
if (this.appLayout === "mapView" && this._layer.isTable) {
|
201
|
+
void this._mapCard.updateLayer();
|
202
|
+
}
|
203
|
+
if (this._isMapViewOnLoad) {
|
204
|
+
void this._layerTable.refresh();
|
205
|
+
this._isMapViewOnLoad = false;
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
193
209
|
/**
|
194
210
|
* When true the map zoom tools will be available
|
195
211
|
*/
|
@@ -258,7 +274,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
258
274
|
layer && await layer.when(() => {
|
259
275
|
// on render if no layer is present and only one table is present in map and app is in map view layer then change it to split layout
|
260
276
|
if (this._layerIds.length === 0 && this.appLayout === 'mapView' && layer.isTable) {
|
261
|
-
this.
|
277
|
+
this.appLayout = "splitView";
|
262
278
|
}
|
263
279
|
this._layer = layer;
|
264
280
|
this._initLayerExpressions();
|
@@ -291,7 +307,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
291
307
|
render() {
|
292
308
|
// only avoid border when we have a header color that is not white
|
293
309
|
const borderClass = this.popupHeaderColor && this.popupHeaderColor !== "#FFFFFF" ? "border-width-0" : "";
|
294
|
-
return (h(Host, { key: '
|
310
|
+
return (h(Host, { key: 'ace73bfa1aa7d460f1cba60d13e94c4f47f77bd0' }, h("calcite-shell", { key: 'f14e70be762bf236be566111b45e40a42f0997f7', class: "position-relative" }, h("calcite-panel", { key: '0dde9426295a780b6a12cd98513f655914c0dab5', class: `width-full height-full ${borderClass}`, loading: this._isLoading }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter()), this._filterModal()));
|
295
311
|
}
|
296
312
|
/**
|
297
313
|
* Called after each render
|
@@ -524,10 +540,9 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
524
540
|
const cardManagerHeight = isTableLayout && this.mapInfos?.length > 1 ? "adjusted-height-100-51" : isMapLayout || isTableLayout ? "height-full" : (this._numSelected > 0 && !this._isMobile) ? "height-50" : !this._showInformationHeader ? "adjusted-height-50_25" : !this._isPortraitMobile ? "height-50" : "height-full";
|
525
541
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
526
542
|
return (h("div", { class: `width-50 height-full ${themeClass}` }, h("card-manager", { class: `${cardManagerHeight} width-full`, customInfoText: this.customInfoText, enableCreateFeatures: this._enableCreateFeatures && !this._isMobile, enableEditGeometry: this?._mapInfo?.enableEditGeometry, isMobile: this._isPortraitMobile, layer: this._layer, mapView: this?._mapView, onBackFromCreateWorkFlow: () => {
|
527
|
-
this._changeLayout(this.appLayout);
|
528
543
|
this._showInformationHeader = true;
|
529
544
|
}, onCreateWorkFlowStarted: () => {
|
530
|
-
this.
|
545
|
+
this.appLayout = this._layer.isTable ? "tableView" : "mapView";
|
531
546
|
this._showInformationHeader = false;
|
532
547
|
}, onFeatureOrRecordSubmitted: () => void this._layerTable.refresh(), selectedFeaturesIds: this._layerTable?.selectedIds, selectingFeatureFromMap: this.appLayout === "mapView", zoomAndScrollToSelected: this.zoomAndScrollToSelected })));
|
533
548
|
}
|
@@ -565,7 +580,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
565
580
|
const icon = this._getDividerIcon(layoutMode, panelOpen);
|
566
581
|
const tooltip = panelOpen ? this._translations.close : this._translations.open;
|
567
582
|
const id = "toggle-layout";
|
568
|
-
return (h(Fragment, null, h("calcite-action", { active: this.appLayout === 'splitView', class: "toggle-node", icon: "browser", id: "browser-action", onClick: () => { this.
|
583
|
+
return (h(Fragment, null, h("calcite-action", { active: this.appLayout === 'splitView', class: "toggle-node", icon: "browser", id: "browser-action", onClick: () => { this.appLayout = "splitView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "browser-action" }, h("span", null, this._translations.splitView)), h("calcite-action", { active: this.appLayout === 'tableView', class: "toggle-node", icon: "dock-left", id: "dock-left-action", onClick: () => { this.appLayout = "tableView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "dock-left-action" }, h("span", null, this._translations.tableView)), h("calcite-action", { active: this.appLayout === 'mapView', class: "toggle-node", disabled: this._layerIds?.length === 0, icon: "browser-map", id: "browser-map-action", onClick: () => { this.appLayout = "mapView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "browser-map-action" }, h("span", null, this._translations.mapView)), h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), slot: "actions-end", text: "" }), h("calcite-tooltip", { placement: "bottom", "reference-element": id }, h("span", null, tooltip))));
|
569
584
|
}
|
570
585
|
/**
|
571
586
|
* Show filter component in modal
|
@@ -638,7 +653,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
638
653
|
if (this._isMobile) {
|
639
654
|
this.showHideMapPopupAndTable(!this._isMobile);
|
640
655
|
this._isPortraitMobile = !!window.matchMedia("(orientation: portrait)").matches;
|
641
|
-
this.
|
656
|
+
this.appLayout = "splitView";
|
642
657
|
}
|
643
658
|
else {
|
644
659
|
this._isPortraitMobile = false;
|
@@ -654,34 +669,14 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
654
669
|
_toggleLayout() {
|
655
670
|
this._panelOpen = !this._panelOpen;
|
656
671
|
}
|
657
|
-
/**
|
658
|
-
* Changes the layout mode
|
659
|
-
* @param appLayout selected active app layout
|
660
|
-
*
|
661
|
-
* @protected
|
662
|
-
*/
|
663
|
-
_changeLayout(appLayout) {
|
664
|
-
if (this.appLayout !== appLayout) {
|
665
|
-
this._setActiveLayout(appLayout);
|
666
|
-
this.appLayout = appLayout;
|
667
|
-
// update the layer if table selected while switching to map view
|
668
|
-
if (this.appLayout === "mapView" && this._layer.isTable) {
|
669
|
-
void this._mapCard.updateLayer();
|
670
|
-
}
|
671
|
-
if (this._isMapViewOnLoad) {
|
672
|
-
void this._layerTable.refresh();
|
673
|
-
this._isMapViewOnLoad = false;
|
674
|
-
}
|
675
|
-
}
|
676
|
-
}
|
677
672
|
/**
|
678
673
|
* shows the map in card view
|
679
674
|
*
|
680
675
|
* @protected
|
681
676
|
*/
|
682
677
|
_showMapInCardView() {
|
683
|
-
if (this.appLayout
|
684
|
-
const fullMapView = document.getElementById('full-map-view')
|
678
|
+
if (this.appLayout !== "mapView") {
|
679
|
+
const fullMapView = document.getElementById('full-map-view')?.childNodes[0];
|
685
680
|
const splitMapClass = document.getElementById('card-mapView');
|
686
681
|
if (fullMapView) {
|
687
682
|
splitMapClass.appendChild(fullMapView);
|
@@ -694,7 +689,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
694
689
|
* @protected
|
695
690
|
*/
|
696
691
|
_showMapInFullView() {
|
697
|
-
const splitMap = document.getElementById('card-mapView')
|
692
|
+
const splitMap = document.getElementById('card-mapView')?.childNodes[0];
|
698
693
|
const fullMapViewClass = document.getElementById('full-map-view');
|
699
694
|
if (splitMap) {
|
700
695
|
fullMapViewClass.appendChild(splitMap);
|
@@ -779,6 +774,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
779
774
|
this._translations = messages[0];
|
780
775
|
}
|
781
776
|
static get watchers() { return {
|
777
|
+
"appLayout": ["appLayoutWatchHandler"],
|
782
778
|
"enableZoom": ["enableZoomWatchHandler"],
|
783
779
|
"hideMapOnLoad": ["hideMapOnLoadWatchHandler"]
|
784
780
|
}; }
|
@@ -839,6 +835,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
839
835
|
"_layerIds": [32],
|
840
836
|
"_isLoading": [32]
|
841
837
|
}, [[8, "featureSelectionChange", "featureSelectionChange"], [8, "popupClosed", "popupClosed"], [8, "layoutChanged", "layoutChanged"], [8, "mapChanged", "mapChanged"], [8, "layerSelectionChange", "layerSelectionChange"], [8, "idsFound", "idsFound"]], {
|
838
|
+
"appLayout": ["appLayoutWatchHandler"],
|
842
839
|
"enableZoom": ["enableZoomWatchHandler"],
|
843
840
|
"hideMapOnLoad": ["hideMapOnLoadWatchHandler"]
|
844
841
|
}]);
|
@@ -7,8 +7,8 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
|
7
7
|
import { getAssetPath } from '@stencil/core/internal/client';
|
8
8
|
import { l as loadModules } from './loadModules.js';
|
9
9
|
import { q as queryFeaturesByID } from './queryUtils.js';
|
10
|
+
import { S as Sanitizer } from './index2.js';
|
10
11
|
import './solution-resource.js';
|
11
|
-
import './index2.js';
|
12
12
|
import { _ as __assign$1, r as request, c as cleanUrl, g as getJson } from './restHelpersGet.js';
|
13
13
|
|
14
14
|
/** @license
|
@@ -2541,12 +2541,13 @@ function _cleanupLabel(labelText) {
|
|
2541
2541
|
labelText = labelText.replace(/<\/p>/gi, "");
|
2542
2542
|
// Replace \n with the line separator character
|
2543
2543
|
labelText = labelText.replace(/\n/gi, "|");
|
2544
|
-
// Remove
|
2544
|
+
// Remove tricky stuff
|
2545
|
+
const sanitizer = new Sanitizer();
|
2546
|
+
labelText = sanitizer.sanitize(labelText);
|
2547
|
+
// Remove remaining HTML tags, replace 0xA0 that popup uses for spaces, and replace
|
2545
2548
|
labelText = labelText
|
2546
2549
|
.replace(/<[\s.]*[^<>]*\/?>/gi, "")
|
2547
2550
|
.replace(/\xA0/gi, " ")
|
2548
|
-
.replace(/</gi, "<")
|
2549
|
-
.replace(/>/gi, ">")
|
2550
2551
|
.replace(/ /gi, " ");
|
2551
2552
|
// Trim each line
|
2552
2553
|
labelText = labelText.replace(/\s*\|\s*/g, "|");
|
@@ -109,6 +109,7 @@ const MapLegend = /*@__PURE__*/ proxyCustomElement(class MapLegend extends HTMLE
|
|
109
109
|
if (!this.legendWidget) {
|
110
110
|
this.legendWidget = new this.Legend({
|
111
111
|
container: this._legendElement,
|
112
|
+
respectLayerDefinitionExpression: true,
|
112
113
|
view
|
113
114
|
});
|
114
115
|
}
|
@@ -15,7 +15,7 @@ import { u as updateHostInteraction, I as InteractiveContainer } from './interac
|
|
15
15
|
import { S as SLOTS$2 } from './resources-35208c6c.js';
|
16
16
|
import { l as loadModules, g as getLocaleComponentStrings } from './locale-0d06fca0.js';
|
17
17
|
import { a as getAllLayers, g as getLayerOrTable } from './mapViewUtils-f54edae3.js';
|
18
|
-
import { P as PopupUtils } from './popupUtils-
|
18
|
+
import { P as PopupUtils } from './popupUtils-03dc398a.js';
|
19
19
|
import './guid-b0fb1de3.js';
|
20
20
|
import './resources-8e2ed936.js';
|
21
21
|
import './browser-b67d8df6.js';
|
@@ -24,9 +24,9 @@ import './observers-c83631e8.js';
|
|
24
24
|
import './esri-loader-c6842c6b.js';
|
25
25
|
import './_commonjsHelpers-089957fe.js';
|
26
26
|
import './interfaces-659e3836.js';
|
27
|
-
import './downloadUtils-
|
28
|
-
import './solution-resource-f5809979.js';
|
27
|
+
import './downloadUtils-bc7a4ba1.js';
|
29
28
|
import './index-e14fade9.js';
|
29
|
+
import './solution-resource-f5809979.js';
|
30
30
|
import './restHelpersGet-48113381.js';
|
31
31
|
|
32
32
|
/*!
|
@@ -6,12 +6,12 @@
|
|
6
6
|
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-904bc599.js';
|
7
7
|
import { g as getLocaleComponentStrings, l as loadModules } from './locale-0d06fca0.js';
|
8
8
|
import { g as getLayerOrTable, q as queryFeaturesByID, e as goToSelection, f as queryAllIds, i as queryAllOidsWithQueryFeatures, j as queryFeaturesByGlobalID, c as getFeatureLayerView } from './mapViewUtils-f54edae3.js';
|
9
|
-
import { d as downloadCSV } from './downloadUtils-
|
9
|
+
import { d as downloadCSV } from './downloadUtils-bc7a4ba1.js';
|
10
10
|
import './esri-loader-c6842c6b.js';
|
11
11
|
import './_commonjsHelpers-089957fe.js';
|
12
12
|
import './interfaces-659e3836.js';
|
13
|
-
import './solution-resource-f5809979.js';
|
14
13
|
import './index-e14fade9.js';
|
14
|
+
import './solution-resource-f5809979.js';
|
15
15
|
import './restHelpersGet-48113381.js';
|
16
16
|
|
17
17
|
const cardManagerCss = ":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}.position-static{position:static !important}.z-index-500{z-index:500 !important}card-manager{display:block}";
|
@@ -131,6 +131,22 @@ const CrowdsourceManager = class {
|
|
131
131
|
// Watch handlers
|
132
132
|
//
|
133
133
|
//--------------------------------------------------------------------------
|
134
|
+
/**
|
135
|
+
* Adjust layout based on current appLayout value
|
136
|
+
*/
|
137
|
+
appLayoutWatchHandler(newAppLayout, oldAppLayout) {
|
138
|
+
if (newAppLayout !== oldAppLayout) {
|
139
|
+
this._setActiveLayout(newAppLayout);
|
140
|
+
// update the layer if table selected while switching to map view
|
141
|
+
if (this.appLayout === "mapView" && this._layer.isTable) {
|
142
|
+
void this._mapCard.updateLayer();
|
143
|
+
}
|
144
|
+
if (this._isMapViewOnLoad) {
|
145
|
+
void this._layerTable.refresh();
|
146
|
+
this._isMapViewOnLoad = false;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
134
150
|
/**
|
135
151
|
* When true the map zoom tools will be available
|
136
152
|
*/
|
@@ -199,7 +215,7 @@ const CrowdsourceManager = class {
|
|
199
215
|
layer && await layer.when(() => {
|
200
216
|
// on render if no layer is present and only one table is present in map and app is in map view layer then change it to split layout
|
201
217
|
if (this._layerIds.length === 0 && this.appLayout === 'mapView' && layer.isTable) {
|
202
|
-
this.
|
218
|
+
this.appLayout = "splitView";
|
203
219
|
}
|
204
220
|
this._layer = layer;
|
205
221
|
this._initLayerExpressions();
|
@@ -232,7 +248,7 @@ const CrowdsourceManager = class {
|
|
232
248
|
render() {
|
233
249
|
// only avoid border when we have a header color that is not white
|
234
250
|
const borderClass = this.popupHeaderColor && this.popupHeaderColor !== "#FFFFFF" ? "border-width-0" : "";
|
235
|
-
return (h(Host, { key: '
|
251
|
+
return (h(Host, { key: 'ace73bfa1aa7d460f1cba60d13e94c4f47f77bd0' }, h("calcite-shell", { key: 'f14e70be762bf236be566111b45e40a42f0997f7', class: "position-relative" }, h("calcite-panel", { key: '0dde9426295a780b6a12cd98513f655914c0dab5', class: `width-full height-full ${borderClass}`, loading: this._isLoading }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter()), this._filterModal()));
|
236
252
|
}
|
237
253
|
/**
|
238
254
|
* Called after each render
|
@@ -465,10 +481,9 @@ const CrowdsourceManager = class {
|
|
465
481
|
const cardManagerHeight = isTableLayout && this.mapInfos?.length > 1 ? "adjusted-height-100-51" : isMapLayout || isTableLayout ? "height-full" : (this._numSelected > 0 && !this._isMobile) ? "height-50" : !this._showInformationHeader ? "adjusted-height-50_25" : !this._isPortraitMobile ? "height-50" : "height-full";
|
466
482
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
467
483
|
return (h("div", { class: `width-50 height-full ${themeClass}` }, h("card-manager", { class: `${cardManagerHeight} width-full`, customInfoText: this.customInfoText, enableCreateFeatures: this._enableCreateFeatures && !this._isMobile, enableEditGeometry: this?._mapInfo?.enableEditGeometry, isMobile: this._isPortraitMobile, layer: this._layer, mapView: this?._mapView, onBackFromCreateWorkFlow: () => {
|
468
|
-
this._changeLayout(this.appLayout);
|
469
484
|
this._showInformationHeader = true;
|
470
485
|
}, onCreateWorkFlowStarted: () => {
|
471
|
-
this.
|
486
|
+
this.appLayout = this._layer.isTable ? "tableView" : "mapView";
|
472
487
|
this._showInformationHeader = false;
|
473
488
|
}, onFeatureOrRecordSubmitted: () => void this._layerTable.refresh(), selectedFeaturesIds: this._layerTable?.selectedIds, selectingFeatureFromMap: this.appLayout === "mapView", zoomAndScrollToSelected: this.zoomAndScrollToSelected })));
|
474
489
|
}
|
@@ -506,7 +521,7 @@ const CrowdsourceManager = class {
|
|
506
521
|
const icon = this._getDividerIcon(layoutMode, panelOpen);
|
507
522
|
const tooltip = panelOpen ? this._translations.close : this._translations.open;
|
508
523
|
const id = "toggle-layout";
|
509
|
-
return (h(Fragment, null, h("calcite-action", { active: this.appLayout === 'splitView', class: "toggle-node", icon: "browser", id: "browser-action", onClick: () => { this.
|
524
|
+
return (h(Fragment, null, h("calcite-action", { active: this.appLayout === 'splitView', class: "toggle-node", icon: "browser", id: "browser-action", onClick: () => { this.appLayout = "splitView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "browser-action" }, h("span", null, this._translations.splitView)), h("calcite-action", { active: this.appLayout === 'tableView', class: "toggle-node", icon: "dock-left", id: "dock-left-action", onClick: () => { this.appLayout = "tableView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "dock-left-action" }, h("span", null, this._translations.tableView)), h("calcite-action", { active: this.appLayout === 'mapView', class: "toggle-node", disabled: this._layerIds?.length === 0, icon: "browser-map", id: "browser-map-action", onClick: () => { this.appLayout = "mapView"; }, text: "" }), h("calcite-tooltip", { placement: "right", "reference-element": "browser-map-action" }, h("span", null, this._translations.mapView)), h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), slot: "actions-end", text: "" }), h("calcite-tooltip", { placement: "bottom", "reference-element": id }, h("span", null, tooltip))));
|
510
525
|
}
|
511
526
|
/**
|
512
527
|
* Show filter component in modal
|
@@ -579,7 +594,7 @@ const CrowdsourceManager = class {
|
|
579
594
|
if (this._isMobile) {
|
580
595
|
this.showHideMapPopupAndTable(!this._isMobile);
|
581
596
|
this._isPortraitMobile = !!window.matchMedia("(orientation: portrait)").matches;
|
582
|
-
this.
|
597
|
+
this.appLayout = "splitView";
|
583
598
|
}
|
584
599
|
else {
|
585
600
|
this._isPortraitMobile = false;
|
@@ -595,34 +610,14 @@ const CrowdsourceManager = class {
|
|
595
610
|
_toggleLayout() {
|
596
611
|
this._panelOpen = !this._panelOpen;
|
597
612
|
}
|
598
|
-
/**
|
599
|
-
* Changes the layout mode
|
600
|
-
* @param appLayout selected active app layout
|
601
|
-
*
|
602
|
-
* @protected
|
603
|
-
*/
|
604
|
-
_changeLayout(appLayout) {
|
605
|
-
if (this.appLayout !== appLayout) {
|
606
|
-
this._setActiveLayout(appLayout);
|
607
|
-
this.appLayout = appLayout;
|
608
|
-
// update the layer if table selected while switching to map view
|
609
|
-
if (this.appLayout === "mapView" && this._layer.isTable) {
|
610
|
-
void this._mapCard.updateLayer();
|
611
|
-
}
|
612
|
-
if (this._isMapViewOnLoad) {
|
613
|
-
void this._layerTable.refresh();
|
614
|
-
this._isMapViewOnLoad = false;
|
615
|
-
}
|
616
|
-
}
|
617
|
-
}
|
618
613
|
/**
|
619
614
|
* shows the map in card view
|
620
615
|
*
|
621
616
|
* @protected
|
622
617
|
*/
|
623
618
|
_showMapInCardView() {
|
624
|
-
if (this.appLayout
|
625
|
-
const fullMapView = document.getElementById('full-map-view')
|
619
|
+
if (this.appLayout !== "mapView") {
|
620
|
+
const fullMapView = document.getElementById('full-map-view')?.childNodes[0];
|
626
621
|
const splitMapClass = document.getElementById('card-mapView');
|
627
622
|
if (fullMapView) {
|
628
623
|
splitMapClass.appendChild(fullMapView);
|
@@ -635,7 +630,7 @@ const CrowdsourceManager = class {
|
|
635
630
|
* @protected
|
636
631
|
*/
|
637
632
|
_showMapInFullView() {
|
638
|
-
const splitMap = document.getElementById('card-mapView')
|
633
|
+
const splitMap = document.getElementById('card-mapView')?.childNodes[0];
|
639
634
|
const fullMapViewClass = document.getElementById('full-map-view');
|
640
635
|
if (splitMap) {
|
641
636
|
fullMapViewClass.appendChild(splitMap);
|
@@ -720,6 +715,7 @@ const CrowdsourceManager = class {
|
|
720
715
|
this._translations = messages[0];
|
721
716
|
}
|
722
717
|
static get watchers() { return {
|
718
|
+
"appLayout": ["appLayoutWatchHandler"],
|
723
719
|
"enableZoom": ["enableZoomWatchHandler"],
|
724
720
|
"hideMapOnLoad": ["hideMapOnLoadWatchHandler"]
|
725
721
|
}; }
|