@esri/solutions-components 0.7.49 → 0.7.51

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +30 -26
  2. package/dist/cjs/card-manager_3.cjs.entry.js +72 -42
  3. package/dist/cjs/crowdsource-manager.cjs.entry.js +31 -45
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/solutions-components.cjs.js +1 -1
  6. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +31 -73
  7. package/dist/collection/components/floor-filter/floor-filter.js +30 -26
  8. package/dist/collection/components/layer-table/layer-table.js +76 -63
  9. package/dist/components/crowdsource-manager.js +31 -51
  10. package/dist/components/floor-filter2.js +30 -26
  11. package/dist/components/layer-table2.js +74 -43
  12. package/dist/esm/basemap-gallery_7.entry.js +30 -26
  13. package/dist/esm/card-manager_3.entry.js +72 -42
  14. package/dist/esm/crowdsource-manager.entry.js +31 -45
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/solutions-components.js +1 -1
  17. package/dist/solutions-components/p-697e9e11.entry.js +6 -0
  18. package/dist/solutions-components/p-7cfc4ba5.entry.js +6 -0
  19. package/dist/solutions-components/p-b4d2feb0.entry.js +6 -0
  20. package/dist/solutions-components/solutions-components.esm.js +1 -1
  21. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +6 -41
  22. package/dist/types/components/floor-filter/floor-filter.d.ts +1 -1
  23. package/dist/types/components/layer-table/layer-table.d.ts +25 -5
  24. package/dist/types/components.d.ts +0 -18
  25. package/package.json +1 -1
  26. package/dist/solutions-components/p-6a83b842.entry.js +0 -6
  27. package/dist/solutions-components/p-6d9f6b6a.entry.js +0 -6
  28. package/dist/solutions-components/p-766c0b57.entry.js +0 -6
@@ -24,13 +24,27 @@ import { ELayoutMode } from "../../utils/interfaces";
24
24
  import { getLayerOrTable } from "../../utils/mapViewUtils";
