@esri/solutions-components 0.8.25 → 0.8.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +6 -6
  2. package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
  3. package/dist/cjs/calcite-alert_4.cjs.entry.js +6 -6
  4. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +1 -1
  5. package/dist/cjs/calcite-flow_6.cjs.entry.js +87 -58
  6. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +7 -7
  7. package/dist/cjs/card-manager_3.cjs.entry.js +2 -2
  8. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  9. package/dist/cjs/crowdsource-reporter.cjs.entry.js +1 -1
  10. package/dist/cjs/deduct-calculator.cjs.entry.js +1 -1
  11. package/dist/cjs/feature-comments.cjs.entry.js +1 -1
  12. package/dist/cjs/feature-form-flow-item.cjs.entry.js +1 -1
  13. package/dist/cjs/feature-list.cjs.entry.js +3 -3
  14. package/dist/cjs/features-flow-item.cjs.entry.js +1 -1
  15. package/dist/cjs/layout-manager.cjs.entry.js +1 -1
  16. package/dist/cjs/list-flow-item.cjs.entry.js +1 -1
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/cjs/location-flow-item.cjs.entry.js +1 -1
  19. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  20. package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
  21. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  22. package/dist/cjs/refine-results-flow-item.cjs.entry.js +1 -1
  23. package/dist/cjs/share-item.cjs.entry.js +1 -1
  24. package/dist/cjs/solution-configuration.cjs.entry.js +3 -3
  25. package/dist/cjs/solution-contents_3.cjs.entry.js +3 -3
  26. package/dist/cjs/solution-item-icon.cjs.entry.js +1 -1
  27. package/dist/cjs/solutions-components.cjs.js +1 -1
  28. package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
  29. package/dist/collection/components/create-feature/create-feature.js +82 -50
  30. package/dist/collection/components/create-related-feature/create-related-feature.js +1 -1
  31. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +1 -1
  32. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +1 -1
  33. package/dist/collection/components/deduct-calculator/deduct-calculator.js +1 -1
  34. package/dist/collection/components/delete-button/delete-button.css +4 -0
  35. package/dist/collection/components/delete-button/delete-button.js +2 -2
  36. package/dist/collection/components/edit-card/edit-card.js +1 -1
  37. package/dist/collection/components/feature-comments/feature-comments.js +1 -1
  38. package/dist/collection/components/feature-details/feature-details.js +6 -6
  39. package/dist/collection/components/feature-form-flow-item/feature-form-flow-item.js +1 -1
  40. package/dist/collection/components/feature-list/feature-list.js +3 -3
  41. package/dist/collection/components/features-flow-item/features-flow-item.js +1 -1
  42. package/dist/collection/components/floor-filter/floor-filter.js +1 -1
  43. package/dist/collection/components/info-card/info-card.js +2 -2
  44. package/dist/collection/components/json-editor/json-editor.js +1 -1
  45. package/dist/collection/components/layer-table/layer-table.js +1 -1
  46. package/dist/collection/components/layout-manager/layout-manager.js +1 -1
  47. package/dist/collection/components/list-flow-item/list-flow-item.js +1 -1
  48. package/dist/collection/components/location-flow-item/location-flow-item.js +1 -1
  49. package/dist/collection/components/map-card/map-card.js +1 -1
  50. package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
  51. package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
  52. package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
  53. package/dist/collection/components/map-legend/map-legend.js +1 -1
  54. package/dist/collection/components/map-picker/map-picker.js +1 -1
  55. package/dist/collection/components/map-search/map-search.js +1 -1
  56. package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
  57. package/dist/collection/components/map-tools/map-tools.js +1 -1
  58. package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
  59. package/dist/collection/components/pdf-download/pdf-download.js +1 -1
  60. package/dist/collection/components/public-notification/public-notification.js +1 -1
  61. package/dist/collection/components/refine-results-flow-item/refine-results-flow-item.js +1 -1
  62. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  63. package/dist/collection/components/share-item/share-item.js +1 -1
  64. package/dist/collection/components/solution-configuration/solution-configuration.js +3 -3
  65. package/dist/collection/components/solution-contents/solution-contents.js +1 -1
  66. package/dist/collection/components/solution-item/solution-item.js +1 -1
  67. package/dist/collection/components/solution-item-details/solution-item-details.js +1 -1
  68. package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
  69. package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
  70. package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -1
  71. package/dist/collection/components/solution-resource-item/solution-resource-item.js +1 -1
  72. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +1 -1
  73. package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
  74. package/dist/collection/components/solution-variables/solution-variables.js +1 -1
  75. package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
  76. package/dist/components/create-feature2.js +90 -53
  77. package/dist/components/create-related-feature2.js +1 -1
  78. package/dist/components/crowdsource-manager.js +1 -1
  79. package/dist/components/crowdsource-reporter.js +1 -1
  80. package/dist/components/deduct-calculator2.js +1 -1
  81. package/dist/components/delete-button2.js +3 -3
  82. package/dist/components/edit-card2.js +1 -1
  83. package/dist/components/feature-comments.js +1 -1
  84. package/dist/components/feature-details2.js +6 -6
  85. package/dist/components/feature-form-flow-item.js +1 -1
  86. package/dist/components/feature-list2.js +3 -3
  87. package/dist/components/features-flow-item.js +1 -1
  88. package/dist/components/floor-filter2.js +1 -1
  89. package/dist/components/info-card2.js +2 -2
  90. package/dist/components/json-editor2.js +1 -1
  91. package/dist/components/layer-table2.js +1 -1
  92. package/dist/components/layout-manager.js +1 -1
  93. package/dist/components/list-flow-item.js +1 -1
  94. package/dist/components/location-flow-item.js +1 -1
  95. package/dist/components/map-card2.js +1 -1
  96. package/dist/components/map-draw-tools2.js +1 -1
  97. package/dist/components/map-fullscreen2.js +1 -1
  98. package/dist/components/map-layer-picker2.js +1 -1
  99. package/dist/components/map-legend2.js +1 -1
  100. package/dist/components/map-picker2.js +1 -1
  101. package/dist/components/map-search2.js +1 -1
  102. package/dist/components/map-select-tools2.js +1 -1
  103. package/dist/components/map-tools2.js +1 -1
  104. package/dist/components/pci-calculator.js +1 -1
  105. package/dist/components/pdf-download2.js +1 -1
  106. package/dist/components/public-notification.js +1 -1
  107. package/dist/components/refine-results-flow-item.js +1 -1
  108. package/dist/components/refine-selection2.js +1 -1
  109. package/dist/components/share-item.js +1 -1
  110. package/dist/components/solution-configuration.js +3 -3
  111. package/dist/components/solution-contents2.js +1 -1
  112. package/dist/components/solution-item-details2.js +1 -1
  113. package/dist/components/solution-item-icon2.js +1 -1
  114. package/dist/components/solution-item-sharing2.js +1 -1
  115. package/dist/components/solution-item2.js +1 -1
  116. package/dist/components/solution-organization-variables2.js +1 -1
  117. package/dist/components/solution-resource-item2.js +1 -1
  118. package/dist/components/solution-spatial-ref2.js +1 -1
  119. package/dist/components/solution-template-data2.js +1 -1
  120. package/dist/components/solution-variables2.js +1 -1
  121. package/dist/components/spatial-ref2.js +1 -1
  122. package/dist/esm/basemap-gallery_7.entry.js +6 -6
  123. package/dist/esm/buffer-tools_3.entry.js +1 -1
  124. package/dist/esm/calcite-alert_4.entry.js +6 -6
  125. package/dist/esm/calcite-dropdown-group_2.entry.js +1 -1
  126. package/dist/esm/calcite-flow_6.entry.js +87 -58
  127. package/dist/esm/calcite-shell-panel_14.entry.js +7 -7
  128. package/dist/esm/card-manager_3.entry.js +2 -2
  129. package/dist/esm/crowdsource-manager.entry.js +1 -1
  130. package/dist/esm/crowdsource-reporter.entry.js +1 -1
  131. package/dist/esm/deduct-calculator.entry.js +1 -1
  132. package/dist/esm/feature-comments.entry.js +1 -1
  133. package/dist/esm/feature-form-flow-item.entry.js +1 -1
  134. package/dist/esm/feature-list.entry.js +3 -3
  135. package/dist/esm/features-flow-item.entry.js +1 -1
  136. package/dist/esm/layout-manager.entry.js +1 -1
  137. package/dist/esm/list-flow-item.entry.js +1 -1
  138. package/dist/esm/loader.js +1 -1
  139. package/dist/esm/location-flow-item.entry.js +1 -1
  140. package/dist/esm/map-select-tools_3.entry.js +3 -3
  141. package/dist/esm/pci-calculator.entry.js +1 -1
  142. package/dist/esm/public-notification.entry.js +1 -1
  143. package/dist/esm/refine-results-flow-item.entry.js +1 -1
  144. package/dist/esm/share-item.entry.js +1 -1
  145. package/dist/esm/solution-configuration.entry.js +3 -3
  146. package/dist/esm/solution-contents_3.entry.js +3 -3
  147. package/dist/esm/solution-item-icon.entry.js +1 -1
  148. package/dist/esm/solutions-components.js +1 -1
  149. package/dist/esm/spatial-ref.entry.js +1 -1
  150. package/dist/solutions-components/{p-2c044250.entry.js → p-053be79f.entry.js} +2 -2
  151. package/dist/solutions-components/{p-1ff9eb95.entry.js → p-05b3a5d9.entry.js} +1 -1
  152. package/dist/solutions-components/p-0d17246a.entry.js +6 -0
  153. package/dist/solutions-components/{p-b3160299.entry.js → p-1e915546.entry.js} +1 -1
  154. package/dist/solutions-components/{p-97e343df.entry.js → p-1f4b174f.entry.js} +1 -1
  155. package/dist/solutions-components/p-27e9ea86.entry.js +6 -0
  156. package/dist/solutions-components/{p-72317f8e.entry.js → p-296375d3.entry.js} +2 -2
  157. package/dist/solutions-components/{p-af4be4ce.entry.js → p-2a6db6e8.entry.js} +1 -1
  158. package/dist/solutions-components/p-4870be89.entry.js +6 -0
  159. package/dist/solutions-components/p-51b5ac05.entry.js +6 -0
  160. package/dist/solutions-components/{p-686fa7ce.entry.js → p-66722851.entry.js} +1 -1
  161. package/dist/solutions-components/{p-f35cc7ae.entry.js → p-81747268.entry.js} +1 -1
  162. package/dist/solutions-components/{p-84a5d221.entry.js → p-92eadd14.entry.js} +1 -1
  163. package/dist/solutions-components/{p-fc665a1a.entry.js → p-96c901b4.entry.js} +1 -1
  164. package/dist/solutions-components/p-9cfc59dd.entry.js +6 -0
  165. package/dist/solutions-components/{p-16730f05.entry.js → p-b656b73e.entry.js} +1 -1
  166. package/dist/solutions-components/{p-8c500fd7.entry.js → p-bfdabb9d.entry.js} +1 -1
  167. package/dist/solutions-components/p-c5becad1.entry.js +6 -0
  168. package/dist/solutions-components/{p-102b1f94.entry.js → p-cb20ba34.entry.js} +1 -1
  169. package/dist/solutions-components/p-cd694107.entry.js +17 -0
  170. package/dist/solutions-components/p-e1662e32.entry.js +6 -0
  171. package/dist/solutions-components/p-eda6994e.entry.js +6 -0
  172. package/dist/solutions-components/{p-bf57dbfd.entry.js → p-edcc1f23.entry.js} +1 -1
  173. package/dist/solutions-components/p-f7b791a8.entry.js +6 -0
  174. package/dist/solutions-components/p-fac36b42.entry.js +6 -0
  175. package/dist/solutions-components/{p-33845a79.entry.js → p-fd28754c.entry.js} +1 -1
  176. package/dist/solutions-components/solutions-components.esm.js +1 -1
  177. package/dist/types/components/create-feature/create-feature.d.ts +21 -3
  178. package/package.json +1 -1
  179. package/dist/solutions-components/p-28c6906c.entry.js +0 -6
  180. package/dist/solutions-components/p-3470c0f7.entry.js +0 -6
  181. package/dist/solutions-components/p-3fae9775.entry.js +0 -6
  182. package/dist/solutions-components/p-5b817c98.entry.js +0 -6
  183. package/dist/solutions-components/p-71de367b.entry.js +0 -6
  184. package/dist/solutions-components/p-8a81f3c7.entry.js +0 -6
  185. package/dist/solutions-components/p-aa06f4d1.entry.js +0 -6
  186. package/dist/solutions-components/p-b76b5310.entry.js +0 -6
  187. package/dist/solutions-components/p-c047a6fc.entry.js +0 -6
  188. package/dist/solutions-components/p-c2ec0dcc.entry.js +0 -17
  189. package/dist/solutions-components/p-e9176a44.entry.js +0 -6
