@esri/solutions-components 0.6.25 → 0.6.27

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 (45) hide show
  1. package/dist/cjs/buffer-tools_4.cjs.entry.js +28 -7
  2. package/dist/cjs/calcite-alert_3.cjs.entry.js +29 -17
  3. package/dist/cjs/card-manager_3.cjs.entry.js +8 -5
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/map-select-tools_3.cjs.entry.js +14 -13
  6. package/dist/cjs/public-notification.cjs.entry.js +4 -4
  7. package/dist/cjs/solutions-components.cjs.js +1 -1
  8. package/dist/collection/components/buffer-tools/buffer-tools.js +55 -7
  9. package/dist/collection/components/edit-card/edit-card.js +29 -17
  10. package/dist/collection/components/layer-table/layer-table.css +4 -0
  11. package/dist/collection/components/layer-table/layer-table.js +2 -2
  12. package/dist/collection/components/map-card/map-card.js +5 -2
  13. package/dist/collection/components/map-select-tools/map-select-tools.js +14 -13
  14. package/dist/collection/components/public-notification/public-notification.css +0 -9
  15. package/dist/collection/components/public-notification/public-notification.js +3 -3
  16. package/dist/collection/demos/crowdsource-manager.html +3 -0
  17. package/dist/components/buffer-tools2.js +30 -8
  18. package/dist/components/edit-card2.js +29 -17
  19. package/dist/components/layer-table2.js +3 -3
  20. package/dist/components/map-card2.js +5 -2
  21. package/dist/components/map-select-tools2.js +14 -13
  22. package/dist/components/public-notification.js +4 -4
  23. package/dist/esm/buffer-tools_4.entry.js +28 -7
  24. package/dist/esm/calcite-alert_3.entry.js +29 -17
  25. package/dist/esm/card-manager_3.entry.js +8 -5
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/map-select-tools_3.entry.js +14 -13
  28. package/dist/esm/public-notification.entry.js +4 -4
  29. package/dist/esm/solutions-components.js +1 -1
  30. package/dist/solutions-components/demos/crowdsource-manager.html +3 -0
  31. package/dist/solutions-components/{p-f5a593f4.entry.js → p-3fe6368e.entry.js} +1 -1
  32. package/dist/solutions-components/p-8144c528.entry.js +6 -0
  33. package/dist/solutions-components/p-86893d46.entry.js +6 -0
  34. package/dist/solutions-components/{p-cfe4ec71.entry.js → p-c68d870a.entry.js} +3 -3
  35. package/dist/solutions-components/p-ce3b40ca.entry.js +6 -0
  36. package/dist/solutions-components/solutions-components.esm.js +1 -1
  37. package/dist/types/components/buffer-tools/buffer-tools.d.ts +18 -0
  38. package/dist/types/components/edit-card/edit-card.d.ts +12 -0
  39. package/dist/types/components/map-card/map-card.d.ts +1 -0
  40. package/dist/types/components/map-select-tools/map-select-tools.d.ts +4 -4
  41. package/dist/types/components.d.ts +5 -0
  42. package/package.json +1 -1
  43. package/dist/solutions-components/p-3c4e583c.entry.js +0 -6
  44. package/dist/solutions-components/p-5bd796dd.entry.js +0 -6
  45. package/dist/solutions-components/p-dc477b27.entry.js +0 -6
@@ -52,6 +52,19 @@ export class BufferTools {
52
52
  }
53
53
  //--------------------------------------------------------------------------
54
54
  //
55
+ // Methods (public)
56
+ //
57
+ //--------------------------------------------------------------------------
58
+ /**
59
+ * Get the translated unit for display
60
+ *
61
+ * @returns Promise resolving with the translated unit
62
+ */
63
+ async getTranslatedUnit(unit) {
64
+ return this._units[unit];
65
+ }
66
+ //--------------------------------------------------------------------------
67
+ //
55
68
  // Functions (lifecycle)
56
69
  //
57
70
  //--------------------------------------------------------------------------
