@esri/solutions-components 0.3.9 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/buffer-tools_6.cjs.entry.js +5 -2
- package/dist/cjs/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-cd8ad61e.js → calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-da276a1c.js} +60 -14
- package/dist/cjs/calcite-input-message_5.cjs.entry.js +1 -1
- package/dist/cjs/{index.es-e89ba2a1.js → index.es-176629d8.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +21 -0
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/map-select-tools/map-select-tools.js +65 -13
- package/dist/collection/components/public-notification/public-notification.js +42 -0
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +13 -5
- package/dist/collection/demos/buffer-tools.html +1 -1
- package/dist/collection/utils/interfaces.ts +6 -0
- package/dist/components/map-select-tools2.js +61 -15
- package/dist/components/public-notification.js +21 -0
- package/dist/components/refine-selection-tools2.js +5 -2
- package/dist/esm/buffer-tools_6.entry.js +5 -2
- package/dist/esm/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-ddd74bd6.js → calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-c6f63458.js} +61 -15
- package/dist/esm/calcite-input-message_5.entry.js +1 -1
- package/dist/esm/{index.es-8edafdb2.js → index.es-54a6f3a3.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/public-notification.entry.js +21 -0
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/buffer-tools.html +1 -1
- package/dist/solutions-components/{p-98884f44.js → p-1e459361.js} +1 -1
- package/dist/solutions-components/{p-238db156.js → p-80f5e33c.js} +12 -12
- package/dist/solutions-components/{p-c5341977.entry.js → p-8927862a.entry.js} +1 -1
- package/dist/solutions-components/{p-2a96314a.entry.js → p-8a0c0935.entry.js} +2 -2
- package/dist/solutions-components/p-e69c58e5.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +6 -0
- package/dist/types/components/json-editor/assets/monaco-editor/monaco.d.ts +8262 -0
- package/dist/types/components/map-select-tools/map-select-tools.d.ts +13 -1
- package/dist/types/components/public-notification/public-notification.d.ts +10 -0
- package/dist/types/components/refine-selection-tools/refine-selection-tools.d.ts +2 -2
- package/dist/types/components.d.ts +6 -2
- package/dist/types/preact.d.ts +2 -1
- package/dist/types/utils/interfaces.d.ts +5 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-15f9b0a0.entry.js +0 -6
@@ -152,6 +152,12 @@ export declare class MapSelectTools {
|
|
152
152
|
* string: A label to help uniquely identify the selection set
|
153
153
|
*/
|
154
154
|
protected _selectionLabel: string;
|
155
|
+
/**
|
156
|
+
* boolean: When false the geometries will be used for selection
|
157
|
+
* When true a list of OIDs will be used
|
158
|
+
* see https://github.com/Esri/solutions-components/issues/148
|
159
|
+
*/
|
160
|
+
protected _skipGeomQuery: boolean;
|
155
161
|
/**
|
156
162
|
* Called each time the geometries prop is changed.
|
157
163
|
*
|
@@ -201,6 +207,10 @@ export declare class MapSelectTools {
|
|
201
207
|
* Handle changes to the selection sets
|
202
208
|
*/
|
203
209
|
labelChange(event: CustomEvent): void;
|
210
|
+
/**
|
211
|
+
* Handle changes to the search configuration
|
212
|
+
*/
|
213
|
+
searchConfigurationChangeChanged(event: CustomEvent): void;
|
204
214
|
/**
|
205
215
|
* Listen to changes in the sketch graphics
|
206
216
|
*
|
@@ -327,10 +337,12 @@ export declare class MapSelectTools {
|
|
327
337
|
* @param type worflow type
|
328
338
|
* @param graphics graphics to be used for selection
|
329
339
|
* @param label selection label
|
340
|
+
* @param useGeoms indicates if the geometries should be used directly for selections
|
341
|
+
* @param oids list of IDs to select when useGeoms is false
|
330
342
|
*
|
331
343
|
* @protected
|
332
344
|
*/
|
333
|
-
protected _updateSelection(type: EWorkflowType, graphics: __esri.Graphic[], label: string): void;
|
345
|
+
protected _updateSelection(type: EWorkflowType, graphics: __esri.Graphic[], label: string, useGeoms: boolean, oids?: number[]): void;
|
334
346
|
/**
|
335
347
|
* Fetches the component's translations
|
336
348
|
*
|
@@ -171,6 +171,12 @@ export declare class PublicNotification {
|
|
171
171
|
* Called each time the mapView prop is changed.
|
172
172
|
*/
|
173
173
|
mapViewWatchHandler(v: __esri.MapView): Promise<void>;
|
174
|
+
/**
|
175
|
+
* Called each time the searchConfiguration prop is changed.
|
176
|
+
*
|
177
|
+
* @returns Promise when complete
|
178
|
+
*/
|
179
|
+
watchSearchConfigurationHandler(newValue: ISearchConfiguration, oldValue: ISearchConfiguration): Promise<void>;
|
174
180
|
/**
|
175
181
|
* Called each time the selectionSets prop is changed.
|
176
182
|
*/
|
@@ -183,6 +189,10 @@ export declare class PublicNotification {
|
|
183
189
|
* Emitted on demand when a buffer is generated.
|
184
190
|
*/
|
185
191
|
labelChange: EventEmitter<string>;
|
192
|
+
/**
|
193
|
+
* Emitted on demand when searchConfiguration gets a new value
|
194
|
+
*/
|
195
|
+
searchConfigurationChange: EventEmitter<ISearchConfiguration>;
|
186
196
|
/**
|
187
197
|
* Handle changes to the buffer distance value
|
188
198
|
*/
|
@@ -15,7 +15,7 @@
|
|
15
15
|
*/
|
16
16
|
/// <reference types="arcgis-js-api" />
|
17
17
|
import { EventEmitter, VNode } from "../../stencil-public-runtime";
|
18
|
-
import { ERefineMode, ESelectionMode, ESelectionType, IRefineOperation, ISelectionSet } from "../../utils/interfaces";
|
18
|
+
import { ERefineMode, ESelectionMode, ESelectionType, IRefineOperation, IRefineSelectionEvent, ISelectionSet } from "../../utils/interfaces";
|
19
19
|
import RefineSelectionTools_T9n from "../../assets/t9n/refine-selection-tools/resources.json";
|
20
20
|
export declare class RefineSelectionTools {
|
21
21
|
el: HTMLRefineSelectionToolsElement;
|
@@ -135,7 +135,7 @@ export declare class RefineSelectionTools {
|
|
135
135
|
/**
|
136
136
|
* Emitted on demand when selection graphics change.
|
137
137
|
*/
|
138
|
-
refineSelectionGraphicsChange: EventEmitter<
|
138
|
+
refineSelectionGraphicsChange: EventEmitter<IRefineSelectionEvent>;
|
139
139
|
/**
|
140
140
|
* Emitted on demand when selection ids change
|
141
141
|
*/
|
@@ -5,7 +5,7 @@
|
|
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 { DistanceUnit, EExpandType, ERefineMode, ESelectionMode, ESketchType, EWorkflowType, IInfoCardValues, IInventoryItem, IMapInfo, IMediaCardValues, ISearchConfiguration, ISearchResult, ISelectionSet, ISolutionSpatialReferenceInfo, ISpatialRefRepresentation, IValueChange, SelectionMode } from "./utils/interfaces";
|
8
|
+
import { DistanceUnit, EExpandType, ERefineMode, ESelectionMode, ESketchType, EWorkflowType, IInfoCardValues, IInventoryItem, IMapInfo, IMediaCardValues, IRefineSelectionEvent, ISearchConfiguration, ISearchResult, ISelectionSet, ISolutionSpatialReferenceInfo, ISpatialRefRepresentation, IValueChange, SelectionMode } from "./utils/interfaces";
|
9
9
|
import { UserSession } from "@esri/solution-common";
|
10
10
|
export namespace Components {
|
11
11
|
interface AddRecordModal {
|
@@ -1211,6 +1211,10 @@ declare namespace LocalJSX {
|
|
1211
1211
|
* Emitted on demand when a buffer is generated.
|
1212
1212
|
*/
|
1213
1213
|
"onLabelChange"?: (event: PublicNotificationCustomEvent<string>) => void;
|
1214
|
+
/**
|
1215
|
+
* Emitted on demand when searchConfiguration gets a new value
|
1216
|
+
*/
|
1217
|
+
"onSearchConfigurationChange"?: (event: PublicNotificationCustomEvent<ISearchConfiguration>) => void;
|
1214
1218
|
/**
|
1215
1219
|
* ISearchConfiguration: Configuration details for the Search widget
|
1216
1220
|
*/
|
@@ -1292,7 +1296,7 @@ declare namespace LocalJSX {
|
|
1292
1296
|
/**
|
1293
1297
|
* Emitted on demand when selection graphics change.
|
1294
1298
|
*/
|
1295
|
-
"onRefineSelectionGraphicsChange"?: (event: RefineSelectionToolsCustomEvent<
|
1299
|
+
"onRefineSelectionGraphicsChange"?: (event: RefineSelectionToolsCustomEvent<IRefineSelectionEvent>) => void;
|
1296
1300
|
/**
|
1297
1301
|
* Emitted on demand when selection ids change
|
1298
1302
|
*/
|
package/dist/types/preact.d.ts
CHANGED
@@ -466,8 +466,9 @@ declare module "preact/src/jsx" {
|
|
466
466
|
|
467
467
|
"pdf-download": JSX.SolutionsPdfDownload & JSXInternal.HTMLAttributes<HTMLSolutionsPdfDownloadElement>
|
468
468
|
|
469
|
-
"public-notification": Omit<JSX.SolutionsPublicNotification, "onLabelChange"> & JSXInternal.HTMLAttributes<HTMLSolutionsPublicNotificationElement> & {
|
469
|
+
"public-notification": Omit<JSX.SolutionsPublicNotification, "onLabelChange" | "onSearchConfigurationChange"> & JSXInternal.HTMLAttributes<HTMLSolutionsPublicNotificationElement> & {
|
470
470
|
"onlabelChange"?: (event: CustomEvent<any>) => void;
|
471
|
+
"onsearchConfigurationChange"?: (event: CustomEvent<any>) => void;
|
471
472
|
}
|
472
473
|
|
473
474
|
"refine-selection": Omit<JSX.SolutionsRefineSelection, "onSelectionSetsChanged"> & JSXInternal.HTMLAttributes<HTMLSolutionsRefineSelectionElement> & {
|
@@ -335,6 +335,11 @@ export interface ISelectionSet {
|
|
335
335
|
refineIds: IRefineIds;
|
336
336
|
redoStack?: IRefineOperation[];
|
337
337
|
undoStack?: IRefineOperation[];
|
338
|
+
skipGeomQuery?: boolean;
|
339
|
+
}
|
340
|
+
export interface IRefineSelectionEvent {
|
341
|
+
graphics: __esri.Graphic[];
|
342
|
+
useOIDs: boolean;
|
338
343
|
}
|
339
344
|
export interface IRefineIds {
|
340
345
|
addIds: number[];
|
package/package.json
CHANGED
@@ -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 s,H as e,g as a}from"./p-c2f00d41.js";import{b as l,c as n,E as d,d as o}from"./p-dbc9a5a8.js";import{l as h}from"./p-eea93a37.js";import{a as c,c as r,g as p,h as g}from"./p-cc2e20c8.js";import{s as b}from"./p-4557d5a8.js";import{g as u}from"./p-9260d75a.js";import{g as m,a as f}from"./p-fc884dd6.js";import"./p-00444009.js";import"./p-e1a4994d.js";const v=class{constructor(s){i(this,s),this.labelChange=t(this,"labelChange",7),this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.addresseeLayer=void 0,this._downloadActive=!0,this._numSelected=0,this._pageType=l.LIST,this._saveEnabled=!1,this._selectionSets=[],this._sketchType=n.INTERACTIVE,this._selectionWorkflowType=d.SEARCH,this._showLayerSelectionChangeModal=!1,this._translations=void 0}async mapViewWatchHandler(i){(null==i?void 0:i.popup)&&(this._popupsEnabled=null==i?void 0:i.popup.autoOpenEnabled)}async selectionSetsWatchHandler(i,t){i&&i!==t&&i.length>0&&0===i.filter((i=>i.workflowType!==d.REFINE)).length&&(this._selectionSets=[])}async pageTypeWatchHandler(i,t){if(this._checkPopups(),this._clearHighlight(),t!==l.SELECT&&t!==l.REFINE||await this._clearSelection(),i!==l.SELECT)return this._highlightFeatures()}distanceChanged(i){this._updateLabel(i,"distance"),this._distance=i.detail.newValue}selectionSetsChanged(i){this._selectionSets=[...i.detail]}sketchTypeChange(i){this._sketchType=i.detail}unitChanged(i){this._updateLabel(i,"unit"),this._unit=i.detail.newValue}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){const i=this._selectionSets.length>0;return s(e,null,s("calcite-shell",null,s("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getActionGroup("list-check",!1,l.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",!i,l.REFINE,this._translations.refineSelection):void 0,this._getActionGroup("file-pdf",!i,l.PDF,this._translations.downloadPDF),this._getActionGroup("file-csv",!i,l.CSV,this._translations.downloadCSV)),this._getPage(this._pageType)))}async _initModules(){const[i]=await h(["esri/geometry/geometryEngine"]);this._geometryEngine=i}_getActionGroup(i,t,e,a){return s("calcite-action-group",{class:this.showRefineSelection?"action-center w-1-4":"action-center w-1-3",layout:"horizontal"},s("calcite-action",{active:this._pageType===e,alignment:"center",class:"width-full height-full",compact:!1,disabled:t,icon:i,id:i,onClick:()=>{this._setPageType(e)},text:""}),s("calcite-tooltip",{label:"",placement:"bottom","reference-element":i},s("span",null,a)))}_setPageType(i){this._pageType=i}_getPage(i){let t;switch(i){case l.LIST:t=this._getListPage();break;case l.SELECT:t=this._getSelectPage();break;case l.REFINE:t=this._getRefinePage();break;case l.PDF:t=this._getPDFPage();break;case l.CSV:t=this._getCSVPage()}return t}_getListPage(){const i=this._selectionSets.filter((i=>i.workflowType!==d.REFINE)).length>0,t=m(this._selectionSets);return i?s("calcite-panel",null,s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:"font-bold"},this._translations.myLists)),this._getNotice(this._translations.listHasSetsTip,"padding-sides-1 padding-bottom-1"),this._getMapLayerPicker(),s("div",{class:"display-block padding-sides-1 height-1-1-2"},s("div",{class:"display-block float-left"},s("calcite-label",{alignment:"start",class:"font-bold"},this._translations.notifications)),s("div",{class:"display-block float-right"},s("calcite-input-message",{active:!0,class:"info-blue margin-top-0",scale:"m"},this._translations.uniqueCout.replace("{{n}}",t.toString())))),i?this._getSelectionSetList():s("div",{class:"info-message"},s("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this._translations.noNotifications)),s("div",{class:"display-flex padding-1"},s("calcite-button",{onClick:()=>{this._setPageType(l.SELECT)},width:"full"},this._translations.add)),this._showModal(this._showLayerSelectionChangeModal)):s("calcite-panel",null,s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:"font-bold"},this._translations.myLists)),s("div",{class:"padding-sides-1"},s("calcite-label",null,this._translations.notifications)),s("div",{class:"info-message padding-bottom-1"},s("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this._translations.noNotifications)),this._getNotice(this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1"),this._getMapLayerPicker(),s("div",{class:"display-flex padding-1"},s("calcite-button",{onClick:()=>{this._setPageType(l.SELECT)},width:"full"},this._translations.add)))}_getMapLayerPicker(){var i;return s("div",{class:"display-flex padding-sides-1"},s("calcite-label",{class:"font-bold width-full"},this._translations.addresseeLayer,s("map-layer-picker",{enabledLayerIds:this.addresseeLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>this._layerSelectionChange(i),selectedLayerIds:this.addresseeLayer?[null===(i=this.addresseeLayer)||void 0===i?void 0:i.layer.id]:[],selectionMode:"single"})))}_getSelectionSetList(){return s("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((i,t,e)=>(t.workflowType!==d.REFINE&&i.push(s("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",t.selectedIds.length.toString()),label:t.label,onClick:()=>this._gotoSelection(t,this.mapView)},this._getAction(!0,"pencil","",(i=>this._openSelection(t,i)),!1,"actions-end"),this._getAction(!0,"x","",(i=>this._deleteSelection(e,i)),!1,"actions-end"))),i)),[]))}_showModal(i){return s("calcite-modal",{"aria-labelledby":"modal-title","background-color":"grey",color:"red",open:i,scale:"s",width:"s"},s("div",{id:"modal-title",slot:"header"},this._translations.shouldProceed),s("div",{slot:"content"},this._translations.proceedInfo),s("calcite-button",{appearance:"outline",onClick:()=>this._cancelLayerChange(),slot:"secondary",width:"full"},this._translations.cancel),s("calcite-button",{onClick:()=>this._handleLayerChange(),slot:"primary",width:"full"},this._translations.proceed))}_cancelLayerChange(){this._layerSelectionChangeEvt.preventDefault(),this._layerSelectionChangeEvt.stopPropagation(),this._layerSelectionChangeEvt=void 0,this._showLayerSelectionChangeModal=!1}async _handleLayerChange(){var i,t;this._showLayerSelectionChangeModal=!1;const s=(null===(t=null===(i=this._layerSelectionChangeEvt)||void 0===i?void 0:i.detail)||void 0===t?void 0:t.length)>0?this._layerSelectionChangeEvt.detail[0]:"";await this._updateAddresseeLayer(s)}_getSelectPage(){var i,t;const e=this._selectionWorkflowType===d.SELECT?this._translations.selectLayerTip:this._selectionWorkflowType===d.SKETCH?this._sketchType===n.INTERACTIVE?this._translations.selectSketchTip:this._translations.selectLayerTip:this._translations.selectSearchTip,a=this.customLabelEnabled?"":"display-none";return s("calcite-panel",null,this._getLabel(this._translations.stepTwoFull.replace("{{layer}}",null===(i=this.addresseeLayer)||void 0===i?void 0:i.layer.title)),this._getNotice(e),s("div",{class:"padding-top-sides-1"},s("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.selectionLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,onSelectionSetChange:i=>this._updateForSelection(i),onWorkflowTypeChange:i=>this._updateForWorkflowType(i),ref:i=>{this._selectTools=i},searchConfiguration:this.searchConfiguration,selectLayerView:this.addresseeLayer,selectionSet:this._activeSelection,showBufferTools:this.showSearchSettings})),s("div",{class:"padding-sides-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},s("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),s("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedAddresses.replace("{{n}}",this._numSelected.toString()).replace("{{layer}}",(null===(t=this.addresseeLayer)||void 0===t?void 0:t.layer.title)||""))),s("div",{class:"padding-sides-1 "+a},s("calcite-label",{class:"font-bold"},"Name label",s("calcite-input",{onInput:()=>{this.labelChange.emit(this._labelName.value)},placeholder:"Insert label here...",ref:i=>{this._labelName=i},value:this._customLabel||""}))),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getRefinePage(){return s("calcite-panel",null,this._getLabel(this._translations.refineSelection),this._getNotice(this._translations.refineTip,"padding-sides-1"),s("refine-selection",{addresseeLayer:this.addresseeLayer,enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets}))}_getPDFPage(){return this._getDownloadPage(o.PDF)}_getCSVPage(){return this._getDownloadPage(o.CSV)}_getDownloadPage(i){const t=i===o.PDF;return s("calcite-panel",null,s("div",null,s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:"font-bold"},t?this._translations.pdfDownloads:this._translations.csvDownloads),s("calcite-label",null,this._translations.notifications)),this._getSelectionLists(),s("div",{class:"margin-side-1 padding-top-1 border-bottom"}),s("div",{class:"padding-top-sides-1"},s("calcite-label",{layout:"inline"},s("calcite-checkbox",{disabled:!this._downloadActive,ref:i=>{this._removeDuplicates=i}}),this._translations.removeDuplicate)),s("div",{class:t?"":"display-none"},this._getLabel(this._translations.selectPDFLabelOption,!1),s("div",{class:"padding-sides-1"},s("pdf-download",{disabled:!this._downloadActive,layerView:this.addresseeLayer,ref:i=>{this._downloadTools=i}}))),s("div",{class:"padding-1 display-flex"},s("calcite-button",{disabled:!this._downloadActive,onClick:t?()=>this._downloadPDF():()=>this._downloadCSV(),width:"full"},t?this._translations.downloadPDF:this._translations.downloadCSV))))}_getPageNavButtons(i,t,e,a,l,n){return s("div",null,s("div",{class:"display-flex padding-top-sides-1"},s("calcite-button",{disabled:t,onClick:e,width:"full"},i)),s("div",{class:"display-flex padding-top-1-2 padding-sides-1"},s("calcite-button",{appearance:"outline",disabled:l,onClick:n,width:"full"},a)))}_getNotice(i,t="padding-1"){return s("calcite-notice",{class:t,color:"green",icon:"lightbulb",open:!0},s("div",{slot:"message"},i))}_getLabel(i,t=!1){return s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:"font-bold","disable-spacing":t},i))}_getSelectionLists(){return this._selectionSets.reduce(((i,t)=>(t.workflowType!==d.REFINE&&(!this._downloadActive&&t.download&&(this._downloadActive=!0),i.push(s("div",{class:"display-flex padding-sides-1 padding-bottom-1"},s("calcite-checkbox",{checked:t.download,class:"align-center",onClick:()=>{this._toggleDownload(t.id)}}),s("calcite-list",{class:"list-border margin-start-1-2 w-100",id:"download-list"},s("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",t.selectedIds.length.toString()),disabled:!t.download,label:t.label,onClick:()=>{this._toggleDownload(t.id)}}))))),i)),[])||s("div",null)}async _toggleDownload(i){let t=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===i?!s.download:s.download,t=!!s.download||t,s))),this._downloadActive=t,await this._highlightFeatures()}_downloadPDF(){const i=f(this._getDownloadSelectionSets());this._downloadTools.downloadPDF(i,this._removeDuplicates.checked)}_downloadCSV(){const i=f(this._getDownloadSelectionSets());this._downloadTools.downloadCSV(i,this._removeDuplicates.checked)}_getDownloadSelectionSets(){return this._selectionSets.filter((i=>i.download||i.workflowType===d.REFINE))}_updateLabel(i,t){this._customLabel&&(this._customLabel=this._customLabel.replace("unit"===t?`${this._distance} ${i.detail.oldValue}`:`${i.detail.oldValue} ${this._unit}`,"unit"===t?`${this._distance} ${i.detail.newValue}`:`${i.detail.newValue} ${this._unit}`),this._labelName.value=this._customLabel,this.labelChange.emit(this._labelName.value))}_updateForWorkflowType(i){this._selectionWorkflowType=i.detail}_getAction(i,t,e,a,l=!1,n=""){return s("calcite-action",{disabled:!i,icon:t,indicator:l,onClick:a,slot:n,text:e})}_updateForSelection(i){this._numSelected=i.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),"boolean"==typeof this._popupsEnabled&&this.mapView.popup&&(this.mapView.popup.autoOpenEnabled=this._popupsEnabled),this._setPageType(l.LIST)}async _layerSelectionChange(i){var t,s,e;const a=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";a!==(null===(s=this.addresseeLayer)||void 0===s?void 0:s.layer.id)&&(this._showLayerSelectionChangeModal=void 0!==(null===(e=this.addresseeLayer)||void 0===e?void 0:e.layer.id)&&this._selectionSets.length>0,this._showLayerSelectionChangeModal?this._layerSelectionChangeEvt=i:await this._updateAddresseeLayer(a))}async _updateAddresseeLayer(i){this.addresseeLayer=await c(this.mapView,i),await this._updateSelectionSets(this.addresseeLayer)}async _updateSelectionSets(i){const t=this._selectionSets.filter((i=>i.workflowType!==d.REFINE)),s=[];return t.forEach((t=>{t.layerView=i,t.selectedIds=[],s.push(r(t,this._geometryEngine))})),Promise.all(s).then((async i=>{i.forEach(((i,s)=>{t[s].selectedIds=i})),await this._highlightFeatures(),this._selectionSets=[...t]}))}async _saveSelection(){var i,t;const s=await(null===(i=this._selectTools)||void 0===i?void 0:i.getSelection()),e=null===(t=this._selectTools)||void 0===t?void 0:t.isUpdate;return this._selectionSets=e?this._selectionSets.map((i=>i.id===s.id?s:i)):[...this._selectionSets,s],this._home()}async _clearSelection(){var i;await(null===(i=this._selectTools)||void 0===i?void 0:i.clearSelection()),this._numSelected=0,this._activeSelection=void 0,this._customLabel=void 0,this._distance=void 0,this._unit=void 0}_deleteSelection(i,t){return t.stopPropagation(),this._selectionSets=this._selectionSets.filter(((t,s)=>{if(s!==i)return t})),this._highlightFeatures()}_gotoSelection(i,t){p(i.selectedIds,i.layerView,t,this.featureHighlightEnabled,this.featureEffect)}_openSelection(i,t){t.stopPropagation(),this._activeSelection=i,this._distance=this._activeSelection.distance,this._unit=this._activeSelection.unit,this._customLabel=this._activeSelection.label,this._pageType=l.SELECT}async _highlightFeatures(){this._clearHighlight();const i=f(this._selectionSets);i.length>0&&(b.highlightHandle=await g(i,this.addresseeLayer,this.mapView))}_checkPopups(){var i;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(i=this.mapView)||void 0===i?void 0:i.popup.autoOpenEnabled)}_clearHighlight(){var i;b&&b.highlightHandle&&(null===(i=b.highlightHandle)||void 0===i||i.remove())}async _getTranslations(){const i=await u(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_selectionSets:["selectionSetsWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};v.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-3{width:33.3%}.w-1-4{width:25%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.main-label{float:left}html[dir="rtl"] .main-label{float:right}.back-label:hover{cursor:pointer;color:var(--calcite-ui-brand-hover)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.margin-side-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.border-top{border-top:1px solid var(--calcite-ui-border-2)}.w-100{width:100%}.w-50{width:50%}.padding-1-2{padding:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.num-selected{align-items:center;display:flex}';export{v as public_notification}
|