@esri/solutions-components 0.7.36 → 0.7.37
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-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 +38 -7
- package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
- 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-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 +36 -5
- package/dist/collection/utils/mapViewUtils.js +2 -0
- package/dist/collection/utils/mapViewUtils.ts +2 -0
- package/dist/components/crowdsource-reporter.js +29 -3
- package/dist/components/info-card2.js +3 -0
- package/dist/components/layer-table2.js +36 -5
- 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 +38 -7
- package/dist/esm/crowdsource-manager.entry.js +1 -1
- 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-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-3c5cae90.entry.js → p-7fec7066.entry.js} +1 -1
- package/dist/solutions-components/p-9161dca9.entry.js +6 -0
- package/dist/solutions-components/p-96f5be25.js +36 -0
- package/dist/solutions-components/p-d503e883.entry.js +6 -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-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-6d0203ed.entry.js +0 -6
- package/dist/solutions-components/p-922f2467.entry.js +0 -6
@@ -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
|
@@ -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,18 @@ 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
|
+
this._table.tableTemplate = new this.TableTemplate({
|
972
|
+
columnTemplates
|
973
|
+
});
|
974
|
+
const fieldNames = columnTemplates.map(f => f.fieldName);
|
975
|
+
this._initColumnsInfo(fieldNames);
|
976
|
+
}
|
962
977
|
/**
|
963
978
|
* Reset basic table props
|
964
979
|
*/
|
@@ -1009,12 +1024,28 @@ export class LayerTable {
|
|
1009
1024
|
}
|
1010
1025
|
/**
|
1011
1026
|
* Store the column names and current hidden status to support show/hide of columns
|
1027
|
+
* @param fieldNames optional list of names from new config options
|
1012
1028
|
*/
|
1013
|
-
_initColumnsInfo() {
|
1014
|
-
|
1015
|
-
|
1029
|
+
_initColumnsInfo(fieldNames) {
|
1030
|
+
var _a, _b;
|
1031
|
+
// this._table.columns is not reflecting correct list when new
|
1032
|
+
// tableTemplate.columnTemplates have been defined on an existing FeatureTable
|
1033
|
+
// TODO review for better solution post 2024 R01 release
|
1034
|
+
const columnsInfo = (_a = this._table) === null || _a === void 0 ? void 0 : _a.columns.reduce((prev, cur) => {
|
1035
|
+
if (!fieldNames || ((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.indexOf(cur.name)) > -1)) {
|
1036
|
+
prev[cur.name] = !cur.hidden;
|
1037
|
+
}
|
1016
1038
|
return prev;
|
1017
1039
|
}, {});
|
1040
|
+
const oldColumnNames = (_b = this._table) === null || _b === void 0 ? void 0 : _b.columns.map((c) => c.name);
|
1041
|
+
const newColumnNames = fieldNames ? fieldNames.filter(n => oldColumnNames.indexOf(n) < 0) : [];
|
1042
|
+
newColumnNames.forEach(c => {
|
1043
|
+
columnsInfo[c] = true;
|
1044
|
+
});
|
1045
|
+
this._columnsInfo = fieldNames ? fieldNames.reduce((prev, cur) => {
|
1046
|
+
prev[cur] = columnsInfo[cur];
|
1047
|
+
return prev;
|
1048
|
+
}, {}) : columnsInfo;
|
1018
1049
|
}
|
1019
1050
|
/**
|
1020
1051
|
* Select the feature that was specified via url params
|
@@ -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
|
}
|
@@ -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
|
@@ -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,18 @@ 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
|
+
this._table.tableTemplate = new this.TableTemplate({
|
1001
|
+
columnTemplates
|
1002
|
+
});
|
1003
|
+
const fieldNames = columnTemplates.map(f => f.fieldName);
|
1004
|
+
this._initColumnsInfo(fieldNames);
|
1005
|
+
}
|
991
1006
|
/**
|
992
1007
|
* Reset basic table props
|
993
1008
|
*/
|
@@ -1038,12 +1053,28 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1038
1053
|
}
|
1039
1054
|
/**
|
1040
1055
|
* Store the column names and current hidden status to support show/hide of columns
|
1056
|
+
* @param fieldNames optional list of names from new config options
|
1041
1057
|
*/
|
1042
|
-
_initColumnsInfo() {
|
1043
|
-
|
1044
|
-
|
1058
|
+
_initColumnsInfo(fieldNames) {
|
1059
|
+
var _a, _b;
|
1060
|
+
// this._table.columns is not reflecting correct list when new
|
1061
|
+
// tableTemplate.columnTemplates have been defined on an existing FeatureTable
|
1062
|
+
// TODO review for better solution post 2024 R01 release
|
1063
|
+
const columnsInfo = (_a = this._table) === null || _a === void 0 ? void 0 : _a.columns.reduce((prev, cur) => {
|
1064
|
+
if (!fieldNames || ((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.indexOf(cur.name)) > -1)) {
|
1065
|
+
prev[cur.name] = !cur.hidden;
|
1066
|
+
}
|
1045
1067
|
return prev;
|
1046
1068
|
}, {});
|
1069
|
+
const oldColumnNames = (_b = this._table) === null || _b === void 0 ? void 0 : _b.columns.map((c) => c.name);
|
1070
|
+
const newColumnNames = fieldNames ? fieldNames.filter(n => oldColumnNames.indexOf(n) < 0) : [];
|
1071
|
+
newColumnNames.forEach(c => {
|
1072
|
+
columnsInfo[c] = true;
|
1073
|
+
});
|
1074
|
+
this._columnsInfo = fieldNames ? fieldNames.reduce((prev, cur) => {
|
1075
|
+
prev[cur] = columnsInfo[cur];
|
1076
|
+
return prev;
|
1077
|
+
}, {}) : columnsInfo;
|
1047
1078
|
}
|
1048
1079
|
/**
|
1049
1080
|
* Select the feature that was specified via url params
|
@@ -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';
|
@@ -5,8 +5,8 @@
|
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-164d485a.js';
|
7
7
|
import { g as getLocaleComponentStrings, l as loadModules } from './locale-25a5ae3e.js';
|
8
|
-
import { q as queryFeaturesByID, g as getLayerOrTable,
|
9
|
-
import { d as downloadCSV } from './downloadUtils-
|
8
|
+
import { q as queryFeaturesByID, g as getLayerOrTable, c as goToSelection, e as queryAllIds, f as queryFeatureIds, i as queryFeaturesByGlobalID } from './mapViewUtils-257bc9b3.js';
|
9
|
+
import { d as downloadCSV } from './downloadUtils-985dcd1c.js';
|
10
10
|
import './esri-loader-eda07632.js';
|
11
11
|
import './_commonjsHelpers-d5f9d613.js';
|
12
12
|
import './interfaces-586e863c.js';
|
@@ -238,6 +238,7 @@ const LayerTable = class {
|
|
238
238
|
this._initToolInfos();
|
239
239
|
}
|
240
240
|
this._initLayerExpressions();
|
241
|
+
this._resetColumnTemplates();
|
241
242
|
}
|
242
243
|
/**
|
243
244
|
* watch for changes in map view and get the first layer
|
@@ -398,12 +399,14 @@ const LayerTable = class {
|
|
398
399
|
* @protected
|
399
400
|
*/
|
400
401
|
async _initModules() {
|
401
|
-
const [FeatureTable, reactiveUtils] = await loadModules([
|
402
|
+
const [FeatureTable, reactiveUtils, TableTemplate] = await loadModules([
|
402
403
|
"esri/widgets/FeatureTable",
|
403
|
-
"esri/core/reactiveUtils"
|
404
|
+
"esri/core/reactiveUtils",
|
405
|
+
"esri/widgets/FeatureTable/support/TableTemplate"
|
404
406
|
]);
|
405
407
|
this.FeatureTable = FeatureTable;
|
406
408
|
this.reactiveUtils = reactiveUtils;
|
409
|
+
this.TableTemplate = TableTemplate;
|
407
410
|
}
|
408
411
|
/**
|
409
412
|
* Update the toolbar when its size changes
|
@@ -1040,6 +1043,18 @@ const LayerTable = class {
|
|
1040
1043
|
}
|
1041
1044
|
this.featureSelectionChange.emit(this.selectedIds);
|
1042
1045
|
}
|
1046
|
+
/**
|
1047
|
+
* Reset the tables column templates when we get new column config
|
1048
|
+
*/
|
1049
|
+
_resetColumnTemplates() {
|
1050
|
+
var _a, _b;
|
1051
|
+
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);
|
1052
|
+
this._table.tableTemplate = new this.TableTemplate({
|
1053
|
+
columnTemplates
|
1054
|
+
});
|
1055
|
+
const fieldNames = columnTemplates.map(f => f.fieldName);
|
1056
|
+
this._initColumnsInfo(fieldNames);
|
1057
|
+
}
|
1043
1058
|
/**
|
1044
1059
|
* Reset basic table props
|
1045
1060
|
*/
|
@@ -1090,12 +1105,28 @@ const LayerTable = class {
|
|
1090
1105
|
}
|
1091
1106
|
/**
|
1092
1107
|
* Store the column names and current hidden status to support show/hide of columns
|
1108
|
+
* @param fieldNames optional list of names from new config options
|
1093
1109
|
*/
|
1094
|
-
_initColumnsInfo() {
|
1095
|
-
|
1096
|
-
|
1110
|
+
_initColumnsInfo(fieldNames) {
|
1111
|
+
var _a, _b;
|
1112
|
+
// this._table.columns is not reflecting correct list when new
|
1113
|
+
// tableTemplate.columnTemplates have been defined on an existing FeatureTable
|
1114
|
+
// TODO review for better solution post 2024 R01 release
|
1115
|
+
const columnsInfo = (_a = this._table) === null || _a === void 0 ? void 0 : _a.columns.reduce((prev, cur) => {
|
1116
|
+
if (!fieldNames || ((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.indexOf(cur.name)) > -1)) {
|
1117
|
+
prev[cur.name] = !cur.hidden;
|
1118
|
+
}
|
1097
1119
|
return prev;
|
1098
1120
|
}, {});
|
1121
|
+
const oldColumnNames = (_b = this._table) === null || _b === void 0 ? void 0 : _b.columns.map((c) => c.name);
|
1122
|
+
const newColumnNames = fieldNames ? fieldNames.filter(n => oldColumnNames.indexOf(n) < 0) : [];
|
1123
|
+
newColumnNames.forEach(c => {
|
1124
|
+
columnsInfo[c] = true;
|
1125
|
+
});
|
1126
|
+
this._columnsInfo = fieldNames ? fieldNames.reduce((prev, cur) => {
|
1127
|
+
prev[cur] = columnsInfo[cur];
|
1128
|
+
return prev;
|
1129
|
+
}, {}) : columnsInfo;
|
1099
1130
|
}
|
1100
1131
|
/**
|
1101
1132
|
* Select the feature that was specified via url params
|
@@ -6,7 +6,7 @@
|
|
6
6
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-164d485a.js';
|
7
7
|
import { g as getLocaleComponentStrings } from './locale-25a5ae3e.js';
|
8
8
|
import { E as ELayoutMode } from './interfaces-586e863c.js';
|
9
|
-
import { g as getLayerOrTable } from './mapViewUtils-
|
9
|
+
import { g as getLayerOrTable } from './mapViewUtils-257bc9b3.js';
|
10
10
|
import './esri-loader-eda07632.js';
|
11
11
|
import './_commonjsHelpers-d5f9d613.js';
|
12
12
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-164d485a.js';
|
7
7
|
import { l as loadModules, g as getLocaleComponentStrings } from './locale-25a5ae3e.js';
|
8
|
-
import { a as getAllLayers, g as getLayerOrTable, q as queryFeaturesByID } from './mapViewUtils-
|
8
|
+
import { a as getAllLayers, b as getFeatureLayerView, h as highlightFeatures, g as getLayerOrTable, q as queryFeaturesByID } from './mapViewUtils-257bc9b3.js';
|
9
9
|
import './esri-loader-eda07632.js';
|
10
10
|
import './_commonjsHelpers-d5f9d613.js';
|
11
11
|
import './interfaces-586e863c.js';
|
@@ -304,6 +304,7 @@ const CrowdsourceReporter = class {
|
|
304
304
|
backFromSelectedPanel() {
|
305
305
|
const updatedFlowItems = [...this._flowItems];
|
306
306
|
updatedFlowItems.pop();
|
307
|
+
this.clearHighlights();
|
307
308
|
//Back to layer list, and return as the flowItems will be reset in navigateToHomePage
|
308
309
|
if (updatedFlowItems.length === 1) {
|
309
310
|
this.navigateToHomePage();
|
@@ -336,14 +337,14 @@ const CrowdsourceReporter = class {
|
|
336
337
|
*/
|
337
338
|
getFeatureListFlowItem(layerId, layerName) {
|
338
339
|
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
|
339
|
-
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",
|
340
|
+
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 }))));
|
340
341
|
}
|
341
342
|
/**
|
342
343
|
* Returns the calcite-flow item for feature details
|
343
344
|
* @returns Node
|
344
345
|
*/
|
345
346
|
getFeatureDetailsFlowItem() {
|
346
|
-
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 }))));
|
347
|
+
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 }))));
|
347
348
|
}
|
348
349
|
/**
|
349
350
|
* Sets the selected features and updates the first feature as the current selected feature
|
@@ -375,6 +376,30 @@ const CrowdsourceReporter = class {
|
|
375
376
|
*/
|
376
377
|
featureDetailsChanged(evt) {
|
377
378
|
this.setCurrentFeature(evt.detail[0]);
|
379
|
+
void this.highlightOnMap(evt.detail[0]);
|
380
|
+
}
|
381
|
+
/**
|
382
|
+
* Highlights the feature on map
|
383
|
+
* @param selectedFeature Graphic currently shown in feature details
|
384
|
+
*/
|
385
|
+
async highlightOnMap(selectedFeature) {
|
386
|
+
// if a feature is already highlighted, remove the previous highlight
|
387
|
+
this.clearHighlights();
|
388
|
+
// highlight the newly selected feature only when it has valid geometry
|
389
|
+
if (selectedFeature && selectedFeature.geometry && selectedFeature.layer) {
|
390
|
+
const selectedLayerView = await getFeatureLayerView(this.mapView, selectedFeature.layer.id);
|
391
|
+
this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true);
|
392
|
+
}
|
393
|
+
}
|
394
|
+
/**
|
395
|
+
* Clears the highlight
|
396
|
+
* @protected
|
397
|
+
*/
|
398
|
+
clearHighlights() {
|
399
|
+
//if a feature is already highlighted, then remove the highlight
|
400
|
+
if (this._highlightHandle) {
|
401
|
+
this._highlightHandle.remove();
|
402
|
+
}
|
378
403
|
}
|
379
404
|
/**
|
380
405
|
* Returns the action button to Expand/Collapse side panel in mobile mode
|
@@ -442,6 +467,7 @@ const CrowdsourceReporter = class {
|
|
442
467
|
}
|
443
468
|
else {
|
444
469
|
this._flowItems = [...this._flowItems];
|
470
|
+
void this.highlightOnMap(clickedGraphics[0]);
|
445
471
|
}
|
446
472
|
}
|
447
473
|
}
|