@esri/solutions-components 0.7.48 → 0.7.50

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/dist/cjs/calcite-input-date-picker_3.cjs.entry.js +5 -5
  2. package/dist/cjs/card-manager_3.cjs.entry.js +71 -51
  3. package/dist/cjs/crowdsource-manager.cjs.entry.js +18 -45
  4. package/dist/cjs/instant-apps-export.cjs.entry.js +5 -5
  5. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +16 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/solutions-components.cjs.js +1 -1
  8. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +18 -73
  9. package/dist/collection/components/layer-table/layer-table.js +75 -72
  10. package/dist/components/crowdsource-manager.js +18 -51
  11. package/dist/components/instant-apps-export.js +5 -5
  12. package/dist/components/instant-apps-filter-list2.js +3 -3
  13. package/dist/components/instant-apps-interactive-legend-classic2.js +16 -1
  14. package/dist/components/instant-apps-social-share2.js +2 -2
  15. package/dist/components/layer-table2.js +73 -52
  16. package/dist/esm/calcite-input-date-picker_3.entry.js +5 -5
  17. package/dist/esm/card-manager_3.entry.js +71 -51
  18. package/dist/esm/crowdsource-manager.entry.js +18 -45
  19. package/dist/esm/instant-apps-export.entry.js +5 -5
  20. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +16 -1
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/solutions-components.js +1 -1
  23. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-filter-list/instant-apps-filter-list.css +2 -4
  24. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-social-share/instant-apps-social-share.css +5 -0
  25. package/dist/solutions-components/p-21bc3c8a.entry.js +6 -0
  26. package/dist/solutions-components/p-8595b4aa.entry.js +17 -0
  27. package/dist/solutions-components/p-a5fd812c.entry.js +6 -0
  28. package/dist/solutions-components/p-ce4eed51.entry.js +6 -0
  29. package/dist/solutions-components/{p-f5b259f3.entry.js → p-de459c0a.entry.js} +1 -1
  30. package/dist/solutions-components/solutions-components.esm.js +1 -1
  31. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +2 -45
  32. package/dist/types/components/layer-table/layer-table.d.ts +16 -5
  33. package/dist/types/components.d.ts +0 -18
  34. package/package.json +2 -2
  35. package/dist/solutions-components/p-704c9ba1.entry.js +0 -17
  36. package/dist/solutions-components/p-766c0b57.entry.js +0 -6
  37. package/dist/solutions-components/p-ac2799f6.entry.js +0 -6
  38. package/dist/solutions-components/p-fec03ab3.entry.js +0 -6
@@ -29,8 +29,9 @@ export class CrowdsourceManager {
29
29
  * MapView.when is not fired when mapView is not currently visible
30
30
  */
31
31
  this._shouldSetMapView = false;
32
+ this._defaultCenterHonored = false;
33
+ this._defaultLevelHonored = false;
32
34
  this.defaultCenter = "";
33
- this.defaultFilter = "";
34
35
  this.defaultGlobalId = "";
35
36
  this.defaultLayer = "";
36
37
  this.defaultLevel = "";
@@ -75,39 +76,6 @@ export class CrowdsourceManager {
75
76
  // Watch handlers
76
77
  //
77
78
  //--------------------------------------------------------------------------
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
79
  /**
112
80
  * When true the map zoom tools will be available
113
81
  */
@@ -399,6 +367,7 @@ export class CrowdsourceManager {
399
367
  * @protected
400
368
  */
401
369
  _getTable(layoutMode, panelOpen, hideTable) {
370
+ var _a, _b;
402
371
  const tableClass = hideTable && this._isMobile ? "visibility-hidden" : "";
403
372
  const tableSizeClass = this._getTableSizeClass(layoutMode, panelOpen);
404
373
  const icon = this._getDividerIcon(layoutMode, panelOpen);
@@ -407,7 +376,11 @@ export class CrowdsourceManager {
407
376
  const toggleLayout = layoutMode === ELayoutMode.HORIZONTAL ? "horizontal" : "vertical";
408
377
  const toggleSlot = layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
409
378
  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 }))));
