@esri/solutions-components 0.6.25 → 0.6.27

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -64,6 +64,19 @@ const BufferTools = class {
64
64
  }
65
65
  //--------------------------------------------------------------------------
66
66
  //
67
+ // Methods (public)
68
+ //
69
+ //--------------------------------------------------------------------------
70
+ /**
71
+ * Get the translated unit for display
72
+ *
73
+ * @returns Promise resolving with the translated unit
74
+ */
75
+ async getTranslatedUnit(unit) {
76
+ return this._units[unit];
77
+ }
78
+ //--------------------------------------------------------------------------
79
+ //
67
80
  // Functions (lifecycle)
68
81
  //
69
82
  //--------------------------------------------------------------------------
@@ -75,6 +88,7 @@ const BufferTools = class {
75
88
  async componentWillLoad() {
76
89
  await this._getTranslations();
77
90
  await this._initModules();
91
+ this._initTranslatedUnits();
78
92
  }
79
93
  /**
80
94
  * Renders the component.
@@ -101,21 +115,28 @@ const BufferTools = class {
101
115
  this._geometryEngine = geometryEngine;
102
116
  }
103
117
  /**
104
- * Gets the nodes for each of the possible distance units
105
- *
106
- * @returns An array of option nodes
118
+ * Init the lookup hash for translated units
107
119
  *
108
120
  * @protected
109
121
  */
110
- _getUnits() {
111
- const units = {
122
+ _initTranslatedUnits() {
123
+ this._units = {
112
124
  "feet": this._translations.feet,
113
125
  "meters": this._translations.meters,
114
126
  "miles": this._translations.miles,
115
127
  "kilometers": this._translations.kilometers
116
128
  };
117
- return Object.keys(units).map(u => {
118
- return (index.h("calcite-option", { label: units[u], selected: this.unit === u, value: u }));
129
+ }
130
+ /**
131
+ * Gets the nodes for each of the possible distance units
132
+ *
133
+ * @returns An array of option nodes
134
+ *
135
+ * @protected
136
+ */
137
+ _getUnits() {
138
+ return Object.keys(this._units).map(u => {
139
+ return (index.h("calcite-option", { label: this._units[u], selected: this.unit === u, value: u }));
119
140
  });
120
141
  }
121
142
  /**
@@ -351,8 +351,7 @@ const EditCard = class {
351
351
  */
352
352
  async graphicsWatchHandler() {
353
353
  if (this.graphics.length === 0) {
354
- this._shouldClose = false;
355
- this.closeEdit.emit();
354
+ this._closeEdit();
356
355
  }
357
356
  }
358
357
  async openWatchHandler(v) {
@@ -361,14 +360,12 @@ const EditCard = class {
361
360
  this._editorLoading = true;
362
361
  this._initEditorWidget();
363
362
  if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
364
- await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
365
- this._shouldClose = true;
363
+ await this._startUpdate();
366
364
  }
367
365
  this._editorLoading = false;
368
366
  }
369
367
  if (!v) {
370
- this._shouldClose = false;
371
- this.closeEdit.emit();
368
+ this._closeEdit();
372
369
  }
373
370
  }
374
371
  //--------------------------------------------------------------------------
@@ -399,13 +396,8 @@ const EditCard = class {
399
396
  this._layerEditHandle.remove();
400
397
  }
401
398
  this._layerEditHandle = this._layer.on("edits", () => {
402
- this._editorLoading = true;
403
399
  this.editsComplete.emit();
404
- this._shouldClose = false;
405
- this._initEditorWidget();
406
- void this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
407
- this._shouldClose = true;
408
- this._editorLoading = false;
400
+ this._closeEdit();
409
401
  });
410
402
  }
411
403
  }
@@ -453,7 +445,11 @@ const EditCard = class {
453
445
  const container = document.createElement("div");
454
446
  this._editor = new this.Editor({
455
447
  allowedWorkflows: "update",
456
- view: this.mapView,
448
+ //view: this.mapView,
449
+ layerInfos: [{
450
+ layer: this._layer,
451
+ geometryUpdatesEnabled: false
452
+ }],
457
453
  visibleElements: {
458
454
  snappingControls: false,
459
455
  sketchTooltipControls: false
@@ -472,12 +468,10 @@ const EditCard = class {
472
468
  });
473
469
  this._editHandle = this.reactiveUtils.when(() => this._editor.viewModel.state === "ready", () => {
474
470
  if (this._shouldClose) {
475
- this._shouldClose = false;
476
- this.closeEdit.emit();
471
+ this._closeEdit();
477
472
  }
478
473
  else if (this.graphicIndex > -1 && this.graphics.length > 0 && this.open && !this._shouldClose) {
479
- void this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
480
- this._shouldClose = true;
474
+ void this._startUpdate();
481
475
  }
482
476
  });
483
477
  this._activeWorkflowHandle = this.reactiveUtils.watch(() => { var _a; return (_a = this._editor.viewModel.activeWorkflow) === null || _a === void 0 ? void 0 : _a.activeWorkflow; }, (activeWorkflow) => {
@@ -489,6 +483,24 @@ const EditCard = class {
489
483
  this._editContainer.appendChild(container);
490
484
  }
491
485
  }
486
+ /**
487
+ * Close the edit widget
488
+ *
489
+ * @returns void
490
+ */
491
+ _closeEdit() {
492
+ this._shouldClose = false;
493
+ this.closeEdit.emit();
494
+ }
495
+ /**
496
+ * Start the update workflow for the editor widget
497
+ *
498
+ * @returns void
499
+ */
500
+ async _startUpdate() {
501
+ await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]);
502
+ this._shouldClose = true;
503
+ }
492
504
  /**
493
505
  * Fetches the component's translations
494
506
  *
@@ -103,7 +103,7 @@ const CardManager = class {
103
103
  };
104
104
  CardManager.style = cardManagerCss;
105
105
 
106
- 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}";
106
+ 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}";
107
107
 
108
108
  const LayerTable = class {
109
109
  constructor(hostRef) {
@@ -243,7 +243,7 @@ const LayerTable = class {
243
243
  const loadingClass = this._fetchingData ? "" : "display-none";
244
244
  const total = this._allIds.length.toString();
245
245
  const selected = this._selectedIndexes.length.toString();
246
- return (index.h(index.Host, null, index.h("calcite-shell", null, this._getTableControlRow("header"), index.h("div", { class: "height-full width-full" }, index.h("calcite-panel", { class: "height-full width-full" }, index.h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData, scale: "l" }), index.h("div", { class: tableNodeClass, ref: this.onTableNodeCreate })), index.h("div", { class: "bottom-left background text-color" }, this._translations.recordsSelected
246
+ return (index.h(index.Host, null, index.h("calcite-shell", null, this._getTableControlRow("header"), index.h("div", { class: "height-full-adjusted width-full" }, index.h("calcite-panel", { class: "height-full width-full" }, index.h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData, scale: "l" }), index.h("div", { class: tableNodeClass, ref: this.onTableNodeCreate })), index.h("div", { class: "bottom-left text-color" }, this._translations.recordsSelected
247
247
  .replace("{{total}}", total)
248
248
  .replace("{{selected}}", selected)))), this._deleteMessage()));
249
249
  }
@@ -424,7 +424,7 @@ const LayerTable = class {
424
424
  * @returns node to confirm or deny the delete operation
425
425
  */
426
426
  _deleteMessage() {
427
- return (index.h("calcite-modal", { "aria-labelledby": "modal-title", kind: "danger", onCalciteModalClose: () => this._deleteClosed(), open: this._confirmDelete }, index.h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, index.h("calcite-icon", { "aria-hidden": "true", class: "padding-end-1 danger-color", icon: "exclamation-mark-triangle", scale: "m" }), this._translations.deleteFeature), index.h("div", { slot: "content" }, this._translations.confirm), index.h("calcite-button", { appearance: "outline", kind: "danger", onClick: () => this._deleteClosed(), slot: "secondary", width: "full" }, this._translations.cancel), index.h("calcite-button", { kind: "danger", loading: this._isDeleting, onClick: () => void this._deleteFeatures(), slot: "primary", width: "full" }, this._translations.delete)));
427
+ return (index.h("calcite-modal", { "aria-labelledby": "modal-title", kind: "danger", onCalciteModalClose: () => this._deleteClosed(), open: this._confirmDelete }, index.h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, this._translations.deleteFeature), index.h("div", { slot: "content" }, this._translations.confirm), index.h("calcite-button", { appearance: "outline", kind: "danger", onClick: () => this._deleteClosed(), slot: "secondary", width: "full" }, this._translations.cancel), index.h("calcite-button", { kind: "danger", loading: this._isDeleting, onClick: () => void this._deleteFeatures(), slot: "primary", width: "full" }, this._translations.delete)));
428
428
  }
429
429
  /**
430
430
  * Delete the currently selected features
@@ -708,6 +708,7 @@ const MapCard = class {
708
708
  */
709
709
  async componentWillLoad() {
710
710
  await this._initModules();
711
+ this.esriConfig.portalUrl = "https://holistic.mapsdevext.arcgis.com";
711
712
  }
712
713
  /**
713
714
  * Renders the component.
@@ -728,14 +729,16 @@ const MapCard = class {
728
729
  * @protected
729
730
  */
730
731
  async _initModules() {
731
- const [WebMap, MapView, Home] = await loadModules.loadModules([
732
+ const [WebMap, MapView, Home, esriConfig] = await loadModules.loadModules([
732
733
  "esri/WebMap",
733
734
  "esri/views/MapView",
734
- "esri/widgets/Home"
735
+ "esri/widgets/Home",
736
+ "esri/config"
735
737
  ]);
736
738
  this.WebMap = WebMap;
737
739
  this.MapView = MapView;
738
740
  this.Home = Home;
741
+ this.esriConfig = esriConfig;
739
742
  }
740
743
  /**
741
744
  * Load the webmap for the provided webMapInfo