25
25
  export class CrowdsourceManager {
26
26
  constructor() {
27
+ //--------------------------------------------------------------------------
28
+ //
29
+ // Properties (protected)
30
+ //
31
+ //--------------------------------------------------------------------------
32
+ /**
33
+ * boolean: When true the map view will be set after render due to popup obstructing the view
34
+ * MapView.when is not fired when mapView is not currently visible
35
+ */
36
+ this._defaultCenterHonored = false;
37
+ /**
38
+ * boolean: When true the map view will be set after render due to popup obstructing the view
39
+ * MapView.when is not fired when mapView is not currently visible
40
+ */
41
+ this._defaultLevelHonored = false;
27
42
  /**
28
43
  * boolean: When true the map view will be set after render due to popup obstructing the view
29
44
  * MapView.when is not fired when mapView is not currently visible
30
45
  */
31
46
  this._shouldSetMapView = false;
32
47
  this.defaultCenter = "";
33
- this.defaultFilter = "";
34
48
  this.defaultGlobalId = "";
35
49
  this.defaultLayer = "";
36
50
  this.defaultLevel = "";
@@ -75,39 +89,6 @@ export class CrowdsourceManager {
75
89
  // Watch handlers
76
90
  //
77
91
  //--------------------------------------------------------------------------
78
- /**
79
- * Watch for center url param to be set
80
- */
81
- defaultCenterWatchHandler() {
82
- this._defaultCenter = !this.defaultCenter ? undefined :
83
- this.defaultCenter.split(";").map(v => parseFloat(v));
84
- }
85
- /**
86
- * Watch for filter url param to be set
87
- */
88
- defaultFilterWatchHandler() {
89
- this._defaultFilter = JSON.parse(this.defaultFilter);
90
- }
91
- /**
92
- * Watch for globalid url param to be set
93
- */
94
- defaultGlobalIdWatchHandler() {
95
- this._defaultGlobalId = !this.defaultGlobalId ? undefined :
96
- this.defaultGlobalId.indexOf(",") > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
97
- }
98
- /**
99
- * Watch for oid url param to be set
100
- */
101
- defaultOidWatchHandler() {
102
- this._defaultOid = !this.defaultOid ? undefined :
103
- this.defaultOid.indexOf(",") > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
104
- }
105
- /**
106
- * Watch for zoom level param to be set
107
- */
108
- defaultLevelWatchHandler() {
109
- this._defaultLevel = !this.defaultLevel ? undefined : parseInt(this.defaultLevel, 10);
110
- }
111
92
  /**
112
93
  * When true the map zoom tools will be available
113
94
  */
@@ -399,6 +380,7 @@ export class CrowdsourceManager {
399
380
  * @protected
400
381
  */
401
382
  _getTable(layoutMode, panelOpen, hideTable) {
383
+ var _a, _b;
402
384
  const tableClass = hideTable && this._isMobile ? "visibility-hidden" : "";
403
385
  const tableSizeClass = this._getTableSizeClass(layoutMode, panelOpen);
404
386
  const icon = this._getDividerIcon(layoutMode, panelOpen);
@@ -407,7 +389,11 @@ export class CrowdsourceManager {
407
389
  const toggleLayout = layoutMode === ELayoutMode.HORIZONTAL ? "horizontal" : "vertical";
408
390
  const toggleSlot = layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
409
391
  const hasMapAndLayer = this.defaultWebmap && this.defaultLayer;
410
- return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultFilter: hasMapAndLayer ? this._defaultFilter : undefined, defaultGlobalId: hasMapAndLayer ? this._defaultGlobalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !this.defaultGlobalId ? this._defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
392
+ const globalId = !this.defaultGlobalId ? undefined :
393
+ ((_a = this.defaultGlobalId) === null || _a === void 0 ? void 0 : _a.indexOf(",")) > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
394
+ const defaultOid = !this.defaultOid ? undefined :
395
+ ((_b = this.defaultOid) === null || _b === void 0 ? void 0 : _b.indexOf(",")) > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
396
+ return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
411
397
  }
412
398
  /**
413
399
  * Update the component layout when its size changes
@@ -460,17 +446,22 @@ export class CrowdsourceManager {
460
446
  * @protected
461
447
  */
462
448
  async _setMapView() {
449
+ var _a;
463
450
  this._mapInfo = this._getMapInfo(this._mapChange.id);
464
451
  this._mapView = this._mapChange.mapView;
465
452
  this._initMapZoom();
466
453
  this._mapView.popupEnabled = false;
467
- if (this._defaultCenter && this._defaultLevel) {
454
+ const center = !this.defaultCenter || this._defaultCenterHonored ?
455
+ undefined : (_a = this.defaultCenter) === null || _a === void 0 ? void 0 : _a.split(";").map(v => parseFloat(v));
456
+ const zoom = !this.defaultLevel || this._defaultLevelHonored ?
457
+ undefined : parseInt(this.defaultLevel, 10);
458
+ if (center && zoom) {
468
459
  await this._mapView.goTo({
469
- center: this._defaultCenter,
470
- zoom: this._defaultLevel
460
+ center,
461
+ zoom
471
462
  });
472
- this._defaultCenter = undefined;
473
- this._defaultLevel = undefined;
463
+ this._defaultCenterHonored = true;
464
+ this._defaultLevelHonored = true;
474
465
  }
475
466
  }
476
467
  /**
@@ -531,24 +522,6 @@ export class CrowdsourceManager {
531
522
  "reflect": false,
532
523
  "defaultValue": "\"\""
533
524
  },
534
- "defaultFilter": {
535
- "type": "string",
536
- "mutable": false,
537
- "complexType": {
538
- "original": "string",
539
- "resolved": "string",
540
- "references": {}
541
- },
542
- "required": false,
543
- "optional": false,
544
- "docs": {
545
- "tags": [],
546
- "text": "string: default layer expression to apply to the current layer"
547
- },
548
- "attribute": "default-filter",
549
- "reflect": false,
550
- "defaultValue": "\"\""
551
- },
552
525
  "defaultGlobalId": {
553
526
  "type": "string",
554
527
  "mutable": false,
@@ -1052,21 +1025,6 @@ export class CrowdsourceManager {
1052
1025
  static get elementRef() { return "el"; }
1053
1026
  static get watchers() {
1054
1027
  return [{
1055
- "propName": "defaultCenter",
1056
- "methodName": "defaultCenterWatchHandler"
1057
- }, {
1058
- "propName": "defaultFilter",
1059
- "methodName": "defaultFilterWatchHandler"
1060
- }, {
1061
- "propName": "defaultGlobalId",
1062
- "methodName": "defaultGlobalIdWatchHandler"
1063
- }, {
1064
- "propName": "defaultOid",
1065
- "methodName": "defaultOidWatchHandler"
1066
- }, {
1067
- "propName": "defaultLevel",
1068
- "methodName": "defaultLevelWatchHandler"
1069
- }, {
1070
1028
  "propName": "enableZoom",
1071
1029
  "methodName": "enableZoomWatchHandler"
1072
1030
  }];
@@ -32,8 +32,17 @@ export class FloorFilter {
32
32
  //
33
33
  //--------------------------------------------------------------------------
34
34
  async mapViewWatchHandler() {
35
- await this.mapView.when(() => {
36
- this._initFloorFilter(this.mapView);
35
+ const webMap = this.mapView.map;
36
+ await webMap.when(() => {
37
+ if (this.floorFilterWidget) {
38
+ this.floorFilterWidget.destroy();
39
+ this.floorFilterWidget = undefined;
40
+ }
41
+ if (this._floorFilterElement) {
42
+ this._floorFilterElement.remove();
43
+ this._floorFilterElement = document.createElement("div");
44
+ }
45
+ this._initFloorFilter(this.mapView, webMap);
37
46
  });
38
47
  }
39
48
  //--------------------------------------------------------------------------
@@ -73,30 +82,25 @@ export class FloorFilter {
73
82
  /**
74
83
  * Initialize the floor filter or reset the current view if it already exists
75
84
  */
76
- _initFloorFilter(view) {
77
- var _a, _b, _c, _d;
78
- if (view && this.enabled && this.FloorFilter && ((_a = view === null || view === void 0 ? void 0 : view.map) === null || _a === void 0 ? void 0 : _a.floorInfo)) {
79
- if (!this.floorFilterWidget) {
80
- this.floorFilterWidget = new this.FloorFilter({
81
- container: this._floorFilterElement,
82
- view
83
- });
84
- (_b = this._facilityHandle) === null || _b === void 0 ? void 0 : _b.remove();
85
- this._facilityHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.facility, (facility) => {
86
- this.facilityChanged.emit(facility);
87
- });
88
- (_c = this._levelHandle) === null || _c === void 0 ? void 0 : _c.remove();
89
- this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
90
- this.levelChanged.emit(level);
91
- });
92
- (_d = this._siteHandle) === null || _d === void 0 ? void 0 : _d.remove();
93
- this._siteHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.site, (site) => {
94
- this.siteChanged.emit(site);
95
- });
96
- }
97
- else {
98
- this.floorFilterWidget.viewModel.view = view;
99
- }
85
+ _initFloorFilter(view, webMap) {
86
+ var _a, _b, _c;
87
+ if (view && this.enabled && this.FloorFilter && (webMap === null || webMap === void 0 ? void 0 : webMap.floorInfo)) {
88
+ this.floorFilterWidget = new this.FloorFilter({
89
+ container: this._floorFilterElement,
90
+ view
91
+ });
92
+ (_a = this._facilityHandle) === null || _a === void 0 ? void 0 : _a.remove();
93
+ this._facilityHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.facility, (facility) => {
94
+ this.facilityChanged.emit(facility);
95
+ });
96
+ (_b = this._levelHandle) === null || _b === void 0 ? void 0 : _b.remove();
97
+ this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
98
+ this.levelChanged.emit(level);
99
+ });
100
+ (_c = this._siteHandle) === null || _c === void 0 ? void 0 : _c.remove();
101
+ this._siteHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.site, (site) => {
102
+ this.siteChanged.emit(site);
103
+ });
100
104
  }
101
105
  }
