@esri/solutions-components 0.8.22 → 0.8.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/dist/cjs/calcite-alert_4.cjs.entry.js +12 -11
  2. package/dist/cjs/calcite-flow_6.cjs.entry.js +8 -8
  3. package/dist/cjs/card-manager_3.cjs.entry.js +9 -3
  4. package/dist/cjs/crowdsource-manager.cjs.entry.js +12 -4
  5. package/dist/cjs/crowdsource-reporter.cjs.entry.js +1 -1
  6. package/dist/cjs/{downloadUtils-2e36a300.js → downloadUtils-5349717a.js} +2 -1
  7. package/dist/cjs/feature-list.cjs.entry.js +7 -3
  8. package/dist/cjs/{index.es-56415e48.js → index.es-aa69b58b.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
  11. package/dist/cjs/{popupUtils-500c1544.js → popupUtils-3e65296c.js} +17 -2
  12. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  13. package/dist/cjs/solutions-components.cjs.js +1 -1
  14. package/dist/collection/components/card-manager/card-manager.js +1 -1
  15. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +30 -8
  16. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +1 -1
  17. package/dist/collection/components/feature-details/feature-details.css +2 -2
  18. package/dist/collection/components/feature-details/feature-details.js +6 -6
  19. package/dist/collection/components/feature-list/feature-list.css +1 -1
  20. package/dist/collection/components/feature-list/feature-list.js +1 -1
  21. package/dist/collection/components/info-card/info-card.js +7 -27
  22. package/dist/collection/components/layer-list/layer-list.js +1 -1
  23. package/dist/collection/components/layer-table/layer-table.js +7 -1
  24. package/dist/collection/demos/crowdsource-manager.html +10 -2
  25. package/dist/collection/utils/popupUtils.js +17 -2
  26. package/dist/collection/utils/popupUtils.ts +23 -3
  27. package/dist/components/card-manager2.js +1 -1
  28. package/dist/components/consent-manager.js +1 -1
  29. package/dist/components/crowdsource-manager.js +13 -5
  30. package/dist/components/crowdsource-reporter.js +1 -1
  31. package/dist/components/downloadUtils.js +1 -1
  32. package/dist/components/esri-loader.js +1 -1
  33. package/dist/components/feature-details2.js +7 -7
  34. package/dist/components/feature-list2.js +2 -2
  35. package/dist/components/html2canvas.js +1 -1
  36. package/dist/components/index.es.js +2 -2
  37. package/dist/components/info-card2.js +7 -11
  38. package/dist/components/instant-apps-interactive-legend-classic2.js +1 -1
  39. package/dist/components/layer-list2.js +1 -1
  40. package/dist/components/layer-table2.js +7 -1
  41. package/dist/components/popupUtils.js +17 -2
  42. package/dist/components/purify.js +1 -1
  43. package/dist/components/solution-resource.js +1 -1
  44. package/dist/esm/calcite-alert_4.entry.js +12 -11
  45. package/dist/esm/calcite-flow_6.entry.js +8 -8
  46. package/dist/esm/card-manager_3.entry.js +9 -3
  47. package/dist/esm/crowdsource-manager.entry.js +12 -4
  48. package/dist/esm/crowdsource-reporter.entry.js +1 -1
  49. package/dist/esm/{downloadUtils-aab31bfe.js → downloadUtils-5fa0d437.js} +2 -2
  50. package/dist/esm/feature-list.entry.js +7 -3
  51. package/dist/esm/{index.es-43ba3006.js → index.es-57c15c9b.js} +1 -1
  52. package/dist/esm/loader.js +1 -1
  53. package/dist/esm/map-select-tools_3.entry.js +1 -1
  54. package/dist/esm/{popupUtils-2cc3c366.js → popupUtils-650b6bba.js} +17 -2
  55. package/dist/esm/public-notification.entry.js +1 -1
  56. package/dist/esm/solutions-components.js +1 -1
  57. package/dist/solutions-components/demos/crowdsource-manager.html +10 -2
  58. package/dist/solutions-components/{p-667caa6b.js → p-24bf45b7.js} +1 -1
  59. package/dist/solutions-components/{p-88f73319.entry.js → p-41d288c0.entry.js} +1 -1
  60. package/dist/solutions-components/p-63460d51.entry.js +6 -0
  61. package/dist/solutions-components/{p-f6668347.entry.js → p-64da5bb8.entry.js} +3 -3
  62. package/dist/solutions-components/{p-37fc92db.js → p-6f69de4d.js} +2 -2
  63. package/dist/solutions-components/{p-8cff32bd.entry.js → p-72317f8e.entry.js} +2 -2
  64. package/dist/solutions-components/p-88495699.entry.js +6 -0
  65. package/dist/solutions-components/{p-54324eaa.entry.js → p-97e343df.entry.js} +1 -1
  66. package/dist/solutions-components/p-a1037b19.js +21 -0
  67. package/dist/solutions-components/{p-48c99a48.entry.js → p-c36bb8ca.entry.js} +1 -1
  68. package/dist/solutions-components/p-f6a1673c.entry.js +6 -0
  69. package/dist/solutions-components/solutions-components.esm.js +1 -1
  70. package/dist/solutions-components/utils/popupUtils.ts +23 -3
  71. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +14 -6
  72. package/dist/types/components/info-card/info-card.d.ts +0 -4
  73. package/dist/types/components.d.ts +11 -14
  74. package/dist/types/preact.d.ts +3 -2
  75. package/dist/types/utils/popupUtils.d.ts +4 -0
  76. package/package.json +1 -1
  77. package/dist/solutions-components/p-5a740f6c.entry.js +0 -6
  78. package/dist/solutions-components/p-64779bb2.entry.js +0 -6
  79. package/dist/solutions-components/p-ebf82ce0.js +0 -21
  80. package/dist/solutions-components/p-f43d6a86.entry.js +0 -6
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { _prepareAttributeValue } from "./downloadUtils";
17
18
  import { loadModules } from "./loadModules";
18
19
 
19
20
  export class PopupUtils {
@@ -23,6 +24,11 @@ export class PopupUtils {
23
24
  */
24
25
  arcade: typeof import("esri/arcade");
25
26
 
27
+ /**
28
+ * esri/intl: https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html
29
+ */
30
+ intl: typeof import("esri/intl");
31
+
26
32
  /**
27
33
  * Get the popup title that honors arcade expressions
28
34
  * @param graphic selected graphic
@@ -47,6 +53,7 @@ export class PopupUtils {
47
53
  }
48
54
  const layer = graphic.layer as __esri.FeatureLayer;
49
55
  const popupTitle = this._removeTags(layer?.popupTemplate?.title as string);
56
+ //resolve arcade expression from the popup title
50
57
  if (popupTitle.includes("{expression/expr") && layer?.popupTemplate?.expressionInfos != null) {
51
58
  for (let i = 0; i < layer.popupTemplate?.expressionInfos.length; i++) {
52
59
  const info = layer.popupTemplate.expressionInfos[i];
@@ -65,7 +72,18 @@ export class PopupUtils {
65
72
  }
66
73
  }
67
74
  }
68
-
75
+ //Format field values
76
+ if (layer.popupTemplate.fieldInfos) {
77
+ layer.fields.forEach((field) => {
78
+ const attributeValue = graphic.attributes[field.name];
79
+ //get the field info from popupTemplate
80
+ const fieldInfo = layer.popupTemplate.fieldInfos.find((fInfo) => fInfo.fieldName.toLowerCase() === field.name.toLowerCase());
81
+ //format the attribute value
82
+ const formattedAttributeValue = _prepareAttributeValue(attributeValue, field.type, field.domain, fieldInfo?.format, this.intl);
83
+ attributes[`{${field.name.toUpperCase()}}`] = formattedAttributeValue;
84
+ })
85
+ }
86
+
69
87
  return popupTitle?.replace(/{.*?}/g, (placeholder: string) => {
70
88
  return attributes[placeholder.toUpperCase()] != null ? (attributes[placeholder.toUpperCase()] as string) : "";
71
89
  });
@@ -93,10 +111,12 @@ export class PopupUtils {
93
111
  * @protected
94
112
  */
95
113
  protected async _initModules(): Promise<void> {
96
- const [arcade] = await loadModules([
97
- "esri/arcade"
114
+ const [arcade, intl] = await loadModules([
115
+ "esri/arcade",
116
+ "esri/intl"
98
117
  ]);
99
118
  this.arcade = arcade;
119
+ this.intl = intl;
100
120
  }
101
121
 
102
122
  }
@@ -59,11 +59,11 @@ export declare class CrowdsourceManager {
59
59
  */
60
60
  defaultWebmap: string;
61
61
  /**
62
- * boolean: When true a introduction page has been enabled in the consuming application.
62
+ * boolean: When true a introduction window has been enabled in the consuming application.
63
63
  * Also when true a floating button will be shown in the lower right of the window that
64
- * will emit an event when clicked that the consuming application can respond to that will open the introduction page.
64
+ * will emit an event when clicked that the consuming application can respond to that will open the introduction window.
65
65
  */
66
- introductionPageEnabled: boolean;
66
+ introductionWindowEnabled: boolean;
67
67
  /**
68
68
  * boolean: when true the layer table will auto refresh the data
69
69
  */
@@ -257,9 +257,13 @@ export declare class CrowdsourceManager {
257
257
  */
258
258
  mapInfosWatchHandler(): void;
259
259
  /**
260
- * Emitted on demand when a info button is clicked
261
- */
262
- infoIconButtonClick: EventEmitter<void>;
260
+ * Emitted on demand when a info button is clicked
261
+ */
262
+ showIntroductionWindow: EventEmitter<void>;
263
+ /**
264
+ * Emitted on demand when a cover page button is clicked
265
+ */
266
+ showCoverPage: EventEmitter<void>;
263
267
  /**
264
268
  * Listen for changes in feature selection and show or hide the map, popup, and table
265
269
  */
@@ -363,6 +367,10 @@ export declare class CrowdsourceManager {
363
367
  * Emit the event when info button clicked
364
368
  */
365
369
  protected infoButtonClick(): void;
370
+ /**
371
+ * Emit the event when cover page button clicked
372
+ */
373
+ protected coverPageButtonClick(): void;
366
374
  /**
367
375
  * Get the map and card nodes based for the current layout options
368
376
  *
@@ -35,10 +35,6 @@ export declare class InfoCard {
35
35
  * esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
36
36
  */
37
37
  mapView: __esri.MapView;
38
- /**
39
- * boolean: When true the selected feature will zoomed to in the map and the row will be scrolled to within the table
40
- */
41
- zoomAndScrollToSelected: boolean;
42
38
  /**
43
39
  * boolean: If true will show edit button
44
40
  */
@@ -248,9 +248,9 @@ export namespace Components {
248
248
  */
249
249
  "hideMapOnLoad": boolean;
250
250
  /**
251
- * boolean: When true a introduction page has been enabled in the consuming application. Also when true a floating button will be shown in the lower right of the window that will emit an event when clicked that the consuming application can respond to that will open the introduction page.
251
+ * boolean: When true a introduction window has been enabled in the consuming application. Also when true a floating button will be shown in the lower right of the window that will emit an event when clicked that the consuming application can respond to that will open the introduction window.
252
252
  */
253
- "introductionPageEnabled": boolean;
253
+ "introductionWindowEnabled": boolean;
254
254
  /**
255
255
  * IMapInfo[]: array of map infos (name and id)
256
256
  */
@@ -613,10 +613,6 @@ export namespace Components {
613
613
  * update the current graphics to the features widget
614
614
  */
615
615
  "updateCurrentGraphic": (selectedGraphic: __esri.Graphic) => Promise<void>;
616
- /**
617
- * boolean: When true the selected feature will zoomed to in the map and the row will be scrolled to within the table
618
- */
619
- "zoomAndScrollToSelected": boolean;
620
616
  }
621
617
  interface JsonEditor {
622
618
  /**
@@ -1702,7 +1698,8 @@ declare global {
1702
1698
  new (): HTMLCreateRelatedFeatureElement;
1703
1699
  };
1704
1700
  interface HTMLCrowdsourceManagerElementEventMap {
1705
- "infoIconButtonClick": void;
1701
+ "showIntroductionWindow": void;
1702
+ "showCoverPage": void;
1706
1703
  }
1707
1704
  interface HTMLCrowdsourceManagerElement extends Components.CrowdsourceManager, HTMLStencilElement {
1708
1705
  addEventListener<K extends keyof HTMLCrowdsourceManagerElementEventMap>(type: K, listener: (this: HTMLCrowdsourceManagerElement, ev: CrowdsourceManagerCustomEvent<HTMLCrowdsourceManagerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -2592,17 +2589,21 @@ declare namespace LocalJSX {
2592
2589
  */
2593
2590
  "hideMapOnLoad"?: boolean;
2594
2591
  /**
2595
- * boolean: When true a introduction page has been enabled in the consuming application. Also when true a floating button will be shown in the lower right of the window that will emit an event when clicked that the consuming application can respond to that will open the introduction page.
2592
+ * boolean: When true a introduction window has been enabled in the consuming application. Also when true a floating button will be shown in the lower right of the window that will emit an event when clicked that the consuming application can respond to that will open the introduction window.
2596
2593
  */
2597
- "introductionPageEnabled"?: boolean;
2594
+ "introductionWindowEnabled"?: boolean;
2598
2595
  /**
2599
2596
  * IMapInfo[]: array of map infos (name and id)
2600
2597
  */
2601
2598
  "mapInfos"?: IMapInfo[];
2599
+ /**
2600
+ * Emitted on demand when a cover page button is clicked
2601
+ */
2602
+ "onShowCoverPage"?: (event: CrowdsourceManagerCustomEvent<void>) => void;
2602
2603
  /**
2603
2604
  * Emitted on demand when a info button is clicked
2604
2605
  */
2605
- "onInfoIconButtonClick"?: (event: CrowdsourceManagerCustomEvent<void>) => void;
2606
+ "onShowIntroductionWindow"?: (event: CrowdsourceManagerCustomEvent<void>) => void;
2606
2607
  /**
2607
2608
  * boolean: When true only editable layers that support the update capability will be available
2608
2609
  */
@@ -2969,10 +2970,6 @@ declare namespace LocalJSX {
2969
2970
  * string: Set the position of the feature info
2970
2971
  */
2971
2972
  "position"?: string;
2972
- /**
2973
- * boolean: When true the selected feature will zoomed to in the map and the row will be scrolled to within the table
2974
- */
2975
- "zoomAndScrollToSelected"?: boolean;
2976
2973
  }
2977
2974
  interface JsonEditor {
2978
2975
  /**
@@ -552,8 +552,9 @@ declare module "preact/src/jsx" {
552
552
  "onisActionPending"?: (event: CustomEvent<any>) => void;
553
553
  }
554
554
 
555
- "crowdsource-manager": Omit<JSX.SolutionsCrowdsourceManager, "onInfoIconButtonClick"> & JSXInternal.HTMLAttributes<HTMLSolutionsCrowdsourceManagerElement> & {
556
- "oninfoIconButtonClick"?: (event: CustomEvent<any>) => void;
555
+ "crowdsource-manager": Omit<JSX.SolutionsCrowdsourceManager, "onShowIntroductionWindow" | "onShowCoverPage"> & JSXInternal.HTMLAttributes<HTMLSolutionsCrowdsourceManagerElement> & {
556
+ "onshowIntroductionWindow"?: (event: CustomEvent<any>) => void;
557
+ "onshowCoverPage"?: (event: CustomEvent<any>) => void;
557
558
  }
558
559
 
559
560
  "crowdsource-reporter": Omit<JSX.SolutionsCrowdsourceReporter, "onTogglePanel"> & JSXInternal.HTMLAttributes<HTMLSolutionsCrowdsourceReporterElement> & {
@@ -19,6 +19,10 @@ export declare class PopupUtils {
19
19
  * esri/arcade: https://developers.arcgis.com/javascript/latest/api-reference/esri-arcade.html
20
20
  */
21
21
  arcade: typeof import("esri/arcade");
22
+ /**
23
+ * esri/intl: https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html
24
+ */
25
+ intl: typeof import("esri/intl");
22
26
  /**
23
27
  * Get the popup title that honors arcade expressions
24
28
  * @param graphic selected graphic
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solutions-components",
3
- "version": "0.8.22",
3
+ "version": "0.8.23",
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 i,c as t,h as e,H as s,g as o}from"./p-6d753a3d.js";import{g as h}from"./p-896c9644.js";import{E as l}from"./p-c1cf3ebc.js";import{g as a}from"./p-583e5dd0.js";import"./p-82e085d0.js";const d=class{constructor(e){i(this,e),this.infoIconButtonClick=t(this,"infoIconButtonClick",7),this._defaultCenterHonored=!1,this._defaultLevelHonored=!1,this._shouldSetMapView=!1,this.appProxies=void 0,this.basemapConfig=void 0,this.coverPageEnabled=void 0,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.introductionPageEnabled=!1,this.enableAutoRefresh=!1,this.enableBasemap=!0,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableHome=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableZoom=!0,this.hideMapOnLoad=!1,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.popupHeaderColor=void 0,this.popupHeaderHoverColor=void 0,this.popupHeaderHoverTextColor=void 0,this.popupHeaderTextColor=void 0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=!0,this.theme="light",this.zoomAndScrollToSelected=!1,this.zoomToScale=void 0,this._expandPopup=this.hideMapOnLoad,this._hideFooter=!1,this._hideTable=!1,this._isMobile=void 0,this._translations=void 0,this._layer=void 0,this._layoutMode=l.GRID,this._mapInfo=void 0,this._mapView=void 0,this._panelOpen=!0,this._numSelected=0,this._tableOnly=!1}enableZoomWatchHandler(){this._initMapZoom()}hideMapOnLoadWatchHandler(){this.showHideMapPopupAndTable(this.hideMapOnLoad),this._expandPopup=this.hideMapOnLoad}mapInfosWatchHandler(){console.log("mapInfosWatchHandler"),console.log(this.mapInfos)}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)}async layerSelectionChange(i){const t=i.detail[0],e=await a(this._mapView,t);await e.when((()=>{this._layer=e}))}async mapInfoChange(){this._expandPopup=this.hideMapOnLoad}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return e(s,{key:"aa063ae3fc59a7f3969aaa5b569fbd0ef09a1766"},e("calcite-shell",{key:"d5d5cdb201c24f2123089c5cd5f70f973aa24e78",class:"position-relative"},e("calcite-panel",{key:"c95bb56946b85574825160acf1411fdf7308cc8c",class:"width-full height-full "+(this.popupHeaderColor&&"#FFFFFF"!==this.popupHeaderColor?"border-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,t,s,o;const h=(null===(i=this._layer)||void 0===i?void 0:i.editingEnabled)&&(null===(o=null===(s=null===(t=this._layer)||void 0===t?void 0:t.capabilities)||void 0===s?void 0:s.operations)||void 0===o?void 0:o.supportsDelete);return this._isMobile&&this._numSelected>0&&!this._hideFooter?e("div",{class:"width-100",slot:"footer"},e("div",{class:"display-flex padding-1-2"},e("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),h?e("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 l.HORIZONTAL:e=t?"chevrons-up":"chevrons-down";break;case l.VERTICAL:case l.GRID:e=t?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(i,t,e){let s="";switch(i){case l.HORIZONTAL:s=(t&&!e?"height-1-2 display-grid":t&&e?"height-full":"height-0")+" width-full position-relative";break;case l.GRID:s="height-full position-relative "+(t?"width-1-3":"width-0");break;case l.VERTICAL:s="height-full position-relative "+(t?"width-1-2":"width-0")}return s}_getTableSizeClass(i,t){let e="";switch(i){case l.HORIZONTAL:e=(t?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=(t?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(t?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(i,t,s){const o="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return e("calcite-panel",{class:"width-full height-full"},e("div",{class:"width-full height-full overflow-hidden "+(i===l.HORIZONTAL?"":"display-flex")},this._getMapAndCard(i,t,s),this._getTable(i,t,s)),this.coverPageEnabled&&e("div",{class:"floating-container",onClick:this.infoButtonClick.bind(this)},e("calcite-button",{appearance:"solid",class:`floating-button ${o}`,"icon-start":"information-letter",kind:"neutral",label:"",round:!0,scale:"l","split-child":"primary",width:"auto"})))}infoButtonClick(){this.infoIconButtonClick.emit()}_getMapAndCard(i,t,s){const o=this._getMapSizeClass(i,t,s);return e("div",{class:`${o} overflow-hidden`},this._getMapNode(t),this._getPopupExpandNode())}_getMapNode(i){var t;return e("div",{class:(this._layoutMode!==l.HORIZONTAL||this._isMobile&&!i?"adjusted-height-50":"")+" overflow-hidden"},e("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===(t=this.mapInfos)||void 0===t?void 0:t.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 t=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",o=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,h="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 e("div",{class:`${this.popupHeaderColor?"":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":""}`,style:{"--calcite-color-foreground-1":this.popupHeaderColor,"--calcite-color-foreground-2":this.popupHeaderHoverColor,"--calcite-color-text-3":this.popupHeaderTextColor,"--calcite-color-text-2":this.popupHeaderTextColor}},e("calcite-panel",null,this._isMobile?void 0:e("div",{class:`display-flex align-items-center ${a}`,slot:"header-content"},e("calcite-icon",{icon:"information",scale:"s"}),e("div",{class:"padding-inline-start-75"},this._translations.information)),e("calcite-action",{class:a,disabled:this._tableOnly,icon:t,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),this._tableOnly?void 0:e("calcite-tooltip",{class:h,label:"",placement:"bottom","reference-element":s},e("span",null,o)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return e("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},e("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,t,s){var o,h;const a=s&&this._isMobile?"visibility-hidden":"",d=this._getTableSizeClass(i,t),n=this._getDividerIcon(i,t),r=t?this._translations.close:this._translations.open,c="toggle-layout",p=i===l.HORIZONTAL?"horizontal":"vertical",g=i===l.HORIZONTAL?"header":"panel-start",u=this.defaultWebmap&&this.defaultLayer,f=this.defaultGlobalId?(null===(o=this.defaultGlobalId)||void 0===o?void 0:o.indexOf(","))>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0,b=this.defaultOid?(null===(h=this.defaultOid)||void 0===h?void 0:h.indexOf(","))>-1?this.defaultOid.split(",").map((i=>parseInt(i,10))):[parseInt(this.defaultOid,10)]:void 0;return e("calcite-shell",{class:`${d} ${a} border-bottom`},this._isMobile?void 0:e("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:p,slot:g},e("calcite-action",{class:"toggle-node",icon:n,id:c,onClick:()=>this._toggleLayout(),text:""}),e("calcite-tooltip",{label:r,placement:"bottom","reference-element":c},e("span",null,r))),e("div",{class:"width-full height-full position-relative"},e("layer-table",{defaultGlobalId:u?f:void 0,defaultLayerId:u?this.defaultLayer:"",defaultOid:u&&!f?b: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,zoomToScale:this.zoomToScale})))}_onResize(){const i=this.el.offsetWidth<1024,t=!this._isMobile&&i;this._isMobile=i,this._layoutMode=this._isMobile?l.HORIZONTAL:l.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 o(this)}static get watchers(){return{enableZoom:["enableZoomWatchHandler"],hideMapOnLoad:["hideMapOnLoadWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};d.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}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}";export{d as crowdsource_manager}
@@ -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,g as e}from"./p-6d753a3d.js";import{l as a,g as h}from"./p-896c9644.js";import{P as c}from"./p-ebf82ce0.js";import{g as n,c as o,h as l}from"./p-583e5dd0.js";import"./p-82e085d0.js";import"./p-c1cf3ebc.js";const r=class{constructor(s){t(this,s),this.featureSelect=i(this,"featureSelect",7),this.selectedLayerId=void 0,this.mapView=void 0,this.noFeaturesFoundMsg=void 0,this.pageSize=100,this.highlightOnMap=!1,this.highlightOnHover=!1,this.sortingInfo=void 0,this.whereClause=void 0,this.textSize="large",this.showInitialLoading=!0,this._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._translations=void 0}async selectedLayerWatchHandler(){this._selectedLayer=await n(this.mapView,this.selectedLayerId),await this.initializeFeatureItems()}async sortingInfoWatchHandler(){await this.initializeFeatureItems()}async whereClauseHandler(){await this.initializeFeatureItems()}async refresh(){await this.initializeFeatureItems()}async componentWillLoad(){await this.initModules(),await this._getTranslations(),this._isLoading=this.showInitialLoading,this._popupUtils=new c,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await n(this.mapView,this.selectedLayerId))}async componentDidLoad(){await this.initializeFeatureItems()}render(){return s("calcite-panel",{key:"9f702c6d98cc19704e0773e36fd969817ea7262e","full-height":!0,"full-width":!0},this._isLoading&&s("calcite-loader",{key:"e9acf13f3444057b097d6b145c1a6e0118f150ea",label:"",scale:"m"}),0===this._featureItems.length&&!this._isLoading&&s("calcite-notice",{key:"8c7fa89e2da7490b04456e51f8534c2515a02399",class:"error-msg",icon:"feature-details",kind:"info",open:!0},s("div",{key:"799d419e9c26b7928f15cb1cf9afa9f47cab0e94",slot:"message"},this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg)),s("calcite-list",{key:"82c60b16ab586ad57f8f98bb08814f688102b166","selection-appearance":"border","selection-mode":"none"},!this._isLoading&&this._featureItems.length>0&&this._featureItems),this._featuresCount>this.pageSize&&s("div",{key:"e5b789ea46c6bedfbe83f1323ffb89271c0b76ce",class:"width-full",slot:"footer"},s("calcite-pagination",{key:"4d30b5364fc4742f278157c5f2c21e75d4ecb0b8",class:"pagination","full-width":!0,onCalcitePaginationChange:this.pageChanged.bind(this),"page-size":this.pageSize,ref:t=>this._pagination=t,"start-item":"1","total-items":this._featuresCount})))}async initModules(){const[t]=await a(["esri/Color"]);this.Color=t}getWhereCondition(){var t;let i="1=1";return this.whereClause&&(i=this.whereClause),(null===(t=this._selectedLayer)||void 0===t?void 0:t.definitionExpression)&&(i=i+" AND "+this._selectedLayer.definitionExpression),i}async initializeFeatureItems(){var t;if(this._selectedLayer){null===(t=this._pagination)||void 0===t||t.goTo("start"),this._isLoading=this.showInitialLoading,this._featureItems=await this.queryPage(0);const i={where:this.getWhereCondition()};this._featuresCount=await this._selectedLayer.queryFeatureCount(i),this._isLoading=!1}}async pageChanged(t){this._isLoading=!0,this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null);const i=t.target.startItem-1;this._featureItems=await this.queryPage(i),this._isLoading=!1}async featureClicked(t,i){if(this.clearHighlights(),this.highlightOnMap){const i=Number(t.target.value),s=await o(this.mapView,this.selectedLayerId);this._highlightHandle=await l([i],s,this.mapView,!0)}await this.emitSelectedFeature(i)}async emitSelectedFeature(t){const i=t.layer,s=i.createQuery();s.returnGeometry=!0,s.objectIds=[t.getObjectId()];const e=await i.queryFeatures(s);this.featureSelect.emit(e.features[0])}async onFeatureHover(t){if(this.clearHighlights(),this.highlightOnHover){const i=t.getObjectId(),s=await o(this.mapView,this.selectedLayerId);s.highlightOptions={color:new this.Color("#FFFF00")},this._highlightHandle=s.highlight([i])}}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}async queryPage(t){var i,s;const e=this._selectedLayer,a=(null===(i=this.sortingInfo)||void 0===i?void 0:i.field)?this.sortingInfo.field:e.objectIdField,h=(null===(s=this.sortingInfo)||void 0===s?void 0:s.order)?this.sortingInfo.order:"desc",c={start:t,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:this.getWhereCondition(),outSpatialReference:this.mapView.spatialReference.toJSON()};a&&h&&(c.orderByFields=[a.toString()+" "+h]);const n=await e.queryFeatures(c);return await this.createFeatureItem(n)}async createFeatureItem(t){const i=(null==t?void 0:t.features).map((async t=>{const i=await this._popupUtils.getPopupTitle(t,this.mapView.map);return this.getFeatureItem(t,i)}));return Promise.all(i)}getFeatureItem(t,i){const e=t.attributes[this._selectedLayer.objectIdField].toString();return s("calcite-list-item",{onCalciteListItemSelect:i=>{this.featureClicked(i,t)},onMouseLeave:()=>{this.clearHighlights()},onMouseOver:()=>{this.onFeatureHover(t)},value:e},s("div",{class:"small"===this.textSize?"feature-list-popup-title-small":"feature-list-popup-title",slot:"content-start"},i=null!=i?i:e),s("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{selectedLayerId:["selectedLayerWatchHandler"],sortingInfo:["sortingInfoWatchHandler"],whereClause:["whereClauseHandler"]}}};r.style=":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px}.feature-list-popup-title-small{font-size:x-small;padding:10px 12px}";export{r as feature_list}
@@ -1,21 +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{l as t}from"./p-896c9644.js";
7
- /** @license
8
- * Copyright 2022 Esri
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */class i{async getPopupTitle(t,i){var o,l,s;this.arcade||await this._initModules();let e={};for(const[i,o]of Object.entries(t.attributes))e=Object.assign(Object.assign({},e),{[`{${i.toUpperCase()}}`]:o});const n=t.layer,a=this._removeTags(null===(o=null==n?void 0:n.popupTemplate)||void 0===o?void 0:o.title);if(a.includes("{expression/expr")&&null!=(null===(l=null==n?void 0:n.popupTemplate)||void 0===l?void 0:l.expressionInfos))for(let o=0;o<(null===(s=n.popupTemplate)||void 0===s?void 0:s.expressionInfos.length);o++){const l=n.popupTemplate.expressionInfos[o],s=this.arcade.createArcadeProfile("popup");try{const o=await this.arcade.createArcadeExecutor(l.expression,s),a=await o.executeAsync({$feature:t,$layer:n,$map:i});null==a&&""===a||(e[`{expression/${l.name}}`.toUpperCase()]=a)}catch(t){console.error(t);continue}}return null==a?void 0:a.replace(/{.*?}/g,(t=>null!=e[t.toUpperCase()]?e[t.toUpperCase()]:""))}_removeTags(t){return null==t||""===t?"":t.toString().replace(/(<([^>]+)>)/gi,"")}async _initModules(){const[i]=await t(["esri/arcade"]);this.arcade=i}}export{i as P}
@@ -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 s,g as e,c as h}from"./p-6d753a3d.js";import{g as a,l as o}from"./p-896c9644.js";import{q as l,g as n,e as d,f as c,i as r,j as v,c as p}from"./p-583e5dd0.js";import{d as u}from"./p-37fc92db.js";import"./p-82e085d0.js";import"./p-c1cf3ebc.js";import"./p-334e6394.js";import"./p-a230b270.js";import"./p-530b73ce.js";const b=class{constructor(t){i(this,t),this.isMobile=void 0,this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(i){const t=i.detail;this._cardLoading=!0;const s=t.length>0?await l(t,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=s.sort(((i,s)=>t.indexOf(i.getObjectId())-t.indexOf(s.getObjectId()))),this._cardLoading=!1}async layerSelectionChange(i){const t=i.detail[0];this.layer=await n(this.mapView,t)}async componentWillLoad(){await this._getTranslations()}render(){var i,e;const h=(null===(i=this._graphics)||void 0===i?void 0:i.length)>0?"":"display-none",a=(null===(e=this._graphics)||void 0===e?void 0:e.length)>0?"display-none":"";return t(s,{key:"c4b71cefeb5eec1e1312104c519dfb9ef1398d71"},t("div",{key:"6c1539db40060f9295c8aa72af29eac5f9c67d8d",class:"overflow-auto height-full"},t("calcite-shell",{key:"2a4f7b47e01e3f27528dbce5fe236187a0f57dab",class:"position-relative "+h},t("div",{key:"4b226239c5b80210aa3d42d422bbc50a66bdcf59"},t("info-card",{key:"23ec16e93def6ebf81ed86109a55aa3e667fb958",graphics:this._graphics,isLoading:this._cardLoading,isMobile:this.isMobile,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),t("calcite-shell",{key:"8b385e91e35cfa4dc14aa67f300badf627119c39",class:"position-relative "+a},t("div",{key:"a4cca3a463dbe115638c3b15d4613f7d719f153f",class:"padding-1"},t("calcite-notice",{key:"91047393ac4f19864179f97631ffcdf48aaa47c1",icon:"table",open:!0},t("div",{key:"c81f06e628d2811c3cedbae6a3e38fb972d0a759",slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const i=await a(this.el);this._translations=i[0]}get el(){return e(this)}};b.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}card-manager{display:block}";const f=class{constructor(t){i(this,t),this.featureSelectionChange=h(this,"featureSelectionChange",7),this._ctrlIsPressed=!1,this._defaultFilterHonored=!1,this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._observerSet=!1,this._shiftIsPressed=!1,this._skipOnChange=!1,this.onTableNodeCreate=i=>{this._tableNode=i},this.defaultGlobalId=void 0,this.defaultLayerId=void 0,this.defaultOid=void 0,this.enableAutoRefresh=void 0,this.enableColumnReorder=!0,this.enableCSV=void 0,this.enableInlineEdit=void 0,this.enableShare=void 0,this.isMobile=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.selectedIds=[],this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this.zoomToScale=void 0,this._allIds=[],this._controlsThatFit=void 0,this._csvExporting=!1,this._fetchingData=!1,this._filterActive=!1,this._filterOpen=!1,this._layer=void 0,this._selectAllActive=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=void 0,this._translations=void 0}async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}enableCSVWatchHandler(){var i;(null===(i=this._toolInfos)||void 0===i?void 0:i.length)>0&&this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}enableShareWatchHandler(){this._toolbar&&this._updateToolbar()}_controlsThatFitWatchHandler(){var i;const t=this._controlsThatFit?this._controlsThatFit.reduce(((i,t)=>(i.push(t.id),i)),[]):[];this._toolInfos=null===(i=this._toolInfos)||void 0===i?void 0:i.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}isMobileWatchHandler(){this._toolInfos||this.isMobile||this._initToolInfos()}async mapInfoWatchHandler(){this._resetColumnTemplates(),this._initLayerExpressions(),this._initToolInfos(),this._updateToolbar(),await this._sortTable()}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression=void 0,this._updateShareUrl(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(i=>{this._mapClicked(i)})))}async _layerWatchHandler(){var i;this._fetchingData=!0,await(null===(i=this._layer)||void 0===i?void 0:i.when((async()=>{var i;this._definitionExpression=this._layer.definitionExpression,this._floorField=null===(i=this._layer.floorInfo)||void 0===i?void 0:i.floorField,this._updateFloorDefinitionExpression(),await this._resetTable(),this._initLayerExpressions(),this._updateShareUrl(),this._fetchingData=!1})))}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1)}async selectionChanged(i){const t=i.detail.selectedFeature[0],s=t.getObjectId();if(this.zoomAndScrollToSelected){const i=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(i);const e=t.layer;let h;this.mapView.allLayerViews.toArray().some((i=>{if(i.layer.title===e.title&&"feature"===i.layer.type)return h=i,!0})),h&&await d([s],h,this.mapView,!0,void 0,this.zoomToScale)}}async editsComplete(i){const t=i.detail;"delete"!==t&&"add"!==t||(this._allIds=await c(this._layer)),await this._refresh()}async facilityChanged(i){this._floorFacility=i.detail,this._updateFloorDefinitionExpression()}async levelChanged(i){this._floorLevel=i.detail,this._updateFloorDefinitionExpression()}async siteChanged(i){this._floorSite=i.detail,this._updateFloorDefinitionExpression()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver||(this._resizeObserver=new ResizeObserver((()=>this._onResize())))}render(){const i=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",h=this._allIds.length.toString(),a=this.selectedIds.length.toString(),o=this.isMobile?"height-full":"height-full-adjusted";return this._validateActiveActions(),t(s,{key:"a8110680363000bcec4eb6f0b4a94ee2f677dcca"},t("calcite-shell",{key:"3c4471daca709db284ede134712933ada2213bdd"},this._getTableControlRow("header"),t("div",{key:"fce44e957e4490d6fd9cbcff02beec8cf1a780f4",class:`width-full ${o}`},t("calcite-panel",{key:"e75572b0f313f99489268f6d63b27b78c8722331",class:"height-full width-full"},t("calcite-loader",{key:"2a34bd84408d1aff552f2818976e03c487443215",class:e,label:this._translations.fetchingData,scale:"l"}),t("div",{key:"0823308992c61fa803cf5a526d903b629327c251",class:i,ref:this.onTableNodeCreate})),this.isMobile?void 0:t("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",h).replace("{{selected}}",a)))),this._filterModal())}async componentDidLoad(){this.isMobile||this._observerSet||(this._resizeObserver.observe(this._toolbar),this._observerSet=!0),document.onclick=i=>this._handleDocumentClick(i),document.onkeydown=i=>this._handleKeyDown(i),document.onkeyup=i=>this._handleKeyUp(i)}componentDidRender(){this._updateToolbar()}async _initModules(){const[i,t,s]=await o(["esri/widgets/FeatureTable","esri/core/reactiveUtils","esri/widgets/FeatureTable/support/TableTemplate"]);this.FeatureTable=i,this.reactiveUtils=t,this.TableTemplate=s}_onResize(){this._updateToolbar()}_getTableControlRow(i){return t("div",{class:"display-flex border-bottom height-51",ref:i=>this._toolbar=i,slot:i},this._getActionBar(),this.isMobile?void 0:this._getDropdown("more-table-options"),this.enableShare&&!this.isMobile?this._getShare("share"):void 0)}_getActionBar(){const i=this.isMobile?"width-full":"",s=this.isMobile?"border-top":"";return t("calcite-action-bar",{class:i,expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},t("div",{class:`border-end ${i} ${s}`,id:"solutions-map-layer-picker-container"},t("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,display:"inline-flex",height:50,isMobile:this.isMobile,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChanged(i)},onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showSingleLayerAsLabel:!0,showTables:!0,type:"dropdown"})),this.isMobile?void 0:this._getActions())}_getActions(){const i=this._getActionItems();return null==i?void 0:i.reduce(((i,s)=>(s&&!s.isOverflow&&i.push(s.isDanger?this._getDangerAction(s.icon,s.label,s.func,s.disabled):s.isSublist?t("calcite-dropdown",{closeOnSelectDisabled:!0,id:this._getId(s.icon),onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._showHideDropdown=i},this._getAction(s.active,this._showHideOpen?"chevron-down":s.icon,s.indicator,s.label,s.func,s.disabled,s.loading,"trigger"),this._showHideOpen?this._getFieldlist():void 0):this._getAction(s.active,s.icon,s.indicator,s.label,s.func,s.disabled,s.loading)),i)),[])}_getFieldlist(){return this._columnsInfo?t("calcite-dropdown-group",{"selection-mode":"multiple"},Object.keys(this._columnsInfo).map((i=>t("calcite-dropdown-item",{id:i,onClick:i=>{const t=i.target;this._columnsInfo[t.id]=t.selected,t.selected?this._table.showColumn(t.id):this._table.hideColumn(t.id)},selected:this._columnsInfo[i]},i)))):void 0}_validateEnabledActions(){var i;const t=this._featuresSelected(),s=["zoom-to-object","trash","erase","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&s.indexOf(i.icon)>-1&&(i.disabled=!t)}))}_validateActiveActions(){var i;const t=["filter","list-check-all","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&t.indexOf(i.icon)>-1&&("filter"===i.icon&&(i.indicator=this._filterActive),"list-check-all"===i.icon&&(i.active=this._selectAllActive),"selected-items-filter"===i.icon&&(i.active=this._showOnlySelected))}))}_initToolInfos(){const i=this._featuresSelected(),t=this._featuresEmpty(),s=this._hasFilterExpressions();this._translations&&(this._toolInfos=[{active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!i,isOverflow:!1},s?{active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this._toggleFilter(),disabled:!1,isOverflow:!1}:void 0,this._deleteEnabled?{active:void 0,icon:"trash",indicator:void 0,label:void 0,func:void 0,disabled:!i,isDanger:!0,isOverflow:!1}:void 0,{active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!i,isOverflow:!1},{active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!i,isOverflow:!1},{active:!1,icon:"list-check-all",indicator:!1,func:()=>this._selectAll(),label:this._translations.selectAll,disabled:t,isOverflow:!1},{active:!1,icon:"compare",indicator:!1,func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:t,isOverflow:!1},{active:!1,icon:"refresh",indicator:!1,func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:t,isOverflow:!1}:void 0,{active:!1,icon:this._showHideOpen?"chevron-down":"chevron-right",indicator:!1,func:()=>this._toggleShowHide(),label:this._translations.showHideColumns,disabled:!1,isOverflow:!1,isSublist:!0}],this._defaultVisibleToolSizeInfos=void 0)}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){const i=`${this._floorField} = '${this._floorLevel}'`,t=this._layer.definitionExpression;this._layer.definitionExpression=(null==t?void 0:t.indexOf(this._floorExpression))>-1?t.replace(this._floorExpression,i):t?`${t} AND (${i})`:i,this._floorExpression=i}}_featuresSelected(){return this.selectedIds.length>0}_featuresEmpty(){return 0===this._allIds.length}_hasFilterExpressions(){var i,t,s;let e;return(null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions)&&(null===(s=this._layer)||void 0===s?void 0:s.id)&&(e=this.mapInfo.filterConfig.layerExpressions.filter((i=>i.id===this._layer.id))),(null==e?void 0:e.length)>0}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),!this.isMobile&&this._toolbar&&this._toolInfos&&(this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const i=this._toolbar.offsetWidth;let t=this._toolbarSizeInfos.reduce(((i,t)=>i+t.width),0);const s=["solutions-more","solutions-map-layer-picker-container","solutions-action-share"];if(t>i){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,h)=>(s.indexOf(h.id)<0&&(t>i?t-=h.width:e.push(h)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((i,t)=>(i.push(t.id),i)),[]);let h=!1;const a=[...this._defaultVisibleToolSizeInfos].reduce(((a,o)=>(!h&&s.indexOf(o.id)<0&&(e.indexOf(o.id)>-1||t+o.width<=i)?(e.indexOf(o.id)<0&&(t+=o.width),a.push(o)):s.indexOf(o.id)<0&&t+o.width>i&&(h=!0),a)),[]);this._setControlsThatFit(a,s)}}),250))}_setControlsThatFit(i,t){let s=JSON.stringify(i)!==JSON.stringify(this._controlsThatFit);document.getElementById("solutions-action-bar").childNodes.forEach((i=>{t.indexOf(i.id)<0&&!s&&(s=this._controlsThatFit.map((i=>i.id)).indexOf(i.id)<0)})),s&&(this._controlsThatFit=[...i])}_setToolbarSizeInfos(){let i=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((t,s)=>{0===s?t.childNodes.forEach((t=>{this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0)})):t.referenceElement||(this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0))})),i&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&!i.isOverflow))}_getDropdown(i){const s=this._getDropdownItems();return s.length>0?t("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this._layer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._moreDropdown=i},t("calcite-action",{appearance:"solid",id:i,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},t("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),t("calcite-dropdown-group",{"selection-mode":"none"},s.map((i=>t("calcite-dropdown-group",{class:i.disabled?"disabled":"",selectionMode:i.disabled?"none":"single"},t("calcite-dropdown-item",{disabled:i.loading,iconStart:i.isSublist&&this._showHideOpen?"chevron-down":i.loading?"":i.icon,id:"solutions-subset-list",onClick:i.func},i.loading?t("div",{class:"display-flex"},t("calcite-loader",{inline:!0,label:i.label,scale:"m"}),i.label):i.label))))),this._showHideOpen?this._getFieldlist():void 0):void 0}_getDropdownItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&i.isOverflow))}_getAction(i,s,e,h,a,o,l,n){const d=void 0===this._layer||o;return t("div",{class:"display-flex",id:this._getId(s),slot:n},t("calcite-action",{active:i,appearance:"solid",disabled:d,icon:s,id:s,indicator:e,label:h,loading:l,onClick:a,text:h,textEnabled:!0}),this._getToolTip("bottom",s,h))}_getShare(i){return t("div",{class:"share-action",id:this._getId(i)},t("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"instant-app-share",embed:this.shareIncludeEmbed,popoverButtonIconScale:"s",ref:i=>this._shareNode=i,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",socialMedia:this.shareIncludeSocial,view:this.mapView}),this._getToolTip("bottom",i,this._translations.share))}_updateShareUrl(){var i,t,s,e;const h=null===(i=this._shareNode)||void 0===i?void 0:i.shareUrl;if(!h)return;const a=new URL(h);(null===(t=this.mapInfo)||void 0===t?void 0:t.id)?a.searchParams.set("webmap",this.mapInfo.id):a.searchParams.delete("webmap"),(null===(s=this._layer)||void 0===s?void 0:s.id)?a.searchParams.set("layer",this._layer.id):a.searchParams.delete("layer"),(null===(e=this.selectedIds)||void 0===e?void 0:e.length)>0?a.searchParams.set("oid",this.selectedIds.join(",")):a.searchParams.delete("oid"),this._shareNode.shareUrl=a.href}_getToolTip(i,s,e){return document.getElementById(s)?t("calcite-tooltip",{placement:i,"reference-element":s},t("span",null,e)):void 0}_getId(i){return`solutions-action-${i}`}_getDangerAction(i,s,e,h){const a=void 0===this._layer||h;return t("div",{class:"display-flex",id:this._getId(i)},"trash"===i?t("delete-button",{buttonType:"action",class:"display-flex",disabled:a,icon:i,ids:this._getIds(),layer:this._layer}):t("calcite-action",{appearance:"solid",disabled:a,id:i,onClick:e,text:""},t("calcite-button",{appearance:"transparent",iconStart:i,kind:"danger"},s)),this._getToolTip("bottom",i,s))}_getIds(){return this._table.highlightIds.toArray()}async _getTable(i,t){this._layer&&(await this._layer.when((()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:t},container:i})})),await this._table.when((()=>{this._table.highlightIds.on("change",(i=>{this._handleOnChange(i)}))})))}async _handleOnChange(i){const t=[...this._table.highlightIds.toArray()];if(this._skipOnChange)this._skipOnChange=!1;else{if(this._ctrlIsPressed||this._shiftIsPressed){if(this._ctrlIsPressed)this.selectedIds=t.reverse();else if(this._shiftIsPressed&&(this._skipOnChange=!0,this._previousCurrentId=this._currentId,this._currentId=[...this._table.highlightIds.toArray()].reverse()[0],this._previousCurrentId!==this._currentId)){const i=this._table.activeSortOrders.reduce(((i,t)=>(i.push(`${t.fieldName} ${t.direction}`),i)),[]),s=await r(this._layer,this._layer.definitionExpression,i);let e=!1;const h=this._table.viewModel.getObjectIdIndex(this._previousCurrentId),a=this._table.viewModel.getObjectIdIndex(this._currentId),o=h<a?h:a,l=a>h?a:h;this._skipOnChange=o+1!==l;const n=s.reduce(((i,t)=>{const s=t,h=this._table.viewModel.getObjectIdIndex(s);return s!==this._currentId&&s!==this._previousCurrentId||(e=!e,i.indexOf(s)<0&&i.push(s)),e&&i.indexOf(s)<0&&i.push(s),(this.selectedIds.indexOf(s)>-1||h>=o&&h<=l)&&i.indexOf(s)<0&&h>-1&&i.push(s),i}),[]);this.selectedIds=h<a?n.reverse():n,this._table.highlightIds.addMany(this.selectedIds.filter((i=>t.indexOf(i)<0)))}}else if(this.selectedIds.length>0){this._skipOnChange=!0;const s=this.selectedIds.length>1&&1===i.removed.length?i.removed:t.filter((i=>this.selectedIds.indexOf(i)<0));this._clearSelection(),this.selectedIds=[...s],s.length>0?this._table.highlightIds.add(s[0]):this._skipOnChange=!1}else this.selectedIds=t.reverse();this._finishOnChange()}this._currentId=[...this._table.highlightIds.toArray()].reverse()[0]}_finishOnChange(){this._showOnlySelected&&(this._featuresSelected()?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this.selectedIds)}_resetColumnTemplates(){var i,t;const s=this._getColumnTemplates(null===(i=this._layer)||void 0===i?void 0:i.id,null===(t=this._layer)||void 0===t?void 0:t.fields),e=null==s?void 0:s.some(((i,t)=>{var s;return JSON.stringify(null===(s=this._table)||void 0===s?void 0:s.tableTemplate.columnTemplates[t])!==JSON.stringify(i)}));if(this._table&&s&&(e||!this._columnsInfo)){this._table.tableTemplate=new this.TableTemplate({columnTemplates:s});const i=s.map((i=>i.fieldName));this._initColumnsInfo(i)}}async _resetTable(){var i;if(this._clearSelection(),this._allIds=await c(this._layer),this._table)this._table.view=this.mapView,this._table.layer=this._layer;else{const t=this._getColumnTemplates(this._layer.id,null===(i=this._layer)||void 0===i?void 0:i.fields);await this._getTable(this._tableNode,t)}await this._initLayerRefresh(),this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,await this.reactiveUtils.once((()=>"loaded"===this._table.state)).then((async()=>{this._table.highlightIds.removeAll(),this._table.clearSelectionFilter(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),this._initToolInfos(),this._updateToolbar()}))}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._refreshHandle=this._layer.on("refresh",(i=>{i.dataChanged&&(this._skipOnChange=!0,this._updateAllIds())}))}async _updateAllIds(){this._allIds=await c(this._layer),this.selectedIds=this.selectedIds.filter((i=>this._allIds.indexOf(i)>-1)),await this._refresh()}async _handleDefaults(){var i,t;if(!this._defaultOidHonored&&(null===(i=this.defaultOid)||void 0===i?void 0:i.length)>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=void 0,this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&(null===(t=this.defaultGlobalId)||void 0===t?void 0:t.length)>0&&this._table){const i=await v(this.defaultGlobalId,this._layer),t=(null==i?void 0:i.length)>0?i.map((i=>i.getObjectId())):void 0;t&&await this._selectDefaultFeature(t),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=void 0,this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(i){var t,s;const e=null===(t=this._table)||void 0===t?void 0:t.columns.reduce(((t,s)=>((!i||(null==i?void 0:i.indexOf(s.name))>-1)&&(t[s.name]=!s.hidden),t)),{}),h=null===(s=this._table)||void 0===s?void 0:s.columns.map((i=>i.name));(i?i.filter((i=>h.indexOf(i)<0)):[]).forEach((i=>{e[i]=!0})),this._columnsInfo=i?i.reduce(((i,t)=>(i[t]=e[t],i)),{}):e}async _selectDefaultFeature(i){i.length>0&&this._table.highlightIds.addMany(i)}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){var i,t,s,e,h;let a,o=null===(i=this._layer)||void 0===i?void 0:i.objectIdField,l="desc";(null===(e=null===(s=null===(t=this.mapInfo)||void 0===t?void 0:t.layerOptions)||void 0===s?void 0:s.layers)||void 0===e?void 0:e.length)>0&&(a=this.mapInfo.layerOptions.layers.filter((i=>i.id===this._layer.id)),a&&a.length>0&&(a=a[0],a.sortField&&(null===(h=a.fields)||void 0===h?void 0:h.includes(a.sortField))&&(o=a.sortField),l=(null==a?void 0:a.sortOrder)?a.sortOrder:"desc")),this._table&&this._layer&&(await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(o,l)})))}_forceShowHide(){this._showHideDropdown&&(this._showHideDropdown.open=this._showHideOpen),this._moreDropdown&&(this._moreDropdown.open=this._showHideOpen)}_toggleShowHide(){this._showHideOpen=!this._showHideOpen}_closeShowHide(){this._showHideOpen=!1}_handleDocumentClick(i){var t;const s=null===(t=i.target)||void 0===t?void 0:t.id;this._showHideOpen&&Object.keys(this._columnsInfo).indexOf(s)<0&&"solutions-subset-list"!==s&&"chevron-right"!==s&&(this._closeShowHide(),this._moreDropdown&&(this._moreDropdown.open=!1),this._showHideDropdown&&(this._showHideDropdown.open=!1))}_handleKeyDown(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_handleKeyUp(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_filterModal(){var i,s,e;return t("calcite-modal",{"aria-labelledby":"modal-title",class:"modal",kind:"brand",onCalciteModalClose:()=>{this._closeFilter()},open:this._filterOpen,widthScale:"s"},t("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},null===(s=null===(i=this._translations)||void 0===i?void 0:i.filter)||void 0===s?void 0:s.replace("{{title}}",null===(e=this._layer)||void 0===e?void 0:e.title)),t("div",{slot:"content"},t("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:async()=>this._closeFilter(),comboboxOverlayPositioning:"fixed",layerExpressions:this._layerExpressions,onFilterListReset:()=>this._handleFilterListReset(),onFilterUpdate:()=>this._handleFilterUpdate(),ref:i=>this._filterList=i,view:this.mapView,zoomBtn:!1})))}_handleFilterListReset(){this._filterActive=!1,this._updateShareUrl()}_handleFilterUpdate(){const i=this._layer.definitionExpression;if(this._floorExpression){const t=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=i&&this._floorField&&i.indexOf(`${this._floorField} = '`)>-1?i.replace(t,this._floorExpression):i?`${i} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=this._definitionExpression!==this._layer.definitionExpression&&(!this._floorExpression||this._layer.definitionExpression!==this._floorExpression),this._updateShareUrl()}async _closeFilter(){this._filterOpen&&(this._allIds=await c(this._layer),this._filterOpen=!1)}async _mapClicked(i){const t={include:this._layer},s=await this.mapView.hitTest(i.screenPoint,t);s.results.length>0?(s.results.forEach((i=>{const t=i.graphic.getObjectId();this._table.highlightIds.indexOf(t)<0&&this._table.highlightIds.add(t)})),this._showOnlySelected&&this._table.filterBySelection()):this._clearSelection()}_selectAll(){const i=this._allIds;this._table.highlightIds.removeAll(),this._skipOnChange=!0,this._table.highlightIds.addMany(i),this.selectedIds=i,this._finishOnChange(),this._selectAllActive=!0}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){var i;this.selectedIds=[],null===(i=this._table)||void 0===i||i.highlightIds.removeAll(),this._finishOnChange()}_toggleFilter(){this._filterOpen=!this._filterOpen}_initLayerExpressions(){var i,t;const s=null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions;this._layerExpressions=s?s.filter((i=>{var t;return i.id===(null===(t=this._layer)||void 0===t?void 0:t.id)})):[],this._filterList.layerExpressions=this._layerExpressions,this._filterActive=this._layerExpressions.filter((i=>i.expressions.filter((i=>i.active)).length>0)).length>0}_switchSelected(){const i=[...this.selectedIds];this._table.highlightIds.removeAll();const t=this._allIds.reduce(((t,s)=>(i.indexOf(s)<0&&t.push(s),t)),[]).sort(((i,t)=>i-t));this._skipOnChange=!0,this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange()}async _exportToCSV(){const i={},t=this._table.highlightIds.toArray();i[this._layer.id]={selectionSetNames:[this._layer.title],ids:t,layer:this._layer};const s=this._table.columns.toArray().reduce(((i,t)=>(t.hidden||i.push(t.name.toLocaleLowerCase()),i)),[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,await u(null,i,!1,!1,!0,s,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}_updateToolInfoLoading(i,t){this._toolInfos.some((s=>{if((null==s?void 0:s.icon)===i)return s.loading=t,!0}))}async _refresh(){await this._table.refresh(),this.featureSelectionChange.emit(this.selectedIds)}async _zoom(){if(this._layer){const i=await p(this.mapView,this._layer.id);await d(this.selectedIds,i,this.mapView,!0,void 0,this.zoomToScale)}}async _layerSelectionChanged(i){var t;const s=i.detail[0];if(s!==(null===(t=this._layer)||void 0===t?void 0:t.id)||this._featuresEmpty()){this._fetchingData=!0;const i=await n(this.mapView,s);await i.when((()=>{this._layer=i}))}this._fetchingData=!1}_getColumnTemplates(i,t){var s,e;let h;null===(e=null===(s=this.mapInfo)||void 0===s?void 0:s.layerOptions)||void 0===e||e.layers.some((t=>{if(t.id===i)return h=t,!0}));const a=(null==h?void 0:h.fields)&&(null==h?void 0:h.fieldOrder)?h.fieldOrder.filter((i=>h.fields.indexOf(i)>-1)):void 0;let o;return t&&(o=h&&(null==h?void 0:h.fields)?t.reduce(((i,t)=>{if(h.fields.indexOf(t.name)>-1){const s={type:"field",fieldName:t.name,label:t.alias,menuConfig:this._getMenuConfig(t.name)};i.push(s)}return i}),[]).sort(this._sortFields.bind(this,null==h?void 0:h.fieldOrder)):t.map((i=>({type:"field",fieldName:i.name,label:i.alias,menuConfig:this._getMenuConfig(i.name)})))),a?null==o?void 0:o.sort(this._sortFields.bind(this,a)):o}_sortFields(i,t,s){return(null==i?void 0:i.indexOf(t.fieldName))-i.indexOf(s.fieldName)}_getMenuConfig(i){return{items:[{label:this._translations.hideField,icon:"view-hide",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(i)}}]}}_handleHideClick(i){this._columnsInfo[i]=!1,this._table.hideColumn(i),this._table.tableTemplate.columnTemplates.forEach((t=>{t.fieldName===i&&(t.visible=!1)}))}async _getTranslations(){const i=await a(this.el);this._translations=i[0]}get el(){return e(this)}static get watchers(){return{defaultOid:["defaultOidWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],enableCSV:["enableCSVWatchHandler"],enableInlineEdit:["enableInlineEditWatchHandler"],enableShare:["enableShareWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"],isMobile:["isMobileWatchHandler"],mapInfo:["mapInfoWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],selectedIds:["selectedIdsWatchHandler"]}}};f.style=':host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{font-size:14px !important;color:var(--calcite-color-text-3) !important}.share-action{position:absolute;right:0}html[dir="rtl"] .share-action{left:0}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.instant-app-share{height:50px !important;display:inline-flex}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-modal-content-padding:0}.esri-feature-table__table-container{height:100%}';const m=class{constructor(t){i(this,t),this.mapChanged=h(this,"mapChanged",7),this.beforeMapChanged=h(this,"beforeMapChanged",7),this._defaultWebmapHonored=!1,this._loadedId="",this.appProxies=void 0,this.defaultWebmapId="",this.enableHome=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSingleExpand=!0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.homeZoomIndex=3,this.homeZoomPosition="top-left",this.homeZoomToolsSize="m",this.mapInfos=[],this.mapWidgetsIndex=0,this.mapWidgetsPosition="top-right",this.mapWidgetsSize="m",this.mapView=void 0,this.stackTools=!0,this.theme=void 0,this.toolOrder=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}enableHomeWatchHandler(){this._initHome()}async mapInfoChange(i){await this._loadMap(i.detail)}async componentWillLoad(){await this._initModules()}render(){var i,e;const h=this.hidden?"visibility-hidden-1":"",a="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",o=(null===(i=this.mapInfos)||void 0===i?void 0:i.length)>1?"":"display-none",l=(null===(e=this.mapInfos)||void 0===e?void 0:e.length)>1?"map-height":"height-full";return t(s,{key:"446f04b49a9d744f3abae1e7ae90113f0eb0da08"},t("map-picker",{key:"b3f388a5b0d6a26951f9ae45dff7629376ff4d17",class:o,mapInfos:this.mapInfos,ref:i=>this._mapPicker=i}),t("div",{key:"f5c44c8cf0b22b496a57cd01ebfdf00c0979bebe",class:`${l} ${h}`,ref:i=>this._mapDiv=i}),t("map-tools",{key:"dab560a9cde03901087a1d136599d0fd26964dce",basemapConfig:this.basemapConfig,class:`box-shadow ${a}`,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:i=>this._mapTools=i,searchConfiguration:this._searchConfiguration,stackTools:this.stackTools,toolOrder:this.toolOrder}))}async _initModules(){const[i,t,s,e]=await o(["esri/WebMap","esri/views/MapView","esri/widgets/Home","esri/config"]);this.WebMap=i,this.MapView=t,this.Home=s,this.esriConfig=e}async _loadMap(i){var t;const s=!this._defaultWebmapHonored&&this.defaultWebmapId,e=null===(t=this.mapInfos)||void 0===t?void 0:t.filter((i=>i.id===this.defaultWebmapId)),h=JSON.stringify(i)!==JSON.stringify(this._webMapInfo);this._webMapInfo=s&&e?e[0]:!(null==i?void 0:i.id)&&this.mapInfos.length>0?this.mapInfos[0]:i;const a=this._webMapInfo.id,o=s&&(null==i?void 0:i.id)===this.defaultWebmapId;if(this._loadedId!==a&&!s||o){const i=new this.WebMap({portalItem:{id:a}});this.appProxies&&(await i.load(),await(l=i,n=this.esriConfig,d=this.appProxies,d&&d.forEach((i=>{l.allLayers.forEach((t=>{t&&t.url===i.sourceUrl&&(t.url=i.proxyUrl,t.portalItem&&t.portalItem.when((()=>{t.portalItem.url=i.proxyUrl})),n.request?.interceptors?.push({urls:i.sourceUrl,before:t=>{t.url&&t.url===i.sourceUrl&&(t.url=i.proxyUrl)}}))}))})),l)),this.mapView=new this.MapView({container:this._mapDiv,map:i,resizeAlign:"center"}),this._loadedId=a,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{this._initHome(),this.mapView.ui.add(this._mapTools,{position:this.mapWidgetsPosition,index:this.mapWidgetsIndex}),this._defaultWebmapHonored=!!o||this._defaultWebmapHonored,this.mapChanged.emit({id:a,mapView:this.mapView})}))}else s?(this._defaultWebmapHonored=!0,this._mapPicker.setMapByID(a)):h&&(this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),this.mapChanged.emit({id:a,mapView:this.mapView}));var l,n,d}_initHome(){if(this.enableHome){this._homeWidget=new this.Home({view:this.mapView}),this.mapView.ui.add(this._homeWidget,{position:this.homeZoomPosition,index:this.homeZoomIndex});const i="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";this._homeWidget.domNode.style.height=i,this._homeWidget.domNode.style.width=i}else this._homeWidget&&this.mapView.ui.remove(this._homeWidget)}get el(){return e(this)}static get watchers(){return{enableHome:["enableHomeWatchHandler"]}}};m.style=":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-1{visibility:hidden;height:1px;}.display-none{display:none}";export{b as card_manager,f as layer_table,m as map_card}