@esri/solutions-components 0.7.30 → 0.7.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/dist/assets/t9n/crowdsource-reporter/resources.json +7 -5
  2. package/dist/assets/t9n/crowdsource-reporter/resources_en.json +7 -5
  3. package/dist/assets/t9n/feature-list/resources.json +1 -1
  4. package/dist/assets/t9n/feature-list/resources_en.json +1 -1
  5. package/dist/assets/t9n/layer-list/resources.json +1 -1
  6. package/dist/assets/t9n/layer-list/resources_en.json +1 -1
  7. package/dist/cjs/{calcite-flow_4.cjs.entry.js → calcite-flow_5.cjs.entry.js} +286 -19
  8. package/dist/cjs/card-manager_3.cjs.entry.js +1 -1
  9. package/dist/cjs/crowdsource-reporter.cjs.entry.js +248 -32
  10. package/dist/cjs/{downloadUtils-83c6d3c3.js → downloadUtils-10e0de31.js} +2 -2
  11. package/dist/cjs/{index.es-bd1a93b2.js → index.es-72dc7ab9.js} +1 -1
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
  14. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  15. package/dist/cjs/solutions-components.cjs.js +1 -1
  16. package/dist/collection/collection-manifest.json +1 -0
  17. package/dist/collection/components/create-feature/create-feature.css +50 -0
  18. package/dist/collection/components/create-feature/create-feature.js +444 -0
  19. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +10 -1
  20. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +287 -33
  21. package/dist/collection/components/feature-list/feature-list.js +1 -0
  22. package/dist/collection/components/layer-list/layer-list.js +60 -16
  23. package/dist/collection/demos/create-feature.html +90 -0
  24. package/dist/collection/demos/crowdsource-reporter.html +26 -11
  25. package/dist/collection/utils/downloadUtils.js +1 -1
  26. package/dist/collection/utils/downloadUtils.ts +1 -1
  27. package/dist/components/create-feature.d.ts +11 -0
  28. package/dist/components/create-feature.js +11 -0
  29. package/dist/components/create-feature2.js +278 -0
  30. package/dist/components/crowdsource-reporter.js +324 -90
  31. package/dist/components/downloadUtils.js +1 -1
  32. package/dist/components/feature-list2.js +1 -0
  33. package/dist/components/layer-list2.js +38 -17
  34. package/dist/esm/{calcite-flow_4.entry.js → calcite-flow_5.entry.js} +286 -20
  35. package/dist/esm/card-manager_3.entry.js +1 -1
  36. package/dist/esm/crowdsource-reporter.entry.js +249 -33
  37. package/dist/esm/{downloadUtils-d070a467.js → downloadUtils-d297078f.js} +2 -2
  38. package/dist/esm/{index.es-d48535a2.js → index.es-3b4fa9d0.js} +1 -1
  39. package/dist/esm/loader.js +1 -1
  40. package/dist/esm/map-select-tools_3.entry.js +1 -1
  41. package/dist/esm/public-notification.entry.js +1 -1
  42. package/dist/esm/solutions-components.js +1 -1
  43. package/dist/solutions-components/demos/create-feature.html +90 -0
  44. package/dist/solutions-components/demos/crowdsource-reporter.html +26 -11
  45. package/dist/solutions-components/{p-f120ff40.entry.js → p-09ec8c8f.entry.js} +1 -1
  46. package/dist/solutions-components/{p-55b835a1.js → p-103c5318.js} +2 -2
  47. package/dist/solutions-components/{p-309cdea1.entry.js → p-57d49d15.entry.js} +1 -1
  48. package/dist/solutions-components/{p-b913a4fd.js → p-8ec25bf4.js} +1 -1
  49. package/dist/solutions-components/{p-f22ff57e.entry.js → p-921f21d5.entry.js} +1 -1
  50. package/dist/solutions-components/p-d5263cb9.entry.js +17 -0
  51. package/dist/solutions-components/p-ea17cefb.entry.js +6 -0
  52. package/dist/solutions-components/solutions-components.esm.js +1 -1
  53. package/dist/solutions-components/utils/downloadUtils.ts +1 -1
  54. package/dist/types/components/create-feature/create-feature.d.ts +125 -0
  55. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +146 -12
  56. package/dist/types/components/feature-list/feature-list.d.ts +1 -0
  57. package/dist/types/components/layer-list/layer-list.d.ts +6 -0
  58. package/dist/types/components.d.ts +102 -0
  59. package/dist/types/preact.d.ts +7 -0
  60. package/package.json +1 -1
  61. package/dist/solutions-components/p-2f162664.entry.js +0 -6
  62. package/dist/solutions-components/p-94ee3ef7.entry.js +0 -17