379
+ const globalId = !this.defaultGlobalId ? undefined :
380
+ ((_a = this.defaultGlobalId) === null || _a === void 0 ? void 0 : _a.indexOf(",")) > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
381
+ const defaultOid = !this.defaultOid ? undefined :
382
+ ((_b = this.defaultOid) === null || _b === void 0 ? void 0 : _b.indexOf(",")) > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
383
+ 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
384
  }
412
385
  /**
413
386
  * Update the component layout when its size changes
@@ -460,17 +433,22 @@ export class CrowdsourceManager {
460
433
  * @protected
461
434
  */
462
435
  async _setMapView() {
436
+ var _a;
463
437
  this._mapInfo = this._getMapInfo(this._mapChange.id);
464
438
  this._mapView = this._mapChange.mapView;
465
439
  this._initMapZoom();
466
440
  this._mapView.popupEnabled = false;
467
- if (this._defaultCenter && this._defaultLevel) {
441
+ const center = !this.defaultCenter || this._defaultCenterHonored ?
442
+ undefined : (_a = this.defaultCenter) === null || _a === void 0 ? void 0 : _a.split(";").map(v => parseFloat(v));
443
+ const zoom = !this.defaultLevel || this._defaultLevelHonored ?
444
+ undefined : parseInt(this.defaultLevel, 10);
445
+ if (center && zoom) {
468
446
  await this._mapView.goTo({
469
- center: this._defaultCenter,
470
- zoom: this._defaultLevel
447
+ center,
448
+ zoom
471
449
  });
472
- this._defaultCenter = undefined;
473
- this._defaultLevel = undefined;
450
+ this._defaultCenterHonored = true;
451
+ this._defaultLevelHonored = true;
474
452
  }
475
453
  }
476
454
  /**
@@ -531,24 +509,6 @@ export class CrowdsourceManager {
531
509
  "reflect": false,
532
510
  "defaultValue": "\"\""
533
511
  },
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
512
  "defaultGlobalId": {
553
513
  "type": "string",
554
514
  "mutable": false,
@@ -1052,21 +1012,6 @@ export class CrowdsourceManager {
1052
1012
  static get elementRef() { return "el"; }
1053
1013
  static get watchers() {
1054
1014
  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
1015
  "propName": "enableZoom",
1071
1016
  "methodName": "enableZoomWatchHandler"
1072
1017
  }];
@@ -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,12 @@ export class LayerTable {
100
99
  // Watch handlers
101
100
  //
102
101
  //--------------------------------------------------------------------------
102
+ async defaultOidWatchHandler() {
103
+ await this._handleDefaults();
104
+ }
105
+ async defaultGlobalIdWatchHandler() {
106
+ await this._handleDefaults();
107
+ }
103
108
  /**
104
109
  * Reset the toolInfos when export csv is enabled/disabled
105
110
  */
@@ -156,6 +161,8 @@ export class LayerTable {
156
161
  * watch for changes in map info and update the toolbar
157
162
  */
158
163
  async mapInfoWatchHandler() {
164
+ this._resetColumnTemplates();
165
+ this._initLayerExpressions();
159
166
  this._initToolInfos();
160
167
  this._updateToolbar();
161
168
  }
@@ -186,8 +193,8 @@ export class LayerTable {
186
193
  this._floorField = (_a = this._layer.floorInfo) === null || _a === void 0 ? void 0 : _a.floorField;
187
194
  this._updateFloorDefinitionExpression();
188
195
  await this._resetTable();
189
- this._updateShareUrl();
190
196
  this._initLayerExpressions();
197
+ this._updateShareUrl();
191
198
  this._fetchingData = false;
192
199
  }));
193
200
  }
