@esri/solutions-components 0.3.3 → 0.3.5
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 +21 -2
- package/dist/cjs/calcite-input-message_5.cjs.entry.js +33 -13
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +11 -19
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +21 -2
- package/dist/collection/components/map-select-tools/map-select-tools.js +75 -13
- package/dist/collection/components/public-notification/public-notification.js +81 -19
- package/dist/collection/demos/map-layer-picker.html +1 -1
- package/dist/collection/demos/new-public-notification.html +10 -7
- package/dist/components/map-draw-tools2.js +21 -2
- package/dist/components/map-select-tools2.js +36 -14
- package/dist/components/public-notification.js +15 -20
- package/dist/esm/buffer-tools_6.entry.js +21 -2
- package/dist/esm/calcite-input-message_5.entry.js +33 -13
- package/dist/esm/loader.js +1 -1
- package/dist/esm/public-notification.entry.js +12 -20
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/map-layer-picker.html +1 -1
- package/dist/solutions-components/demos/new-public-notification.html +10 -7
- package/dist/solutions-components/p-778c0a36.entry.js +17 -0
- package/dist/solutions-components/{p-fc9609e6.entry.js → p-877dd0dc.entry.js} +1 -1
- package/dist/solutions-components/p-bd4d0773.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/map-draw-tools/map-draw-tools.d.ts +4 -0
- package/dist/types/components/map-select-tools/map-select-tools.d.ts +18 -0
- package/dist/types/components/public-notification/public-notification.d.ts +22 -2
- package/dist/types/components.d.ts +48 -0
- package/dist/types/preact.d.ts +3 -1
- package/package.json +1 -1
- package/dist/solutions-components/p-07593958.entry.js +0 -6
- package/dist/solutions-components/p-bfa95147.entry.js +0 -17
@@ -19,6 +19,14 @@ import { DistanceUnit, ISearchConfiguration, EWorkflowType, ISelectionSet, ESket
|
|
19
19
|
import MapSelectTools_T9n from "../../assets/t9n/map-select-tools/resources.json";
|
20
20
|
export declare class MapSelectTools {
|
21
21
|
el: HTMLMapSelectToolsElement;
|
22
|
+
/**
|
23
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
24
|
+
*/
|
25
|
+
bufferColor: any;
|
26
|
+
/**
|
27
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
28
|
+
*/
|
29
|
+
bufferOutlineColor: any;
|
22
30
|
/**
|
23
31
|
* string[]: Optional list of enabled layer ids
|
24
32
|
* If empty all layers will be available
|
@@ -183,6 +191,10 @@ export declare class MapSelectTools {
|
|
183
191
|
*
|
184
192
|
*/
|
185
193
|
workflowTypeChange: EventEmitter<EWorkflowType>;
|
194
|
+
/**
|
195
|
+
* Handle changes to the selection sets
|
196
|
+
*/
|
197
|
+
labelChange(event: CustomEvent): void;
|
186
198
|
/**
|
187
199
|
* Listen to changes in the sketch graphics
|
188
200
|
*
|
@@ -225,6 +237,12 @@ export declare class MapSelectTools {
|
|
225
237
|
* @protected
|
226
238
|
*/
|
227
239
|
protected _initSelectionSet(): void;
|
240
|
+
/**
|
241
|
+
* Get the default label base when the user has not provided a value
|
242
|
+
*
|
243
|
+
* @protected
|
244
|
+
*/
|
245
|
+
protected _getSelectionBaseLabel(): string;
|
228
246
|
/**
|
229
247
|
* Initialize the search widget
|
230
248
|
*
|
@@ -14,7 +14,7 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
/// <reference types="arcgis-js-api" />
|
17
|
-
import { VNode } from "../../stencil-public-runtime";
|
17
|
+
import { EventEmitter, VNode } from "../../stencil-public-runtime";
|
18
18
|
import { DistanceUnit, EExportType, EPageType, ESketchType, EWorkflowType, IExportOptions, ISearchConfiguration, ISelectionSet } from "../../utils/interfaces";
|
19
19
|
import NewPublicNotification_T9n from "../../assets/t9n/public-notification/resources.json";
|
20
20
|
export declare class PublicNotification {
|
@@ -23,6 +23,18 @@ export declare class PublicNotification {
|
|
23
23
|
* string[]: List of layer ids that should be shown as potential addressee layers
|
24
24
|
*/
|
25
25
|
addresseeLayerIds: string[];
|
26
|
+
/**
|
27
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
28
|
+
*/
|
29
|
+
bufferColor: any;
|
30
|
+
/**
|
31
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
32
|
+
*/
|
33
|
+
bufferOutlineColor: any;
|
34
|
+
/**
|
35
|
+
* boolean: When true the user can define a name for each notification list
|
36
|
+
*/
|
37
|
+
customLabelEnabled: boolean;
|
26
38
|
/**
|
27
39
|
* number: The default value to show for the buffer distance
|
28
40
|
*/
|
@@ -128,6 +140,10 @@ export declare class PublicNotification {
|
|
128
140
|
* esri/geometry/geometryEngine: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html
|
129
141
|
*/
|
130
142
|
protected _geometryEngine: __esri.geometryEngine;
|
143
|
+
/**
|
144
|
+
* CustomEvent: Used to prevent default behavior of layer selection change
|
145
|
+
*/
|
146
|
+
protected _labelName: HTMLCalciteInputElement;
|
131
147
|
/**
|
132
148
|
* CustomEvent: Used to prevent default behavior of layer selection change
|
133
149
|
*/
|
@@ -156,6 +172,10 @@ export declare class PublicNotification {
|
|
156
172
|
* Called each time the pageType prop is changed.
|
157
173
|
*/
|
158
174
|
pageTypeWatchHandler(pageType: EPageType, oldPageType: EPageType): Promise<void>;
|
175
|
+
/**
|
176
|
+
* Emitted on demand when a buffer is generated.
|
177
|
+
*/
|
178
|
+
labelChange: EventEmitter<string>;
|
159
179
|
/**
|
160
180
|
* Handle changes to the selection sets
|
161
181
|
*/
|
@@ -327,7 +347,7 @@ export declare class PublicNotification {
|
|
327
347
|
* Get selection set list node with checkbox for Download pages
|
328
348
|
*
|
329
349
|
* @returns the list node
|
330
|
-
* @
|
350
|
+
* @protectedlabel
|
331
351
|
*/
|
332
352
|
protected _getSelectionLists(): VNode;
|
333
353
|
/**
|
@@ -195,6 +195,14 @@ export namespace Components {
|
|
195
195
|
"searchConfiguration": ISearchConfiguration;
|
196
196
|
}
|
197
197
|
interface MapSelectTools {
|
198
|
+
/**
|
199
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
200
|
+
*/
|
201
|
+
"bufferColor": any;
|
202
|
+
/**
|
203
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
204
|
+
*/
|
205
|
+
"bufferOutlineColor": any;
|
198
206
|
/**
|
199
207
|
* Clear any selection results
|
200
208
|
* @returns Promise when the results have been cleared
|
@@ -287,6 +295,18 @@ export namespace Components {
|
|
287
295
|
* string[]: List of layer ids that should be shown as potential addressee layers
|
288
296
|
*/
|
289
297
|
"addresseeLayerIds": string[];
|
298
|
+
/**
|
299
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
300
|
+
*/
|
301
|
+
"bufferColor": any;
|
302
|
+
/**
|
303
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
304
|
+
*/
|
305
|
+
"bufferOutlineColor": any;
|
306
|
+
/**
|
307
|
+
* boolean: When true the user can define a name for each notification list
|
308
|
+
*/
|
309
|
+
"customLabelEnabled": boolean;
|
290
310
|
/**
|
291
311
|
* number: The default value to show for the buffer distance
|
292
312
|
*/
|
@@ -599,6 +619,10 @@ export interface MapSelectToolsCustomEvent<T> extends CustomEvent<T> {
|
|
599
619
|
detail: T;
|
600
620
|
target: HTMLMapSelectToolsElement;
|
601
621
|
}
|
622
|
+
export interface PublicNotificationCustomEvent<T> extends CustomEvent<T> {
|
623
|
+
detail: T;
|
624
|
+
target: HTMLPublicNotificationElement;
|
625
|
+
}
|
602
626
|
export interface RefineSelectionCustomEvent<T> extends CustomEvent<T> {
|
603
627
|
detail: T;
|
604
628
|
target: HTMLRefineSelectionElement;
|
@@ -1058,6 +1082,14 @@ declare namespace LocalJSX {
|
|
1058
1082
|
"searchConfiguration"?: ISearchConfiguration;
|
1059
1083
|
}
|
1060
1084
|
interface MapSelectTools {
|
1085
|
+
/**
|
1086
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
1087
|
+
*/
|
1088
|
+
"bufferColor"?: any;
|
1089
|
+
/**
|
1090
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
1091
|
+
*/
|
1092
|
+
"bufferOutlineColor"?: any;
|
1061
1093
|
/**
|
1062
1094
|
* number: The default value to show for the buffer distance
|
1063
1095
|
*/
|
@@ -1138,6 +1170,18 @@ declare namespace LocalJSX {
|
|
1138
1170
|
* string[]: List of layer ids that should be shown as potential addressee layers
|
1139
1171
|
*/
|
1140
1172
|
"addresseeLayerIds"?: string[];
|
1173
|
+
/**
|
1174
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
1175
|
+
*/
|
1176
|
+
"bufferColor"?: any;
|
1177
|
+
/**
|
1178
|
+
* string | number[] | object with r, g, b, a: https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html
|
1179
|
+
*/
|
1180
|
+
"bufferOutlineColor"?: any;
|
1181
|
+
/**
|
1182
|
+
* boolean: When true the user can define a name for each notification list
|
1183
|
+
*/
|
1184
|
+
"customLabelEnabled"?: boolean;
|
1141
1185
|
/**
|
1142
1186
|
* number: The default value to show for the buffer distance
|
1143
1187
|
*/
|
@@ -1166,6 +1210,10 @@ declare namespace LocalJSX {
|
|
1166
1210
|
* string: The value to show for no results when left empty the default text "0 selected features from {layerTitle}" will be shown
|
1167
1211
|
*/
|
1168
1212
|
"noResultText"?: string;
|
1213
|
+
/**
|
1214
|
+
* Emitted on demand when a buffer is generated.
|
1215
|
+
*/
|
1216
|
+
"onLabelChange"?: (event: PublicNotificationCustomEvent<string>) => void;
|
1169
1217
|
/**
|
1170
1218
|
* ISearchConfiguration: Configuration details for the Search widget
|
1171
1219
|
*/
|
package/dist/types/preact.d.ts
CHANGED
@@ -464,7 +464,9 @@ declare module "preact/src/jsx" {
|
|
464
464
|
|
465
465
|
"pdf-download": JSX.SolutionsPdfDownload & JSXInternal.HTMLAttributes<HTMLSolutionsPdfDownloadElement>
|
466
466
|
|
467
|
-
"public-notification": JSX.SolutionsPublicNotification & JSXInternal.HTMLAttributes<HTMLSolutionsPublicNotificationElement>
|
467
|
+
"public-notification": Omit<JSX.SolutionsPublicNotification, "onLabelChange"> & JSXInternal.HTMLAttributes<HTMLSolutionsPublicNotificationElement> & {
|
468
|
+
"onlabelChange"?: (event: CustomEvent<any>) => void;
|
469
|
+
}
|
468
470
|
|
469
471
|
"refine-selection": Omit<JSX.SolutionsRefineSelection, "onSelectionSetsChanged"> & JSXInternal.HTMLAttributes<HTMLSolutionsRefineSelectionElement> & {
|
470
472
|
"onselectionSetsChanged"?: (event: CustomEvent<any>) => void;
|
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,h as t,H as e,g as s}from"./p-c023e6a1.js";import{b as a,c as l,E as n,d as o}from"./p-be41429f.js";import{l as d}from"./p-1c567f3a.js";import{a as c,c as h,g as r,h as p}from"./p-3fa9b3c8.js";import{s as g}from"./p-9c1ebc90.js";import{g as b}from"./p-44da2507.js";import{g as u,a as m}from"./p-fc884dd6.js";import"./p-4307dacd.js";import"./p-3b010ce1.js";const v=class{constructor(t){i(this,t),this.addresseeLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.exportOptions=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=a.LIST,this._saveEnabled=!1,this._selectionSets=[],this._sketchType=l.INTERACTIVE,this._selectionWorkflowType=n.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!==n.REFINE)).length&&(this._selectionSets=[])}async pageTypeWatchHandler(i,t){if(this._checkPopups(),this._clearHighlight(),t!==a.SELECT&&t!==a.REFINE||await this._clearSelection(),i!==a.SELECT)return this._highlightFeatures()}selectionSetsChanged(i){this._selectionSets=[...i.detail]}sketchTypeChange(i){this._sketchType=i.detail}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){var i,s,l,n,o,d;const c=this._selectionSets.length>0,h="boolean"!=typeof(null===(s=null===(i=this.exportOptions)||void 0===i?void 0:i.csvOptions)||void 0===s?void 0:s.enabled)||(null===(l=this.exportOptions)||void 0===l?void 0:l.csvOptions.enabled),r="boolean"!=typeof(null===(o=null===(n=this.exportOptions)||void 0===n?void 0:n.pdfOptions)||void 0===o?void 0:o.enabled)||(null===(d=this.exportOptions)||void 0===d?void 0:d.pdfOptions.enabled);return t(e,null,t("calcite-shell",null,t("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getActionGroup("list-check",!1,a.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",!c,a.REFINE,this._translations.refineSelection):void 0,r?this._getActionGroup("file-pdf",!c,a.PDF,this._translations.downloadPDF):void 0,h?this._getActionGroup("file-csv",!c,a.CSV,this._translations.downloadCSV):void 0),this._getPage(this._pageType)))}async _initModules(){const[i]=await d(["esri/geometry/geometryEngine"]);this._geometryEngine=i}_getActionGroup(i,e,s,a){return t("calcite-action-group",{class:this.showRefineSelection?"action-center w-1-4":"action-center w-1-3",layout:"horizontal"},t("calcite-action",{active:this._pageType===s,alignment:"center",class:"width-full height-full",compact:!1,disabled:e,icon:i,id:i,onClick:()=>{this._setPageType(s)},text:""}),t("calcite-tooltip",{label:"",placement:"bottom","reference-element":i},t("span",null,a)))}_setPageType(i){this._pageType=i}_getPage(i){let t;switch(i){case a.LIST:t=this._getListPage();break;case a.SELECT:t=this._getSelectPage();break;case a.REFINE:t=this._getRefinePage();break;case a.PDF:t=this._getPDFPage();break;case a.CSV:t=this._getCSVPage()}return t}_getListPage(){const i=this._selectionSets.filter((i=>i.workflowType!==n.REFINE)).length>0,e=u(this._selectionSets);return i?t("calcite-panel",null,t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold"},this._translations.myLists)),this._getNotice(this._translations.listHasSetsTip,"padding-sides-1 padding-bottom-1"),this._getMapLayerPicker(),t("div",{class:"padding-sides-1 height-1-1-2"},t("div",{class:"position-left"},t("calcite-label",{alignment:"start",class:"font-bold"},this._translations.notifications)),t("div",{class:"position-right"},t("calcite-input-message",{active:!0,class:"info-blue margin-top-0",scale:"m"},this._translations.uniqueCout.replace("{{n}}",e.toString())))),i?this._getSelectionSetList():t("div",{class:"info-message"},t("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this._translations.noNotifications)),t("div",{class:"display-flex padding-1"},t("calcite-button",{onClick:()=>{this._setPageType(a.SELECT)},width:"full"},this._translations.add)),this._showModal(this._showLayerSelectionChangeModal)):t("calcite-panel",null,t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold"},this._translations.myLists)),t("div",{class:"padding-sides-1"},t("calcite-label",null,this._translations.notifications)),t("div",{class:"info-message padding-bottom-1"},t("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(),t("div",{class:"display-flex padding-1"},t("calcite-button",{onClick:()=>{this._setPageType(a.SELECT)},width:"full"},this._translations.add)))}_getMapLayerPicker(){var i;return t("div",{class:"display-flex padding-sides-1"},t("calcite-label",{class:"font-bold width-full"},this._translations.addresseeLayer,t("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 t("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((i,e,s)=>(e.workflowType!==n.REFINE&&i.push(t("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",e.selectedIds.length.toString()),label:e.label,onClick:()=>this._gotoSelection(e,this.mapView)},this._getAction(!0,"pencil","",(i=>this._openSelection(e,i)),!1,"actions-end"),this._getAction(!0,"x","",(i=>this._deleteSelection(s,i)),!1,"actions-end"))),i)),[]))}_showModal(i){return t("calcite-modal",{"aria-labelledby":"modal-title","background-color":"grey",color:"red",open:i,scale:"s",width:"s"},t("div",{id:"modal-title",slot:"header"},this._translations.shouldProceed),t("div",{slot:"content"},this._translations.proceedInfo),t("calcite-button",{appearance:"outline",onClick:()=>this._cancelLayerChange(),slot:"secondary",width:"full"},this._translations.cancel),t("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 e=(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(e)}_getSelectPage(){var i,e;const s=this._selectionWorkflowType===n.SELECT?this._translations.selectLayerTip:this._selectionWorkflowType===n.SKETCH?this._sketchType===l.INTERACTIVE?this._translations.selectSketchTip:this._translations.selectLayerTip:this._translations.selectSearchTip;return t("calcite-panel",null,this._getLabel(this._translations.stepTwoFull.replace("{{layer}}",null===(i=this.addresseeLayer)||void 0===i?void 0:i.layer.title)),this._getNotice(s),t("div",{class:"padding-1"},t("map-select-tools",{class:"font-bold",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})),t("div",{class:"padding-sides-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},t("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),t("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===(e=this.addresseeLayer)||void 0===e?void 0:e.layer.title)||""))),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getRefinePage(){return t("calcite-panel",null,this._getLabel(this._translations.refineSelection),this._getNotice(this._translations.refineTip,"padding-sides-1"),t("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){var e,s;const a=i===o.PDF,l=(null===(e=this.exportOptions)||void 0===e?void 0:e.pdfOptions.enabledSizeValues.length)>1;return t("calcite-panel",null,t("div",null,t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold"},a?this._translations.pdfDownloads:this._translations.csvDownloads),t("calcite-label",null,this._translations.notifications)),this._getSelectionLists(),t("div",{class:"margin-side-1 padding-top-1 border-bottom"}),t("div",{class:"padding-top-sides-1"},t("calcite-label",{layout:"inline"},t("calcite-checkbox",{disabled:!this._downloadActive,ref:i=>{this._removeDuplicates=i}}),this._translations.removeDuplicate)),t("div",{class:a&&l?"":"display-none"},this._getLabel(this._translations.selectPDFLabelOption,!1),t("div",{class:"padding-sides-1"},t("pdf-download",{disabled:!this._downloadActive,enabledSizeValues:null===(s=this.exportOptions)||void 0===s?void 0:s.pdfOptions.enabledSizeValues,layerView:this.addresseeLayer,ref:i=>{this._downloadTools=i}}))),t("div",{class:"padding-1 display-flex"},t("calcite-button",{disabled:!this._downloadActive,onClick:a?()=>this._downloadPDF():()=>this._downloadCSV(),width:"full"},a?this._translations.downloadPDF:this._translations.downloadCSV))))}_getPageNavButtons(i,e,s,a,l,n){return t("div",null,t("div",{class:"display-flex padding-top-sides-1"},t("calcite-button",{disabled:e,onClick:s,width:"full"},i)),t("div",{class:"display-flex padding-top-1-2 padding-sides-1"},t("calcite-button",{appearance:"outline",disabled:l,onClick:n,width:"full"},a)))}_getNotice(i,e="padding-1"){return t("calcite-notice",{class:e,color:"green",icon:"lightbulb",open:!0},t("div",{slot:"message"},i))}_getLabel(i,e=!1){return t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold","disable-spacing":e},i))}_getSelectionLists(){return this._selectionSets.reduce(((i,e)=>(e.workflowType!==n.REFINE&&(!this._downloadActive&&e.download&&(this._downloadActive=!0),i.push(t("div",{class:"display-flex padding-sides-1 padding-bottom-1"},t("calcite-checkbox",{checked:e.download,onClick:()=>{this._toggleDownload(e.id)}}),t("calcite-list",{class:"list-border margin-start-1-2 w-100",id:"download-list"},t("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",e.selectedIds.length.toString()),disabled:!e.download,label:e.label,onClick:()=>{this._toggleDownload(e.id)}}))))),i)),[])||t("div",null)}async _toggleDownload(i){let t=!1;this._selectionSets=this._selectionSets.map((e=>(e.download=e.id===i?!e.download:e.download,t=!!e.download||t,e))),this._downloadActive=t,await this._highlightFeatures()}_downloadPDF(){const i=m(this._getDownloadSelectionSets());this._downloadTools.downloadPDF(i,this._removeDuplicates.checked)}_downloadCSV(){var i;const t=m(this._getDownloadSelectionSets());this._downloadTools.downloadCSV(t,this._removeDuplicates.checked,null===(i=this.exportOptions)||void 0===i?void 0:i.csvOptions.addColumnTitle)}_getDownloadSelectionSets(){return this._selectionSets.filter((i=>i.download||i.workflowType===n.REFINE))}_updateForWorkflowType(i){this._selectionWorkflowType=i.detail}_getAction(i,e,s,a,l=!1,n=""){return t("calcite-action",{disabled:!i,icon:e,indicator:l,onClick:a,slot:n,text:s})}_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(a.LIST)}async _layerSelectionChange(i){var t,e,s;const a=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";a!==(null===(e=this.addresseeLayer)||void 0===e?void 0:e.layer.id)&&(this._showLayerSelectionChangeModal=void 0!==(null===(s=this.addresseeLayer)||void 0===s?void 0:s.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!==n.REFINE)),e=[];return t.forEach((t=>{t.layerView=i,t.selectedIds=[],e.push(h(t,this._geometryEngine))})),Promise.all(e).then((async i=>{i.forEach(((i,e)=>{t[e].selectedIds=i})),await this._highlightFeatures(),this._selectionSets=[...t]}))}async _saveSelection(){var i,t;const e=await(null===(i=this._selectTools)||void 0===i?void 0:i.getSelection()),s=null===(t=this._selectTools)||void 0===t?void 0:t.isUpdate;return this._selectionSets=s?this._selectionSets.map((i=>i.id===e.id?e:i)):[...this._selectionSets,e],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}_deleteSelection(i,t){return t.stopPropagation(),this._selectionSets=this._selectionSets.filter(((t,e)=>{if(e!==i)return t})),this._highlightFeatures()}_gotoSelection(i,t){r(i.selectedIds,i.layerView,t,this.featureHighlightEnabled,this.featureEffect)}_openSelection(i,t){t.stopPropagation(),this._activeSelection=i,this._pageType=a.SELECT}async _highlightFeatures(){this._clearHighlight();const i=m(this._selectionSets);i.length>0&&(g.highlightHandle=await p(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;g&&g.highlightHandle&&(null===(i=g.highlightHandle)||void 0===i||i.remove())}async _getTranslations(){const i=await b(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_selectionSets:["selectionSetsWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};v.style=':host{display:block;--calcite-input-message-spacing-value:0}.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}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.position-left{position:absolute;left:1rem}.position-left[dir="rtl"]{position:absolute;right:1rem}.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}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Copyright 2022 Esri
|
3
|
-
* Licensed under the Apache License, Version 2.0
|
4
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
-
*/
|
6
|
-
import{r as i,h as t,H as e,g as a,c as s}from"./p-c023e6a1.js";import{s as n,g as o,a as l}from"./p-83166522.js";import{S as c}from"./p-6fe17794.js";import{c as r,d as h}from"./p-ea534300.js";import{l as d}from"./p-1c567f3a.js";import{g as m,h as p,d as g,e as u}from"./p-3fa9b3c8.js";import{E as v,f as b,g as f,c as y}from"./p-be41429f.js";import{s as w}from"./p-9c1ebc90.js";import{g as k}from"./p-44da2507.js";import{e as x}from"./p-b668daf8.js";import{a as D,g as _}from"./p-fc884dd6.js";import"./p-729708a3.js";import"./p-a80b3880.js";import"./p-9a9955db.js";import"./p-4307dacd.js";import"./p-3b010ce1.js";
|
7
|
-
/*!
|
8
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
|
-
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
10
|
-
* v1.0.0-beta.97
|
11
|
-
*/var z;!function(i){i.valid="check-circle",i.invalid="exclamation-mark-triangle",i.idle="information"}(z||(z={}));const S=class{constructor(t){i(this,t),this.active=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=n(z,this.icon,this.status)}connectedCallback(){this.status=o(this.el,"status",this.status),this.scale=o(this.el,"scale",this.scale),this.requestedIcon=n(z,this.icon,this.status)}render(){return t(e,{"calcite-hydrated-hidden":!this.active},this.renderIcon(this.requestedIcon),t("slot",null))}renderIcon(i){if(i)return t("calcite-icon",{class:"calcite-input-message-icon",icon:i,scale:"s"})}get el(){return a(this)}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}};S.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([active][scale=m]),:host([active][scale=l]){--calcite-input-message-spacing-value:0.25rem}:host{visibility:hidden;box-sizing:border-box;display:flex;block-size:0px;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([active]){visibility:visible;block-size:auto;opacity:1;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([active][scale=m]),:host([active][scale=l]){-webkit-margin-before:var(--calcite-input-message-spacing-value);margin-block-start:var(--calcite-input-message-spacing-value)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-ui-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-ui-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-ui-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-ui-brand)}:host([status][active]){color:var(--calcite-ui-text-1)}:host([status][scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([status][scale=m]){-webkit-margin-before:0.25rem;margin-block-start:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([status][scale=l]){-webkit-margin-before:0.25rem;margin-block-start:0.25rem;font-size:var(--calcite-font-size--1);line-height:1rem}";
|
12
|
-
/*!
|
13
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
14
|
-
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
15
|
-
* v1.0.0-beta.97
|
16
|
-
*/
|
17
|
-
const P="actions-end",L=class{constructor(t){i(this,t),this.calciteNoticeClose=s(this,"calciteNoticeClose",6),this.calciteNoticeOpen=s(this,"calciteNoticeOpen",6),this.active=!1,this.open=!1,this.color="blue",this.dismissible=!1,this.closable=!1,this.intlClose="Close",this.scale="m",this.width="auto",this.close=()=>{this.open=!1,this.calciteNoticeClose.emit()}}activeHandler(i){this.open=i}openHandler(i){this.active=i}handleDismissible(i){this.closable=i}handleClosable(i){this.dismissible=i}updateRequestedIcon(){this.requestedIcon=n(c,this.icon,this.color)}connectedCallback(){r(this);const i=this.active||this.open;i&&(this.activeHandler(i),this.openHandler(i)),this.dismissible&&this.handleDismissible(this.dismissible),this.closable&&this.handleClosable(this.closable)}disconnectedCallback(){h(this)}componentWillLoad(){this.requestedIcon=n(c,this.icon,this.color)}render(){const{el:i}=this,e=t("button",{"aria-label":this.intlClose,class:"notice-close",onClick:this.close,ref:i=>this.closeButton=i},t("calcite-icon",{icon:"x",scale:"l"===this.scale?"m":"s"})),a=l(i,P);return t("div",{class:"container"},this.requestedIcon?t("div",{class:"notice-icon"},t("calcite-icon",{icon:this.requestedIcon,scale:"l"===this.scale?"m":"s"})):null,t("div",{class:"notice-content"},t("slot",{name:"title"}),t("slot",{name:"message"}),t("slot",{name:"link"})),a?t("div",{class:"actions-end"},t("slot",{name:P})):null,this.closable?e:null)}async setFocus(){const i=this.el.querySelector("calcite-link");(this.closeButton||i)&&(i?i.setFocus():this.closeButton&&this.closeButton.focus())}get el(){return a(this)}static get watchers(){return{active:["activeHandler"],open:["openHandler"],dismissible:["handleDismissible"],closable:["handleClosable"],icon:["updateRequestedIcon"],color:["updateRequestedIcon"]}}};L.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;-webkit-border-start:0px solid;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);-webkit-margin-end:var(--calcite-notice-spacing-token-small);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){-webkit-padding-start:var(--calcite-notice-spacing-token-large);padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([color=blue]) .container{border-color:var(--calcite-ui-brand)}:host([color=blue]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([color=red]) .container{border-color:var(--calcite-ui-danger)}:host([color=red]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([color=yellow]) .container{border-color:var(--calcite-ui-warning)}:host([color=yellow]) .container .notice-icon{color:var(--calcite-ui-warning)}:host([color=green]) .container{border-color:var(--calcite-ui-success)}:host([color=green]) .container .notice-icon{color:var(--calcite-ui-success)}";const I=class{constructor(t){i(this,t),this.selectionSetChange=s(this,"selectionSetChange",7),this.sketchTypeChange=s(this,"sketchTypeChange",7),this.workflowTypeChange=s(this,"workflowTypeChange",7),this._selectedIds=[],this._selectionLabel="",this.enabledLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=void 0,this.isUpdate=!1,this.mapView=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectLayerView=void 0,this.showBufferTools=!0,this._layerSelectChecked=void 0,this._searchTerm=void 0,this._translations=void 0,this._workflowType=void 0}async watchGeometriesHandler(i,t){if(i!==t){if(i.length>0)return this._geomQuery(this.geometries);if(0===i.length)return this._clearResults(!0,!0)}}async workflowTypeHandler(i,t){i!==t&&(this.mapView.popup.autoOpenEnabled=["SELECT","SKETCH","REFINE"].indexOf(i)<0,this.workflowTypeChange.emit(i))}async clearSelection(){return this._clearResults()}async getSelection(){return{id:this.isUpdate?this.selectionSet.id:Date.now(),workflowType:this._workflowType,searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.distance,download:!0,unit:this._bufferTools.unit,label:this._workflowType===v.SEARCH?this._selectionLabel:`${this._selectionLabel} ${this._bufferTools.distance} ${this._bufferTools.unit}`,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,refineSelectLayers:this._refineTools.layerViews}}sketchGraphicsChange(i){this._updateSelection(v.SKETCH,i.detail,this._translations.sketch)}refineSelectionGraphicsChange(i){const t=i.detail;this._updateSelection(v.SELECT,t,this._translations.select);const e=Array.isArray(t)?t.map((i=>i.attributes[i.layer.objectIdField])):[];return this._highlightFeatures(e)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){return this._init()}render(){var i,a;const s=this._workflowType===v.SEARCH,n=s?" div-visible-search":" div-not-visible",o=this._workflowType===v.SKETCH||this._workflowType===v.SELECT,l=this.showBufferTools?"search-distance":"div-not-visible",c=this._layerSelectChecked&&!s?" div-visible":" div-not-visible",r=this._layerSelectChecked||s?" div-not-visible":" div-visible",h=s?"div-not-visible":"div-visible";return t(e,null,t("div",{class:"padding-bottom-1"},t("calcite-radio-group",{class:"w-100",onCalciteRadioGroupChange:i=>this._workflowChange(i)},t("calcite-radio-group-item",{checked:s,class:"w-50 end-border",value:v.SEARCH},this._translations.search),t("calcite-radio-group-item",{checked:o,class:"w-50",value:v.SKETCH},this._translations.sketch))),t("div",{class:n},t("div",{class:"search-widget",ref:i=>{this._searchElement=i}})),t("div",{class:h},t("calcite-label",{layout:"inline"},t("calcite-checkbox",{onCalciteCheckboxChange:()=>this._layerSelectChanged(),ref:i=>this._selectFromLayerElement=i}),"Use layer features")),t("div",{class:r},t("map-draw-tools",{active:!0,border:!0,mapView:this.mapView,ref:i=>{this._drawTools=i}})),t("div",{class:c},t("refine-selection-tools",{active:!0,border:!0,enabledLayerIds:this.enabledLayerIds,layerViews:this._refineSelectLayers,mapView:this.mapView,mode:b.ADD,ref:i=>{this._refineTools=i},refineMode:f.SUBSET})),t("calcite-label",{class:l},this._translations.searchDistance,t("buffer-tools",{distance:(null===(i=this.selectionSet)||void 0===i?void 0:i.distance)||this.defaultBufferDistance,geometries:this.geometries,onBufferComplete:i=>this._bufferComplete(i),ref:i=>this._bufferTools=i,unit:(null===(a=this.selectionSet)||void 0===a?void 0:a.unit)||this.defaultBufferUnit})),t("slot",null))}async _initModules(){const[i,t,e,a,s]=await d(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=i,this.Graphic=t,this.Search=e,this._geometryEngine=a,this.FeatureLayer=s}async _init(){this._initGraphicsLayer(),this._initSelectionSet(),this._initSearchWidget()}_initSelectionSet(){var i,t,e,a,s,n,o;this.selectionSet?(this._searchTerm=null===(t=null===(i=this.selectionSet)||void 0===i?void 0:i.searchResult)||void 0===t?void 0:t.name,this._workflowType=null===(e=this.selectionSet)||void 0===e?void 0:e.workflowType,this._searchResult=null===(a=this.selectionSet)||void 0===a?void 0:a.searchResult,this._refineSelectLayers=null===(s=this.selectionSet)||void 0===s?void 0:s.refineSelectLayers,this.geometries=[...null===(n=this.selectionSet)||void 0===n?void 0:n.geometries],this._selectionLabel=this._workflowType===v.SKETCH?this._translations.sketch:this._workflowType===v.SELECT?this._translations.select:null===(o=this.selectionSet)||void 0===o?void 0:o.label,m(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1)):this._workflowType=v.SEARCH}_initSearchWidget(){if(this.mapView&&this._searchElement){const i=this._getSearchConfig(this.searchConfiguration,this.mapView),t=Object.assign({view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm},i);this._searchWidget=new this.Search(t),this._searchWidget.on("search-clear",(()=>{this._clearResults(!1)})),this._searchWidget.on("select-result",(i=>{var t;this._clearResults(!1),i.result&&(this._searchResult=i.result,this._updateSelection(v.SEARCH,[i.result.feature],null===(t=null==i?void 0:i.result)||void 0===t?void 0:t.name))}))}}_getSearchConfig(i,t){var e;const a=null==i?void 0:i.sources;return a&&a.forEach((i=>{var e,a,s;if(i.hasOwnProperty("layer")){const n=i,o=(null===(e=n.layer)||void 0===e?void 0:e.id)?t.map.findLayerById(n.layer.id):null;o?n.layer=o:(null===(a=null==n?void 0:n.layer)||void 0===a?void 0:a.url)&&(n.layer=new this.FeatureLayer(null===(s=null==n?void 0:n.layer)||void 0===s?void 0:s.url))}})),null===(e=null==i?void 0:i.sources)||void 0===e||e.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;t.url=t.url,delete t.url}})),i}_initGraphicsLayer(){const i=this._translations.bufferLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));if(t>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(t);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:i}),w.managedLayers.push(i);const t=this.mapView.map.layers.findIndex((i=>i.title===this._translations.sketchLayer));t>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,t):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}_layerSelectChanged(){this._layerSelectChecked=this._selectFromLayerElement.checked,this.sketchTypeChange.emit(this._layerSelectChecked?y.LAYER:y.INTERACTIVE)}_workflowChange(i){this._workflowType=i.detail}async _highlightFeatures(i){var t;null===(t=w.highlightHandle)||void 0===t||t.remove(),i.length>0&&(w.highlightHandle=await p(i,this.selectLayerView,this.mapView)),this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this._selectedIds=await g(i,this.selectLayerView.layer),this._drawTools.graphics=this.geometries.map((i=>{var t,e,a;const s={geometry:i,symbol:"point"===i.type?null===(t=this._drawTools)||void 0===t?void 0:t.pointSymbol:"polyline"===i.type?null===(e=this._drawTools)||void 0===e?void 0:e.polylineSymbol:"polygon"===i.type?null===(a=this._drawTools)||void 0===a?void 0:a.polygonSymbol:void 0};return new this.Graphic(s)})),this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){if(this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail,this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:[227,139,79,.8],outline:{color:[255,255,255],width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),this._selectFeatures([this._bufferGeometry]),this.mapView.goTo(i.geometry.extent)}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),this._geomQuery(this.geometries)}_geomQuery(i){const t=u(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!0){var e,a;this._selectedIds=[],t&&(this._selectionLabel=""),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._searchWidget.clear(),null===(e=w.highlightHandle)||void 0===e||e.remove(),(null===(a=this._drawTools)||void 0===a?void 0:a.clear)&&this._drawTools.clear(),this.selectionSetChange.emit(this._selectedIds.length)}_updateSelection(i,t,e){this.geometries=Array.isArray(t)?t.map((i=>i.geometry)):this.geometries,this._workflowType=i,this._selectionLabel=e}async _getTranslations(){const i=await k(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],_workflowType:["workflowTypeHandler"]}}};I.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{-webkit-border-end:1px solid var(--calcite-ui-border-2);border-inline-end:1px solid var(--calcite-ui-border-2)}.search-distance{display:flex;padding-top:1rem}';const C=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageDimensions:{width:8.5,height:11,leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageDimensions:{width:8.5,height:11,leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageDimensions:{width:8.5,height:11,leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageDimensions:{width:8.5,height:11,leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageDimensions:{width:8.5,height:11,leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageDimensions:{width:8.5,height:11,leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageDimensions:{width:8.5,height:11,leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]}),M=class{constructor(t){i(this,t),this.disabled=!0,this.enabledSizeValues=[],this.layerView=void 0,this._translations=void 0}async downloadPDF(i,t){return this._downloadPDF(i,t)}async downloadCSV(i,t,e){return this._downloadCSV(i,t,e)}async componentWillLoad(){await this._getTranslations()}render(){return t(e,null,t("calcite-select",{disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}},this._renderItems()))}_renderItems(){return(C.default||C).sort(((i,t)=>{const e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),a=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return e<a?-1:e>a?1:0})).reduce(((i,e)=>((0===this.enabledSizeValues.length||this.enabledSizeValues.indexOf(parseInt(e.descriptionPDF.labelsPerPageDisplay,10))>-1)&&i.push(t("calcite-option",{value:e},this._getLabelSizeText(e))),i)),[])}async _downloadPDF(i,t){alert(`PDF download: (${this._getLabelSizeText(this._labelInfoElement.selectedOption.value)}) (remove dups: ${t}) ${i.join(", ")}`)}async _downloadCSV(i,t,e){console.log(t),await x(this.layerView,i,e)}_getLabelSizeText(i){const t=`${i.descriptionPDF.labelWidthDisplay} x ${i.descriptionPDF.labelHeightDisplay}`;return this._translations.pdfLabel.replace("{{n}}",i.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",t)}async _getTranslations(){const i=await k(this.el);this._translations=i[0]}get el(){return a(this)}};M.style=":host{display:block}";const H=class{constructor(t){i(this,t),this.selectionSetsChanged=s(this,"selectionSetsChanged",7),this._addEnabled=!0,this.addresseeLayer=void 0,this.enabledLayerIds=[],this.mapView=void 0,this.selectionSets=[],this.GraphicsLayer=void 0,this.SketchViewModel=void 0,this._translations=void 0}refineSelectionIdsChange(i){var t,e;const a=(null===(t=i.detail)||void 0===t?void 0:t.addIds)||[],s=(null===(e=i.detail)||void 0===e?void 0:e.removeIds)||[];this._updateSelectionSets(s),this._updateRefineSelectionSet(a,s)}async componentWillLoad(){await this._getTranslations()}render(){return t(e,null,t("div",{class:"padding-1"},t("div",null,t("calcite-radio-group",{class:"w-100",onCalciteRadioGroupChange:i=>this._modeChanged(i)},t("calcite-radio-group-item",{checked:this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(b.ADD),value:b.ADD},this._translations.add),t("calcite-radio-group-item",{checked:!this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(b.REMOVE),value:b.REMOVE},this._translations.remove)),t("refine-selection-tools",{border:!0,enabledLayerIds:this.enabledLayerIds,ids:D(this.selectionSets),layerViews:[this.addresseeLayer],mapView:this.mapView,mode:this._addEnabled?b.ADD:b.REMOVE,ref:i=>{this._refineTools=i},useLayerPicker:!1})),t("br",null),t("calcite-list",{class:"list-border"},this._getRefineSelectionSetList())))}_modeChanged(i){this._addEnabled=i.detail===b.ADD}_setSelectionMode(i){this._refineTools.mode=i}_getRefineSelectionSetList(){const i=_(this.selectionSets),e=this._getRefineSelectionSet(this.selectionSets),a=(null==e?void 0:e.refineIds.removeIds.length)||0;return[t("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",((null==e?void 0:e.refineIds.addIds.length)||0).toString())}),t("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString())}),t("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString())})]}_getRefineSelectionSet(i){let t;return i.some((i=>{if(i.workflowType===v.REFINE)return t=i,!0})),t}_updateSelectionSets(i){i.length>0&&(this.selectionSets=this.selectionSets.reduce(((t,e)=>(e.selectedIds=e.selectedIds.filter((t=>i.indexOf(t)<0)),e.selectedIds.length>0&&t.push(e),t)),[]),this.selectionSetsChanged.emit(this.selectionSets))}_updateRefineSelectionSet(i,t){const e=this._getRefineSelectionSet(this.selectionSets);this.selectionSets=e?this._updateRefineIds(e,i,t):this._addRefineSelectionSet(i,t),this.selectionSetsChanged.emit(this.selectionSets)}_updateRefineIds(i,t,e){i.refineIds.addIds=i.refineIds.addIds.filter((i=>e.indexOf(i)<0)),i.refineIds.removeIds=i.refineIds.removeIds.filter((i=>t.indexOf(i)<0));const a=[...new Set(i.refineIds.addIds.concat(t))],s=[...new Set(i.refineIds.removeIds.concat(e))];return i.refineIds={addIds:a.filter((i=>s.indexOf(i)<0)),removeIds:s.filter((i=>a.indexOf(i)<0))},i.selectedIds=i.refineIds.addIds.length>0?[...new Set(i.selectedIds.concat(i.refineIds.addIds))]:i.selectedIds.filter((t=>i.refineIds.removeIds.indexOf(t)<0)),this.selectionSets.map((t=>t.workflowType===v.REFINE?i:t))}_addRefineSelectionSet(i,t){return[...this.selectionSets,{buffer:void 0,distance:0,download:!0,geometries:[],id:Date.now(),label:"Refine",layerView:this.addresseeLayer,refineSelectLayers:[],searchResult:void 0,selectedIds:i,unit:"feet",workflowType:v.REFINE,refineIds:{addIds:i,removeIds:t}}]}async _getTranslations(){const i=await k(this.el);this._translations=i[0]}_testAccess(i,t){switch(i){case"_modeChanged":return this._modeChanged(t);case"_setSelectionMode":return this._setSelectionMode(t)}return null}get el(){return a(this)}};H.style=":host{display:block}";export{S as calcite_input_message,L as calcite_notice,I as map_select_tools,M as pdf_download,H as refine_selection}
|