@@ -0,0 +1,125 @@
1
+ /** @license
2
+ * Copyright 2022 Esri
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /// <reference types="arcgis-js-api" />
17
+ import { EventEmitter } from "../../stencil-public-runtime";
18
+ export declare class CreateFeature {
19
+ el: HTMLCreateFeatureElement;
20
+ /**
21
+ * esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
22
+ */
23
+ mapView: __esri.MapView;
24
+ /**
25
+ * string: Layer id of the feature layer in which the new feature is to be created
26
+ */
27
+ selectedLayerId: string;
28
+ /**
29
+ * boolean: Set this to true when have a custom submit button in the app.
30
+ * This will hide the header and footer elements of the editor and user needs to execute the submit method manually.
31
+ */
32
+ customizeSubmit?: boolean;
33
+ /**
34
+ * esri/widgets/Editor: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html
35
+ * The Editor constructor
36
+ */
37
+ protected Editor: typeof import("esri/widgets/Editor");
38
+ /**
39
+ * esri/widgets/Editor: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html
40
+ * The Editor instance
41
+ */
42
+ protected _editor: __esri.Editor;
43
+ /**
44
+ * esri/core/reactiveUtils: https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html
45
+ */
46
+ protected reactiveUtils: typeof import("esri/core/reactiveUtils");
47
+ /**
48
+ * boolean: Flag to maintain the add attachment
49
+ */
50
+ protected _addingAttachment: boolean;
51
+ /**
52
+ * Called each time the mapView prop is changed.
53
+ */
54
+ mapViewWatchHandler(): Promise<void>;
55
+ /**
56
+ * Destroy the Editor widget instance
57
+ * @returns Promise that resolves when the operation is complete
58
+ */
59
+ close(): Promise<void>;
60
+ /**
61
+ * Submit the created feature
62
+ * @returns Promise that resolves when the operation is complete
63
+ */
64
+ submit(): Promise<void>;
65
+ /**
66
+ * Emitted on demand when the feature is created successfully
67
+ */
68
+ success: EventEmitter<void>;
69
+ /**
70
+ * Emitted on demand when the feature creation is failed
71
+ */
72
+ fail: EventEmitter<Error>;
73
+ /**
74
+ * Emitted on demand when drawing is completed
75
+ */
76
+ drawComplete: EventEmitter<void>;
77
+ /**
78
+ * Emitted on demand when editing attachments
79
+ */
80
+ editingAttachment: EventEmitter<boolean>;
81
+ /**
82
+ * StencilJS: Called once just after the component is first connected to the DOM.
83
+ * @returns Promise when complete
84
+ */
85
+ componentWillLoad(): Promise<void>;
86
+ /**
87
+ * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
88
+ */
89
+ componentDidLoad(): Promise<void>;
90
+ /**
91
+ * Renders the component.
92
+ */
93
+ render(): any;
94
+ /**
95
+ * Init Editor widget and starts the create workflow
96
+ */
97
+ protected init(): Promise<void>;
98
+ /**
99
+ * Load esri javascript api modules
100
+ * @returns Promise resolving when function is done
101
+ * @protected
102
+ */
103
+ protected initModules(): Promise<void>;
104
+ /**
105
+ * Display editor widget to create the new feature
106
+ * @protected
107
+ */
108
+ protected createEditorWidget(): Promise<void>;
109
+ /**
110
+ * Start creating the feature
111
+ * @protected
112
+ */
113
+ protected startCreate(): Promise<void>;
114
+ /**
115
+ * Hides the elements of editor widget
116
+ * @protected
117
+ */
118
+ protected hideEditorsElements(): void;
119
+ /**
120
+ * On creation of feature emit the event that the feature is created
121
+ * @param evt feature submit event
122
+ * @protected
123
+ */
124
+ protected submitted(evt: any): Promise<void>;
125
+ }
@@ -15,7 +15,7 @@
15
15
  */
16
16
  /// <reference types="arcgis-js-api" />
17
17
  import { VNode, EventEmitter } from "../../stencil-public-runtime";