@@ -785,22 +792,6 @@ export class LayerTable {
785
792
  else {
786
793
  urlObj.searchParams.delete("oid");
787
794
  }
788
- if (this._filterActive) {
789
- const filter = JSON.parse(this._filterList.urlParams.get("filter"));
790
- const layerExpressions = this._filterList.layerExpressions.map(layerExp => {
791
- layerExp.expressions = layerExp.expressions.map(exp => {
792
- if (exp.id.toString() === filter.expressionId.toString()) {
793
- exp.active = true;
794
- }
795
- return exp;
796
- });
797
- return layerExp;
798
- });
799
- urlObj.searchParams.set("filter", JSON.stringify(layerExpressions));
800
- }
801
- else {
802
- urlObj.searchParams.delete("filter");
803
- }
804
795
  this._shareNode.shareUrl = urlObj.href;
805
796
  }
806
797
  /**
@@ -814,7 +805,7 @@ export class LayerTable {
814
805
  * @returns VNode The tooltip node
815
806
  */
816
807
  _getToolTip(placement, referenceElement, text) {
817
- return (h("calcite-tooltip", { placement: placement, "reference-element": referenceElement }, h("span", null, text)));
808
+ return document.getElementById(referenceElement) ? (h("calcite-tooltip", { placement: placement, "reference-element": referenceElement }, h("span", null, text))) : undefined;
818
809
  }
