@esri/solutions-components 0.11.17 → 0.11.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/card-manager_3.cjs.entry.js +116 -137
- package/dist/cjs/create-feature_4.cjs.entry.js +55 -9
- package/dist/cjs/create-related-feature_3.cjs.entry.js +1 -1
- package/dist/cjs/crowdsource-manager.cjs.entry.js +32 -19
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +1 -1
- package/dist/cjs/{downloadUtils-88ec0e88.js → downloadUtils-9abff913.js} +1 -1
- package/dist/cjs/feature-list.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-layer-picker.cjs.entry.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/{mapViewUtils-319df9ec.js → mapViewUtils-4ea7216c.js} +0 -44
- package/dist/cjs/{popupUtils-ca1127aa.js → popupUtils-fc7557da.js} +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/solution-item-accordion.cjs.entry.js +6 -3
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/assets/t9n/crowdsource-manager/resources.json +4 -1
- package/dist/collection/assets/t9n/crowdsource-manager/resources_en.json +4 -1
- package/dist/collection/components/card-manager/card-manager.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +23 -0
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +32 -18
- package/dist/collection/components/info-card/info-card.js +88 -7
- package/dist/collection/components/layer-table/layer-table.js +147 -137
- package/dist/collection/components/solution-item-accordion/solution-item-accordion.js +11 -4
- package/dist/components/card-manager2.js +1 -1
- package/dist/components/crowdsource-manager.js +33 -19
- package/dist/components/info-card2.js +54 -6
- package/dist/components/layer-table2.js +116 -136
- package/dist/components/map-select-tools2.js +1 -1
- package/dist/components/queryUtils.js +1 -43
- package/dist/components/refine-selection2.js +1 -1
- package/dist/components/solution-item-accordion.js +6 -3
- package/dist/esm/card-manager_3.entry.js +116 -137
- package/dist/esm/create-feature_4.entry.js +55 -9
- package/dist/esm/create-related-feature_3.entry.js +1 -1
- package/dist/esm/crowdsource-manager.entry.js +32 -19
- package/dist/esm/crowdsource-reporter.entry.js +1 -1
- package/dist/esm/{downloadUtils-22a8f2d8.js → downloadUtils-36d854d2.js} +1 -1
- package/dist/esm/feature-list.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-layer-picker.entry.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +2 -2
- package/dist/esm/{mapViewUtils-a854e298.js → mapViewUtils-9da9be1c.js} +1 -43
- package/dist/esm/{popupUtils-1314cb13.js → popupUtils-64d25cb0.js} +1 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solution-item-accordion.entry.js +6 -3
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/assets/t9n/crowdsource-manager/resources.json +4 -1
- package/dist/solutions-components/assets/t9n/crowdsource-manager/resources_en.json +4 -1
- package/dist/solutions-components/{p-43d9bb7d.entry.js → p-055706e3.entry.js} +1 -1
- package/dist/solutions-components/{p-8ea0a36a.entry.js → p-06970873.entry.js} +1 -1
- package/dist/solutions-components/{p-bf2598f8.entry.js → p-3c43839b.entry.js} +1 -1
- package/dist/solutions-components/{p-4f514c6d.js → p-6eab9d1f.js} +1 -1
- package/dist/solutions-components/{p-a003600b.entry.js → p-72ae3bf0.entry.js} +1 -1
- package/dist/solutions-components/p-777ed6b0.entry.js +6 -0
- package/dist/solutions-components/{p-5ea1e18b.entry.js → p-8b5c3c9f.entry.js} +1 -1
- package/dist/solutions-components/{p-1fe3577a.entry.js → p-a44815ea.entry.js} +1 -1
- package/dist/solutions-components/p-b1bd3028.entry.js +6 -0
- package/dist/solutions-components/{p-3c3aecdd.js → p-d0d21a1f.js} +1 -1
- package/dist/solutions-components/{p-952da957.js → p-dcd2f00b.js} +2 -2
- package/dist/solutions-components/{p-bc2548ba.entry.js → p-e2270562.entry.js} +1 -1
- package/dist/solutions-components/p-e90c0e26.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components_commit.txt +6 -6
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +11 -7
- package/dist/types/components/info-card/info-card.d.ts +16 -0
- package/dist/types/components/layer-table/layer-table.d.ts +32 -21
- package/dist/types/components/solution-item-accordion/solution-item-accordion.d.ts +1 -1
- package/dist/types/components.d.ts +19 -2
- package/dist/types/preact.d.ts +2 -1
- package/package.json +1 -1
- package/dist/solutions-components/p-87919d6d.entry.js +0 -6
- package/dist/solutions-components/p-b37be371.entry.js +0 -6
- package/dist/solutions-components/p-ce8377c6.entry.js +0 -6
@@ -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
|
10
|
+
import { b as queryFeaturesByGlobalID } from './queryUtils.js';
|
11
11
|
import { d as downloadCSV } from './downloadUtils.js';
|
12
12
|
import { d as defineCustomElement$3 } from './instant-apps-filter-list2.js';
|
13
13
|
import { d as defineCustomElement$2 } from './instant-apps-social-share2.js';
|
@@ -213,10 +213,6 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
213
213
|
* IColumnsInfo: Key/value pair with fieldname/(visible in table)
|
214
214
|
*/
|
215
215
|
_columnsInfo;
|
216
|
-
/**
|
217
|
-
* boolean: When true the ctrl key is currently pressed
|
218
|
-
*/
|
219
|
-
_ctrlIsPressed = false;
|
220
216
|
/**
|
221
217
|
* number: The id of the most recently selected row from the table
|
222
218
|
*/
|
@@ -322,18 +318,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
322
318
|
* HTMLInstantAppsSocialShareElement: Element to support app sharing to social media
|
323
319
|
*/
|
324
320
|
_shareNode;
|
325
|
-
/**
|
326
|
-
* boolean: When true the shift key is currently pressed
|
327
|
-
*/
|
328
|
-
_shiftIsPressed = false;
|
329
321
|
/**
|
330
322
|
* HTMLCalciteDropdownElement: Dropdown the will support show/hide of table columns
|
331
323
|
*/
|
332
324
|
_showHideDropdown;
|
333
|
-
/**
|
334
|
-
* boolean: When true any onChange handeling will be skipped
|
335
|
-
*/
|
336
|
-
_skipOnChange = false;
|
337
325
|
/**
|
338
326
|
* HTMLCalciteDropdownElement: Dropdown the will support overflow tools that won't fit in the current display
|
339
327
|
*/
|
@@ -366,10 +354,22 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
366
354
|
* boolean: When true we will not evaluate if the editor has any pending edits
|
367
355
|
*/
|
368
356
|
_skipEditCheck = false;
|
357
|
+
/**
|
358
|
+
* __esri.Handle: handle for the filter by extent
|
359
|
+
*/
|
360
|
+
_filterByExtentHandle;
|
369
361
|
/**
|
370
362
|
* number[]: selected features from table
|
371
363
|
*/
|
372
364
|
_tempSelectedIds;
|
365
|
+
/**
|
366
|
+
* number[]: out of extent oids which are selected but now out of extent
|
367
|
+
*/
|
368
|
+
_outOFExtentOids = [];
|
369
|
+
/**
|
370
|
+
* boolean: When true allow table to update the records
|
371
|
+
*/
|
372
|
+
_shouldUpdateTableOnExtentChange = true;
|
373
373
|
//--------------------------------------------------------------------------
|
374
374
|
//
|
375
375
|
// Watch handlers
|
@@ -533,13 +533,35 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
533
533
|
* Reset the filter
|
534
534
|
*/
|
535
535
|
async filterReset() {
|
536
|
+
if (this._filterByExtentHandle) {
|
537
|
+
this._table.filterGeometry = undefined;
|
538
|
+
this._filterByExtentHandle.remove();
|
539
|
+
this._filterByExtentHandle = undefined;
|
540
|
+
}
|
536
541
|
await this._handleFilterListReset();
|
537
542
|
}
|
538
543
|
/**
|
539
544
|
* Updates the filter
|
540
545
|
*/
|
541
|
-
async filterUpdate(
|
542
|
-
await this._handleFilterUpdate(
|
546
|
+
async filterUpdate(filterActive, keepTableUpdatingOnMapExtentChange) {
|
547
|
+
await this._handleFilterUpdate(filterActive);
|
548
|
+
if (keepTableUpdatingOnMapExtentChange) {
|
549
|
+
this._shouldUpdateTableOnExtentChange = true;
|
550
|
+
this._handleTableOnMapExtent();
|
551
|
+
}
|
552
|
+
else if (keepTableUpdatingOnMapExtentChange === false) {
|
553
|
+
this._table.filterGeometry = undefined;
|
554
|
+
this._filterByExtentHandle.remove();
|
555
|
+
this._filterByExtentHandle = undefined;
|
556
|
+
// update all the ids when filter is unchecked or toggled off
|
557
|
+
await this._updateAllIds();
|
558
|
+
}
|
559
|
+
}
|
560
|
+
/**
|
561
|
+
* Validate if the table should update
|
562
|
+
*/
|
563
|
+
async validateTableUpdate(shouldUpdateTableOnExtentChange) {
|
564
|
+
this._shouldUpdateTableOnExtentChange = shouldUpdateTableOnExtentChange;
|
543
565
|
}
|
544
566
|
/**
|
545
567
|
* Validate if the editor has any pending edits
|
@@ -593,8 +615,20 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
593
615
|
* @returns a promise when the operation has completed
|
594
616
|
*/
|
595
617
|
async editorInitialized(evt) {
|
618
|
+
this._shouldUpdateTableOnExtentChange = false;
|
596
619
|
this._editor = evt.detail;
|
597
620
|
}
|
621
|
+
/**
|
622
|
+
* Respond to and close the edit record display
|
623
|
+
*
|
624
|
+
* @returns a promise when the operation has completed
|
625
|
+
*/
|
626
|
+
async closeEdit() {
|
627
|
+
this._shouldUpdateTableOnExtentChange = true;
|
628
|
+
if (this._filterByExtentHandle) {
|
629
|
+
this._handleTableOnMapExtent();
|
630
|
+
}
|
631
|
+
}
|
598
632
|
/**
|
599
633
|
* Scroll and zoom to the selected feature from the Features widget.
|
600
634
|
*
|
@@ -655,7 +689,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
655
689
|
async editsComplete(evt) {
|
656
690
|
const editType = evt.detail;
|
657
691
|
if (editType === "delete" || editType === "add") {
|
658
|
-
this._allIds = await queryAllIds(
|
692
|
+
this._allIds = await this.queryAllIds();
|
659
693
|
}
|
660
694
|
await this._refresh();
|
661
695
|
}
|
@@ -727,8 +761,8 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
727
761
|
const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
|
728
762
|
const showSearch = this._canShowFullTextSearch();
|
729
763
|
this._validateActiveActions();
|
730
|
-
return (h(Host, { key: '
|
731
|
-
h("div", { key: '
|
764
|
+
return (h(Host, { key: 'a0a998de3a1b29c311a9fdfa87f3bd836481ba5a' }, h("div", { key: 'aafaf9f925ed7321e1ca7f15fc7db369212dc1dc' }, h("calcite-scrim", { key: '86459aed994823dbf1d774aad01e8207a7df5f4f', class: scrimClass, loading: this._queryingData }), h("calcite-shell", { key: 'b29896a197cba444d2ac377779670394e29ecaf6' }, this._getTableControlRow("header"), h("div", { key: '0456651ac46f399eb04253387d7aae76995f4683', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: '9ba484159832fea630bbb653bc2fc4e99e602674', class: "height-full width-full" }, showSearch &&
|
765
|
+
h("div", { key: 'bd4b72db51f44c2954e893e8ef7ec2a30efc4c45', class: "search-container" }, h("calcite-input", { key: '8811ff1dd71408fda37a0d7d2403671df24b5b7b', class: "search", clearable: true, icon: "search", onCalciteInputChange: (evt) => void this._searchTextChanged(evt), placeholder: this._searchPlaceHolder, title: this._searchPlaceHolder, type: "search" })), h("calcite-loader", { key: '44a419089cf1e207f52ce19015c2870ce956e261', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '096f4fc7f5cc9500e7982bbfaceb2fcc4c82a1dd', class: tableNodeClass, ref: this.onTableNodeCreate }))), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
|
732
766
|
.replace("{{total}}", total)
|
733
767
|
.replace("{{selected}}", selected))) : undefined), this.createFilterModal && this._filterModal())));
|
734
768
|
}
|
@@ -748,8 +782,6 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
748
782
|
componentDidRender() {
|
749
783
|
// need to be called after each render to get the clicked mouseEvent
|
750
784
|
document.onclick = (e) => this._handleDocumentClick(e);
|
751
|
-
document.onkeydown = (e) => this._handleKeyDown(e);
|
752
|
-
document.onkeyup = (e) => this._handleKeyUp(e);
|
753
785
|
this._updateToolbar();
|
754
786
|
}
|
755
787
|
//--------------------------------------------------------------------------
|
@@ -1010,6 +1042,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1010
1042
|
}
|
1011
1043
|
if (ti.icon === "selected-items-filter") {
|
1012
1044
|
ti.active = this._showOnlySelected;
|
1045
|
+
ti.label = this._showOnlySelected ? this._translations.showAll : this._translations.showSelected;
|
1013
1046
|
}
|
1014
1047
|
}
|
1015
1048
|
});
|
@@ -1024,7 +1057,6 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1024
1057
|
// hide multiple edits for R03
|
1025
1058
|
const showMultipleEdits = this.selectedIds.length > 1 && this._layer?.capabilities?.operations?.supportsUpdate && false;
|
1026
1059
|
const featuresEmpty = this._featuresEmpty();
|
1027
|
-
const hasFilterExpressions = this._hasFilterExpressions();
|
1028
1060
|
if (this._translations) {
|
1029
1061
|
this._toolInfos = [
|
1030
1062
|
!this.mapHidden ? {
|
@@ -1036,7 +1068,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1036
1068
|
disabled: !featuresSelected,
|
1037
1069
|
isOverflow: false
|
1038
1070
|
} : undefined,
|
1039
|
-
|
1071
|
+
{
|
1040
1072
|
active: false,
|
1041
1073
|
icon: "filter",
|
1042
1074
|
indicator: false,
|
@@ -1044,7 +1076,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1044
1076
|
func: () => this.createFilterModal ? this._toggleFilter() : this.toggleFilter.emit(),
|
1045
1077
|
disabled: false,
|
1046
1078
|
isOverflow: false
|
1047
|
-
}
|
1079
|
+
},
|
1048
1080
|
showMultipleEdits ? {
|
1049
1081
|
active: false,
|
1050
1082
|
icon: "pencil",
|
@@ -1446,6 +1478,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1446
1478
|
editingEnabled: this._editEnabled && this.enableInlineEdit,
|
1447
1479
|
highlightEnabled: true,
|
1448
1480
|
multiSortEnabled: false,
|
1481
|
+
attachmentsEnabled: true,
|
1449
1482
|
visibleElements: {
|
1450
1483
|
columnDescriptions: false,
|
1451
1484
|
header: false,
|
@@ -1477,88 +1510,9 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1477
1510
|
return;
|
1478
1511
|
}
|
1479
1512
|
const ids = [...this._getIds()];
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
this._skipOnChange = true;
|
1484
|
-
// only readd in specific case where we have multiple selected and then click one of the currently selected
|
1485
|
-
const reAdd = this.selectedIds.length > 1 && evt.removed.length === 1;
|
1486
|
-
const newIds = reAdd ? evt.removed : ids.filter(id => this.selectedIds.indexOf(id) < 0);
|
1487
|
-
this._tempSelectedIds = newIds.length ? [...newIds] : [...this.selectedIds];
|
1488
|
-
this._clearSelection();
|
1489
|
-
this.selectedIds = [...newIds];
|
1490
|
-
if (newIds.length > 0) {
|
1491
|
-
this._table.highlightIds.add(newIds[0]);
|
1492
|
-
}
|
1493
|
-
else {
|
1494
|
-
this._skipOnChange = false;
|
1495
|
-
}
|
1496
|
-
}
|
1497
|
-
else {
|
1498
|
-
// https://github.com/Esri/solutions-components/issues/365
|
1499
|
-
this.selectedIds = ids.reverse();
|
1500
|
-
this._tempSelectedIds = [...this.selectedIds];
|
1501
|
-
}
|
1502
|
-
}
|
1503
|
-
else if (this._ctrlIsPressed) {
|
1504
|
-
this.selectedIds = ids.reverse();
|
1505
|
-
this._tempSelectedIds = [...this.selectedIds];
|
1506
|
-
}
|
1507
|
-
else if (this._shiftIsPressed && ids?.length > 0) {
|
1508
|
-
this._skipOnChange = true;
|
1509
|
-
this._previousCurrentId = this._currentId;
|
1510
|
-
this._currentId = [...ids].reverse()[0];
|
1511
|
-
if (ids.length === 1) {
|
1512
|
-
this._skipOnChange = false;
|
1513
|
-
}
|
1514
|
-
else if (this._previousCurrentId !== this._currentId) {
|
1515
|
-
// query the layer based on current sort and filters then grab between the current id and previous id
|
1516
|
-
const orderBy = this._table.activeSortOrders.reduce((prev, cur) => {
|
1517
|
-
prev.push(`${cur.fieldName} ${cur.direction}`);
|
1518
|
-
return prev;
|
1519
|
-
}, []);
|
1520
|
-
// when dealing with a feature layer with many features shift-select can take a very long time.
|
1521
|
-
// don't allow the user to make additional interactions with the table if it takes more than 500 miliseconds
|
1522
|
-
let queryComplete = false;
|
1523
|
-
setTimeout(() => {
|
1524
|
-
if (!queryComplete) {
|
1525
|
-
this._queryingData = true;
|
1526
|
-
}
|
1527
|
-
}, 500);
|
1528
|
-
const oids = await queryAllOidsWithQueryFeatures(0, this._layer, [], orderBy);
|
1529
|
-
queryComplete = true;
|
1530
|
-
this._queryingData = false;
|
1531
|
-
let isBetween = false;
|
1532
|
-
const _start = this._table.viewModel.getObjectIdIndex(this._previousCurrentId);
|
1533
|
-
const _end = this._table.viewModel.getObjectIdIndex(this._currentId);
|
1534
|
-
const startIndex = _start < _end ? _start : _end;
|
1535
|
-
const endIndex = _end > _start ? _end : _start;
|
1536
|
-
this._skipOnChange = startIndex + 1 !== endIndex;
|
1537
|
-
const idsInRange = oids.reduce((prev, cur) => {
|
1538
|
-
const id = cur;
|
1539
|
-
if ((id === this._currentId || id === this._previousCurrentId)) {
|
1540
|
-
isBetween = !isBetween;
|
1541
|
-
if (prev.indexOf(id) < 0) {
|
1542
|
-
prev.push(id);
|
1543
|
-
}
|
1544
|
-
}
|
1545
|
-
else if (isBetween && prev.indexOf(id) < 0) {
|
1546
|
-
prev.push(id);
|
1547
|
-
}
|
1548
|
-
return prev;
|
1549
|
-
}, []);
|
1550
|
-
const selectedIds = _start < _end ? idsInRange.reverse() : idsInRange;
|
1551
|
-
this.selectedIds = [...new Set([...selectedIds, ...this.selectedIds])];
|
1552
|
-
this._tempSelectedIds = [...this.selectedIds];
|
1553
|
-
this._table.highlightIds.addMany(this.selectedIds.filter(i => ids.indexOf(i) < 0));
|
1554
|
-
}
|
1555
|
-
}
|
1556
|
-
this._finishOnChange();
|
1557
|
-
}
|
1558
|
-
else {
|
1559
|
-
this._skipOnChange = false;
|
1560
|
-
}
|
1561
|
-
this._currentId = [...this._getIds()].reverse()[0];
|
1513
|
+
this.selectedIds = ids.reverse();
|
1514
|
+
this._tempSelectedIds = [...this.selectedIds];
|
1515
|
+
this._finishOnChange();
|
1562
1516
|
this._selectionFromMap = false;
|
1563
1517
|
}
|
1564
1518
|
/**
|
@@ -1597,6 +1551,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1597
1551
|
handleOnChange = !this._skipEditCheck;
|
1598
1552
|
this._skipEditCheck = false;
|
1599
1553
|
}
|
1554
|
+
this._shouldUpdateTableOnExtentChange = handleOnChange;
|
1600
1555
|
return handleOnChange;
|
1601
1556
|
}
|
1602
1557
|
/**
|
@@ -1613,7 +1568,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1613
1568
|
_finishOnChange() {
|
1614
1569
|
if (this._showOnlySelected) {
|
1615
1570
|
if (this._featuresSelected()) {
|
1616
|
-
this._table.
|
1571
|
+
this._table.filterBySelectionEnabled = true;
|
1617
1572
|
}
|
1618
1573
|
else {
|
1619
1574
|
this._toggleShowSelected();
|
@@ -1651,7 +1606,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1651
1606
|
async _resetTable() {
|
1652
1607
|
this._loaded = false;
|
1653
1608
|
this._clearSelection();
|
1654
|
-
this._allIds = await queryAllIds(
|
1609
|
+
this._allIds = await this.queryAllIds();
|
1655
1610
|
if (!this._table) {
|
1656
1611
|
const columnTemplates = this._getColumnTemplates(this._layer.id, this._layer?.fields);
|
1657
1612
|
await this._getTable(this._tableNode, columnTemplates);
|
@@ -1705,7 +1660,6 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1705
1660
|
}
|
1706
1661
|
this._refreshHandle = this._layer.on("refresh", (evt) => {
|
1707
1662
|
if (evt.dataChanged) {
|
1708
|
-
this._skipOnChange = true;
|
1709
1663
|
void this._updateAllIds();
|
1710
1664
|
}
|
1711
1665
|
});
|
@@ -1714,7 +1668,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1714
1668
|
* Reset _allIds when the layers data has changed and refresh the selection ids and table
|
1715
1669
|
*/
|
1716
1670
|
async _updateAllIds() {
|
1717
|
-
this._allIds = await queryAllIds(
|
1671
|
+
this._allIds = await this.queryAllIds();
|
1718
1672
|
this.selectedIds = this.selectedIds.filter(id => this._allIds.indexOf(id) > -1);
|
1719
1673
|
await this._refresh();
|
1720
1674
|
}
|
@@ -1854,20 +1808,6 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1854
1808
|
}
|
1855
1809
|
}
|
1856
1810
|
}
|
1857
|
-
/**
|
1858
|
-
* Keep track of key down for ctrl and shift
|
1859
|
-
*/
|
1860
|
-
_handleKeyDown(e) {
|
1861
|
-
this._ctrlIsPressed = e.ctrlKey;
|
1862
|
-
this._shiftIsPressed = e.shiftKey;
|
1863
|
-
}
|
1864
|
-
/**
|
1865
|
-
* Keep track of key up for ctrl and shift
|
1866
|
-
*/
|
1867
|
-
_handleKeyUp(e) {
|
1868
|
-
this._ctrlIsPressed = e.ctrlKey;
|
1869
|
-
this._shiftIsPressed = e.shiftKey;
|
1870
|
-
}
|
1871
1811
|
/**
|
1872
1812
|
* Show filter component in modal
|
1873
1813
|
*
|
@@ -1903,6 +1843,40 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1903
1843
|
this._updateShareUrl();
|
1904
1844
|
await this._searchFullText();
|
1905
1845
|
}
|
1846
|
+
/**
|
1847
|
+
* Update the table when extent is changed
|
1848
|
+
*/
|
1849
|
+
_handleTableOnMapExtent() {
|
1850
|
+
if (this._table) {
|
1851
|
+
this._filterByExtentHandle = this.reactiveUtils.when(() => this.mapView.stationary,
|
1852
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
1853
|
+
async () => {
|
1854
|
+
if (this._shouldUpdateTableOnExtentChange) {
|
1855
|
+
//Added timeout while updating table records to avoid the issue in which we see empty table records when extent is changed
|
1856
|
+
await new Promise(resolve => setTimeout(resolve, 800));
|
1857
|
+
this._table.filterGeometry = this.mapView.extent;
|
1858
|
+
const query = {
|
1859
|
+
geometry: this.mapView.extent
|
1860
|
+
};
|
1861
|
+
const objectIdsInExtent = await this._layer.queryObjectIds(query);
|
1862
|
+
// remove the highlight of features which are not in the map extent
|
1863
|
+
const outOids = this.selectedIds.filter(id => !objectIdsInExtent.includes(id));
|
1864
|
+
const restoreOids = this._outOFExtentOids.filter(id => objectIdsInExtent.includes(id));
|
1865
|
+
if (outOids.length > 0) {
|
1866
|
+
this._table.highlightIds.removeMany(outOids);
|
1867
|
+
this._outOFExtentOids = [...this._outOFExtentOids, ...outOids];
|
1868
|
+
}
|
1869
|
+
if (restoreOids.length > 0) {
|
1870
|
+
this._table.highlightIds.addMany(restoreOids);
|
1871
|
+
this._outOFExtentOids = this._outOFExtentOids.filter(oid => !restoreOids.includes(oid));
|
1872
|
+
}
|
1873
|
+
}
|
1874
|
+
this._allIds = await this.queryAllIds();
|
1875
|
+
}, {
|
1876
|
+
initial: true
|
1877
|
+
});
|
1878
|
+
}
|
1879
|
+
}
|
1906
1880
|
/**
|
1907
1881
|
* Close the filter modal
|
1908
1882
|
* @protected
|
@@ -1910,10 +1884,20 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1910
1884
|
async _closeFilter() {
|
1911
1885
|
if (this._filterOpen) {
|
1912
1886
|
// reset allIds
|
1913
|
-
this._allIds = await queryAllIds(
|
1887
|
+
this._allIds = await this.queryAllIds();
|
1914
1888
|
this._filterOpen = false;
|
1915
1889
|
}
|
1916
1890
|
}
|
1891
|
+
/**
|
1892
|
+
* Query the layer for applied filter
|
1893
|
+
* @returns Promise with the featureSet from the layer that match the provided ids
|
1894
|
+
*/
|
1895
|
+
async queryAllIds() {
|
1896
|
+
const query = this._layer.createQuery();
|
1897
|
+
query.geometry = this._filterByExtentHandle ? this.mapView.extent : null;
|
1898
|
+
query.where = this._layer.definitionExpression || "1=1";
|
1899
|
+
return await this._layer.queryObjectIds(query);
|
1900
|
+
}
|
1917
1901
|
/**
|
1918
1902
|
* Handle map click events to keep table and map click selection in sync
|
1919
1903
|
*
|
@@ -1935,7 +1919,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1935
1919
|
}
|
1936
1920
|
});
|
1937
1921
|
if (this._showOnlySelected) {
|
1938
|
-
this._table.
|
1922
|
+
this._table.filterBySelectionEnabled = true;
|
1939
1923
|
}
|
1940
1924
|
}
|
1941
1925
|
else {
|
@@ -1952,7 +1936,6 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1952
1936
|
const editsDiscarded = await this._validateActiveEdits(addedIds, this.selectedIds);
|
1953
1937
|
if (editsDiscarded) {
|
1954
1938
|
this._table.highlightIds.removeAll();
|
1955
|
-
this._skipOnChange = true;
|
1956
1939
|
this._table.highlightIds.addMany(ids);
|
1957
1940
|
this.selectedIds = ids;
|
1958
1941
|
this._finishOnChange();
|
@@ -1969,12 +1952,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1969
1952
|
*/
|
1970
1953
|
_toggleShowSelected() {
|
1971
1954
|
this._showOnlySelected = !this._showOnlySelected;
|
1972
|
-
|
1973
|
-
this._table.filterBySelection();
|
1974
|
-
}
|
1975
|
-
else {
|
1976
|
-
this._table.objectIds.removeAll();
|
1977
|
-
}
|
1955
|
+
this._table.filterBySelectionEnabled = this._showOnlySelected;
|
1978
1956
|
}
|
1979
1957
|
/**
|
1980
1958
|
* Clears the selected indexes
|
@@ -1982,6 +1960,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1982
1960
|
*/
|
1983
1961
|
_clearSelection() {
|
1984
1962
|
this.selectedIds = [];
|
1963
|
+
this._outOFExtentOids = [];
|
1985
1964
|
this._table?.highlightIds.removeAll();
|
1986
1965
|
this._table?.rowHighlightIds.removeAll();
|
1987
1966
|
this._finishOnChange();
|
@@ -2021,7 +2000,6 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
2021
2000
|
const editsDiscarded = await this._validateActiveEdits(ids, currentIndexes);
|
2022
2001
|
if (editsDiscarded) {
|
2023
2002
|
this._table.highlightIds.removeAll();
|
2024
|
-
this._skipOnChange = true;
|
2025
2003
|
this._table.highlightIds.addMany(ids);
|
2026
2004
|
this.selectedIds = ids;
|
2027
2005
|
this._finishOnChange();
|
@@ -2079,8 +2057,8 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
2079
2057
|
async _refresh() {
|
2080
2058
|
const editsDiscarded = await this._validateActiveEdits([], this.selectedIds);
|
2081
2059
|
if (editsDiscarded) {
|
2082
|
-
await this._table
|
2083
|
-
this._allIds = await queryAllIds(
|
2060
|
+
await this._table?.refresh();
|
2061
|
+
this._allIds = await this.queryAllIds();
|
2084
2062
|
this.featureSelectionChange.emit(this.selectedIds);
|
2085
2063
|
}
|
2086
2064
|
}
|
@@ -2110,6 +2088,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
2110
2088
|
this._fetchingData = true;
|
2111
2089
|
const layer = await getLayerOrTable(this.mapView, id);
|
2112
2090
|
layer && await layer.when(() => {
|
2091
|
+
this._shouldUpdateTableOnExtentChange = true;
|
2113
2092
|
this._layer = layer;
|
2114
2093
|
this._getFullTextSearchInfo();
|
2115
2094
|
});
|
@@ -2275,9 +2254,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
2275
2254
|
"closeFilter": [64],
|
2276
2255
|
"filterReset": [64],
|
2277
2256
|
"filterUpdate": [64],
|
2257
|
+
"validateTableUpdate": [64],
|
2278
2258
|
"validateActiveEdits": [64],
|
2279
2259
|
"refresh": [64]
|
2280
|
-
}, [[10, "beforeMapInfoChange", "beforeMapInfoChange"], [8, "editorInitialized", "editorInitialized"], [8, "selectionChanged", "selectionChanged"], [8, "beforeLayerSelectionChange", "beforeLayerSelectionChange"], [8, "layerSelectionChange", "layerSelectionChange"], [8, "editsComplete", "editsComplete"], [8, "facilityChanged", "facilityChanged"], [8, "levelChanged", "levelChanged"], [8, "siteChanged", "siteChanged"], [8, "noLayersFound", "noLayersFound"], [8, "clearSelection", "clearSelection"]], {
|
2260
|
+
}, [[10, "beforeMapInfoChange", "beforeMapInfoChange"], [8, "editorInitialized", "editorInitialized"], [8, "closeEdit", "closeEdit"], [8, "selectionChanged", "selectionChanged"], [8, "beforeLayerSelectionChange", "beforeLayerSelectionChange"], [8, "layerSelectionChange", "layerSelectionChange"], [8, "editsComplete", "editsComplete"], [8, "facilityChanged", "facilityChanged"], [8, "levelChanged", "levelChanged"], [8, "siteChanged", "siteChanged"], [8, "noLayersFound", "noLayersFound"], [8, "clearSelection", "clearSelection"]], {
|
2281
2261
|
"appLayout": ["appLayoutWatchHandler"],
|
2282
2262
|
"defaultOid": ["defaultOidWatchHandler"],
|
2283
2263
|
"defaultGlobalId": ["defaultGlobalIdWatchHandler"],
|
@@ -6,7 +6,7 @@
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
7
7
|
import { l as loadModules } from './loadModules.js';
|
8
8
|
import { b as goToSelection, h as highlightFeatures, c as getFeatureLayerView } from './mapViewUtils.js';
|
9
|
-
import {
|
9
|
+
import { c as queryObjectIds, g as getQueryGeoms, d as queryFeaturesByGeometry } from './queryUtils.js';
|
10
10
|
import { E as EWorkflowType } from './interfaces.js';
|
11
11
|
import { s as state } from './publicNotificationStore.js';
|
12
12
|
import { a as getComponentClosestLanguage, g as getLocaleComponentStrings } from './locale.js';
|
@@ -18,48 +18,6 @@
|
|
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
|
-
}
|
51
|
-
/**
|
52
|
-
* Query the layer for all IDs
|
53
|
-
*
|
54
|
-
* @param layer the layer to retrieve features from
|
55
|
-
*
|
56
|
-
* @returns Promise with the featureSet from the layer that match the provided ids
|
57
|
-
*/
|
58
|
-
async function queryAllIds(layer) {
|
59
|
-
const query = layer.createQuery();
|
60
|
-
query.where = layer.definitionExpression || "1=1";
|
61
|
-
return await layer.queryObjectIds(query);
|
62
|
-
}
|
63
21
|
/**
|
64
22
|
* Query the layer for OIDs based on any user drawn geometries or buffers
|
65
23
|
*
|
@@ -214,4 +172,4 @@ async function _intersectQuery(geometry, layer) {
|
|
214
172
|
return layer.queryObjectIds(q);
|
215
173
|
}
|
216
174
|
|
217
|
-
export { queryExtent as a,
|
175
|
+
export { queryExtent as a, queryFeaturesByGlobalID as b, queryObjectIds as c, queryFeaturesByGeometry as d, getQueryGeoms as g, queryFeaturesByID as q };
|
@@ -6,7 +6,7 @@
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
7
7
|
import { e as ESelectionMode, b as EDrawMode, E as EWorkflowType } from './interfaces.js';
|
8
8
|
import { c as getFeatureLayerView, i as getIdSets, j as highlightAllFeatures } from './mapViewUtils.js';
|
9
|
-
import {
|
9
|
+
import { d as queryFeaturesByGeometry } from './queryUtils.js';
|
10
10
|
import { s as state } from './publicNotificationStore.js';
|
11
11
|
import { g as getLocaleComponentStrings } from './locale.js';
|
12
12
|
import { d as defineCustomElement$2 } from './map-draw-tools2.js';
|
@@ -119,14 +119,17 @@ const SolutionItemAccordion$1 = /*@__PURE__*/ proxyCustomElement(class SolutionI
|
|
119
119
|
//
|
120
120
|
//--------------------------------------------------------------------------
|
121
121
|
/**
|
122
|
-
*
|
122
|
+
* Deselects all items in the accordion and closes the accordion item containing it.
|
123
123
|
* Only applies when selectionMode is "single" or "single-persist".
|
124
124
|
*/
|
125
125
|
async deselectAll() {
|
126
126
|
if (this.listSelectionMode === "single" || this.listSelectionMode === "single-persist") {
|
127
127
|
const items = this.el.shadowRoot.querySelectorAll("calcite-list-item");
|
128
128
|
items.forEach(item => {
|
129
|
-
item.selected
|
129
|
+
if (item.selected) {
|
130
|
+
item.selected = false;
|
131
|
+
item.parentElement.parentElement.expanded = false;
|
132
|
+
}
|
130
133
|
});
|
131
134
|
}
|
132
135
|
}
|
@@ -171,7 +174,7 @@ const SolutionItemAccordion$1 = /*@__PURE__*/ proxyCustomElement(class SolutionI
|
|
171
174
|
* Renders the component.
|
172
175
|
*/
|
173
176
|
render() {
|
174
|
-
return (h(Host, { key: '
|
177
|
+
return (h(Host, { key: '23845e68bd1920f17f27b1679df20915230f99c3' }, this._getAccordion()));
|
175
178
|
}
|
176
179
|
//--------------------------------------------------------------------------
|
177
180
|
//
|