@esri/solutions-components 0.8.28 → 0.8.30
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +65 -31
- package/dist/cjs/calcite-alert_4.cjs.entry.js +3 -3
- package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-flow_6.cjs.entry.js +1 -1
- package/dist/cjs/card-manager_3.cjs.entry.js +19 -19
- package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +1 -1
- package/dist/cjs/{downloadUtils-5349717a.js → downloadUtils-83bf79ba.js} +2 -2
- package/dist/cjs/feature-list.cjs.entry.js +3 -3
- package/dist/cjs/{index.es-aa69b58b.js → index.es-4e523f8b.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/{mapViewUtils-6e46ba33.js → mapViewUtils-911698e5.js} +31 -17
- package/dist/cjs/{popupUtils-3e65296c.js → popupUtils-e3fa775b.js} +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/floor-filter/floor-filter.js +66 -30
- package/dist/collection/components/layer-table/layer-table.js +18 -18
- package/dist/collection/utils/queryUtils.js +30 -0
- package/dist/collection/utils/queryUtils.ts +41 -0
- package/dist/components/floor-filter2.js +67 -32
- package/dist/components/layer-table2.js +18 -18
- package/dist/components/queryUtils.js +31 -17
- package/dist/esm/basemap-gallery_7.entry.js +65 -31
- package/dist/esm/calcite-alert_4.entry.js +3 -3
- package/dist/esm/calcite-dropdown-group_2.entry.js +1 -1
- package/dist/esm/calcite-flow_6.entry.js +1 -1
- package/dist/esm/card-manager_3.entry.js +19 -19
- package/dist/esm/crowdsource-manager.entry.js +1 -1
- package/dist/esm/crowdsource-reporter.entry.js +1 -1
- package/dist/esm/{downloadUtils-5fa0d437.js → downloadUtils-571a502d.js} +2 -2
- package/dist/esm/feature-list.entry.js +3 -3
- package/dist/esm/{index.es-57c15c9b.js → index.es-2f9f04c5.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +2 -2
- package/dist/esm/{mapViewUtils-4618ddb8.js → mapViewUtils-b8deb4ae.js} +31 -17
- package/dist/esm/{popupUtils-650b6bba.js → popupUtils-17193415.js} +1 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-81747268.entry.js → p-061da95a.entry.js} +1 -1
- package/dist/solutions-components/{p-e1662e32.entry.js → p-16fb8296.entry.js} +1 -1
- package/dist/solutions-components/p-1bdf0ba0.entry.js +6 -0
- package/dist/solutions-components/{p-a1037b19.js → p-2e23ac2c.js} +1 -1
- package/dist/solutions-components/{p-66722851.entry.js → p-2f7bfd8d.entry.js} +1 -1
- package/dist/solutions-components/{p-bfdabb9d.entry.js → p-51d5532f.entry.js} +1 -1
- package/dist/solutions-components/{p-6f69de4d.js → p-52dba022.js} +2 -2
- package/dist/solutions-components/{p-24bf45b7.js → p-57eeed77.js} +1 -1
- package/dist/solutions-components/p-5aaa05ef.js +36 -0
- package/dist/solutions-components/{p-05b3a5d9.entry.js → p-61bf98bc.entry.js} +1 -1
- package/dist/solutions-components/p-a0616647.entry.js +6 -0
- package/dist/solutions-components/{p-296375d3.entry.js → p-bb90a138.entry.js} +1 -1
- package/dist/solutions-components/{p-6bd6624f.entry.js → p-bda54b12.entry.js} +1 -1
- package/dist/solutions-components/{p-cd694107.entry.js → p-c21a6940.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/queryUtils.ts +41 -0
- package/dist/types/components/floor-filter/floor-filter.d.ts +23 -1
- package/dist/types/utils/queryUtils.d.ts +16 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-2a6db6e8.entry.js +0 -6
- package/dist/solutions-components/p-583e5dd0.js +0 -36
- package/dist/solutions-components/p-c3821586.entry.js +0 -6
@@ -31,19 +31,22 @@ export class FloorFilter {
|
|
31
31
|
// Watch handlers
|
32
32
|
//
|
33
33
|
//--------------------------------------------------------------------------
|
34
|
+
/**
|
35
|
+
* Watch for changes to the mapView and re-init the floor filter
|
36
|
+
*/
|
34
37
|
async mapViewWatchHandler() {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
this.
|
46
|
-
}
|
38
|
+
await this._initFloorFilter(this.mapView);
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* Watch for changes to the enabled property and re-init or destroy the floor filter
|
42
|
+
*/
|
43
|
+
async enabledWatchHandler() {
|
44
|
+
if (this.enabled) {
|
45
|
+
await this._initFloorFilter(this.mapView);
|
46
|
+
}
|
47
|
+
else if (!this.enabled) {
|
48
|
+
this._destroyWidget();
|
49
|
+
}
|
47
50
|
}
|
48
51
|
//--------------------------------------------------------------------------
|
49
52
|
//
|
@@ -56,8 +59,11 @@ export class FloorFilter {
|
|
56
59
|
async componentWillLoad() {
|
57
60
|
return this._initModules();
|
58
61
|
}
|
62
|
+
/**
|
63
|
+
* Renders the component.
|
64
|
+
*/
|
59
65
|
render() {
|
60
|
-
return (h(Host, { key: '
|
66
|
+
return (h(Host, { key: 'c80a8d46fb48f3789d9fa09c2400faad49e2e236' }, h("div", { key: '82919a3ba061a17c8aeaa0d2f6f4f13bc428b519', ref: (el) => { this._floorFilterElement = el; } })));
|
61
67
|
}
|
62
68
|
//--------------------------------------------------------------------------
|
63
69
|
//
|
@@ -79,27 +85,54 @@ export class FloorFilter {
|
|
79
85
|
this.FloorFilter = FloorFilter;
|
80
86
|
this.reactiveUtils = reactiveUtils;
|
81
87
|
}
|
88
|
+
/**
|
89
|
+
* Destroy the widget and remove the containing element if it exists
|
90
|
+
*
|
91
|
+
* @protected
|
92
|
+
*/
|
93
|
+
_destroyWidget() {
|
94
|
+
if (this.floorFilterWidget) {
|
95
|
+
this.floorFilterWidget.destroy();
|
96
|
+
this.floorFilterWidget = undefined;
|
97
|
+
}
|
98
|
+
if (this._floorFilterElement) {
|
99
|
+
this._floorFilterElement.remove();
|
100
|
+
}
|
101
|
+
}
|
102
|
+
/**
|
103
|
+
* Destroy the widget and remove the containing element then re-create the container element
|
104
|
+
*
|
105
|
+
* @protected
|
106
|
+
*/
|
107
|
+
_initContainer() {
|
108
|
+
this._destroyWidget();
|
109
|
+
this._floorFilterElement = document.createElement("div");
|
110
|
+
}
|
82
111
|
/**
|
83
112
|
* Initialize the floor filter or reset the current view if it already exists
|
84
113
|
*/
|
85
|
-
_initFloorFilter(view
|
86
|
-
|
114
|
+
async _initFloorFilter(view) {
|
115
|
+
const webMap = view === null || view === void 0 ? void 0 : view.map;
|
87
116
|
if (view && this.enabled && this.FloorFilter && (webMap === null || webMap === void 0 ? void 0 : webMap.floorInfo)) {
|
88
|
-
this.
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
117
|
+
this._initContainer();
|
118
|
+
await webMap.when(() => {
|
119
|
+
var _a, _b, _c;
|
120
|
+
this.floorFilterWidget = new this.FloorFilter({
|
121
|
+
container: this._floorFilterElement,
|
122
|
+
view
|
123
|
+
});
|
124
|
+
(_a = this._facilityHandle) === null || _a === void 0 ? void 0 : _a.remove();
|
125
|
+
this._facilityHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.facility, (facility) => {
|
126
|
+
this.facilityChanged.emit(facility);
|
127
|
+
});
|
128
|
+
(_b = this._levelHandle) === null || _b === void 0 ? void 0 : _b.remove();
|
129
|
+
this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
|
130
|
+
this.levelChanged.emit(level);
|
131
|
+
});
|
132
|
+
(_c = this._siteHandle) === null || _c === void 0 ? void 0 : _c.remove();
|
133
|
+
this._siteHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.site, (site) => {
|
134
|
+
this.siteChanged.emit(site);
|
135
|
+
});
|
103
136
|
});
|
104
137
|
}
|
105
138
|
}
|
@@ -229,6 +262,9 @@ export class FloorFilter {
|
|
229
262
|
return [{
|
230
263
|
"propName": "mapView",
|
231
264
|
"methodName": "mapViewWatchHandler"
|
265
|
+
}, {
|
266
|
+
"propName": "enabled",
|
267
|
+
"methodName": "enabledWatchHandler"
|
232
268
|
}];
|
233
269
|
}
|
234
270
|
}
|
@@ -22,7 +22,7 @@ import { Host, h } from "@stencil/core";
|
|
22
22
|
import { loadModules } from "../../utils/loadModules";
|
23
23
|
import { getLocaleComponentStrings } from "../../utils/locale";
|
24
24
|
import { getFeatureLayerView, getLayerOrTable, goToSelection } from "../../utils/mapViewUtils";
|
25
|
-
import { queryAllIds,
|
25
|
+
import { queryAllIds, queryAllOidsWithQueryFeatures, queryFeaturesByGlobalID } from "../../utils/queryUtils";
|
26
26
|
import * as downloadUtils from "../../utils/downloadUtils";
|
27
27
|
import "@esri/instant-apps-components/dist/components/instant-apps-social-share";
|
28
28
|
export class LayerTable {
|
@@ -216,6 +216,10 @@ export class LayerTable {
|
|
216
216
|
if (this._selectAllActive && this.selectedIds.length !== this._allIds.length) {
|
217
217
|
this._selectAllActive = false;
|
218
218
|
}
|
219
|
+
if (this.selectedIds.length > 0) {
|
220
|
+
this._table.rowHighlightIds.removeAll();
|
221
|
+
this._table.rowHighlightIds.add(this.selectedIds[0]);
|
222
|
+
}
|
219
223
|
}
|
220
224
|
/**
|
221
225
|
* Scroll and zoom to the selected feature from the Features widget.
|
@@ -315,7 +319,7 @@ export class LayerTable {
|
|
315
319
|
const selected = this.selectedIds.length.toString();
|
316
320
|
const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
|
317
321
|
this._validateActiveActions();
|
318
|
-
return (h(Host, { key: '
|
322
|
+
return (h(Host, { key: '928286a8e4d1159b56b2aa4384f0d6eed38c9e76' }, h("calcite-shell", { key: '7c9b98056ee867df54ebfd31fee6f046f5152f64' }, this._getTableControlRow("header"), h("div", { key: 'b1a9a9cca100c7bef335afd5b6c7d7384ca7536c', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: 'ceeead9900f43c94f46c8c94698ae17f3ae558b7', class: "height-full width-full" }, h("calcite-loader", { key: '7bf3c9ba21daa27dd387ba5413b6f6e982e1f10d', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '7d0440047453a45fe1688ad373ab2463fe7479ba', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
|
319
323
|
.replace("{{total}}", total)
|
320
324
|
.replace("{{selected}}", selected))) : undefined)), this._filterModal()));
|
321
325
|
}
|
@@ -916,43 +920,38 @@ export class LayerTable {
|
|
916
920
|
else if (this._shiftIsPressed) {
|
917
921
|
this._skipOnChange = true;
|
918
922
|
this._previousCurrentId = this._currentId;
|
919
|
-
this._currentId = [...
|
920
|
-
if (
|
923
|
+
this._currentId = [...ids].reverse()[0];
|
924
|
+
if (ids.length === 1) {
|
925
|
+
this._skipOnChange = false;
|
926
|
+
}
|
927
|
+
else if (this._previousCurrentId !== this._currentId) {
|
921
928
|
// query the layer based on current sort and filters then grab between the current id and previous id
|
922
929
|
const orderBy = this._table.activeSortOrders.reduce((prev, cur) => {
|
923
930
|
prev.push(`${cur.fieldName} ${cur.direction}`);
|
924
931
|
return prev;
|
925
932
|
}, []);
|
926
|
-
const oids = await
|
933
|
+
const oids = await queryAllOidsWithQueryFeatures(0, this._layer, [], orderBy);
|
927
934
|
let isBetween = false;
|
928
935
|
const _start = this._table.viewModel.getObjectIdIndex(this._previousCurrentId);
|
929
936
|
const _end = this._table.viewModel.getObjectIdIndex(this._currentId);
|
930
937
|
const startIndex = _start < _end ? _start : _end;
|
931
938
|
const endIndex = _end > _start ? _end : _start;
|
932
939
|
this._skipOnChange = startIndex + 1 !== endIndex;
|
933
|
-
const
|
940
|
+
const idsInRange = oids.reduce((prev, cur) => {
|
934
941
|
const id = cur;
|
935
|
-
const index = this._table.viewModel.getObjectIdIndex(id);
|
936
942
|
if ((id === this._currentId || id === this._previousCurrentId)) {
|
937
943
|
isBetween = !isBetween;
|
938
944
|
if (prev.indexOf(id) < 0) {
|
939
945
|
prev.push(id);
|
940
946
|
}
|
941
947
|
}
|
942
|
-
|
943
|
-
// Index of -1 will occur for features between the start and and oid if
|
944
|
-
// you select a row then scroll faster than the FeatureTable loads the data to select the next id
|
945
|
-
if (isBetween && prev.indexOf(id) < 0) {
|
946
|
-
prev.push(id);
|
947
|
-
}
|
948
|
-
// Also add index based check.
|
949
|
-
// In some cases the FeatureTable and Layer query will have differences in how null/undefined field values are sorted
|
950
|
-
if ((this.selectedIds.indexOf(id) > -1 || (index >= startIndex && index <= endIndex)) && prev.indexOf(id) < 0 && index > -1) {
|
948
|
+
else if (isBetween && prev.indexOf(id) < 0) {
|
951
949
|
prev.push(id);
|
952
950
|
}
|
953
951
|
return prev;
|
954
952
|
}, []);
|
955
|
-
|
953
|
+
const selectedIds = _start < _end ? idsInRange.reverse() : idsInRange;
|
954
|
+
this.selectedIds = [...new Set([...selectedIds, ...this.selectedIds])];
|
956
955
|
this._table.highlightIds.addMany(this.selectedIds.filter(i => ids.indexOf(i) < 0));
|
957
956
|
}
|
958
957
|
}
|
@@ -1294,9 +1293,10 @@ export class LayerTable {
|
|
1294
1293
|
* Clears the selected indexes
|
1295
1294
|
*/
|
1296
1295
|
_clearSelection() {
|
1297
|
-
var _a;
|
1296
|
+
var _a, _b;
|
1298
1297
|
this.selectedIds = [];
|
1299
1298
|
(_a = this._table) === null || _a === void 0 ? void 0 : _a.highlightIds.removeAll();
|
1299
|
+
(_b = this._table) === null || _b === void 0 ? void 0 : _b.rowHighlightIds.removeAll();
|
1300
1300
|
this._finishOnChange();
|
1301
1301
|
}
|
1302
1302
|
/**
|
@@ -40,6 +40,36 @@ export async function queryAllFeatures(start, layer, graphics) {
|
|
40
40
|
queryAllFeatures(start += num, layer, graphics) :
|
41
41
|
Promise.resolve(graphics);
|
42
42
|
}
|
43
|
+
/**
|
44
|
+
* Query the layer for all OIDs valid for any definition expressions applied to the layer.
|
45
|
+
*
|
46
|
+
* This query allows OIDs to be returned in the same order as shown in the FeatureTable.
|
47
|
+
* FeatureLayer.queryObjectIds can return OIDs in a different order.
|
48
|
+
*
|
49
|
+
* @param start zero-based index indicating where to begin retrieving features
|
50
|
+
* @param layer the layer to retrieve features from
|
51
|
+
* @param graphics stores the features
|
52
|
+
* @param orderBy One or more field names used to order the query results.
|
53
|
+
* Specify ASC (ascending) or DESC (descending) after the field name to control the order.
|
54
|
+
* The default order is ASC.
|
55
|
+
*
|
56
|
+
* @returns Promise with the OIDs sorted based on any orderBy definitions
|
57
|
+
*/
|
58
|
+
export async function queryAllOidsWithQueryFeatures(start, layer, graphics, orderBy) {
|
59
|
+
const num = layer.capabilities.query.maxRecordCount;
|
60
|
+
const query = layer.createQuery();
|
61
|
+
query.start = start;
|
62
|
+
query.num = num;
|
63
|
+
query.returnGeometry = false;
|
64
|
+
query.orderByFields = orderBy;
|
65
|
+
query.outFields = [layer.objectIdField];
|
66
|
+
query.where = layer.definitionExpression || "1=1";
|
67
|
+
const result = await layer.queryFeatures(query);
|
68
|
+
graphics = graphics.concat(result.features);
|
69
|
+
return result.exceededTransferLimit ?
|
70
|
+
queryAllOidsWithQueryFeatures(start += num, layer, graphics, orderBy) :
|
71
|
+
Promise.resolve(graphics.map(g => g.attributes[layer.objectIdField]));
|
72
|
+
}
|
43
73
|
/**
|
44
74
|
* Query the layer for all IDs
|
45
75
|
*
|
@@ -48,6 +48,47 @@ export async function queryAllFeatures(
|
|
48
48
|
Promise.resolve(graphics);
|
49
49
|
}
|
50
50
|
|
51
|
+
/**
|
52
|
+
* Query the layer for all OIDs valid for any definition expressions applied to the layer.
|
53
|
+
*
|
54
|
+
* This query allows OIDs to be returned in the same order as shown in the FeatureTable.
|
55
|
+
* FeatureLayer.queryObjectIds can return OIDs in a different order.
|
56
|
+
*
|
57
|
+
* @param start zero-based index indicating where to begin retrieving features
|
58
|
+
* @param layer the layer to retrieve features from
|
59
|
+
* @param graphics stores the features
|
60
|
+
* @param orderBy One or more field names used to order the query results.
|
61
|
+
* Specify ASC (ascending) or DESC (descending) after the field name to control the order.
|
62
|
+
* The default order is ASC.
|
63
|
+
*
|
64
|
+
* @returns Promise with the OIDs sorted based on any orderBy definitions
|
65
|
+
*/
|
66
|
+
export async function queryAllOidsWithQueryFeatures(
|
67
|
+
start: number,
|
68
|
+
layer: __esri.FeatureLayer,
|
69
|
+
graphics: __esri.Graphic[],
|
70
|
+
orderBy?: string[]
|
71
|
+
): Promise<number[]> {
|
72
|
+
const num = layer.capabilities.query.maxRecordCount;
|
73
|
+
const query = layer.createQuery();
|
74
|
+
query.start = start;
|
75
|
+
query.num = num;
|
76
|
+
query.returnGeometry = false;
|
77
|
+
query.orderByFields = orderBy;
|
78
|
+
query.outFields = [layer.objectIdField];
|
79
|
+
query.where = layer.definitionExpression || "1=1";
|
80
|
+
|
81
|
+
const result = await layer.queryFeatures(query);
|
82
|
+
|
83
|
+
graphics = graphics.concat(
|
84
|
+
result.features
|
85
|
+
);
|
86
|
+
|
87
|
+
return result.exceededTransferLimit ?
|
88
|
+
queryAllOidsWithQueryFeatures(start += num, layer, graphics, orderBy) :
|
89
|
+
Promise.resolve(graphics.map(g => g.attributes[layer.objectIdField]));
|
90
|
+
}
|
91
|
+
|
51
92
|
/**
|
52
93
|
* Query the layer for all IDs
|
53
94
|
*
|
@@ -26,19 +26,22 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
|
|
26
26
|
// Watch handlers
|
27
27
|
//
|
28
28
|
//--------------------------------------------------------------------------
|
29
|
+
/**
|
30
|
+
* Watch for changes to the mapView and re-init the floor filter
|
31
|
+
*/
|
29
32
|
async mapViewWatchHandler() {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
this.
|
41
|
-
}
|
33
|
+
await this._initFloorFilter(this.mapView);
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* Watch for changes to the enabled property and re-init or destroy the floor filter
|
37
|
+
*/
|
38
|
+
async enabledWatchHandler() {
|
39
|
+
if (this.enabled) {
|
40
|
+
await this._initFloorFilter(this.mapView);
|
41
|
+
}
|
42
|
+
else if (!this.enabled) {
|
43
|
+
this._destroyWidget();
|
44
|
+
}
|
42
45
|
}
|
43
46
|
//--------------------------------------------------------------------------
|
44
47
|
//
|
@@ -51,8 +54,11 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
|
|
51
54
|
async componentWillLoad() {
|
52
55
|
return this._initModules();
|
53
56
|
}
|
57
|
+
/**
|
58
|
+
* Renders the component.
|
59
|
+
*/
|
54
60
|
render() {
|
55
|
-
return (h(Host, { key: '
|
61
|
+
return (h(Host, { key: 'c80a8d46fb48f3789d9fa09c2400faad49e2e236' }, h("div", { key: '82919a3ba061a17c8aeaa0d2f6f4f13bc428b519', ref: (el) => { this._floorFilterElement = el; } })));
|
56
62
|
}
|
57
63
|
//--------------------------------------------------------------------------
|
58
64
|
//
|
@@ -74,33 +80,61 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
|
|
74
80
|
this.FloorFilter = FloorFilter;
|
75
81
|
this.reactiveUtils = reactiveUtils;
|
76
82
|
}
|
83
|
+
/**
|
84
|
+
* Destroy the widget and remove the containing element if it exists
|
85
|
+
*
|
86
|
+
* @protected
|
87
|
+
*/
|
88
|
+
_destroyWidget() {
|
89
|
+
if (this.floorFilterWidget) {
|
90
|
+
this.floorFilterWidget.destroy();
|
91
|
+
this.floorFilterWidget = undefined;
|
92
|
+
}
|
93
|
+
if (this._floorFilterElement) {
|
94
|
+
this._floorFilterElement.remove();
|
95
|
+
}
|
96
|
+
}
|
97
|
+
/**
|
98
|
+
* Destroy the widget and remove the containing element then re-create the container element
|
99
|
+
*
|
100
|
+
* @protected
|
101
|
+
*/
|
102
|
+
_initContainer() {
|
103
|
+
this._destroyWidget();
|
104
|
+
this._floorFilterElement = document.createElement("div");
|
105
|
+
}
|
77
106
|
/**
|
78
107
|
* Initialize the floor filter or reset the current view if it already exists
|
79
108
|
*/
|
80
|
-
_initFloorFilter(view
|
81
|
-
|
109
|
+
async _initFloorFilter(view) {
|
110
|
+
const webMap = view === null || view === void 0 ? void 0 : view.map;
|
82
111
|
if (view && this.enabled && this.FloorFilter && (webMap === null || webMap === void 0 ? void 0 : webMap.floorInfo)) {
|
83
|
-
this.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
112
|
+
this._initContainer();
|
113
|
+
await webMap.when(() => {
|
114
|
+
var _a, _b, _c;
|
115
|
+
this.floorFilterWidget = new this.FloorFilter({
|
116
|
+
container: this._floorFilterElement,
|
117
|
+
view
|
118
|
+
});
|
119
|
+
(_a = this._facilityHandle) === null || _a === void 0 ? void 0 : _a.remove();
|
120
|
+
this._facilityHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.facility, (facility) => {
|
121
|
+
this.facilityChanged.emit(facility);
|
122
|
+
});
|
123
|
+
(_b = this._levelHandle) === null || _b === void 0 ? void 0 : _b.remove();
|
124
|
+
this._levelHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.level, (level) => {
|
125
|
+
this.levelChanged.emit(level);
|
126
|
+
});
|
127
|
+
(_c = this._siteHandle) === null || _c === void 0 ? void 0 : _c.remove();
|
128
|
+
this._siteHandle = this.reactiveUtils.watch(() => this.floorFilterWidget.site, (site) => {
|
129
|
+
this.siteChanged.emit(site);
|
130
|
+
});
|
98
131
|
});
|
99
132
|
}
|
100
133
|
}
|
101
134
|
get el() { return this; }
|
102
135
|
static get watchers() { return {
|
103
|
-
"mapView": ["mapViewWatchHandler"]
|
136
|
+
"mapView": ["mapViewWatchHandler"],
|
137
|
+
"enabled": ["enabledWatchHandler"]
|
104
138
|
}; }
|
105
139
|
static get style() { return FloorFilterStyle0; }
|
106
140
|
}, [1, "floor-filter", {
|
@@ -108,7 +142,8 @@ const FloorFilter = /*@__PURE__*/ proxyCustomElement(class FloorFilter extends H
|
|
108
142
|
"floorFilterWidget": [16],
|
109
143
|
"mapView": [16]
|
110
144
|
}, undefined, {
|
111
|
-
"mapView": ["mapViewWatchHandler"]
|
145
|
+
"mapView": ["mapViewWatchHandler"],
|
146
|
+
"enabled": ["enabledWatchHandler"]
|
112
147
|
}]);
|
113
148
|
function defineCustomElement() {
|
114
149
|
if (typeof customElements === "undefined") {
|
@@ -7,7 +7,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
7
7
|
import { l as loadModules } from './loadModules.js';
|
8
8
|
import { g as getLocaleComponentStrings } from './locale.js';
|
9
9
|
import { b as goToSelection, c as getFeatureLayerView, g as getLayerOrTable } from './mapViewUtils.js';
|
10
|
-
import { b as queryAllIds, c as
|
10
|
+
import { b as queryAllIds, c as queryAllOidsWithQueryFeatures, d as queryFeaturesByGlobalID } from './queryUtils.js';
|
11
11
|
import { d as downloadCSV } from './downloadUtils.js';
|
12
12
|
import { d as defineCustomElement$D } from './action.js';
|
13
13
|
import { d as defineCustomElement$C } from './action-bar.js';
|
@@ -246,6 +246,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
246
246
|
if (this._selectAllActive && this.selectedIds.length !== this._allIds.length) {
|
247
247
|
this._selectAllActive = false;
|
248
248
|
}
|
249
|
+
if (this.selectedIds.length > 0) {
|
250
|
+
this._table.rowHighlightIds.removeAll();
|
251
|
+
this._table.rowHighlightIds.add(this.selectedIds[0]);
|
252
|
+
}
|
249
253
|
}
|
250
254
|
/**
|
251
255
|
* Scroll and zoom to the selected feature from the Features widget.
|
@@ -345,7 +349,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
345
349
|
const selected = this.selectedIds.length.toString();
|
346
350
|
const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
|
347
351
|
this._validateActiveActions();
|
348
|
-
return (h(Host, { key: '
|
352
|
+
return (h(Host, { key: '928286a8e4d1159b56b2aa4384f0d6eed38c9e76' }, h("calcite-shell", { key: '7c9b98056ee867df54ebfd31fee6f046f5152f64' }, this._getTableControlRow("header"), h("div", { key: 'b1a9a9cca100c7bef335afd5b6c7d7384ca7536c', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: 'ceeead9900f43c94f46c8c94698ae17f3ae558b7', class: "height-full width-full" }, h("calcite-loader", { key: '7bf3c9ba21daa27dd387ba5413b6f6e982e1f10d', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '7d0440047453a45fe1688ad373ab2463fe7479ba', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
|
349
353
|
.replace("{{total}}", total)
|
350
354
|
.replace("{{selected}}", selected))) : undefined)), this._filterModal()));
|
351
355
|
}
|
@@ -946,43 +950,38 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
946
950
|
else if (this._shiftIsPressed) {
|
947
951
|
this._skipOnChange = true;
|
948
952
|
this._previousCurrentId = this._currentId;
|
949
|
-
this._currentId = [...
|
950
|
-
if (
|
953
|
+
this._currentId = [...ids].reverse()[0];
|
954
|
+
if (ids.length === 1) {
|
955
|
+
this._skipOnChange = false;
|
956
|
+
}
|
957
|
+
else if (this._previousCurrentId !== this._currentId) {
|
951
958
|
// query the layer based on current sort and filters then grab between the current id and previous id
|
952
959
|
const orderBy = this._table.activeSortOrders.reduce((prev, cur) => {
|
953
960
|
prev.push(`${cur.fieldName} ${cur.direction}`);
|
954
961
|
return prev;
|
955
962
|
}, []);
|
956
|
-
const oids = await
|
963
|
+
const oids = await queryAllOidsWithQueryFeatures(0, this._layer, [], orderBy);
|
957
964
|
let isBetween = false;
|
958
965
|
const _start = this._table.viewModel.getObjectIdIndex(this._previousCurrentId);
|
959
966
|
const _end = this._table.viewModel.getObjectIdIndex(this._currentId);
|
960
967
|
const startIndex = _start < _end ? _start : _end;
|
961
968
|
const endIndex = _end > _start ? _end : _start;
|
962
969
|
this._skipOnChange = startIndex + 1 !== endIndex;
|
963
|
-
const
|
970
|
+
const idsInRange = oids.reduce((prev, cur) => {
|
964
971
|
const id = cur;
|
965
|
-
const index = this._table.viewModel.getObjectIdIndex(id);
|
966
972
|
if ((id === this._currentId || id === this._previousCurrentId)) {
|
967
973
|
isBetween = !isBetween;
|
968
974
|
if (prev.indexOf(id) < 0) {
|
969
975
|
prev.push(id);
|
970
976
|
}
|
971
977
|
}
|
972
|
-
|
973
|
-
// Index of -1 will occur for features between the start and and oid if
|
974
|
-
// you select a row then scroll faster than the FeatureTable loads the data to select the next id
|
975
|
-
if (isBetween && prev.indexOf(id) < 0) {
|
976
|
-
prev.push(id);
|
977
|
-
}
|
978
|
-
// Also add index based check.
|
979
|
-
// In some cases the FeatureTable and Layer query will have differences in how null/undefined field values are sorted
|
980
|
-
if ((this.selectedIds.indexOf(id) > -1 || (index >= startIndex && index <= endIndex)) && prev.indexOf(id) < 0 && index > -1) {
|
978
|
+
else if (isBetween && prev.indexOf(id) < 0) {
|
981
979
|
prev.push(id);
|
982
980
|
}
|
983
981
|
return prev;
|
984
982
|
}, []);
|
985
|
-
|
983
|
+
const selectedIds = _start < _end ? idsInRange.reverse() : idsInRange;
|
984
|
+
this.selectedIds = [...new Set([...selectedIds, ...this.selectedIds])];
|
986
985
|
this._table.highlightIds.addMany(this.selectedIds.filter(i => ids.indexOf(i) < 0));
|
987
986
|
}
|
988
987
|
}
|
@@ -1324,9 +1323,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1324
1323
|
* Clears the selected indexes
|
1325
1324
|
*/
|
1326
1325
|
_clearSelection() {
|
1327
|
-
var _a;
|
1326
|
+
var _a, _b;
|
1328
1327
|
this.selectedIds = [];
|
1329
1328
|
(_a = this._table) === null || _a === void 0 ? void 0 : _a.highlightIds.removeAll();
|
1329
|
+
(_b = this._table) === null || _b === void 0 ? void 0 : _b.rowHighlightIds.removeAll();
|
1330
1330
|
this._finishOnChange();
|
1331
1331
|
}
|
1332
1332
|
/**
|
@@ -18,6 +18,36 @@
|
|
18
18
|
* See the License for the specific language governing permissions and
|
19
19
|
* limitations under the License.
|
20
20
|
*/
|
21
|
+
/**
|
22
|
+
* Query the layer for all OIDs valid for any definition expressions applied to the layer.
|
23
|
+
*
|
24
|
+
* This query allows OIDs to be returned in the same order as shown in the FeatureTable.
|
25
|
+
* FeatureLayer.queryObjectIds can return OIDs in a different order.
|
26
|
+
*
|
27
|
+
* @param start zero-based index indicating where to begin retrieving features
|
28
|
+
* @param layer the layer to retrieve features from
|
29
|
+
* @param graphics stores the features
|
30
|
+
* @param orderBy One or more field names used to order the query results.
|
31
|
+
* Specify ASC (ascending) or DESC (descending) after the field name to control the order.
|
32
|
+
* The default order is ASC.
|
33
|
+
*
|
34
|
+
* @returns Promise with the OIDs sorted based on any orderBy definitions
|
35
|
+
*/
|
36
|
+
async function queryAllOidsWithQueryFeatures(start, layer, graphics, orderBy) {
|
37
|
+
const num = layer.capabilities.query.maxRecordCount;
|
38
|
+
const query = layer.createQuery();
|
39
|
+
query.start = start;
|
40
|
+
query.num = num;
|
41
|
+
query.returnGeometry = false;
|
42
|
+
query.orderByFields = orderBy;
|
43
|
+
query.outFields = [layer.objectIdField];
|
44
|
+
query.where = layer.definitionExpression || "1=1";
|
45
|
+
const result = await layer.queryFeatures(query);
|
46
|
+
graphics = graphics.concat(result.features);
|
47
|
+
return result.exceededTransferLimit ?
|
48
|
+
queryAllOidsWithQueryFeatures(start += num, layer, graphics, orderBy) :
|
49
|
+
Promise.resolve(graphics.map(g => g.attributes[layer.objectIdField]));
|
50
|
+
}
|
21
51
|
/**
|
22
52
|
* Query the layer for all IDs
|
23
53
|
*
|
@@ -125,22 +155,6 @@ async function queryFeaturesByGeometry(start, layer, geometry, featuresCollectio
|
|
125
155
|
queryFeaturesByGeometry(start += num, layer, geometry, featuresCollection) :
|
126
156
|
Promise.resolve(featuresCollection);
|
127
157
|
}
|
128
|
-
/**
|
129
|
-
* Query the layer for feature ids that match the provided where clause.
|
130
|
-
* If no where clause is provided all features will be returned.
|
131
|
-
*
|
132
|
-
* @param layer the layer to retrieve features from
|
133
|
-
* @param where the where clause for the query
|
134
|
-
* @param orderBy any sort order to apply to the query
|
135
|
-
*
|
136
|
-
* @returns Promise with the ids from the layer that match the where and are sorted as defined by orderBy
|
137
|
-
*/
|
138
|
-
async function queryFeatureIds(layer, where, orderBy) {
|
139
|
-
const query = layer.createQuery();
|
140
|
-
query.where = where ? where : "1=1";
|
141
|
-
query.orderByFields = orderBy;
|
142
|
-
return await layer.queryObjectIds(query);
|
143
|
-
}
|
144
158
|
/**
|
145
159
|
* Query the layer for the extent of features with the provided OIDs
|
146
160
|
*
|
@@ -198,4 +212,4 @@ async function _intersectQuery(geometry, layer) {
|
|
198
212
|
return layer.queryObjectIds(q);
|
199
213
|
}
|
200
214
|
|
201
|
-
export { queryExtent as a, queryAllIds as b,
|
215
|
+
export { queryExtent as a, queryAllIds as b, queryAllOidsWithQueryFeatures as c, queryFeaturesByGlobalID as d, queryObjectIds as e, queryFeaturesByGeometry as f, getQueryGeoms as g, queryFeaturesByID as q };
|