819
810
  /**
820
811
  * Get an id with a prefix to the user supplied value
@@ -874,8 +865,6 @@ export class LayerTable {
874
865
  container: node
875
866
  });
876
867
  });
877
- this._initColumnsInfo();
878
- this._checkEditEnabled();
879
868
  await this._table.when(() => {
880
869
  this._table.highlightIds.on("change", (evt) => {
881
870
  void this._handleOnChange(evt);
@@ -979,7 +968,11 @@ export class LayerTable {
979
968
  _resetColumnTemplates() {
980
969
  var _a, _b;
981
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);
982
- if (this._table && columnTemplates) {
971
+ const hasChange = columnTemplates.some((ct, i) => {
972
+ var _a;
973
+ return JSON.stringify((_a = this._table) === null || _a === void 0 ? void 0 : _a.tableTemplate.columnTemplates[i]) !== JSON.stringify(ct);
974
+ });
975
+ if (this._table && columnTemplates && hasChange) {
983
976
  this._table.tableTemplate = new this.TableTemplate({
984
977
  columnTemplates
985
978
  });
@@ -993,46 +986,73 @@ export class LayerTable {
993
986
  async _resetTable() {
994
987
  var _a;
995
988
  this._clearSelection();
996
- this._allIds = [];
997
- this.featureSelectionChange.emit(this.selectedIds);
998
- const columnTemplates = this._getColumnTemplates(this._layer.id, (_a = this._layer) === null || _a === void 0 ? void 0 : _a.fields);
999
989
  this._allIds = await queryAllIds(this._layer);
1000
990
  if (!this._table) {
991
+ const columnTemplates = this._getColumnTemplates(this._layer.id, (_a = this._layer) === null || _a === void 0 ? void 0 : _a.fields);
1001
992
  await this._getTable(this._tableNode, columnTemplates);
1002
993
  }
1003
- this._table.layer = this._layer;
1004
- this._table.view = this.mapView;
994
+ else {
995
+ this._table.view = this.mapView;
996
+ this._table.layer = this._layer;
997
+ }
998
+ await this._initLayerRefresh();
1005
999
  this._checkEditEnabled();
1006
1000
  this._table.editingEnabled = this._editEnabled && this.enableInlineEdit;
1007
1001
  await this.reactiveUtils.once(() => this._table.state === "loaded")
1008
1002
  .then(async () => {
1009
- var _a, _b;
1010
1003
  this._table.highlightIds.removeAll();
1011
1004
  this._table.clearSelectionFilter();
1012
1005
  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 && this.defaultFilter && this._filterList) {
1026
- this._layerExpressions = this.defaultFilter;
1027
- this._filterActive = true;
1028
- this._defaultFilterHonored = true;
1029
- }
1030
1006
  this._showOnlySelected = false;
1007
+ await this._handleDefaults();
1031
1008
  await this._sortTable();
1032
1009
  this._initToolInfos();
1033
1010
  this._updateToolbar();
1034
1011
  });
1035
1012
  }
1013
+ /**
1014
+ * Update the current IDs when that layers data is modified
1015
+ */
1016
+ async _initLayerRefresh() {
1017
+ if (this._refreshHandle) {
1018
+ this._refreshHandle.remove();
1019
+ }
1020
+ this._refreshHandle = this._layer.on("refresh", (evt) => {
1021
+ if (evt.dataChanged) {
1022
+ this._skipOnChange = true;
1023
+ void this._updateAllIds();
1024
+ }
1025
+ });
1026
+ }
1027
+ /**
1028
+ * Reset _allIds when the layers data has changed and refresh the selection ids and table
1029
+ */
1030
+ async _updateAllIds() {
1031
+ this._allIds = await queryAllIds(this._layer);
1032
+ this.selectedIds = this.selectedIds.filter(id => this._allIds.indexOf(id) > -1);
1033
+ await this._refresh();
1034
+ }
1035
+ async _handleDefaults() {
1036
+ var _a, _b;
1037
+ if (!this._defaultOidHonored && ((_a = this.defaultOid) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.defaultOid[0] > -1 && this._table) {
1038
+ await this._selectDefaultFeature(this.defaultOid);
1039
+ this._defaultOidHonored = true;
1040
+ this.defaultOid = undefined;
1041
+ this._showOnlySelected = false;
1042
+ this._toggleShowSelected();
1043
+ }
1044
+ if (!this._defaultGlobalIdHonored && ((_b = this.defaultGlobalId) === null || _b === void 0 ? void 0 : _b.length) > 0 && this._table) {
1045
+ const features = await queryFeaturesByGlobalID(this.defaultGlobalId, this._layer);
1046
+ const oids = (features === null || features === void 0 ? void 0 : features.length) > 0 ? features.map(f => f.getObjectId()) : undefined;
1047
+ if (oids) {
1048
+ await this._selectDefaultFeature(oids);
1049
+ }
1050
+ this._defaultGlobalIdHonored = true;
1051
+ this.defaultGlobalId = undefined;
1052
+ this._showOnlySelected = false;
1053
+ this._toggleShowSelected();
1054
+ }
1055
+ }
1036
1056
  /**
1037
1057
  * Store the column names and current hidden status to support show/hide of columns
1038
1058
  * @param fieldNames optional list of names from new config options
@@ -1061,13 +1081,12 @@ export class LayerTable {
1061
1081
  /**
1062
1082
  * Select the feature that was specified via url params
1063
1083
  */
1064
- _selectDefaultFeature(oids) {
1084
+ async _selectDefaultFeature(oids) {
1065
1085
  if (oids.length > 0) {
1066
1086
  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
- });
1087
+ // This is messed up and only make this worse
1088
+ //const i = this._table.viewModel.getObjectIdIndex(oids[0]);
1089
+ //this._table.viewModel.scrollToIndex(i);
1071
1090
  }
1072
1091
  }
