@esri/solutions-components 0.8.4 → 0.8.6

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 (98) hide show
  1. package/dist/assets/t9n/crowdsource-reporter/resources.json +5 -6
  2. package/dist/assets/t9n/crowdsource-reporter/resources_en.json +5 -6
  3. package/dist/assets/t9n/feature-list/resources.json +1 -1
  4. package/dist/assets/t9n/feature-list/resources_en.json +1 -1
  5. package/dist/assets/t9n/public-notification/resources.json +3 -1
  6. package/dist/assets/t9n/public-notification/resources_en.json +3 -1
  7. package/dist/cjs/buffer-tools_3.cjs.entry.js +2 -2
  8. package/dist/cjs/calcite-alert_4.cjs.entry.js +2 -2
  9. package/dist/cjs/calcite-combobox_5.cjs.entry.js +2 -2
  10. package/dist/cjs/calcite-flow_5.cjs.entry.js +163 -16
  11. package/dist/cjs/card-manager_3.cjs.entry.js +41 -2
  12. package/dist/cjs/crowdsource-manager.cjs.entry.js +2 -1
  13. package/dist/cjs/crowdsource-reporter.cjs.entry.js +120 -38
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
  16. package/dist/cjs/public-notification.cjs.entry.js +110 -4
  17. package/dist/cjs/{publicNotificationStore-ef379d11.js → publicNotificationStore-e790601d.js} +2 -2
  18. package/dist/cjs/solutions-components.cjs.js +1 -1
  19. package/dist/collection/collection-manifest.json +1 -1
  20. package/dist/collection/components/create-feature/create-feature.css +9 -0
  21. package/dist/collection/components/create-feature/create-feature.js +134 -6
  22. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +19 -1
  23. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +5 -0
  24. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +120 -38
  25. package/dist/collection/components/feature-list/feature-list.js +93 -5
  26. package/dist/collection/components/info-card/info-card.css +1 -1
  27. package/dist/collection/components/info-card/info-card.js +1 -1
  28. package/dist/collection/components/layer-list/layer-list.js +6 -6
  29. package/dist/collection/components/map-card/map-card.js +27 -2
  30. package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
  31. package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
  32. package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
  33. package/dist/collection/components/public-notification/public-notification.js +110 -3
  34. package/dist/collection/demos/crowdsource-reporter.html +1 -1
  35. package/dist/collection/utils/interfaces.ts +7 -0
  36. package/dist/collection/utils/publicNotificationStore.js +2 -2
  37. package/dist/collection/utils/publicNotificationStore.ts +3 -2
  38. package/dist/components/create-feature2.js +111 -7
  39. package/dist/components/crowdsource-manager.js +3 -1
  40. package/dist/components/crowdsource-reporter.js +121 -39
  41. package/dist/components/feature-list2.js +54 -6
  42. package/dist/components/info-card2.js +2 -2
  43. package/dist/components/layer-list2.js +6 -6
  44. package/dist/components/map-card2.js +42 -2
  45. package/dist/components/map-draw-tools2.js +1 -1
  46. package/dist/components/map-layer-picker2.js +1 -1
  47. package/dist/components/map-select-tools2.js +1 -1
  48. package/dist/components/public-notification.js +110 -3
  49. package/dist/components/publicNotificationStore.js +2 -2
  50. package/dist/esm/buffer-tools_3.entry.js +2 -2
  51. package/dist/esm/calcite-alert_4.entry.js +3 -3
  52. package/dist/esm/calcite-combobox_5.entry.js +3 -3
  53. package/dist/esm/calcite-flow_5.entry.js +164 -17
  54. package/dist/esm/card-manager_3.entry.js +43 -4
  55. package/dist/esm/crowdsource-manager.entry.js +3 -2
  56. package/dist/esm/crowdsource-reporter.entry.js +121 -39
  57. package/dist/esm/{downloadUtils-0c13073b.js → downloadUtils-0c1e4d7b.js} +2 -2
  58. package/dist/esm/{index.es-ad250bc6.js → index.es-286e3cfa.js} +2 -2
  59. package/dist/esm/loader.js +1 -1
  60. package/dist/esm/map-select-tools_3.entry.js +4 -4
  61. package/dist/esm/{mapViewUtils-20504620.js → mapViewUtils-253178f1.js} +1 -1
  62. package/dist/esm/public-notification.entry.js +112 -6
  63. package/dist/esm/{publicNotificationStore-3bf4de75.js → publicNotificationStore-223faed2.js} +2 -2
  64. package/dist/esm/solutions-components.js +1 -1
  65. package/dist/solutions-components/demos/crowdsource-reporter.html +1 -1
  66. package/dist/solutions-components/p-15f9624a.entry.js +6 -0
  67. package/dist/solutions-components/{p-955647ea.entry.js → p-1ea5e061.entry.js} +2 -2
  68. package/dist/solutions-components/{p-590a2a26.js → p-212b02e7.js} +1 -1
  69. package/dist/solutions-components/p-238d3b5f.entry.js +6 -0
  70. package/dist/solutions-components/p-273d833b.entry.js +6 -0
  71. package/dist/solutions-components/{p-cc280aa1.js → p-322868ec.js} +1 -1
  72. package/dist/solutions-components/{p-1d3a1794.js → p-331b5d1e.js} +2 -2
  73. package/dist/solutions-components/{p-c897e3eb.js → p-3af79063.js} +1 -1
  74. package/dist/solutions-components/p-45ed16d5.entry.js +6 -0
  75. package/dist/solutions-components/p-80b11ec1.entry.js +17 -0
  76. package/dist/solutions-components/{p-5c7e3941.entry.js → p-813fd8a4.entry.js} +2 -2
  77. package/dist/solutions-components/{p-ff302d95.entry.js → p-d136eab0.entry.js} +2 -2
  78. package/dist/solutions-components/p-e0446d5b.entry.js +6 -0
  79. package/dist/solutions-components/solutions-components.esm.js +1 -1
  80. package/dist/solutions-components/utils/interfaces.ts +7 -0
  81. package/dist/solutions-components/utils/publicNotificationStore.ts +3 -2
  82. package/dist/types/components/create-feature/create-feature.d.ts +43 -1
  83. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +4 -0
  84. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +31 -10
  85. package/dist/types/components/feature-list/feature-list.d.ts +31 -0
  86. package/dist/types/components/layer-list/layer-list.d.ts +3 -3
  87. package/dist/types/components/map-card/map-card.d.ts +8 -0
  88. package/dist/types/components/public-notification/public-notification.d.ts +48 -0
  89. package/dist/types/components.d.ts +37 -0
  90. package/dist/types/utils/interfaces.d.ts +6 -0
  91. package/dist/types/utils/publicNotificationStore.d.ts +2 -1
  92. package/package.json +2 -1
  93. package/dist/solutions-components/p-6512dc44.entry.js +0 -6
  94. package/dist/solutions-components/p-65ad1625.entry.js +0 -6
  95. package/dist/solutions-components/p-989bf0bf.entry.js +0 -6
  96. package/dist/solutions-components/p-a0611720.entry.js +0 -6
  97. package/dist/solutions-components/p-efe1694a.entry.js +0 -17
  98. package/dist/solutions-components/p-f3467807.entry.js +0 -6
