@esri/solutions-components 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -572,3 +572,19 @@ export interface IConsentResponse {
572
572
  export interface IManagedLayers {
573
573
  [key: string]: "buffer" | "sketch";
574
574
  }
575
+
576
+ /**
577
+ * Key is the layers guid
578
+ */
579
+ export interface IReportingOptions {
580
+ [key: string]: IReportOption;
581
+ }
582
+
583
+ export interface IReportOption {
584
+ reporting: boolean;
585
+ comment: boolean;
586
+ like: boolean;
587
+ dislike: boolean;
588
+ likeField: string;
589
+ dislikeField: string;
590
+ }
@@ -23,6 +23,10 @@ export declare class CrowdsourceManager {
23
23
  * Array of objects containing proxy information for premium platform services.
24
24
  */
25
25
  appProxies: any;
26
+ /**
27
+ * IBasemapConfig: List of any basemaps to filter out from the basemap widget
28
+ */
29
+ basemapConfig: IBasemapConfig;
26
30
  /**
27
31
  * string: default center point values for the map
28
32
  * ; delimited x;y pair
@@ -52,6 +56,10 @@ export declare class CrowdsourceManager {
52
56
  * boolean: when true the layer table will auto refresh the data
53
57
  */
54
58
  enableAutoRefresh: boolean;
59
+ /**
60
+ * boolean: when true the basemap widget will be available
61
+ */
62
+ enableBasemap: boolean;
55
63
  /**
56
64
  * boolean: when true the layer table will support drag/drop of columns to adjust order
57
65
  */
@@ -68,6 +76,10 @@ export declare class CrowdsourceManager {
68
76
  * boolean: when true the fullscreen widget will be available
69
77
  */
70
78
  enableFullscreen: boolean;
79
+ /**
80
+ * boolean: when true the home widget will be available
81
+ */
82
+ enableHome: boolean;
71
83
  /**
72
84
  * boolean: when true edits can be applied directly within the table
73
85
  */
@@ -84,26 +96,14 @@ export declare class CrowdsourceManager {
84
96
  * boolean: when true the share widget will be available
85
97
  */
86
98
  enableShare: boolean;
87
- /**
88
- * boolean: when true the home widget will be available
89
- */
90
- enableHome: boolean;
91
99
  /**
92
100
  * boolean: when true the zoom widget will be available
93
101
  */
94
102
  enableZoom: boolean;
95
103
  /**
96
- * boolean: when true the basemap widget will be available
97
- */
98
- enableBasemap: boolean;
99
- /**
100
- * IBasemapConfig: List of any basemaps to filter out from the basemap widget
101
- */
102
- basemapConfig: IBasemapConfig;
103
- /**
104
- * boolean: when true the table will be sorted by objectid in descending order by default
104
+ * boolean: when true the map will be hidden on load
105
105
  */
106
- showNewestFirst: boolean;
106
+ hideMapOnLoad: boolean;
107
107
  /**
108
108
  * IMapInfo[]: array of map infos (name and id)
109
109
  */
@@ -124,6 +124,10 @@ export declare class CrowdsourceManager {
124
124
  * boolean: When true the share options will include social media sharing
125
125
  */
126
126
  shareIncludeSocial: boolean;
127
+ /**
128
+ * boolean: when true the table will be sorted by objectid in descending order by default
129
+ */
130
+ showNewestFirst: boolean;
127
131
  /**
128
132
  * theme: "light" | "dark" theme to be used
129
133
  */
@@ -132,6 +136,10 @@ export declare class CrowdsourceManager {
132
136
  * boolean: When true the selected feature will zoomed to in the map and the row will be scrolled to within the table
133
137
  */
134
138
  zoomAndScrollToSelected: boolean;
139
+ /**
140
+ * number: default scale to zoom to when zooming to a single point feature
141
+ */
142
+ zoomToScale: number;
135
143
  /**
136
144
  * When true the info panel with the popup details will take the full height and prevent the map from displaying
137
145
  */
@@ -15,7 +15,7 @@
15
15
  */
16
16
  /// <reference types="arcgis-js-api" />
17
17
  import { VNode, EventEmitter } from "../../stencil-public-runtime";
18
- import { IMapChange, IMapClick, IMapInfo, ISearchConfiguration, theme } from "../../utils/interfaces";
18
+ import { IMapChange, IMapClick, IMapInfo, IReportingOptions, ISearchConfiguration, theme } from "../../utils/interfaces";
19
19
  import CrowdsourceReporter_T9n from "../../assets/t9n/crowdsource-reporter/resources.json";
20
20
  import { ILayerItemsHash } from "../layer-list/layer-list";
21
21
  export declare class CrowdsourceReporter {
@@ -76,6 +76,14 @@ export declare class CrowdsourceReporter {
76
76
  * string: Id of the zoom level from URL params
77
77
  */
78
78
  level: string;
79
+ /**
80
+ * string: The color that will be displayed on hover when expanding the popup header
81
+ */
82
+ popupHeaderHoverColor: string;
83
+ /**
84
+ * string: The background color to apply to the popup header
85
+ */
86
+ popupHeaderColor: string;
79
87
  /**
80
88
  * string: The word(s) to display in the reports submit button
81
89
  */
@@ -84,6 +92,10 @@ export declare class CrowdsourceReporter {
84
92
  * string: The word(s) to display in the reports header
85
93
  */
86
94
  reportsHeader: string;
95
+ /**
96
+ * IReportingOptions: Key options for reporting
97
+ */
98
+ reportingOptions: IReportingOptions;
87
99
  /**
88
100
  * string: The message to display when the report has been submitted
89
101
  */
@@ -120,6 +132,10 @@ export declare class CrowdsourceReporter {
120
132
  * boolean: when true the zoom widget will be available
121
133
  */
122
134
  enableZoom: boolean;
135
+ /**
136
+ * number: default scale to zoom to when zooming to a single point feature
137
+ */
138
+ zoomToScale: number;
123
139
  /**
124
140
  * IMapInfo: The current map info stores configuration details
125
141
  */
@@ -5,9 +5,9 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { ButtonType, DistanceUnit, EditType, EDrawMode, ELayoutMode, IBasemapConfig, IConsentResponse, IExportInfos, IInventoryItem, ILayerAndTableIds, IMapChange, IMapInfo, ISearchConfiguration, ISelectionSet, ISketchGraphicsChange, ISolutionSpatialReferenceInfo, ISpatialRefRepresentation, IValueChange, theme } from "./utils/interfaces";
8
+ import { ButtonType, DistanceUnit, EditType, EDrawMode, ELayoutMode, IBasemapConfig, IConsentResponse, IExportInfos, IInventoryItem, ILayerAndTableIds, IMapChange, IMapInfo, IReportingOptions, ISearchConfiguration, ISelectionSet, ISketchGraphicsChange, ISolutionSpatialReferenceInfo, ISpatialRefRepresentation, IValueChange, theme } from "./utils/interfaces";
9
9
  import { UserSession } from "@esri/solution-common";
10
- export { ButtonType, DistanceUnit, EditType, EDrawMode, ELayoutMode, IBasemapConfig, IConsentResponse, IExportInfos, IInventoryItem, ILayerAndTableIds, IMapChange, IMapInfo, ISearchConfiguration, ISelectionSet, ISketchGraphicsChange, ISolutionSpatialReferenceInfo, ISpatialRefRepresentation, IValueChange, theme } from "./utils/interfaces";
10
+ export { ButtonType, DistanceUnit, EditType, EDrawMode, ELayoutMode, IBasemapConfig, IConsentResponse, IExportInfos, IInventoryItem, ILayerAndTableIds, IMapChange, IMapInfo, IReportingOptions, ISearchConfiguration, ISelectionSet, ISketchGraphicsChange, ISolutionSpatialReferenceInfo, ISpatialRefRepresentation, IValueChange, theme } from "./utils/interfaces";
11
11
  export { UserSession } from "@esri/solution-common";
12
12
  export namespace Components {
13
13
  interface ArcgisLogin {
@@ -211,6 +211,10 @@ export namespace Components {
211
211
  * boolean: when true the zoom widget will be available
212
212
  */
213
213
  "enableZoom": boolean;
214
+ /**
215
+ * boolean: when true the map will be hidden on load
216
+ */
217
+ "hideMapOnLoad": boolean;
214
218
  /**
215
219
  * IMapInfo[]: array of map infos (name and id)
216
220
  */
@@ -243,6 +247,10 @@ export namespace Components {
243
247
  * boolean: When true the selected feature will zoomed to in the map and the row will be scrolled to within the table
244
248
  */
245
249
  "zoomAndScrollToSelected": boolean;
250
+ /**
251
+ * number: default scale to zoom to when zooming to a single point feature
252
+ */
253
+ "zoomToScale": number;
246
254
  }
247
255
  interface CrowdsourceReporter {
248
256
  /**
@@ -321,6 +329,14 @@ export namespace Components {
321
329
  * string: Object id of the feature from URL params
322
330
  */
323
331
  "objectId": string;
332
+ /**
333
+ * string: The background color to apply to the popup header
334
+ */
335
+ "popupHeaderColor": string;
336
+ /**
337
+ * string: The color that will be displayed on hover when expanding the popup header
338
+ */
339
+ "popupHeaderHoverColor": string;
324
340
  /**
325
341
  * string: The word(s) to display in the reports submit button
326
342
  */
@@ -329,6 +345,10 @@ export namespace Components {
329
345
  * string: The message to display when the report has been submitted
330
346
  */
331
347
  "reportSubmittedMessage": string;
348
+ /**
349
+ * IReportingOptions: Key options for reporting
350
+ */
351
+ "reportingOptions": IReportingOptions;
332
352
  /**
333
353
  * string: The word(s) to display in the reports header
334
354
  */
@@ -345,6 +365,10 @@ export namespace Components {
345
365
  * theme: "light" | "dark" theme to be used
346
366
  */
347
367
  "theme": theme;
368
+ /**
369
+ * number: default scale to zoom to when zooming to a single point feature
370
+ */
371
+ "zoomToScale": number;
348
372
  }
349
373
  interface DeductCalculator {
350
374
  }
@@ -2342,6 +2366,10 @@ declare namespace LocalJSX {
2342
2366
  * boolean: when true the zoom widget will be available
2343
2367
  */
2344
2368
  "enableZoom"?: boolean;
2369
+ /**
2370
+ * boolean: when true the map will be hidden on load
2371
+ */
2372
+ "hideMapOnLoad"?: boolean;
2345
2373
  /**
2346
2374
  * IMapInfo[]: array of map infos (name and id)
2347
2375
  */
@@ -2374,6 +2402,10 @@ declare namespace LocalJSX {
2374
2402
  * boolean: When true the selected feature will zoomed to in the map and the row will be scrolled to within the table
2375
2403
  */
2376
2404
  "zoomAndScrollToSelected"?: boolean;
2405
+ /**
2406
+ * number: default scale to zoom to when zooming to a single point feature
2407
+ */
2408
+ "zoomToScale"?: number;
2377
2409
  }
2378
2410
  interface CrowdsourceReporter {
2379
2411
  /**
@@ -2456,6 +2488,14 @@ declare namespace LocalJSX {
2456
2488
  * Emitted when toggle panel button is clicked in reporter
2457
2489
  */
2458
2490
  "onTogglePanel"?: (event: CrowdsourceReporterCustomEvent<boolean>) => void;
2491
+ /**
2492
+ * string: The background color to apply to the popup header
2493
+ */
2494
+ "popupHeaderColor"?: string;
2495
+ /**
2496
+ * string: The color that will be displayed on hover when expanding the popup header
2497
+ */
2498
+ "popupHeaderHoverColor"?: string;
2459
2499
  /**
2460
2500
  * string: The word(s) to display in the reports submit button
2461
2501
  */
@@ -2464,6 +2504,10 @@ declare namespace LocalJSX {
2464
2504
  * string: The message to display when the report has been submitted
2465
2505
  */
2466
2506
  "reportSubmittedMessage"?: string;
2507
+ /**
2508
+ * IReportingOptions: Key options for reporting
2509
+ */
2510
+ "reportingOptions"?: IReportingOptions;
2467
2511
  /**
2468
2512
  * string: The word(s) to display in the reports header
2469
2513
  */
@@ -2480,6 +2524,10 @@ declare namespace LocalJSX {
2480
2524
  * theme: "light" | "dark" theme to be used
2481
2525
  */
2482
2526
  "theme"?: theme;
2527
+ /**
2528
+ * number: default scale to zoom to when zooming to a single point feature
2529
+ */
2530
+ "zoomToScale"?: number;
2483
2531
  }
2484
2532
  interface DeductCalculator {
2485
2533
  /**
@@ -493,3 +493,17 @@ export interface IConsentResponse {
493
493
  export interface IManagedLayers {
494
494
  [key: string]: "buffer" | "sketch";
495
495
  }
496
+ /**
497
+ * Key is the layers guid
498
+ */
499
+ export interface IReportingOptions {
500
+ [key: string]: IReportOption;
501
+ }
502
+ export interface IReportOption {
503
+ reporting: boolean;
504
+ comment: boolean;
505
+ like: boolean;
506
+ dislike: boolean;
507
+ likeField: string;
508
+ dislikeField: string;
509
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solutions-components",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "Web Components for Esri's Solutions Applications",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,h as s,H as e,g as h}from"./p-7d280d8a.js";import{l as a,g as o}from"./p-be8ef276.js";import{a as l,b as c,h as n,c as r,g as d,q as u}from"./p-3af79063.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";const p=class{constructor(s){t(this,s),this.togglePanel=i(this,"togglePanel",7),this._noLayerToDisplayErrorMsg="Web map does not contain any editable layers.",this.description=void 0,this.isMobile=void 0,this.enableAnonymousAccess=void 0,this.enableAnonymousComments=void 0,this.enableComments=void 0,this.enableLogin=void 0,this.enableNewReports=void 0,this.layers=void 0,this.loginTitle=void 0,this.mapView=void 0,this.layerId=void 0,this.objectId=void 0,this.center=void 0,this.level=void 0,this.reportButtonText=void 0,this.reportsHeader=void 0,this.reportSubmittedMessage=void 0,this.searchConfiguration=void 0,this.showComments=void 0,this.defaultWebmap="",this.enableSearch=!0,this.enableHome=!0,this.mapInfos=[],this.theme="light",this.enableZoom=!0,this._mapInfo=void 0,this._flowItems=[],this._sidePanelCollapsed=!1,this._translations=void 0,this._hasValidLayers=!1,this._selectedLayerName=void 0,this._reportSubmitted=!1,this._showSubmitCancelButton=!1,this._featureCreationFailedErrorMsg=void 0}async isMobileWatchHandler(){this._sidePanelCollapsed=!1}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.setMapView()}))}async componentWillLoad(){var t;this._urlParamsLoaded=!1,await this._initModules(),await this._getTranslations(),await(null===(t=this.mapView)||void 0===t?void 0:t.when((async()=>{await this.setMapView()})))}render(){const t="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return s(e,null,this._reportSubmitted&&s("calcite-alert",{"auto-close":!0,class:t+" report-submitted-msg",icon:"check-circle",kind:"success",label:"",onCalciteAlertClose:()=>{this._reportSubmitted=!1},open:!0,placement:"top"},s("div",{slot:"message"},this.reportSubmittedMessage?this.reportSubmittedMessage:this._translations.submitMsg)),this._featureCreationFailedErrorMsg&&s("calcite-alert",{"auto-close":!0,class:t,icon:"x-octagon",kind:"danger",label:"",onCalciteAlertClose:()=>{this._featureCreationFailedErrorMsg=""},open:!0,placement:"top"},s("div",{slot:"title"},this._translations.error),s("div",{slot:"message"},this._featureCreationFailedErrorMsg)),s("div",null,s("calcite-shell",{"content-behind":!0},this._getReporter())))}async _initModules(){const[t]=await a(["esri/core/reactiveUtils"]);this.reactiveUtils=t}setSelectedLayer(t,i){this._selectedLayerId=t,this._selectedLayerName=i,this._validLayers.forEach((i=>{i.set("visible",!t||i.id===t)}))}_getReporter(){const t=[];return this._flowItems.forEach((i=>{switch(i){case"layer-list":t.push(this.getLayerListFlowItem());break;case"feature-list":t.push(this.getFeatureListFlowItem(this._selectedLayerId,this._selectedLayerName));break;case"feature-details":t.push(this.getFeatureDetailsFlowItem());break;case"reporting-layer-list":t.push(this.getChooseCategoryFlowItem());break;case"feature-create":t.push(this.getFeatureCreateFlowItem())}})),s("calcite-panel",{class:"width-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},this.mapView?s("calcite-flow",null,(null==t?void 0:t.length)>0&&t):s("calcite-loader",{label:"",scale:"m"}))}getLayerListFlowItem(){var t;return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this.reportsHeader},this.isMobile&&this.getActionToExpandCollapsePanel(),this._hasValidLayers&&this.enableNewReports&&s("calcite-button",{appearance:"solid",onClick:this.navigateToChooseCategory.bind(this),slot:"footer",width:"full"},this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText),s("calcite-panel",{"full-height":!0,"full-width":!0},s("layer-list",{class:"height-full",layers:(null===(t=this._editableLayerIds)||void 0===t?void 0:t.length)>0?this._editableLayerIds:this.layers,mapView:this.mapView,noLayerErrorMsg:this._noLayerToDisplayErrorMsg,onLayerSelect:this.displayFeaturesList.bind(this),onLayersListLoaded:this.layerListLoaded.bind(this),ref:t=>this._layerList=t,showFeatureCount:!0,showNextIcon:!0})))}getChooseCategoryFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),s("calcite-panel",{"full-height":!0,"full-width":!0},s("calcite-notice",{class:"notice-msg",icon:"lightbulb",kind:"success",open:!0},s("div",{slot:"message"},this._translations.chooseCategoryMsg)),s("layer-list",{class:"height-full",layers:this.layers,mapView:this.mapView,noLayerErrorMsg:this._noLayerToDisplayErrorMsg,onLayerSelect:this.navigateToCreateFeature.bind(this),showFeatureCount:!1,showNextIcon:!1})))}getFeatureCreateFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._selectedLayerName,onCalciteFlowItemBack:this.backFromCreateFeaturePanel.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),this._showSubmitCancelButton&&s("div",{class:"width-full",slot:"footer"},s("calcite-button",{appearance:"solid",class:"footer-top-button footer-button",onClick:this.onSubmitButtonClick.bind(this),width:"full"},this._translations.submit),s("calcite-button",{appearance:"outline",class:"footer-button",onClick:this.backFromCreateFeaturePanel.bind(this),width:"full"},this._translations.cancel)),s("calcite-panel",{"full-height":!0,"full-width":!0},s("calcite-notice",{class:"notice-msg",icon:"lightbulb",kind:"success",open:!0},s("div",{slot:"message"},this._translations.featureEditFormInfoMsg)),s("create-feature",{customizeSubmit:!0,mapView:this.mapView,onDrawComplete:this.onDrawComplete.bind(this),onEditingAttachment:this.showSubmitCancelButton.bind(this),onFail:this.createFeatureFailed.bind(this),onSuccess:this.onReportSubmitted.bind(this),ref:t=>this._createFeature=t,searchConfiguration:this.searchConfiguration,selectedLayerId:this._selectedLayerId})))}onDrawComplete(){this._showSubmitCancelButton=!0}showSubmitCancelButton(t){this._showSubmitCancelButton=!t.detail}onSubmitButtonClick(){this._createFeature&&this._createFeature.submit()}backFromCreateFeaturePanel(){this._createFeature&&this._createFeature.close(),this.backFromSelectedPanel()}createFeatureFailed(t){console.error(t.detail),this._featureCreationFailedErrorMsg=t.detail.message}onReportSubmitted(){this._reportSubmitted=!0,this.navigateToHomePage()}async navigateToHomePage(){this._createFeature&&this._createFeature.close(),this._layerList&&this._layerList.refresh(),this.setSelectedFeatures([]),1===this._editableLayerIds.length?(await this._featureList.refresh(),this._flowItems=["feature-list"]):this._flowItems=["layer-list"]}async navigateToCreateFeature(t){t.detail.layerId&&t.detail.layerName&&this.setSelectedLayer(t.detail.layerId,t.detail.layerName),this._showSubmitCancelButton=!1,this._flowItems=[...this._flowItems,"feature-create"]}navigateToChooseCategory(){this._flowItems=[...this._flowItems,"reporting-layer-list"]}async layerListLoaded(t){const i=t.detail,s=await l(this.mapView);this._validLayers=[],s.forEach((t=>{i.includes(t.id)&&this._validLayers.push(t)})),this.handleMapClick(),this._hasValidLayers=i.length>0,this._urlParamsLoaded||(this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams())}displayFeaturesList(t){this.setSelectedLayer(t.detail.layerId,t.detail.layerName),this._flowItems=[...this._flowItems,"feature-list"]}backFromSelectedPanel(){const t=[...this._flowItems];t.pop(),this.clearHighlights(),1!==t.length||"layer-list"!==t[0]?this._flowItems=[...t]:this.navigateToHomePage()}toggleSidePanel(){this._sidePanelCollapsed=!this._sidePanelCollapsed,this.togglePanel.emit(this._sidePanelCollapsed)}async onFeatureSelectFromList(t){this.setSelectedFeatures([t.detail]),this._flowItems=[...this._flowItems,"feature-details"]}getFeatureListFlowItem(t,i){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:i,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),this.enableNewReports&&s("calcite-button",{appearance:"solid",onClick:this.navigateToCreateFeature.bind(this),slot:"footer",width:"full"},this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText),s("calcite-panel",{"full-height":!0},s("feature-list",{class:"height-full",highlightOnHover:!0,mapView:this.mapView,noFeaturesFoundMsg:this._translations.featureErrorMsg,onFeatureSelect:this.onFeatureSelectFromList.bind(this),pageSize:30,ref:t=>this._featureList=t,selectedLayerId:t})))}getFeatureDetailsFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._selectedLayerName,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),s("instant-apps-social-share",{autoUpdateShareUrl:!1,embed:!1,popoverButtonIconScale:"s",ref:t=>this._shareNode=t,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",slot:"header-actions-end",socialMedia:!0,view:this.mapView}),s("calcite-panel",{"full-height":!0},s("info-card",{allowEditing:!1,graphics:this._selectedFeature,highlightEnabled:!1,isLoading:!1,isMobile:!1,mapView:this.mapView,onSelectionChanged:this.featureDetailsChanged.bind(this),zoomAndScrollToSelected:!0})))}setSelectedFeatures(t){this._selectedFeature=t,this.setCurrentFeature(this._selectedFeature.length?this._selectedFeature[0]:null)}setCurrentFeature(t){if(t&&t.layer){const i=t.layer;this.setSelectedLayer(i.id,i.title),this._currentFeatureId=t.attributes[i.objectIdField]}else this._editableLayerIds.length>1&&this.setSelectedLayer("",""),this._currentFeatureId="";this._updateShareURL()}featureDetailsChanged(t){this.setCurrentFeature(t.detail[0]),this.highlightOnMap(t.detail[0])}async highlightOnMap(t){if(this.clearHighlights(),t&&t.geometry&&t.layer){const i=await c(this.mapView,t.layer.id);i.highlightOptions=null,this._highlightHandle=await n([t.getObjectId()],i,this.mapView,!0)}}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}getActionToExpandCollapsePanel(){return s("calcite-action",{icon:this._sidePanelCollapsed?"chevrons-up":"chevrons-down",onClick:this.toggleSidePanel.bind(this),slot:"header-actions-end",text:this._sidePanelCollapsed?this._translations.expand:this._translations.collapse})}async setMapView(){var t;await this.getLayersToShowInList(),1===(null===(t=this._editableLayerIds)||void 0===t?void 0:t.length)?await this.renderFeaturesList():this._flowItems=["layer-list"],this.mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this.mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}handleMapClick(){this._mapClickHandle&&this._mapClickHandle.remove(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",this.onMapClick.bind(this))}async onMapClick(t){this.mapView.popupEnabled=!1;const i=await this.mapView.hitTest(t);if(i.results.length>0){const t=[];i.results.forEach((function(i){"graphic"===i.type&&t.push(i.graphic)}));const s=t.filter((t=>this._validLayers.includes(t.layer))),e=t.filter((t=>{var i;return!this._validLayers.includes(t.layer)&&(null===(i=null==t?void 0:t.layer)||void 0===i?void 0:i.id)}));if(s.length>0&&(this.setSelectedFeatures(s),this._flowItems.length&&"feature-details"!==this._flowItems[this._flowItems.length-1]?this._flowItems=[...this._flowItems,"feature-details"]:(this._flowItems=[...this._flowItems],this.highlightOnMap(t[0]))),e.length>0){this.mapView.popupEnabled=!0;const t={features:e,updateLocationEnabled:!0};await this.mapView.openPopup(t)}}}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}reduceToConfiguredLayers(t){var i;const s=(null===(i=this.layers)||void 0===i?void 0:i.length)>0?this.layers:[];return Object.keys(t).reduce(((i,e)=>{let h=t[e].supportsAdd;return(null==s?void 0:s.length)>0&&(h=s.indexOf(e)>-1&&t[e].supportsAdd),h&&i.push(e),i}),[])}async getLayersToShowInList(){const t=await r(this.mapView,!0);(await l(this.mapView)).forEach((i=>{var s,e;"feature"===(null==i?void 0:i.type)&&(null==i?void 0:i.editingEnabled)&&(null===(e=null===(s=null==i?void 0:i.capabilities)||void 0===s?void 0:s.operations)||void 0===e?void 0:e.supportsAdd)&&(t[i.id].supportsAdd=!0)})),this._editableLayerIds=this.reduceToConfiguredLayers(t)}async renderFeaturesList(){const t={detail:this._editableLayerIds};await this.layerListLoaded(t),this.setSelectedLayer(this._validLayers[0].id,this._validLayers[0].title),this._flowItems=["feature-list"]}_updateShareURL(){var t,i;const s=null===(t=this._shareNode)||void 0===t?void 0:t.shareUrl;if(!s)return;const e=new URL(s);this._selectedLayerId?e.searchParams.set("layerid",this._selectedLayerId):e.searchParams.delete("layerid"),(null===(i=this._selectedFeature)||void 0===i?void 0:i.length)?e.searchParams.set("oid",this._currentFeatureId):e.searchParams.delete("oid"),this._shareNode.shareUrl=e.href}async loadFeatureFromURLParams(){if(this.center&&this.level&&await this.mapView.goTo({center:this.center.split(";").map(Number),zoom:this.level}),this.layerId&&this.objectId){const t=await d(this.mapView,this.layerId);if(t){const i=await u([Number(this.objectId)],t,[],!0,this.mapView.spatialReference);i.length&&(this._selectedFeature=i,this._flowItems=this._flowItems.length&&"feature-details"!==this._flowItems[this._flowItems.length-1]?[...this._flowItems,"feature-details"]:[...this._flowItems],await this.highlightOnMap(i[0]))}}}get el(){return h(this)}static get watchers(){return{isMobile:["isMobileWatchHandler"],mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.notice-msg{padding:10px;width:calc(100% - 20px)}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.report-submitted-msg{position:absolute;z-index:1000}";export{p as crowdsource_reporter}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as i,h as t,H as e,g as s}from"./p-7d280d8a.js";import{g as h}from"./p-be8ef276.js";import{E as o}from"./p-c1cf3ebc.js";import{g as l}from"./p-3af79063.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";const a=class{constructor(t){i(this,t),this._defaultCenterHonored=!1,this._defaultLevelHonored=!1,this._shouldSetMapView=!1,this.appProxies=void 0,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableHome=!0,this.enableZoom=!0,this.enableBasemap=!0,this.basemapConfig=void 0,this.showNewestFirst=!0,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.theme="light",this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._hideFooter=!1,this._hideTable=!1,this._isMobile=void 0,this._translations=void 0,this._layer=void 0,this._layoutMode=o.GRID,this._mapInfo=void 0,this._mapView=void 0,this._panelOpen=!0,this._numSelected=0,this._tableOnly=!1}enableZoomWatchHandler(){this._initMapZoom()}async featureSelectionChange(i){var t;this._numSelected=null===(t=i.detail)||void 0===t?void 0:t.length}async popupClosed(){this._isMobile&&this.showHideMapPopupAndTable(!1)}async idsFound(i){const t=i.detail;this._tableOnly=t.tableIds.length>0&&0===t.layerIds.length,this._tableOnly&&(this._expandPopup=!0)}async layoutChanged(i){this._layoutMode=i.detail}async mapChanged(i){this._mapChange=i.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0,this._expandPopup=!1)}async layerSelectionChange(i){const t=i.detail[0],e=await l(this._mapView,t);await e.when((()=>{this._layer=e}))}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return t(e,null,t("calcite-shell",{class:"position-relative"},t("calcite-panel",{class:"width-full height-full "+(this._isMobile&&this._hideTable?"border-width-0":this._isMobile?"border-bottom-width-0":"")},this._getBody(this._layoutMode,this._panelOpen,this._hideTable)),this._getFooter()))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,await this._setMapView())}async componentDidLoad(){this._resizeObserver.observe(this.el)}_getFooter(){var i,e,s,h;const o=(null===(i=this._layer)||void 0===i?void 0:i.editingEnabled)&&(null===(h=null===(s=null===(e=this._layer)||void 0===e?void 0:e.capabilities)||void 0===s?void 0:s.operations)||void 0===h?void 0:h.supportsDelete);return this._isMobile&&this._numSelected>0&&!this._hideFooter?t("div",{class:"width-100",slot:"footer"},t("div",{class:"display-flex padding-1-2"},t("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),o?t("delete-button",{class:"padding-inline-start-1 width-full",id:"solutions-delete",ids:this._layerTable.selectedIds,layer:this._layer}):void 0)):void 0}_getDividerIcon(i,t){let e="";switch(i){case o.HORIZONTAL:e=t?"chevrons-up":"chevrons-down";break;case o.VERTICAL:case o.GRID:e=t?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(i,t,e){let s="";switch(i){case o.HORIZONTAL:s=(t&&!e?"height-1-2 display-grid":t&&e?"height-full":"height-0")+" width-full position-relative";break;case o.GRID:s="height-full position-relative "+(t?"width-1-3":"width-0");break;case o.VERTICAL:s="height-full position-relative "+(t?"width-1-2":"width-0")}return s}_getTableSizeClass(i,t){let e="";switch(i){case o.HORIZONTAL:e=(t?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case o.GRID:e=(t?"width-2-3":"width-full")+" height-full display-flex";break;case o.VERTICAL:e=(t?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(i,e,s){return t("calcite-panel",{class:"width-full height-full"},t("div",{class:"width-full height-full overflow-hidden "+(i===o.HORIZONTAL?"":"display-flex")},this._getMapAndCard(i,e,s),this._getTable(i,e,s)))}_getMapAndCard(i,e,s){const h=this._getMapSizeClass(i,e,s);return t("div",{class:`${h} overflow-hidden`},this._getMapNode(e),this._getPopupExpandNode())}_getMapNode(i){var e;return t("div",{class:(this._layoutMode!==o.HORIZONTAL||this._isMobile&&!i?"adjusted-height-50":"")+" overflow-hidden"},t("map-card",{appProxies:this.appProxies,basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:!0,hidden:this._expandPopup&&!this._isMobile,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",mapInfos:null===(e=this.mapInfos)||void 0===e?void 0:e.filter((i=>!1!==i.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"]}))}_getPopupExpandNode(){var i;const e=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",h=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,o="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",l=this._expandPopup?1===(null===(i=this.mapInfos)||void 0===i?void 0:i.length)||this._isMobile?"position-absolute-0":"position-absolute-50":"height-full",a=this._isMobile?"display-none height-0":"";return t("div",{class:`${this._isMobile?"calcite-mode-light":"calcite-mode-dark"} ${l} ${this._isMobile&&this._hideTable?"position-absolute-0 width-full height-full":this._isMobile?"display-none height-0":""}`},t("calcite-panel",null,this._isMobile?void 0:t("div",{class:`display-flex align-items-center ${a}`,slot:"header-content"},t("calcite-icon",{icon:"information",scale:"s"}),t("div",{class:"padding-inline-start-75"},this._translations.information)),t("calcite-action",{class:a,disabled:this._tableOnly,icon:e,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),this._tableOnly?void 0:t("calcite-tooltip",{class:o,label:"",placement:"bottom","reference-element":s},t("span",null,h)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return t("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},t("card-manager",{class:(this._expandPopup||this._isMobile?"height-full":"height-50")+" width-full",isMobile:this._isMobile,mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(i,e,s){var h,l;const a=s&&this._isMobile?"visibility-hidden":"",d=this._getTableSizeClass(i,e),n=this._getDividerIcon(i,e),r=e?this._translations.close:this._translations.open,c="toggle-layout",p=i===o.HORIZONTAL?"horizontal":"vertical",u=i===o.HORIZONTAL?"header":"panel-start",g=this.defaultWebmap&&this.defaultLayer,b=this.defaultGlobalId?(null===(h=this.defaultGlobalId)||void 0===h?void 0:h.indexOf(","))>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0,v=this.defaultOid?(null===(l=this.defaultOid)||void 0===l?void 0:l.indexOf(","))>-1?this.defaultOid.split(",").map((i=>parseInt(i,10))):[parseInt(this.defaultOid,10)]:void 0;return t("calcite-shell",{class:`${d} ${a} border-bottom`},this._isMobile?void 0:t("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:p,slot:u},t("calcite-action",{class:"toggle-node",icon:n,id:c,onClick:()=>this._toggleLayout(),text:""}),t("calcite-tooltip",{label:r,placement:"bottom","reference-element":c},t("span",null,r))),t("div",{class:"width-full height-full position-relative"},t("layer-table",{defaultGlobalId:g?b:void 0,defaultLayerId:g?this.defaultLayer:"",defaultOid:g&&!b?v:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,isMobile:this._isMobile,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:i=>this._layerTable=i,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_onResize(){const i=this.el.offsetWidth<1024,t=!this._isMobile&&i;this._isMobile=i,this._layoutMode=this._isMobile?o.HORIZONTAL:o.GRID,t&&(this._panelOpen=!0)}_toggleLayout(){this._panelOpen=!this._panelOpen}showHideMapPopupAndTable(i){this._expandPopup=!1,this._hideTable=i,this._hideFooter=i}_getMapInfo(i){let t;return this.mapInfos.some((e=>{if(e.id===i)return t=e,!0})),Object.assign({},t)}async _setMapView(){var i;this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1;const t=!this.defaultCenter||this._defaultCenterHonored||null===(i=this.defaultCenter)||void 0===i?void 0:i.split(";").map((i=>parseFloat(i))),e=!this.defaultLevel||this._defaultLevelHonored?void 0:parseInt(this.defaultLevel,10);t&&e&&(await this._mapView.goTo({center:t,zoom:e}),this._defaultCenterHonored=!0,this._defaultLevelHonored=!0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const i=await h(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{enableZoom:["enableZoomWatchHandler"]}}};a.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}";export{a as crowdsource_manager}