@esri/solutions-components 0.7.25 → 0.7.27
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-alert_4.cjs.entry.js +2 -2
- package/dist/cjs/calcite-flow_4.cjs.entry.js +43 -12
- package/dist/cjs/card-manager_3.cjs.entry.js +3 -1
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +11 -22
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{popupUtils-a73902a6.js → popupUtils-7755782a.js} +9 -12
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +0 -21
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +27 -21
- package/dist/collection/components/feature-list/feature-list.js +43 -10
- package/dist/collection/components/info-card/info-card.js +1 -1
- package/dist/collection/components/layer-list/layer-list.js +2 -1
- package/dist/collection/components/layer-table/layer-table.js +3 -1
- package/dist/collection/demos/crowdsource-reporter.html +92 -58
- package/dist/collection/demos/feature-list.html +65 -17
- package/dist/collection/demos/layer-list.html +43 -3
- package/dist/collection/utils/interfaces.ts +1 -1
- package/dist/collection/utils/popupUtils.js +9 -12
- package/dist/collection/utils/popupUtils.ts +30 -32
- package/dist/components/crowdsource-reporter.js +12 -23
- package/dist/components/feature-list2.js +42 -10
- package/dist/components/info-card2.js +1 -1
- package/dist/components/layer-list2.js +2 -1
- package/dist/components/layer-table2.js +3 -1
- package/dist/components/popupUtils.js +9 -12
- package/dist/esm/calcite-alert_4.entry.js +2 -2
- package/dist/esm/calcite-flow_4.entry.js +43 -12
- package/dist/esm/card-manager_3.entry.js +3 -1
- package/dist/esm/crowdsource-reporter.entry.js +12 -23
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{popupUtils-a593bd78.js → popupUtils-d75edf93.js} +9 -12
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/crowdsource-reporter.html +92 -58
- package/dist/solutions-components/demos/feature-list.html +65 -17
- package/dist/solutions-components/demos/layer-list.html +43 -3
- package/dist/solutions-components/p-515a319e.js +21 -0
- package/dist/solutions-components/p-6a452a84.entry.js +17 -0
- package/dist/solutions-components/p-8756eebb.entry.js +6 -0
- package/dist/solutions-components/{p-29f661f5.entry.js → p-934cbe40.entry.js} +2 -2
- package/dist/solutions-components/{p-5af99fd8.entry.js → p-9549b5b1.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +1 -1
- package/dist/solutions-components/utils/popupUtils.ts +30 -32
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +5 -1
- package/dist/types/components/feature-list/feature-list.d.ts +8 -0
- package/dist/types/components.d.ts +19 -0
- package/dist/types/preact.d.ts +3 -1
- package/dist/types/utils/interfaces.d.ts +1 -1
- package/dist/types/utils/popupUtils.d.ts +3 -2
- package/package.json +1 -1
- package/dist/solutions-components/p-0b619197.entry.js +0 -17
- package/dist/solutions-components/p-db868283.js +0 -21
- package/dist/solutions-components/p-e88a64be.entry.js +0 -6
@@ -23,15 +23,17 @@ export class PopupUtils {
|
|
23
23
|
*/
|
24
24
|
arcade: typeof import("esri/arcade");
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
/**
|
27
|
+
* Get the popup title that honors arcade expressions
|
28
|
+
* @param graphic selected graphic
|
29
|
+
* @param map __esri.Map
|
30
|
+
* @returns Promise resolving with the popup title
|
31
|
+
*
|
32
|
+
* @protected
|
33
|
+
*/
|
33
34
|
public async getPopupTitle(
|
34
|
-
graphic: __esri.Graphic
|
35
|
+
graphic: __esri.Graphic,
|
36
|
+
map: __esri.Map
|
35
37
|
): Promise<string> {
|
36
38
|
if (!this.arcade) {
|
37
39
|
await this._initModules()
|
@@ -48,21 +50,17 @@ export class PopupUtils {
|
|
48
50
|
if (popupTitle.includes("{expression/expr") && layer?.popupTemplate?.expressionInfos != null) {
|
49
51
|
for (let i = 0; i < layer.popupTemplate?.expressionInfos.length; i++) {
|
50
52
|
const info = layer.popupTemplate.expressionInfos[i];
|
51
|
-
|
52
|
-
|
53
|
-
{
|
54
|
-
name: "$feature",
|
55
|
-
type: "feature"
|
56
|
-
}
|
57
|
-
]
|
58
|
-
} as __esri.Profile;
|
53
|
+
//create arcade profile for popup
|
54
|
+
const profile = this.arcade.createArcadeProfile('popup');
|
59
55
|
try {
|
60
56
|
const arcadeExecutor = await this.arcade.createArcadeExecutor(info.expression, profile);
|
61
|
-
const arcadeTitle = arcadeExecutor.
|
57
|
+
const arcadeTitle = await arcadeExecutor.executeAsync({ $feature: graphic, $layer: layer, $map: map });
|
62
58
|
if (arcadeTitle != null || arcadeTitle !== "") {
|
63
59
|
attributes[`{expression/${info.name}}`.toUpperCase()] = arcadeTitle;
|
64
60
|
}
|
65
|
-
} catch {
|
61
|
+
} catch (e) {
|
62
|
+
//log error in console to understand if the arcade expressions are failing
|
63
|
+
console.error(e);
|
66
64
|
continue;
|
67
65
|
}
|
68
66
|
}
|
@@ -73,13 +71,13 @@ export class PopupUtils {
|
|
73
71
|
});
|
74
72
|
}
|
75
73
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
74
|
+
/**
|
75
|
+
* Remove any tags from the title
|
76
|
+
*
|
77
|
+
* @returns title string without tags
|
78
|
+
*
|
79
|
+
* @protected
|
80
|
+
*/
|
83
81
|
protected _removeTags(str: string): string {
|
84
82
|
if (str == null || str === "") {
|
85
83
|
return "";
|
@@ -87,13 +85,13 @@ export class PopupUtils {
|
|
87
85
|
return str.toString().replace(/(<([^>]+)>)/gi, "");
|
88
86
|
}
|
89
87
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
88
|
+
/**
|
89
|
+
* Load esri javascript api modules
|
90
|
+
*
|
91
|
+
* @returns Promise resolving when function is done
|
92
|
+
*
|
93
|
+
* @protected
|
94
|
+
*/
|
97
95
|
protected async _initModules(): Promise<void> {
|
98
96
|
const [arcade] = await loadModules([
|
99
97
|
"esri/arcade"
|
@@ -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 { VNode, EventEmitter } from "../../stencil-public-runtime";
|
18
18
|
import { IMapChange, IMapInfo, ISearchConfiguration, theme } from "../../utils/interfaces";
|
19
19
|
import CrowdsourceReporter_T9n from "../../assets/t9n/crowdsource-reporter/resources.json";
|
20
20
|
export declare class CrowdsourceReporter {
|
@@ -156,6 +156,10 @@ export declare class CrowdsourceReporter {
|
|
156
156
|
* Called each time the mapView prop is changed.
|
157
157
|
*/
|
158
158
|
mapViewWatchHandler(): Promise<void>;
|
159
|
+
/**
|
160
|
+
* Emitted when toggle panel button is clicked in reporter
|
161
|
+
*/
|
162
|
+
togglePanel: EventEmitter<boolean>;
|
159
163
|
/**
|
160
164
|
* StencilJS: Called once just after the component is first connected to the DOM.
|
161
165
|
* Create component translations and monitor the mediaQuery change to detect mobile/desktop mode
|
@@ -68,6 +68,10 @@ export declare class FeatureList {
|
|
68
68
|
* __esri.Handle: Highlight handle of the selections
|
69
69
|
*/
|
70
70
|
protected _highlightHandle: __esri.Handle;
|
71
|
+
/**
|
72
|
+
* Watch for selectedLayerId change and update layer instance and features list for new layerId
|
73
|
+
*/
|
74
|
+
selectedLayerWatchHandler(): Promise<void>;
|
71
75
|
/**
|
72
76
|
* Emitted on demand when feature is selected using the list
|
73
77
|
*/
|
@@ -85,6 +89,10 @@ export declare class FeatureList {
|
|
85
89
|
* Renders the component.
|
86
90
|
*/
|
87
91
|
render(): any;
|
92
|
+
/**
|
93
|
+
* Initialize the features list using the selected layer
|
94
|
+
*/
|
95
|
+
protected initializeFeatureItems(): Promise<void>;
|
88
96
|
/**
|
89
97
|
* On page change get the next updated feature list
|
90
98
|
* @param event page change event
|
@@ -1260,6 +1260,10 @@ export interface BufferToolsCustomEvent<T> extends CustomEvent<T> {
|
|
1260
1260
|
detail: T;
|
1261
1261
|
target: HTMLBufferToolsElement;
|
1262
1262
|
}
|
1263
|
+
export interface CrowdsourceReporterCustomEvent<T> extends CustomEvent<T> {
|
1264
|
+
detail: T;
|
1265
|
+
target: HTMLCrowdsourceReporterElement;
|
1266
|
+
}
|
1263
1267
|
export interface DeductCalculatorCustomEvent<T> extends CustomEvent<T> {
|
1264
1268
|
detail: T;
|
1265
1269
|
target: HTMLDeductCalculatorElement;
|
@@ -1396,7 +1400,18 @@ declare global {
|
|
1396
1400
|
prototype: HTMLCrowdsourceManagerElement;
|
1397
1401
|
new (): HTMLCrowdsourceManagerElement;
|
1398
1402
|
};
|
1403
|
+
interface HTMLCrowdsourceReporterElementEventMap {
|
1404
|
+
"togglePanel": boolean;
|
1405
|
+
}
|
1399
1406
|
interface HTMLCrowdsourceReporterElement extends Components.CrowdsourceReporter, HTMLStencilElement {
|
1407
|
+
addEventListener<K extends keyof HTMLCrowdsourceReporterElementEventMap>(type: K, listener: (this: HTMLCrowdsourceReporterElement, ev: CrowdsourceReporterCustomEvent<HTMLCrowdsourceReporterElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
1408
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
1409
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
1410
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
1411
|
+
removeEventListener<K extends keyof HTMLCrowdsourceReporterElementEventMap>(type: K, listener: (this: HTMLCrowdsourceReporterElement, ev: CrowdsourceReporterCustomEvent<HTMLCrowdsourceReporterElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
1412
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
1413
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
1414
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
1400
1415
|
}
|
1401
1416
|
var HTMLCrowdsourceReporterElement: {
|
1402
1417
|
prototype: HTMLCrowdsourceReporterElement;
|
@@ -2234,6 +2249,10 @@ declare namespace LocalJSX {
|
|
2234
2249
|
* esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
|
2235
2250
|
*/
|
2236
2251
|
"mapView"?: __esri.MapView;
|
2252
|
+
/**
|
2253
|
+
* Emitted when toggle panel button is clicked in reporter
|
2254
|
+
*/
|
2255
|
+
"onTogglePanel"?: (event: CrowdsourceReporterCustomEvent<boolean>) => void;
|
2237
2256
|
/**
|
2238
2257
|
* string: The word(s) to display in the reports submit button
|
2239
2258
|
*/
|
package/dist/types/preact.d.ts
CHANGED
@@ -504,7 +504,9 @@ declare module "preact/src/jsx" {
|
|
504
504
|
|
505
505
|
"crowdsource-manager": JSX.SolutionsCrowdsourceManager & JSXInternal.HTMLAttributes<HTMLSolutionsCrowdsourceManagerElement>
|
506
506
|
|
507
|
-
"crowdsource-reporter": JSX.SolutionsCrowdsourceReporter & JSXInternal.HTMLAttributes<HTMLSolutionsCrowdsourceReporterElement>
|
507
|
+
"crowdsource-reporter": Omit<JSX.SolutionsCrowdsourceReporter, "onTogglePanel"> & JSXInternal.HTMLAttributes<HTMLSolutionsCrowdsourceReporterElement> & {
|
508
|
+
"ontogglePanel"?: (event: CustomEvent<any>) => void;
|
509
|
+
}
|
508
510
|
|
509
511
|
"deduct-calculator": Omit<JSX.SolutionsDeductCalculator, "onDeductValueComplete"> & JSXInternal.HTMLAttributes<HTMLSolutionsDeductCalculatorElement> & {
|
510
512
|
"ondeductValueComplete"?: (event: CustomEvent<any>) => void;
|
@@ -474,5 +474,5 @@ export interface ILayerAndTableIds {
|
|
474
474
|
}
|
475
475
|
export interface IPopupUtils {
|
476
476
|
arcade: typeof import("esri/arcade");
|
477
|
-
getPopupTitle(graphic: __esri.Graphic): Promise<string>;
|
477
|
+
getPopupTitle(graphic: __esri.Graphic, map: __esri.Map): Promise<string>;
|
478
478
|
}
|
@@ -21,12 +21,13 @@ export declare class PopupUtils {
|
|
21
21
|
arcade: typeof import("esri/arcade");
|
22
22
|
/**
|
23
23
|
* Get the popup title that honors arcade expressions
|
24
|
-
*
|
24
|
+
* @param graphic selected graphic
|
25
|
+
* @param map __esri.Map
|
25
26
|
* @returns Promise resolving with the popup title
|
26
27
|
*
|
27
28
|
* @protected
|
28
29
|
*/
|
29
|
-
getPopupTitle(graphic: __esri.Graphic): Promise<string>;
|
30
|
+
getPopupTitle(graphic: __esri.Graphic, map: __esri.Map): Promise<string>;
|
30
31
|
/**
|
31
32
|
* Remove any tags from the title
|
32
33
|
*
|
package/package.json
CHANGED
@@ -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 t,h as i,g as s,c as e,H as a,F as o}from"./p-78780f63.js";import{c as l}from"./p-5b566d55.js";import{c as n,s as c,a as r}from"./p-f10944e6.js";import{a as h}from"./p-83fd31d5.js";import{c as d,u as m,d as p}from"./p-0c97de08.js";import{c as f,d as u}from"./p-de281b08.js";import{c as g,s as v,d as b,u as y}from"./p-981e9549.js";import{S as w}from"./p-35c58364.js";import{P as x}from"./p-db868283.js";import{g as k,b as L,h as C,c as j,d as z}from"./p-4566438a.js";import{g as I,f as F}from"./p-e902ba19.js";import"./p-fcefdfff.js";import"./p-29d68474.js";import"./p-c92fff33.js";import"./p-1e2ffee3.js";import"./p-c1cf3ebc.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";
|
7
|
-
/*!
|
8
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
|
-
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
10
|
-
* v2.0.0
|
11
|
-
*/const D=class{constructor(i){t(this,i),this.itemMutationObserver=l("mutation",(()=>this.updateFlowProps())),this.getFlowDirection=(t,i)=>t&&i>1||t>1?i<t?"retreating":"advancing":null,this.updateFlowProps=()=>{const{customItemSelectors:t,el:i,items:s}=this,e=Array.from(i.querySelectorAll("calcite-flow-item"+(t?`,${t}`:""))).filter((t=>t.closest("calcite-flow")===i)),a=s.length,o=e.length,l=e[o-1],n=e[o-2];if(o&&l&&e.forEach((t=>{t.showBackButton=t===l&&o>1,t.hidden=t!==l})),n&&(n.menuOpen=!1),this.items=e,a!==o){const t=this.getFlowDirection(a,o);this.itemCount=o,this.flowDirection=t}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,i=t[t.length-1];if(!i)return;const s=i.beforeBack?i.beforeBack:()=>Promise.resolve();try{await s.call(i)}catch(t){return}return i.remove(),i}async setFocus(){await n(this);const{items:t}=this,i=t[t.length-1];return null==i?void 0:i.setFocus()}connectedCallback(){var t;null===(t=this.itemMutationObserver)||void 0===t||t.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){c(this)}componentDidLoad(){r(this)}disconnectedCallback(){var t;null===(t=this.itemMutationObserver)||void 0===t||t.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this;return i("div",{class:{frame:!0,"frame--advancing":"advancing"===t,"frame--retreating":"retreating"===t}},i("slot",null))}get el(){return s(this)}};D.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}";
|
12
|
-
/*!
|
13
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
14
|
-
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
15
|
-
* v2.0.0
|
16
|
-
*/
|
17
|
-
const B=class{constructor(i){t(this,i),this.calciteFlowItemBack=e(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=e(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=e(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=e(this,"calciteFlowItemToggle",6),this.handlePanelScroll=t=>{t.stopPropagation(),this.calciteFlowItemScroll.emit()},this.handlePanelClose=t=>{t.stopPropagation(),this.calciteFlowItemClose.emit()},this.handlePanelToggle=t=>{t.stopPropagation(),this.collapsed=t.target.collapsed,this.calciteFlowItemToggle.emit()},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){d(this),f(this),g(this)}async componentWillLoad(){await v(this),c(this)}componentDidRender(){m(this)}disconnectedCallback(){p(this),u(this),b(this)}componentDidLoad(){r(this)}effectiveLocaleChange(){y(this,this.effectiveLocale)}async setFocus(){await n(this);const{backButtonEl:t,containerEl:i}=this;return t?t.setFocus():i?i.setFocus():void 0}async scrollContentTo(t){var i;await(null===(i=this.containerEl)||void 0===i?void 0:i.scrollContentTo(t))}renderBackButton(){const{el:t}=this,s="rtl"===h(t),{showBackButton:e,backButtonClick:a,messages:o}=this,l=o.back;return e?i("calcite-action",{"aria-label":l,class:"back-button",icon:s?"chevron-right":"chevron-left",key:"flow-back-button",onClick:a,scale:"s",slot:"header-actions-start",text:l,title:l,ref:this.setBackRef}):null}render(){const{collapsed:t,collapseDirection:s,collapsible:e,closable:o,closed:l,description:n,disabled:c,heading:r,headingLevel:h,loading:d,menuOpen:m,messages:p}=this;return i(a,null,i("calcite-panel",{closable:o,closed:l,collapseDirection:s,collapsed:t,collapsible:e,description:n,disabled:c,heading:r,headingLevel:h,loading:d,menuOpen:m,messageOverrides:p,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,onCalcitePanelToggle:this.handlePanelToggle,ref:this.setContainerRef},this.renderBackButton(),i("slot",{name:"action-bar",slot:w.actionBar}),i("slot",{name:"header-actions-start",slot:w.headerActionsStart}),i("slot",{name:"header-actions-end",slot:w.headerActionsEnd}),i("slot",{name:"header-content",slot:w.headerContent}),i("slot",{name:"header-menu-actions",slot:w.headerMenuActions}),i("slot",{name:"fab",slot:w.fab}),i("slot",{name:"footer-actions",slot:w.footerActions}),i("slot",{name:"footer",slot:w.footer}),i("slot",null)))}static get assetsDirs(){return["assets"]}get el(){return s(this)}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};B.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}";const P=class{constructor(i){t(this,i),this.featureSelect=e(this,"featureSelect",7),this.selectedLayerId=void 0,this.mapView=void 0,this.noFeaturesFoundMsg=void 0,this.pageSize=100,this.highlightOnMap=!1,this._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._translations=void 0}async componentWillLoad(){await this._getTranslations(),this._isLoading=!0,this._popupUtils=new x,this._selectedLayer=await k(this.mapView,this.selectedLayerId)}async componentDidLoad(){this._selectedLayer&&(this._featureItems=await this.queryPage(0),this._featuresCount=await this._selectedLayer.queryFeatureCount(),this._isLoading=!1)}render(){return i("calcite-panel",{"full-height":!0,"full-width":!0},this._isLoading&&i("calcite-loader",{scale:"m"}),0===this._featureItems.length&&!this._isLoading&&i("calcite-notice",{class:"error-msg",icon:"feature-details",kind:"info",open:!0},i("div",{slot:"message"},this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg)),i("calcite-list",{"selection-appearance":"border","selection-mode":"single"},!this._isLoading&&this._featureItems.length>0&&this._featureItems),this._featuresCount>this.pageSize&&i("div",{class:"width-full",slot:"footer"},i("calcite-pagination",{class:"pagination","full-width":!0,onCalcitePaginationChange:this.pageChanged.bind(this),"page-size":this.pageSize,"start-item":"1","total-items":this._featuresCount})))}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.highlightOnMap&&this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null),t.target.selected){if(this.highlightOnMap){const i=Number(t.target.value),s=await L(this.mapView,this.selectedLayerId);this._highlightHandle=await C([i],s,this.mapView,!0)}this.featureSelect.emit(i)}}async queryPage(t){const i=this._selectedLayer,s={start:t,num:this.pageSize,outFields:["*"],orderByFields:[i.objectIdField+" DESC"],returnGeometry:!0,where:i.definitionExpression},e=await i.queryFeatures(s);return await this.createFeatureItem(e)}async createFeatureItem(t){const i=(null==t?void 0:t.features).map((async t=>{const i=await this._popupUtils.getPopupTitle(t);return this.getFeatureItem(t,i)}));return Promise.all(i)}getFeatureItem(t,s){const e=t.attributes[this._selectedLayer.objectIdField].toString();return i("calcite-list-item",{onCalciteListItemSelect:i=>{this.featureClicked(i,t)},value:e},i("div",{class:"popup-title",slot:"content-start"},s=null!=s?s:e),i("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}async _getTranslations(){const t=await I(this.el);this._translations=t[0]}get el(){return s(this)}};P.style=":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.popup-title{font-weight:500;padding:10px 12px}";const S=class{constructor(i){t(this,i),this.layerSelect=e(this,"layerSelect",7),this.layersListLoaded=e(this,"layersListLoaded",7),this.mapView=void 0,this.layers=void 0,this.noLayerErrorMsg=void 0,this._noLayersToDisplay=!1,this._mapLayerIds=[],this._isLoading=!1,this._translations=void 0}async componentWillLoad(){await this._getTranslations(),this._isLoading=!0}async componentDidLoad(){await this.setLayers(),this._isLoading=!1}render(){return i(o,null,this._isLoading&&i("calcite-loader",{scale:"m"}),!this._isLoading&&this.mapView&&this._noLayersToDisplay&&i("calcite-notice",{class:"error-msg",icon:"layers-reference",kind:"danger",open:!0},i("div",{slot:"title"},this._translations.error),i("div",{slot:"message"},this.noLayerErrorMsg?this.noLayerErrorMsg:this._translations.noLayerToDisplayErrorMsg)),!this._isLoading&&this.mapView&&i("calcite-list",null,this.renderLayerList()))}async setLayers(){this.mapView&&await this.initLayerHash()}async initLayerHash(){const t=[];this._layerItemsHash=await j(this.mapView,!0),(await z(this.mapView)).forEach((async i=>{var s,e;if("feature"===(null==i?void 0:i.type)&&(null==i?void 0:i.editingEnabled)&&(null===(e=null===(s=null==i?void 0:i.capabilities)||void 0===s?void 0:s.operations)||void 0===e?void 0:e.supportsUpdate)){const s=i.createQuery(),e=i.queryFeatureCount(s);t.push(e),e.then((async t=>{const s=isNaN(t)?"":await F(t,{places:0,api:4,type:"decimal"});this._layerItemsHash[i.id].formattedFeatureCount=s}))}})),await Promise.all(t).then((()=>{const t=this.getEditableIds(this._layerItemsHash);this._mapLayerIds=t.reverse(),this.handleNoLayersToDisplay()}),(()=>{this._mapLayerIds=[],this.handleNoLayersToDisplay()}))}handleNoLayersToDisplay(){this._noLayersToDisplay=!(this._mapLayerIds.length>0),this.layersListLoaded.emit(this._mapLayerIds)}getEditableIds(t){var i;const s=(null===(i=this.layers)||void 0===i?void 0:i.length)>0?this.layers:[];return Object.keys(t).reduce(((i,e)=>{let a=t[e].supportsUpdate;return(null==s?void 0:s.length)>0&&(a=s.indexOf(e)>-1&&t[e].supportsUpdate),a&&i.push(e),i}),[])}renderLayerList(){return this._mapLayerIds.length>0&&this._mapLayerIds.reduce(((t,i)=>(this._layerItemsHash[i]&&t.push(this.getLayerListItem(i)),t)),[])}getLayerListItem(t){const s=this._layerItemsHash[t].formattedFeatureCount;return i("calcite-list-item",{onCalciteListItemSelect:()=>{this.showFeaturesList(t)}},i("div",{class:"layer-name",slot:"content-start"},this._layerItemsHash[t].name),""!==s&&i("div",{slot:"content-end"},"("+s+")"),i("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}showFeaturesList(t){this.layerSelect.emit({layerId:t,layerName:this._layerItemsHash[t].name})}async _getTranslations(){const t=await I(this.el);this._translations=t[0]}get el(){return s(this)}};S.style=":host{display:block}.error-msg{padding:10px}.layer-name{font-weight:500;padding:10px 12px}";export{D as calcite_flow,B as calcite_flow_item,P as feature_list,S as layer_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-e902ba19.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 e{async getPopupTitle(t){var e,i,l;this.arcade||await this._initModules();let o={};for(const[e,i]of Object.entries(t.attributes))o=Object.assign(Object.assign({},o),{[`{${e.toUpperCase()}}`]:i});const n=t.layer,s=this._removeTags(null===(e=null==n?void 0:n.popupTemplate)||void 0===e?void 0:e.title);if(s.includes("{expression/expr")&&null!=(null===(i=null==n?void 0:n.popupTemplate)||void 0===i?void 0:i.expressionInfos))for(let e=0;e<(null===(l=n.popupTemplate)||void 0===l?void 0:l.expressionInfos.length);e++){const i=n.popupTemplate.expressionInfos[e],l={variables:[{name:"$feature",type:"feature"}]};try{const e=(await this.arcade.createArcadeExecutor(i.expression,l)).execute({$feature:t});null==e&&""===e||(o[`{expression/${i.name}}`.toUpperCase()]=e)}catch(t){continue}}return null==s?void 0:s.replace(/{.*?}/g,(t=>null!=o[t.toUpperCase()]?o[t.toUpperCase()]:""))}_removeTags(t){return null==t||""===t?"":t.toString().replace(/(<([^>]+)>)/gi,"")}async _initModules(){const[e]=await t(["esri/arcade"]);this.arcade=e}}export{e 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 t,h as i,H as e,g as s}from"./p-78780f63.js";import{g as a}from"./p-e902ba19.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const h=class{constructor(i){t(this,i),this.description=void 0,this.isMobile=void 0,this.enableAnonymousAccess=void 0,this.enableAnonymousComments=void 0,this.enableComments=void 0,this.enableLogin=void 0,this.enableNewReports=void 0,this.layers=void 0,this.loginTitle=void 0,this.mapView=void 0,this.reportButtonText=void 0,this.reportsHeader=void 0,this.reportSubmittedMessage=void 0,this.searchConfiguration=void 0,this.showComments=void 0,this.defaultWebmap="",this.enableSearch=!0,this.enableHome=!0,this.mapInfos=[],this.theme="light",this.enableZoom=!0,this._mapInfo=void 0,this._flowItems=["layer-list"],this._sidePanelCollapsed=!1,this._translations=void 0,this._hasValidLayers=!1}async isMobileWatchHandler(){this.isMobile&&(this._sidePanelCollapsed=!1)}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.setMapView()}))}async componentWillLoad(){await this._getTranslations()}render(){return i(e,null,i("div",null,i("calcite-shell",{"content-behind":!0},this._getReporter())))}_getReporter(){const t=[];this._flowItems.forEach((i=>{switch(i){case"layer-list":t.push(this.getLayerListFlowItem());break;case"feature-list":t.push(this.getFeatureListFlowItem(this._selectedLayerId,this._selectedLayerName));break;case"feature-details":t.push(this.getFeatureDetailsFlowItem())}}));let e="side-panel";return this.isMobile&&this._sidePanelCollapsed&&(e+=" collapsed-side-panel"),i("calcite-panel",{class:e+" width-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},this.mapView?i("calcite-flow",null,(null==t?void 0:t.length)>0&&t):i("calcite-loader",{scale:"m"}))}getLayerListFlowItem(){return i("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this.reportsHeader},this._hasValidLayers&&i("calcite-action",{icon:"sort-ascending-arrow",slot:this.isMobile?"header-menu-actions":"header-actions-end",text:this._translations.sort,"text-enabled":this.isMobile}),this._hasValidLayers&&i("calcite-action",{icon:"filter",slot:this.isMobile?"header-menu-actions":"header-actions-end",text:this._translations.filter,"text-enabled":this.isMobile}),this.isMobile&&this.getActionToExpandCollapsePanel(),this._hasValidLayers&&this.enableNewReports&&i("calcite-button",{appearance:"secondary",slot:"footer",width:"full"},this.reportButtonText),i("calcite-panel",{"full-height":!0,"full-width":!0},i("layer-list",{class:"height-full",layers:this.layers,mapView:this.mapView,noLayerErrorMsg:this._translations.noLayerToDisplayErrorMsg,onLayerSelect:this.displayFeaturesList.bind(this),onLayersListLoaded:this.layerListLoaded.bind(this)})))}layerListLoaded(t){this._hasValidLayers=t.detail.length>0}displayFeaturesList(t){this._selectedLayerId=t.detail.layerId,this._selectedLayerName=t.detail.layerName,this._flowItems=[...this._flowItems,"feature-list"]}backFromFeatureList(){const t=[...this._flowItems];t.pop(),this._flowItems=[...t]}toggleSidePanel(){this._sidePanelCollapsed=!this._sidePanelCollapsed}async onFeatureSelectFromList(t){this._selectedFeature=[t.detail],this._flowItems=[...this._flowItems,"feature-details"]}getFeatureListFlowItem(t,e){return i("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:e,onCalciteFlowItemBack:this.backFromFeatureList.bind(this)},i("calcite-action",{icon:"sort-ascending-arrow",slot:this.isMobile?"header-menu-actions":"header-actions-end",text:this._translations.sort,"text-enabled":this.isMobile}),i("calcite-action",{icon:"filter",slot:this.isMobile?"header-menu-actions":"header-actions-end",text:this._translations.filter,"text-enabled":this.isMobile}),this.isMobile&&this.getActionToExpandCollapsePanel(),this.enableNewReports&&i("calcite-button",{appearance:"secondary",slot:"footer",width:"full"},this.reportButtonText),i("calcite-panel",{"full-height":!0},i("feature-list",{class:"height-full",highlightOnMap:!0,mapView:this.mapView,noFeaturesFoundMsg:this._translations.featureErrorMsg,onFeatureSelect:this.onFeatureSelectFromList.bind(this),pageSize:100,selectedLayerId:t})))}getFeatureDetailsFlowItem(){return i("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._selectedLayerName,onCalciteFlowItemBack:this.backFromFeatureList.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),i("calcite-action",{icon:"share",slot:"header-actions-end",text:this._translations.share}),i("calcite-panel",{"full-height":!0},i("info-card",{allowEditing:!1,graphics:this._selectedFeature,isLoading:!1,isMobile:!1,mapView:this.mapView,zoomAndScrollToSelected:!0})))}getActionToExpandCollapsePanel(){return i("calcite-action",{icon:this._sidePanelCollapsed?"chevrons-up":"chevrons-down",onClick:this.toggleSidePanel.bind(this),slot:"header-actions-end",text:this._sidePanelCollapsed?this._translations.expand:this._translations.collapse})}async setMapView(){this.mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this.mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}async _getTranslations(){const t=await a(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{isMobile:["isMobileWatchHandler"],mapView:["mapViewWatchHandler"]}}};h.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.map-container{position:absolute;width:calc(100% - 390px);left:390px}.side-panel{padding:2px;width:390px;height:100%;position:absolute;top:0;left:0;z-index:60}.error-msg{padding:10px}.collapsed-side-panel{top:calc(100% - 55px);height:54px}";export{h as crowdsource_reporter}
|