@esri/solutions-components 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/assets/t9n/map-tools/resources.json +2 -2
  2. package/dist/assets/t9n/map-tools/resources_en.json +2 -2
  3. package/dist/cjs/basemap-gallery_7.cjs.entry.js +38 -20
  4. package/dist/cjs/calcite-alert_3.cjs.entry.js +17 -13
  5. package/dist/cjs/card-manager_3.cjs.entry.js +9 -9
  6. package/dist/cjs/crowdsource-manager.cjs.entry.js +30 -5
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/solutions-components.cjs.js +1 -1
  9. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +70 -5
  10. package/dist/collection/components/edit-card/edit-card.js +30 -13
  11. package/dist/collection/components/info-card/info-card.js +12 -0
  12. package/dist/collection/components/layer-table/layer-table.css +7 -1
  13. package/dist/collection/components/layer-table/layer-table.js +7 -7
  14. package/dist/collection/components/map-card/map-card.js +1 -1
  15. package/dist/collection/components/map-fullscreen/map-fullscreen.js +33 -17
  16. package/dist/collection/components/map-tools/map-tools.js +22 -3
  17. package/dist/components/crowdsource-manager.js +34 -5
  18. package/dist/components/edit-card2.js +11 -13
  19. package/dist/components/info-card2.js +7 -1
  20. package/dist/components/layer-table2.js +8 -8
  21. package/dist/components/map-card2.js +1 -1
  22. package/dist/components/map-fullscreen2.js +17 -18
  23. package/dist/components/map-tools2.js +22 -3
  24. package/dist/esm/basemap-gallery_7.entry.js +38 -20
  25. package/dist/esm/calcite-alert_3.entry.js +17 -13
  26. package/dist/esm/card-manager_3.entry.js +9 -9
  27. package/dist/esm/crowdsource-manager.entry.js +30 -5
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/esm/solutions-components.js +1 -1
  30. package/dist/solutions-components/{p-3272b303.entry.js → p-14236e25.entry.js} +1 -1
  31. package/dist/solutions-components/p-4b3ebd24.entry.js +6 -0
  32. package/dist/solutions-components/p-a4a0c7c5.entry.js +6 -0
  33. package/dist/solutions-components/p-b070bd54.entry.js +6 -0
  34. package/dist/solutions-components/solutions-components.esm.js +1 -1
  35. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +27 -2
  36. package/dist/types/components/edit-card/edit-card.d.ts +5 -0
  37. package/dist/types/components/info-card/info-card.d.ts +4 -0
  38. package/dist/types/components/layer-table/layer-table.d.ts +1 -1
  39. package/dist/types/components/map-fullscreen/map-fullscreen.d.ts +14 -1
  40. package/dist/types/components/map-tools/map-tools.d.ts +8 -0
  41. package/dist/types/components.d.ts +40 -0
  42. package/dist/types/preact.d.ts +5 -2
  43. package/package.json +1 -1
  44. package/dist/solutions-components/p-089dc6bf.entry.js +0 -6
  45. package/dist/solutions-components/p-dfb33c83.entry.js +0 -6
  46. package/dist/solutions-components/p-ed254530.entry.js +0 -6