@@ -63,6 +76,7 @@ export class BufferTools {
63
76
  async componentWillLoad() {
64
77
  await this._getTranslations();
65
78
  await this._initModules();
79
+ this._initTranslatedUnits();
66
80
  }
67
81
  /**
68
82
  * Renders the component.
@@ -89,21 +103,28 @@ export class BufferTools {
89
103
  this._geometryEngine = geometryEngine;
90
104
  }
91
105
  /**
92
- * Gets the nodes for each of the possible distance units
93
- *
94
- * @returns An array of option nodes
106
+ * Init the lookup hash for translated units
95
107
  *
96
108
  * @protected
97
109
  */
98
- _getUnits() {
99
- const units = {
110
+ _initTranslatedUnits() {
111
+ this._units = {
100
112
  "feet": this._translations.feet,
101
113
  "meters": this._translations.meters,
102
114
  "miles": this._translations.miles,
103
115
  "kilometers": this._translations.kilometers
104
116
  };
105
- return Object.keys(units).map(u => {
106
- return (h("calcite-option", { label: units[u], selected: this.unit === u, value: u }));
117
+ }
118
+ /**
119
+ * Gets the nodes for each of the possible distance units
120
+ *
121
+ * @returns An array of option nodes
122
+ *
123
+ * @protected
124
+ */
125
+ _getUnits() {
126
+ return Object.keys(this._units).map(u => {
127
+ return (h("calcite-option", { label: this._units[u], selected: this.unit === u, value: u }));
107
128
  });
108
129
  }
109
130
  /**
@@ -470,6 +491,33 @@ export class BufferTools {
470
491
  }
471
492
  }];
472
493
  }
494
+ static get methods() {
495
+ return {
496
+ "getTranslatedUnit": {
497
+ "complexType": {
498
+ "signature": "(unit: string) => Promise<string>",
499
+ "parameters": [{
500
+ "tags": [],
501
+ "text": ""
502
+ }],
503
+ "references": {
504
+ "Promise": {
505
+ "location": "global",
506
+ "id": "global::Promise"
507
+ }
508
+ },
509
+ "return": "Promise<string>"
510
+ },
511
+ "docs": {
512
+ "text": "Get the translated unit for display",
513
+ "tags": [{
514
+ "name": "returns",
515
+ "text": "Promise resolving with the translated unit"
516
+ }]
517
+ }
518
+ }
519
+ };
520
+ }
473
521
  static get elementRef() { return "el"; }
474
522
  static get watchers() {
475
523
  return [{
@@ -44,8 +44,7 @@ export class EditCard {
44
44
  */
45
45
  async graphicsWatchHandler() {
46
46
  if (this.graphics.length === 0) {
47
- this._shouldClose = false;
48
- this.closeEdit.emit();
47
+ this._closeEdit();
49
48
  }
50
49
  }
51
50
  async openWatchHandler(v) {
@@ -54,14 +53,12 @@ export class EditCard {
54
53
  this._editorLoading = true;
55
54
  this._initEditorWidget();
56
55
  if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
57
- await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
58
- this._shouldClose = true;
56
+ await this._startUpdate();
59
57
  }
60
58
  this._editorLoading = false;
61
59
  }
62
60
  if (!v) {
63
- this._shouldClose = false;
64
- this.closeEdit.emit();
61
+ this._closeEdit();
65
62
  }
66
63
  }
67
64
  //--------------------------------------------------------------------------
@@ -92,13 +89,8 @@ export class EditCard {
92
89
  this._layerEditHandle.remove();
93
90
  }
94
91
  this._layerEditHandle = this._layer.on("edits", () => {
95
- this._editorLoading = true;
96
92
  this.editsComplete.emit();
97
- this._shouldClose = false;
98
- this._initEditorWidget();
99
- void this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
100
- this._shouldClose = true;
101
- this._editorLoading = false;
93
+ this._closeEdit();
102
94
  });
103
95
  }
104
96
  }
@@ -146,7 +138,11 @@ export class EditCard {
146
138
  const container = document.createElement("div");
147
139
  this._editor = new this.Editor({
148
140
  allowedWorkflows: "update",
149
- view: this.mapView,
141
+ //view: this.mapView,
142
+ layerInfos: [{
143
+ layer: this._layer,
144
+ geometryUpdatesEnabled: false
145
+ }],
150
146
  visibleElements: {
151
147
  snappingControls: false,
152
148
  sketchTooltipControls: false
@@ -165,12 +161,10 @@ export class EditCard {
165
161
  });
166
162
  this._editHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "ready", () => {
167
163
  if (this._shouldClose) {
168
- this._shouldClose = false;
169
- this.closeEdit.emit();
164
+ this._closeEdit();
170
165
  }
171
166
  else if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
172
- void this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
173
- this._shouldClose = true;
167
+ void this._startUpdate();
174
168
  }
175
169
  });
176
170
  this._activeWorkflowHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.activeWorkflow) === null || _a === void 0 ? void 0 : _a.activeWorkflow; }, (activeWorkflow) => {
@@ -182,6 +176,24 @@ export class EditCard {
182
176
  this._editContainer.appendChild(container);
183
177
  }
184
178
  }
179
+ /**
180
+ * Close the edit widget
181
+ *
182
+ * @returns void
183
+ */
184
+ _closeEdit() {
185
+ this._shouldClose = false;
186
+ this.closeEdit.emit();
187
+ }
188
+ /**
189
+ * Start the update workflow for the editor widget
190
+ *
191
+ * @returns void
192
+ */
193
+ async _startUpdate() {
194
+ await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
195
+ this._shouldClose = true;
196
+ }
185
197
  /**
186
198
  * Fetches the component's translations
187
199
  *
@@ -22,6 +22,10 @@
22
22
  height: 100%;
23
23
  }
24
24
 
25
+ .height-full-adjusted {
26
+ height: calc(100% - 20px);
27
+ }
28
+
25
29
  .width-full {
26
30
  width: 100%;
27
31
  }
@@ -159,7 +159,7 @@ export class LayerTable {
159
159
  const loadingClass = this._fetchingData ? "" : "display-none";
160
160
  const total = this._allIds.length.toString();
161
161
  const selected = this._selectedIndexes.length.toString();
162
- return (h(Host, null, h("calcite-shell", null, this._getTableControlRow("header"), h("div", { class: "height-full width-full" }, h("calcite-panel", { class: "height-full width-full" }, h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { class: tableNodeClass, ref: this.onTableNodeCreate })), h("div", { class: "bottom-left background text-color" }, this._translations.recordsSelected
162
+ return (h(Host, null, h("calcite-shell", null, this._getTableControlRow("header"), h("div", { class: "height-full-adjusted width-full" }, h("calcite-panel", { class: "height-full width-full" }, h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { class: tableNodeClass, ref: this.onTableNodeCreate })), h("div", { class: "bottom-left text-color" }, this._translations.recordsSelected
163
163
  .replace("{{total}}", total)
164
164
  .replace("{{selected}}", selected)))), this._deleteMessage()));
165
165
  }
@@ -340,7 +340,7 @@ export class LayerTable {
340
340
  * @returns node to confirm or deny the delete operation
341
341
  */
342
342
  _deleteMessage() {
343
- return (h("calcite-modal", { "aria-labelledby": "modal-title", kind: "danger", onCalciteModalClose: () => this._deleteClosed(), open: this._confirmDelete }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, h("calcite-icon", { "aria-hidden": "true", class: "padding-end-1 danger-color", icon: "exclamation-mark-triangle", scale: "m" }), this._translations.deleteFeature), h("div", { slot: "content" }, this._translations.confirm), h("calcite-button", { appearance: "outline", kind: "danger", onClick: () => this._deleteClosed(), slot: "secondary", width: "full" }, this._translations.cancel), h("calcite-button", { kind: "danger", loading: this._isDeleting, onClick: () => void this._deleteFeatures(), slot: "primary", width: "full" }, this._translations.delete)));
343
+ return (h("calcite-modal", { "aria-labelledby": "modal-title", kind: "danger", onCalciteModalClose: () => this._deleteClosed(), open: this._confirmDelete }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, this._translations.deleteFeature), h("div", { slot: "content" }, this._translations.confirm), h("calcite-button", { appearance: "outline", kind: "danger", onClick: () => this._deleteClosed(), slot: "secondary", width: "full" }, this._translations.cancel), h("calcite-button", { kind: "danger", loading: this._isDeleting, onClick: () => void this._deleteFeatures(), slot: "primary", width: "full" }, this._translations.delete)));
344
344
  }
