@esri/solutions-components 0.7.24 → 0.7.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/dist/cjs/{info-card_4.cjs.entry.js → basemap-gallery_7.cjs.entry.js} +410 -324
  2. package/dist/cjs/buffer-tools_3.cjs.entry.js +3 -4
  3. package/dist/cjs/{calcite-alert_3.cjs.entry.js → calcite-alert_4.cjs.entry.js} +296 -3
  4. package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -2
  5. package/dist/cjs/calcite-flow_4.cjs.entry.js +3 -4
  6. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +1 -2
  7. package/dist/cjs/{card-manager_2.cjs.entry.js → card-manager_3.cjs.entry.js} +182 -5
  8. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -2
  9. package/dist/cjs/crowdsource-reporter.cjs.entry.js +32 -90
  10. package/dist/cjs/{downloadUtils-401356b5.js → downloadUtils-83c6d3c3.js} +6 -6
  11. package/dist/cjs/{index.es-a9a4ff08.js → index.es-bd1a93b2.js} +2 -2
  12. package/dist/cjs/layout-manager.cjs.entry.js +1 -2
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/{locale-1ff119f5.js → locale-a476e15d.js} +24 -3
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +4 -5
  16. package/dist/cjs/{popupUtils-8d5b6e94.js → popupUtils-a73902a6.js} +2 -2
  17. package/dist/cjs/public-notification.cjs.entry.js +3 -4
  18. package/dist/cjs/solution-configuration.cjs.entry.js +1 -2
  19. package/dist/cjs/solution-contents_3.cjs.entry.js +1 -2
  20. package/dist/cjs/solutions-components.cjs.js +1 -1
  21. package/dist/cjs/spatial-ref.cjs.entry.js +1 -2
  22. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +5 -27
  23. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +69 -95
  24. package/dist/collection/demos/crowdsource-reporter.html +96 -45
  25. package/dist/components/crowdsource-reporter.js +95 -209
  26. package/dist/esm/{info-card_4.entry.js → basemap-gallery_7.entry.js} +406 -323
  27. package/dist/esm/buffer-tools_3.entry.js +1 -2
  28. package/dist/esm/{calcite-alert_3.entry.js → calcite-alert_4.entry.js} +295 -3
  29. package/dist/esm/calcite-combobox_6.entry.js +1 -2
  30. package/dist/esm/calcite-flow_4.entry.js +3 -4
  31. package/dist/esm/calcite-shell-panel_14.entry.js +1 -2
  32. package/dist/esm/{card-manager_2.entry.js → card-manager_3.entry.js} +181 -5
  33. package/dist/esm/crowdsource-manager.entry.js +1 -2
  34. package/dist/esm/crowdsource-reporter.entry.js +32 -90
  35. package/dist/esm/{downloadUtils-067dc2ff.js → downloadUtils-a301c193.js} +2 -2
  36. package/dist/esm/{index.es-92e46d8b.js → index.es-37a9907e.js} +2 -2
  37. package/dist/esm/layout-manager.entry.js +1 -2
  38. package/dist/esm/loader.js +1 -1
  39. package/dist/esm/{locale-13e3c96c.js → locale-731e75a8.js} +22 -2
  40. package/dist/esm/map-select-tools_3.entry.js +2 -3
  41. package/dist/esm/{popupUtils-b71f30fc.js → popupUtils-a593bd78.js} +1 -1
  42. package/dist/esm/public-notification.entry.js +2 -3
  43. package/dist/esm/solution-configuration.entry.js +1 -2
  44. package/dist/esm/solution-contents_3.entry.js +1 -2
  45. package/dist/esm/solutions-components.js +1 -1
  46. package/dist/esm/spatial-ref.entry.js +1 -2
  47. package/dist/solutions-components/demos/crowdsource-reporter.html +96 -45
  48. package/dist/solutions-components/{p-36cbf14f.js → p-0587972d.js} +1 -1
  49. package/dist/solutions-components/p-0b4f4b0e.entry.js +6 -0
  50. package/dist/solutions-components/{p-f54f3719.entry.js → p-0b619197.entry.js} +1 -1
  51. package/dist/solutions-components/{p-d50f34c4.entry.js → p-2656c6e4.entry.js} +1 -1
  52. package/dist/solutions-components/p-284cc5cd.entry.js +6 -0
  53. package/dist/solutions-components/{p-01032eec.entry.js → p-29f661f5.entry.js} +2 -2
  54. package/dist/solutions-components/p-5af99fd8.entry.js +6 -0
  55. package/dist/solutions-components/{p-d9061e5d.entry.js → p-7116f96d.entry.js} +1 -1
  56. package/dist/solutions-components/p-7c13406e.entry.js +6 -0
  57. package/dist/solutions-components/{p-685257d1.entry.js → p-7dbccc10.entry.js} +1 -1
  58. package/dist/solutions-components/p-8308f64c.entry.js +6 -0
  59. package/dist/solutions-components/{p-ca4023f4.entry.js → p-891682da.entry.js} +1 -1
  60. package/dist/solutions-components/{p-14ff1465.js → p-a603e673.js} +2 -2
  61. package/dist/solutions-components/p-b37ec1f3.entry.js +6 -0
  62. package/dist/solutions-components/{p-fec77450.js → p-db868283.js} +1 -1
  63. package/dist/solutions-components/{p-fb1c6811.entry.js → p-dded59a7.entry.js} +1 -1
  64. package/dist/solutions-components/p-e88a64be.entry.js +6 -0
  65. package/dist/solutions-components/p-e902ba19.js +36 -0
  66. package/dist/solutions-components/p-fe295e9d.entry.js +6 -0
  67. package/dist/solutions-components/solutions-components.esm.js +1 -1
  68. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +14 -28
  69. package/dist/types/components.d.ts +16 -0
  70. package/package.json +1 -1
  71. package/dist/cjs/basemap-gallery_5.cjs.entry.js +0 -573
  72. package/dist/cjs/loadModules-46d14e81.js +0 -30
  73. package/dist/esm/basemap-gallery_5.entry.js +0 -565
  74. package/dist/esm/loadModules-cea493da.js +0 -28
  75. package/dist/solutions-components/p-3606c4b8.entry.js +0 -6
  76. package/dist/solutions-components/p-48ff9cea.js +0 -21
  77. package/dist/solutions-components/p-5e832d65.entry.js +0 -6
  78. package/dist/solutions-components/p-8fc072ca.entry.js +0 -6
  79. package/dist/solutions-components/p-a2d3df14.entry.js +0 -6
  80. package/dist/solutions-components/p-ab006ace.js +0 -21
  81. package/dist/solutions-components/p-ba56035f.entry.js +0 -6
  82. package/dist/solutions-components/p-c0ed2b83.entry.js +0 -6
  83. package/dist/solutions-components/p-cc88bb42.entry.js +0 -6
  84. package/dist/solutions-components/p-db69f4ba.entry.js +0 -6
  85. package/dist/solutions-components/p-e3061220.entry.js +0 -6
