@esri/solutions-components 0.10.12 → 0.10.14
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
- package/dist/cjs/calcite-flow_6.cjs.entry.js +103 -7
- package/dist/cjs/card-manager_3.cjs.entry.js +2 -1
- package/dist/cjs/crowdsource-manager.cjs.entry.js +3 -2
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +173 -43
- package/dist/cjs/feature-list.cjs.entry.js +110 -17
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{popupUtils-92e52dbf.js → popupUtils-47bd97e7.js} +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/assets/t9n/crowdsource-reporter/resources.json +3 -1
- package/dist/collection/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
- package/dist/collection/assets/t9n/feature-list/resources.json +3 -1
- package/dist/collection/assets/t9n/feature-list/resources_en.json +3 -1
- package/dist/collection/components/card-manager/card-manager.js +19 -1
- package/dist/collection/components/create-feature/create-feature.js +145 -2
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +20 -2
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +227 -43
- package/dist/collection/components/feature-list/feature-list.css +16 -1
- package/dist/collection/components/feature-list/feature-list.js +165 -15
- package/dist/collection/components/layer-list/layer-list.js +35 -6
- package/dist/collection/demos/crowdsource-reporter.html +2 -0
- package/dist/collection/utils/popupUtils.js +1 -1
- package/dist/collection/utils/popupUtils.ts +1 -1
- package/dist/components/card-manager2.js +3 -1
- package/dist/components/create-feature2.js +91 -3
- package/dist/components/crowdsource-manager.js +4 -2
- package/dist/components/crowdsource-reporter.js +178 -45
- package/dist/components/feature-list2.js +152 -50
- package/dist/components/layer-list2.js +18 -6
- package/dist/components/popupUtils.js +1 -1
- package/dist/esm/calcite-alert_4.entry.js +1 -1
- package/dist/esm/calcite-flow_6.entry.js +104 -8
- package/dist/esm/card-manager_3.entry.js +2 -1
- package/dist/esm/crowdsource-manager.entry.js +3 -2
- package/dist/esm/crowdsource-reporter.entry.js +173 -43
- package/dist/esm/feature-list.entry.js +110 -17
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{popupUtils-00c655fb.js → popupUtils-349a26e6.js} +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources.json +3 -1
- package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
- package/dist/solutions-components/assets/t9n/feature-list/resources.json +3 -1
- package/dist/solutions-components/assets/t9n/feature-list/resources_en.json +3 -1
- package/dist/solutions-components/demos/crowdsource-reporter.html +2 -0
- package/dist/solutions-components/p-40e305b4.entry.js +17 -0
- package/dist/solutions-components/p-4d44410b.entry.js +6 -0
- package/dist/solutions-components/{p-900fee65.js → p-5a473f0d.js} +1 -1
- package/dist/solutions-components/p-8efa9edf.entry.js +6 -0
- package/dist/solutions-components/p-977f2314.entry.js +6 -0
- package/dist/solutions-components/p-9b83e593.entry.js +6 -0
- package/dist/solutions-components/{p-cde8d6e5.entry.js → p-f6bc95b3.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/popupUtils.ts +1 -1
- package/dist/types/components/card-manager/card-manager.d.ts +4 -0
- package/dist/types/components/create-feature/create-feature.d.ts +34 -0
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +4 -0
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +80 -21
- package/dist/types/components/feature-list/feature-list.d.ts +49 -7
- package/dist/types/components/layer-list/layer-list.d.ts +4 -0
- package/dist/types/components.d.ts +93 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-064e43e0.entry.js +0 -6
- package/dist/solutions-components/p-2d1afda0.entry.js +0 -17
- package/dist/solutions-components/p-4a0d9efe.entry.js +0 -6
- package/dist/solutions-components/p-c9260b4c.entry.js +0 -6
- package/dist/solutions-components/p-f7d3ef3e.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$
|
12
|
-
import { d as defineCustomElement$
|
13
|
-
import { d as defineCustomElement$
|
14
|
-
import { d as defineCustomElement$
|
15
|
-
import { d as defineCustomElement$
|
16
|
-
import { d as defineCustomElement$
|
17
|
-
import { d as defineCustomElement$
|
18
|
-
import { d as defineCustomElement$
|
19
|
-
import { d as defineCustomElement$
|
20
|
-
import { d as defineCustomElement$
|
21
|
-
import { d as defineCustomElement$
|
22
|
-
import { d as defineCustomElement$
|
23
|
-
import { d as defineCustomElement$
|
24
|
-
import { d as defineCustomElement$
|
25
|
-
import { d as defineCustomElement$
|
26
|
-
import { d as defineCustomElement$
|
27
|
-
import { d as defineCustomElement$
|
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: '
|
160
|
-
h("calcite-notice", { key: '
|
161
|
-
h("div", { key: '
|
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
|
-
|
170
|
-
|
171
|
-
|
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:
|
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:
|
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
|
-
|
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 }),
|
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$
|
522
|
+
defineCustomElement$i();
|
426
523
|
}
|
427
524
|
break;
|
428
525
|
case "calcite-action-menu":
|
429
526
|
if (!customElements.get(tagName)) {
|
430
|
-
defineCustomElement$
|
527
|
+
defineCustomElement$h();
|
431
528
|
}
|
432
529
|
break;
|
433
530
|
case "calcite-avatar":
|
434
531
|
if (!customElements.get(tagName)) {
|
435
|
-
defineCustomElement$
|
532
|
+
defineCustomElement$g();
|
436
533
|
}
|
437
534
|
break;
|
438
535
|
case "calcite-filter":
|
439
536
|
if (!customElements.get(tagName)) {
|
440
|
-
defineCustomElement$
|
537
|
+
defineCustomElement$f();
|
441
538
|
}
|
442
539
|
break;
|
443
540
|
case "calcite-handle":
|
444
541
|
if (!customElements.get(tagName)) {
|
445
|
-
defineCustomElement$
|
542
|
+
defineCustomElement$e();
|
446
543
|
}
|
447
544
|
break;
|
448
545
|
case "calcite-icon":
|
449
546
|
if (!customElements.get(tagName)) {
|
450
|
-
defineCustomElement$
|
547
|
+
defineCustomElement$d();
|
451
548
|
}
|
452
549
|
break;
|
453
550
|
case "calcite-input":
|
454
551
|
if (!customElements.get(tagName)) {
|
455
|
-
defineCustomElement$
|
552
|
+
defineCustomElement$c();
|
456
553
|
}
|
457
554
|
break;
|
458
555
|
case "calcite-list":
|
459
556
|
if (!customElements.get(tagName)) {
|
460
|
-
defineCustomElement$
|
557
|
+
defineCustomElement$b();
|
461
558
|
}
|
462
559
|
break;
|
463
560
|
case "calcite-list-item":
|
464
561
|
if (!customElements.get(tagName)) {
|
465
|
-
defineCustomElement$
|
562
|
+
defineCustomElement$a();
|
466
563
|
}
|
467
564
|
break;
|
468
565
|
case "calcite-loader":
|
469
566
|
if (!customElements.get(tagName)) {
|
470
|
-
defineCustomElement$
|
567
|
+
defineCustomElement$9();
|
471
568
|
}
|
472
569
|
break;
|
473
570
|
case "calcite-notice":
|
474
571
|
if (!customElements.get(tagName)) {
|
475
|
-
defineCustomElement$
|
572
|
+
defineCustomElement$8();
|
476
573
|
}
|
477
574
|
break;
|
478
575
|
case "calcite-pagination":
|
479
576
|
if (!customElements.get(tagName)) {
|
480
|
-
defineCustomElement$
|
577
|
+
defineCustomElement$7();
|
481
578
|
}
|
482
579
|
break;
|
483
580
|
case "calcite-panel":
|
484
581
|
if (!customElements.get(tagName)) {
|
485
|
-
defineCustomElement$
|
582
|
+
defineCustomElement$6();
|
486
583
|
}
|
487
584
|
break;
|
488
585
|
case "calcite-popover":
|
489
586
|
if (!customElements.get(tagName)) {
|
490
|
-
defineCustomElement$
|
587
|
+
defineCustomElement$5();
|
491
588
|
}
|
492
589
|
break;
|
493
590
|
case "calcite-progress":
|
494
591
|
if (!customElements.get(tagName)) {
|
495
|
-
defineCustomElement$
|
592
|
+
defineCustomElement$4();
|
496
593
|
}
|
497
594
|
break;
|
498
595
|
case "calcite-scrim":
|
499
596
|
if (!customElements.get(tagName)) {
|
500
|
-
defineCustomElement$
|
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: '
|
106
|
-
h("calcite-notice", { key: '
|
107
|
-
h("calcite-list", { key: '
|
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
|
-
|
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
|
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-
|
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';
|