@esri/solutions-components 0.8.17 → 0.8.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/cjs/calcite-flow_6.cjs.entry.js +8 -7
  2. package/dist/cjs/crowdsource-reporter.cjs.entry.js +4 -3
  3. package/dist/cjs/feature-list.cjs.entry.js +5 -3
  4. package/dist/collection/components/create-related-feature/create-related-feature.js +17 -1
  5. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +4 -3
  6. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +3 -2
  7. package/dist/collection/components/feature-details/feature-details.js +22 -7
  8. package/dist/collection/components/feature-list/feature-list.js +5 -3
  9. package/dist/components/create-related-feature2.js +2 -1
  10. package/dist/components/crowdsource-reporter.js +4 -3
  11. package/dist/components/feature-details2.js +6 -6
  12. package/dist/components/feature-list2.js +5 -3
  13. package/dist/esm/calcite-flow_6.entry.js +8 -7
  14. package/dist/esm/crowdsource-reporter.entry.js +4 -3
  15. package/dist/esm/feature-list.entry.js +5 -3
  16. package/dist/solutions-components/{p-d4686851.entry.js → p-48c99a48.entry.js} +1 -1
  17. package/dist/solutions-components/p-64779bb2.entry.js +6 -0
  18. package/dist/solutions-components/{p-b6d47bab.entry.js → p-f6668347.entry.js} +3 -3
  19. package/dist/solutions-components/solutions-components.esm.js +1 -1
  20. package/dist/types/components/create-related-feature/create-related-feature.d.ts +16 -0
  21. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +1 -0
  22. package/dist/types/components/feature-details/feature-details.d.ts +16 -1
  23. package/dist/types/components/feature-list/feature-list.d.ts +4 -0
  24. package/dist/types/components.d.ts +1 -1
  25. package/package.json +1 -1
  26. package/dist/solutions-components/p-22aece81.entry.js +0 -6
@@ -1,3 +1,18 @@
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
+ */
1
16
  /// <reference types="arcgis-js-api" />
2
17
  import { EventEmitter } from '../../stencil-public-runtime';
3
18
  export declare class CreateRelatedFeature {
@@ -102,6 +117,7 @@ export declare class CreateRelatedFeature {
102
117
  * @param parentRelationship Parent relationship
103
118
  * @param childRelationship Child relationship
104
119
  * @returns Attributes for related feature
120
+ * @protected
105
121
  */
106
122
  protected makeAttributesForRelatedFeature(parentFeature: __esri.Graphic, parentRelationship: __esri.Relationship, childRelationship: __esri.Relationship): object;
107
123
  /**
@@ -366,6 +366,7 @@ export declare class CrowdsourceReporter {
366
366
  * On sort option click update the sort field and sort order
367
367
  * @param sortField sort field
368
368
  * @param sortOrder sort order
369
+ * @param sortOption selected sort option (Newest/Oldest/Highest Voted/Lowest Voted)
369
370
  */
370
371
  protected sortOptionClick(sortField: string, sortOrder: "asc" | "desc", sortOption: string): Promise<void>;
371
372
  /**
@@ -1,3 +1,18 @@
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
+ */
1
16
  /// <reference types="arcgis-js-api" />
2
17
  import { EventEmitter } from '../../stencil-public-runtime';
3
18
  import { IReportingOptions } from '../../components';
@@ -110,7 +125,7 @@ export declare class FeatureDetails {
110
125
  */
111
126
  loadingStatus: EventEmitter<boolean>;
112
127
  /**
113
- * Emitted on demand when feature is selected using the list
128
+ * Emitted on demand when comment is selected using the feature-list
114
129
  */
115
130
  featureSelect: EventEmitter<__esri.Graphic>;
116
131
  /**
@@ -93,6 +93,10 @@ export declare class FeatureList {
93
93
  * __esri.Handle: Highlight handle of the selections
94
94
  */
95
95
  protected _highlightHandle: __esri.Handle;
96
+ /**
97
+ * HTMLCalcitePaginationElement: Calcite pagination element instance
98
+ */
99
+ protected _pagination: HTMLCalcitePaginationElement;
96
100
  /**
97
101
  * Watch for selectedLayerId change and update layer instance and features list for new layerId
98
102
  */
@@ -2856,7 +2856,7 @@ declare namespace LocalJSX {
2856
2856
  */
2857
2857
  "mapView"?: __esri.MapView;
2858
2858
  /**
2859
- * Emitted on demand when feature is selected using the list
2859
+ * Emitted on demand when comment is selected using the feature-list
2860
2860
  */
2861
2861
  "onFeatureSelect"?: (event: FeatureDetailsCustomEvent<__esri.Graphic>) => void;
2862
2862
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solutions-components",
3
- "version": "0.8.17",
3
+ "version": "0.8.18",
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,g as e}from"./p-6d753a3d.js";import{l as a,g as h}from"./p-896c9644.js";import{P as c}from"./p-ebf82ce0.js";import{g as n,c as o,h as l}from"./p-583e5dd0.js";import"./p-82e085d0.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._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._translations=void 0}async selectedLayerWatchHandler(){this._selectedLayer=await n(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 c,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await n(this.mapView,this.selectedLayerId))}async componentDidLoad(){await this.initializeFeatureItems()}render(){return s("calcite-panel",{key:"37f83a9c019e68213493f5e890324470389cd36f","full-height":!0,"full-width":!0},this._isLoading&&s("calcite-loader",{key:"671559375bb5fcdc8a01f9f10a82ab71edc0d836",label:"",scale:"m"}),0===this._featureItems.length&&!this._isLoading&&s("calcite-notice",{key:"f6101de52464f2316bfbb83919036b4cf035f8b9",class:"error-msg",icon:"feature-details",kind:"info",open:!0},s("div",{key:"e49017399909f1d0b93ec4e24341b9042267977f",slot:"message"},this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg)),s("calcite-list",{key:"2e90c0aec739fcce422ff730a39adc85b71a84cb","selection-appearance":"border","selection-mode":"none"},!this._isLoading&&this._featureItems.length>0&&this._featureItems),this._featuresCount>this.pageSize&&s("div",{key:"4b59248846c5b433bb88171c322070a13002f23d",class:"width-full",slot:"footer"},s("calcite-pagination",{key:"1ca5dbccdc59379999a94198d7ac6111e1ef547b",class:"pagination","full-width":!0,onCalcitePaginationChange:this.pageChanged.bind(this),"page-size":this.pageSize,"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(){if(this._selectedLayer){this._isLoading=this.showInitialLoading,this._featureItems=await this.queryPage(0);const t={where:this.getWhereCondition()};this._featuresCount=await this._selectedLayer.queryFeatureCount(t),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 o(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 o(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",c={start:t,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:this.getWhereCondition(),outSpatialReference:this.mapView.spatialReference.toJSON()};a&&h&&(c.orderByFields=[a.toString()+" "+h]);const n=await e.queryFeatures(c);return await this.createFeatureItem(n)}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",{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}.feature-list-popup-title-small{font-size:x-small;padding:10px 12px}";export{r as feature_list}