1073
1092
  /**
@@ -1258,7 +1277,6 @@ export class LayerTable {
1258
1277
  this._layerExpressions = layerExpressions ? layerExpressions.filter((exp) => { var _a; return exp.id === ((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id); }) : [];
1259
1278
  this._filterList.layerExpressions = this._layerExpressions;
1260
1279
  this._filterActive = this._layerExpressions.filter(lyrExp => {
1261
- console.log(lyrExp);
1262
1280
  return lyrExp.expressions.filter(exp => exp.active).length > 0;
1263
1281
  }).length > 0;
1264
1282
  }
@@ -1455,27 +1473,6 @@ export class LayerTable {
1455
1473
  }
1456
1474
  static get properties() {
1457
1475
  return {
1458
- "defaultFilter": {
1459
- "type": "unknown",
1460
- "mutable": false,
1461
- "complexType": {
1462
- "original": "LayerExpression[]",
1463
- "resolved": "LayerExpression[]",
1464
- "references": {
1465
- "LayerExpression": {
1466
- "location": "import",
1467
- "path": "@esri/instant-apps-components",
1468
- "id": ""
1469
- }
1470
- }
1471
- },
1472
- "required": false,
1473
- "optional": false,
1474
- "docs": {
1475
- "tags": [],
1476
- "text": "LayerExpression[]: default layer expression(s) to apply to the current layer"
1477
- }
1478
- },
1479
1476
  "defaultGlobalId": {
1480
1477
  "type": "unknown",
1481
1478
  "mutable": false,
@@ -1807,6 +1804,12 @@ export class LayerTable {
1807
1804
  static get elementRef() { return "el"; }
1808
1805
  static get watchers() {
1809
1806
  return [{
1807
+ "propName": "defaultOid",
1808
+ "methodName": "defaultOidWatchHandler"
1809
+ }, {
1810
+ "propName": "defaultGlobalId",
1811
+ "methodName": "defaultGlobalIdWatchHandler"
1812
+ }, {
1810
1813
  "propName": "enableCSV",
1811
1814
  "methodName": "enableCSVWatchHandler"
1812
1815
  }, {
@@ -76,8 +76,9 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
76
76
  * MapView.when is not fired when mapView is not currently visible
77
77
  */
78
78
  this._shouldSetMapView = false;
79
+ this._defaultCenterHonored = false;
80
+ this._defaultLevelHonored = false;
79
81
  this.defaultCenter = "";
80
- this.defaultFilter = "";
81
82
  this.defaultGlobalId = "";
82
83
  this.defaultLayer = "";
83
84
  this.defaultLevel = "";
@@ -122,39 +123,6 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
122
123
  // Watch handlers
123
124
  //
124
125
  //--------------------------------------------------------------------------
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
126
  /**
159
127
  * When true the map zoom tools will be available
160
128
  */
@@ -446,6 +414,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
446
414
  * @protected
447
415
  */
448
416
  _getTable(layoutMode, panelOpen, hideTable) {
417
+ var _a, _b;
449
418
  const tableClass = hideTable && this._isMobile ? "visibility-hidden" : "";
450
419
  const tableSizeClass = this._getTableSizeClass(layoutMode, panelOpen);
451
420
  const icon = this._getDividerIcon(layoutMode, panelOpen);
@@ -454,7 +423,11 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
454
423
  const toggleLayout = layoutMode === ELayoutMode.HORIZONTAL ? "horizontal" : "vertical";
455
424
  const toggleSlot = layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
456
425
  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 }))));
426
+ const globalId = !this.defaultGlobalId ? undefined :
427
+ ((_a = this.defaultGlobalId) === null || _a === void 0 ? void 0 : _a.indexOf(",")) > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
428
+ const defaultOid = !this.defaultOid ? undefined :
429
+ ((_b = this.defaultOid) === null || _b === void 0 ? void 0 : _b.indexOf(",")) > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
430
+ 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
431
  }
459
432
  /**
460
433
  * Update the component layout when its size changes
@@ -507,17 +480,22 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
507
480
  * @protected
508
481
  */