@@ -11,7 +11,7 @@ const index = require('./index-105cf2b9.js');
11
11
  const locale = require('./locale-3d0a4bc2.js');
12
12
  const mapViewUtils = require('./mapViewUtils-3e0fa457.js');
13
13
  const interfaces = require('./interfaces-7cd0a48a.js');
14
- const publicNotificationStore = require('./publicNotificationStore-ef379d11.js');
14
+ const publicNotificationStore = require('./publicNotificationStore-e790601d.js');
15
15
  const downloadUtils = require('./downloadUtils-8b05d7cc.js');
16
16
  require('./esri-loader-ce6c3d3d.js');
17
17
  require('./_commonjsHelpers-480c2e77.js');
@@ -426,7 +426,7 @@ const MapSelectTools = class {
426
426
  }
427
427
  else {
428
428
  this._bufferGraphicsLayer = new this.GraphicsLayer({ title, listMode: "hide" });
429
- publicNotificationStore.state.managedLayers.push(title);
429
+ publicNotificationStore.state.managedLayers[title] = "buffer";
430
430
  const sketchIndex = this.mapView.map.layers.findIndex((l) => l.title === this._translations.sketchLayer);
431
431
  if (sketchIndex > -1) {
432
432
  this.mapView.map.layers.add(this._bufferGraphicsLayer, sketchIndex);
@@ -11,7 +11,7 @@ const index = require('./index-105cf2b9.js');
11
11
  const interfaces = require('./interfaces-7cd0a48a.js');
12
12
  const locale = require('./locale-3d0a4bc2.js');
13
13
  const mapViewUtils = require('./mapViewUtils-3e0fa457.js');
14
- const publicNotificationStore = require('./publicNotificationStore-ef379d11.js');
14
+ const publicNotificationStore = require('./publicNotificationStore-e790601d.js');
15
15
  const downloadUtils = require('./downloadUtils-8b05d7cc.js');
16
16
  require('./esri-loader-ce6c3d3d.js');
17
17
  require('./_commonjsHelpers-480c2e77.js');
@@ -57,6 +57,7 @@ const PublicNotification = class {
57
57
  this.sketchLineSymbol = undefined;
58
58
  this.sketchPointSymbol = undefined;
59
59
  this.sketchPolygonSymbol = undefined;
60
+ this._exportGraphics = false;
60
61
  this._addMap = false;
61
62
  this._addResults = true;
62
63
  this._addTitle = false;
@@ -135,6 +136,7 @@ const PublicNotification = class {
135
136
  if (pageType === interfaces.EPageType.EXPORT) {
136
137
  this._fetchingData = true;
137
138
  this._numDuplicates = await this._getNumDuplicates();
139
+ this._updateExportGraphics();
138
140
  this._fetchingData = false;
139
141
  }
140
142
  this._clearHighlight();
@@ -142,6 +144,9 @@ const PublicNotification = class {
142
144
  // clear any draw shapes or buffers
143
145
  await this._clearSelection();
144
146
  }
147
+ if (oldPageType === interfaces.EPageType.EXPORT) {
148
+ this._removeExportGraphics();
149
+ }
145
150
  if (pageType !== interfaces.EPageType.SELECT) {
146
151
  return this._highlightFeatures();
147
152
  }
@@ -205,12 +210,14 @@ const PublicNotification = class {
205
210
  * @protected
206
211
  */
207
212
  async _initModules() {
208
- const [geometryEngine, jsonUtils] = await locale.loadModules([
213
+ const [geometryEngine, jsonUtils, graphic] = await locale.loadModules([
209
214
  "esri/geometry/geometryEngine",
210
- "esri/symbols/support/jsonUtils"
215
+ "esri/symbols/support/jsonUtils",
216
+ "esri/Graphic"
211
217
  ]);
212
218
  this._geometryEngine = geometryEngine;
213
219
  this._jsonUtils = jsonUtils;
220
+ this.Graphic = graphic;
214
221
  }
215
222
  /**
216
223
  * Load the search configuration
@@ -538,9 +545,107 @@ const PublicNotification = class {
538
545
  _getExportOptions() {
539
546
  const displayClass = this._exportType === interfaces.EExportType.PDF ? "display-block" : "display-none";
540
547
  const titleOptionsClass = this._addTitle ? "display-block" : "display-none";
548
+ const graphicsOptionsClass = this._addMap ? "display-flex" : "display-none";
541
549
  const title = this._titleValue ? this._titleValue : this.defaultExportTitle ? this.defaultExportTitle : "";
542
550
  const formatOptionsClass = this._addResults ? "" : "display-none";
543
- return (index.h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), index.h("div", { class: "padding-top-sides-1" }, index.h("calcite-label", { class: "label-margin-0", layout: "inline" }, index.h("calcite-checkbox", { checked: this._addResults, onCalciteCheckboxChange: () => this._addResults = !this._addResults }), this._translations.addResults)), index.h("div", { class: `padding-top-sides-1 ${formatOptionsClass}` }, index.h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), index.h("div", { class: `padding-sides-1 ${formatOptionsClass}` }, index.h("pdf-download", { defaultNumLabelsPerPage: parseInt(this.defaultNumLabelsPerPage.toString(), 10), disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), index.h("div", { class: "padding-top-sides-1" }, index.h("calcite-label", { class: "label-margin-0", layout: "inline" }, index.h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.title)), index.h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), index.h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), index.h("div", { class: "padding-top-sides-1" }, index.h("calcite-label", { class: "label-margin-0", layout: "inline" }, index.h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._addMap = !this._addMap }), this._translations.includeMap))));
551
+ return (index.h("div", { class: displayClass }, this._getLabel(this._translations.pdfOptions, true), index.h("div", { class: "padding-top-sides-1" }, index.h("calcite-label", { class: "label-margin-0", layout: "inline" }, index.h("calcite-checkbox", { checked: this._addResults, onCalciteCheckboxChange: () => this._addResults = !this._addResults }), this._translations.addResults)), index.h("div", { class: `padding-top-sides-1 ${formatOptionsClass}` }, index.h("calcite-label", { class: "label-margin-0" }, this._translations.selectPDFLabelOption)), index.h("div", { class: `padding-sides-1 ${formatOptionsClass}` }, index.h("pdf-download", { defaultNumLabelsPerPage: parseInt(this.defaultNumLabelsPerPage.toString(), 10), disabled: !this._downloadActive, ref: (el) => { this._downloadTools = el; } })), index.h("div", { class: "padding-top-sides-1" }, index.h("calcite-label", { class: "label-margin-0", layout: "inline" }, index.h("calcite-checkbox", { checked: this._addTitle, onCalciteCheckboxChange: () => this._addTitle = !this._addTitle }), this._translations.title)), index.h("div", { class: titleOptionsClass }, this._getLabel(this._translations.title, true, ""), index.h("calcite-input-text", { class: "padding-sides-1", onCalciteInputTextInput: () => this._changeTitle(), placeholder: this._translations.titlePlaceholder, ref: (el) => { this._titleElement = el; }, value: title })), index.h("div", { class: "padding-top-sides-1" }, index.h("calcite-label", { class: "label-margin-0", layout: "inline" }, index.h("calcite-checkbox", { checked: this._addMap, onCalciteCheckboxChange: () => this._handleAddMapChange() }), this._translations.includeMap)), index.h("div", { class: `padding-top-sides-1 ${graphicsOptionsClass}` }, index.h("calcite-label", { class: "label-margin-0", layout: "inline" }, index.h("calcite-checkbox", { checked: this._exportGraphics, onCalciteCheckboxChange: () => this._handleExportGraphicsChange() }), this._translations.listGraphics), index.h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "list-graphics-icon", scale: "s" }), index.h("calcite-popover", { closable: true, label: "", referenceElement: "list-graphics-icon" }, index.h("span", { class: "tooltip-message" }, this._translations.listGraphicsTip)))));
552
+ }
553
+ /**
554
+ * Toggle the _addMap state variable and update the graphics on the map
555
+ *
556
+ * @protected
557
+ */
558
+ _handleAddMapChange() {
559
+ this._addMap = !this._addMap;
560
+ this._updateExportGraphics();
561
+ }
562
+ /**
563
+ * Toggle the _exportGraphics state variable and update the graphics on the map
564
+ *
565
+ * @protected
566
+ */
567
+ _handleExportGraphicsChange() {
568
+ this._exportGraphics = !this._exportGraphics;
569
+ this._updateExportGraphics();
570
+ }
571
+ /**
572
+ * Get the "sketch" or "buffer" graphics layer
573
+ *
574
+ * @param type The type of managed layer to fetch "sketch" | "buffer"
575
+ *
576
+ * @protected
577
+ */
578
+ _getManagedLayer(type) {
579
+ let layer;
580
+ Object.keys(publicNotificationStore.state.managedLayers).some((k) => {
581
+ const i = this.mapView.map.layers.findIndex((l) => l.title === k);
582
+ if (publicNotificationStore.state.managedLayers[k] === type) {
583
+ layer = this.mapView.map.layers.getItemAt(i);
584
+ return true;
585
+ }
586
+ });
587
+ return layer;
588
+ }
589
+ /**
590
+ * Update the export graphics by adding or removeing them
591
+ *
592
+ * @param clear When true the graphics layers will be cleared prior to adding any new graphics, defaults to false
593
+ *
594
+ * @protected
595
+ */
596
+ _updateExportGraphics(clear = false) {
597
+ if (clear || !this._exportGraphics || !this._addMap) {
598
+ this._removeExportGraphics();
599
+ }
600
+ if (this._exportGraphics && this._addMap) {
601
+ this._addExportGraphics();
602
+ }
603
+ }
604
+ /**
605
+ * Remove all buffer and sketch graphics
606
+ *
607
+ * @protected
608
+ */
609
+ _removeExportGraphics() {
610
+ const sketchLayer = this._getManagedLayer("sketch");
611
+ const bufferLayer = this._getManagedLayer("buffer");
612
+ if (sketchLayer) {
613
+ sketchLayer.graphics.removeAll();
614
+ }
615
+ if (bufferLayer) {
616
+ bufferLayer.graphics.removeAll();
617
+ }
618
+ }
619
+ /**
620
+ * Add all buffer and sketch graphics that are flagged for download
621
+ *
622
+ * @protected
623
+ */
624
+ _addExportGraphics() {
625
+ const sketchLayer = this._getManagedLayer("sketch");
626
+ const bufferLayer = this._getManagedLayer("buffer");
627
+ this._selectionSets.forEach(ss => {
628
+ if (ss.download) {
629
+ if (sketchLayer) {
630
+ sketchLayer.graphics.add(ss.sketchGraphic);
631
+ }
632
+ if (bufferLayer) {
633
+ const symbol = {
634
+ type: "simple-fill",
635
+ color: this.bufferColor,
636
+ outline: {
637
+ color: this.bufferOutlineColor,
638
+ width: 1
639
+ }
640
+ };
641
+ const bufferGraphic = new this.Graphic({
642
+ geometry: ss.buffer,
643
+ symbol
644
+ });
645
+ bufferLayer.graphics.add(bufferGraphic);
646
+ }
647
+ }
648
+ });
544
649
  }
545
650
  /**
546
651
  * Render the refine page
@@ -634,6 +739,7 @@ const PublicNotification = class {
634
739
  isActive = ss.download ? true : isActive;
635
740
  return ss;
636
741
  });
742
+ this._updateExportGraphics(true);
637
743
  this._downloadActive = isActive;
638
744
  this._fetchingData = true;
639
745
  this._numDuplicates = await this._getNumDuplicates();
@@ -23,8 +23,8 @@ const index = require('./index-ae65e42f.js');
23
23
  * limitations under the License.
24
24
  */
25
25
  const { state, onChange } = index.createStore({
26
- // List of layers added and managed by the component
27
- managedLayers: [],
26
+ // Key Value pair whose Key is the layer name and the Value is the type of layer ("buffer" | "sketch")
27
+ managedLayers: {},
28
28
  // List of tables added and managed by the component
29
29
  managedTables: [],
30
30
  // Handle[]: https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#Handle