@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.
- package/dist/cjs/{info-card_4.cjs.entry.js → basemap-gallery_7.cjs.entry.js} +410 -324
- package/dist/cjs/buffer-tools_3.cjs.entry.js +3 -4
- package/dist/cjs/{calcite-alert_3.cjs.entry.js → calcite-alert_4.cjs.entry.js} +296 -3
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -2
- package/dist/cjs/calcite-flow_4.cjs.entry.js +3 -4
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +1 -2
- package/dist/cjs/{card-manager_2.cjs.entry.js → card-manager_3.cjs.entry.js} +182 -5
- package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -2
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +32 -90
- package/dist/cjs/{downloadUtils-401356b5.js → downloadUtils-83c6d3c3.js} +6 -6
- package/dist/cjs/{index.es-a9a4ff08.js → index.es-bd1a93b2.js} +2 -2
- package/dist/cjs/layout-manager.cjs.entry.js +1 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{locale-1ff119f5.js → locale-a476e15d.js} +24 -3
- package/dist/cjs/map-select-tools_3.cjs.entry.js +4 -5
- package/dist/cjs/{popupUtils-8d5b6e94.js → popupUtils-a73902a6.js} +2 -2
- package/dist/cjs/public-notification.cjs.entry.js +3 -4
- package/dist/cjs/solution-configuration.cjs.entry.js +1 -2
- package/dist/cjs/solution-contents_3.cjs.entry.js +1 -2
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +1 -2
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +5 -27
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +69 -95
- package/dist/collection/demos/crowdsource-reporter.html +96 -45
- package/dist/components/crowdsource-reporter.js +95 -209
- package/dist/esm/{info-card_4.entry.js → basemap-gallery_7.entry.js} +406 -323
- package/dist/esm/buffer-tools_3.entry.js +1 -2
- package/dist/esm/{calcite-alert_3.entry.js → calcite-alert_4.entry.js} +295 -3
- package/dist/esm/calcite-combobox_6.entry.js +1 -2
- package/dist/esm/calcite-flow_4.entry.js +3 -4
- package/dist/esm/calcite-shell-panel_14.entry.js +1 -2
- package/dist/esm/{card-manager_2.entry.js → card-manager_3.entry.js} +181 -5
- package/dist/esm/crowdsource-manager.entry.js +1 -2
- package/dist/esm/crowdsource-reporter.entry.js +32 -90
- package/dist/esm/{downloadUtils-067dc2ff.js → downloadUtils-a301c193.js} +2 -2
- package/dist/esm/{index.es-92e46d8b.js → index.es-37a9907e.js} +2 -2
- package/dist/esm/layout-manager.entry.js +1 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{locale-13e3c96c.js → locale-731e75a8.js} +22 -2
- package/dist/esm/map-select-tools_3.entry.js +2 -3
- package/dist/esm/{popupUtils-b71f30fc.js → popupUtils-a593bd78.js} +1 -1
- package/dist/esm/public-notification.entry.js +2 -3
- package/dist/esm/solution-configuration.entry.js +1 -2
- package/dist/esm/solution-contents_3.entry.js +1 -2
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +1 -2
- package/dist/solutions-components/demos/crowdsource-reporter.html +96 -45
- package/dist/solutions-components/{p-36cbf14f.js → p-0587972d.js} +1 -1
- package/dist/solutions-components/p-0b4f4b0e.entry.js +6 -0
- package/dist/solutions-components/{p-f54f3719.entry.js → p-0b619197.entry.js} +1 -1
- package/dist/solutions-components/{p-d50f34c4.entry.js → p-2656c6e4.entry.js} +1 -1
- package/dist/solutions-components/p-284cc5cd.entry.js +6 -0
- package/dist/solutions-components/{p-01032eec.entry.js → p-29f661f5.entry.js} +2 -2
- package/dist/solutions-components/p-5af99fd8.entry.js +6 -0
- package/dist/solutions-components/{p-d9061e5d.entry.js → p-7116f96d.entry.js} +1 -1
- package/dist/solutions-components/p-7c13406e.entry.js +6 -0
- package/dist/solutions-components/{p-685257d1.entry.js → p-7dbccc10.entry.js} +1 -1
- package/dist/solutions-components/p-8308f64c.entry.js +6 -0
- package/dist/solutions-components/{p-ca4023f4.entry.js → p-891682da.entry.js} +1 -1
- package/dist/solutions-components/{p-14ff1465.js → p-a603e673.js} +2 -2
- package/dist/solutions-components/p-b37ec1f3.entry.js +6 -0
- package/dist/solutions-components/{p-fec77450.js → p-db868283.js} +1 -1
- package/dist/solutions-components/{p-fb1c6811.entry.js → p-dded59a7.entry.js} +1 -1
- package/dist/solutions-components/p-e88a64be.entry.js +6 -0
- package/dist/solutions-components/p-e902ba19.js +36 -0
- package/dist/solutions-components/p-fe295e9d.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +14 -28
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/dist/cjs/basemap-gallery_5.cjs.entry.js +0 -573
- package/dist/cjs/loadModules-46d14e81.js +0 -30
- package/dist/esm/basemap-gallery_5.entry.js +0 -565
- package/dist/esm/loadModules-cea493da.js +0 -28
- package/dist/solutions-components/p-3606c4b8.entry.js +0 -6
- package/dist/solutions-components/p-48ff9cea.js +0 -21
- package/dist/solutions-components/p-5e832d65.entry.js +0 -6
- package/dist/solutions-components/p-8fc072ca.entry.js +0 -6
- package/dist/solutions-components/p-a2d3df14.entry.js +0 -6
- package/dist/solutions-components/p-ab006ace.js +0 -21
- package/dist/solutions-components/p-ba56035f.entry.js +0 -6
- package/dist/solutions-components/p-c0ed2b83.entry.js +0 -6
- package/dist/solutions-components/p-cc88bb42.entry.js +0 -6
- package/dist/solutions-components/p-db69f4ba.entry.js +0 -6
- package/dist/solutions-components/p-e3061220.entry.js +0 -6
@@ -4,8 +4,7 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-7183ce4a.js';
|
7
|
-
import { l as loadModules } from './
|
8
|
-
import { g as getLocaleComponentStrings } from './locale-13e3c96c.js';
|
7
|
+
import { l as loadModules, g as getLocaleComponentStrings } from './locale-731e75a8.js';
|
9
8
|
import { x as setRequestedIcon } from './dom-8f926f33.js';
|
10
9
|
import { f as EDrawMode } from './interfaces-586e863c.js';
|
11
10
|
import { s as state } from './publicNotificationStore-9362d7ae.js';
|
@@ -11,9 +11,9 @@ import { c as connectLocalized, d as disconnectLocalized, n as numberStringForma
|
|
11
11
|
import { o as onToggleOpenCloseComponent } from './openCloseComponent-982c6b9e.js';
|
12
12
|
import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as updateMessages } from './t9n-f16911e7.js';
|
13
13
|
import { K as KindIcons } from './resources-6e00e0d1.js';
|
14
|
-
import { g as getLocaleComponentStrings } from './locale-
|
15
|
-
import { l as loadModules } from './loadModules-cea493da.js';
|
14
|
+
import { g as getLocaleComponentStrings, l as loadModules } from './locale-731e75a8.js';
|
16
15
|
import { d as getAllLayers } from './mapViewUtils-6daedef8.js';
|
16
|
+
import { P as PopupUtils } from './popupUtils-a593bd78.js';
|
17
17
|
import './guid-36c6c6a5.js';
|
18
18
|
import './resources-cdc36705.js';
|
19
19
|
import './key-af303047.js';
|
@@ -650,4 +650,296 @@ const EditCard = class {
|
|
650
650
|
};
|
651
651
|
EditCard.style = editCardCss;
|
652
652
|
|
653
|
-
|
653
|
+
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}";
|
654
|
+
|
655
|
+
const InfoCard = class {
|
656
|
+
constructor(hostRef) {
|
657
|
+
registerInstance(this, hostRef);
|
658
|
+
this.popupClosed = createEvent(this, "popupClosed", 7);
|
659
|
+
this.selectionChanged = createEvent(this, "selectionChanged", 7);
|
660
|
+
this.graphics = undefined;
|
661
|
+
this.isLoading = false;
|
662
|
+
this.isMobile = undefined;
|
663
|
+
this.mapView = undefined;
|
664
|
+
this.zoomAndScrollToSelected = undefined;
|
665
|
+
this.allowEditing = true;
|
666
|
+
this._alertOpen = false;
|
667
|
+
this._count = "";
|
668
|
+
this._editRecordOpen = false;
|
669
|
+
this._mobileTitle = "";
|
670
|
+
this._showListView = false;
|
671
|
+
this._translations = undefined;
|
672
|
+
}
|
673
|
+
//--------------------------------------------------------------------------
|
674
|
+
//
|
675
|
+
// Watch handlers
|
676
|
+
//
|
677
|
+
//--------------------------------------------------------------------------
|
678
|
+
/**
|
679
|
+
* Watch for changes to the graphic and update the feature widget
|
680
|
+
*/
|
681
|
+
async graphicsWatchHandler() {
|
682
|
+
await this.setGraphics();
|
683
|
+
}
|
684
|
+
/**
|
685
|
+
* Watch for changes to the isMobile prop then init the Features widget
|
686
|
+
* We need to know if the title should be displayed by the widget (non mobile)
|
687
|
+
* or by us (mobile)
|
688
|
+
*/
|
689
|
+
async isMobileWatchHandler() {
|
690
|
+
await this._initFeaturesWidget();
|
691
|
+
}
|
692
|
+
/**
|
693
|
+
* Watch for changes to the mapView and re-init the Feature widget
|
694
|
+
*/
|
695
|
+
async mapViewWatchHandler() {
|
696
|
+
return await this._initFeaturesWidget();
|
697
|
+
}
|
698
|
+
//--------------------------------------------------------------------------
|
699
|
+
//
|
700
|
+
// Methods (public)
|
701
|
+
//
|
702
|
+
//--------------------------------------------------------------------------
|
703
|
+
/**
|
704
|
+
* Get the current selected feature from the Features widget
|
705
|
+
*
|
706
|
+
* @returns Promise resolving with the current feature
|
707
|
+
*/
|
708
|
+
async getSelectedFeature() {
|
709
|
+
return this._features.selectedFeature;
|
710
|
+
}
|
711
|
+
/**
|
712
|
+
* Respond to and close the edit record display
|
713
|
+
*
|
714
|
+
* @returns a promise when the operation has completed
|
715
|
+
*/
|
716
|
+
async closeEdit() {
|
717
|
+
this._editRecordOpen = false;
|
718
|
+
}
|
719
|
+
/**
|
720
|
+
* Reset key properties when the layer selection changes
|
721
|
+
*/
|
722
|
+
async layerSelectionChange() {
|
723
|
+
var _a;
|
724
|
+
this._showListView = false;
|
725
|
+
if ((_a = this._features) === null || _a === void 0 ? void 0 : _a.viewModel) {
|
726
|
+
this._features.viewModel.featureMenuOpen = false;
|
727
|
+
this._features.close();
|
728
|
+
}
|
729
|
+
}
|
730
|
+
/**
|
731
|
+
* Refresh the info-card graphics
|
732
|
+
*/
|
733
|
+
async refreshGraphics(evt) {
|
734
|
+
this.graphics = [...evt.detail];
|
735
|
+
}
|
736
|
+
//--------------------------------------------------------------------------
|
737
|
+
//
|
738
|
+
// Functions (lifecycle)
|
739
|
+
//
|
740
|
+
//--------------------------------------------------------------------------
|
741
|
+
/**
|
742
|
+
* StencilJS: Called once just after the component is first connected to the DOM.
|
743
|
+
*
|
744
|
+
* @returns Promise when complete
|
745
|
+
*/
|
746
|
+
async componentWillLoad() {
|
747
|
+
await this._initModules();
|
748
|
+
await this._getTranslations();
|
749
|
+
this._popupUtils = new PopupUtils();
|
750
|
+
}
|
751
|
+
/**
|
752
|
+
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
753
|
+
* @returns Promise when complete
|
754
|
+
*/
|
755
|
+
async componentDidLoad() {
|
756
|
+
var _a;
|
757
|
+
if (((_a = this.graphics) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
758
|
+
await this.setGraphics();
|
759
|
+
}
|
760
|
+
}
|
761
|
+
/**
|
762
|
+
* Renders the component.
|
763
|
+
*/
|
764
|
+
render() {
|
765
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
766
|
+
const loadingClass = this.isLoading ? "" : "display-none";
|
767
|
+
const featureNodeClass = this.isLoading || this._editRecordOpen ? "visibility-hidden" : "position-absolute";
|
768
|
+
const editClass = !this.isLoading && this._editRecordOpen ? "position-absolute" : "display-none";
|
769
|
+
const editButtonClass = (!this.isLoading && this._editRecordOpen) || this._showListView ? "display-none" : "";
|
770
|
+
const nextBackDisabled = ((_b = (_a = this._features) === null || _a === void 0 ? void 0 : _a.features) === null || _b === void 0 ? void 0 : _b.length) < 2;
|
771
|
+
const nextBackClass = this.isMobile ? "display-none" : "";
|
772
|
+
const shellClass = this.isMobile && !this._editRecordOpen ? "padding-top-46" : "";
|
773
|
+
const id = (_d = (_c = this._features) === null || _c === void 0 ? void 0 : _c.selectedFeature) === null || _d === void 0 ? void 0 : _d.getObjectId();
|
774
|
+
const ids = parseInt(id === null || id === void 0 ? void 0 : id.toString(), 10) > -1 ? [id] : [];
|
775
|
+
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);
|
776
|
+
return (h(Host, null, this.isMobile && !this._editRecordOpen ? (h("calcite-panel", null, h("calcite-action", { class: "end-border", icon: "chevron-left", iconFlipRtl: true, onClick: () => this._closePopup(), scale: "s", slot: "header-actions-start", text: "" }), h("span", { class: "font-bold", slot: "header-content" }, this._mobileTitle))) : undefined, h("calcite-shell", { class: shellClass }, h("calcite-loader", { class: loadingClass, label: this._translations.fetchingData }), h("div", { class: "esri-widget " + featureNodeClass, id: "features-node" }), h("div", { class: `${editButtonClass} width-100`, slot: "footer" }, this.allowEditing &&
|
777
|
+
h("div", { class: "display-flex top-border padding-1-2" }, h("calcite-button", { appearance: "solid", id: "solutions-edit", onClick: () => this._openEditRecord(), width: "full" }, this._translations.edit), this.isMobile && deleteEnabled ? (h("delete-button", { class: "padding-inline-start-1 width-100", id: "solutions-delete", ids: ids, layer: this._layer, onEditsComplete: () => this._closePopup() })) : undefined, h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "solutions-edit" }, h("span", null, this._translations.edit)), this.isMobile ? (h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": "solutions-delete" }, h("span", null, this._translations.delete))) : undefined), !nextBackDisabled && h("div", { class: `display-flex padding-1-2 button-container top-border ${nextBackClass}` }, h("div", { class: "min-width-100" }, h("calcite-button", { appearance: "outline", disabled: nextBackDisabled, id: "solutions-back", onClick: () => this._back(), width: "full" }, this._translations.back), h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-back" }, h("span", null, this._translations.back))), h("div", null, h("calcite-action", { icon: "list", onClick: () => this._toggleListView(), scale: "s", text: this._count, textEnabled: true })), h("div", { class: "min-width-100" }, h("calcite-button", { appearance: "outline", disabled: nextBackDisabled, id: "solutions-next", onClick: () => this._next(), width: "full" }, this._translations.next), h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-next" }, h("span", null, this._translations.next))))), 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 }), h("calcite-alert", { icon: "layer-broken", kind: "warning", label: "", onCalciteAlertClose: () => this._alertClosed(), open: this._alertOpen, placement: "top" }, h("div", { slot: "title" }, this._translations.editDisabled), h("div", { slot: "message" }, this._translations.enableEditing)))));
|
778
|
+
}
|
779
|
+
//--------------------------------------------------------------------------
|
780
|
+
//
|
781
|
+
// Functions (protected)
|
782
|
+
//
|
783
|
+
//--------------------------------------------------------------------------
|
784
|
+
/**
|
785
|
+
* Load esri javascript api modules
|
786
|
+
*
|
787
|
+
* @returns Promise resolving when function is done
|
788
|
+
*
|
789
|
+
* @protected
|
790
|
+
*/
|
791
|
+
async _initModules() {
|
792
|
+
const [Features, reactiveUtils] = await loadModules([
|
793
|
+
"esri/widgets/Features",
|
794
|
+
"esri/core/reactiveUtils"
|
795
|
+
]);
|
796
|
+
this.Features = Features;
|
797
|
+
this.reactiveUtils = reactiveUtils;
|
798
|
+
}
|
799
|
+
/**
|
800
|
+
* Initializes the features widget if not created and updates the feature widget and other required states
|
801
|
+
*
|
802
|
+
* @protected
|
803
|
+
*/
|
804
|
+
async setGraphics() {
|
805
|
+
var _a;
|
806
|
+
if (!this._features) {
|
807
|
+
await this._initFeaturesWidget();
|
808
|
+
}
|
809
|
+
if (this.graphics.length > 0) {
|
810
|
+
this._layer = (_a = this.graphics[0]) === null || _a === void 0 ? void 0 : _a.layer;
|
811
|
+
this._editEnabled = this._layer.editingEnabled && this._layer.capabilities.operations.supportsUpdate;
|
812
|
+
this._mobileTitle = await this._popupUtils.getPopupTitle(this.graphics[0]);
|
813
|
+
this._features.open({
|
814
|
+
features: this.graphics
|
815
|
+
});
|
816
|
+
}
|
817
|
+
else {
|
818
|
+
this._features.clear();
|
819
|
+
this._features.close();
|
820
|
+
}
|
821
|
+
this._count = this._getCount();
|
822
|
+
}
|
823
|
+
/**
|
824
|
+
* Init the Feature widget so we can display the popup content
|
825
|
+
*
|
826
|
+
* @returns a promise when the operation has completed
|
827
|
+
*
|
828
|
+
* @protected
|
829
|
+
*/
|
830
|
+
async _initFeaturesWidget() {
|
831
|
+
var _a;
|
832
|
+
return this.isMobile !== undefined ? await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.when(() => {
|
833
|
+
if (!this._features) {
|
834
|
+
this._features = new this.Features({
|
835
|
+
view: this.mapView,
|
836
|
+
container: "features-node",
|
837
|
+
visibleElements: {
|
838
|
+
actionBar: false,
|
839
|
+
closeButton: false,
|
840
|
+
heading: !this.isMobile
|
841
|
+
}
|
842
|
+
});
|
843
|
+
this.reactiveUtils.watch(() => this._features.viewModel.featureMenuOpen, (isOpen) => {
|
844
|
+
if (!isOpen) {
|
845
|
+
this._showListView = isOpen;
|
846
|
+
}
|
847
|
+
});
|
848
|
+
if (this.zoomAndScrollToSelected) {
|
849
|
+
this.reactiveUtils.watch(() => this._features.selectedFeatureIndex, (i) => {
|
850
|
+
if (i > -1) {
|
851
|
+
this.selectionChanged.emit([this._features.selectedFeature]);
|
852
|
+
}
|
853
|
+
});
|
854
|
+
}
|
855
|
+
}
|
856
|
+
else {
|
857
|
+
this._features.view = this.mapView;
|
858
|
+
this._features.visibleElements.actionBar = false;
|
859
|
+
this._features.visibleElements.closeButton = false;
|
860
|
+
this._features.visibleElements.heading = !this.isMobile;
|
861
|
+
}
|
862
|
+
})) : Promise.resolve();
|
863
|
+
}
|
864
|
+
/**
|
865
|
+
* Close the popup and emit the selected features
|
866
|
+
*/
|
867
|
+
_closePopup() {
|
868
|
+
this.popupClosed.emit();
|
869
|
+
}
|
870
|
+
/**
|
871
|
+
* Set the alertOpen member to false when the alert is closed
|
872
|
+
*/
|
873
|
+
_alertClosed() {
|
874
|
+
this._alertOpen = false;
|
875
|
+
}
|
876
|
+
/**
|
877
|
+
* Open the edit record
|
878
|
+
*/
|
879
|
+
_openEditRecord() {
|
880
|
+
if (this._editEnabled) {
|
881
|
+
this._editRecordOpen = true;
|
882
|
+
}
|
883
|
+
else {
|
884
|
+
this._alertOpen = true;
|
885
|
+
}
|
886
|
+
}
|
887
|
+
/**
|
888
|
+
* Go to the previous feature in the features widget
|
889
|
+
*/
|
890
|
+
_back() {
|
891
|
+
this._features.previous();
|
892
|
+
this._count = this._getCount();
|
893
|
+
}
|
894
|
+
/**
|
895
|
+
* Go to the next feature in the features widget
|
896
|
+
*/
|
897
|
+
_next() {
|
898
|
+
this._features.next();
|
899
|
+
this._count = this._getCount();
|
900
|
+
}
|
901
|
+
/**
|
902
|
+
* Get the current index of total string
|
903
|
+
*
|
904
|
+
* @returns the index of total string
|
905
|
+
*/
|
906
|
+
_getCount() {
|
907
|
+
var _a, _b, _c;
|
908
|
+
const index = (((_a = this._features) === null || _a === void 0 ? void 0 : _a.viewModel.selectedFeatureIndex) + 1).toString();
|
909
|
+
const total = (_c = (_b = this._features) === null || _b === void 0 ? void 0 : _b.features) === null || _c === void 0 ? void 0 : _c.length.toString();
|
910
|
+
return this._translations.indexOfTotal
|
911
|
+
.replace("{{index}}", index)
|
912
|
+
.replace("{{total}}", total);
|
913
|
+
}
|
914
|
+
/**
|
915
|
+
* Toggle the visibility of the features list view
|
916
|
+
*/
|
917
|
+
_toggleListView() {
|
918
|
+
this._showListView = !this._showListView;
|
919
|
+
const i = this._features.selectedFeatureIndex;
|
920
|
+
this._features.open({
|
921
|
+
features: this.graphics,
|
922
|
+
featureMenuOpen: this._showListView
|
923
|
+
});
|
924
|
+
this._features.selectedFeatureIndex = i;
|
925
|
+
}
|
926
|
+
/**
|
927
|
+
* Fetches the component's translations
|
928
|
+
*
|
929
|
+
* @returns Promise when complete
|
930
|
+
* @protected
|
931
|
+
*/
|
932
|
+
async _getTranslations() {
|
933
|
+
const messages = await getLocaleComponentStrings(this.el);
|
934
|
+
this._translations = messages[0];
|
935
|
+
}
|
936
|
+
get el() { return getElement(this); }
|
937
|
+
static get watchers() { return {
|
938
|
+
"graphics": ["graphicsWatchHandler"],
|
939
|
+
"isMobile": ["isMobileWatchHandler"],
|
940
|
+
"mapView": ["mapViewWatchHandler"]
|
941
|
+
}; }
|
942
|
+
};
|
943
|
+
InfoCard.style = infoCardCss;
|
944
|
+
|
945
|
+
export { Alert as calcite_alert, DeleteButton as delete_button, EditCard as edit_card, InfoCard as info_card };
|
@@ -21,12 +21,11 @@ import { g as getIconScale } from './component-98bae46b.js';
|
|
21
21
|
import { d as debounce } from './debounce-229b1a22.js';
|
22
22
|
import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-1149b5cb.js';
|
23
23
|
import { i as isActivationKey } from './key-af303047.js';
|
24
|
-
import { g as getLocaleComponentStrings } from './locale-
|
24
|
+
import { g as getLocaleComponentStrings } from './locale-731e75a8.js';
|
25
25
|
import { c as getMapLayerHash, o as getMapTableHash } from './mapViewUtils-6daedef8.js';
|
26
26
|
import { s as state } from './publicNotificationStore-9362d7ae.js';
|
27
27
|
import './resources-cdc36705.js';
|
28
28
|
import './browser-b4c16201.js';
|
29
|
-
import './loadModules-cea493da.js';
|
30
29
|
import './esri-loader-eda07632.js';
|
31
30
|
import './_commonjsHelpers-d5f9d613.js';
|
32
31
|
import './interfaces-586e863c.js';
|
@@ -11,17 +11,16 @@ import { c as connectInteractive, u as updateHostInteraction, d as disconnectInt
|
|
11
11
|
import { c as connectLocalized, d as disconnectLocalized } from './locale-6107ef11.js';
|
12
12
|
import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as updateMessages } from './t9n-f16911e7.js';
|
13
13
|
import { S as SLOTS$1 } from './resources-649a0f91.js';
|
14
|
-
import { P as PopupUtils } from './popupUtils-
|
14
|
+
import { P as PopupUtils } from './popupUtils-a593bd78.js';
|
15
15
|
import { g as getLayerOrTable, b as getFeatureLayerView, h as highlightFeatures, c as getMapLayerHash, d as getAllLayers } from './mapViewUtils-6daedef8.js';
|
16
|
-
import { g as getLocaleComponentStrings, f as formatNumber } from './locale-
|
16
|
+
import { g as getLocaleComponentStrings, f as formatNumber } from './locale-731e75a8.js';
|
17
17
|
import './guid-36c6c6a5.js';
|
18
18
|
import './resources-cdc36705.js';
|
19
19
|
import './browser-b4c16201.js';
|
20
20
|
import './key-af303047.js';
|
21
|
-
import './
|
21
|
+
import './interfaces-586e863c.js';
|
22
22
|
import './esri-loader-eda07632.js';
|
23
23
|
import './_commonjsHelpers-d5f9d613.js';
|
24
|
-
import './interfaces-586e863c.js';
|
25
24
|
|
26
25
|
/*!
|
27
26
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
@@ -19,7 +19,7 @@ import { q as getItemIndex, m as mutationObserverCallback, d as deselectRemovedI
|
|
19
19
|
import { d as dragActive, a as disconnectSortableComponent, c as connectSortableComponent } from './sortableComponent-65956286.js';
|
20
20
|
import { C as CSS$5, S as SLOTS$3 } from './resources-13098091.js';
|
21
21
|
import { I as ICON_TYPES$1 } from './resources-6772a50d.js';
|
22
|
-
import { g as getLocaleComponentStrings } from './locale-
|
22
|
+
import { g as getLocaleComponentStrings } from './locale-731e75a8.js';
|
23
23
|
import { s as state } from './solution-store-19f7825b.js';
|
24
24
|
import { d as EUpdateType } from './interfaces-586e863c.js';
|
25
25
|
import { E as EFileType } from './solution-resource-7b8d302d.js';
|
@@ -29,7 +29,6 @@ import './browser-b4c16201.js';
|
|
29
29
|
import './array-51c31356.js';
|
30
30
|
import './resources-a0420cda.js';
|
31
31
|
import './debounce-229b1a22.js';
|
32
|
-
import './loadModules-cea493da.js';
|
33
32
|
import './esri-loader-eda07632.js';
|
34
33
|
import './_commonjsHelpers-d5f9d613.js';
|
35
34
|
import './index-857df22e.js';
|
@@ -4,13 +4,12 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-7183ce4a.js';
|
7
|
-
import { g as getLocaleComponentStrings } from './locale-
|
7
|
+
import { g as getLocaleComponentStrings, l as loadModules } from './locale-731e75a8.js';
|
8
8
|
import { q as queryFeaturesByID, g as getLayerOrTable, a as goToSelection, e as queryAllIds, f as queryFeatureIds, i as queryFeaturesByGlobalID } from './mapViewUtils-6daedef8.js';
|
9
|
-
import {
|
10
|
-
import { d as downloadCSV } from './downloadUtils-067dc2ff.js';
|
11
|
-
import './interfaces-586e863c.js';
|
9
|
+
import { d as downloadCSV } from './downloadUtils-a301c193.js';
|
12
10
|
import './esri-loader-eda07632.js';
|
13
11
|
import './_commonjsHelpers-d5f9d613.js';
|
12
|
+
import './interfaces-586e863c.js';
|
14
13
|
import './solution-resource-7b8d302d.js';
|
15
14
|
import './index-a1e91462.js';
|
16
15
|
import './restHelpersGet-af032ab2.js';
|
@@ -1461,4 +1460,181 @@ const LayerTable = class {
|
|
1461
1460
|
};
|
1462
1461
|
LayerTable.style = layerTableCss;
|
1463
1462
|
|
1464
|
-
|
1463
|
+
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}";
|
1464
|
+
|
1465
|
+
const MapCard = class {
|
1466
|
+
constructor(hostRef) {
|
1467
|
+
registerInstance(this, hostRef);
|
1468
|
+
this.mapChanged = createEvent(this, "mapChanged", 7);
|
1469
|
+
this.beforeMapChanged = createEvent(this, "beforeMapChanged", 7);
|
1470
|
+
/**
|
1471
|
+
* boolean: When true the default map provided via url params has been loaded and should no longer override other maps
|
1472
|
+
*/
|
1473
|
+
this._defaultWebmapHonored = false;
|
1474
|
+
/**
|
1475
|
+
* string: the id of map currently displayed
|
1476
|
+
*/
|
1477
|
+
this._loadedId = "";
|
1478
|
+
this.defaultWebmapId = "";
|
1479
|
+
this.enableHome = undefined;
|
1480
|
+
this.enableLegend = undefined;
|
1481
|
+
this.enableFloorFilter = undefined;
|
1482
|
+
this.enableFullscreen = undefined;
|
1483
|
+
this.enableSingleExpand = true;
|
1484
|
+
this.enableSearch = undefined;
|
1485
|
+
this.enableBasemap = undefined;
|
1486
|
+
this.basemapConfig = undefined;
|
1487
|
+
this.hidden = undefined;
|
1488
|
+
this.homeZoomIndex = 3;
|
1489
|
+
this.homeZoomPosition = "top-left";
|
1490
|
+
this.homeZoomToolsSize = "m";
|
1491
|
+
this.mapInfos = [];
|
1492
|
+
this.mapWidgetsIndex = 0;
|
1493
|
+
this.mapWidgetsPosition = "top-right";
|
1494
|
+
this.mapWidgetsSize = "m";
|
1495
|
+
this.mapView = undefined;
|
1496
|
+
this.stackTools = true;
|
1497
|
+
this.theme = undefined;
|
1498
|
+
this.toolOrder = undefined;
|
1499
|
+
this._searchConfiguration = undefined;
|
1500
|
+
this._webMapInfo = undefined;
|
1501
|
+
}
|
1502
|
+
//--------------------------------------------------------------------------
|
1503
|
+
//
|
1504
|
+
// Watch handlers
|
1505
|
+
//
|
1506
|
+
//--------------------------------------------------------------------------
|
1507
|
+
/**
|
1508
|
+
* Add/remove home widget
|
1509
|
+
*/
|
1510
|
+
enableHomeWatchHandler() {
|
1511
|
+
this._initHome();
|
1512
|
+
}
|
1513
|
+
/**
|
1514
|
+
* Listen for changes to map info and load the appropriate map
|
1515
|
+
*/
|
1516
|
+
async mapInfoChange(evt) {
|
1517
|
+
await this._loadMap(evt.detail);
|
1518
|
+
}
|
1519
|
+
//--------------------------------------------------------------------------
|
1520
|
+
//
|
1521
|
+
// Functions (lifecycle)
|
1522
|
+
//
|
1523
|
+
//--------------------------------------------------------------------------
|
1524
|
+
/**
|
1525
|
+
* StencilJS: Called once just after the component is first connected to the DOM.
|
1526
|
+
*/
|
1527
|
+
async componentWillLoad() {
|
1528
|
+
await this._initModules();
|
1529
|
+
}
|
1530
|
+
/**
|
1531
|
+
* Renders the component.
|
1532
|
+
*/
|
1533
|
+
render() {
|
1534
|
+
var _a, _b;
|
1535
|
+
const mapClass = this.hidden ? "visibility-hidden" : "";
|
1536
|
+
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
1537
|
+
const mapPickerClass = ((_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.length) > 1 ? "" : "display-none";
|
1538
|
+
const mapHeightClass = ((_b = this.mapInfos) === null || _b === void 0 ? void 0 : _b.length) > 1 ? "map-height" : "height-full";
|
1539
|
+
return (h(Host, null, h("map-picker", { class: mapPickerClass, mapInfos: this.mapInfos, ref: (el) => this._mapPicker = el }), h("div", { class: `${mapHeightClass} ${mapClass}`, ref: (el) => (this._mapDiv = el) }), 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 })));
|
1540
|
+
}
|
1541
|
+
//--------------------------------------------------------------------------
|
1542
|
+
//
|
1543
|
+
// Functions (protected)
|
1544
|
+
//
|
1545
|
+
//--------------------------------------------------------------------------
|
1546
|
+
/**
|
1547
|
+
* Load esri javascript api modules
|
1548
|
+
*
|
1549
|
+
* @returns Promise resolving when function is done
|
1550
|
+
*
|
1551
|
+
* @protected
|
1552
|
+
*/
|
1553
|
+
async _initModules() {
|
1554
|
+
const [WebMap, MapView, Home] = await loadModules([
|
1555
|
+
"esri/WebMap",
|
1556
|
+
"esri/views/MapView",
|
1557
|
+
"esri/widgets/Home"
|
1558
|
+
]);
|
1559
|
+
this.WebMap = WebMap;
|
1560
|
+
this.MapView = MapView;
|
1561
|
+
this.Home = Home;
|
1562
|
+
}
|
1563
|
+
/**
|
1564
|
+
* Load the webmap for the provided webMapInfo
|
1565
|
+
*
|
1566
|
+
* @param webMapInfo the webmap id and name to load
|
1567
|
+
*/
|
1568
|
+
async _loadMap(webMapInfo) {
|
1569
|
+
var _a;
|
1570
|
+
// on the first render use the default webmap id if provided otherwise use the first child of the provided mapInfos
|
1571
|
+
const loadDefaultMap = !this._defaultWebmapHonored && this.defaultWebmapId;
|
1572
|
+
const defaultMap = (_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.filter(i => i.id === this.defaultWebmapId);
|
1573
|
+
const mapConfigChanged = JSON.stringify(webMapInfo) !== JSON.stringify(this._webMapInfo);
|
1574
|
+
this._webMapInfo = loadDefaultMap && defaultMap ? defaultMap[0] :
|
1575
|
+
!(webMapInfo === null || webMapInfo === void 0 ? void 0 : webMapInfo.id) && this.mapInfos.length > 0 ? this.mapInfos[0] : webMapInfo;
|
1576
|
+
const id = this._webMapInfo.id;
|
1577
|
+
const isDefaultMap = loadDefaultMap && (webMapInfo === null || webMapInfo === void 0 ? void 0 : webMapInfo.id) === this.defaultWebmapId;
|
1578
|
+
if ((this._loadedId !== id && !loadDefaultMap) || isDefaultMap) {
|
1579
|
+
const webMap = new this.WebMap({
|
1580
|
+
portalItem: { id }
|
1581
|
+
});
|
1582
|
+
this.mapView = new this.MapView({
|
1583
|
+
container: this._mapDiv,
|
1584
|
+
map: webMap,
|
1585
|
+
resizeAlign: "center"
|
1586
|
+
});
|
1587
|
+
this._loadedId = id;
|
1588
|
+
this._searchConfiguration = this._webMapInfo.searchConfiguration;
|
1589
|
+
this.beforeMapChanged.emit();
|
1590
|
+
await this.mapView.when(() => {
|
1591
|
+
this._initHome();
|
1592
|
+
this.mapView.ui.add(this._mapTools, { position: this.mapWidgetsPosition, index: this.mapWidgetsIndex });
|
1593
|
+
this._defaultWebmapHonored = isDefaultMap ? true : this._defaultWebmapHonored;
|
1594
|
+
this.mapChanged.emit({
|
1595
|
+
id: id,
|
1596
|
+
mapView: this.mapView
|
1597
|
+
});
|
1598
|
+
});
|
1599
|
+
}
|
1600
|
+
else if (loadDefaultMap) {
|
1601
|
+
this._defaultWebmapHonored = true;
|
1602
|
+
this._mapPicker.setMapByID(id);
|
1603
|
+
}
|
1604
|
+
else if (mapConfigChanged) {
|
1605
|
+
// Map is the same so no need to reload but we need to update for any changes from the config
|
1606
|
+
this._searchConfiguration = this._webMapInfo.searchConfiguration;
|
1607
|
+
this.beforeMapChanged.emit();
|
1608
|
+
this.mapChanged.emit({
|
1609
|
+
id: id,
|
1610
|
+
mapView: this.mapView
|
1611
|
+
});
|
1612
|
+
}
|
1613
|
+
}
|
1614
|
+
/**
|
1615
|
+
* Add/remove the home widget base on enableHome prop
|
1616
|
+
*
|
1617
|
+
* @protected
|
1618
|
+
*/
|
1619
|
+
_initHome() {
|
1620
|
+
if (this.enableHome) {
|
1621
|
+
this._homeWidget = new this.Home({
|
1622
|
+
view: this.mapView
|
1623
|
+
});
|
1624
|
+
this.mapView.ui.add(this._homeWidget, { position: this.homeZoomPosition, index: this.homeZoomIndex });
|
1625
|
+
const size = this.homeZoomToolsSize === "s" ? "32px" : this.homeZoomToolsSize === "m" ? "40px" : "48px";
|
1626
|
+
this._homeWidget.domNode.style.height = size;
|
1627
|
+
this._homeWidget.domNode.style.width = size;
|
1628
|
+
}
|
1629
|
+
else if (this._homeWidget) {
|
1630
|
+
this.mapView.ui.remove(this._homeWidget);
|
1631
|
+
}
|
1632
|
+
}
|
1633
|
+
get el() { return getElement(this); }
|
1634
|
+
static get watchers() { return {
|
1635
|
+
"enableHome": ["enableHomeWatchHandler"]
|
1636
|
+
}; }
|
1637
|
+
};
|
1638
|
+
MapCard.style = mapCardCss;
|
1639
|
+
|
1640
|
+
export { CardManager as card_manager, LayerTable as layer_table, MapCard as map_card };
|
@@ -4,10 +4,9 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-7183ce4a.js';
|
7
|
-
import { g as getLocaleComponentStrings } from './locale-
|
7
|
+
import { g as getLocaleComponentStrings } from './locale-731e75a8.js';
|
8
8
|
import { E as ELayoutMode } from './interfaces-586e863c.js';
|
9
9
|
import { g as getLayerOrTable } from './mapViewUtils-6daedef8.js';
|
10
|
-
import './loadModules-cea493da.js';
|
11
10
|
import './esri-loader-eda07632.js';
|
12
11
|
import './_commonjsHelpers-d5f9d613.js';
|
13
12
|
|