@@ -29,8 +29,10 @@ export class CrowdsourceManager {
29
29
  */
30
30
  this._shouldSetMapView = false;
31
31
  this.classicGrid = false;
32
+ this.defaultCenter = "";
32
33
  this.defaultGlobalId = "";
33
34
  this.defaultLayer = "";
35
+ this.defaultLevel = "";
34
36
  this.defaultOid = "";
35
37
  this.defaultWebmap = "";
36
38
  this.enableAutoRefresh = false;
@@ -64,6 +66,13 @@ export class CrowdsourceManager {
64
66
  // Watch handlers
65
67
  //
66
68
  //--------------------------------------------------------------------------
69
+ /**
70
+ * Watch for center url param to be set
71
+ */
72
+ defaultCenterWatchHandler() {
73
+ this._defaultCenter = !this.defaultCenter ? undefined :
74
+ this.defaultCenter.split(";").map(v => parseFloat(v));
75
+ }
67
76
  /**
68
77
  * Watch for globalid url param to be set
69
78
  */
@@ -78,6 +87,12 @@ export class CrowdsourceManager {
78
87
  this._defaultOid = !this.defaultOid ? undefined :
79
88
  this.defaultOid.indexOf(",") > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
80
89
  }
90
+ /**
91
+ * Watch for zoom level param to be set
92
+ */
93
+ defaultLevelWatchHandler() {
94
+ this._defaultLevel = !this.defaultLevel ? undefined : parseInt(this.defaultLevel, 10);
95
+ }
81
96
  /**
82
97
  * When true the map zoom tools will be available
83
98
  */
@@ -105,8 +120,8 @@ export class CrowdsourceManager {
105
120
  */
106
121
  async mapChanged(evt) {
107
122
  this._mapChange = evt.detail;
108
- await this._mapChange.mapView.when(() => {
109
- this._setMapView();
123
+ await this._mapChange.mapView.when(async () => {
124
+ await this._setMapView();
110
125
  });
111
126
  }
112
127
  /**
@@ -141,10 +156,10 @@ export class CrowdsourceManager {
141
156
  * Called after each render
142
157
  * Used to delay the setting of the mapView when the popup is expaneded and obstructs the view
143
158
  */
144
- componentDidRender() {
159
+ async componentDidRender() {
145
160
  if (this._shouldSetMapView) {
146
161
  this._shouldSetMapView = false;
147
- this._setMapView();
162
+ await this._setMapView();
148
163
  }
149
164
  }
150
165
  //--------------------------------------------------------------------------
@@ -366,11 +381,19 @@ export class CrowdsourceManager {
366
381
  *
367
382
  * @protected
368
383
  */
369
- _setMapView() {
384
+ async _setMapView() {
370
385
  this._mapInfo = this._getMapInfo(this._mapChange.id);
371
386
  this._mapView = this._mapChange.mapView;
372
387
  this._initMapZoom();
373
388
  this._mapView.popupEnabled = false;
389
+ if (this._defaultCenter && this._defaultLevel) {
390
+ await this._mapView.goTo({
391
+ center: this._defaultCenter,
392
+ zoom: this._defaultLevel
393
+ });
394
+ this._defaultCenter = undefined;
395
+ this._defaultLevel = undefined;
396
+ }
374
397
  }
375
398
  /**
376
399
  * Add/remove zoom tools based on enableZoom prop
@@ -430,6 +453,24 @@ export class CrowdsourceManager {
430
453
  "reflect": false,
431
454
  "defaultValue": "false"
432
455
  },
456
+ "defaultCenter": {
457
+ "type": "string",
458
+ "mutable": false,
459
+ "complexType": {
460
+ "original": "string",
461
+ "resolved": "string",
462
+ "references": {}
463
+ },
464
+ "required": false,
465
+ "optional": false,
466
+ "docs": {
467
+ "tags": [],
468
+ "text": "string: default center point values for the map\r\n; delimited x;y pair"
469
+ },
470
+ "attribute": "default-center",
471
+ "reflect": false,
472
+ "defaultValue": "\"\""
473
+ },
433
474
  "defaultGlobalId": {
434
475
  "type": "string",
435
476
  "mutable": false,
@@ -466,6 +507,24 @@ export class CrowdsourceManager {
466
507
  "reflect": false,
467
508
  "defaultValue": "\"\""
468
509
  },
510
+ "defaultLevel": {
511
+ "type": "string",
512
+ "mutable": false,
513
+ "complexType": {
514
+ "original": "string",
515
+ "resolved": "string",
516
+ "references": {}
517
+ },
518
+ "required": false,
519
+ "optional": false,
520
+ "docs": {
521
+ "tags": [],
522
+ "text": "string: default zoom level"
523
+ },
524
+ "attribute": "default-level",
525
+ "reflect": false,
526
+ "defaultValue": "\"\""
527
+ },
469
528
  "defaultOid": {
470
529
  "type": "string",
471
530
  "mutable": false,
@@ -892,11 +951,17 @@ export class CrowdsourceManager {
892
951
  static get elementRef() { return "el"; }
893
952
  static get watchers() {
894
953
  return [{
954
+ "propName": "defaultCenter",
955
+ "methodName": "defaultCenterWatchHandler"
956
+ }, {
895
957
  "propName": "defaultGlobalId",
896
958
  "methodName": "defaultGlobalIdWatchHandler"
897
959
  }, {
898
960
  "propName": "defaultOid",
899
961
  "methodName": "defaultOidWatchHandler"
962
+ }, {
963
+ "propName": "defaultLevel",
964
+ "methodName": "defaultLevelWatchHandler"
900
965
  }, {
901
966
  "propName": "enableZoom",
902
967
  "methodName": "enableZoomWatchHandler"
@@ -94,7 +94,7 @@ export class EditCard {
94
94
  }
95
95
  this._layerEditHandle = this._layer.on("edits", () => {
96
96
  this.editsComplete.emit();
97
- void this._closeEdit();
97
+ this.open = false;
98
98
  });
99
99
  }
100
100
  }
@@ -157,8 +157,7 @@ export class EditCard {
157
157
  },
158
158
  container
159
159
  });
160
- if (this._editHandle && this._attachmentHandle && this._activeWorkflowHandle) {
161
- this._editHandle.remove();
160
+ if (this._attachmentHandle && this._activeWorkflowHandle) {
162
161
  this._attachmentHandle.remove();
163
162
  this._activeWorkflowHandle.remove();
164
163
  }
@@ -167,18 +166,13 @@ export class EditCard {
167
166
  this._editor.viewModel.state === "creating-features", () => {
168
167
  this._shouldClose = false;
169
168
  });
170
- this._editHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "ready", () => {
171
- if (this._shouldClose) {
172
- void this._closeEdit();
173
- }
174
- else if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
175
- void this._startUpdate();
176
- }
177
- });
178
169
  this._activeWorkflowHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.activeWorkflow) === null || _a === void 0 ? void 0 : _a.activeWorkflow; }, (activeWorkflow) => {
179
170
  if ((activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "update-table-record" || (activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "create-features") {
180
171
  this._shouldClose = false;
181
172
  }
173
+ if (!(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) && !(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.hasPendingEdits)) {
174
+ this.open = false;
175
+ }
182
176
  });
183
177
  // had issues with destroy before adding like this
184
178
  this._editContainer.appendChild(container);
@@ -190,12 +184,15 @@ export class EditCard {
190
184
  * @returns void
191
185
  */
192
186
  async _closeEdit() {
193
- var _a, _b, _c;
187
+ var _a, _b, _c, _d;
194
188
  this._shouldClose = true;
195
189
  if ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow) {
196
190
  await ((_b = this._editor) === null || _b === void 0 ? void 0 : _b.cancelWorkflow());
197
191
  }
198
- (_c = this._editor) === null || _c === void 0 ? void 0 : _c.destroy();
192
+ if (this.graphicIndex > -1 && ((_c = this.graphics) === null || _c === void 0 ? void 0 : _c.length) > 0) {
193
+ this.refreshGraphics.emit(this.graphics);
194
+ }
195
+ (_d = this._editor) === null || _d === void 0 ? void 0 : _d.destroy();
199
196
  this._shouldClose = false;
200
197
  this.closeEdit.emit();
201
198
  }
@@ -345,6 +342,26 @@ export class EditCard {
345
342
  "resolved": "void",
346
343
  "references": {}
347
344
  }
345
+ }, {
346
+ "method": "refreshGraphics",
347
+ "name": "refreshGraphics",
348
+ "bubbles": true,
349
+ "cancelable": true,
350
+ "composed": true,
351
+ "docs": {
352
+ "tags": [],
353
+ "text": "Emitted on demand when the editor is closed to handle\r\nthings like attachment updates that don't fire the standard edit update event when complete"
354
+ },
355
+ "complexType": {
356
+ "original": "__esri.Graphic[]",
357
+ "resolved": "Graphic[]",
358
+ "references": {
359
+ "___esri": {
360
+ "location": "global",
361
+ "id": "global::___esri"
362
+ }
363
+ }
364
+ }
348
365
  }];
349
366
  }
350
367
  static get elementRef() { return "el"; }
@@ -85,6 +85,12 @@ export class InfoCard {
85
85
  async closeEdit() {
86
86
  this._editRecordOpen = false;
87
87
  }
88
+ /**
89
+ * Refresh the info-card graphics
90
+ */
91
+ async refreshGraphics(evt) {
92
+ this.graphics = [...evt.detail];
93
+ }
88
94
  //--------------------------------------------------------------------------
89
95
  //
90
96
  // Functions (lifecycle)
@@ -413,6 +419,12 @@ export class InfoCard {
413
419
  "target": "window",
414
420
  "capture": false,
415
421
  "passive": false
422
+ }, {
423
+ "name": "refreshGraphics",
424
+ "method": "refreshGraphics",
425
+ "target": "window",
426
+ "capture": false,
427
+ "passive": false
416
428
  }];
417
429
  }
418
430
  }
@@ -108,8 +108,9 @@ vaadin-grid-cell-content {
108
108
  .share-action {
109
109
  position: absolute;
110
110
  right: 0;
111
- margin-top: 9px;
111
+ margin-top: 4px;
112
112
  margin-inline-end: 4px;
113
+ margin-bottom: 4px;
113
114
  }
114
115
 
115
116
  html[dir="rtl"] .share-action {
@@ -124,3 +125,8 @@ html[dir="rtl"] .share-action {
124
125
  opacity: var(--calcite-ui-opacity-disabled);
125
126
  pointer-events: none;
126
127
  }
128
+
129
+ .instant-app-share {
130
+ height: 42px !important;
131
+ display: inline-flex;
132
+ }
@@ -613,7 +613,7 @@ export class LayerTable {
613
613
  * @returns VNode The node representing the DOM element that will contain the action
614
614
  */
615
615
  _getShare(icon) {
616
- return (h("div", { class: "share-action", id: this._getId(icon) }, h("instant-apps-social-share", { autoUpdateShareUrl: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", socialMedia: true, view: this.mapView }), this._getToolTip("bottom", icon, this._translations.share)));
616
+ return (h("div", { class: "share-action", id: this._getId(icon) }, h("instant-apps-social-share", { autoUpdateShareUrl: false, class: "instant-app-share", popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", socialMedia: true, view: this.mapView }), this._getToolTip("bottom", icon, this._translations.share)));
617
617
  }
618
618
  /**
619
619
  * Called each time the values that are used for custom url params change
@@ -732,11 +732,11 @@ export class LayerTable {
732
732
  * @returns void
733
733
  */
734
734
  async _resetTable() {
735
- var _a, _b;
735
+ var _a;
736
736
  this._clearSelection();
737
737
  this._allIds = [];
738
738
  this.featureSelectionChange.emit(this._selectedIndexes);
739
- const columnTemplates = this._getColumnTemplates(this._layer.id, (_b = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.popupTemplate) === null || _b === void 0 ? void 0 : _b.fieldInfos);
739
+ const columnTemplates = this._getColumnTemplates(this._layer.id, (_a = this._layer) === null || _a === void 0 ? void 0 : _a.fields);
740
740
  this._allIds = await queryAllIds(this._layer);
741
741
  if (!this._table) {
742
742
  await this._getTable(this._tableNode, columnTemplates);
@@ -1067,8 +1067,8 @@ export class LayerTable {
1067
1067
  if (fieldInfos) {
1068
1068
  columnTemplates = columnTemplates ? columnTemplates.map(columnTemplate => {
1069
1069
  fieldInfos.some(fieldInfo => {
1070
- if (fieldInfo.fieldName === columnTemplate.fieldName) {
1071
- columnTemplate.label = fieldInfo.label;
1070
+ if (fieldInfo.name === columnTemplate.fieldName) {
1071
+ columnTemplate.label = fieldInfo.alias;
1072
1072
  return true;
1073
1073
  }
1074
1074
  });
@@ -1076,8 +1076,8 @@ export class LayerTable {
1076
1076
  }) : fieldInfos.map(fieldInfo => {
1077
1077
  return {
1078
1078
  type: "field",
1079
- fieldName: fieldInfo.fieldName,
1080
- label: fieldInfo.label
1079
+ fieldName: fieldInfo.name,
1080
+ label: fieldInfo.alias
1081
1081
  };
1082
1082
  });
1083
1083
  }
@@ -134,7 +134,7 @@ export class MapCard {
134
134
  this.mapView = new this.MapView({
135
135
  container: this._mapDiv,
136
136
  map: webMap,
137
- resizeAlign: "top-left"
137
+ resizeAlign: "center"
138
138
  });
139
139
  this._loadedId = id;
140
140
  this._searchConfiguration = this._webMapInfo.searchConfiguration;
@@ -36,22 +36,12 @@ export class MapFullscreen {
36
36
  * @returns Promise when complete
37
37
  */
38
38
  async mapViewWatchHandler() {
39
- await this.mapView.when(() => {
40
- this._initFullscreenWidget();
39
+ await this.mapView.when(async () => {
40
+ await this._initFullscreenWidget();
41
41
  });
42
42
  }
43
43
  //--------------------------------------------------------------------------
44
44
  //
45
- // Methods (public)
46
- //
47
- //--------------------------------------------------------------------------
48
- //--------------------------------------------------------------------------
49
- //
50
- // Events (public)
51
- //
52
- //--------------------------------------------------------------------------
53
- //--------------------------------------------------------------------------
54
- //
55
45
  // Functions (lifecycle)
56
46
  //
57
47
  //--------------------------------------------------------------------------
@@ -72,13 +62,13 @@ export class MapFullscreen {
72
62
  * It's never called during the first render().
73
63
  */
74
64
  async componentDidUpdate() {
75
- this._initFullscreenWidget();
65
+ await this._initFullscreenWidget();
76
66
  }
77
67
  /**
78
68
  * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
79
69
  */
80
70
  async componentDidLoad() {
81
- this._initFullscreenWidget();
71
+ await this._initFullscreenWidget();
82
72
  }
83
73
  //--------------------------------------------------------------------------
84
74
  //
@@ -93,21 +83,29 @@ export class MapFullscreen {
93
83
  * @protected
94
84
  */
95
85
  async _initModules() {
96
- const [Fullscreen] = await loadModules([
97
- "esri/widgets/Fullscreen"
86
+ const [Fullscreen, reactiveUtils] = await loadModules([
87
+ "esri/widgets/Fullscreen",
88
+ "esri/core/reactiveUtils"
98
89
  ]);
99
90
  this.Fullscreen = Fullscreen;
91
+ this.reactiveUtils = reactiveUtils;
100
92
  }
101
93
  /**
102
94
  * Initialize the search widget
103
95
  *
104
96
  * @protected
105
97
  */
106
- _initFullscreenWidget() {
98
+ async _initFullscreenWidget() {
107
99
  if (this.mapView && this._fullscreenElement && !this.fullscreenWidget) {
108
100
  this.fullscreenWidget = new this.Fullscreen({
109
101
  view: this.mapView
110
102
  });
103
+ await this.fullscreenWidget.when(() => {
104
+ if (this._fullscreenStateChangeHandle) {
105
+ this._fullscreenStateChangeHandle.remove();
106
+ }
107
+ this._fullscreenStateChangeHandle = this.reactiveUtils.watch(() => this.fullscreenWidget.viewModel.state, (state) => this.fullscreenStateChange.emit(state));
108
+ });
111
109
  }
112
110
  else if (this.fullscreenWidget) {
113
111
  this.fullscreenWidget.view = this.mapView;
@@ -169,6 +167,24 @@ export class MapFullscreen {
169
167
  }
170
168
  };
171
169
  }
170
+ static get events() {
171
+ return [{
172
+ "method": "fullscreenStateChange",
173
+ "name": "fullscreenStateChange",
174
+ "bubbles": true,
175
+ "cancelable": true,
176
+ "composed": true,
177
+ "docs": {
178
+ "tags": [],
179
+ "text": "Emitted on demand when the fullscreen widget state has changed"
180
+ },
181
+ "complexType": {
182
+ "original": "string",
183
+ "resolved": "string",
184
+ "references": {}
185
+ }
186
+ }];
187
+ }
172
188
  static get watchers() {
173
189
  return [{
174
190
  "propName": "mapView",
@@ -89,10 +89,14 @@ export class MapTools {
89
89
  async _showFullscreenWatchHandler(v) {
90
90
  const fs = this._fullscreenElement.fullscreenWidget;
91
91
  if (v) {
92
- fs.viewModel.enter();
92
+ if (fs.viewModel.state === "ready") {
93
+ fs.viewModel.enter();
94
+ }
93
95
  }
94
96
  else {
95
- fs.viewModel.exit();
97
+ if (fs.viewModel.state === "active") {
98
+ fs.viewModel.exit();
99
+ }
96
100
  }
97
101
  }
98
102
  /**
@@ -169,7 +173,22 @@ export class MapTools {
169
173
  this._getActionGroup("basemap", false, this._translations.basemap, () => this._toggleBasemapPicker()) :
170
174
  undefined, this.enableFloorFilter && this._hasFloorInfo ?
171
175
  this._getActionGroup("urban-model", false, this._translations.floorFilter, () => this._toggleFloorFilter()) :
172
- undefined)), h("basemap-gallery", { basemapConfig: this.basemapConfig, class: basemapClass, mapView: this.mapView, ref: (el) => { this._basemapElement = el; } }), h("map-search", { class: searchClass, mapView: this.mapView, ref: (el) => { this._searchElement = el; }, resultGraphicEnabled: true, searchConfiguration: this.searchConfiguration }), h("map-legend", { class: legendClass, mapView: this.mapView, ref: (el) => { this._legendElement = el; } }), h("map-fullscreen", { class: fullscreenClass, mapView: this.mapView, ref: (el) => { this._fullscreenElement = el; } }), h("floor-filter", { class: floorFilterClass, enabled: this.enableFloorFilter, mapView: this.mapView, ref: (el) => { this._floorFilterElement = el; } })));
176
+ undefined)), h("basemap-gallery", { basemapConfig: this.basemapConfig, class: basemapClass, mapView: this.mapView, ref: (el) => { this._basemapElement = el; } }), h("map-search", { class: searchClass, mapView: this.mapView, ref: (el) => { this._searchElement = el; }, resultGraphicEnabled: true, searchConfiguration: this.searchConfiguration }), h("map-legend", { class: legendClass, mapView: this.mapView, ref: (el) => { this._legendElement = el; } }), h("map-fullscreen", { class: fullscreenClass, mapView: this.mapView, onFullscreenStateChange: (evt) => this._fullscreenStateChange(evt.detail), ref: (el) => { this._fullscreenElement = el; } }), h("floor-filter", { class: floorFilterClass, enabled: this.enableFloorFilter, mapView: this.mapView, ref: (el) => { this._floorFilterElement = el; } })));
177
+ }
178
+ /**
179
+ * Respond to fullscreen state change and ensure our state var is in sync
180
+ *
181
+ * @param state The fullscreen view model's state.
182
+ *
183
+ * @protected
184
+ */
185
+ _fullscreenStateChange(state) {
186
+ if (state === "ready" && this._showFullscreen) {
187
+ this._showFullscreen = false;
188
+ }
189
+ else if (state === "active" && !this._showFullscreen) {
190
+ this._showFullscreen = true;
191
+ }
173
192
  }
174
193
  //--------------------------------------------------------------------------
175
194
  //
@@ -63,8 +63,10 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
63
63
  */
64
64
  this._shouldSetMapView = false;
65
65
  this.classicGrid = false;
66
+ this.defaultCenter = "";
66
67
  this.defaultGlobalId = "";
67
68
  this.defaultLayer = "";
69
+ this.defaultLevel = "";
68
70
  this.defaultOid = "";
69
71
  this.defaultWebmap = "";
70
72
  this.enableAutoRefresh = false;
@@ -98,6 +100,13 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
98
100
  // Watch handlers
99
101
  //
100
102
  //--------------------------------------------------------------------------
103
+ /**
104
+ * Watch for center url param to be set
105
+ */
106
+ defaultCenterWatchHandler() {
107
+ this._defaultCenter = !this.defaultCenter ? undefined :
108
+ this.defaultCenter.split(";").map(v => parseFloat(v));
109
+ }
101
110
  /**
102
111
  * Watch for globalid url param to be set
103
112
  */
@@ -112,6 +121,12 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
112
121
  this._defaultOid = !this.defaultOid ? undefined :
113
122
  this.defaultOid.indexOf(",") > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
114
123
  }
124
+ /**
125
+ * Watch for zoom level param to be set
126
+ */
127
+ defaultLevelWatchHandler() {
128
+ this._defaultLevel = !this.defaultLevel ? undefined : parseInt(this.defaultLevel, 10);
129
+ }
115
130
  /**
116
131
  * When true the map zoom tools will be available
117
132
  */
@@ -139,8 +154,8 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
139
154
  */
140
155
  async mapChanged(evt) {
141
156
  this._mapChange = evt.detail;
142
- await this._mapChange.mapView.when(() => {
143
- this._setMapView();
157
+ await this._mapChange.mapView.when(async () => {
158
+ await this._setMapView();
144
159
  });
145
160
  }
146
161
  /**
@@ -175,10 +190,10 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
175
190
  * Called after each render
176
191
  * Used to delay the setting of the mapView when the popup is expaneded and obstructs the view
177
192
  */
178
- componentDidRender() {
193
+ async componentDidRender() {
179
194
  if (this._shouldSetMapView) {
180
195
  this._shouldSetMapView = false;
181
- this._setMapView();
196
+ await this._setMapView();
182
197
  }
183
198
  }
184
199
  //--------------------------------------------------------------------------
@@ -400,11 +415,19 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
400
415
  *
401
416
  * @protected
402
417
  */
403
- _setMapView() {
418
+ async _setMapView() {
404
419
  this._mapInfo = this._getMapInfo(this._mapChange.id);
405
420
  this._mapView = this._mapChange.mapView;
406
421
  this._initMapZoom();
407
422
  this._mapView.popupEnabled = false;
423
+ if (this._defaultCenter && this._defaultLevel) {
424
+ await this._mapView.goTo({
425
+ center: this._defaultCenter,
426
+ zoom: this._defaultLevel
427
+ });
428
+ this._defaultCenter = undefined;
429
+ this._defaultLevel = undefined;
430
+ }
408
431
  }
409
432
  /**
410
433
  * Add/remove zoom tools based on enableZoom prop
@@ -435,15 +458,19 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
435
458
  }
436
459
  get el() { return this; }
437
460
  static get watchers() { return {
461
+ "defaultCenter": ["defaultCenterWatchHandler"],
438
462
  "defaultGlobalId": ["defaultGlobalIdWatchHandler"],
439
463
  "defaultOid": ["defaultOidWatchHandler"],
464
+ "defaultLevel": ["defaultLevelWatchHandler"],
440
465
  "enableZoom": ["enableZoomWatchHandler"]
441
466
  }; }
442
467
  static get style() { return crowdsourceManagerCss; }
443
468
  }, [0, "crowdsource-manager", {
444
469
  "classicGrid": [4, "classic-grid"],
470
+ "defaultCenter": [1, "default-center"],
445
471
  "defaultGlobalId": [1, "default-global-id"],
446
472
  "defaultLayer": [1, "default-layer"],
473
+ "defaultLevel": [1, "default-level"],
447
474
  "defaultOid": [1, "default-oid"],
448
475
  "defaultWebmap": [1, "default-webmap"],
449
476
  "enableAutoRefresh": [4, "enable-auto-refresh"],
@@ -472,8 +499,10 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
472
499
  "_mapView": [32],
473
500
  "_panelOpen": [32]
474
501
  }, [[8, "layoutChanged", "layoutChanged"], [8, "mapChanged", "mapChanged"], [8, "beforeMapChanged", "beforeMapChanged"]], {
502
+ "defaultCenter": ["defaultCenterWatchHandler"],
475
503
  "defaultGlobalId": ["defaultGlobalIdWatchHandler"],
476
504
  "defaultOid": ["defaultOidWatchHandler"],
505
+ "defaultLevel": ["defaultLevelWatchHandler"],
477
506
  "enableZoom": ["enableZoomWatchHandler"]
478
507
  }]);
479
508
  function defineCustomElement$1() {
@@ -19,6 +19,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
19
19
  this.__registerHost();
20
20
  this.closeEdit = createEvent(this, "closeEdit", 7);
21
21
  this.editsComplete = createEvent(this, "editsComplete", 7);
22
+ this.refreshGraphics = createEvent(this, "refreshGraphics", 7);
22
23
  /**
23
24
  * boolean: When true the Editor widget should be closed
24
25
  */
@@ -89,7 +90,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
89
90
  }
90
91
  this._layerEditHandle = this._layer.on("edits", () => {
91
92
  this.editsComplete.emit();
92
- void this._closeEdit();
93
+ this.open = false;
93
94
  });
94
95
  }
95
96
  }
@@ -152,8 +153,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
152
153
  },
153
154
  container
154
155
  });
155
- if (this._editHandle && this._attachmentHandle && this._activeWorkflowHandle) {
156
- this._editHandle.remove();
156
+ if (this._attachmentHandle && this._activeWorkflowHandle) {
157
157
  this._attachmentHandle.remove();
158
158
  this._activeWorkflowHandle.remove();
159
159
  }
@@ -162,18 +162,13 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
162
162
  this._editor.viewModel.state === "creating-features", () => {
163
163
  this._shouldClose = false;
164
164
  });
165
- this._editHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "ready", () => {
166
- if (this._shouldClose) {
167
- void this._closeEdit();
168
- }
169
- else if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
170
- void this._startUpdate();
171
- }
172
- });
173
165
  this._activeWorkflowHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.activeWorkflow) === null || _a === void 0 ? void 0 : _a.activeWorkflow; }, (activeWorkflow) => {
174
166
  if ((activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "update-table-record" || (activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) === "create-features") {
175
167
  this._shouldClose = false;
176
168
  }
169
+ if (!(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.type) && !(activeWorkflow === null || activeWorkflow === void 0 ? void 0 : activeWorkflow.hasPendingEdits)) {
170
+ this.open = false;
171
+ }
177
172
  });
178
173
  // had issues with destroy before adding like this
179
174
  this._editContainer.appendChild(container);
@@ -185,12 +180,15 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
185
180
  * @returns void
186
181
  */
187
182
  async _closeEdit() {
188
- var _a, _b, _c;
183
+ var _a, _b, _c, _d;
189
184
  this._shouldClose = true;
190
185
  if ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.activeWorkflow) {
191
186
  await ((_b = this._editor) === null || _b === void 0 ? void 0 : _b.cancelWorkflow());
192
187
  }
193
- (_c = this._editor) === null || _c === void 0 ? void 0 : _c.destroy();
188
+ if (this.graphicIndex > -1 && ((_c = this.graphics) === null || _c === void 0 ? void 0 : _c.length) > 0) {
189
+ this.refreshGraphics.emit(this.graphics);
190
+ }
191
+ (_d = this._editor) === null || _d === void 0 ? void 0 : _d.destroy();
194
192
  this._shouldClose = false;
195
193
  this.closeEdit.emit();
196
194
  }