@@ -35,6 +35,10 @@ export declare class CreateFeature {
35
35
  * ISearchConfiguration: Configuration details for the Search widget
36
36
  */
37
37
  searchConfiguration: ISearchConfiguration;
38
+ /**
39
+ * boolean: When true a loading indicator will be shown while the editor loads
40
+ */
41
+ _editorLoading: boolean;
38
42
  /**
39
43
  * boolean: When true the search widget will shown
40
44
  */
@@ -72,14 +76,22 @@ export declare class CreateFeature {
72
76
  * boolean: Flag to maintain the add attachment
73
77
  */
74
78
  protected _addingAttachment: boolean;
79
+ /**
80
+ * HTMLDivElement: The node the editor will be added to
81
+ */
82
+ protected _container: HTMLDivElement;
75
83
  /**
76
84
  * boolean: Flag to maintain form submission using submit button
77
85
  */
78
86
  protected _isSubmitBtnClicked: boolean;
79
87
  /**
80
- * Called each time the mapView prop is changed.
81
- */
88
+ * Called each time the mapView prop is changed.
89
+ */
82
90
  mapViewWatchHandler(): Promise<void>;
91
+ /**
92
+ * When _editorLoading is true the container node will be hidden while starting the create workflow
93
+ */
94
+ _editorLoadingWatchHandler(v: boolean): Promise<void>;
83
95
  /**
84
96
  * Destroy the Editor widget instance
85
97
  * @returns Promise that resolves when the operation is complete
@@ -161,11 +173,17 @@ export declare class CreateFeature {
161
173
  * Hides the elements of editor widget
162
174
  * @protected
163
175
  */
164
- protected hideEditorsElements(): void;
176
+ protected hideEditorsElements(): Promise<void>;
165
177
  /**
166
178
  * On creation of feature emit the event that the feature is created
167
179
  * @param evt feature submit event
168
180
  * @protected
169
181
  */
170
182
  protected submitted(evt: any): Promise<void>;
183
+ /**
184
+ * call setTimeout in Promise wrapper
185
+ * @param delay The time, in milliseconds that the timer should wait before the promise is resolved
186
+ * @protected
187
+ */
188
+ protected timeout(delay: number): Promise<void>;
171
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solutions-components",
3
- "version": "0.8.25",
3
+ "version": "0.8.26",
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 e,h as s,H as a,g as t}from"./p-6d753a3d.js";const c=class{constructor(s){e(this,s)}render(){return s(a,{key:"388f7097c0cfc5b9c6cc6649ff00e9fd0be1c6aa"},s("slot",{key:"31a2a3694358fe14a2195da82063f3be0500b3d8"}))}get el(){return t(this)}};c.style=":host{display:block}";export{c as feature_comments}
@@ -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 e,h as a,H as i,g as t}from"./p-6d753a3d.js";import{c as l}from"./p-8294d644.js";const s=class{constructor(a){e(this,a),this.showAddDeduct=!1}render(){const e=this.showAddDeduct?"position-relative":"display-none";return a(i,{key:"afa9619bc233e51ff10ecbd0f751c14d2cebfc82"},a("div",{key:"507ba13d0e9a79758f52480bdbf9605b5154cb0e",class:this.showAddDeduct?"display-none":"display-grid"},a("div",{key:"dfeb3d2d1e228ea2e38073f5ce49b7af7c3172e4",class:"label-display"},a("calcite-label",{key:"e7f1ad67dc48060342f4d1d73dae9257a47a8992",class:"label-display"},"Enter comma delimited deduct values",this._getDeductValuesInput())),a("div",{key:"6bc4c6101387ef44b72bceb409c1550bcb36b290"},this._getCalculateButton())),a("div",{key:"ceb863669ecfca2f84710f4811d30f816e26c6c8",class:e},a("div",{key:"897bd23fb38bfea7d39345a224a1c5384129be7d",class:"position-right"},a("calcite-action",{key:"9a2744cc4815b9976450ea9683e757d32d06b946",appearance:"transparent",class:"float-end",icon:"x",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""})),a("deduct-calculator",{key:"ff5d517f67ec4752dbc72bf829ec87d967b89db1",class:"display-grid padding-top-1",onDeductValueComplete:e=>this._addDeductValue(e)})))}_getDeductValuesInput(){return a("div",{class:"display-flex"},a("calcite-input",{class:"main-input",ref:e=>{this._deductValuesElement=e}}),a("calcite-action",{appearance:"transparent",icon:"plus-circle",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""}))}_getCalculateButton(){return a("calcite-button",{onClick:()=>this._calculatePCI(this._deductValuesElement.value)},"Calculate PCI")}_toggleShowAddDeduct(){this.showAddDeduct=!this.showAddDeduct}_addDeductValue(e){this._toggleShowAddDeduct(),this._deductValuesElement.value+=Math.abs(parseFloat(this._deductValuesElement.value))>0?`,${e.detail}`:e.detail}_calculatePCI(e){const a=l(e,!0),i=a<=10?"Failed":a<=25?"Serious":a<=40?"Very Poor":a<=55?"Poor":a<=70?"Fair":a<=85?"Satisfactory":"Good";console.log(`PCI: ${a}`),console.log(`Rating: ${i}`),alert("See debug console for results")}get el(){return t(this)}};s.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";export{s as pci_calculator}
@@ -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 e,h as a,H as s,g as c}from"./p-6d753a3d.js";const r=class{constructor(a){e(this,a)}render(){return a(s,{key:"99ce98d1216732f934a30c4906603846f30bed3c"},a("slot",{key:"eaa9fec6228279c1dace55b24fab53af5a332cc6"}))}get el(){return c(this)}};r.style=":host{display:block}";export{r as share_item}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,h as s,g as e}from"./p-6d753a3d.js";import{l as a,g as h}from"./p-896c9644.js";import{P as n}from"./p-a1037b19.js";import{g as o,c,h as l}from"./p-583e5dd0.js";import"./p-82e085d0.js";import"./p-6f69de4d.js";import"./p-334e6394.js";import"./p-a230b270.js";import"./p-530b73ce.js";import"./p-c1cf3ebc.js";const r=class{constructor(s){t(this,s),this.featureSelect=i(this,"featureSelect",7),this.selectedLayerId=void 0,this.mapView=void 0,this.noFeaturesFoundMsg=void 0,this.pageSize=100,this.highlightOnMap=!1,this.highlightOnHover=!1,this.sortingInfo=void 0,this.whereClause=void 0,this.textSize="large",this.showInitialLoading=!0,this.showErrorWhenNoFeatures=!0,this._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._translations=void 0}async selectedLayerWatchHandler(){this._selectedLayer=await o(this.mapView,this.selectedLayerId),await this.initializeFeatureItems()}async sortingInfoWatchHandler(){await this.initializeFeatureItems()}async whereClauseHandler(){await this.initializeFeatureItems()}async refresh(){await this.initializeFeatureItems()}async componentWillLoad(){await this.initModules(),await this._getTranslations(),this._isLoading=this.showInitialLoading,this._popupUtils=new n,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await o(this.mapView,this.selectedLayerId))}async componentDidLoad(){await this.initializeFeatureItems()}render(){return s("calcite-panel",{key:"6184d07592669fd8884996475b7eeb26e0604790","full-height":!0,"full-width":!0},this._isLoading&&s("calcite-loader",{key:"282127215213a28b9cfdf484aaf5730145b6bb55",label:"",scale:"m"}),this.showErrorWhenNoFeatures&&0===this._featureItems.length&&!this._isLoading&&s("calcite-notice",{key:"25fcfeb1d19a089b092050515c3d69401bc17dc8",class:"error-msg",icon:"feature-details",kind:"info",open:!0},s("div",{key:"2ac81a338df9d0e0f43c659a24be0c9b7b95d027",slot:"message"},this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg)),s("calcite-list",{key:"70453e8ded4f859076a5f00d8f04152cd78278d8","selection-appearance":"border","selection-mode":"none"},!this._isLoading&&this._featureItems.length>0&&this._featureItems),this._featuresCount>this.pageSize&&s("div",{key:"db1003ace54cd599acefad04e94fe54248327126",class:"width-full",slot:"footer"},s("calcite-pagination",{key:"67764a051381b0e7ef26dbd16dc9226d7e152c20",class:"pagination","full-width":!0,onCalcitePaginationChange:this.pageChanged.bind(this),"page-size":this.pageSize,ref:t=>this._pagination=t,"start-item":"1","total-items":this._featuresCount})))}async initModules(){const[t]=await a(["esri/Color"]);this.Color=t}getWhereCondition(){var t;let i="1=1";return this.whereClause&&(i=this.whereClause),(null===(t=this._selectedLayer)||void 0===t?void 0:t.definitionExpression)&&(i=i+" AND "+this._selectedLayer.definitionExpression),i}async initializeFeatureItems(){var t;if(this._selectedLayer){null===(t=this._pagination)||void 0===t||t.goTo("start"),this._isLoading=this.showInitialLoading,this._featureItems=await this.queryPage(0);const i={where:this.getWhereCondition()};this._featuresCount=await this._selectedLayer.queryFeatureCount(i),this._isLoading=!1}}async pageChanged(t){this._isLoading=!0,this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null);const i=t.target.startItem-1;this._featureItems=await this.queryPage(i),this._isLoading=!1}async featureClicked(t,i){if(this.clearHighlights(),this.highlightOnMap){const i=Number(t.target.value),s=await c(this.mapView,this.selectedLayerId);this._highlightHandle=await l([i],s,this.mapView,!0)}await this.emitSelectedFeature(i)}async emitSelectedFeature(t){const i=t.layer,s=i.createQuery();s.returnGeometry=!0,s.objectIds=[t.getObjectId()];const e=await i.queryFeatures(s);this.featureSelect.emit(e.features[0])}async onFeatureHover(t){if(this.clearHighlights(),this.highlightOnHover){const i=t.getObjectId(),s=await c(this.mapView,this.selectedLayerId);s.highlightOptions={color:new this.Color("#FFFF00")},this._highlightHandle=s.highlight([i])}}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}async queryPage(t){var i,s;const e=this._selectedLayer,a=(null===(i=this.sortingInfo)||void 0===i?void 0:i.field)?this.sortingInfo.field:e.objectIdField,h=(null===(s=this.sortingInfo)||void 0===s?void 0:s.order)?this.sortingInfo.order:"desc",n={start:t,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:this.getWhereCondition(),outSpatialReference:this.mapView.spatialReference.toJSON()};a&&h&&(n.orderByFields=[a.toString()+" "+h]);const o=await e.queryFeatures(n);return await this.createFeatureItem(o)}async createFeatureItem(t){const i=(null==t?void 0:t.features).map((async t=>{const i=await this._popupUtils.getPopupTitle(t,this.mapView.map);return this.getFeatureItem(t,i)}));return Promise.all(i)}getFeatureItem(t,i){const e=t.attributes[this._selectedLayer.objectIdField].toString();return s("calcite-list-item",{onCalciteListItemSelect:i=>{this.featureClicked(i,t)},onMouseLeave:()=>{this.clearHighlights()},onMouseOver:()=>{this.onFeatureHover(t)},value:e},s("div",{class:"small"===this.textSize?"feature-list-popup-title-small":"feature-list-popup-title",slot:"content-start"},i=null!=i?i:e),s("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{selectedLayerId:["selectedLayerWatchHandler"],sortingInfo:["sortingInfoWatchHandler"],whereClause:["whereClauseHandler"]}}};r.style=":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px;white-space:pre-line}.feature-list-popup-title-small{font-size:small;padding:10px 12px;white-space:pre-line}";export{r as feature_list}
@@ -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 e,h as s,H as t,g as r}from"./p-6d753a3d.js";const d=class{constructor(s){e(this,s)}render(){return s(t,{key:"294c2df1aa37bf2276716e93953fb9670d08ed2d"},s("slot",{key:"b57b34de225e39fda047027286f8eb8367f335df"}))}get el(){return r(this)}};d.style=":host{display:block}";export{d as list_flow_item}
@@ -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 e,h as s,H as r,g as t}from"./p-6d753a3d.js";const a=class{constructor(s){e(this,s)}render(){return s(r,{key:"850d0a10f8c3e2f35abdd1a07f00c4ff04ab9f76"},s("slot",{key:"c1c1e3fceff2787447a2dbd3568c497cd050195b"}))}get el(){return t(this)}};a.style=":host{display:block}";export{a as refine_results_flow_item}
@@ -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 a,h as s,H as t,g as e}from"./p-6d753a3d.js";const o=class{constructor(s){a(this,s)}render(){return s(t,{key:"a9741da11365a4ce9b1504da6f6c84542bdfd556"},s("slot",{key:"3f98024fa3209a783296a2f80267dff08a13eb2f"}))}get el(){return e(this)}};o.style=":host{display:block}";export{o as location_flow_item}
@@ -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 e,c as a,h as t,H as l,g as c}from"./p-6d753a3d.js";import{E as i,a as s,b as r}from"./p-8294d644.js";const b=class{constructor(t){e(this,t),this.deductValueComplete=a(this,"deductValueComplete",7),this._types=Object.keys(i).filter((e=>!isNaN(Number(i[e]))))}render(){return t(l,{key:"68401afdbb18147910d55f13cae4c019bda9f020"},t("div",{key:"88b89c1a9b260024f28315574539f47bd0bd0a3a",class:"label-display"},t("calcite-label",{key:"8e81c5e65fe272c547addd3915ccc6a7da48a5b8",class:"label-display"},"Density %",this._getDensityInput()),t("calcite-label",{key:"f549369baa3b681922c07b2c91a626664e98309f",class:"label-display"},"Type",this._getTypeInput()),t("calcite-label",{key:"e850fbf5d9728f969c289946c3518a30316e88b9",class:"label-display"},"Severity",this._getSeverityInput())),t("div",{key:"2485c0b0f0c2681b1af7cf55478ec34efb734a46"},this._getCalculateInput()))}_getDensityInput(){return t("calcite-input",{max:100,min:0,ref:e=>{this._densityElement=e},type:"number"})}_getTypeInput(){return t("calcite-select",{label:"",ref:e=>{this._typeElement=e}},this._types.map(((e,a)=>t("calcite-option",{value:i[e].toString()},`${e} (${a+1})`))))}_getSeverityInput(){return t("calcite-select",{label:"",ref:e=>{this._severityElement=e}},t("calcite-option",{value:s.H},"High"),t("calcite-option",{value:s.M},"Medium"),t("calcite-option",{value:s.L},"Low"))}_getCalculateInput(){return t("calcite-button",{onClick:()=>this._calculateDeduct(parseFloat(this._typeElement.value),this._severityElement.value,parseFloat(this._densityElement.value))},"Calculate Deduct Value")}_calculateDeduct(e,a,t){if(e&&a&&!isNaN(t)){const l=r(e.toString(),a.toString(),t.toString(),!0);this.deductValueComplete.emit(l),alert(l)}else alert("Type, severity, and a density number are required")}get el(){return c(this)}};b.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}";export{b as deduct_calculator}
@@ -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 e,h as a,H as s,g as t}from"./p-6d753a3d.js";const r=class{constructor(a){e(this,a)}render(){return a(s,{key:"e0d4102af27d4ca25cb6257292797c2900337ec7"},a("slot",{key:"ea50a07d3d33ee0b67bc5a27a71bc7ea597fb008"}))}get el(){return t(this)}};r.style=":host{display:block}";export{r as features_flow_item}
@@ -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-6d753a3d.js";import{c as n}from"./p-bfd3d428.js";import{c as h,s as c,a as l}from"./p-a25bbcc1.js";import{a as r}from"./p-67b26725.js";import{c as d,u as b,d as f,I as p}from"./p-9db9645e.js";import{c as u,d as m}from"./p-b5bfe190.js";import{c as v,s as y,d as g,u as w}from"./p-2e625f11.js";import{S as k}from"./p-d2b66bd2.js";import{l as x,f as L,g as C}from"./p-896c9644.js";import{a as _,g as S,b as j,d as E}from"./p-583e5dd0.js";import"./p-b85be429.js";import"./p-db50226e.js";import"./p-820d8935.js";import"./p-f50a294b.js";import"./p-82e085d0.js";import"./p-c1cf3ebc.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.8.2
11
- */const I="frame",F="frame--advancing",W="frame--retreating",z=class{constructor(i){t(this,i),this.itemMutationObserver=n("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,n=e[o-1],h=e[o-2];if(o&&n&&e.forEach((t=>{t.showBackButton=t===n&&o>1,t.hidden=t!==n})),h&&(h.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 h(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(){l(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",{key:"9d405841d7a1ee2d7a5da28c02ef8d5bf08dd9f5",class:{[I]:!0,[F]:"advancing"===t,[W]:"retreating"===t}},i("slot",{key:"a02231a5002f8b19542e03529aad12771787b26f"}))}get el(){return s(this)}};z.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.8.2
16
- */
17
- const D=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.overlayPositioning="absolute",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){d(this),u(this),v(this)}async componentWillLoad(){await y(this),c(this)}componentDidRender(){b(this)}disconnectedCallback(){f(this),m(this),g(this)}componentDidLoad(){l(this)}effectiveLocaleChange(){w(this,this.effectiveLocale)}async setFocus(){await h(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"===r(t),{showBackButton:e,backButtonClick:a,messages:o}=this,n=o.back;return e?i("calcite-action",{"aria-label":n,class:"back-button",icon:s?"chevron-right":"chevron-left",key:"flow-back-button",onClick:a,scale:"s",slot:"header-actions-start",text:n,title:n,ref:this.setBackRef}):null}render(){const{collapsed:t,collapseDirection:s,collapsible:e,closable:o,closed:n,description:h,disabled:c,heading:l,headingLevel:r,loading:d,menuOpen:b,messages:f,overlayPositioning:u}=this;return i(a,{key:"ab926d381ff2493f3fd49a5c8724260211d69ca9"},i(p,{key:"6799b56c2116de5e08739ddc2ec1557bd291f3f8",disabled:c},i("calcite-panel",{key:"2e438b8abf573eabaaa2e966dcca5c4843a53cba",closable:o,closed:n,collapseDirection:s,collapsed:t,collapsible:e,description:h,disabled:c,heading:l,headingLevel:r,loading:d,menuOpen:b,messageOverrides:f,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,onCalcitePanelToggle:this.handlePanelToggle,overlayPositioning:u,ref:this.setContainerRef},this.renderBackButton(),i("slot",{key:"39b650abdf64df16f535d45f64dc1b367acfcc9e",name:"action-bar",slot:k.actionBar}),i("slot",{key:"5b36c56874ad762f842c81f9ffbdcdbd3168cf75",name:"header-actions-start",slot:k.headerActionsStart}),i("slot",{key:"2dbf552425d238a4479a12bbec79571d11124577",name:"header-actions-end",slot:k.headerActionsEnd}),i("slot",{key:"2dd0a30236844c91c2cf10a9fbacbe9935ea234c",name:"header-content",slot:k.headerContent}),i("slot",{key:"1b025f746e2e7d58fb057aab36b24e46872e607e",name:"header-menu-actions",slot:k.headerMenuActions}),i("slot",{key:"5dd5986e93dcc11e0b0fade6822814b160053c70",name:"fab",slot:k.fab}),i("slot",{key:"e7cf2702cd2e423d07a8a8ac57c142bc4738b3ef",name:"footer-actions",slot:k.footerActions}),i("slot",{key:"e2561d89aaebe4fbb82b1f546551d05ebb23b0bf",name:"footer",slot:k.footer}),i("slot",{key:"fb6bf40456038f84486b2858765bb9d147800e84"}))))}static get assetsDirs(){return["assets"]}get el(){return s(this)}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};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([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;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.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 O=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.drawComplete=e(this,"drawComplete",7),this.editingAttachment=e(this,"editingAttachment",7),this.progressStatus=e(this,"progressStatus",7),this._isSubmitBtnClicked=!1,this.mapView=void 0,this.selectedLayerId=void 0,this.customizeSubmit=!1,this.searchConfiguration=void 0,this.showSearchWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async close(){this._editor&&this._editor.destroy()}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async componentWillLoad(){await this.initModules()}async componentDidLoad(){await this.init()}render(){const t=this.showSearchWidget?"":"display-none";return i(o,{key:"d11a16053bc5eb86a09fd3bc35c9a89cee6dd064"},i("div",{key:"0320bb0ca9fc069306151078c66fbee11060fcab",id:"feature-form"}),i("div",{key:"8aaa13e87213a880382ca408d324beb79ba7a500",class:`search-widget ${t}`,id:"search-widget-ref"}))}async init(){this.mapView&&this.selectedLayerId&&(await this.createEditorWidget(),await this.createSearchWidget())}async initModules(){const[t,i,s]=await x(["esri/widgets/Editor","esri/core/reactiveUtils","esri/widgets/Search"]);this.Editor=t,this.reactiveUtils=i,this.Search=s}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[],i=document.createElement("div");(await _(this.mapView)).forEach((async i=>{t.push({layer:i,enabled:"feature"===(null==i?void 0:i.type)&&(null==i?void 0:i.id)===this.selectedLayerId,addEnabled:!0,updateEnabled:!1,deleteEnabled:!1})})),this._editor=new this.Editor({allowedWorkflows:"create-features",view:this.mapView,layerInfos:t,visibleElements:{snappingControls:!1},container:i}),this.el.appendChild(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.editingAttachment.emit(!0)):this._addingAttachment&&(this.editingAttachment.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(s);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&(this.progressStatus.emit(.5),this.startCreate())}));this._editor.viewModel.addHandles(e);const a=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"creating-features"===t&&(this.showSearchWidget=!0)}));this._editor.viewModel.addHandles(a)}async startCreate(){var t;if(null===(t=this._editor.viewModel.featureTemplatesViewModel.items)||void 0===t?void 0:t.length){const t=this._editor.viewModel.featureTemplatesViewModel.items[0].get("items");this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{this.progressStatus.emit(.75),setTimeout((()=>{this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),this._editor.viewModel.sketchViewModel.on("create",(t=>{"complete"===t.state&&(this.showSearchWidget=!1,this.progressStatus.emit(1),this.drawComplete.emit())})),this.hideEditorsElements()}),700),this.hideEditorsElements()})),1===t.length&&this._editor.viewModel.featureTemplatesViewModel.select(t[0]),this.hideEditorsElements()}}async createSearchWidget(){let t={view:this.mapView};if(this.searchConfiguration){const i=this._getSearchConfig(this.searchConfiguration,this.mapView);t=Object.assign({},i)}this._search=new this.Search(t),this._search.container="search-widget-ref",this._search.popupEnabled=!1,this._search.resultGraphicEnabled=!1;const i=await S(this.mapView,this.selectedLayerId);let s=null;this._search.on("search-complete",(t=>{var e;this.mapView.goTo(t.results[0].results[0].extent),"point"===i.geometryType&&(s=null===(e=t.results[0].results[0])||void 0===e?void 0:e.feature.geometry)}));const e=this.reactiveUtils.watch((()=>this._search.viewModel.state),(t=>{"ready"===t&&setTimeout((()=>{this._editor.viewModel.sketchViewModel.createGraphic&&s&&(this._editor.viewModel.sketchViewModel.createGraphic.set("geometry",s),this._editor.viewModel.sketchViewModel.complete(),this.hideEditorsElements())}),100)}));this._search.viewModel.addHandles(e)}_getSearchConfig(t,i){const s=t.sources;return(null==s?void 0:s.length)>0?(t.includeDefaultSources=!1,s.forEach((t=>{var s,e;if(t.hasOwnProperty("layer")){const a=t,o=null===(s=a.layer)||void 0===s?void 0:s.id,n=o?i.map.findLayerById(o):null,h=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;n?a.layer=n:h&&(a.layer=new this.FeatureLayer(h))}})),null==s||s.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===(null==i?void 0:i.name)&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t=Object.assign(Object.assign({},t),{includeDefaultSources:!0}),t}hideEditorsElements(){this.customizeSubmit&&setTimeout((()=>{var t;null===(t=this.el.querySelector(".esri-editor").querySelectorAll("calcite-flow-item"))||void 0===t||t.forEach((t=>{var i,s,e,a,o;const n=null===(e=null===(s=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelector("calcite-panel"))||void 0===s?void 0:s.shadowRoot)||void 0===e?void 0:e.querySelector("article");null===(a=null==n?void 0:n.querySelector("header"))||void 0===a||a.setAttribute("style","display: none"),null===(o=null==n?void 0:n.querySelector("footer"))||void 0===o||o.setAttribute("style","display: none")}))}),700)}async submitted(t){var i;if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(t.valid.length&&this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{await this._editor.activeWorkflow.commit(),(null===(i=this._editor.viewModel.failures)||void 0===i?void 0:i.length)&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}get el(){return s(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};O.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__update-actions{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 0 20px 14px}.display-none{display:none !important}";const B=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.isActionPending=e(this,"isActionPending",7),this._isSubmitBtnClicked=!1,this.mapView=void 0,this.table=void 0,this.selectedFeature=void 0,this.customizeSubmit=!1}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async close(){this._editor&&this._editor.destroy()}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async componentWillLoad(){await this.initModules()}async init(){this.mapView&&await this.createEditorWidget()}async initModules(){const[t,i]=await x(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}render(){return i(a,{key:"8c32e05707b6e5501759caaef5d89f8da40640e4"})}async componentDidLoad(){await this.init()}async createEditorWidget(){this._editor&&this._editor.destroy();const t=document.createElement("div");this._editor=new this.Editor({view:this.mapView,visibleElements:{snappingControls:!1},container:t}),this.el.appendChild(t);const i=this.reactiveUtils.watch((()=>{var t;return null===(t=this._editor.viewModel.featureFormViewModel)||void 0===t?void 0:t.state}),(t=>{"ready"===t&&this.hideEditorsElements()}));this._editor.viewModel.addHandles(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&this.startCreate()}));this._editor.viewModel.addHandles(s);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.isActionPending.emit(!0)):this._addingAttachment&&(this.isActionPending.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(e)}async startCreate(){const t=this.selectedFeature.layer,i=this.table,s=t.relationships[0],e=i.relationships.find((i=>t.layerId===i.relatedTableId)),a=await t.queryFeatures({objectIds:[this.selectedFeature.getObjectId()],outFields:[t.objectIdField,s.keyField]}),o=i.templates[0],n={attributeOverrides:this.makeAttributesForRelatedFeature(a.features[0],s,e),layer:i,template:o};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(n),this.isActionPending.emit(!1),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this))}hideEditorsElements(){this.customizeSubmit&&setTimeout((()=>{var t;null===(t=this.el.querySelector(".esri-editor").querySelectorAll("calcite-flow-item"))||void 0===t||t.forEach((t=>{var i,s,e,a,o;const n=null===(e=null===(s=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelector("calcite-panel"))||void 0===s?void 0:s.shadowRoot)||void 0===e?void 0:e.querySelector("article");null===(a=null==n?void 0:n.querySelector("header"))||void 0===a||a.setAttribute("style","display: none"),null===(o=null==n?void 0:n.querySelector("footer"))||void 0===o||o.setAttribute("style","display: none")}))}),700)}makeAttributesForRelatedFeature(t,i,s){const e=t.getAttribute(i.keyField);let a=s.keyField;const o=this.table.fields.find((t=>t.name.toLocaleLowerCase()===a.toLocaleLowerCase()));return a=o.name,{[a]:e}}async submitted(t){var i;if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(t.valid.length&&this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{await this._editor.activeWorkflow.commit(),(null===(i=this._editor.viewModel.failures)||void 0===i?void 0:i.length)&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}get el(){return s(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};B.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}";const N=class{constructor(i){t(this,i),this.loadingStatus=e(this,"loadingStatus",7),this.commentSelect=e(this,"commentSelect",7),this.featureSelectionChange=e(this,"featureSelectionChange",7),this._validFieldTypes=["small-integer","integer","big-integer","single","long"],this.mapView=void 0,this.graphics=void 0,this.reportingOptions=void 0,this.layerItemsHash=void 0,this._likeFieldAvailable=!1,this._likeCount=0,this._disLikeCount=0,this._dislikeFieldAvailable=!1,this._commentsAvailable=!1,this._isLikeBtnClicked=!1,this._isDislikeBtnClicked=!1,this._relatedFeaturesOIDs=void 0,this._updating=!1}async graphicsWatchHandler(){await this.getCompleteGraphic(this.graphics[0]),this.checkLikeDislikeFields(),await this.processComments()}async refresh(t){await this.getCompleteGraphic(t),await this.processComments(),this.isLikeDislikeConfigured(t.layer)?t&&this.graphics.length>1&&this.checkLikeDislikeFields():(this._likeFieldAvailable=!1,this._dislikeFieldAvailable=!1)}async back(){this._infoCard.back()}async next(){this._infoCard.next()}async toggleListView(){this._infoCard.toggleListView()}async componentWillLoad(){await this._initModules(),await this.getCompleteGraphic(this.graphics[0]),this.checkLikeDislikeFields(),await this.processComments()}render(){var t,s,e,a,o;const n=(null===(t=this._relatedFeaturesOIDs)||void 0===t?void 0:t.length)>0?`objectId in(${this._relatedFeaturesOIDs})`:"1=0";return i("calcite-panel",{key:"8d7069fec0df2a6217c175df6171376b4412c548","full-height":!0},i("info-card",{key:"3713b783371bcb36a9b844196033326941d833f5",allowEditing:!1,graphics:this.graphics,highlightEnabled:!1,isLoading:!1,isMobile:!1,mapView:this.mapView,onSelectionChanged:t=>{this.featureSelectionChange.emit(t.detail)},paginationEnabled:!1,position:"relative",ref:t=>this._infoCard=t}),(this._likeFieldAvailable||this._dislikeFieldAvailable||this._commentsAvailable)&&i("div",{key:"8c84e82708fab0d6091050672b26e6fa2de59345",class:"buttons-container"},this._commentsAvailable&&i("div",{key:"22edb3f17ef6a2bdef67e5e94492966986d452b7",class:"comment-btn"},i("span",{key:"03b7eb0aff4358aac3020b3d6d52a2d47b308a41"},this._relatedFeaturesOIDs.length),i("calcite-icon",{key:"5225e156b45a15db0055a28ed21bc3511dedc706",icon:"speech-bubble",scale:"s"})),this._likeFieldAvailable&&i("calcite-button",{key:"1a291524d46c6f826813c87f781e7d6bcf5bc097",appearance:"transparent",iconEnd:"thumbs-up",kind:this._isLikeBtnClicked?"brand":"neutral",loading:this._updating,onClick:this.onLikeButtonClick.bind(this),scale:"m"},null!==(e=null!==(s=this._likeCount)&&void 0!==s?s:this._selectedGraphic.attributes[this._likeField])&&void 0!==e?e:0),this._dislikeFieldAvailable&&i("calcite-button",{key:"da6bee2189565c1eb70564b340e742494bac35c9",appearance:"transparent",iconEnd:"thumbs-down",kind:this._isDislikeBtnClicked?"brand":"neutral",loading:this._updating,onClick:this.onDislikeButtonClick.bind(this),scale:"m"},null!==(o=null!==(a=this._disLikeCount)&&void 0!==a?a:this._selectedGraphic.attributes[this._dislikeField])&&void 0!==o?o:0)),this.relatedTableId&&this._commentsAvailable&&i("feature-list",{key:"fd6faa9f3404a2dfadb102ca7c578ffb47207729",class:"height-full",mapView:this.mapView,onFeatureSelect:t=>{this.commentSelect.emit(t.detail)},pageSize:5,ref:t=>this._commentsList=t,selectedLayerId:this.relatedTableId,showErrorWhenNoFeatures:!1,showInitialLoading:!1,textSize:"small",whereClause:n}))}async _initModules(){const[t,i]=await x(["esri/rest/support/RelationshipQuery","esri/Graphic"]);this.RelationshipQuery=t,this.Graphic=i}async getCompleteGraphic(t){const i=t.layer,s=i.createQuery();s.objectIds=[t.getObjectId()];const e=await i.queryFeatures(s);this._selectedGraphic=e.features[0]}async processComments(){var t;const i=this._selectedGraphic.layer;if(this.reportingOptions&&this.reportingOptions[i.id]&&this.reportingOptions[i.id].comment&&(null===(t=i.relationships)||void 0===t?void 0:t.length)>0){const t=i.relationships[0].relatedTableId,s=(await j(this.mapView)).filter((i=>t===i.layerId));if(this.relatedTableId=(null==s?void 0:s.length)>0?s[0].id:"",this.relatedTableId){const t=this._selectedGraphic.attributes[i.objectIdField],s=new this.RelationshipQuery({objectIds:[t],outFields:["*"],relationshipId:i.relationships[0].id}),e=await i.queryRelatedFeatures(s).catch((t=>{console.error(t)})),a=[];e[t]&&e[t].features.forEach((t=>{a.push(t.attributes.OBJECTID)})),this._relatedFeaturesOIDs=a,this._commentsAvailable=!0}else this._relatedFeaturesOIDs=[],this._commentsAvailable=!1}else this._relatedFeaturesOIDs=[],this._commentsAvailable=!1,this.relatedTableId=""}isLikeDislikeConfigured(t){let i=!1,s=!1;if(this.reportingOptions&&this.reportingOptions[t.id]){if(!this.reportingOptions[t.id].like&&!this.reportingOptions[t.id].dislike)return!1;const e=this.reportingOptions[t.id].likeField,a=this.reportingOptions[t.id].dislikeField;if(!e&&!a)return!1;t.fields.forEach((o=>{this._validFieldTypes.indexOf(o.type)>-1&&this.layerItemsHash[t.id].supportsUpdate&&(o.name===e&&this.reportingOptions[t.id].like?i=!0:o.name===a&&this.reportingOptions[t.id].dislike&&(s=!0))}))}return i||s}checkLikeDislikeFields(){this._likeFieldAvailable=!1,this._dislikeFieldAvailable=!1,this._isLikeBtnClicked=!1,this._isDislikeBtnClicked=!1,this._likeCount=0,this._disLikeCount=0;const t=this._selectedGraphic.layer;if(this.reportingOptions&&this.reportingOptions[t.id]){if(this._likeField=this.reportingOptions[t.id].likeField,this._dislikeField=this.reportingOptions[t.id].dislikeField,!this._likeField&&!this._dislikeField)return;t.fields.forEach((i=>{this._validFieldTypes.indexOf(i.type)>-1&&this.layerItemsHash[t.id].supportsUpdate&&(i.name===this._likeField&&this.reportingOptions[t.id].like?(this._likeFieldAvailable=!0,this._likeCount=this._selectedGraphic.attributes[i.name]):i.name===this._dislikeField&&this.reportingOptions[t.id].dislike&&(this._dislikeFieldAvailable=!0,this._disLikeCount=this._selectedGraphic.attributes[i.name]))})),this.getFromLocalStorage()}}onLikeButtonClick(){this._isDislikeBtnClicked&&this.reportingOptions[this._selectedGraphic.layer.id].dislike&&this.onDislikeButtonClick(),this._isLikeBtnClicked=!this._isLikeBtnClicked,this._isLikeBtnClicked?this._likeCount++:this._likeCount--,this.updateFeaturesLikeDislikeField(this._likeField,this._isLikeBtnClicked)}onDislikeButtonClick(){this._isLikeBtnClicked&&this.reportingOptions[this._selectedGraphic.layer.id].like&&this.onLikeButtonClick(),this._isDislikeBtnClicked=!this._isDislikeBtnClicked,this._isDislikeBtnClicked?this._disLikeCount++:this._disLikeCount--,this.updateFeaturesLikeDislikeField(this._dislikeField,this._isDislikeBtnClicked)}async updateFeaturesLikeDislikeField(t,i){const s={},e=this._selectedGraphic.layer;this._updating=!0;const a=this._selectedGraphic;a.attributes[t]=i?Number(a.attributes[t])+1:Number(a.attributes[t])-1,s[e.objectIdField]=a.attributes[e.objectIdField],s[t]=a.attributes[t];const o=new this.Graphic;o.attributes=s;const n={updateFeatures:[o]};await e.applyEdits(n).then((()=>{this._selectedGraphic=a,this._infoCard&&this._infoCard.updateCurrentGraphic(this._selectedGraphic),this.setInLocalStorage(),this._updating=!1}),(t=>{this._updating=!1,console.log(t)}))}getFromLocalStorage(){const t=localStorage[this._selectedGraphic.layer.id];if(t){const i=JSON.parse(t).filter((t=>t.id===this._selectedGraphic.getObjectId()));i.length>0&&(this._isLikeBtnClicked=i[0].like,this._isDislikeBtnClicked=i[0].dislike)}}setInLocalStorage(){const t=this._selectedGraphic.layer.id,i=localStorage[t];let s=[];if(i){s=JSON.parse(i);const t=s.findIndex((t=>t.id===this._selectedGraphic.getObjectId()));t>=0&&s.splice(t,1)}s.push({id:this._selectedGraphic.getObjectId(),like:this._isLikeBtnClicked&&0!==this._likeCount,dislike:this._isDislikeBtnClicked&&0!==this._disLikeCount}),localStorage.setItem(t,JSON.stringify(s))}get el(){return s(this)}static get watchers(){return{graphics:["graphicsWatchHandler"]}}};N.style=":host{display:block}.buttons-container{align-items:center;display:flex;padding:4px;color:var(--calcite-color-text-1) !important;background-color:var(--calcite-color-foreground-1) !important;border-block-start:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3)}.comment-btn{display:flex;gap:10px;font-size:var(--calcite-font-size--1);align-items:center;padding:7px 0.75rem}";const T=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.showFeatureCount=!0,this.showNextIcon=!1,this._noLayersToDisplay=!1,this._mapLayerIds=[],this._isLoading=!1,this._translations=void 0}async refresh(){await this.setLayers()}async componentWillLoad(){await this._getTranslations(),this._isLoading=!0}async componentDidLoad(){await this.setLayers(),this._isLoading=!1}render(){return i(o,{key:"9366302a704c1dbdd7a65aef5c43d0ad84a44b23"},this._isLoading&&i("calcite-loader",{key:"69974a23fd42bc37ef13816efbe6d06e28cb2749",label:"",scale:"m"}),!this._isLoading&&this.mapView&&this._noLayersToDisplay&&i("calcite-notice",{key:"a93abb55b4db09727b3634cb1935e482c377d662",class:"error-msg",icon:"layers-reference",kind:"danger",open:!0},i("div",{key:"b9046685353b8894e6c6094cff47fab7a8e07ffa",slot:"title"},this._translations.error),i("div",{key:"90a052e1d80779a09a32fdd35563a1ce21d582e0",slot:"message"},this._translations.noLayerToDisplayErrorMsg)),!this._isLoading&&this.mapView&&i("calcite-list",{key:"709c1b8edd5710a2476ecef638199c2f929b4165","selection-appearance":"border","selection-mode":"none"},this.renderLayerList()))}async setLayers(){this.mapView&&await this.initLayerHash()}async initLayerHash(){const t=[];this._layerItemsHash=await E(this.mapView,!0),(await _(this.mapView)).forEach((async i=>{if("feature"===(null==i?void 0:i.type)&&this.showFeatureCount){const s=i.createQuery(),e=i.queryFeatureCount(s);t.push(e),e.then((async t=>{const s=isNaN(t)?"":await L(t,{places:0,api:4,type:"decimal"});this._layerItemsHash[i.id].formattedFeatureCount=s}))}})),await Promise.all(t).then((()=>{const t=this.getLayersToBeShownInList(this._layerItemsHash);this._mapLayerIds=t.reverse(),this.handleNoLayersToDisplay()}),(()=>{this._mapLayerIds=[],this.handleNoLayersToDisplay()}))}handleNoLayersToDisplay(){this._noLayersToDisplay=!(this._mapLayerIds.length>0),this.layersListLoaded.emit(this._mapLayerIds)}getLayersToBeShownInList(t){var i;const s=(null===(i=this.layers)||void 0===i?void 0:i.length)>0?this.layers:[];return Object.keys(t).reduce(((t,i)=>(s.indexOf(i)>-1&&t.push(i),t)),[])}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.onLayerItemSelected(t)}},i("div",{class:"layer-name",slot:"content-start"},this._layerItemsHash[t].name),this.showFeatureCount&&void 0!==s&&""!==s&&i("div",{class:this.showNextIcon?"":"feature-count",slot:"content-end"},"("+s+")"),this.showNextIcon&&i("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}onLayerItemSelected(t){this.layerSelect.emit({layerId:t,layerName:this._layerItemsHash[t].name})}async _getTranslations(){const t=await C(this.el);this._translations=t[0]}get el(){return s(this)}};T.style=":host{display:block}.error-msg{padding:10px}.layer-name{font-weight:500;padding:10px 12px}.feature-count{padding-right:12px}";export{z as calcite_flow,D as calcite_flow_item,O as create_feature,B as create_related_feature,N as feature_details,T as layer_list}
@@ -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 e,h as a,H as r,g as s}from"./p-6d753a3d.js";const t=class{constructor(a){e(this,a)}render(){return a(r,{key:"2607999cdad5fbe75eac4366256b589eeb33fe36"},a("slot",{key:"a9443a71e40b37449d01f4c40ca5f21b83bf005a"}))}get el(){return s(this)}};t.style=":host{display:block}";export{t as feature_form_flow_item}