@esri/solutions-components 0.6.33 → 0.6.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/dist/cjs/calcite-alert_3.cjs.entry.js +20 -6
  2. package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -1
  3. package/dist/cjs/card-manager_3.cjs.entry.js +91 -15
  4. package/dist/cjs/crowdsource-manager.cjs.entry.js +30 -3
  5. package/dist/cjs/{downloadUtils-b37689dd.js → downloadUtils-37d9aaf3.js} +2 -2
  6. package/dist/cjs/{index.es-83e253dc.js → index.es-d1d9b140.js} +2 -2
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
  9. package/dist/cjs/{mapViewUtils-303bf42d.js → mapViewUtils-96172223.js} +18 -0
  10. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  11. package/dist/cjs/solutions-components.cjs.js +1 -1
  12. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +34 -4
  13. package/dist/collection/components/edit-card/edit-card.js +19 -6
  14. package/dist/collection/components/layer-table/layer-table.js +80 -9
  15. package/dist/collection/components/map-card/map-card.js +52 -4
  16. package/dist/collection/demos/crowdsource-manager.html +5 -4
  17. package/dist/collection/utils/mapViewUtils.js +17 -0
  18. package/dist/collection/utils/mapViewUtils.ts +20 -0
  19. package/dist/components/crowdsource-manager.js +33 -4
  20. package/dist/components/edit-card2.js +19 -6
  21. package/dist/components/layer-table2.js +62 -10
  22. package/dist/components/map-card2.js +36 -5
  23. package/dist/components/map-layer-picker2.js +1 -1
  24. package/dist/components/map-select-tools2.js +1 -1
  25. package/dist/components/mapViewUtils.js +18 -1
  26. package/dist/components/public-notification.js +1 -1
  27. package/dist/components/refine-selection2.js +1 -1
  28. package/dist/esm/calcite-alert_3.entry.js +20 -6
  29. package/dist/esm/calcite-combobox_6.entry.js +1 -1
  30. package/dist/esm/card-manager_3.entry.js +91 -15
  31. package/dist/esm/crowdsource-manager.entry.js +30 -3
  32. package/dist/esm/{downloadUtils-ddd7eeb7.js → downloadUtils-76379e4a.js} +2 -2
  33. package/dist/esm/{index.es-a53707d1.js → index.es-0d134a52.js} +2 -2
  34. package/dist/esm/loader.js +1 -1
  35. package/dist/esm/map-select-tools_3.entry.js +2 -2
  36. package/dist/esm/{mapViewUtils-43c930f1.js → mapViewUtils-08f6cfce.js} +18 -1
  37. package/dist/esm/public-notification.entry.js +2 -2
  38. package/dist/esm/solutions-components.js +1 -1
  39. package/dist/solutions-components/demos/crowdsource-manager.html +5 -4
  40. package/dist/solutions-components/{p-05ba41f9.js → p-03130804.js} +1 -1
  41. package/dist/solutions-components/{p-e05cf92d.entry.js → p-0f50087e.entry.js} +2 -2
  42. package/dist/solutions-components/{p-f2194390.js → p-15070568.js} +1 -1
  43. package/dist/solutions-components/{p-4792005c.entry.js → p-1682bd0f.entry.js} +1 -1
  44. package/dist/solutions-components/p-63867402.entry.js +6 -0
  45. package/dist/solutions-components/{p-50a3a887.entry.js → p-81a0c88f.entry.js} +1 -1
  46. package/dist/solutions-components/{p-978a26b3.entry.js → p-9800e602.entry.js} +1 -1
  47. package/dist/solutions-components/{p-b745143d.js → p-b02eb8f4.js} +2 -2
  48. package/dist/solutions-components/p-eba875d9.entry.js +6 -0
  49. package/dist/solutions-components/solutions-components.esm.js +1 -1
  50. package/dist/solutions-components/utils/mapViewUtils.ts +20 -0
  51. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +10 -0
  52. package/dist/types/components/edit-card/edit-card.d.ts +5 -1
  53. package/dist/types/components/layer-table/layer-table.d.ts +28 -0
  54. package/dist/types/components/map-card/map-card.d.ts +18 -0
  55. package/dist/types/components.d.ts +16 -0
  56. package/dist/types/utils/mapViewUtils.d.ts +9 -0
  57. package/package.json +1 -1
  58. package/dist/solutions-components/p-65ade5af.entry.js +0 -6
  59. package/dist/solutions-components/p-a5342c42.entry.js +0 -6
