@esri/solutions-components 0.7.36 → 0.7.38
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-alert_4.cjs.entry.js +3 -1
- package/dist/cjs/calcite-combobox_5.cjs.entry.js +1 -1
- package/dist/cjs/calcite-flow_5.cjs.entry.js +1 -1
- package/dist/cjs/card-manager_3.cjs.entry.js +45 -12
- package/dist/cjs/crowdsource-manager.cjs.entry.js +4 -5
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +29 -3
- package/dist/cjs/{downloadUtils-8ca56dfa.js → downloadUtils-c22a71da.js} +2 -2
- package/dist/cjs/{index.es-3c36cde7.js → index.es-8d317f5e.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/{mapViewUtils-8aa325de.js → mapViewUtils-cd29b129.js} +2 -0
- 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 +3 -4
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +29 -3
- package/dist/collection/components/info-card/info-card.js +20 -0
- package/dist/collection/components/layer-table/layer-table.js +41 -8
- package/dist/collection/components/map-card/map-card.css +2 -1
- package/dist/collection/components/map-card/map-card.js +1 -1
- package/dist/collection/utils/mapViewUtils.js +2 -0
- package/dist/collection/utils/mapViewUtils.ts +2 -0
- package/dist/components/crowdsource-manager.js +3 -4
- package/dist/components/crowdsource-reporter.js +29 -3
- package/dist/components/info-card2.js +3 -0
- package/dist/components/layer-table2.js +41 -8
- package/dist/components/map-card2.js +2 -2
- package/dist/components/mapViewUtils.js +2 -0
- package/dist/esm/calcite-alert_4.entry.js +3 -1
- package/dist/esm/calcite-combobox_5.entry.js +1 -1
- package/dist/esm/calcite-flow_5.entry.js +1 -1
- package/dist/esm/card-manager_3.entry.js +45 -12
- package/dist/esm/crowdsource-manager.entry.js +4 -5
- package/dist/esm/crowdsource-reporter.entry.js +29 -3
- package/dist/esm/{downloadUtils-8b83a40c.js → downloadUtils-985dcd1c.js} +2 -2
- package/dist/esm/{index.es-33e2ee2d.js → index.es-03d8386e.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +2 -2
- package/dist/esm/{mapViewUtils-cf05e880.js → mapViewUtils-257bc9b3.js} +3 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-e4e59f16.js → p-00ba5a2a.js} +2 -2
- package/dist/solutions-components/{p-d3da7497.entry.js → p-12492469.entry.js} +1 -1
- package/dist/solutions-components/{p-cf24dd35.entry.js → p-20b206f3.entry.js} +1 -1
- package/dist/solutions-components/{p-8365664f.entry.js → p-23e58d7c.entry.js} +1 -1
- package/dist/solutions-components/p-2f840f08.entry.js +6 -0
- package/dist/solutions-components/{p-25894d7a.entry.js → p-34eaca46.entry.js} +1 -1
- package/dist/solutions-components/{p-c85ce035.entry.js → p-6419f8d7.entry.js} +2 -2
- package/dist/solutions-components/p-820e3d28.entry.js +6 -0
- package/dist/solutions-components/p-9161dca9.entry.js +6 -0
- package/dist/solutions-components/p-96f5be25.js +36 -0
- package/dist/solutions-components/{p-ee1e4df3.js → p-df048b47.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/mapViewUtils.ts +2 -0
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +1 -1
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +14 -0
- package/dist/types/components/info-card/info-card.d.ts +4 -0
- package/dist/types/components/layer-table/layer-table.d.ts +10 -1
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-2c382841.js +0 -36
- package/dist/solutions-components/p-3c5cae90.entry.js +0 -6
- package/dist/solutions-components/p-6d0203ed.entry.js +0 -6
- package/dist/solutions-components/p-922f2467.entry.js +0 -6
@@ -336,7 +336,7 @@ export class CrowdsourceManager {
|
|
336
336
|
*/
|
337
337
|
_getMapAndCard(layoutMode, panelOpen, hideTable) {
|
338
338
|
const mapSizeClass = this._getMapSizeClass(layoutMode, panelOpen, hideTable);
|
339
|
-
return (h("div", { class: `${mapSizeClass} overflow-hidden` }, this._getMapNode(
|
339
|
+
return (h("div", { class: `${mapSizeClass} overflow-hidden` }, this._getMapNode(panelOpen), this._getPopupExpandNode()));
|
340
340
|
}
|
341
341
|
/**
|
342
342
|
* Get the map node based for the current layout options
|
@@ -347,11 +347,10 @@ export class CrowdsourceManager {
|
|
347
347
|
* @returns the map node
|
348
348
|
* @protected
|
349
349
|
*/
|
350
|
-
_getMapNode(
|
350
|
+
_getMapNode(panelOpen) {
|
351
351
|
var _a;
|
352
|
-
const mapDisplayClass = layoutMode === ELayoutMode.HORIZONTAL ? "" : layoutMode === ELayoutMode.GRID ? "" : "visibility-hidden";
|
353
352
|
const mapContainerClass = this._layoutMode === ELayoutMode.HORIZONTAL && (!this._isMobile || panelOpen) ? "" : "adjusted-height-50";
|
354
|
-
return (h("div", { class: `${mapContainerClass} overflow-hidden
|
353
|
+
return (h("div", { class: `${mapContainerClass} overflow-hidden` }, h("map-card", { basemapConfig: this.basemapConfig, class: "width-full", defaultWebmapId: this.defaultWebmap, enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableHome: this.enableHome, enableLegend: this.enableLegend, enableSearch: this.enableSearch, enableSingleExpand: true, hidden: this._expandPopup && !this._isMobile, homeZoomIndex: 3, homeZoomPosition: "top-left", homeZoomToolsSize: "s", mapInfos: (_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.filter(mapInfo => mapInfo.visible !== false), mapWidgetsIndex: 0, mapWidgetsPosition: "top-right", mapWidgetsSize: "m", stackTools: true, theme: this.theme, toolOrder: ["legend", "search", "fullscreen", "basemap", "floorfilter"] })));
|
355
354
|
}
|
356
355
|
/**
|
357
356
|
* Get the expand node for the popup information
|
@@ -21,7 +21,7 @@
|
|
21
21
|
import { Host, h } from "@stencil/core";
|
22
22
|
import { getLocaleComponentStrings } from "../../utils/locale";
|
23
23
|
import { loadModules } from "../../utils/loadModules";
|
24
|
-
import { getAllLayers, getLayerOrTable } from "../../utils/mapViewUtils";
|
24
|
+
import { getAllLayers, getFeatureLayerView, getLayerOrTable, highlightFeatures } from "../../utils/mapViewUtils";
|
25
25
|
import { queryFeaturesByID } from "../../utils/queryUtils";
|
26
26
|
export class CrowdsourceReporter {
|
27
27
|
constructor() {
|
@@ -313,6 +313,7 @@ export class CrowdsourceReporter {
|
|
313
313
|
backFromSelectedPanel() {
|
314
314
|
const updatedFlowItems = [...this._flowItems];
|
315
315
|
updatedFlowItems.pop();
|
316
|
+
this.clearHighlights();
|
316
317
|
//Back to layer list, and return as the flowItems will be reset in navigateToHomePage
|
317
318
|
if (updatedFlowItems.length === 1) {
|
318
319
|
this.navigateToHomePage();
|
@@ -345,14 +346,14 @@ export class CrowdsourceReporter {
|
|
345
346
|
*/
|
346
347
|
getFeatureListFlowItem(layerId, layerName) {
|
347
348
|
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
|
348
|
-
h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full",
|
349
|
+
h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, selectedLayerId: layerId }))));
|
349
350
|
}
|
350
351
|
/**
|
351
352
|
* Returns the calcite-flow item for feature details
|
352
353
|
* @returns Node
|
353
354
|
*/
|
354
355
|
getFeatureDetailsFlowItem() {
|
355
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), h("calcite-panel", { "full-height": true }, h("info-card", { allowEditing: false, graphics: this._selectedFeature, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: this.featureDetailsChanged.bind(this), zoomAndScrollToSelected: true }))));
|
356
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), h("calcite-panel", { "full-height": true }, h("info-card", { allowEditing: false, graphics: this._selectedFeature, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: this.featureDetailsChanged.bind(this), zoomAndScrollToSelected: true }))));
|
356
357
|
}
|
357
358
|
/**
|
358
359
|
* Sets the selected features and updates the first feature as the current selected feature
|
@@ -384,6 +385,30 @@ export class CrowdsourceReporter {
|
|
384
385
|
*/
|
385
386
|
featureDetailsChanged(evt) {
|
386
387
|
this.setCurrentFeature(evt.detail[0]);
|
388
|
+
void this.highlightOnMap(evt.detail[0]);
|
389
|
+
}
|
390
|
+
/**
|
391
|
+
* Highlights the feature on map
|
392
|
+
* @param selectedFeature Graphic currently shown in feature details
|
393
|
+
*/
|
394
|
+
async highlightOnMap(selectedFeature) {
|
395
|
+
// if a feature is already highlighted, remove the previous highlight
|
396
|
+
this.clearHighlights();
|
397
|
+
// highlight the newly selected feature only when it has valid geometry
|
398
|
+
if (selectedFeature && selectedFeature.geometry && selectedFeature.layer) {
|
399
|
+
const selectedLayerView = await getFeatureLayerView(this.mapView, selectedFeature.layer.id);
|
400
|
+
this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true);
|
401
|
+
}
|
402
|
+
}
|
403
|
+
/**
|
404
|
+
* Clears the highlight
|
405
|
+
* @protected
|
406
|
+
*/
|
407
|
+
clearHighlights() {
|
408
|
+
//if a feature is already highlighted, then remove the highlight
|
409
|
+
if (this._highlightHandle) {
|
410
|
+
this._highlightHandle.remove();
|
411
|
+
}
|
387
412
|
}
|
388
413
|
/**
|
389
414
|
* Returns the action button to Expand/Collapse side panel in mobile mode
|
@@ -451,6 +476,7 @@ export class CrowdsourceReporter {
|
|
451
476
|
}
|
452
477
|
else {
|
453
478
|
this._flowItems = [...this._flowItems];
|
479
|
+
void this.highlightOnMap(clickedGraphics[0]);
|
454
480
|
}
|
455
481
|
}
|
456
482
|
}
|
@@ -30,6 +30,7 @@ export class InfoCard {
|
|
30
30
|
this.mapView = undefined;
|
31
31
|
this.zoomAndScrollToSelected = undefined;
|
32
32
|
this.allowEditing = true;
|
33
|
+
this.highlightEnabled = true;
|
33
34
|
this._alertOpen = false;
|
34
35
|
this._count = "";
|
35
36
|
this._editRecordOpen = false;
|
@@ -206,6 +207,7 @@ export class InfoCard {
|
|
206
207
|
heading: !this.isMobile
|
207
208
|
}
|
208
209
|
});
|
210
|
+
this._features.viewModel.highlightEnabled = this.highlightEnabled;
|
209
211
|
this.reactiveUtils.watch(() => this._features.viewModel.featureMenuOpen, (isOpen) => {
|
210
212
|
if (!isOpen) {
|
211
213
|
this._showListView = isOpen;
|
@@ -431,6 +433,24 @@ export class InfoCard {
|
|
431
433
|
"attribute": "allow-editing",
|
432
434
|
"reflect": false,
|
433
435
|
"defaultValue": "true"
|
436
|
+
},
|
437
|
+
"highlightEnabled": {
|
438
|
+
"type": "boolean",
|
439
|
+
"mutable": false,
|
440
|
+
"complexType": {
|
441
|
+
"original": "boolean",
|
442
|
+
"resolved": "boolean",
|
443
|
+
"references": {}
|
444
|
+
},
|
445
|
+
"required": false,
|
446
|
+
"optional": true,
|
447
|
+
"docs": {
|
448
|
+
"tags": [],
|
449
|
+
"text": "boolean: If true will highlights the features on map using Features Widget"
|
450
|
+
},
|
451
|
+
"attribute": "highlight-enabled",
|
452
|
+
"reflect": false,
|
453
|
+
"defaultValue": "true"
|
434
454
|
}
|
435
455
|
};
|
436
456
|
}
|
@@ -157,6 +157,7 @@ export class LayerTable {
|
|
157
157
|
this._initToolInfos();
|
158
158
|
}
|
159
159
|
this._initLayerExpressions();
|
160
|
+
this._resetColumnTemplates();
|
160
161
|
}
|
161
162
|
/**
|
162
163
|
* watch for changes in map view and get the first layer
|
@@ -176,10 +177,10 @@ export class LayerTable {
|
|
176
177
|
* watch for changes in layer view and verify if it has editing enabled
|
177
178
|
*/
|
178
179
|
async _layerWatchHandler() {
|
179
|
-
var _a, _b;
|
180
|
+
var _a, _b, _c;
|
180
181
|
this._fetchingData = true;
|
181
|
-
this._definitionExpression = this._layer.definitionExpression;
|
182
|
-
this._floorField = (
|
182
|
+
this._definitionExpression = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.definitionExpression;
|
183
|
+
this._floorField = (_c = (_b = this._layer) === null || _b === void 0 ? void 0 : _b.floorInfo) === null || _c === void 0 ? void 0 : _c.floorField;
|
183
184
|
this._updateFloorDefinitionExpression();
|
184
185
|
await this._resetTable();
|
185
186
|
this._updateShareUrl();
|
@@ -317,12 +318,14 @@ export class LayerTable {
|
|
317
318
|
* @protected
|
318
319
|
*/
|
319
320
|
async _initModules() {
|
320
|
-
const [FeatureTable, reactiveUtils] = await loadModules([
|
321
|
+
const [FeatureTable, reactiveUtils, TableTemplate] = await loadModules([
|
321
322
|
"esri/widgets/FeatureTable",
|
322
|
-
"esri/core/reactiveUtils"
|
323
|
+
"esri/core/reactiveUtils",
|
324
|
+
"esri/widgets/FeatureTable/support/TableTemplate"
|
323
325
|
]);
|
324
326
|
this.FeatureTable = FeatureTable;
|
325
327
|
this.reactiveUtils = reactiveUtils;
|
328
|
+
this.TableTemplate = TableTemplate;
|
326
329
|
}
|
327
330
|
/**
|
328
331
|
* Update the toolbar when its size changes
|
@@ -959,6 +962,20 @@ export class LayerTable {
|
|
959
962
|
}
|
960
963
|
this.featureSelectionChange.emit(this.selectedIds);
|
961
964
|
}
|
965
|
+
/**
|
966
|
+
* Reset the tables column templates when we get new column config
|
967
|
+
*/
|
968
|
+
_resetColumnTemplates() {
|
969
|
+
var _a, _b;
|
970
|
+
const columnTemplates = this._getColumnTemplates((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id, (_b = this._layer) === null || _b === void 0 ? void 0 : _b.fields);
|
971
|
+
if (this._table && columnTemplates) {
|
972
|
+
this._table.tableTemplate = new this.TableTemplate({
|
973
|
+
columnTemplates
|
974
|
+
});
|
975
|
+
const fieldNames = columnTemplates.map(f => f.fieldName);
|
976
|
+
this._initColumnsInfo(fieldNames);
|
977
|
+
}
|
978
|
+
}
|
962
979
|
/**
|
963
980
|
* Reset basic table props
|
964
981
|
*/
|
@@ -1009,12 +1026,28 @@ export class LayerTable {
|
|
1009
1026
|
}
|
1010
1027
|
/**
|
1011
1028
|
* Store the column names and current hidden status to support show/hide of columns
|
1029
|
+
* @param fieldNames optional list of names from new config options
|
1012
1030
|
*/
|
1013
|
-
_initColumnsInfo() {
|
1014
|
-
|
1015
|
-
|
1031
|
+
_initColumnsInfo(fieldNames) {
|
1032
|
+
var _a, _b;
|
1033
|
+
// this._table.columns is not reflecting correct list when new
|
1034
|
+
// tableTemplate.columnTemplates have been defined on an existing FeatureTable
|
1035
|
+
// TODO review for better solution post 2024 R01 release
|
1036
|
+
const columnsInfo = (_a = this._table) === null || _a === void 0 ? void 0 : _a.columns.reduce((prev, cur) => {
|
1037
|
+
if (!fieldNames || ((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.indexOf(cur.name)) > -1)) {
|
1038
|
+
prev[cur.name] = !cur.hidden;
|
1039
|
+
}
|
1016
1040
|
return prev;
|
1017
1041
|
}, {});
|
1042
|
+
const oldColumnNames = (_b = this._table) === null || _b === void 0 ? void 0 : _b.columns.map((c) => c.name);
|
1043
|
+
const newColumnNames = fieldNames ? fieldNames.filter(n => oldColumnNames.indexOf(n) < 0) : [];
|
1044
|
+
newColumnNames.forEach(c => {
|
1045
|
+
columnsInfo[c] = true;
|
1046
|
+
});
|
1047
|
+
this._columnsInfo = fieldNames ? fieldNames.reduce((prev, cur) => {
|
1048
|
+
prev[cur] = columnsInfo[cur];
|
1049
|
+
return prev;
|
1050
|
+
}, {}) : columnsInfo;
|
1018
1051
|
}
|
1019
1052
|
/**
|
1020
1053
|
* Select the feature that was specified via url params
|
@@ -93,7 +93,7 @@ export class MapCard {
|
|
93
93
|
*/
|
94
94
|
render() {
|
95
95
|
var _a, _b;
|
96
|
-
const mapClass = this.hidden ? "visibility-hidden" : "";
|
96
|
+
const mapClass = this.hidden ? "visibility-hidden-1" : "";
|
97
97
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
98
98
|
const mapPickerClass = ((_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.length) > 1 ? "" : "display-none";
|
99
99
|
const mapHeightClass = ((_b = this.mapInfos) === null || _b === void 0 ? void 0 : _b.length) > 1 ? "map-height" : "height-full";
|
@@ -160,6 +160,8 @@ export async function getAllLayers(mapView) {
|
|
160
160
|
export async function highlightFeatures(ids, layerView, mapView, updateExtent = false) {
|
161
161
|
if (updateExtent) {
|
162
162
|
await goToSelection(ids, layerView, mapView, false);
|
163
|
+
//wait for sometime to load the feature in layerView then only the highlight will work
|
164
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
163
165
|
}
|
164
166
|
return layerView.highlight(ids);
|
165
167
|
}
|
@@ -193,6 +193,8 @@ export async function highlightFeatures(
|
|
193
193
|
): Promise<__esri.Handle> {
|
194
194
|
if (updateExtent) {
|
195
195
|
await goToSelection(ids, layerView, mapView, false);
|
196
|
+
//wait for sometime to load the feature in layerView then only the highlight will work
|
197
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
196
198
|
}
|
197
199
|
return layerView.highlight(ids);
|
198
200
|
}
|
@@ -383,7 +383,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
383
383
|
*/
|
384
384
|
_getMapAndCard(layoutMode, panelOpen, hideTable) {
|
385
385
|
const mapSizeClass = this._getMapSizeClass(layoutMode, panelOpen, hideTable);
|
386
|
-
return (h("div", { class: `${mapSizeClass} overflow-hidden` }, this._getMapNode(
|
386
|
+
return (h("div", { class: `${mapSizeClass} overflow-hidden` }, this._getMapNode(panelOpen), this._getPopupExpandNode()));
|
387
387
|
}
|
388
388
|
/**
|
389
389
|
* Get the map node based for the current layout options
|
@@ -394,11 +394,10 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
394
394
|
* @returns the map node
|
395
395
|
* @protected
|
396
396
|
*/
|
397
|
-
_getMapNode(
|
397
|
+
_getMapNode(panelOpen) {
|
398
398
|
var _a;
|
399
|
-
const mapDisplayClass = layoutMode === ELayoutMode.HORIZONTAL ? "" : layoutMode === ELayoutMode.GRID ? "" : "visibility-hidden";
|
400
399
|
const mapContainerClass = this._layoutMode === ELayoutMode.HORIZONTAL && (!this._isMobile || panelOpen) ? "" : "adjusted-height-50";
|
401
|
-
return (h("div", { class: `${mapContainerClass} overflow-hidden
|
400
|
+
return (h("div", { class: `${mapContainerClass} overflow-hidden` }, h("map-card", { basemapConfig: this.basemapConfig, class: "width-full", defaultWebmapId: this.defaultWebmap, enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableHome: this.enableHome, enableLegend: this.enableLegend, enableSearch: this.enableSearch, enableSingleExpand: true, hidden: this._expandPopup && !this._isMobile, homeZoomIndex: 3, homeZoomPosition: "top-left", homeZoomToolsSize: "s", mapInfos: (_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.filter(mapInfo => mapInfo.visible !== false), mapWidgetsIndex: 0, mapWidgetsPosition: "top-right", mapWidgetsSize: "m", stackTools: true, theme: this.theme, toolOrder: ["legend", "search", "fullscreen", "basemap", "floorfilter"] })));
|
402
401
|
}
|
403
402
|
/**
|
404
403
|
* Get the expand node for the popup information
|
@@ -6,7 +6,7 @@
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
7
7
|
import { g as getLocaleComponentStrings } from './locale.js';
|
8
8
|
import { l as loadModules } from './loadModules.js';
|
9
|
-
import { a as getAllLayers, g as getLayerOrTable } from './mapViewUtils.js';
|
9
|
+
import { a as getAllLayers, e as getFeatureLayerView, h as highlightFeatures, g as getLayerOrTable } from './mapViewUtils.js';
|
10
10
|
import { q as queryFeaturesByID } from './queryUtils.js';
|
11
11
|
import { d as defineCustomElement$w } from './action.js';
|
12
12
|
import { d as defineCustomElement$v } from './action-menu.js';
|
@@ -335,6 +335,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
335
335
|
backFromSelectedPanel() {
|
336
336
|
const updatedFlowItems = [...this._flowItems];
|
337
337
|
updatedFlowItems.pop();
|
338
|
+
this.clearHighlights();
|
338
339
|
//Back to layer list, and return as the flowItems will be reset in navigateToHomePage
|
339
340
|
if (updatedFlowItems.length === 1) {
|
340
341
|
this.navigateToHomePage();
|
@@ -367,14 +368,14 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
367
368
|
*/
|
368
369
|
getFeatureListFlowItem(layerId, layerName) {
|
369
370
|
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
|
370
|
-
h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full",
|
371
|
+
h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, selectedLayerId: layerId }))));
|
371
372
|
}
|
372
373
|
/**
|
373
374
|
* Returns the calcite-flow item for feature details
|
374
375
|
* @returns Node
|
375
376
|
*/
|
376
377
|
getFeatureDetailsFlowItem() {
|
377
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), h("calcite-panel", { "full-height": true }, h("info-card", { allowEditing: false, graphics: this._selectedFeature, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: this.featureDetailsChanged.bind(this), zoomAndScrollToSelected: true }))));
|
378
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), h("calcite-panel", { "full-height": true }, h("info-card", { allowEditing: false, graphics: this._selectedFeature, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: this.featureDetailsChanged.bind(this), zoomAndScrollToSelected: true }))));
|
378
379
|
}
|
379
380
|
/**
|
380
381
|
* Sets the selected features and updates the first feature as the current selected feature
|
@@ -406,6 +407,30 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
406
407
|
*/
|
407
408
|
featureDetailsChanged(evt) {
|
408
409
|
this.setCurrentFeature(evt.detail[0]);
|
410
|
+
void this.highlightOnMap(evt.detail[0]);
|
411
|
+
}
|
412
|
+
/**
|
413
|
+
* Highlights the feature on map
|
414
|
+
* @param selectedFeature Graphic currently shown in feature details
|
415
|
+
*/
|
416
|
+
async highlightOnMap(selectedFeature) {
|
417
|
+
// if a feature is already highlighted, remove the previous highlight
|
418
|
+
this.clearHighlights();
|
419
|
+
// highlight the newly selected feature only when it has valid geometry
|
420
|
+
if (selectedFeature && selectedFeature.geometry && selectedFeature.layer) {
|
421
|
+
const selectedLayerView = await getFeatureLayerView(this.mapView, selectedFeature.layer.id);
|
422
|
+
this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true);
|
423
|
+
}
|
424
|
+
}
|
425
|
+
/**
|
426
|
+
* Clears the highlight
|
427
|
+
* @protected
|
428
|
+
*/
|
429
|
+
clearHighlights() {
|
430
|
+
//if a feature is already highlighted, then remove the highlight
|
431
|
+
if (this._highlightHandle) {
|
432
|
+
this._highlightHandle.remove();
|
433
|
+
}
|
409
434
|
}
|
410
435
|
/**
|
411
436
|
* Returns the action button to Expand/Collapse side panel in mobile mode
|
@@ -473,6 +498,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
473
498
|
}
|
474
499
|
else {
|
475
500
|
this._flowItems = [...this._flowItems];
|
501
|
+
void this.highlightOnMap(clickedGraphics[0]);
|
476
502
|
}
|
477
503
|
}
|
478
504
|
}
|
@@ -38,6 +38,7 @@ const InfoCard = /*@__PURE__*/ proxyCustomElement(class InfoCard extends HTMLEle
|
|
38
38
|
this.mapView = undefined;
|
39
39
|
this.zoomAndScrollToSelected = undefined;
|
40
40
|
this.allowEditing = true;
|
41
|
+
this.highlightEnabled = true;
|
41
42
|
this._alertOpen = false;
|
42
43
|
this._count = "";
|
43
44
|
this._editRecordOpen = false;
|
@@ -214,6 +215,7 @@ const InfoCard = /*@__PURE__*/ proxyCustomElement(class InfoCard extends HTMLEle
|
|
214
215
|
heading: !this.isMobile
|
215
216
|
}
|
216
217
|
});
|
218
|
+
this._features.viewModel.highlightEnabled = this.highlightEnabled;
|
217
219
|
this.reactiveUtils.watch(() => this._features.viewModel.featureMenuOpen, (isOpen) => {
|
218
220
|
if (!isOpen) {
|
219
221
|
this._showListView = isOpen;
|
@@ -331,6 +333,7 @@ const InfoCard = /*@__PURE__*/ proxyCustomElement(class InfoCard extends HTMLEle
|
|
331
333
|
"mapView": [16],
|
332
334
|
"zoomAndScrollToSelected": [4, "zoom-and-scroll-to-selected"],
|
333
335
|
"allowEditing": [4, "allow-editing"],
|
336
|
+
"highlightEnabled": [4, "highlight-enabled"],
|
334
337
|
"_alertOpen": [32],
|
335
338
|
"_count": [32],
|
336
339
|
"_editRecordOpen": [32],
|
@@ -186,6 +186,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
186
186
|
this._initToolInfos();
|
187
187
|
}
|
188
188
|
this._initLayerExpressions();
|
189
|
+
this._resetColumnTemplates();
|
189
190
|
}
|
190
191
|
/**
|
191
192
|
* watch for changes in map view and get the first layer
|
@@ -205,10 +206,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
205
206
|
* watch for changes in layer view and verify if it has editing enabled
|
206
207
|
*/
|
207
208
|
async _layerWatchHandler() {
|
208
|
-
var _a, _b;
|
209
|
+
var _a, _b, _c;
|
209
210
|
this._fetchingData = true;
|
210
|
-
this._definitionExpression = this._layer.definitionExpression;
|
211
|
-
this._floorField = (
|
211
|
+
this._definitionExpression = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.definitionExpression;
|
212
|
+
this._floorField = (_c = (_b = this._layer) === null || _b === void 0 ? void 0 : _b.floorInfo) === null || _c === void 0 ? void 0 : _c.floorField;
|
212
213
|
this._updateFloorDefinitionExpression();
|
213
214
|
await this._resetTable();
|
214
215
|
this._updateShareUrl();
|
@@ -346,12 +347,14 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
346
347
|
* @protected
|
347
348
|
*/
|
348
349
|
async _initModules() {
|
349
|
-
const [FeatureTable, reactiveUtils] = await loadModules([
|
350
|
+
const [FeatureTable, reactiveUtils, TableTemplate] = await loadModules([
|
350
351
|
"esri/widgets/FeatureTable",
|
351
|
-
"esri/core/reactiveUtils"
|
352
|
+
"esri/core/reactiveUtils",
|
353
|
+
"esri/widgets/FeatureTable/support/TableTemplate"
|
352
354
|
]);
|
353
355
|
this.FeatureTable = FeatureTable;
|
354
356
|
this.reactiveUtils = reactiveUtils;
|
357
|
+
this.TableTemplate = TableTemplate;
|
355
358
|
}
|
356
359
|
/**
|
357
360
|
* Update the toolbar when its size changes
|
@@ -988,6 +991,20 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
988
991
|
}
|
989
992
|
this.featureSelectionChange.emit(this.selectedIds);
|
990
993
|
}
|
994
|
+
/**
|
995
|
+
* Reset the tables column templates when we get new column config
|
996
|
+
*/
|
997
|
+
_resetColumnTemplates() {
|
998
|
+
var _a, _b;
|
999
|
+
const columnTemplates = this._getColumnTemplates((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id, (_b = this._layer) === null || _b === void 0 ? void 0 : _b.fields);
|
1000
|
+
if (this._table && columnTemplates) {
|
1001
|
+
this._table.tableTemplate = new this.TableTemplate({
|
1002
|
+
columnTemplates
|
1003
|
+
});
|
1004
|
+
const fieldNames = columnTemplates.map(f => f.fieldName);
|
1005
|
+
this._initColumnsInfo(fieldNames);
|
1006
|
+
}
|
1007
|
+
}
|
991
1008
|
/**
|
992
1009
|
* Reset basic table props
|
993
1010
|
*/
|
@@ -1038,12 +1055,28 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1038
1055
|
}
|
1039
1056
|
/**
|
1040
1057
|
* Store the column names and current hidden status to support show/hide of columns
|
1058
|
+
* @param fieldNames optional list of names from new config options
|
1041
1059
|
*/
|
1042
|
-
_initColumnsInfo() {
|
1043
|
-
|
1044
|
-
|
1060
|
+
_initColumnsInfo(fieldNames) {
|
1061
|
+
var _a, _b;
|
1062
|
+
// this._table.columns is not reflecting correct list when new
|
1063
|
+
// tableTemplate.columnTemplates have been defined on an existing FeatureTable
|
1064
|
+
// TODO review for better solution post 2024 R01 release
|
1065
|
+
const columnsInfo = (_a = this._table) === null || _a === void 0 ? void 0 : _a.columns.reduce((prev, cur) => {
|
1066
|
+
if (!fieldNames || ((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.indexOf(cur.name)) > -1)) {
|
1067
|
+
prev[cur.name] = !cur.hidden;
|
1068
|
+
}
|
1045
1069
|
return prev;
|
1046
1070
|
}, {});
|
1071
|
+
const oldColumnNames = (_b = this._table) === null || _b === void 0 ? void 0 : _b.columns.map((c) => c.name);
|
1072
|
+
const newColumnNames = fieldNames ? fieldNames.filter(n => oldColumnNames.indexOf(n) < 0) : [];
|
1073
|
+
newColumnNames.forEach(c => {
|
1074
|
+
columnsInfo[c] = true;
|
1075
|
+
});
|
1076
|
+
this._columnsInfo = fieldNames ? fieldNames.reduce((prev, cur) => {
|
1077
|
+
prev[cur] = columnsInfo[cur];
|
1078
|
+
return prev;
|
1079
|
+
}, {}) : columnsInfo;
|
1047
1080
|
}
|
1048
1081
|
/**
|
1049
1082
|
* Select the feature that was specified via url params
|
@@ -30,7 +30,7 @@ import { d as defineCustomElement$3 } from './map-picker2.js';
|
|
30
30
|
import { d as defineCustomElement$2 } from './map-search2.js';
|
31
31
|
import { d as defineCustomElement$1 } from './map-tools2.js';
|
32
32
|
|
33
|
-
const mapCardCss = ":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.box-shadow{box-shadow:none !important}.visibility-hidden{visibility:hidden}.display-none{display:none}";
|
33
|
+
const mapCardCss = ":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.box-shadow{box-shadow:none !important}.visibility-hidden-1{visibility:hidden;height:1px;}.display-none{display:none}";
|
34
34
|
|
35
35
|
const MapCard = /*@__PURE__*/ proxyCustomElement(class MapCard extends HTMLElement {
|
36
36
|
constructor() {
|
@@ -103,7 +103,7 @@ const MapCard = /*@__PURE__*/ proxyCustomElement(class MapCard extends HTMLEleme
|
|
103
103
|
*/
|
104
104
|
render() {
|
105
105
|
var _a, _b;
|
106
|
-
const mapClass = this.hidden ? "visibility-hidden" : "";
|
106
|
+
const mapClass = this.hidden ? "visibility-hidden-1" : "";
|
107
107
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
108
108
|
const mapPickerClass = ((_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.length) > 1 ? "" : "display-none";
|
109
109
|
const mapHeightClass = ((_b = this.mapInfos) === null || _b === void 0 ? void 0 : _b.length) > 1 ? "map-height" : "height-full";
|
@@ -161,6 +161,8 @@ async function getAllLayers(mapView) {
|
|
161
161
|
async function highlightFeatures(ids, layerView, mapView, updateExtent = false) {
|
162
162
|
if (updateExtent) {
|
163
163
|
await goToSelection(ids, layerView, mapView, false);
|
164
|
+
//wait for sometime to load the feature in layerView then only the highlight will work
|
165
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
164
166
|
}
|
165
167
|
return layerView.highlight(ids);
|
166
168
|
}
|
@@ -12,7 +12,7 @@ import { o as onToggleOpenCloseComponent } from './openCloseComponent-9f90f493.j
|
|
12
12
|
import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as updateMessages } from './t9n-436fb2b1.js';
|
13
13
|
import { K as KindIcons } from './resources-88a48c5c.js';
|
14
14
|
import { g as getLocaleComponentStrings, l as loadModules } from './locale-25a5ae3e.js';
|
15
|
-
import { a as getAllLayers } from './mapViewUtils-
|
15
|
+
import { a as getAllLayers } from './mapViewUtils-257bc9b3.js';
|
16
16
|
import { P as PopupUtils } from './popupUtils-23fe3c9f.js';
|
17
17
|
import './guid-b75a5f7b.js';
|
18
18
|
import './resources-8834f920.js';
|
@@ -677,6 +677,7 @@ const InfoCard = class {
|
|
677
677
|
this.mapView = undefined;
|
678
678
|
this.zoomAndScrollToSelected = undefined;
|
679
679
|
this.allowEditing = true;
|
680
|
+
this.highlightEnabled = true;
|
680
681
|
this._alertOpen = false;
|
681
682
|
this._count = "";
|
682
683
|
this._editRecordOpen = false;
|
@@ -853,6 +854,7 @@ const InfoCard = class {
|
|
853
854
|
heading: !this.isMobile
|
854
855
|
}
|
855
856
|
});
|
857
|
+
this._features.viewModel.highlightEnabled = this.highlightEnabled;
|
856
858
|
this.reactiveUtils.watch(() => this._features.viewModel.featureMenuOpen, (isOpen) => {
|
857
859
|
if (!isOpen) {
|
858
860
|
this._showListView = isOpen;
|
@@ -22,7 +22,7 @@ import { V as Validation } from './Validation-ea480265.js';
|
|
22
22
|
import { d as debounce } from './debounce-229b1a22.js';
|
23
23
|
import { i as isActivationKey } from './key-c83d835f.js';
|
24
24
|
import { g as getLocaleComponentStrings } from './locale-25a5ae3e.js';
|
25
|
-
import { d as getMapLayerHash, o as getMapTableHash } from './mapViewUtils-
|
25
|
+
import { d as getMapLayerHash, o as getMapTableHash } from './mapViewUtils-257bc9b3.js';
|
26
26
|
import { s as state } from './publicNotificationStore-3bf4de75.js';
|
27
27
|
import './resources-8834f920.js';
|
28
28
|
import './browser-d60104bd.js';
|
@@ -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-25a5ae3e.js';
|
15
|
-
import { a as getAllLayers, g as getLayerOrTable,
|
15
|
+
import { a as getAllLayers, g as getLayerOrTable, b as getFeatureLayerView, h as highlightFeatures, d as getMapLayerHash } from './mapViewUtils-257bc9b3.js';
|
16
16
|
import { P as PopupUtils } from './popupUtils-23fe3c9f.js';
|
17
17
|
import './guid-b75a5f7b.js';
|
18
18
|
import './resources-8834f920.js';
|