18
- import { IMapChange, IMapInfo, ISearchConfiguration, theme } from "../../utils/interfaces";
18
+ import { IMapChange, IMapClick, IMapInfo, ISearchConfiguration, theme } from "../../utils/interfaces";
19
19
  import CrowdsourceReporter_T9n from "../../assets/t9n/crowdsource-reporter/resources.json";
20
20
  export declare class CrowdsourceReporter {
21
21
  el: HTMLCrowdsourceReporterElement;
@@ -59,6 +59,14 @@ export declare class CrowdsourceReporter {
59
59
  * esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
60
60
  */
61
61
  mapView: __esri.MapView;
62
+ /**
63
+ * string: Layer id of the feature from URL params
64
+ */
65
+ layerId: string;
66
+ /**
67
+ * string: Object id of the feature from URL params
68
+ */
69
+ objectId: string;
62
70
  /**
63
71
  * string: The word(s) to display in the reports submit button
64
72
  */
@@ -125,9 +133,21 @@ export declare class CrowdsourceReporter {
125
133
  */
126
134
  _hasValidLayers: boolean;
127
135
  /**
128
- * string: The selected feature layer's name from the layer's list
129
- */
136
+ * string: The selected feature layer's name from the layer's list
137
+ */
130
138
  _selectedLayerName: string;
139
+ /**
140
+ * boolean: When true show the success message in the panel
141
+ */
142
+ _reportSubmitted: boolean;
143
+ /**
144
+ * boolean: When true show the submit and cancel button
145
+ */
146
+ _showSubmitCancelButton: boolean;
147
+ /**
148
+ * string: Error message when feature creation fails
149
+ */
150
+ _featureCreationFailedErrorMsg: string;
131
151
  /**
132
152
  * IMapChange: The current map change details
133
153
  */
@@ -140,6 +160,10 @@ export declare class CrowdsourceReporter {
140
160
  * number: zoom level the map should go to
141
161
  */
142
162
  protected _defaultLevel: number;
163
+ /**
164
+ * __esri.FeatureLayer[]: Valid layers from the current map
165
+ */
166
+ protected _validLayers: __esri.FeatureLayer[];
143
167
  /**
144
168
  * string: The selected feature layer's id from the layer's list
145
169
  */
@@ -156,6 +180,26 @@ export declare class CrowdsourceReporter {
156
180
  * IHandle: The map click handle
157
181
  */
158
182
  protected _mapClickHandle: IHandle;
183
+ /**
184
+ * HTMLCreateFeatureElement: Create Feature component instance
185
+ */
186
+ protected _createFeature: HTMLCreateFeatureElement;
187
+ /**
188
+ * HTMLLayerListElement: Create Layer list component instance
189
+ */
190
+ protected _layerList: HTMLLayerListElement;
191
+ /**
192
+ * HTMLInstantAppsSocialShareElement: Share element
193
+ */
194
+ protected _shareNode: HTMLInstantAppsSocialShareElement;
195
+ /**
196
+ * ObjectId of the feature currently shown in the details
197
+ */
198
+ protected _currentFeatureId: string;
199
+ /**
200
+ * boolean: Maintains a flag to know if urls params are loaded or not
201
+ */
202
+ protected _urlParamsLoaded: boolean;
159
203
  /**
160
204
  * Called each time the mapView prop is changed.
161
205
  */
@@ -186,6 +230,12 @@ export declare class CrowdsourceReporter {
186
230
  * @protected
187
231
  */
188
232
  protected _initModules(): Promise<void>;
233
+ /**
234
+ * Set the selected layer id and layer name
235
+ * @param layerId string layerId of the selected layer
236
+ * @param layerName string layerName of the selected layer
237
+ */
238
+ protected setSelectedLayer(layerId: string, layerName: string): void;
189
239
  /**
190
240
  * Get the reporter app functionality
191
241
  * @protected
@@ -197,22 +247,86 @@ export declare class CrowdsourceReporter {
197
247
  * @protected
198
248
  */
199
249
  protected getLayerListFlowItem(): Node;
250
+ /**
251
+ * Get the layer list for creating a report
252
+ * @returns Choose category flow item
253
+ * @protected
254
+ */
255
+ protected getChooseCategoryFlowItem(): Node;
256
+ /**
257
+ * Get Feature create form of the selected feature layer
258
+ * @returns feature create form
259
+ * @protected
260
+ */
261
+ protected getFeatureCreateFlowItem(): Node;
262
+ /**
263
+ * When drawing of incident location completed on map show the submit and cancel button
264
+ * @protected
265
+ */
266
+ protected onDrawComplete(): void;
267
+ /**
268
+ * When Add attachment panel is enabled hide the submit and cancel button
269
+ * @protected
270
+ */
271
+ protected showSubmitCancelButton(evt: CustomEvent): void;
272
+ /**
273
+ * On back from create feature, call submit editor to destroy the Editor widget instance
274
+ * @protected
275
+ */
276
+ protected onSubmitButtonClick(): void;
277
+ /**
278
+ * On back from create feature, call close editor to destroy the Editor widget instance
279
+ * @protected
280
+ */
281
+ protected backFromCreateFeaturePanel(): void;
282
+ /**
283
+ * On creating the feature is failed, show the error message
284
+ * @param evt Event which has feature failed message
285
+ * @protected
286
+ */
287
+ protected createFeatureFailed(evt: CustomEvent): void;
288
+ /**
289
+ * On submit report navigate to the layer list home page and refresh the layer list
290
+ * @protected
291
+ */
292
+ protected onReportSubmitted(): void;
293
+ /**
294
+ * Navigates to layer-list
295
+ * @protected
296
+ */
297
+ protected navigateToHomePage(): void;
298
+ /**
299
+ * Update the selected layer id and name
300
+ * @param evt Event which has details of selected layerId and layerName
301
+ * @protected
302
+ */
303
+ protected highlightSelectedLayer(evt: CustomEvent): void;
304
+ /**
305
+ * On next button click open the feature create flow item
306
+ * @protected
307
+ */
308
+ protected navigateToCreateFeature(): Promise<void>;
309
+ /**
310
+ * On report an incident button click open the create a report panel with the layer list
311
+ * @protected
312
+ */
313
+ protected navigateToChooseCategory(): void;
200
314
  /**
201
315
  * When layer list is loaded, we will receive the list of layers, if its means we don't have any valid layer to be listed
202
316
  * @param evt Event which has list of layers
203
317
  * @protected
204
318
  */
205
- protected layerListLoaded(evt: CustomEvent): void;
319
+ protected layerListLoaded(evt: CustomEvent): Promise<void>;
206
320
  /**On click of layer list item show feature list
207
321
  * @param evt Event which has details of selected layerId and layerName
208
322
  * @protected
209
323
  */
210
324
  protected displayFeaturesList(evt: CustomEvent): void;
211
325
  /**
212
- * On back from feature list navigate to the Layer list panel
326
+ * On back from selected panel navigate to the previous panel
213
327
  * @protected
214
328
  */
215
- protected backFromFeatureList(): void;
329
+ protected backFromSelectedPanel(): void;
216
330
  /**
217
331
  * Toggle side panel in case of mobile mode
218
332
  * @protected
@@ -236,13 +350,24 @@ export declare class CrowdsourceReporter {
236
350
  * @returns Node
237
351
  */
238
352
  protected getFeatureDetailsFlowItem(): Node;
353
+ /**
354
+ * Sets the selected features and updates the first feature as the current selected feature
355
+ * @param features Graphics array of the features selected
356
+ */
357
+ protected setSelectedFeatures(features: __esri.Graphic[]): void;
358
+ /**
359
+ * Set the object id of the current selected feature, and also updates the current selected layer details
360
+ * @param selectedFeature Graphic currently shown in feature details
361
+ */
362
+ protected setCurrentFeature(selectedFeature?: __esri.Graphic): void;
239
363
  /**
240
364
  * On Feature details change update the Layer title and the current selected layer id
241
365
  * @param evt Event hold the details of current feature graphic in the info-card
242
366
  */
243
- protected featureDetailsChanged(evt: any): void;
367
+ protected featureDetailsChanged(evt: CustomEvent): void;
244
368
  /**
245
369
  * Returns the action button to Expand/Collapse side panel in mobile mode
370
+ * @protected
246
371
  */
247
372
  protected getActionToExpandCollapsePanel(): Node;
248
373
  /**
@@ -254,21 +379,30 @@ export declare class CrowdsourceReporter {
254
379
  * Handle map click event
255
380
  * @param layers Array of layerIds
256
381
  *
257
- * @protected
382
+ * @protected
258
383
  */
259
- protected handleMapClick(layers: string[]): void;
384
+ protected handleMapClick(): void;
260
385
  /**
261
386
  * On map click do hitTest and get the clicked graphics of valid layers and show feature details
262
- * @param event
263
- * @param layers
387
+ * @param event IMapClick map click event details
264
388
  *
265
389
  * @protected
266
390
  */
267
- protected onMapClick(event: any, layers: string[]): Promise<void>;
391
+ protected onMapClick(event: IMapClick): Promise<void>;
268
392
  /**
269
393
  * Fetches the component's translations
270
394
  * @returns Promise when complete
271
395
  * @protected
272
396
  */
273
397
  protected _getTranslations(): Promise<void>;
398
+ /**
399
+ * Updates the share url for current selected feature
400
+ * @protected
401
+ */
402
+ protected _updateShareURL(): void;
403
+ /**
404
+ * Navigates to selected features detail based on the URL params
405
+ * @protected
406
+ */
407
+ protected loadFeatureFromURLParams(): Promise<void>;
274
408
  }
@@ -91,6 +91,7 @@ export declare class FeatureList {
91
91
  render(): any;
92
92
  /**
93
93
  * Initialize the features list using the selected layer
94
+ * @protected
94
95
  */
95
96
  protected initializeFeatureItems(): Promise<void>;
96
97
  /**
@@ -23,6 +23,7 @@ interface ILayerDetailsHash {
23
23
  name: string;
24
24
  formattedFeatureCount: string;
25
25
  supportsUpdate: boolean;
26
+ supportsAdd: boolean;
26
27
  }
27
28
  export declare class LayerList {
28
29
  el: HTMLLayerListElement;
@@ -66,6 +67,11 @@ export declare class LayerList {
66
67
  * ILayerItemHash: id/name lookup
67
68
  */
68
69
  protected _layerItemsHash: ILayerItemsHash;
70
+ /**
71
+ * Refresh the layer list which will fetch the latest layer count and update the list
72
+ * @returns Promise that resolves when the operation is complete
73
+ */
74
+ refresh(): Promise<void>;
69
75
  /**
70
76
  * Emitted on demand when feature layer clicked with details layerId and layerName
71
77
  */
@@ -86,6 +86,30 @@ export namespace Components {
86
86
  */
87
87
  "zoomAndScrollToSelected": boolean;
88
88
  }
89
+ interface CreateFeature {
90
+ /**
91
+ * Destroy the Editor widget instance
92
+ * @returns Promise that resolves when the operation is complete
93
+ */
94
+ "close": () => Promise<void>;
95
+ /**
96
+ * boolean: Set this to true when have a custom submit button in the app. This will hide the header and footer elements of the editor and user needs to execute the submit method manually.
97
+ */
98
+ "customizeSubmit"?: boolean;
99
+ /**
100
+ * esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
101
+ */
102
+ "mapView": __esri.MapView;
103
+ /**
104
+ * string: Layer id of the feature layer in which the new feature is to be created
105
+ */
106
+ "selectedLayerId": string;
107
+ /**
108
+ * Submit the created feature
109
+ * @returns Promise that resolves when the operation is complete
110
+ */
111
+ "submit": () => Promise<void>;
112
+ }
89
113
  interface CrowdsourceManager {
90
114
  /**
91
115
  * IBasemapConfig: List of any basemaps to filter out from the basemap widget
@@ -245,6 +269,10 @@ export namespace Components {
245
269
  * boolean: When true the application will be in mobile mode, controls the mobile or desktop view
246
270
  */
247
271
  "isMobile": boolean;
272
+ /**
273
+ * string: Layer id of the feature from URL params
274
+ */
275
+ "layerId": string;
248
276
  /**
249
277
  * string[]: list of layer ids
250
278
  */
@@ -261,6 +289,10 @@ export namespace Components {
261
289
  * esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
262
290
  */
263
291
  "mapView": __esri.MapView;
292
+ /**
293
+ * string: Object id of the feature from URL params
294
+ */
295
+ "objectId": string;
264
296
  /**
265
297
  * string: The word(s) to display in the reports submit button
266
298
  */
@@ -452,6 +484,11 @@ export namespace Components {
452
484
  * string: Error message to be displayed when no layers found
453
485
  */
454
486
  "noLayerErrorMsg"?: string;
487
+ /**
488
+ * Refresh the layer list which will fetch the latest layer count and update the list
489
+ * @returns Promise that resolves when the operation is complete
490
+ */
491
+ "refresh": () => Promise<void>;
455
492
  /**
456
493
  * boolean: if true display's feature count for each layer
457
494
  */
@@ -1268,6 +1305,10 @@ export interface BufferToolsCustomEvent<T> extends CustomEvent<T> {
1268
1305
  detail: T;
1269
1306
  target: HTMLBufferToolsElement;
1270
1307
  }
1308
+ export interface CreateFeatureCustomEvent<T> extends CustomEvent<T> {
1309
+ detail: T;
1310
+ target: HTMLCreateFeatureElement;
1311
+ }
1271
1312
  export interface CrowdsourceReporterCustomEvent<T> extends CustomEvent<T> {
1272
1313
  detail: T;
1273
1314
  target: HTMLCrowdsourceReporterElement;
@@ -1402,6 +1443,26 @@ declare global {
1402
1443
  prototype: HTMLCardManagerElement;
1403
1444
  new (): HTMLCardManagerElement;
1404
1445
  };
1446
+ interface HTMLCreateFeatureElementEventMap {
1447
+ "success": void;
1448
+ "fail": Error;
1449
+ "drawComplete": void;
1450
+ "editingAttachment": boolean;
1451
+ }
1452
+ interface HTMLCreateFeatureElement extends Components.CreateFeature, HTMLStencilElement {
1453
+ addEventListener<K extends keyof HTMLCreateFeatureElementEventMap>(type: K, listener: (this: HTMLCreateFeatureElement, ev: CreateFeatureCustomEvent<HTMLCreateFeatureElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
1454
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1455
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1456
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1457
+ removeEventListener<K extends keyof HTMLCreateFeatureElementEventMap>(type: K, listener: (this: HTMLCreateFeatureElement, ev: CreateFeatureCustomEvent<HTMLCreateFeatureElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
1458
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1459
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1460
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1461
+ }
1462
+ var HTMLCreateFeatureElement: {
1463
+ prototype: HTMLCreateFeatureElement;
1464
+ new (): HTMLCreateFeatureElement;
1465
+ };
1405
1466
  interface HTMLCrowdsourceManagerElement extends Components.CrowdsourceManager, HTMLStencilElement {
1406
1467
  }
1407
1468
  var HTMLCrowdsourceManagerElement: {
@@ -1953,6 +2014,7 @@ declare global {
1953
2014
  "basemap-gallery": HTMLBasemapGalleryElement;
1954
2015
  "buffer-tools": HTMLBufferToolsElement;
1955
2016
  "card-manager": HTMLCardManagerElement;
2017
+ "create-feature": HTMLCreateFeatureElement;
1956
2018
  "crowdsource-manager": HTMLCrowdsourceManagerElement;
1957
2019
  "crowdsource-reporter": HTMLCrowdsourceReporterElement;
1958
2020
  "deduct-calculator": HTMLDeductCalculatorElement;
@@ -2082,6 +2144,36 @@ declare namespace LocalJSX {
2082
2144
  */
2083
2145
  "zoomAndScrollToSelected"?: boolean;
2084
2146
  }
2147
+ interface CreateFeature {
2148
+ /**
2149
+ * boolean: Set this to true when have a custom submit button in the app. This will hide the header and footer elements of the editor and user needs to execute the submit method manually.
2150
+ */
2151
+ "customizeSubmit"?: boolean;
2152
+ /**
2153
+ * esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
2154
+ */
2155
+ "mapView"?: __esri.MapView;
2156
+ /**
2157
+ * Emitted on demand when drawing is completed
2158
+ */
2159
+ "onDrawComplete"?: (event: CreateFeatureCustomEvent<void>) => void;
2160
+ /**
2161
+ * Emitted on demand when editing attachments
2162
+ */
2163
+ "onEditingAttachment"?: (event: CreateFeatureCustomEvent<boolean>) => void;
2164
+ /**
2165
+ * Emitted on demand when the feature creation is failed
2166
+ */
2167
+ "onFail"?: (event: CreateFeatureCustomEvent<Error>) => void;
2168
+ /**
2169
+ * Emitted on demand when the feature is created successfully
2170
+ */
2171
+ "onSuccess"?: (event: CreateFeatureCustomEvent<void>) => void;
2172
+ /**
2173
+ * string: Layer id of the feature layer in which the new feature is to be created
2174
+ */
2175
+ "selectedLayerId"?: string;
2176
+ }
2085
2177
  interface CrowdsourceManager {
2086
2178
  /**
2087
2179
  * IBasemapConfig: List of any basemaps to filter out from the basemap widget
@@ -2241,6 +2333,10 @@ declare namespace LocalJSX {
2241
2333
  * boolean: When true the application will be in mobile mode, controls the mobile or desktop view
2242
2334
  */
2243
2335
  "isMobile"?: boolean;
2336
+ /**
2337
+ * string: Layer id of the feature from URL params
2338
+ */
2339
+ "layerId"?: string;
2244
2340
  /**
2245
2341
  * string[]: list of layer ids
2246
2342
  */
@@ -2257,6 +2353,10 @@ declare namespace LocalJSX {
2257
2353
  * esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
2258
2354
  */
2259
2355
  "mapView"?: __esri.MapView;
2356
+ /**
2357
+ * string: Object id of the feature from URL params
2358
+ */
2359
+ "objectId"?: string;
2260
2360
  /**
2261
2361
  * Emitted when toggle panel button is clicked in reporter
2262
2362
  */
@@ -3302,6 +3402,7 @@ declare namespace LocalJSX {
3302
3402
  "basemap-gallery": BasemapGallery;
3303
3403
  "buffer-tools": BufferTools;
3304
3404
  "card-manager": CardManager;
3405
+ "create-feature": CreateFeature;
3305
3406
  "crowdsource-manager": CrowdsourceManager;
3306
3407
  "crowdsource-reporter": CrowdsourceReporter;
3307
3408
  "deduct-calculator": DeductCalculator;
@@ -3357,6 +3458,7 @@ declare module "@stencil/core" {
3357
3458
  "basemap-gallery": LocalJSX.BasemapGallery & JSXBase.HTMLAttributes<HTMLBasemapGalleryElement>;
3358
3459
  "buffer-tools": LocalJSX.BufferTools & JSXBase.HTMLAttributes<HTMLBufferToolsElement>;
3359
3460
  "card-manager": LocalJSX.CardManager & JSXBase.HTMLAttributes<HTMLCardManagerElement>;
3461
+ "create-feature": LocalJSX.CreateFeature & JSXBase.HTMLAttributes<HTMLCreateFeatureElement>;
3360
3462
  "crowdsource-manager": LocalJSX.CrowdsourceManager & JSXBase.HTMLAttributes<HTMLCrowdsourceManagerElement>;
3361
3463
  "crowdsource-reporter": LocalJSX.CrowdsourceReporter & JSXBase.HTMLAttributes<HTMLCrowdsourceReporterElement>;
3362
3464
  "deduct-calculator": LocalJSX.DeductCalculator & JSXBase.HTMLAttributes<HTMLDeductCalculatorElement>;
@@ -502,6 +502,13 @@ declare module "preact/src/jsx" {
502
502
 
503
503
  "card-manager": JSX.SolutionsCardManager & JSXInternal.HTMLAttributes<HTMLSolutionsCardManagerElement>
504
504
 
505
+ "create-feature": Omit<JSX.SolutionsCreateFeature, "onSuccess" | "onFail" | "onDrawComplete" | "onEditingAttachment"> & JSXInternal.HTMLAttributes<HTMLSolutionsCreateFeatureElement> & {
506
+ "onsuccess"?: (event: CustomEvent<any>) => void;
507
+ "onfail"?: (event: CustomEvent<any>) => void;
508
+ "ondrawComplete"?: (event: CustomEvent<any>) => void;
509
+ "oneditingAttachment"?: (event: CustomEvent<any>) => void;
510
+ }
511
+
505
512
  "crowdsource-manager": JSX.SolutionsCrowdsourceManager & JSXInternal.HTMLAttributes<HTMLSolutionsCrowdsourceManagerElement>
506
513
 
507
514
  "crowdsource-reporter": Omit<JSX.SolutionsCrowdsourceReporter, "onTogglePanel"> & JSXInternal.HTMLAttributes<HTMLSolutionsCrowdsourceReporterElement> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solutions-components",
3
- "version": "0.7.30",
3
+ "version": "0.7.32",
4
4
  "description": "Web Components for Esri's Solutions Applications",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,h as s,H as e,g as h}from"./p-78780f63.js";import{l as a,g as o}from"./p-e902ba19.js";import{a as l}from"./p-2c382841.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-c1cf3ebc.js";const c=class{constructor(s){t(this,s),this.togglePanel=i(this,"togglePanel",7),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,this._selectedLayerName=void 0}async isMobileWatchHandler(){this._sidePanelCollapsed=!1}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.setMapView()}))}async componentWillLoad(){await this._initModules(),await this._getTranslations()}render(){return s(e,null,s("div",null,s("calcite-shell",{"content-behind":!0},this._getReporter())))}async _initModules(){const[t]=await a(["esri/core/reactiveUtils"]);this.reactiveUtils=t}_getReporter(){const t=[];return this._flowItems.forEach((i=>{switch(i){case"layer-list":t.push(this.getLayerListFlowItem());break;case"feature-list":t.push(this.getFeatureListFlowItem(this._selectedLayerId,this._selectedLayerName));break;case"feature-details":t.push(this.getFeatureDetailsFlowItem())}})),s("calcite-panel",{class:"width-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},this.mapView?s("calcite-flow",null,(null==t?void 0:t.length)>0&&t):s("calcite-loader",{scale:"m"}))}getLayerListFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this.reportsHeader},this._hasValidLayers&&s("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&&s("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&&s("calcite-button",{appearance:"secondary",slot:"footer",width:"full"},this.reportButtonText),s("calcite-panel",{"full-height":!0,"full-width":!0},s("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),showFeatureCount:!0,showNextIcon:!0})))}layerListLoaded(t){const i=t.detail;this.handleMapClick(i),this._hasValidLayers=i.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,this.togglePanel.emit(this._sidePanelCollapsed)}async onFeatureSelectFromList(t){this._selectedFeature=[t.detail],this._flowItems=[...this._flowItems,"feature-details"]}getFeatureListFlowItem(t,i){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:i,onCalciteFlowItemBack:this.backFromFeatureList.bind(this)},s("calcite-action",{icon:"sort-ascending-arrow",slot:this.isMobile?"header-menu-actions":"header-actions-end",text:this._translations.sort,"text-enabled":this.isMobile}),s("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&&s("calcite-button",{appearance:"secondary",slot:"footer",width:"full"},this.reportButtonText),s("calcite-panel",{"full-height":!0},s("feature-list",{class:"height-full",highlightOnMap:!0,mapView:this.mapView,noFeaturesFoundMsg:this._translations.featureErrorMsg,onFeatureSelect:this.onFeatureSelectFromList.bind(this),pageSize:30,selectedLayerId:t})))}getFeatureDetailsFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._selectedLayerName,onCalciteFlowItemBack:this.backFromFeatureList.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),s("calcite-action",{icon:"share",slot:"header-actions-end",text:this._translations.share}),s("calcite-panel",{"full-height":!0},s("info-card",{allowEditing:!1,graphics:this._selectedFeature,isLoading:!1,isMobile:!1,mapView:this.mapView,onSelectionChanged:this.featureDetailsChanged.bind(this),zoomAndScrollToSelected:!0})))}featureDetailsChanged(t){this._selectedLayerId=t.detail[0].layer.id,this._selectedLayerName=t.detail[0].layer.title}getActionToExpandCollapsePanel(){return s("calcite-action",{icon:this._sidePanelCollapsed?"chevrons-up":"chevrons-down",onClick:this.toggleSidePanel.bind(this),slot:"header-actions-end",text:this._sidePanelCollapsed?this._translations.expand:this._translations.collapse})}async setMapView(){this.mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this.mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}handleMapClick(t){this._mapClickHandle&&this._mapClickHandle.remove(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(i=>{this.onMapClick(i,t)}))}async onMapClick(t,i){this.mapView.popupEnabled=!1;const s=await l(this.mapView),e=[];s.forEach((t=>{i.includes(t.id)&&e.push(t)}));const h={include:e},a=await this.mapView.hitTest(t,h);if(a.results.length>0){const t=[];a.results.forEach((function(i){"graphic"===i.type&&t.push(i.graphic)})),this._selectedFeature=t,this._flowItems=this._flowItems.length&&"feature-details"!==this._flowItems[this._flowItems.length-1]?[...this._flowItems,"feature-details"]:[...this._flowItems]}}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}get el(){return h(this)}static get watchers(){return{isMobile:["isMobileWatchHandler"],mapView:["mapViewWatchHandler"]}}};c.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)}.error-msg{padding:10px}";export{c as crowdsource_reporter}