@@ -8,8 +8,7 @@
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  const index = require('./index-b8a649fc.js');
11
- const loadModules = require('./loadModules-46d14e81.js');
12
- const locale = require('./locale-1ff119f5.js');
11
+ const locale = require('./locale-a476e15d.js');
13
12
  const dom = require('./dom-e111eaa6.js');
14
13
  const interfaces = require('./interfaces-7cd0a48a.js');
15
14
  const publicNotificationStore = require('./publicNotificationStore-3a17c2f4.js');
@@ -114,7 +113,7 @@ const BufferTools = class {
114
113
  * @protected
115
114
  */
116
115
  async _initModules() {
117
- const [geometryEngine] = await loadModules.loadModules([
116
+ const [geometryEngine] = await locale.loadModules([
118
117
  "esri/geometry/geometryEngine"
119
118
  ]);
120
119
  this._geometryEngine = geometryEngine;
@@ -435,7 +434,7 @@ const MapDrawTools = class {
435
434
  * @protected
436
435
  */
437
436
  async _initModules() {
438
- const [GraphicsLayer, Sketch, SketchViewModel] = await loadModules.loadModules([
437
+ const [GraphicsLayer, Sketch, SketchViewModel] = await locale.loadModules([
439
438
  "esri/layers/GraphicsLayer",
440
439
  "esri/widgets/Sketch",
441
440
  "esri/widgets/Sketch/SketchViewModel"
@@ -15,9 +15,9 @@ const locale = require('./locale-6a627639.js');
15
15
  const openCloseComponent = require('./openCloseComponent-8c9a1749.js');
16
16
  const t9n = require('./t9n-0556abcb.js');
17
17
  const resources = require('./resources-222ad22c.js');
18
- const locale$1 = require('./locale-1ff119f5.js');
19
- const loadModules = require('./loadModules-46d14e81.js');
18
+ const locale$1 = require('./locale-a476e15d.js');
20
19
  const mapViewUtils = require('./mapViewUtils-8aa325de.js');
20
+ const popupUtils = require('./popupUtils-a73902a6.js');
21
21
  require('./guid-1a466ca6.js');
22
22
  require('./resources-6c60363a.js');
23
23
  require('./key-b8c05387.js');
@@ -553,7 +553,7 @@ const EditCard = class {
553
553
  * @returns Promise resolving when function is done
554
554
  */
555
555
  async _initModules() {
556
- const [Editor, reactiveUtils] = await loadModules.loadModules([
556
+ const [Editor, reactiveUtils] = await locale$1.loadModules([
557
557
  "esri/widgets/Editor",
558
558
  "esri/core/reactiveUtils"
559
559
  ]);
@@ -654,6 +654,299 @@ const EditCard = class {
654
654
  };
655
655
  EditCard.style = editCardCss;
656
656
 
657
+ const infoCardCss = ":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.padding-top-46{padding-top:46px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}";
658
+
659
+ const InfoCard = class {
660
+ constructor(hostRef) {
661
+ index.registerInstance(this, hostRef);
662
+ this.popupClosed = index.createEvent(this, "popupClosed", 7);
663
+ this.selectionChanged = index.createEvent(this, "selectionChanged", 7);
664
+ this.graphics = undefined;
665
+ this.isLoading = false;
666
+ this.isMobile = undefined;
667
+ this.mapView = undefined;
668
+ this.zoomAndScrollToSelected = undefined;
669
+ this.allowEditing = true;
670
+ this._alertOpen = false;
671
+ this._count = "";
672
+ this._editRecordOpen = false;
673
+ this._mobileTitle = "";
674
+ this._showListView = false;
675
+ this._translations = undefined;
676
+ }
677
+ //--------------------------------------------------------------------------
678
+ //
679
+ // Watch handlers
680
+ //
681
+ //--------------------------------------------------------------------------
682
+ /**
683
+ * Watch for changes to the graphic and update the feature widget
684
+ */
685
+ async graphicsWatchHandler() {
686
+ await this.setGraphics();
687
+ }
688
+ /**
689
+ * Watch for changes to the isMobile prop then init the Features widget
690
+ * We need to know if the title should be displayed by the widget (non mobile)
691
+ * or by us (mobile)
692
+ */
693
+ async isMobileWatchHandler() {
694
+ await this._initFeaturesWidget();
695
+ }
696
+ /**
697
+ * Watch for changes to the mapView and re-init the Feature widget
698
+ */
699
+ async mapViewWatchHandler() {
700
+ return await this._initFeaturesWidget();
701
+ }
702
+ //--------------------------------------------------------------------------
703
+ //
704
+ // Methods (public)
705
+ //
706
+ //--------------------------------------------------------------------------
707
+ /**
708
+ * Get the current selected feature from the Features widget
709
+ *
710
+ * @returns Promise resolving with the current feature
711
+ */
712
+ async getSelectedFeature() {
713
+ return this._features.selectedFeature;
714
+ }
715
+ /**
716
+ * Respond to and close the edit record display
717
+ *
718
+ * @returns a promise when the operation has completed
719
+ */
720
+ async closeEdit() {
721
+ this._editRecordOpen = false;
722
+ }
723
+ /**
724
+ * Reset key properties when the layer selection changes
725
+ */
726
+ async layerSelectionChange() {
727
+ var _a;
728
+ this._showListView = false;
729
+ if ((_a = this._features) === null || _a === void 0 ? void 0 : _a.viewModel) {
730
+ this._features.viewModel.featureMenuOpen = false;
731
+ this._features.close();
732
+ }
733
+ }
734
+ /**
735
+ * Refresh the info-card graphics
736
+ */
737
+ async refreshGraphics(evt) {
738
+ this.graphics = [...evt.detail];
739
+ }
740
+ //--------------------------------------------------------------------------
741
+ //
742
+ // Functions (lifecycle)
743
+ //
744
+ //--------------------------------------------------------------------------
745
+ /**
746
+ * StencilJS: Called once just after the component is first connected to the DOM.
747
+ *
748
+ * @returns Promise when complete
749
+ */
750
+ async componentWillLoad() {
751
+ await this._initModules();
752
+ await this._getTranslations();
753
+ this._popupUtils = new popupUtils.PopupUtils();
754
+ }
755
+ /**
756
+ * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
757
+ * @returns Promise when complete
758
+ */
759
+ async componentDidLoad() {
760
+ var _a;
761
+ if (((_a = this.graphics) === null || _a === void 0 ? void 0 : _a.length) > 0) {
762
+ await this.setGraphics();
763
+ }
764
+ }
765
+ /**
766
+ * Renders the component.
767
+ */
768
+ render() {
769
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
770
+ const loadingClass = this.isLoading ? "" : "display-none";
771
+ const featureNodeClass = this.isLoading || this._editRecordOpen ? "visibility-hidden" : "position-absolute";
772
+ const editClass = !this.isLoading && this._editRecordOpen ? "position-absolute" : "display-none";
773
+ const editButtonClass = (!this.isLoading && this._editRecordOpen) || this._showListView ? "display-none" : "";
774
+ const nextBackDisabled = ((_b = (_a = this._features) === null || _a === void 0 ? void 0 : _a.features) === null || _b === void 0 ? void 0 : _b.length) < 2;
775
+ const nextBackClass = this.isMobile ? "display-none" : "";
776
+ const shellClass = this.isMobile && !this._editRecordOpen ? "padding-top-46" : "";
777
+ const id = (_d = (_c = this._features) === null || _c === void 0 ? void 0 : _c.selectedFeature) === null || _d === void 0 ? void 0 : _d.getObjectId();
778
+ const ids = parseInt(id === null || id === void 0 ? void 0 : id.toString(), 10) > -1 ? [id] : [];
779
+ const deleteEnabled = ((_e = this._layer) === null || _e === void 0 ? void 0 : _e.editingEnabled) && ((_h = (_g = (_f = this._layer) === null || _f === void 0 ? void 0 : _f.capabilities) === null || _g === void 0 ? void 0 : _g.operations) === null || _h === void 0 ? void 0 : _h.supportsDelete);
780
+ return (index.h(index.Host, null, this.isMobile && !this._editRecordOpen ? (index.h("calcite-panel", null, index.h("calcite-action", { class: "end-border", icon: "chevron-left", iconFlipRtl: true, onClick: () => this._closePopup(), scale: "s", slot: "header-actions-start", text: "" }), index.h("span", { class: "font-bold", slot: "header-content" }, this._mobileTitle))) : undefined, index.h("calcite-shell", { class: shellClass }, index.h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData }), index.h("div", { class: "esri-widget " + featureNodeClass, id: "features-node" }), index.h("div", { class: `${editButtonClass} width-100`, slot: "footer" }, this.allowEditing &&
781
+ index.h("div", { class: "display-flex top-border padding-1-2" }, index.h("calcite-button", { appearance: "solid", id: "solutions-edit", onClick: () => this._openEditRecord(), width: "full" }, this._translations.edit), this.isMobile && deleteEnabled ? (index.h("delete-button", { class: "padding-inline-start-1 width-100", id: "solutions-delete", ids: ids, layer: this._layer, onEditsComplete: () => this._closePopup() })) : undefined, index.h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "solutions-edit" }, index.h("span", null, this._translations.edit)), this.isMobile ? (index.h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "solutions-delete" }, index.h("span", null, this._translations.delete))) : undefined), !nextBackDisabled && index.h("div", { class: `display-flex padding-1-2 button-container top-border ${nextBackClass}` }, index.h("div", { class: "min-width-100" }, index.h("calcite-button", { appearance: "outline", disabled: nextBackDisabled, id: "solutions-back", onClick: () => this._back(), width: "full" }, this._translations.back), index.h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-back" }, index.h("span", null, this._translations.back))), index.h("div", null, index.h("calcite-action", { icon: "list", onClick: () => this._toggleListView(), scale: "s", text: this._count, textEnabled: true })), index.h("div", { class: "min-width-100" }, index.h("calcite-button", { appearance: "outline", disabled: nextBackDisabled, id: "solutions-next", onClick: () => this._next(), width: "full" }, this._translations.next), index.h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-next" }, index.h("span", null, this._translations.next))))), index.h("edit-card", { class: editClass, graphicIndex: (_j = this._features) === null || _j === void 0 ? void 0 : _j.selectedFeatureIndex, graphics: this.graphics, mapView: this.mapView, open: this._editRecordOpen }), index.h("calcite-alert", { icon: "layer-broken", kind: "warning", label: "", onCalciteAlertClose: () => this._alertClosed(), open: this._alertOpen, placement: "top" }, index.h("div", { slot: "title" }, this._translations.editDisabled), index.h("div", { slot: "message" }, this._translations.enableEditing)))));
782
+ }
783
+ //--------------------------------------------------------------------------
784
+ //
785
+ // Functions (protected)
786
+ //
787
+ //--------------------------------------------------------------------------
788
+ /**
789
+ * Load esri javascript api modules
790
+ *
791
+ * @returns Promise resolving when function is done
792
+ *
793
+ * @protected
794
+ */
795
+ async _initModules() {
796
+ const [Features, reactiveUtils] = await locale$1.loadModules([
797
+ "esri/widgets/Features",
798
+ "esri/core/reactiveUtils"
799
+ ]);
800
+ this.Features = Features;
801
+ this.reactiveUtils = reactiveUtils;
802
+ }
803
+ /**
804
+ * Initializes the features widget if not created and updates the feature widget and other required states
805
+ *
806
+ * @protected
807
+ */
808
+ async setGraphics() {
809
+ var _a;
810
+ if (!this._features) {
811
+ await this._initFeaturesWidget();
812
+ }
813
+ if (this.graphics.length > 0) {
814
+ this._layer = (_a = this.graphics[0]) === null || _a === void 0 ? void 0 : _a.layer;
815
+ this._editEnabled = this._layer.editingEnabled && this._layer.capabilities.operations.supportsUpdate;
816
+ this._mobileTitle = await this._popupUtils.getPopupTitle(this.graphics[0]);
817
+ this._features.open({
818
+ features: this.graphics
819
+ });
820
+ }
821
+ else {
822
+ this._features.clear();
823
+ this._features.close();
824
+ }
825
+ this._count = this._getCount();
826
+ }
827
+ /**
828
+ * Init the Feature widget so we can display the popup content
829
+ *
830
+ * @returns a promise when the operation has completed
831
+ *
832
+ * @protected
833
+ */
834
+ async _initFeaturesWidget() {
835
+ var _a;
836
+ return this.isMobile !== undefined ? await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.when(() => {
837
+ if (!this._features) {
838
+ this._features = new this.Features({
839
+ view: this.mapView,
840
+ container: "features-node",
841
+ visibleElements: {
842
+ actionBar: false,
843
+ closeButton: false,
844
+ heading: !this.isMobile
845
+ }
846
+ });
847
+ this.reactiveUtils.watch(() => this._features.viewModel.featureMenuOpen, (isOpen) => {
848
+ if (!isOpen) {
849
+ this._showListView = isOpen;
850
+ }
851
+ });
852
+ if (this.zoomAndScrollToSelected) {
853
+ this.reactiveUtils.watch(() => this._features.selectedFeatureIndex, (i) => {
854
+ if (i > -1) {
855
+ this.selectionChanged.emit([this._features.selectedFeature]);
856
+ }
857
+ });
858
+ }
859
+ }
860
+ else {
861
+ this._features.view = this.mapView;
862
+ this._features.visibleElements.actionBar = false;
863
+ this._features.visibleElements.closeButton = false;
864
+ this._features.visibleElements.heading = !this.isMobile;
865
+ }
866
+ })) : Promise.resolve();
867
+ }
868
+ /**
869
+ * Close the popup and emit the selected features
870
+ */
871
+ _closePopup() {
872
+ this.popupClosed.emit();
873
+ }
874
+ /**
875
+ * Set the alertOpen member to false when the alert is closed
876
+ */
877
+ _alertClosed() {
878
+ this._alertOpen = false;
879
+ }
880
+ /**
881
+ * Open the edit record
882
+ */
883
+ _openEditRecord() {
884
+ if (this._editEnabled) {
885
+ this._editRecordOpen = true;
886
+ }
887
+ else {
888
+ this._alertOpen = true;
889
+ }
890
+ }
891
+ /**
892
+ * Go to the previous feature in the features widget
893
+ */
894
+ _back() {
895
+ this._features.previous();
896
+ this._count = this._getCount();
897
+ }
898
+ /**
899
+ * Go to the next feature in the features widget
900
+ */
901
+ _next() {
902
+ this._features.next();
903
+ this._count = this._getCount();
904
+ }
905
+ /**
906
+ * Get the current index of total string
907
+ *
908
+ * @returns the index of total string
909
+ */
910
+ _getCount() {
911
+ var _a, _b, _c;
912
+ const index = (((_a = this._features) === null || _a === void 0 ? void 0 : _a.viewModel.selectedFeatureIndex) + 1).toString();
913
+ const total = (_c = (_b = this._features) === null || _b === void 0 ? void 0 : _b.features) === null || _c === void 0 ? void 0 : _c.length.toString();
914
+ return this._translations.indexOfTotal
915
+ .replace("{{index}}", index)
916
+ .replace("{{total}}", total);
917
+ }
918
+ /**
919
+ * Toggle the visibility of the features list view
920
+ */
921
+ _toggleListView() {
922
+ this._showListView = !this._showListView;
923
+ const i = this._features.selectedFeatureIndex;
924
+ this._features.open({
925
+ features: this.graphics,
926
+ featureMenuOpen: this._showListView
927
+ });
928
+ this._features.selectedFeatureIndex = i;
929
+ }
930
+ /**
931
+ * Fetches the component's translations
932
+ *
933
+ * @returns Promise when complete
934
+ * @protected
935
+ */
936
+ async _getTranslations() {
937
+ const messages = await locale$1.getLocaleComponentStrings(this.el);
938
+ this._translations = messages[0];
939
+ }
940
+ get el() { return index.getElement(this); }
941
+ static get watchers() { return {
942
+ "graphics": ["graphicsWatchHandler"],
943
+ "isMobile": ["isMobileWatchHandler"],
944
+ "mapView": ["mapViewWatchHandler"]
945
+ }; }
946
+ };
947
+ InfoCard.style = infoCardCss;
948
+
657
949
  exports.calcite_alert = Alert;
658
950
  exports.delete_button = DeleteButton;
659
951
  exports.edit_card = EditCard;
952
+ exports.info_card = InfoCard;
@@ -25,12 +25,11 @@ const component = require('./component-c270a500.js');
25
25
  const debounce = require('./debounce-30afab47.js');
26
26
  const conditionalSlot = require('./conditionalSlot-63e11cba.js');
27
27
  const key = require('./key-b8c05387.js');
28
- const locale$1 = require('./locale-1ff119f5.js');
28
+ const locale$1 = require('./locale-a476e15d.js');
29
29
  const mapViewUtils = require('./mapViewUtils-8aa325de.js');
30
30
  const publicNotificationStore = require('./publicNotificationStore-3a17c2f4.js');
31
31
  require('./resources-6c60363a.js');
32
32
  require('./browser-9a43b900.js');
33
- require('./loadModules-46d14e81.js');
34
33
  require('./esri-loader-a91c0ec1.js');
35
34
  require('./_commonjsHelpers-384729db.js');
36
35
  require('./interfaces-7cd0a48a.js');
@@ -15,17 +15,16 @@ const interactive = require('./interactive-8aff886e.js');
15
15
  const locale = require('./locale-6a627639.js');
16
16
  const t9n = require('./t9n-0556abcb.js');
17
17
  const resources = require('./resources-8e3763a4.js');
18
- const popupUtils = require('./popupUtils-8d5b6e94.js');
18
+ const popupUtils = require('./popupUtils-a73902a6.js');
19
19
  const mapViewUtils = require('./mapViewUtils-8aa325de.js');
20
- const locale$1 = require('./locale-1ff119f5.js');
20
+ const locale$1 = require('./locale-a476e15d.js');
21
21
  require('./guid-1a466ca6.js');
22
22
  require('./resources-6c60363a.js');
23
23
  require('./browser-9a43b900.js');
24
24
  require('./key-b8c05387.js');
25
- require('./loadModules-46d14e81.js');
25
+ require('./interfaces-7cd0a48a.js');
26
26
  require('./esri-loader-a91c0ec1.js');
27
27
  require('./_commonjsHelpers-384729db.js');
28
- require('./interfaces-7cd0a48a.js');
29
28
 
30
29
  /*!
31
30
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
@@ -23,7 +23,7 @@ const sharedListRender = require('./shared-list-render-25bedff5.js');
23
23
  const sortableComponent = require('./sortableComponent-188f3290.js');
24
24
  const resources$2 = require('./resources-228f9286.js');
25
25
  const resources$1 = require('./resources-d2d7b7c7.js');
26
- const locale$1 = require('./locale-1ff119f5.js');
26
+ const locale$1 = require('./locale-a476e15d.js');
27
27
  const solutionStore = require('./solution-store-ab6c980f.js');
28
28
  const interfaces = require('./interfaces-7cd0a48a.js');
29
29
  const solutionResource = require('./solution-resource-abec7452.js');
@@ -33,7 +33,6 @@ require('./browser-9a43b900.js');
33
33
  require('./array-1d19377b.js');
34
34
  require('./resources-9400a252.js');
35
35
  require('./debounce-30afab47.js');
36
- require('./loadModules-46d14e81.js');
37
36
  require('./esri-loader-a91c0ec1.js');
38
37
  require('./_commonjsHelpers-384729db.js');
39
38
  require('./index-22bb61da.js');
@@ -8,13 +8,12 @@
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  const index = require('./index-b8a649fc.js');
11
- const locale = require('./locale-1ff119f5.js');
11
+ const locale = require('./locale-a476e15d.js');
12
12
  const mapViewUtils = require('./mapViewUtils-8aa325de.js');
13
- const loadModules = require('./loadModules-46d14e81.js');
14
- const downloadUtils = require('./downloadUtils-401356b5.js');
15
- require('./interfaces-7cd0a48a.js');
13
+ const downloadUtils = require('./downloadUtils-83c6d3c3.js');
16
14
  require('./esri-loader-a91c0ec1.js');
17
15
  require('./_commonjsHelpers-384729db.js');
16
+ require('./interfaces-7cd0a48a.js');
18
17
  require('./solution-resource-abec7452.js');
19
18
  require('./index-f64944ad.js');
20
19
  require('./restHelpersGet-e0737480.js');
@@ -402,7 +401,7 @@ const LayerTable = class {
402
401
  * @protected
403
402
  */
404
403
  async _initModules() {
405
- const [FeatureTable, reactiveUtils] = await loadModules.loadModules([
404
+ const [FeatureTable, reactiveUtils] = await locale.loadModules([
406
405
  "esri/widgets/FeatureTable",
407
406
  "esri/core/reactiveUtils"
408
407
  ]);
@@ -1465,5 +1464,183 @@ const LayerTable = class {
1465
1464
  };
1466
1465
  LayerTable.style = layerTableCss;
1467
1466
 
1467
+ const mapCardCss = ":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.box-shadow{box-shadow:none !important}.visibility-hidden{visibility:hidden}.display-none{display:none}";
1468
+
1469
+ const MapCard = class {
1470
+ constructor(hostRef) {
1471
+ index.registerInstance(this, hostRef);
1472
+ this.mapChanged = index.createEvent(this, "mapChanged", 7);
1473
+ this.beforeMapChanged = index.createEvent(this, "beforeMapChanged", 7);
1474
+ /**
1475
+ * boolean: When true the default map provided via url params has been loaded and should no longer override other maps
1476
+ */
1477
+ this._defaultWebmapHonored = false;
1478
+ /**
1479
+ * string: the id of map currently displayed
1480
+ */
1481
+ this._loadedId = "";
1482
+ this.defaultWebmapId = "";
1483
+ this.enableHome = undefined;
1484
+ this.enableLegend = undefined;
1485
+ this.enableFloorFilter = undefined;
1486
+ this.enableFullscreen = undefined;
1487
+ this.enableSingleExpand = true;
1488
+ this.enableSearch = undefined;
1489
+ this.enableBasemap = undefined;
1490
+ this.basemapConfig = undefined;
1491
+ this.hidden = undefined;
1492
+ this.homeZoomIndex = 3;
1493
+ this.homeZoomPosition = "top-left";
1494
+ this.homeZoomToolsSize = "m";
1495
+ this.mapInfos = [];
1496
+ this.mapWidgetsIndex = 0;
1497
+ this.mapWidgetsPosition = "top-right";
1498
+ this.mapWidgetsSize = "m";
1499
+ this.mapView = undefined;
1500
+ this.stackTools = true;
1501
+ this.theme = undefined;
1502
+ this.toolOrder = undefined;
1503
+ this._searchConfiguration = undefined;
1504
+ this._webMapInfo = undefined;
1505
+ }
1506
+ //--------------------------------------------------------------------------
1507
+ //
1508
+ // Watch handlers
1509
+ //
1510
+ //--------------------------------------------------------------------------
1511
+ /**
1512
+ * Add/remove home widget
1513
+ */
1514
+ enableHomeWatchHandler() {
1515
+ this._initHome();
1516
+ }
1517
+ /**
1518
+ * Listen for changes to map info and load the appropriate map
1519
+ */
1520
+ async mapInfoChange(evt) {
1521
+ await this._loadMap(evt.detail);
1522
+ }
1523
+ //--------------------------------------------------------------------------
1524
+ //
1525
+ // Functions (lifecycle)
1526
+ //
1527
+ //--------------------------------------------------------------------------
1528
+ /**
1529
+ * StencilJS: Called once just after the component is first connected to the DOM.
1530
+ */
1531
+ async componentWillLoad() {
1532
+ await this._initModules();
1533
+ }
1534
+ /**
1535
+ * Renders the component.
1536
+ */
1537
+ render() {
1538
+ var _a, _b;
1539
+ const mapClass = this.hidden ? "visibility-hidden" : "";
1540
+ const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
1541
+ const mapPickerClass = ((_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.length) > 1 ? "" : "display-none";
1542
+ const mapHeightClass = ((_b = this.mapInfos) === null || _b === void 0 ? void 0 : _b.length) > 1 ? "map-height" : "height-full";
1543
+ return (index.h(index.Host, null, index.h("map-picker", { class: mapPickerClass, mapInfos: this.mapInfos, ref: (el) => this._mapPicker = el }), index.h("div", { class: `${mapHeightClass} ${mapClass}`, ref: (el) => (this._mapDiv = el) }), index.h("map-tools", { basemapConfig: this.basemapConfig, class: `box-shadow ${themeClass}`, enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableHome: this.enableHome, enableLegend: this.enableLegend, enableSearch: this.enableSearch, enableSingleExpand: this.enableSingleExpand, homeZoomToolsSize: this.homeZoomToolsSize, mapView: this.mapView, mapWidgetsSize: this.mapWidgetsSize, position: this.mapWidgetsPosition, ref: (el) => this._mapTools = el, searchConfiguration: this._searchConfiguration, stackTools: this.stackTools, toolOrder: this.toolOrder })));
1544
+ }
1545
+ //--------------------------------------------------------------------------
1546
+ //
1547
+ // Functions (protected)
1548
+ //
1549
+ //--------------------------------------------------------------------------
1550
+ /**
1551
+ * Load esri javascript api modules
1552
+ *
1553
+ * @returns Promise resolving when function is done
1554
+ *
1555
+ * @protected
1556
+ */
1557
+ async _initModules() {
1558
+ const [WebMap, MapView, Home] = await locale.loadModules([
1559
+ "esri/WebMap",
1560
+ "esri/views/MapView",
1561
+ "esri/widgets/Home"
1562
+ ]);
1563
+ this.WebMap = WebMap;
1564
+ this.MapView = MapView;
1565
+ this.Home = Home;
1566
+ }
1567
+ /**
1568
+ * Load the webmap for the provided webMapInfo
1569
+ *
1570
+ * @param webMapInfo the webmap id and name to load
1571
+ */
1572
+ async _loadMap(webMapInfo) {
1573
+ var _a;
1574
+ // on the first render use the default webmap id if provided otherwise use the first child of the provided mapInfos
1575
+ const loadDefaultMap = !this._defaultWebmapHonored && this.defaultWebmapId;
1576
+ const defaultMap = (_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.filter(i => i.id === this.defaultWebmapId);
1577
+ const mapConfigChanged = JSON.stringify(webMapInfo) !== JSON.stringify(this._webMapInfo);
1578
+ this._webMapInfo = loadDefaultMap && defaultMap ? defaultMap[0] :
1579
+ !(webMapInfo === null || webMapInfo === void 0 ? void 0 : webMapInfo.id) && this.mapInfos.length > 0 ? this.mapInfos[0] : webMapInfo;
1580
+ const id = this._webMapInfo.id;
1581
+ const isDefaultMap = loadDefaultMap && (webMapInfo === null || webMapInfo === void 0 ? void 0 : webMapInfo.id) === this.defaultWebmapId;
1582
+ if ((this._loadedId !== id && !loadDefaultMap) || isDefaultMap) {
1583
+ const webMap = new this.WebMap({
1584
+ portalItem: { id }
1585
+ });
1586
+ this.mapView = new this.MapView({
1587
+ container: this._mapDiv,
1588
+ map: webMap,
1589
+ resizeAlign: "center"
1590
+ });
1591
+ this._loadedId = id;
1592
+ this._searchConfiguration = this._webMapInfo.searchConfiguration;
1593
+ this.beforeMapChanged.emit();
1594
+ await this.mapView.when(() => {
1595
+ this._initHome();
1596
+ this.mapView.ui.add(this._mapTools, { position: this.mapWidgetsPosition, index: this.mapWidgetsIndex });
1597
+ this._defaultWebmapHonored = isDefaultMap ? true : this._defaultWebmapHonored;
1598
+ this.mapChanged.emit({
1599
+ id: id,
1600
+ mapView: this.mapView
1601
+ });
1602
+ });
1603
+ }
1604
+ else if (loadDefaultMap) {
1605
+ this._defaultWebmapHonored = true;
1606
+ this._mapPicker.setMapByID(id);
1607
+ }
1608
+ else if (mapConfigChanged) {
1609
+ // Map is the same so no need to reload but we need to update for any changes from the config
1610
+ this._searchConfiguration = this._webMapInfo.searchConfiguration;
1611
+ this.beforeMapChanged.emit();
1612
+ this.mapChanged.emit({
1613
+ id: id,
1614
+ mapView: this.mapView
1615
+ });
1616
+ }
1617
+ }
1618
+ /**
1619
+ * Add/remove the home widget base on enableHome prop
1620
+ *
1621
+ * @protected
1622
+ */
1623
+ _initHome() {
1624
+ if (this.enableHome) {
1625
+ this._homeWidget = new this.Home({
1626
+ view: this.mapView
1627
+ });
1628
+ this.mapView.ui.add(this._homeWidget, { position: this.homeZoomPosition, index: this.homeZoomIndex });
1629
+ const size = this.homeZoomToolsSize === "s" ? "32px" : this.homeZoomToolsSize === "m" ? "40px" : "48px";
1630
+ this._homeWidget.domNode.style.height = size;
1631
+ this._homeWidget.domNode.style.width = size;
1632
+ }
1633
+ else if (this._homeWidget) {
1634
+ this.mapView.ui.remove(this._homeWidget);
1635
+ }
1636
+ }
1637
+ get el() { return index.getElement(this); }
1638
+ static get watchers() { return {
1639
+ "enableHome": ["enableHomeWatchHandler"]
1640
+ }; }
1641
+ };
1642
+ MapCard.style = mapCardCss;
1643
+
1468
1644
  exports.card_manager = CardManager;
1469
1645
  exports.layer_table = LayerTable;
1646
+ exports.map_card = MapCard;
@@ -8,10 +8,9 @@
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  const index = require('./index-b8a649fc.js');
11
- const locale = require('./locale-1ff119f5.js');
11
+ const locale = require('./locale-a476e15d.js');
12
12
  const interfaces = require('./interfaces-7cd0a48a.js');
13
13
  const mapViewUtils = require('./mapViewUtils-8aa325de.js');
14
- require('./loadModules-46d14e81.js');
15
14
  require('./esri-loader-a91c0ec1.js');
16
15
  require('./_commonjsHelpers-384729db.js');
17
16