102
106
  static get is() { return "floor-filter"; }
@@ -64,7 +64,6 @@ export class LayerTable {
64
64
  this.onTableNodeCreate = (node) => {
65
65
  this._tableNode = node;
66
66
  };
67
- this.defaultFilter = undefined;
68
67
  this.defaultGlobalId = undefined;
69
68
  this.defaultLayerId = undefined;
70
69
  this.defaultOid = undefined;
@@ -100,6 +99,18 @@ export class LayerTable {
100
99
  // Watch handlers
101
100
  //
102
101
  //--------------------------------------------------------------------------
102
+ /**
103
+ * Handle url defaults when defaultOid is set
104
+ */
105
+ async defaultOidWatchHandler() {
106
+ await this._handleDefaults();
107
+ }
108
+ /**
109
+ * Handle url defaults when defaultGlobalId is set
110
+ */
111
+ async defaultGlobalIdWatchHandler() {
112
+ await this._handleDefaults();
113
+ }
103
114
  /**
104
115
  * Reset the toolInfos when export csv is enabled/disabled
105
116
  */
@@ -787,22 +798,6 @@ export class LayerTable {
787
798
  else {
788
799
  urlObj.searchParams.delete("oid");
789
800
  }
790
- if (this._filterActive) {
791
- const filter = JSON.parse(this._filterList.urlParams.get("filter"));
792
- const layerExpressions = this._filterList.layerExpressions.map(layerExp => {
793
- layerExp.expressions = layerExp.expressions.map(exp => {
794
- if (exp.id.toString() === filter.expressionId.toString()) {
795
- exp.active = true;
796
- }
797
- return exp;
798
- });
799
- return layerExp;
800
- });
801
- urlObj.searchParams.set("filter", JSON.stringify(layerExpressions));
802
- }
803
- else {
804
- urlObj.searchParams.delete("filter");
805
- }
806
801
  this._shareNode.shareUrl = urlObj.href;
807
802
  }
808
803
  /**
@@ -816,7 +811,7 @@ export class LayerTable {
816
811
  * @returns VNode The tooltip node
817
812
  */
818
813
  _getToolTip(placement, referenceElement, text) {
819
- return (h("calcite-tooltip", { placement: placement, "reference-element": referenceElement }, h("span", null, text)));
814
+ return document.getElementById(referenceElement) ? (h("calcite-tooltip", { placement: placement, "reference-element": referenceElement }, h("span", null, text))) : undefined;
820
815
  }
821
816
  /**
822
817
  * Get an id with a prefix to the user supplied value
@@ -979,7 +974,11 @@ export class LayerTable {
979
974
  _resetColumnTemplates() {
980
975
  var _a, _b;
981
976
  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);
982
- if (this._table && columnTemplates) {
977
+ const hasChange = columnTemplates === null || columnTemplates === void 0 ? void 0 : columnTemplates.some((ct, i) => {
978
+ var _a;
979
+ return JSON.stringify((_a = this._table) === null || _a === void 0 ? void 0 : _a.tableTemplate.columnTemplates[i]) !== JSON.stringify(ct);
980
+ });
981
+ if (this._table && columnTemplates && hasChange) {
983
982
  this._table.tableTemplate = new this.TableTemplate({
984
983
  columnTemplates
985
984
  });
@@ -1002,37 +1001,67 @@ export class LayerTable {
1002
1001
  this._table.view = this.mapView;
1003
1002
  this._table.layer = this._layer;
1004
1003
  }
1004
+ await this._initLayerRefresh();
1005
1005
  this._checkEditEnabled();
1006
1006
  this._table.editingEnabled = this._editEnabled && this.enableInlineEdit;
1007
1007
  await this.reactiveUtils.once(() => this._table.state === "loaded")
1008
1008
  .then(async () => {
1009
- var _a, _b, _c;
1010
1009
  this._table.highlightIds.removeAll();
1011
1010
  this._table.clearSelectionFilter();
1012
1011
  this._resetColumnTemplates();
1013
- if (!this._defaultOidHonored && ((_a = this.defaultOid) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.defaultOid[0] > -1) {
1014
- this._selectDefaultFeature(this.defaultOid);
1015
- this._defaultOidHonored = true;
1016
- }
1017
- if (!this._defaultGlobalIdHonored && ((_b = this.defaultGlobalId) === null || _b === void 0 ? void 0 : _b.length) > 0) {
1018
- const features = await queryFeaturesByGlobalID(this.defaultGlobalId, this._layer);
1019
- const oids = (features === null || features === void 0 ? void 0 : features.length) > 0 ? features.map(f => f.getObjectId()) : undefined;
1020
- if (oids) {
1021
- this._selectDefaultFeature(oids);
1022
- }
1023
- this._defaultGlobalIdHonored = true;
1024
- }
1025
- if (!this._defaultFilterHonored && ((_c = this.defaultFilter) === null || _c === void 0 ? void 0 : _c.length) > 0 && this._filterList) {
1026
- this._layerExpressions = this.defaultFilter;
1027
- this._filterActive = true;
1028
- this._defaultFilterHonored = true;
1029
- }
1030
1012
  this._showOnlySelected = false;
1013
+ await this._handleDefaults();
1031
1014
  await this._sortTable();
1032
1015
  this._initToolInfos();
1033
1016
  this._updateToolbar();
1034
1017
  });
1035
1018
  }
1019
+ /**
1020
+ * Update the current IDs when that layers data is modified
1021
+ */
1022
+ async _initLayerRefresh() {
1023
+ if (this._refreshHandle) {
1024
+ this._refreshHandle.remove();
1025
+ }
1026
+ this._refreshHandle = this._layer.on("refresh", (evt) => {
1027
+ if (evt.dataChanged) {
1028
+ this._skipOnChange = true;
1029
+ void this._updateAllIds();
1030
+ }
1031
+ });
1032
+ }
1033
+ /**
1034
+ * Reset _allIds when the layers data has changed and refresh the selection ids and table
1035
+ */
1036
+ async _updateAllIds() {
1037
+ this._allIds = await queryAllIds(this._layer);
1038
+ this.selectedIds = this.selectedIds.filter(id => this._allIds.indexOf(id) > -1);
1039
+ await this._refresh();
1040
+ }
1041
+ /**
1042
+ * Handle default OID or GlobalID from url parameters
1043
+ */
1044
+ async _handleDefaults() {
1045
+ var _a, _b;
1046
+ if (!this._defaultOidHonored && ((_a = this.defaultOid) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.defaultOid[0] > -1 && this._table) {
1047
+ await this._selectDefaultFeature(this.defaultOid);
1048
+ this._defaultOidHonored = true;
1049
+ this.defaultOid = undefined;
1050
+ this._showOnlySelected = false;
1051
+ this._toggleShowSelected();
1052
+ }
1053
+ if (!this._defaultGlobalIdHonored && ((_b = this.defaultGlobalId) === null || _b === void 0 ? void 0 : _b.length) > 0 && this._table) {
1054
+ const features = await queryFeaturesByGlobalID(this.defaultGlobalId, this._layer);
1055
+ const oids = (features === null || features === void 0 ? void 0 : features.length) > 0 ? features.map(f => f.getObjectId()) : undefined;
1056
+ if (oids) {
1057
+ await this._selectDefaultFeature(oids);
1058
+ }
1059
+ this._defaultGlobalIdHonored = true;
1060
+ this.defaultGlobalId = undefined;
1061
+ this._showOnlySelected = false;
1062
+ this._toggleShowSelected();
1063
+ }
1064
+ }
1036
1065
  /**
1037
1066
  * Store the column names and current hidden status to support show/hide of columns
1038
1067
  * @param fieldNames optional list of names from new config options
@@ -1061,13 +1090,12 @@ export class LayerTable {
1061
1090
  /**
1062
1091
  * Select the feature that was specified via url params
1063
1092
  */
1064
- _selectDefaultFeature(oids) {
1093
+ async _selectDefaultFeature(oids) {
1065
1094
  if (oids.length > 0) {
1066
1095
  this._table.highlightIds.addMany(oids);
1067
- void this._table.when(() => {
1068
- const i = this._table.viewModel.getObjectIdIndex(oids[0]);
1069
- this._table.viewModel.scrollToIndex(i);
1070
- });
1096
+ // This is messed up and only make this worse
1097
+ //const i = this._table.viewModel.getObjectIdIndex(oids[0]);
1098
+ //this._table.viewModel.scrollToIndex(i);
1071
1099
  }
1072
1100
  }
1073
1101
  /**
@@ -1454,27 +1482,6 @@ export class LayerTable {
1454
1482
  }
1455
1483
  static get properties() {
1456
1484
  return {
1457
- "defaultFilter": {
1458
- "type": "unknown",
1459
- "mutable": false,
1460
- "complexType": {
1461
- "original": "LayerExpression[]",
1462
- "resolved": "LayerExpression[]",
1463
- "references": {
1464
- "LayerExpression": {
1465
- "location": "import",
1466
- "path": "@esri/instant-apps-components",
1467
- "id": ""
1468
- }
1469
- }
1470
- },
1471
- "required": false,
1472
- "optional": false,
1473
- "docs": {
1474
- "tags": [],
1475
- "text": "LayerExpression[]: default layer expression(s) to apply to the current layer"
1476
- }
1477
- },
1478
1485
  "defaultGlobalId": {
1479
1486
  "type": "unknown",
1480
1487
  "mutable": false,
@@ -1806,6 +1813,12 @@ export class LayerTable {
1806
1813
  static get elementRef() { return "el"; }
1807
1814
  static get watchers() {
1808
1815
  return [{
1816
+ "propName": "defaultOid",
1817
+ "methodName": "defaultOidWatchHandler"
1818
+ }, {
1819
+ "propName": "defaultGlobalId",
1820
+ "methodName": "defaultGlobalIdWatchHandler"
1821
+ }, {
1809
1822
  "propName": "enableCSV",
1810
1823
  "methodName": "enableCSVWatchHandler"
1811
1824
  }, {
@@ -71,13 +71,27 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
71
71
  constructor() {
72
72
  super();
73
73
  this.__registerHost();
74
+ //--------------------------------------------------------------------------
75
+ //
76
+ // Properties (protected)
77
+ //
78
+ //--------------------------------------------------------------------------
79
+ /**
80
+ * boolean: When true the map view will be set after render due to popup obstructing the view
81
+ * MapView.when is not fired when mapView is not currently visible
82
+ */
83
+ this._defaultCenterHonored = false;
84
+ /**
85
+ * boolean: When true the map view will be set after render due to popup obstructing the view
86
+ * MapView.when is not fired when mapView is not currently visible
87
+ */
88
+ this._defaultLevelHonored = false;
74
89
  /**
75
90
  * boolean: When true the map view will be set after render due to popup obstructing the view
76
91
  * MapView.when is not fired when mapView is not currently visible
77
92
  */
78
93
  this._shouldSetMapView = false;
79
94
  this.defaultCenter = "";
80
- this.defaultFilter = "";
81
95
  this.defaultGlobalId = "";
82
96
  this.defaultLayer = "";
83
97
  this.defaultLevel = "";
@@ -122,39 +136,6 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
122
136
  // Watch handlers
123
137
  //
124
138
  //--------------------------------------------------------------------------
125
- /**
126
- * Watch for center url param to be set
127
- */
128
- defaultCenterWatchHandler() {
129
- this._defaultCenter = !this.defaultCenter ? undefined :
130
- this.defaultCenter.split(";").map(v => parseFloat(v));
131
- }
132
- /**
133
- * Watch for filter url param to be set
134
- */
135
- defaultFilterWatchHandler() {
136
- this._defaultFilter = JSON.parse(this.defaultFilter);
137
- }
138
- /**
139
- * Watch for globalid url param to be set
140
- */
141
- defaultGlobalIdWatchHandler() {
142
- this._defaultGlobalId = !this.defaultGlobalId ? undefined :
143
- this.defaultGlobalId.indexOf(",") > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
144
- }
145
- /**
146
- * Watch for oid url param to be set
147
- */
148
- defaultOidWatchHandler() {
149
- this._defaultOid = !this.defaultOid ? undefined :
150
- this.defaultOid.indexOf(",") > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
151
- }
152
- /**
153
- * Watch for zoom level param to be set
154
- */
155
- defaultLevelWatchHandler() {
156
- this._defaultLevel = !this.defaultLevel ? undefined : parseInt(this.defaultLevel, 10);
157
- }
158
139
  /**
159
140
  * When true the map zoom tools will be available
160
141
  */
@@ -446,6 +427,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
446
427
  * @protected
447
428
  */
448
429
  _getTable(layoutMode, panelOpen, hideTable) {
430
+ var _a, _b;
449
431
  const tableClass = hideTable && this._isMobile ? "visibility-hidden" : "";
450
432
  const tableSizeClass = this._getTableSizeClass(layoutMode, panelOpen);
451
433
  const icon = this._getDividerIcon(layoutMode, panelOpen);
@@ -454,7 +436,11 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
454
436
  const toggleLayout = layoutMode === ELayoutMode.HORIZONTAL ? "horizontal" : "vertical";
455
437
  const toggleSlot = layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
456
438
  const hasMapAndLayer = this.defaultWebmap && this.defaultLayer;
457
- return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultFilter: hasMapAndLayer ? this._defaultFilter : undefined, defaultGlobalId: hasMapAndLayer ? this._defaultGlobalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !this.defaultGlobalId ? this._defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
439
+ const globalId = !this.defaultGlobalId ? undefined :
440
+ ((_a = this.defaultGlobalId) === null || _a === void 0 ? void 0 : _a.indexOf(",")) > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
441
+ const defaultOid = !this.defaultOid ? undefined :
442
+ ((_b = this.defaultOid) === null || _b === void 0 ? void 0 : _b.indexOf(",")) > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
443
+ return (h("calcite-shell", { class: `${tableSizeClass} ${tableClass} border-bottom` }, !this._isMobile ? (h("calcite-action-bar", { class: "border-sides", expandDisabled: true, layout: toggleLayout, slot: toggleSlot }, h("calcite-action", { class: "toggle-node", icon: icon, id: id, onClick: () => this._toggleLayout(), text: "" }), h("calcite-tooltip", { label: tooltip, placement: "bottom", "reference-element": id }, h("span", null, tooltip)))) : undefined, h("div", { class: `width-full height-full position-relative` }, h("layer-table", { defaultGlobalId: hasMapAndLayer ? globalId : undefined, defaultLayerId: hasMapAndLayer ? this.defaultLayer : "", defaultOid: hasMapAndLayer && !globalId ? defaultOid : undefined, enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableColumnReorder: this.enableColumnReorder, enableInlineEdit: this.enableInlineEdit, enableShare: this.enableShare, isMobile: this._isMobile, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, ref: (el) => this._layerTable = el, shareIncludeEmbed: this.shareIncludeEmbed, shareIncludeSocial: this.shareIncludeSocial, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
458
444
  }
459
445
  /**
460
446
  * Update the component layout when its size changes
@@ -507,17 +493,22 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
507
493
  * @protected
508
494
  */
509
495
  async _setMapView() {
496
+ var _a;
510
497
  this._mapInfo = this._getMapInfo(this._mapChange.id);
511
498
  this._mapView = this._mapChange.mapView;
512
499
  this._initMapZoom();
513
500
  this._mapView.popupEnabled = false;
514
- if (this._defaultCenter && this._defaultLevel) {
501
+ const center = !this.defaultCenter || this._defaultCenterHonored ?
502
+ undefined : (_a = this.defaultCenter) === null || _a === void 0 ? void 0 : _a.split(";").map(v => parseFloat(v));
503
+ const zoom = !this.defaultLevel || this._defaultLevelHonored ?
504
+ undefined : parseInt(this.defaultLevel, 10);
505
+ if (center && zoom) {
515
506
  await this._mapView.goTo({
516
- center: this._defaultCenter,
517
- zoom: this._defaultLevel
507
+ center,
508
+ zoom
518
509
  });
519
- this._defaultCenter = undefined;
520
- this._defaultLevel = undefined;
510
+ this._defaultCenterHonored = true;
511
+ this._defaultLevelHonored = true;
521
512
  }
522
513
  }
523
514
  /**
@@ -549,17 +540,11 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
549
540
  }
550
541
  get el() { return this; }
551
542
  static get watchers() { return {
552
- "defaultCenter": ["defaultCenterWatchHandler"],
553
- "defaultFilter": ["defaultFilterWatchHandler"],
554
- "defaultGlobalId": ["defaultGlobalIdWatchHandler"],
555
- "defaultOid": ["defaultOidWatchHandler"],
556
- "defaultLevel": ["defaultLevelWatchHandler"],
557
543
  "enableZoom": ["enableZoomWatchHandler"]
558
544
  }; }
559
545
  static get style() { return crowdsourceManagerCss; }
560
546
  }, [0, "crowdsource-manager", {
561
547
  "defaultCenter": [1, "default-center"],
562
- "defaultFilter": [1, "default-filter"],
563
548
  "defaultGlobalId": [1, "default-global-id"],
564
549
  "defaultLayer": [1, "default-layer"],
565
550
  "defaultLevel": [1, "default-level"],
@@ -599,11 +584,6 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
599
584
  "_numSelected": [32],
600
585
  "_tableOnly": [32]
601
586
  }, [[8, "featureSelectionChange", "featureSelectionChange"], [8, "popupClosed", "popupClosed"], [8, "idsFound", "idsFound"], [8, "layoutChanged", "layoutChanged"], [8, "mapChanged", "mapChanged"], [8, "beforeMapChanged", "beforeMapChanged"], [8, "layerSelectionChange", "layerSelectionChange"]], {
602
- "defaultCenter": ["defaultCenterWatchHandler"],
603
- "defaultFilter": ["defaultFilterWatchHandler"],
604
- "defaultGlobalId": ["defaultGlobalIdWatchHandler"],
605
- "defaultOid": ["defaultOidWatchHandler"],
606
- "defaultLevel": ["defaultLevelWatchHandler"],
607
587
  "enableZoom": ["enableZoomWatchHandler"]
608
588
  }]);
609
589
  function defineCustomElement$1() {