@esri/solutions-components 0.10.12 → 0.10.13

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 (52) hide show
  1. package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-flow_6.cjs.entry.js +103 -7
  3. package/dist/cjs/crowdsource-reporter.cjs.entry.js +173 -43
  4. package/dist/cjs/feature-list.cjs.entry.js +110 -17
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/{popupUtils-92e52dbf.js → popupUtils-47bd97e7.js} +1 -1
  7. package/dist/cjs/solutions-components.cjs.js +1 -1
  8. package/dist/collection/assets/t9n/crowdsource-reporter/resources.json +3 -1
  9. package/dist/collection/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
  10. package/dist/collection/assets/t9n/feature-list/resources.json +3 -1
  11. package/dist/collection/assets/t9n/feature-list/resources_en.json +3 -1
  12. package/dist/collection/components/create-feature/create-feature.js +145 -2
  13. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +227 -43
  14. package/dist/collection/components/feature-list/feature-list.css +16 -1
  15. package/dist/collection/components/feature-list/feature-list.js +165 -15
  16. package/dist/collection/components/layer-list/layer-list.js +35 -6
  17. package/dist/collection/demos/crowdsource-reporter.html +2 -0
  18. package/dist/collection/utils/popupUtils.js +1 -1
  19. package/dist/collection/utils/popupUtils.ts +1 -1
  20. package/dist/components/create-feature2.js +91 -3
  21. package/dist/components/crowdsource-reporter.js +178 -45
  22. package/dist/components/feature-list2.js +152 -50
  23. package/dist/components/layer-list2.js +18 -6
  24. package/dist/components/popupUtils.js +1 -1
  25. package/dist/esm/calcite-alert_4.entry.js +1 -1
  26. package/dist/esm/calcite-flow_6.entry.js +104 -8
  27. package/dist/esm/crowdsource-reporter.entry.js +173 -43
  28. package/dist/esm/feature-list.entry.js +110 -17
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/esm/{popupUtils-00c655fb.js → popupUtils-349a26e6.js} +1 -1
  31. package/dist/esm/solutions-components.js +1 -1
  32. package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources.json +3 -1
  33. package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
  34. package/dist/solutions-components/assets/t9n/feature-list/resources.json +3 -1
  35. package/dist/solutions-components/assets/t9n/feature-list/resources_en.json +3 -1
  36. package/dist/solutions-components/demos/crowdsource-reporter.html +2 -0
  37. package/dist/solutions-components/p-40e305b4.entry.js +17 -0
  38. package/dist/solutions-components/p-4d44410b.entry.js +6 -0
  39. package/dist/solutions-components/{p-900fee65.js → p-5a473f0d.js} +1 -1
  40. package/dist/solutions-components/p-9b83e593.entry.js +6 -0
  41. package/dist/solutions-components/{p-cde8d6e5.entry.js → p-f6bc95b3.entry.js} +1 -1
  42. package/dist/solutions-components/solutions-components.esm.js +1 -1
  43. package/dist/solutions-components/utils/popupUtils.ts +1 -1
  44. package/dist/types/components/create-feature/create-feature.d.ts +34 -0
  45. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +80 -21
  46. package/dist/types/components/feature-list/feature-list.d.ts +49 -7
  47. package/dist/types/components/layer-list/layer-list.d.ts +4 -0
  48. package/dist/types/components.d.ts +77 -0
  49. package/package.json +1 -1
  50. package/dist/solutions-components/p-064e43e0.entry.js +0 -6
  51. package/dist/solutions-components/p-2d1afda0.entry.js +0 -17
  52. package/dist/solutions-components/p-c9260b4c.entry.js +0 -6
@@ -8,25 +8,26 @@ import { l as loadModules } from './loadModules.js';
8
8
  import { P as PopupUtils } from './popupUtils.js';
9
9
  import { g as getLayerOrTable, c as getFeatureLayerView, h as highlightFeatures } from './mapViewUtils.js';
10
10
  import { g as getLocaleComponentStrings } from './locale.js';