@@ -21,6 +21,7 @@
21
21
  import { Host, h } from "@stencil/core";
22
22
  import { loadModules } from "../../utils/loadModules";
23
23
  import { getLocaleComponentStrings } from "../../utils/locale";
24
+ import { getAllLayers } from "../../utils/mapViewUtils";
24
25
  export class EditCard {
25
26
  constructor() {
26
27
  /**
@@ -51,7 +52,7 @@ export class EditCard {
51
52
  var _a;
52
53
  if (v && ((_a = this.graphics) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.graphicIndex > -1) {
53
54
  this._editorLoading = true;
54
- this._initEditorWidget();
55
+ await this._initEditorWidget();
55
56
  if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
56
57
  await this._startUpdate();
57
58
  }
@@ -133,19 +134,24 @@ export class EditCard {
133
134
  *
134
135
  * @returns void
135
136
  */
136
- _initEditorWidget() {
137
+ async _initEditorWidget() {
137
138
  if (this.mapView && this.graphics && this.graphics.length > 0 && this.graphics[0]) {
138
139
  if (this._editor) {
139
140
  this._editor.destroy();
140
141
  }
141
142
  const container = document.createElement("div");
143
+ const layers = await getAllLayers(this.mapView);
144
+ const layerInfos = layers.map(layer => {
145
+ return {
146
+ layer,
147
+ geometryUpdatesEnabled: false,
148
+ addEnabled: false
149
+ };
150
+ });
142
151
  this._editor = new this.Editor({
143
152
  allowedWorkflows: "update",
144
153
  view: this.mapView,
145
- layerInfos: [{
146
- layer: this._layer,
147
- geometryUpdatesEnabled: false
148
- }],
154
+ layerInfos,
149
155
  visibleElements: {
150
156
  snappingControls: false,
151
157
  sketchTooltipControls: false
@@ -156,6 +162,7 @@ export class EditCard {
156
162
  this._editHandle.remove();
157
163
  this._attachmentHandle.remove();
158
164
  this._activeWorkflowHandle.remove();
165
+ this._addRelatedRecordHandle.remove();
159
166
  }
160
167
  this._attachmentHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "adding-attachment" ||
161
168
  this._editor.viewModel.state === "editing-attachment" ||
@@ -175,6 +182,12 @@ export class EditCard {
175
182
  this._shouldClose = false;
176
183
  }
177
184
  });
185
+ // Temp workaround until a new prop is added at 4.29
186
+ this._addRelatedRecordHandle = this.reactiveUtils.when(() => !!this._editor.viewModel.featureFormViewModel.relatedRecordCallbacks, () => {
187
+ this._editor.viewModel.featureFormViewModel.relatedRecordCallbacks.addRelatedRecord = null;
188
+ }, {
189
+ once: true
190
+ });
178
191
  // had issues with destroy before adding like this
179
192
  this._editContainer.appendChild(container);
180
193
  }
@@ -48,6 +48,7 @@ export class LayerTable {
48
48
  this.enableAutoRefresh = undefined;
49
49
  this.enableCSV = undefined;
50
50
  this.enableInlineEdit = undefined;
51
+ this.enableZoom = undefined;
51
52
  this.mapInfo = undefined;
52
53
  this.mapView = undefined;
53
54
  this.onlyShowUpdatableLayers = undefined;
@@ -68,6 +69,32 @@ export class LayerTable {
68
69
  // Watch handlers
69
70
  //
70
71
  //--------------------------------------------------------------------------
72
+ /**
73
+ * Reset the toolInfos when zoom tool is enabled/disabled
74
+ */
75
+ enableZoomWatchHandler() {
76
+ var _a;
77
+ if (((_a = this._toolInfos) === null || _a === void 0 ? void 0 : _a.length) > 0) {
78
+ this._initToolInfos();
79
+ }
80
+ }
81
+ /**
82
+ * Reset the toolInfos when export csv is enabled/disabled
83
+ */
84
+ enableCSVWatchHandler() {
85
+ var _a;
86
+ if (((_a = this._toolInfos) === null || _a === void 0 ? void 0 : _a.length) > 0) {
87
+ this._initToolInfos();
88
+ }
89
+ }
90
+ /**
91
+ * Update the table when enableInlineEdit is enabled/disabled
92
+ */
93
+ enableInlineEditWatchHandler() {
94
+ if (this._table) {
95
+ this._table.editingEnabled = this._editEnabled && this.enableInlineEdit;
96
+ }
97
+ }
71
98
  /**
72
99
  * watch for changes to the list of controls that will currently fit in the display
73
100
  */
@@ -271,7 +298,7 @@ export class LayerTable {
271
298
  * @returns void
272
299
  */
273
300
  _validateEnabledActions() {
274
- const featuresSelected = this._selectedIndexes.length > 0;
301
+ const featuresSelected = this._featuresSelected();
275
302
  const selectionDependant = [
276
303
  "zoom-to-object",
277
304
  "trash",
@@ -293,14 +320,16 @@ export class LayerTable {
293
320
  */
294
321
  _initToolInfos() {
295
322
  var _a;
296
- const featuresSelected = this._selectedIndexes.length > 0;
297
- this._toolInfos = [{
323
+ const featuresSelected = this._featuresSelected();
324
+ const featuresEmpty = this._featuresEmpty();
325
+ this._toolInfos = [this.enableZoom ? {
298
326
  icon: "zoom-to-object",
299
327
  label: this._translations.zoom,
300
328
  func: () => this._zoom(),
301
329
  disabled: !featuresSelected,
302
330
  isOverflow: false
303
- }, ((_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.filters) ? {
331
+ } : undefined,
332
+ ((_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.filters) ? {
304
333
  icon: "filter",
305
334
  label: this._translations.filters,
306
335
  func: () => this._filter(),
@@ -330,13 +359,13 @@ export class LayerTable {
330
359
  icon: "list-check-all",
331
360
  func: () => this._selectAll(),
332
361
  label: this._translations.selectAll,
333
- disabled: false,
362
+ disabled: featuresEmpty,
334
363
  isOverflow: false
335
364
  }, {
336
365
  icon: "compare",
337
366
  func: () => this._switchSelected(),
338
367
  label: this._translations.switchSelected,
339
- disabled: false,
368
+ disabled: featuresEmpty,
340
369
  isOverflow: false
341
370
  }, {
342
371
  icon: "refresh",
@@ -349,11 +378,27 @@ export class LayerTable {
349
378
  icon: "export",
350
379
  func: () => void this._exportToCSV(),
351
380
  label: this._translations.exportCSV,
352
- disabled: false,
381
+ disabled: featuresEmpty,
353
382
  isOverflow: false
354
383
  } : undefined];
355
384
  this._defaultVisibleToolSizeInfos = undefined;
356
385
  }
386
+ /**
387
+ * Returns true when one ore more features are selected
388
+ *
389
+ * @returns boolean
390
+ */
391
+ _featuresSelected() {
392
+ return this._selectedIndexes.length > 0;
393
+ }
394
+ /**
395
+ * Return true when we have no features
396
+ *
397
+ * @returns boolean
398
+ */
399
+ _featuresEmpty() {
400
+ return this._allIds.length === 0;
401
+ }
357
402
  /**
358
403
  * Add/Remove tools from the action bar and dropdown based on available size
359
404
  *
@@ -582,7 +627,7 @@ export class LayerTable {
582
627
  // https://github.com/Esri/solutions-components/issues/365
583
628
  this._selectedIndexes = this._table.highlightIds.toArray().reverse();
584
629
  if (this._showOnlySelected) {
585
- if (this._selectedIndexes.length > 0) {
630
+ if (this._featuresSelected()) {
586
631
  this._table.filterBySelection();
587
632
  }
588
633
  else {
@@ -832,7 +877,7 @@ export class LayerTable {
832
877
  async _layerSelectionChanged(evt) {
833
878
  var _a;
834
879
  const id = evt.detail[0];
835
- if (id !== ((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id) || this._allIds.length === 0) {
880
+ if (id !== ((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id) || this._featuresEmpty()) {
836
881
  this._fetchingData = true;
837
882
  const layer = await getLayerOrTable(this.mapView, id);
838
883
  await layer.when(() => {
@@ -951,6 +996,23 @@ export class LayerTable {
951
996
  "attribute": "enable-inline-edit",
952
997
  "reflect": false
953
998
  },
999
+ "enableZoom": {
1000
+ "type": "boolean",
1001
+ "mutable": false,
1002
+ "complexType": {
1003
+ "original": "boolean",
1004
+ "resolved": "boolean",
1005
+ "references": {}
1006
+ },
1007
+ "required": false,
1008
+ "optional": false,
1009
+ "docs": {
1010
+ "tags": [],
1011
+ "text": "boolean: when true the zoom button will be enabled"
1012
+ },
1013
+ "attribute": "enable-zoom",
1014
+ "reflect": false
1015
+ },
954
1016
  "mapInfo": {
955
1017
  "type": "unknown",
956
1018
  "mutable": false,
@@ -1094,6 +1156,15 @@ export class LayerTable {
1094
1156
  static get elementRef() { return "el"; }
1095
1157
  static get watchers() {
1096
1158
  return [{
1159
+ "propName": "enableZoom",
1160
+ "methodName": "enableZoomWatchHandler"
1161
+ }, {
1162
+ "propName": "enableCSV",
1163
+ "methodName": "enableCSVWatchHandler"
1164
+ }, {
1165
+ "propName": "enableInlineEdit",
1166
+ "methodName": "enableInlineEditWatchHandler"
1167
+ }, {
1097
1168
  "propName": "_controlsThatFit",
1098
1169
  "methodName": "_controlsThatFitWatchHandler"
1099
1170
  }, {
@@ -32,6 +32,7 @@ export class MapCard {
32
32
  * string: the id of map currently displayed
33
33
  */
34
34
  this._loadedId = "";
35
+ this.enableHome = undefined;
35
36
  this.enableLegend = undefined;
36
37
  this.enableFloorFilter = undefined;
37
38
  this.enableFullscreen = undefined;
@@ -44,6 +45,17 @@ export class MapCard {
44
45
  this._searchConfiguration = undefined;
45
46
  this._webMapInfo = undefined;
46
47
  }
48
+ //--------------------------------------------------------------------------
49
+ //
50
+ // Watch handlers
51
+ //
52
+ //--------------------------------------------------------------------------
53
+ /**
54
+ * Add/remove home widget
55
+ */
56
+ enableHomeWatchHandler() {
57
+ this._initHome();
58
+ }
47
59
  /**
48
60
  * Listen for changes to map info and load the appropriate map
49
61
  */
@@ -118,10 +130,7 @@ export class MapCard {
118
130
  this._searchConfiguration = this._webMapInfo.searchConfiguration;
119
131
  this.beforeMapChanged.emit();
120
132
  await this.mapView.when(() => {
121
- const home = new this.Home({
122
- view: this.mapView
123
- });
124
- this.mapView.ui.add(home, { position: "top-left", index: 3 });
133
+ this._initHome();
125
134
  this.mapView.ui.add(this._mapTools, { position: "top-right", index: 0 });
126
135
  this.mapChanged.emit({
127
136
  id: id,
@@ -130,6 +139,22 @@ export class MapCard {
130
139
  });
131
140
  }
132
141
  }
142
+ /**
143
+ * Add/remove the home widget base on enableHome prop
144
+ *
145
+ * @protected
146
+ */
147
+ _initHome() {
148
+ if (this.enableHome) {
149
+ this._homeWidget = new this.Home({
150
+ view: this.mapView
151
+ });
152
+ this.mapView.ui.add(this._homeWidget, { position: "top-left", index: 3 });
153
+ }
154
+ else if (this._homeWidget) {
155
+ this.mapView.ui.remove(this._homeWidget);
156
+ }
157
+ }
133
158
  static get is() { return "map-card"; }
134
159
  static get originalStyleUrls() {
135
160
  return {
@@ -143,6 +168,23 @@ export class MapCard {
143
168
  }
144
169
  static get properties() {
145
170
  return {
171
+ "enableHome": {
172
+ "type": "boolean",
173
+ "mutable": false,
174
+ "complexType": {
175
+ "original": "boolean",
176
+ "resolved": "boolean",
177
+ "references": {}
178
+ },
179
+ "required": false,
180
+ "optional": false,
181
+ "docs": {
182
+ "tags": [],
183
+ "text": "boolean: when true the home widget will be available"
184
+ },
185
+ "attribute": "enable-home",
186
+ "reflect": false
187
+ },
146
188
  "enableLegend": {
147
189
  "type": "boolean",
148
190
  "mutable": false,
@@ -356,6 +398,12 @@ export class MapCard {
356
398
  }];
357
399
  }
358
400
  static get elementRef() { return "el"; }
401
+ static get watchers() {
402
+ return [{
403
+ "propName": "enableHome",
404
+ "methodName": "enableHomeWatchHandler"
405
+ }];
406
+ }
359
407
  static get listeners() {
360
408
  return [{
361
409
  "name": "mapInfoChange",
@@ -28,10 +28,9 @@
28
28
  }
29
29
  </style>
30
30
 
31
- <link
32
- rel="stylesheet"
33
- href="https://jsdev.arcgis.com/4.28/esri/themes/light/main.css"
34
- />
31
+ <link rel="stylesheet" href="https://jsdev.arcgis.com/4.28/esri/themes/light/main.css" />
32
+ <!-- <link rel="stylesheet" href="https://jsdev.arcgis.com/4.28/esri/themes/dark/main.css" /> -->
33
+
35
34
  <link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
36
35
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
37
36
 
@@ -132,7 +131,9 @@
132
131
  </script>
133
132
  </head>
134
133
 
134
+ <!-- <body class="calcite-mode-dark" onload="addValues()"> -->
135
135
  <body onload="addValues()">
136
136
  <crowdsource-manager id="demo" class="crowdsource"/>
137
+ <!-- <crowdsource-manager id="demo" class="crowdsource" theme="dark"/> -->
137
138
  </body>
138
139
  </html>
@@ -130,6 +130,23 @@ export async function getLayerOrTable(mapView, id) {
130
130
  });
131
131
  return layers.length > 0 ? layers[0] : undefined;
132
132
  }
133
+ /**
134
+ * Gets all of the layers from the current map when the map and their layerView is ready
135
+ *
136
+ * @param mapView the map view to fetch the layer names from
137
+ *
138
+ * @returns Promise resolving with an array of all layers
139
+ *
140
+ */
141
+ export async function getAllLayers(mapView) {
142
+ const layers = mapView.map.allLayers.toArray();
143
+ let layerViewPromises;
144
+ await mapView.when(() => {
145
+ layerViewPromises = layers.map(l => mapView.whenLayerView(l));
146
+ });
147
+ await Promise.allSettled(layerViewPromises);
148
+ return layers;
149
+ }
133
150
  /**
134
151
  * Highlight features by OID
135
152
  *
@@ -155,6 +155,26 @@ export async function getLayerOrTable(
155
155
  return layers.length > 0 ? layers[0] : undefined;
156
156
  }
157
157
 
158
+ /**
159
+ * Gets all of the layers from the current map when the map and their layerView is ready
160
+ *
161
+ * @param mapView the map view to fetch the layer names from
162
+ *
163
+ * @returns Promise resolving with an array of all layers
164
+ *
165
+ */
166
+ export async function getAllLayers(
167
+ mapView: __esri.MapView
168
+ ): Promise<__esri.Layer[]> {
169
+ const layers = mapView.map.allLayers.toArray();
170
+ let layerViewPromises;
171
+ await mapView.when(() => {
172
+ layerViewPromises = layers.map(l => mapView.whenLayerView(l));
173
+ });
174
+ await Promise.allSettled(layerViewPromises);
175
+ return layers;
176
+ }
177
+
158
178
  /**
159
179
  * Highlight features by OID
160
180
  *
@@ -62,7 +62,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
62
62
  */
63
63
  this._shouldSetMapView = false;
64
64
  this.classicGrid = false;
65
- this.enableAutoRefresh = true;
65
+ this.enableAutoRefresh = false;
66
66
  this.enableCSV = true;
67
67
  this.enableFloorFilter = true;
68
68
  this.enableFullscreen = true;
@@ -91,6 +91,12 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
91
91
  // Watch handlers
92
92
  //
93
93
  //--------------------------------------------------------------------------
94
+ /**
95
+ * When true the map zoom tools will be available
96
+ */
97
+ enableZoomWatchHandler() {
98
+ this._initMapZoom();
99
+ }
94
100
  //--------------------------------------------------------------------------
95
101
  //
96
102
  // Methods (public)
@@ -283,7 +289,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
283
289
  const mapDisplayClass = this.classicGrid && layoutMode === ELayoutMode.GRID ? "display-flex height-full width-1-2" :
284
290
  layoutMode === ELayoutMode.GRID && !hideMap ? "" : "display-none";
285
291
  const mapContainerClass = this.classicGrid && layoutMode === ELayoutMode.GRID ? "width-full" : "adjusted-height-50";
286
- return (h("div", { class: `${mapContainerClass} overflow-hidden ${mapDisplayClass}` }, h("map-card", { basemapConfig: this.basemapConfig, class: "width-full", enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableLegend: this.enableLegend, enableSearch: this.enableSearch, hidden: this._expandPopup, mapInfos: (_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.filter(mapInfo => mapInfo.visible !== false) })));
292
+ return (h("div", { class: `${mapContainerClass} overflow-hidden ${mapDisplayClass}` }, h("map-card", { basemapConfig: this.basemapConfig, class: "width-full", enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableHome: this.enableHome, enableLegend: this.enableLegend, enableSearch: this.enableSearch, hidden: this._expandPopup, mapInfos: (_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.filter(mapInfo => mapInfo.visible !== false) })));
287
293
  }
288
294
  /**
289
295
  * Get the expand node for the popup information
@@ -339,7 +345,7 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
339
345
  const toggleSlot = this.classicGrid && layoutMode !== ELayoutMode.VERTICAL ? "footer" :
340
346
  this.classicGrid && layoutMode === ELayoutMode.VERTICAL ? "panel-end" :
341
347
  layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
342
- return (h("calcite-shell", { class: tableSizeClass + " border-bottom" }, 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))), h("div", { class: "width-full height-full position-relative" }, h("layer-table", { enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableInlineEdit: this.enableInlineEdit, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
348
+ return (h("calcite-shell", { class: tableSizeClass + " border-bottom" }, 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))), h("div", { class: "width-full height-full position-relative" }, h("layer-table", { enableAutoRefresh: this.enableAutoRefresh, enableCSV: this.enableCSV, enableInlineEdit: this.enableInlineEdit, enableZoom: this.enableZoom, mapInfo: this._mapInfo, mapView: this === null || this === void 0 ? void 0 : this._mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, showNewestFirst: this.showNewestFirst, zoomAndScrollToSelected: this.zoomAndScrollToSelected }))));
343
349
  }
344
350
  /**
345
351
  * Open/Close the appropriate panel.
@@ -375,8 +381,26 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
375
381
  _setMapView() {
376
382
  this._mapInfo = this._getMapInfo(this._mapChange.id);
377
383
  this._mapView = this._mapChange.mapView;
384
+ this._initMapZoom();
378
385
  this._mapView.popupEnabled = false;
379
386
  }
387
+ /**
388
+ * Add/remove zoom tools based on enableZoom prop
389
+ *
390
+ * @protected
391
+ */
392
+ _initMapZoom() {
393
+ if (!this.enableZoom) {
394
+ this._mapView.ui.remove("zoom");
395
+ }
396
+ else if (this.enableZoom) {
397
+ this._mapView.ui.add({
398
+ component: "zoom",
399
+ position: "top-left",
400
+ index: 0
401
+ });
402
+ }
403
+ }
380
404
  /**
381
405
  * Fetches the component's translations
382
406
  *
@@ -388,6 +412,9 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
388
412
  this._translations = messages[0];
389
413
  }
390
414
  get el() { return this; }
415
+ static get watchers() { return {
416
+ "enableZoom": ["enableZoomWatchHandler"]
417
+ }; }
391
418
  static get style() { return crowdsourceManagerCss; }
392
419
  }, [0, "crowdsource-manager", {
393
420
  "classicGrid": [4, "classic-grid"],
@@ -414,7 +441,9 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
414
441
  "_layoutMode": [32],
415
442
  "_mapView": [32],
416
443
  "_panelOpen": [32]
417
- }, [[8, "layoutChanged", "layoutChanged"], [8, "mapChanged", "mapChanged"], [8, "beforeMapChanged", "beforeMapChanged"]]]);
444
+ }, [[8, "layoutChanged", "layoutChanged"], [8, "mapChanged", "mapChanged"], [8, "beforeMapChanged", "beforeMapChanged"]], {
445
+ "enableZoom": ["enableZoomWatchHandler"]
446
+ }]);
418
447
  function defineCustomElement$1() {
419
448
  if (typeof customElements === "undefined") {
420
449
  return;
@@ -6,6 +6,7 @@
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
7
  import { l as loadModules } from './loadModules.js';
8
8
  import { g as getLocaleComponentStrings } from './locale.js';
9
+ import { a as getAllLayers } from './mapViewUtils.js';
9
10
  import { d as defineCustomElement$3 } from './icon.js';
10
11
  import { d as defineCustomElement$2 } from './loader.js';
11
12
  import { d as defineCustomElement$1 } from './notice.js';
@@ -46,7 +47,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
46
47
  var _a;
47
48
  if (v && ((_a = this.graphics) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.graphicIndex > -1) {
48
49
  this._editorLoading = true;
49
- this._initEditorWidget();
50
+ await this._initEditorWidget();
50
51
  if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
51
52
  await this._startUpdate();
52
53
  }
@@ -128,19 +129,24 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
128
129
  *
129
130
  * @returns void
130
131
  */
131
- _initEditorWidget() {
132
+ async _initEditorWidget() {
132
133
  if (this.mapView && this.graphics && this.graphics.length > 0 && this.graphics[0]) {
133
134
  if (this._editor) {
134
135
  this._editor.destroy();
135
136
  }
136
137
  const container = document.createElement("div");
138
+ const layers = await getAllLayers(this.mapView);
139
+ const layerInfos = layers.map(layer => {
140
+ return {
141
+ layer,
142
+ geometryUpdatesEnabled: false,
143
+ addEnabled: false
144
+ };
145
+ });
137
146
  this._editor = new this.Editor({
138
147
  allowedWorkflows: "update",
139
148
  view: this.mapView,
140
- layerInfos: [{
141
- layer: this._layer,
142
- geometryUpdatesEnabled: false
143
- }],
149
+ layerInfos,
144
150
  visibleElements: {
145
151
  snappingControls: false,
146
152
  sketchTooltipControls: false
@@ -151,6 +157,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
151
157
  this._editHandle.remove();
152
158
  this._attachmentHandle.remove();
153
159
  this._activeWorkflowHandle.remove();
160
+ this._addRelatedRecordHandle.remove();
154
161
  }
155
162
  this._attachmentHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "adding-attachment" ||
156
163
  this._editor.viewModel.state === "editing-attachment" ||
@@ -170,6 +177,12 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
170
177
  this._shouldClose = false;
171
178
  }
172
179
  });
180
+ // Temp workaround until a new prop is added at 4.29
181
+ this._addRelatedRecordHandle = this.reactiveUtils.when(() => !!this._editor.viewModel.featureFormViewModel.relatedRecordCallbacks, () => {
182
+ this._editor.viewModel.featureFormViewModel.relatedRecordCallbacks.addRelatedRecord = null;
183
+ }, {
184
+ once: true
185
+ });
173
186
  // had issues with destroy before adding like this
174
187
  this._editContainer.appendChild(container);
175
188
  }