509
482
  async _setMapView() {
483
+ var _a;
510
484
  this._mapInfo = this._getMapInfo(this._mapChange.id);
511
485
  this._mapView = this._mapChange.mapView;
512
486
  this._initMapZoom();
513
487
  this._mapView.popupEnabled = false;
514
- if (this._defaultCenter && this._defaultLevel) {
488
+ const center = !this.defaultCenter || this._defaultCenterHonored ?
489
+ undefined : (_a = this.defaultCenter) === null || _a === void 0 ? void 0 : _a.split(";").map(v => parseFloat(v));
490
+ const zoom = !this.defaultLevel || this._defaultLevelHonored ?
491
+ undefined : parseInt(this.defaultLevel, 10);
492
+ if (center && zoom) {
515
493
  await this._mapView.goTo({
516
- center: this._defaultCenter,
517
- zoom: this._defaultLevel
494
+ center,
495
+ zoom
518
496
  });
519
- this._defaultCenter = undefined;
520
- this._defaultLevel = undefined;
497
+ this._defaultCenterHonored = true;
498
+ this._defaultLevelHonored = true;
521
499
  }
522
500
  }
523
501
  /**
@@ -549,17 +527,11 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
549
527
  }
550
528
  get el() { return this; }
551
529
  static get watchers() { return {
552
- "defaultCenter": ["defaultCenterWatchHandler"],
553
- "defaultFilter": ["defaultFilterWatchHandler"],
554
- "defaultGlobalId": ["defaultGlobalIdWatchHandler"],
555
- "defaultOid": ["defaultOidWatchHandler"],
556
- "defaultLevel": ["defaultLevelWatchHandler"],
557
530
  "enableZoom": ["enableZoomWatchHandler"]
558
531
  }; }
559
532
  static get style() { return crowdsourceManagerCss; }
560
533
  }, [0, "crowdsource-manager", {
561
534
  "defaultCenter": [1, "default-center"],
562
- "defaultFilter": [1, "default-filter"],
563
535
  "defaultGlobalId": [1, "default-global-id"],
564
536
  "defaultLayer": [1, "default-layer"],
565
537
  "defaultLevel": [1, "default-level"],
@@ -599,11 +571,6 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
599
571
  "_numSelected": [32],
600
572
  "_tableOnly": [32]
601
573
  }, [[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
574
  "enableZoom": ["enableZoomWatchHandler"]
608
575
  }]);
609
576
  function defineCustomElement$1() {
@@ -664,13 +664,13 @@ const InstantAppsExport$1 = /*@__PURE__*/ proxyCustomElement(class InstantAppsEx
664
664
  });
665
665
  }