11
- import { d as defineCustomElement$h } from './action.js';
12
- import { d as defineCustomElement$g } from './action-menu.js';
13
- import { d as defineCustomElement$f } from './avatar.js';
14
- import { d as defineCustomElement$e } from './filter2.js';
15
- import { d as defineCustomElement$d } from './handle.js';
16
- import { d as defineCustomElement$c } from './icon.js';
17
- import { d as defineCustomElement$b } from './input.js';
18
- import { d as defineCustomElement$a } from './list.js';
19
- import { d as defineCustomElement$9 } from './list-item.js';
20
- import { d as defineCustomElement$8 } from './loader.js';
21
- import { d as defineCustomElement$7 } from './notice.js';
22
- import { d as defineCustomElement$6 } from './pagination.js';
23
- import { d as defineCustomElement$5 } from './panel.js';
24
- import { d as defineCustomElement$4 } from './popover.js';
25
- import { d as defineCustomElement$3 } from './progress.js';
26
- import { d as defineCustomElement$2 } from './scrim.js';
27
- import { d as defineCustomElement$1 } from './stack.js';
11
+ import { d as defineCustomElement$i } from './action.js';
12
+ import { d as defineCustomElement$h } from './action-menu.js';
13
+ import { d as defineCustomElement$g } from './avatar.js';
14
+ import { d as defineCustomElement$f } from './filter2.js';
15
+ import { d as defineCustomElement$e } from './handle.js';
16
+ import { d as defineCustomElement$d } from './icon.js';
17
+ import { d as defineCustomElement$c } from './input.js';
18
+ import { d as defineCustomElement$b } from './list.js';
19
+ import { d as defineCustomElement$a } from './list-item.js';
20
+ import { d as defineCustomElement$9 } from './loader.js';
21
+ import { d as defineCustomElement$8 } from './notice.js';
22
+ import { d as defineCustomElement$7 } from './pagination.js';
23
+ import { d as defineCustomElement$6 } from './panel.js';
24
+ import { d as defineCustomElement$5 } from './popover.js';
25
+ import { d as defineCustomElement$4 } from './progress.js';
26
+ import { d as defineCustomElement$3 } from './scrim.js';
27
+ import { d as defineCustomElement$2 } from './stack.js';
28
+ import { d as defineCustomElement$1 } from './tooltip.js';
28
29
 
29
- const featureListCss = ":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;white-space:pre-line}.feature-list-popup-title-small{font-size:small;white-space:pre-line}.feature-list-popup-title-padding{padding:10px 12px}.feature-list-popup-title-padding-reduced{padding:10px 0}.profile-img{margin:0 0.75rem;min-width:32px}";
30
+ const featureListCss = ":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;white-space:pre-line}.feature-list-popup-title-small{font-size:small;white-space:pre-line}.feature-list-popup-title-padding{padding:10px 12px}.feature-list-popup-title-padding-reduced{padding:10px 0}.profile-img{margin:0 0.75rem;min-width:32px}.like-container{display:flex;align-items:center;gap:5px;color:gray !important;font-style:italic}.feature-symbol{padding:3px 10px;min-width:30px;display:flex;justify-content:center}";
30
31
  const FeatureListStyle0 = featureListCss;
31
32
 