345
345
  /**
346
346
  * Delete the currently selected features
@@ -59,6 +59,7 @@ export class MapCard {
59
59
  */
60
60
  async componentWillLoad() {
61
61
  await this._initModules();
62
+ this.esriConfig.portalUrl = "https://holistic.mapsdevext.arcgis.com";
62
63
  }
63
64
  /**
64
65
  * Renders the component.
@@ -79,14 +80,16 @@ export class MapCard {
79
80
  * @protected
80
81
  */
81
82
  async _initModules() {
82
- const [WebMap, MapView, Home] = await loadModules([
83
+ const [WebMap, MapView, Home, esriConfig] = await loadModules([
83
84
  "esri/WebMap",
84
85
  "esri/views/MapView",
85
- "esri/widgets/Home"
86
+ "esri/widgets/Home",
87
+ "esri/config"
86
88
  ]);
87
89
  this.WebMap = WebMap;
88
90
  this.MapView = MapView;
89
91
  this.Home = Home;
92
+ this.esriConfig = esriConfig;
90
93
  }
91
94
  /**
92
95
  * Load the webmap for the provided webMapInfo
@@ -118,7 +118,7 @@ export class MapSelectTools {
118
118
  async getSelection() {
119
119
  // Allow any non whitespace
120
120
  if (!/\S+/gm.test(this._selectionLabel)) {
121
- this._updateLabel();
121
+ await this._updateLabel();
122
122
  }
123
123
  return {
124
124
  id: this.isUpdate ? this.selectionSet.id : Date.now(),
@@ -149,16 +149,16 @@ export class MapSelectTools {
149
149
  /**
150
150
  * Handle changes to the buffer distance value
151
151
  */
152
- distanceChanged(event) {
153
- this._distanceChanged(event.detail);
152
+ async distanceChanged(event) {
153
+ await this._distanceChanged(event.detail);
154
154
  }
155
155
  /**
156
156
  * Handle changes to the buffer unit
157
157
  */
158
- unitChanged(event) {
158
+ async unitChanged(event) {
159
159
  if (event.detail.newValue !== event.detail.oldValue) {
160
160
  this._unit = event.detail.newValue;
161
- this._updateLabel();
161
+ await this._updateLabel();
162
162
  }
163
163
  }
164
164
  //--------------------------------------------------------------------------
@@ -334,7 +334,7 @@ export class MapSelectTools {
334
334
  const useOIDs = ((_b = (_a = searchResults.source) === null || _a === void 0 ? void 0 : _a.layer) === null || _b === void 0 ? void 0 : _b.id) && searchResults.source.layer.id === this.selectLayerView.layer.id;
335
335
  const oids = useOIDs ? [searchResults.result.feature.getObjectId()] : undefined;
336
336
  this._workflowType = EWorkflowType.SEARCH;
337
- this._updateLabel();
337
+ void this._updateLabel();
338
338
  const graphics = [searchResults.result.feature];
339
339
  this._updateSelection(graphics, useOIDs, oids);
340
340
  this._drawTools.graphics = graphics;
@@ -446,7 +446,7 @@ export class MapSelectTools {
446
446
  if (this._workflowType === EWorkflowType.SKETCH) {
447
447
  this._drawTools.updateGraphics();
448
448
  }
449
- this._updateLabel();
449
+ await this._updateLabel();
450
450
  this._clearSearchWidget();
451
451
  if (this._useLayerFeaturesEnabled && !forceUpdate) {
452
452
  // Will only ever be a single graphic
@@ -564,7 +564,7 @@ export class MapSelectTools {
564
564
  }
565
565
  // mock this b/c the tools can store a value that is different than what is shown in the map
566
566
  // this occurs when a distance is set but then buffer is disabled
567
- this._distanceChanged({
567
+ await this._distanceChanged({
568
568
  oldValue,
569
569
  newValue
570
570
  });
@@ -643,7 +643,7 @@ export class MapSelectTools {
643
643
  *
644
644
  * @protected
645
645
  */
646
- _updateLabel() {
646
+ async _updateLabel() {
647
647
  var _a, _b;
648
648
  const hasSketch = this._selectionLabel.indexOf(this._translations.sketch) > -1;
649
649
  const hasSelect = this._selectionLabel.indexOf(this._translations.select) > -1;
@@ -651,7 +651,8 @@ export class MapSelectTools {
651
651
  const label = this._workflowType === EWorkflowType.SEARCH ? (_b = this._searchResult) === null || _b === void 0 ? void 0 : _b.name :
652
652
  this._workflowType === EWorkflowType.SELECT ?
653
653
  this._translations.select : this._translations.sketch;
654
- const unit = !this._unit ? this._bufferTools.unit : this._unit;
654
+ const _unit = !this._unit ? this._bufferTools.unit : this._unit;
655
+ const unit = await this._bufferTools.getTranslatedUnit(_unit);
655
656
  const distance = isNaN(this._distance) ? this._bufferTools.distance : this._distance;
656
657
  this._selectionLabel = hasSketch || hasSelect || hasSearch || !this._selectionLabel ?
657
658
  `${label} ${distance} ${unit}` : this._selectionLabel;
@@ -696,7 +697,7 @@ export class MapSelectTools {
696
697
  const id = ((_a = evt === null || evt === void 0 ? void 0 : evt.detail) === null || _a === void 0 ? void 0 : _a.length) > 0 ? evt.detail[0] : "";
697
698
  if (!this.selectLayerView || id !== this.selectLayerView.layer.id) {
698
699
  this.selectLayerView = await getFeatureLayerView(this.mapView, id);
699
- this._updateLabel();
700
+ await this._updateLabel();
700
701
  this._bufferGeometry ? await this._selectFeatures([this._bufferGeometry]) :
701
702
  await this._highlightWithOIDsOrGeoms();
702
703
  }
@@ -704,10 +705,10 @@ export class MapSelectTools {
704
705
  /**
705
706
  * Handle changes to the buffer distance value
706
707
  */
707
- _distanceChanged(detail) {
708
+ async _distanceChanged(detail) {
708
709
  if (detail.newValue !== detail.oldValue) {
709
710
  this._distance = detail.newValue;
710
- this._updateLabel();
711
+ await this._updateLabel();
711
712
  }
712
713
  }
713
714
  /**
@@ -43,15 +43,6 @@
43
43
  width: 33.33%;
44
44
  }
45
45
 
46
- .action-center {
47
- -webkit-box-align: center;
48
- -webkit-align-items: center;
49
- -ms-grid-row-align: center;
50
- align-items: center;
51
- align-content: center;
52
- justify-content: center;
53
- }
54
-
55
46
  .width-full {
56
47
  width: 100%;
57
48
  }
@@ -299,8 +299,8 @@ export class PublicNotification {
299
299
  * @protected
300
300
  */
301
301
  _getActionGroup(icon, pageType, tip) {
302
- const sizeClass = this.showRefineSelection ? " w-1-3" : " w-1-2";
303
- return (h("calcite-action-group", { class: "action-center" + sizeClass, layout: "horizontal" }, h("div", { class: "background-override" }, h("calcite-action", { active: this._pageType === pageType, alignment: "center", class: "width-full height-full", compact: false, icon: icon, id: icon, onClick: () => { this._setPageType(pageType); }, text: "" })), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": icon }, h("span", null, tip))));
302
+ const sizeClass = this.showRefineSelection ? "w-1-3" : "w-1-2";
303
+ return (h("calcite-action-group", { class: sizeClass, layout: "horizontal" }, h("div", { class: "background-override" }, h("calcite-action", { active: this._pageType === pageType, alignment: "center", class: "width-full height-full", compact: false, icon: icon, id: icon, onClick: () => { this._setPageType(pageType); }, text: "" })), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": icon }, h("span", null, tip))));
304
304
  }
305
305
  /**
306
306
  * Navigate to the defined page type
@@ -516,7 +516,7 @@ export class PublicNotification {
516
516
  _getExportOptions() {
517
517
  const displayClass = this._exportType === EExportType.PDF ? "display-block" : "display-none";
518
518
  const titleOptionsClass = this._addTitle ? "display-block" : "display-none";
519
- const title = this._titleValue !== undefined ? this._titleValue : this.defaultExportTitle ? this.defaultExportTitle : "";
519
+ const title = this._titleValue ? this._titleValue : this.defaultExportTitle ? this.defaultExportTitle : "";
520
520
  return (h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), h("div", { class: "padding-sides-1" }, h("pdf-download", { defaultNumLabelsPerPage: this.defaultNumLabelsPerPage, disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.addTitle)), h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "label-margin-0", layout: "inline" }, h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
521
521
  }
522
522
  /**
@@ -83,6 +83,9 @@
83
83
  demo.mapInfos = [
84
84
  ...custom,
85
85
  ...[{
86
+ id: "e443af6208f6482d8737c406bdbcb17d",
87
+ name: "edit issues"
88
+ }, {
86
89
  id: "ce3dec81bf714d3bb71da9691ab686d1",
87
90
  name: "Popup Configured Map",
88
91
  // filters: {},
@@ -53,6 +53,19 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class BufferTools extends H
53
53
  }
54
54
  //--------------------------------------------------------------------------
55
55
  //
56
+ // Methods (public)
57
+ //
58
+ //--------------------------------------------------------------------------
59
+ /**
60
+ * Get the translated unit for display
61
+ *
62
+ * @returns Promise resolving with the translated unit
63
+ */
64
+ async getTranslatedUnit(unit) {
65
+ return this._units[unit];
66
+ }
67
+ //--------------------------------------------------------------------------
68
+ //
56
69
  // Functions (lifecycle)
57
70
  //
58
71
  //--------------------------------------------------------------------------
@@ -64,6 +77,7 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class BufferTools extends H
64
77
  async componentWillLoad() {
65
78
  await this._getTranslations();
66
79
  await this._initModules();
80
+ this._initTranslatedUnits();
67
81
  }
68
82
  /**
69
83
  * Renders the component.
@@ -90,21 +104,28 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class BufferTools extends H
90
104
  this._geometryEngine = geometryEngine;
91
105
  }
92
106
  /**
93
- * Gets the nodes for each of the possible distance units
94
- *
95
- * @returns An array of option nodes
107
+ * Init the lookup hash for translated units
96
108
  *
97
109
  * @protected
98
110
  */
99
- _getUnits() {
100
- const units = {
111
+ _initTranslatedUnits() {
112
+ this._units = {
101
113
  "feet": this._translations.feet,
102
114
  "meters": this._translations.meters,
103
115
  "miles": this._translations.miles,
104
116
  "kilometers": this._translations.kilometers
105
117
  };
106
- return Object.keys(units).map(u => {
107
- return (h("calcite-option", { label: units[u], selected: this.unit === u, value: u }));
118
+ }
119
+ /**
120
+ * Gets the nodes for each of the possible distance units
121
+ *
122
+ * @returns An array of option nodes
123
+ *
124
+ * @protected
125
+ */
126
+ _getUnits() {
127
+ return Object.keys(this._units).map(u => {
128
+ return (h("calcite-option", { label: this._units[u], selected: this.unit === u, value: u }));
108
129
  });
109
130
  }
110
131
  /**
@@ -231,7 +252,8 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class BufferTools extends H
231
252
  "unionResults": [1028, "union-results"],
232
253
  "unit": [1025],
233
254
  "disabled": [4],
234
- "_translations": [32]
255
+ "_translations": [32],
256
+ "getTranslatedUnit": [64]
235
257
  }, undefined, {
236
258
  "geometries": ["geometriesWatchHandler"],
237
259
  "disabled": ["disabledWatchHandler"]
@@ -39,8 +39,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
39
39
  */
40
40
  async graphicsWatchHandler() {
41
41
  if (this.graphics.length === 0) {
42
- this._shouldClose = false;
43
- this.closeEdit.emit();
42
+ this._closeEdit();
44
43
  }
45
44
  }
46
45
  async openWatchHandler(v) {
@@ -49,14 +48,12 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
49
48
  this._editorLoading = true;
50
49
  this._initEditorWidget();
51
50
  if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
52
- await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
53
- this._shouldClose = true;
51
+ await this._startUpdate();
54
52
  }
55
53
  this._editorLoading = false;
56
54
  }
57
55
  if (!v) {
58
- this._shouldClose = false;
59
- this.closeEdit.emit();
56
+ this._closeEdit();
60
57
  }
61
58
  }
62
59
  //--------------------------------------------------------------------------
@@ -87,13 +84,8 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
87
84
  this._layerEditHandle.remove();
88
85
  }
89
86
  this._layerEditHandle = this._layer.on("edits", () => {
90
- this._editorLoading = true;
91
87
  this.editsComplete.emit();
92
- this._shouldClose = false;
93
- this._initEditorWidget();
94
- void this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
95
- this._shouldClose = true;
96
- this._editorLoading = false;
88
+ this._closeEdit();
97
89
  });
98
90
  }
99
91
  }
@@ -141,7 +133,11 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
141
133
  const container = document.createElement("div");
142
134
  this._editor = new this.Editor({
143
135
  allowedWorkflows: "update",
144
- view: this.mapView,
136
+ //view: this.mapView,
137
+ layerInfos: [{
138
+ layer: this._layer,
139
+ geometryUpdatesEnabled: false
140
+ }],
145
141
  visibleElements: {
146
142
  snappingControls: false,
147
143
  sketchTooltipControls: false
@@ -160,12 +156,10 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
160
156
  });
161
157
  this._editHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "ready", () => {
162
158
  if (this._shouldClose) {
163
- this._shouldClose = false;
164
- this.closeEdit.emit();
159
+ this._closeEdit();
165
160
  }
166
161
  else if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
167
- void this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
168
- this._shouldClose = true;
162
+ void this._startUpdate();
169
163
  }
170
164
  });
171
165
  this._activeWorkflowHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.activeWorkflow) === null || _a === void 0 ? void 0 : _a.activeWorkflow; }, (activeWorkflow) => {
@@ -177,6 +171,24 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
177
171
  this._editContainer.appendChild(container);
178
172
  }
179
173
  }
174
+ /**
175
+ * Close the edit widget
176
+ *
177
+ * @returns void
178
+ */
179
+ _closeEdit() {
180
+ this._shouldClose = false;
181
+ this.closeEdit.emit();
182
+ }
183
+ /**
184
+ * Start the update workflow for the editor widget
185
+ *
186
+ * @returns void
187
+ */
188
+ async _startUpdate() {
189
+ await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
190
+ this._shouldClose = true;
191
+ }
180
192
  /**
181
193
  * Fetches the component's translations
182
194
  *
@@ -33,7 +33,7 @@ import { d as defineCustomElement$3 } from './shell.js';
33
33
  import { d as defineCustomElement$2 } from './tooltip.js';
34
34
  import { d as defineCustomElement$1 } from './map-layer-picker2.js';
35
35
 
36
- const layerTableCss = ":host{display:block}.height-full{height:100%}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.border-end{border-inline-end:1px solid var(--calcite-ui-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.bottom-left{position:absolute;left:0;bottom:0}html[dir=\"rtl\"] .bottom-left{position:absolute;right:0;bottom:0}.background{background-color:var(--calcite-ui-background)}.text-color{color:var(--calcite-ui-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-ui-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{padding:var(--lumo-space-xs) var(--lumo-space-m) !important;font-size:14px !important}";
36
+ const layerTableCss = ":host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.border-end{border-inline-end:1px solid var(--calcite-ui-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.bottom-left{position:absolute;left:0;bottom:0}html[dir=\"rtl\"] .bottom-left{position:absolute;right:0;bottom:0}.background{background-color:var(--calcite-ui-background)}.text-color{color:var(--calcite-ui-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-ui-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{padding:var(--lumo-space-xs) var(--lumo-space-m) !important;font-size:14px !important}";
37
37
 
38
38
  const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTMLElement {
39
39
  constructor() {
@@ -174,7 +174,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
174
174
  const loadingClass = this._fetchingData ? "" : "display-none";
175
175
  const total = this._allIds.length.toString();
176
176
  const selected = this._selectedIndexes.length.toString();
177
- return (h(Host, null, h("calcite-shell", null, this._getTableControlRow("header"), h("div", { class: "height-full width-full" }, h("calcite-panel", { class: "height-full width-full" }, h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { class: tableNodeClass, ref: this.onTableNodeCreate })), h("div", { class: "bottom-left background text-color" }, this._translations.recordsSelected
177
+ return (h(Host, null, h("calcite-shell", null, this._getTableControlRow("header"), h("div", { class: "height-full-adjusted width-full" }, h("calcite-panel", { class: "height-full width-full" }, h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { class: tableNodeClass, ref: this.onTableNodeCreate })), h("div", { class: "bottom-left text-color" }, this._translations.recordsSelected
178
178
  .replace("{{total}}", total)
179
179
  .replace("{{selected}}", selected)))), this._deleteMessage()));
180
180
  }
@@ -355,7 +355,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
355
355
  * @returns node to confirm or deny the delete operation
356
356
  */
357
357
  _deleteMessage() {
358
- return (h("calcite-modal", { "aria-labelledby": "modal-title", kind: "danger", onCalciteModalClose: () => this._deleteClosed(), open: this._confirmDelete }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, h("calcite-icon", { "aria-hidden": "true", class: "padding-end-1 danger-color", icon: "exclamation-mark-triangle", scale: "m" }), this._translations.deleteFeature), h("div", { slot: "content" }, this._translations.confirm), h("calcite-button", { appearance: "outline", kind: "danger", onClick: () => this._deleteClosed(), slot: "secondary", width: "full" }, this._translations.cancel), h("calcite-button", { kind: "danger", loading: this._isDeleting, onClick: () => void this._deleteFeatures(), slot: "primary", width: "full" }, this._translations.delete)));
358
+ return (h("calcite-modal", { "aria-labelledby": "modal-title", kind: "danger", onCalciteModalClose: () => this._deleteClosed(), open: this._confirmDelete }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, this._translations.deleteFeature), h("div", { slot: "content" }, this._translations.confirm), h("calcite-button", { appearance: "outline", kind: "danger", onClick: () => this._deleteClosed(), slot: "secondary", width: "full" }, this._translations.cancel), h("calcite-button", { kind: "danger", loading: this._isDeleting, onClick: () => void this._deleteFeatures(), slot: "primary", width: "full" }, this._translations.delete)));
359
359
  }
360
360
  /**
361
361
  * Delete the currently selected features
@@ -69,6 +69,7 @@ const MapCard = /*@__PURE__*/ proxyCustomElement(class MapCard extends HTMLEleme
69
69
  */
70
70
  async componentWillLoad() {
71
71
  await this._initModules();
72
+ this.esriConfig.portalUrl = "https://holistic.mapsdevext.arcgis.com";
72
73
  }
73
74
  /**
74
75
  * Renders the component.
@@ -89,14 +90,16 @@ const MapCard = /*@__PURE__*/ proxyCustomElement(class MapCard extends HTMLEleme
89
90
  * @protected
90
91
  */
91
92
  async _initModules() {
92
- const [WebMap, MapView, Home] = await loadModules([
93
+ const [WebMap, MapView, Home, esriConfig] = await loadModules([
93
94
  "esri/WebMap",
94
95
  "esri/views/MapView",
95
- "esri/widgets/Home"
96
+ "esri/widgets/Home",
97
+ "esri/config"
96
98
  ]);
97
99
  this.WebMap = WebMap;
98
100
  this.MapView = MapView;
99
101
  this.Home = Home;
102
+ this.esriConfig = esriConfig;
100
103
  }
101
104
  /**
102
105
  * Load the webmap for the provided webMapInfo