666
666
  updateScaleBar() {
667
- var _a, _b, _c;
668
- if (this.scaleBarContainerEl) {
667
+ if (this.scaleBarContainerEl && this.view != null) {
669
668
  this.scaleBarContainerEl.innerHTML = '';
670
669
  if (this.showScaleBar) {
671
- const scaleBar = (_c = (_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.container) === null || _b === void 0 ? void 0 : _b.querySelector('.esri-scale-bar.esri-widget')) === null || _c === void 0 ? void 0 : _c.cloneNode(true);
672
- if (scaleBar != null) {
673
- this.scaleBarContainerEl.append(scaleBar);
670
+ const widgets = this.view.ui.getComponents();
671
+ const scaleBar = widgets === null || widgets === void 0 ? void 0 : widgets.find(({ container }) => { var _a; return (_a = container === null || container === void 0 ? void 0 : container.className) === null || _a === void 0 ? void 0 : _a.includes('esri-scale-bar'); });
672
+ if ((scaleBar === null || scaleBar === void 0 ? void 0 : scaleBar.container) != null && typeof scaleBar.container !== 'string') {
673
+ this.scaleBarContainerEl.append(scaleBar.container.cloneNode(true));
674
674
  }
675
675
  }
676
676
  }
@@ -65,7 +65,7 @@ function resetDatePicker(datePicker) {
65
65
  }
66
66
  }
67
67
 
68
- const instantAppsFilterListCss = ":host{display:block}.instant-apps-filter-list *{box-sizing:border-box}.instant-apps-filter-list__container{height:100%}.instant-apps-filter-list__container calcite-block:last-of-type{margin-bottom:0}.instant-apps-filter-list__footer{padding:12px;display:flex}.instant-apps-filter-list__footer calcite-button:nth-child(2){margin-left:6px}.instant-apps-filter-list__item-container,.instant-apps-filter-list__item-container--user-input{display:flex;justify-content:space-between;align-items:center}.instant-apps-filter-list__item-container:not(:last-child),.instant-apps-filter-list__item-container--user-input:not(:last-child){padding-bottom:20px}.instant-apps-filter-list__item-container--user-input{margin:0;display:flex;flex-direction:column;align-items:flex-start}.instant-apps-filter-list__item-container--user-input>span{margin:0 0 6px;font-size:14px;font-weight:normal}.instant-apps-filter-list__item-container--user-input calcite-combobox{width:100%;--calcite-font-size--1:16px}.instant-apps-filter-list__item-container--user-input calcite-combobox-item{--calcite-font-size--1:12px}.instant-apps-filter-list__number-input-container{width:100%;display:flex;justify-content:center}.instant-apps-filter-list__number-input-container calcite-slider{width:90%}.instant-apps-filter-list__date-picker-input-container{display:flex;align-items:center;justify-content:unset;width:100%}.instant-apps-filter-list__date-picker-input-container calcite-action{height:64px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__title{margin-right:20px}.instant-apps-filter-list__title>p{font-size:14px;font-weight:normal;margin:0}.instant-apps-filter-list__checkbox-container{display:flex}.instant-apps-filter-list__checkbox-container calcite-checkbox{height:18px}.instant-apps-filter-list__operator-description{margin:0;--calcite-font-size--1:12px}.instant-apps-filter-list__zoom-to{display:flex;justify-content:flex-end;margin:8px 0 20px}.instant-apps-filter-list__zoom-to calcite-action{width:-moz-min-content;width:min-content}.instant-apps-filter-list calcite-input-date-picker{--calcite-font-size--1:16px}@media (prefers-reduced-motion){.instant-apps-filter-list calcite-loader{--calcite-internal-duration-factor:2;--calcite-internal-animation-timing-slow:calc(300ms * 2)}}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__header-container{background:#2b2b2b;color:#fff}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__operator-description{background:#353535}";
68
+ const instantAppsFilterListCss = ":host{display:block}.instant-apps-filter-list *{box-sizing:border-box}.instant-apps-filter-list__container{height:100%}.instant-apps-filter-list__container calcite-block:last-of-type{margin-bottom:0}.instant-apps-filter-list__footer{padding:12px;display:flex}.instant-apps-filter-list__footer calcite-button:nth-child(2){margin-left:6px}.instant-apps-filter-list__item-container,.instant-apps-filter-list__item-container--user-input{display:flex;justify-content:space-between;align-items:center}.instant-apps-filter-list__item-container:not(:last-child),.instant-apps-filter-list__item-container--user-input:not(:last-child){padding-bottom:20px}.instant-apps-filter-list__item-container--user-input{margin:0;display:flex;flex-direction:column;align-items:flex-start}.instant-apps-filter-list__item-container--user-input>span{margin:0 0 6px;font-size:14px;font-weight:normal}.instant-apps-filter-list__item-container--user-input calcite-combobox{width:100%;font-size:16px;--calcite-combobox-input-height:24px}.instant-apps-filter-list__number-input-container{width:100%;display:flex;justify-content:center}.instant-apps-filter-list__number-input-container calcite-slider{width:90%}.instant-apps-filter-list__date-picker-input-container{display:flex;align-items:center;justify-content:unset;width:100%}.instant-apps-filter-list__date-picker-input-container calcite-action{height:64px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__title{margin-right:20px}.instant-apps-filter-list__title>p{font-size:14px;font-weight:normal;margin:0}.instant-apps-filter-list__checkbox-container{display:flex}.instant-apps-filter-list__checkbox-container calcite-checkbox{height:18px}.instant-apps-filter-list__operator-description{margin:0;--calcite-font-size--1:12px}.instant-apps-filter-list__zoom-to{display:flex;justify-content:flex-end;margin:8px 0 20px}.instant-apps-filter-list__zoom-to calcite-action{width:-moz-min-content;width:min-content}.instant-apps-filter-list calcite-input-date-picker{--calcite-font-size--1:16px}@media (prefers-reduced-motion){.instant-apps-filter-list calcite-loader{--calcite-internal-duration-factor:2;--calcite-internal-animation-timing-slow:calc(300ms * 2)}}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__header-container{background:#2b2b2b;color:#fff}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__operator-description{background:#353535}";
69
69
 
70
70
  const CSS = {
71
71
  base: 'instant-apps-filter-list',
@@ -91,7 +91,7 @@ const InstantAppsFilterList = /*@__PURE__*/ proxyCustomElement(class InstantApps
91
91
  this.autoUpdateUrl = false;
92
92
  this.closeBtn = false;
93
93
  this.closeBtnOnClick = undefined;
94
- this.comboboxOverlayPositioning = "absolute";
94
+ this.comboboxOverlayPositioning = 'absolute';
95
95
  this.closeBtnText = undefined;
96
96
  this.openFilters = false;
97
97
  this.extentSelector = false;
@@ -188,7 +188,7 @@ const InstantAppsFilterList = /*@__PURE__*/ proxyCustomElement(class InstantApps
188
188
  }
189
189
  renderCombobox(layerExpression, expression) {
190
190
  var _a;
191
- return (h("label", { key: "combo-select", class: CSS.filterUIItemContainer }, h("span", null, expression.name), h("calcite-combobox", { id: expression.id.toString(), onCalciteComboboxChange: this.handleComboSelect.bind(this, expression, layerExpression), label: expression.name, placeholder: expression.placeholder, selectionMode: "multiple", "max-items": "6", overlayPositioning: this.comboboxOverlayPositioning }, (_a = expression.fields) === null || _a === void 0 ? void 0 : _a.map((value, index) => this.renderComboboxItem(expression, value, index)))));
191
+ return (h("label", { key: "combo-select", class: CSS.filterUIItemContainer }, h("span", null, expression.name), h("calcite-combobox", { id: expression.id.toString(), onCalciteComboboxChange: this.handleComboSelect.bind(this, expression, layerExpression), label: expression.name, placeholder: expression.placeholder, selectionMode: "multiple", "max-items": "6", scale: "s", overlayPositioning: this.comboboxOverlayPositioning }, (_a = expression.fields) === null || _a === void 0 ? void 0 : _a.map((value, index) => this.renderComboboxItem(expression, value, index)))));
192
192
  }
193
193
  renderComboboxItem(expression, value, index) {
194
194
  var _a;
@@ -1200,11 +1200,26 @@ const InstantAppsInteractiveLegendClassic = /*@__PURE__*/ proxyCustomElement(cla
1200
1200
  var _a, _b, _c, _d;
1201
1201
  try {
1202
1202
  // Initial data setup
1203
+ // Loads map/basemap
1203
1204
  const map = await ((_c = (_b = (_a = this.legendvm) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.map) === null || _c === void 0 ? void 0 : _c.load());
1204
1205
  await ((_d = map === null || map === void 0 ? void 0 : map.basemap) === null || _d === void 0 ? void 0 : _d.load());
1206
+ // Loads all layers in webmap and waits until all settled promises
1205
1207
  const allLayers = map === null || map === void 0 ? void 0 : map.allLayers;
1206
1208
  const promises = allLayers === null || allLayers === void 0 ? void 0 : allLayers.map(layer => layer.load());
1207
- await Promise.allSettled(promises);
1209
+ const settled = await Promise.allSettled(promises);
1210
+ const settledLayerPromises = settled
1211
+ .map(settledLayer => ((settledLayer === null || settledLayer === void 0 ? void 0 : settledLayer.status) === 'fulfilled' && (settledLayer === null || settledLayer === void 0 ? void 0 : settledLayer.value) ? settledLayer.value : null))
1212
+ .filter(layer => !!layer);
1213
+ // Wait until all layer views are settled/available
1214
+ const lvPromises = [];
1215
+ settledLayerPromises.forEach(layer => {
1216
+ var _a;
1217
+ if ((_a = this.legendvm) === null || _a === void 0 ? void 0 : _a.view) {
1218
+ lvPromises.push(this.legendvm.view.whenLayerView(layer));
1219
+ }
1220
+ });
1221
+ await Promise.allSettled(lvPromises);
1222
+ // Generate data once all layers/layer views are complete
1208
1223
  const data = await generateData(this.legendvm, this.reactiveUtils);
1209
1224
  store.set('data', Object.assign(Object.assign({}, interactiveLegendState.data), data));
1210
1225
  this.isLoading = false;