32
33
  const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends HTMLElement {
@@ -46,6 +47,9 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
46
47
  this.showInitialLoading = true;
47
48
  this.showErrorWhenNoFeatures = true;
48
49
  this.showUserImageInList = false;
50
+ this.showFeatureSymbol = false;
51
+ this.applyLayerViewFilter = false;
52
+ this.reportingOptions = undefined;
49
53
  this._featureItems = [];
50
54
  this._featuresCount = 0;
51
55
  this._isLoading = false;
@@ -67,6 +71,11 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
67
71
  * Esri config
68
72
  */
69
73
  esriConfig;
74
+ /**
75
+ * "esri/symbols/support/symbolUtils": https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html
76
+ * Symbol utils
77
+ */
78
+ symbolUtils;
70
79
  /**
71
80
  * IPopupUtils: To fetch the list label using popup titles
72
81
  */
@@ -83,6 +92,18 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
83
92
  * HTMLCalcitePaginationElement: Calcite pagination element instance
84
93
  */
85
94
  _pagination;
95
+ /**
96
+ * string[]: Valid field types for like
97
+ */
98
+ _validFieldTypes = ["small-integer", "integer", "big-integer", "single", "long"];
99
+ /**
100
+ * string: Abbrivated like count of the feature
101
+ */
102
+ _abbreviatedLikeCount;
103
+ /**
104
+ * boolean: When true configured like field is available in selected layer
105
+ */
106
+ _likeFieldAvailable = false;
86
107
  //--------------------------------------------------------------------------
87
108
  //
88
109
  // Watch handlers
@@ -156,9 +177,9 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
156
177
  * Renders the component.
157
178
  */
158
179
  render() {
159
- return (h("calcite-panel", { key: 'ace7bcabf497e9a61d261fd7ea29dc664ee0a526', "full-height": true, "full-width": true }, this._isLoading && h("calcite-loader", { key: '675c7f5be7f8456954acdf353f357bac6145c390', label: "", scale: "m" }), this.showErrorWhenNoFeatures && this._featureItems.length === 0 && !this._isLoading &&
160
- h("calcite-notice", { key: 'b2e6537acdec801ef066a74c78a2c4a13dbbc44b', class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { key: '7697470234b396a904906b80e4fc8df3a0cc732b', slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { key: 'd2b40c9a5e1bf009cb78d640351a16b24711ff59', "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
161
- h("div", { key: '15b0dae0fb914faf053a4b0cbea6e35ef7abc038', class: "width-full", slot: "footer" }, h("calcite-pagination", { key: '04f8eb02535f8cff8de0c111ac2d4bfa883ac128', class: "pagination", "full-width": true, onCalcitePaginationChange: this.pageChanged.bind(this), "page-size": this.pageSize, ref: el => this._pagination = el, "start-item": "1", "total-items": this._featuresCount }))));
180
+ return (h("calcite-panel", { key: 'b84cbd9d8c0f4d9d84fe7a49d149b67e88e46c53', "full-height": true, "full-width": true }, this._isLoading && h("calcite-loader", { key: '91ee86a3223b55141206be0d3f20bca1b777e4db', label: "", scale: "m" }), this.showErrorWhenNoFeatures && this._featureItems.length === 0 && !this._isLoading &&
181
+ h("calcite-notice", { key: '3c3b4a35c45715a86bd17630e8f3f9b566592c27', class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { key: '63a35389ac64f66c706fa05e92fb8f1af8dd0b69', slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { key: 'a237f97a0d286af17cce837bfbdd3c0d868ea023', "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
182
+ h("div", { key: '9cb166b5095167a2004e93217240bea6789e9039', class: "width-full", slot: "footer" }, h("calcite-pagination", { key: 'a413b26dd30fdc89be1d65ef06995604f1430a18', class: "pagination", "full-width": true, onCalcitePaginationChange: this.pageChanged.bind(this), "page-size": this.pageSize, ref: el => this._pagination = el, "start-item": "1", "total-items": this._featuresCount }))));
162
183
  }
163
184
  //--------------------------------------------------------------------------
164
185
  //
@@ -166,23 +187,25 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
166
187
  //
167
188
  //--------------------------------------------------------------------------
168
189
  /**
169
- * Load esri javascript api modules
170
- * @returns Promise resolving when function is done
171
- * @protected
172
- */
190
+ * Load esri javascript api modules
191
+ * @returns Promise resolving when function is done
192
+ * @protected
193
+ */
173
194
  async initModules() {
174
- const [Color, esriConfig] = await loadModules([
195
+ const [Color, esriConfig, symbolUtils] = await loadModules([
175
196
  "esri/Color",
176
197
  "esri/config",
198
+ "esri/symbols/support/symbolUtils"
177
199
  ]);
178
200
  this.Color = Color;
179
201
  this.esriConfig = esriConfig;
202
+ this.symbolUtils = symbolUtils;
180
203
  }
181
204
  /**
182
205
  * Return the where condition string considering the defined where clause and layer's definition expression
183
206
  * @protected
184
207
  */
185
- getWhereCondition() {
208
+ async getWhereCondition() {
186
209
  //By Default load all the features
187
210
  let whereClause = '1=1';
188
211
  //if where clause is defined use it
@@ -193,6 +216,13 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
193
216
  if (this._selectedLayer?.definitionExpression) {
194
217
  whereClause = whereClause + ' AND ' + this._selectedLayer.definitionExpression;
195
218
  }
219
+ // if layerview has any applied filter, use it
220
+ if (this.applyLayerViewFilter) {
221
+ const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayerId);
222
+ if (selectedLayerView?.filter?.where) {
223
+ whereClause = whereClause + ' AND ' + selectedLayerView.filter.where;
224
+ }
225
+ }
196
226
  return whereClause;
197
227
  }
198
228
  /**
@@ -204,8 +234,9 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
204
234
  void this._pagination?.goTo("start");
205
235
  this._isLoading = this.showInitialLoading;
206
236
  this._featureItems = await this.queryPage(0);
237
+ const whereCondition = await this.getWhereCondition();
207
238
  const query = {
208
- where: this.getWhereCondition()
239
+ where: whereCondition
209
240
  };
210
241
  this._featuresCount = await this._selectedLayer.queryFeatureCount(query);
211
242
  this._isLoading = false;
@@ -291,12 +322,13 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
291
322
  const featureLayer = this._selectedLayer;
292
323
  const sortField = this.sortingInfo?.field ? this.sortingInfo.field : featureLayer.objectIdField;
293
324
  const sortOrder = this.sortingInfo?.order ? this.sortingInfo.order : 'desc';
325
+ const whereCondition = await this.getWhereCondition();
294
326
  const query = {
295
327
  start: page,
296
328
  num: this.pageSize,
297
329
  outFields: ["*"],
298
330
  returnGeometry: true,
299
- where: this.getWhereCondition(),
331
+ where: whereCondition,
300
332
  outSpatialReference: this.mapView.spatialReference.toJSON()
301
333
  };
302
334
  //sort only when sort field and order is valid
@@ -314,10 +346,12 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
314
346
  */
315
347
  async createFeatureItem(featureSet) {
316
348
  const currentFeatures = featureSet?.features;
349
+ const showLikeCount = this.reportingOptions && this.reportingOptions[this.selectedLayerId].like;
317
350
  const items = currentFeatures.map(async (feature) => {
318
351
  const popupTitle = await this._popupUtils.getPopupTitle(feature, this.mapView.map);
319
352
  //fetch the feature creator user info to show the creator user image
320
353
  let userInfo;
354
+ let featureSymbol;
321
355
  if (this.showUserImageInList) {
322
356
  const creatorField = this._selectedLayer.editFieldsInfo?.creatorField.toLowerCase();
323
357
  // if feature's creator field is present then only we can fetch the information of user
@@ -325,10 +359,37 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
325
359
  userInfo = await this.getUserInformation(feature, creatorField);
326
360
  }
327
361
  }
328
- return this.getFeatureItem(feature, popupTitle, userInfo);
362
+ if (this.showFeatureSymbol) {
363
+ featureSymbol = await this.getFeatureSymbol(feature);
364
+ }
365
+ if (showLikeCount) {
366
+ void this.getAbbreviatedLikeCount(feature);
367
+ }
368
+ return this.getFeatureItem(feature, popupTitle, featureSymbol, userInfo);
329
369
  });
330
370
  return Promise.all(items);
331
371
  }
372
+ /**
373
+ * Displays the abbrivated like count on the feature list
374
+ * @param feature feature of the layer
375
+ * @protected
376
+ */
377
+ getAbbreviatedLikeCount(feature) {
378
+ const selectedLayer = this._selectedLayer;
379
+ const likeField = this.reportingOptions[selectedLayer.id].likeField;
380
+ selectedLayer.fields.forEach((eachField) => {
381
+ if (this._validFieldTypes.indexOf(eachField.type) > -1) {
382
+ if (eachField.name === likeField && this.reportingOptions[selectedLayer.id].like) {
383
+ this._likeFieldAvailable = true;
384
+ let likes = feature.attributes[likeField] || 0;
385
+ if (likes > 999) {
386
+ likes = likes > 999999 ? this._translations.millionsAbbreviation.replace("{{abbreviated_value}}", Math.floor(likes / 1000000).toString()) : this._translations.thousandsAbbreviation.replace("{{abbreviated_value}}", Math.floor(likes / 1000).toString());
387
+ }
388
+ this._abbreviatedLikeCount = likes;
389
+ }
390
+ }
391
+ });
392
+ }
332
393
  /**
333
394
  * Get each feature item
334
395
  * @param selectedFeature Each individual feature instance to be listed
@@ -336,15 +397,19 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
336
397
  * @returns individual feature item to be rendered
337
398
  * @protected
338
399
  */
339
- getFeatureItem(selectedFeature, popupTitle, userInfo) {
400
+ getFeatureItem(selectedFeature, popupTitle, featureSymbol, userInfo) {
340
401
  //get the object id value of the feature
341
402
  const oId = selectedFeature.attributes[this._selectedLayer.objectIdField].toString();
342
403
  //use object id if popupTitle is null or undefined
343
404
  popupTitle = popupTitle ?? oId;
405
+ // get the formatted like count
406
+ const formattedLikeCount = Number(selectedFeature.attributes[this.reportingOptions?.[this._selectedLayer.id].likeField]).toLocaleString();
344
407
  const popupTitleClass = this.textSize === 'small' ? 'feature-list-popup-title-small' : 'feature-list-popup-title';
345
- const popupTitlePaddingClass = this.showUserImageInList ? 'feature-list-popup-title-padding-reduced' : 'feature-list-popup-title-padding';
408
+ const popupTitlePaddingClass = this.showUserImageInList || this.showFeatureSymbol ? 'feature-list-popup-title-padding-reduced' : 'feature-list-popup-title-padding';
346
409
  return (h("calcite-list-item", { onCalciteListItemSelect: (e) => { void this.featureClicked(e, selectedFeature); }, onMouseLeave: () => { void this.clearHighlights(); }, onMouseOver: () => { void this.onFeatureHover(selectedFeature); }, value: oId }, this.showUserImageInList &&
347
- h("calcite-avatar", { class: 'profile-img', "full-name": userInfo?.fullName, id: userInfo?.id, scale: "m", slot: "content-start", thumbnail: userInfo?.userProfileUrl, username: userInfo?.username }), h("div", { class: `${popupTitleClass} ${popupTitlePaddingClass}`, slot: "content-start" }, popupTitle), h("calcite-icon", { flipRtl: true, icon: "chevron-right", scale: "s", slot: "content-end" })));
410
+ h("calcite-avatar", { class: 'profile-img', "full-name": userInfo?.fullName, id: userInfo?.id, scale: "m", slot: "content-start", thumbnail: userInfo?.userProfileUrl, username: userInfo?.username }), this.showFeatureSymbol &&
411
+ h("div", { class: 'feature-symbol', ref: (el) => el && el.appendChild(featureSymbol), slot: "content-start" }), h("div", { class: `${popupTitleClass} ${popupTitlePaddingClass}`, slot: "content-start" }, popupTitle), this._likeFieldAvailable &&
412
+ h("div", { class: "like-container", id: oId.concat("like"), slot: "content-end" }, h("span", null, this._abbreviatedLikeCount), h("calcite-icon", { icon: "thumbs-up", scale: 's' }), h("calcite-tooltip", { "reference-element": oId.concat("like") }, formattedLikeCount)), h("calcite-icon", { flipRtl: true, icon: "chevron-right", scale: "s", slot: "content-end" })));
348
413
  }
349
414
  /**
350
415
  *
@@ -371,6 +436,35 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
371
436
  userInfo.userProfileUrl = userProfileUrl;
372
437
  return userInfo;
373
438
  }
439
+ /**
440
+ * Creates a feature symbology
441
+ * @param feature Each individual feature
442
+ * @returns Feature symbology
443
+ * @protected
444
+ */
445
+ async getFeatureSymbol(feature) {
446
+ const nodeHtml = document.createElement('div');
447
+ await this.symbolUtils.getDisplayedSymbol(feature).then(async (symbol) => {
448
+ symbol && await this.symbolUtils?.renderPreviewHTML(symbol, {
449
+ node: nodeHtml
450
+ });
451
+ if (nodeHtml.children?.length) {
452
+ const imgOrSvgElm = nodeHtml.children[0];
453
+ if (imgOrSvgElm) {
454
+ const height = Number(imgOrSvgElm.getAttribute('height'));
455
+ const width = Number(imgOrSvgElm.getAttribute('width'));
456
+ if (width > 30) {
457
+ imgOrSvgElm.setAttribute('width', '30');
458
+ }
459
+ else if (width < 19) {
460
+ imgOrSvgElm.setAttribute('width', '20');
461
+ }
462
+ imgOrSvgElm.setAttribute('viewBox', `0 0 ${width} ${height}`);
463
+ }
464
+ }
465
+ });
466
+ return nodeHtml;
467
+ }
374
468
  /**
375
469
  * Fetches the component's translations
376
470
  * @returns Promise when complete
@@ -399,6 +493,9 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
399
493
  "showInitialLoading": [4, "show-initial-loading"],
400
494
  "showErrorWhenNoFeatures": [4, "show-error-when-no-features"],
401
495
  "showUserImageInList": [4, "show-user-image-in-list"],
496
+ "showFeatureSymbol": [4, "show-feature-symbol"],
497
+ "applyLayerViewFilter": [4, "apply-layer-view-filter"],
498
+ "reportingOptions": [16],
402
499
  "_featureItems": [32],
403
500
  "_featuresCount": [32],
404
501
  "_isLoading": [32],
@@ -413,7 +510,7 @@ function defineCustomElement() {
413
510
  if (typeof customElements === "undefined") {
414
511
  return;
415
512
  }
416
- const components = ["feature-list", "calcite-action", "calcite-action-menu", "calcite-avatar", "calcite-filter", "calcite-handle", "calcite-icon", "calcite-input", "calcite-list", "calcite-list-item", "calcite-loader", "calcite-notice", "calcite-pagination", "calcite-panel", "calcite-popover", "calcite-progress", "calcite-scrim", "calcite-stack"];
513
+ const components = ["feature-list", "calcite-action", "calcite-action-menu", "calcite-avatar", "calcite-filter", "calcite-handle", "calcite-icon", "calcite-input", "calcite-list", "calcite-list-item", "calcite-loader", "calcite-notice", "calcite-pagination", "calcite-panel", "calcite-popover", "calcite-progress", "calcite-scrim", "calcite-stack", "calcite-tooltip"];
417
514
  components.forEach(tagName => { switch (tagName) {
418
515
  case "feature-list":
419
516
  if (!customElements.get(tagName)) {
@@ -422,85 +519,90 @@ function defineCustomElement() {
422
519
  break;
423
520
  case "calcite-action":
424
521
  if (!customElements.get(tagName)) {
425
- defineCustomElement$h();
522
+ defineCustomElement$i();
426
523
  }
427
524
  break;
428
525
  case "calcite-action-menu":
429
526
  if (!customElements.get(tagName)) {
430
- defineCustomElement$g();
527
+ defineCustomElement$h();
431
528
  }
432
529
  break;
433
530
  case "calcite-avatar":
434
531
  if (!customElements.get(tagName)) {
435
- defineCustomElement$f();
532
+ defineCustomElement$g();
436
533
  }
437
534
  break;
438
535
  case "calcite-filter":
439
536
  if (!customElements.get(tagName)) {
440
- defineCustomElement$e();
537
+ defineCustomElement$f();
441
538
  }
442
539
  break;
443
540
  case "calcite-handle":
444
541
  if (!customElements.get(tagName)) {
445
- defineCustomElement$d();
542
+ defineCustomElement$e();
446
543
  }
447
544
  break;
448
545
  case "calcite-icon":
449
546
  if (!customElements.get(tagName)) {
450
- defineCustomElement$c();
547
+ defineCustomElement$d();
451
548
  }
452
549
  break;
453
550
  case "calcite-input":
454
551
  if (!customElements.get(tagName)) {
455
- defineCustomElement$b();
552
+ defineCustomElement$c();
456
553
  }
457
554
  break;
458
555
  case "calcite-list":
459
556
  if (!customElements.get(tagName)) {
460
- defineCustomElement$a();
557
+ defineCustomElement$b();
461
558
  }
462
559
  break;
463
560
  case "calcite-list-item":
464
561
  if (!customElements.get(tagName)) {
465
- defineCustomElement$9();
562
+ defineCustomElement$a();
466
563
  }
467
564
  break;
468
565
  case "calcite-loader":
469
566
  if (!customElements.get(tagName)) {
470
- defineCustomElement$8();
567
+ defineCustomElement$9();
471
568
  }
472
569
  break;
473
570
  case "calcite-notice":
474
571
  if (!customElements.get(tagName)) {
475
- defineCustomElement$7();
572
+ defineCustomElement$8();
476
573
  }
477
574
  break;
478
575
  case "calcite-pagination":
479
576
  if (!customElements.get(tagName)) {
480
- defineCustomElement$6();
577
+ defineCustomElement$7();
481
578
  }
482
579
  break;
483
580
  case "calcite-panel":
484
581
  if (!customElements.get(tagName)) {
485
- defineCustomElement$5();
582
+ defineCustomElement$6();
486
583
  }
487
584
  break;
488
585
  case "calcite-popover":
489
586
  if (!customElements.get(tagName)) {
490
- defineCustomElement$4();
587
+ defineCustomElement$5();
491
588
  }
492
589
  break;
493
590
  case "calcite-progress":
494
591
  if (!customElements.get(tagName)) {
495
- defineCustomElement$3();
592
+ defineCustomElement$4();
496
593
  }
497
594
  break;
498
595
  case "calcite-scrim":
499
596
  if (!customElements.get(tagName)) {
500
- defineCustomElement$2();
597
+ defineCustomElement$3();
501
598
  }
502
599
  break;
503
600
  case "calcite-stack":
601
+ if (!customElements.get(tagName)) {
602
+ defineCustomElement$2();
603
+ }
604
+ break;
605
+ case "calcite-tooltip":
504
606
  if (!customElements.get(tagName)) {
505
607
  defineCustomElement$1();
506
608
  }
@@ -4,7 +4,7 @@
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
7
- import { d as getMapLayerHash, a as getAllLayers } from './mapViewUtils.js';
7
+ import { d as getMapLayerHash, a as getAllLayers, c as getFeatureLayerView } from './mapViewUtils.js';
8
8
  import { f as formatNumber, g as getLocaleComponentStrings } from './locale.js';
9
9
  import { d as defineCustomElement$c } from './action.js';
10
10
  import { d as defineCustomElement$b } from './filter2.js';
@@ -32,6 +32,7 @@ const LayerList = /*@__PURE__*/ proxyCustomElement(class LayerList extends HTMLE
32
32
  this.layers = undefined;
33
33
  this.showFeatureCount = true;
34
34
  this.showNextIcon = false;
35
+ this.applyLayerViewFilter = false;
35
36
  this._noLayersToDisplay = false;
36
37
  this._mapLayerIds = [];
37
38
  this._isLoading = false;
@@ -102,9 +103,9 @@ const LayerList = /*@__PURE__*/ proxyCustomElement(class LayerList extends HTMLE
102
103
  * Renders the component.
103
104
  */
104
105
  render() {
105
- return (h(Fragment, { key: '9366302a704c1dbdd7a65aef5c43d0ad84a44b23' }, this._isLoading && h("calcite-loader", { key: '69974a23fd42bc37ef13816efbe6d06e28cb2749', label: "", scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
106
- h("calcite-notice", { key: 'a93abb55b4db09727b3634cb1935e482c377d662', class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, h("div", { key: 'b9046685353b8894e6c6094cff47fab7a8e07ffa', slot: "title" }, this._translations.error), h("div", { key: '90a052e1d80779a09a32fdd35563a1ce21d582e0', slot: "message" }, this._translations.noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
107
- h("calcite-list", { key: '709c1b8edd5710a2476ecef638199c2f929b4165', "selection-appearance": "border", "selection-mode": "none" }, this.renderLayerList())));
106
+ return (h(Fragment, { key: '19f68b9a5d0b6c85832544e4281e1c4a1707ba86' }, this._isLoading && h("calcite-loader", { key: 'c908f311165f8f520f267a0dcde0bd954863ba6b', label: "", scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
107
+ h("calcite-notice", { key: '56dfb252f998333ed6a671cccddd5683f08ad63d', class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, h("div", { key: 'a27ad45ac2b1984152af5a80da36583f7c375be6', slot: "title" }, this._translations.error), h("div", { key: 'a9466cb560b6ee2c72ebd18130ce21371f9e7cdf', slot: "message" }, this._translations.noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
108
+ h("calcite-list", { key: '40e54ba92d2f48a97dd0987808f4b7fdefd266bb', "selection-appearance": "border", "selection-mode": "none" }, this.renderLayerList())));
108
109
  }
109
110
  //--------------------------------------------------------------------------
110
111
  //
@@ -131,10 +132,20 @@ const LayerList = /*@__PURE__*/ proxyCustomElement(class LayerList extends HTMLE
131
132
  this._layerItemsHash = await getMapLayerHash(this.mapView, true);
132
133
  const allMapLayers = await getAllLayers(this.mapView);
133
134
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
134
- allMapLayers.forEach(async (eachLayer) => {
135
+ for (const eachLayer of allMapLayers) {
135
136
  if (eachLayer?.type === "feature") {
136
137
  if (this.showFeatureCount) {
137
138
  const q = eachLayer.createQuery();
139
+ //if layer has definitionExpression append it to the where clause
140
+ if (eachLayer?.definitionExpression) {
141
+ q.where = q.where + ' AND ' + eachLayer.definitionExpression;
142
+ }
143
+ if (this.applyLayerViewFilter) {
144
+ const featureLayerView = await getFeatureLayerView(this.mapView, eachLayer.id);
145
+ if (featureLayerView?.filter?.where) {
146
+ q.where = q.where ? q.where + ' AND ' + featureLayerView.filter.where : featureLayerView.filter.where;
147
+ }
148
+ }
138
149
  const result = eachLayer.queryFeatureCount(q);
139
150
  def.push(result);
140
151
  void result.then(async (resCount) => {
@@ -147,7 +158,7 @@ const LayerList = /*@__PURE__*/ proxyCustomElement(class LayerList extends HTMLE
147
158
  });
148
159
  }
149
160
  }
150
- });
161
+ }
151
162
  await Promise.all(def).then(() => {
152
163
  const editableLayerIds = this.getLayersToBeShownInList(this._layerItemsHash);
153
164
  this._mapLayerIds = editableLayerIds.reverse();
@@ -224,6 +235,7 @@ const LayerList = /*@__PURE__*/ proxyCustomElement(class LayerList extends HTMLE
224
235
  "layers": [16],
225
236
  "showFeatureCount": [4, "show-feature-count"],
226
237
  "showNextIcon": [4, "show-next-icon"],
238
+ "applyLayerViewFilter": [4, "apply-layer-view-filter"],
227
239
  "_noLayersToDisplay": [32],
228
240
  "_mapLayerIds": [32],
229
241
  "_isLoading": [32],
@@ -72,7 +72,7 @@ class PopupUtils {
72
72
  }
73
73
  }
74
74
  //Format field values
75
- if (layer.popupTemplate.fieldInfos) {
75
+ if (layer.popupTemplate?.fieldInfos) {
76
76
  layer.fields.forEach((field) => {
77
77
  const attributeValue = graphic.attributes[field.name];
78
78
  //get the field info from popupTemplate
@@ -13,7 +13,7 @@ import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as
13
13
  import { K as KindIcons } from './resources-5ba50a1d.js';
14
14
  import { g as getLocaleComponentStrings, l as loadModules } from './locale-b1d53fb1.js';
15
15
  import { a as getAllLayers } from './mapViewUtils-3e3d33ea.js';
16
- import { P as PopupUtils } from './popupUtils-00c655fb.js';
16
+ import { P as PopupUtils } from './popupUtils-349a26e6.js';
17
17
  import './guid-4c746a7f.js';
18
18
  import './resources-defbb49f.js';
19
19
  import './browser-552eb2d0.js';