@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
@@ -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 {
|
25
|
+
import { 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 {
|
@@ -220,10 +220,6 @@ export class LayerTable {
|
|
220
220
|
* IColumnsInfo: Key/value pair with fieldname/(visible in table)
|
221
221
|
*/
|
222
222
|
_columnsInfo;
|
223
|
-
/**
|
224
|
-
* boolean: When true the ctrl key is currently pressed
|
225
|
-
*/
|
226
|
-
_ctrlIsPressed = false;
|
227
223
|
/**
|
228
224
|
* number: The id of the most recently selected row from the table
|
229
225
|
*/
|
@@ -329,18 +325,10 @@ export class LayerTable {
|
|
329
325
|
* HTMLInstantAppsSocialShareElement: Element to support app sharing to social media
|
330
326
|
*/
|
331
327
|
_shareNode;
|
332
|
-
/**
|
333
|
-
* boolean: When true the shift key is currently pressed
|
334
|
-
*/
|
335
|
-
_shiftIsPressed = false;
|
336
328
|
/**
|
337
329
|
* HTMLCalciteDropdownElement: Dropdown the will support show/hide of table columns
|
338
330
|
*/
|
339
331
|
_showHideDropdown;
|
340
|
-
/**
|
341
|
-
* boolean: When true any onChange handeling will be skipped
|
342
|
-
*/
|
343
|
-
_skipOnChange = false;
|
344
332
|
/**
|
345
333
|
* HTMLCalciteDropdownElement: Dropdown the will support overflow tools that won't fit in the current display
|
346
334
|
*/
|
@@ -373,10 +361,22 @@ export class LayerTable {
|
|
373
361
|
* boolean: When true we will not evaluate if the editor has any pending edits
|
374
362
|
*/
|
375
363
|
_skipEditCheck = false;
|
364
|
+
/**
|
365
|
+
* __esri.Handle: handle for the filter by extent
|
366
|
+
*/
|
367
|
+
_filterByExtentHandle;
|
376
368
|
/**
|
377
369
|
* number[]: selected features from table
|
378
370
|
*/
|
379
371
|
_tempSelectedIds;
|
372
|
+
/**
|
373
|
+
* number[]: out of extent oids which are selected but now out of extent
|
374
|
+
*/
|
375
|
+
_outOFExtentOids = [];
|
376
|
+
/**
|
377
|
+
* boolean: When true allow table to update the records
|
378
|
+
*/
|
379
|
+
_shouldUpdateTableOnExtentChange = true;
|
380
380
|
//--------------------------------------------------------------------------
|
381
381
|
//
|
382
382
|
// Watch handlers
|
@@ -540,13 +540,35 @@ export class LayerTable {
|
|
540
540
|
* Reset the filter
|
541
541
|
*/
|
542
542
|
async filterReset() {
|
543
|
+
if (this._filterByExtentHandle) {
|
544
|
+
this._table.filterGeometry = undefined;
|
545
|
+
this._filterByExtentHandle.remove();
|
546
|
+
this._filterByExtentHandle = undefined;
|
547
|
+
}
|
543
548
|
await this._handleFilterListReset();
|
544
549
|
}
|
545
550
|
/**
|
546
551
|
* Updates the filter
|
547
552
|
*/
|
548
|
-
async filterUpdate(
|
549
|
-
await this._handleFilterUpdate(
|
553
|
+
async filterUpdate(filterActive, keepTableUpdatingOnMapExtentChange) {
|
554
|
+
await this._handleFilterUpdate(filterActive);
|
555
|
+
if (keepTableUpdatingOnMapExtentChange) {
|
556
|
+
this._shouldUpdateTableOnExtentChange = true;
|
557
|
+
this._handleTableOnMapExtent();
|
558
|
+
}
|
559
|
+
else if (keepTableUpdatingOnMapExtentChange === false) {
|
560
|
+
this._table.filterGeometry = undefined;
|
561
|
+
this._filterByExtentHandle.remove();
|
562
|
+
this._filterByExtentHandle = undefined;
|
563
|
+
// update all the ids when filter is unchecked or toggled off
|
564
|
+
await this._updateAllIds();
|
565
|
+
}
|
566
|
+
}
|
567
|
+
/**
|
568
|
+
* Validate if the table should update
|
569
|
+
*/
|
570
|
+
async validateTableUpdate(shouldUpdateTableOnExtentChange) {
|
571
|
+
this._shouldUpdateTableOnExtentChange = shouldUpdateTableOnExtentChange;
|
550
572
|
}
|
551
573
|
/**
|
552
574
|
* Validate if the editor has any pending edits
|
@@ -600,8 +622,20 @@ export class LayerTable {
|
|
600
622
|
* @returns a promise when the operation has completed
|
601
623
|
*/
|
602
624
|
async editorInitialized(evt) {
|
625
|
+
this._shouldUpdateTableOnExtentChange = false;
|
603
626
|
this._editor = evt.detail;
|
604
627
|
}
|
628
|
+
/**
|
629
|
+
* Respond to and close the edit record display
|
630
|
+
*
|
631
|
+
* @returns a promise when the operation has completed
|
632
|
+
*/
|
633
|
+
async closeEdit() {
|
634
|
+
this._shouldUpdateTableOnExtentChange = true;
|
635
|
+
if (this._filterByExtentHandle) {
|
636
|
+
this._handleTableOnMapExtent();
|
637
|
+
}
|
638
|
+
}
|
605
639
|
/**
|
606
640
|
* Scroll and zoom to the selected feature from the Features widget.
|
607
641
|
*
|
@@ -662,7 +696,7 @@ export class LayerTable {
|
|
662
696
|
async editsComplete(evt) {
|
663
697
|
const editType = evt.detail;
|
664
698
|
if (editType === "delete" || editType === "add") {
|
665
|
-
this._allIds = await queryAllIds(
|
699
|
+
this._allIds = await this.queryAllIds();
|
666
700
|
}
|
667
701
|
await this._refresh();
|
668
702
|
}
|
@@ -734,8 +768,8 @@ export class LayerTable {
|
|
734
768
|
const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
|
735
769
|
const showSearch = this._canShowFullTextSearch();
|
736
770
|
this._validateActiveActions();
|
737
|
-
return (h(Host, { key: '
|
738
|
-
h("div", { key: '
|
771
|
+
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 &&
|
772
|
+
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
|
739
773
|
.replace("{{total}}", total)
|
740
774
|
.replace("{{selected}}", selected))) : undefined), this.createFilterModal && this._filterModal())));
|
741
775
|
}
|
@@ -755,8 +789,6 @@ export class LayerTable {
|
|
755
789
|
componentDidRender() {
|
756
790
|
// need to be called after each render to get the clicked mouseEvent
|
757
791
|
document.onclick = (e) => this._handleDocumentClick(e);
|
758
|
-
document.onkeydown = (e) => this._handleKeyDown(e);
|
759
|
-
document.onkeyup = (e) => this._handleKeyUp(e);
|
760
792
|
this._updateToolbar();
|
761
793
|
}
|
762
794
|
//--------------------------------------------------------------------------
|
@@ -1017,6 +1049,7 @@ export class LayerTable {
|
|
1017
1049
|
}
|
1018
1050
|
if (ti.icon === "selected-items-filter") {
|
1019
1051
|
ti.active = this._showOnlySelected;
|
1052
|
+
ti.label = this._showOnlySelected ? this._translations.showAll : this._translations.showSelected;
|
1020
1053
|
}
|
1021
1054
|
}
|
1022
1055
|
});
|
@@ -1031,7 +1064,6 @@ export class LayerTable {
|
|
1031
1064
|
// hide multiple edits for R03
|
1032
1065
|
const showMultipleEdits = this.selectedIds.length > 1 && this._layer?.capabilities?.operations?.supportsUpdate && false;
|
1033
1066
|
const featuresEmpty = this._featuresEmpty();
|
1034
|
-
const hasFilterExpressions = this._hasFilterExpressions();
|
1035
1067
|
if (this._translations) {
|
1036
1068
|
this._toolInfos = [
|
1037
1069
|
!this.mapHidden ? {
|
@@ -1043,7 +1075,7 @@ export class LayerTable {
|
|
1043
1075
|
disabled: !featuresSelected,
|
1044
1076
|
isOverflow: false
|
1045
1077
|
} : undefined,
|
1046
|
-
|
1078
|
+
{
|
1047
1079
|
active: false,
|
1048
1080
|
icon: "filter",
|
1049
1081
|
indicator: false,
|
@@ -1051,7 +1083,7 @@ export class LayerTable {
|
|
1051
1083
|
func: () => this.createFilterModal ? this._toggleFilter() : this.toggleFilter.emit(),
|
1052
1084
|
disabled: false,
|
1053
1085
|
isOverflow: false
|
1054
|
-
}
|
1086
|
+
},
|
1055
1087
|
showMultipleEdits ? {
|
1056
1088
|
active: false,
|
1057
1089
|
icon: "pencil",
|
@@ -1453,6 +1485,7 @@ export class LayerTable {
|
|
1453
1485
|
editingEnabled: this._editEnabled && this.enableInlineEdit,
|
1454
1486
|
highlightEnabled: true,
|
1455
1487
|
multiSortEnabled: false,
|
1488
|
+
attachmentsEnabled: true,
|
1456
1489
|
visibleElements: {
|
1457
1490
|
columnDescriptions: false,
|
1458
1491
|
header: false,
|
@@ -1484,88 +1517,9 @@ export class LayerTable {
|
|
1484
1517
|
return;
|
1485
1518
|
}
|
1486
1519
|
const ids = [...this._getIds()];
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
this._skipOnChange = true;
|
1491
|
-
// only readd in specific case where we have multiple selected and then click one of the currently selected
|
1492
|
-
const reAdd = this.selectedIds.length > 1 && evt.removed.length === 1;
|
1493
|
-
const newIds = reAdd ? evt.removed : ids.filter(id => this.selectedIds.indexOf(id) < 0);
|
1494
|
-
this._tempSelectedIds = newIds.length ? [...newIds] : [...this.selectedIds];
|
1495
|
-
this._clearSelection();
|
1496
|
-
this.selectedIds = [...newIds];
|
1497
|
-
if (newIds.length > 0) {
|
1498
|
-
this._table.highlightIds.add(newIds[0]);
|
1499
|
-
}
|
1500
|
-
else {
|
1501
|
-
this._skipOnChange = false;
|
1502
|
-
}
|
1503
|
-
}
|
1504
|
-
else {
|
1505
|
-
// https://github.com/Esri/solutions-components/issues/365
|
1506
|
-
this.selectedIds = ids.reverse();
|
1507
|
-
this._tempSelectedIds = [...this.selectedIds];
|
1508
|
-
}
|
1509
|
-
}
|
1510
|
-
else if (this._ctrlIsPressed) {
|
1511
|
-
this.selectedIds = ids.reverse();
|
1512
|
-
this._tempSelectedIds = [...this.selectedIds];
|
1513
|
-
}
|
1514
|
-
else if (this._shiftIsPressed && ids?.length > 0) {
|
1515
|
-
this._skipOnChange = true;
|
1516
|
-
this._previousCurrentId = this._currentId;
|
1517
|
-
this._currentId = [...ids].reverse()[0];
|
1518
|
-
if (ids.length === 1) {
|
1519
|
-
this._skipOnChange = false;
|
1520
|
-
}
|
1521
|
-
else if (this._previousCurrentId !== this._currentId) {
|
1522
|
-
// query the layer based on current sort and filters then grab between the current id and previous id
|
1523
|
-
const orderBy = this._table.activeSortOrders.reduce((prev, cur) => {
|
1524
|
-
prev.push(`${cur.fieldName} ${cur.direction}`);
|
1525
|
-
return prev;
|
1526
|
-
}, []);
|
1527
|
-
// when dealing with a feature layer with many features shift-select can take a very long time.
|
1528
|
-
// don't allow the user to make additional interactions with the table if it takes more than 500 miliseconds
|
1529
|
-
let queryComplete = false;
|
1530
|
-
setTimeout(() => {
|
1531
|
-
if (!queryComplete) {
|
1532
|
-
this._queryingData = true;
|
1533
|
-
}
|
1534
|
-
}, 500);
|
1535
|
-
const oids = await queryAllOidsWithQueryFeatures(0, this._layer, [], orderBy);
|
1536
|
-
queryComplete = true;
|
1537
|
-
this._queryingData = false;
|
1538
|
-
let isBetween = false;
|
1539
|
-
const _start = this._table.viewModel.getObjectIdIndex(this._previousCurrentId);
|
1540
|
-
const _end = this._table.viewModel.getObjectIdIndex(this._currentId);
|
1541
|
-
const startIndex = _start < _end ? _start : _end;
|
1542
|
-
const endIndex = _end > _start ? _end : _start;
|
1543
|
-
this._skipOnChange = startIndex + 1 !== endIndex;
|
1544
|
-
const idsInRange = oids.reduce((prev, cur) => {
|
1545
|
-
const id = cur;
|
1546
|
-
if ((id === this._currentId || id === this._previousCurrentId)) {
|
1547
|
-
isBetween = !isBetween;
|
1548
|
-
if (prev.indexOf(id) < 0) {
|
1549
|
-
prev.push(id);
|
1550
|
-
}
|
1551
|
-
}
|
1552
|
-
else if (isBetween && prev.indexOf(id) < 0) {
|
1553
|
-
prev.push(id);
|
1554
|
-
}
|
1555
|
-
return prev;
|
1556
|
-
}, []);
|
1557
|
-
const selectedIds = _start < _end ? idsInRange.reverse() : idsInRange;
|
1558
|
-
this.selectedIds = [...new Set([...selectedIds, ...this.selectedIds])];
|
1559
|
-
this._tempSelectedIds = [...this.selectedIds];
|
1560
|
-
this._table.highlightIds.addMany(this.selectedIds.filter(i => ids.indexOf(i) < 0));
|
1561
|
-
}
|
1562
|
-
}
|
1563
|
-
this._finishOnChange();
|
1564
|
-
}
|
1565
|
-
else {
|
1566
|
-
this._skipOnChange = false;
|
1567
|
-
}
|
1568
|
-
this._currentId = [...this._getIds()].reverse()[0];
|
1520
|
+
this.selectedIds = ids.reverse();
|
1521
|
+
this._tempSelectedIds = [...this.selectedIds];
|
1522
|
+
this._finishOnChange();
|
1569
1523
|
this._selectionFromMap = false;
|
1570
1524
|
}
|
1571
1525
|
/**
|
@@ -1604,6 +1558,7 @@ export class LayerTable {
|
|
1604
1558
|
handleOnChange = !this._skipEditCheck;
|
1605
1559
|
this._skipEditCheck = false;
|
1606
1560
|
}
|
1561
|
+
this._shouldUpdateTableOnExtentChange = handleOnChange;
|
1607
1562
|
return handleOnChange;
|
1608
1563
|
}
|
1609
1564
|
/**
|
@@ -1620,7 +1575,7 @@ export class LayerTable {
|
|
1620
1575
|
_finishOnChange() {
|
1621
1576
|
if (this._showOnlySelected) {
|
1622
1577
|
if (this._featuresSelected()) {
|
1623
|
-
this._table.
|
1578
|
+
this._table.filterBySelectionEnabled = true;
|
1624
1579
|
}
|
1625
1580
|
else {
|
1626
1581
|
this._toggleShowSelected();
|
@@ -1658,7 +1613,7 @@ export class LayerTable {
|
|
1658
1613
|
async _resetTable() {
|
1659
1614
|
this._loaded = false;
|
1660
1615
|
this._clearSelection();
|
1661
|
-
this._allIds = await queryAllIds(
|
1616
|
+
this._allIds = await this.queryAllIds();
|
1662
1617
|
if (!this._table) {
|
1663
1618
|
const columnTemplates = this._getColumnTemplates(this._layer.id, this._layer?.fields);
|
1664
1619
|
await this._getTable(this._tableNode, columnTemplates);
|
@@ -1712,7 +1667,6 @@ export class LayerTable {
|
|
1712
1667
|
}
|
1713
1668
|
this._refreshHandle = this._layer.on("refresh", (evt) => {
|
1714
1669
|
if (evt.dataChanged) {
|
1715
|
-
this._skipOnChange = true;
|
1716
1670
|
void this._updateAllIds();
|
1717
1671
|
}
|
1718
1672
|
});
|
@@ -1721,7 +1675,7 @@ export class LayerTable {
|
|
1721
1675
|
* Reset _allIds when the layers data has changed and refresh the selection ids and table
|
1722
1676
|
*/
|
1723
1677
|
async _updateAllIds() {
|
1724
|
-
this._allIds = await queryAllIds(
|
1678
|
+
this._allIds = await this.queryAllIds();
|
1725
1679
|
this.selectedIds = this.selectedIds.filter(id => this._allIds.indexOf(id) > -1);
|
1726
1680
|
await this._refresh();
|
1727
1681
|
}
|
@@ -1861,20 +1815,6 @@ export class LayerTable {
|
|
1861
1815
|
}
|
1862
1816
|
}
|
1863
1817
|
}
|
1864
|
-
/**
|
1865
|
-
* Keep track of key down for ctrl and shift
|
1866
|
-
*/
|
1867
|
-
_handleKeyDown(e) {
|
1868
|
-
this._ctrlIsPressed = e.ctrlKey;
|
1869
|
-
this._shiftIsPressed = e.shiftKey;
|
1870
|
-
}
|
1871
|
-
/**
|
1872
|
-
* Keep track of key up for ctrl and shift
|
1873
|
-
*/
|
1874
|
-
_handleKeyUp(e) {
|
1875
|
-
this._ctrlIsPressed = e.ctrlKey;
|
1876
|
-
this._shiftIsPressed = e.shiftKey;
|
1877
|
-
}
|
1878
1818
|
/**
|
1879
1819
|
* Show filter component in modal
|
1880
1820
|
*
|
@@ -1910,6 +1850,40 @@ export class LayerTable {
|
|
1910
1850
|
this._updateShareUrl();
|
1911
1851
|
await this._searchFullText();
|
1912
1852
|
}
|
1853
|
+
/**
|
1854
|
+
* Update the table when extent is changed
|
1855
|
+
*/
|
1856
|
+
_handleTableOnMapExtent() {
|
1857
|
+
if (this._table) {
|
1858
|
+
this._filterByExtentHandle = this.reactiveUtils.when(() => this.mapView.stationary,
|
1859
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
1860
|
+
async () => {
|
1861
|
+
if (this._shouldUpdateTableOnExtentChange) {
|
1862
|
+
//Added timeout while updating table records to avoid the issue in which we see empty table records when extent is changed
|
1863
|
+
await new Promise(resolve => setTimeout(resolve, 800));
|
1864
|
+
this._table.filterGeometry = this.mapView.extent;
|
1865
|
+
const query = {
|
1866
|
+
geometry: this.mapView.extent
|
1867
|
+
};
|
1868
|
+
const objectIdsInExtent = await this._layer.queryObjectIds(query);
|
1869
|
+
// remove the highlight of features which are not in the map extent
|
1870
|
+
const outOids = this.selectedIds.filter(id => !objectIdsInExtent.includes(id));
|
1871
|
+
const restoreOids = this._outOFExtentOids.filter(id => objectIdsInExtent.includes(id));
|
1872
|
+
if (outOids.length > 0) {
|
1873
|
+
this._table.highlightIds.removeMany(outOids);
|
1874
|
+
this._outOFExtentOids = [...this._outOFExtentOids, ...outOids];
|
1875
|
+
}
|
1876
|
+
if (restoreOids.length > 0) {
|
1877
|
+
this._table.highlightIds.addMany(restoreOids);
|
1878
|
+
this._outOFExtentOids = this._outOFExtentOids.filter(oid => !restoreOids.includes(oid));
|
1879
|
+
}
|
1880
|
+
}
|
1881
|
+
this._allIds = await this.queryAllIds();
|
1882
|
+
}, {
|
1883
|
+
initial: true
|
1884
|
+
});
|
1885
|
+
}
|
1886
|
+
}
|
1913
1887
|
/**
|
1914
1888
|
* Close the filter modal
|
1915
1889
|
* @protected
|
@@ -1917,10 +1891,20 @@ export class LayerTable {
|
|
1917
1891
|
async _closeFilter() {
|
1918
1892
|
if (this._filterOpen) {
|
1919
1893
|
// reset allIds
|
1920
|
-
this._allIds = await queryAllIds(
|
1894
|
+
this._allIds = await this.queryAllIds();
|
1921
1895
|
this._filterOpen = false;
|
1922
1896
|
}
|
1923
1897
|
}
|
1898
|
+
/**
|
1899
|
+
* Query the layer for applied filter
|
1900
|
+
* @returns Promise with the featureSet from the layer that match the provided ids
|
1901
|
+
*/
|
1902
|
+
async queryAllIds() {
|
1903
|
+
const query = this._layer.createQuery();
|
1904
|
+
query.geometry = this._filterByExtentHandle ? this.mapView.extent : null;
|
1905
|
+
query.where = this._layer.definitionExpression || "1=1";
|
1906
|
+
return await this._layer.queryObjectIds(query);
|
1907
|
+
}
|
1924
1908
|
/**
|
1925
1909
|
* Handle map click events to keep table and map click selection in sync
|
1926
1910
|
*
|
@@ -1942,7 +1926,7 @@ export class LayerTable {
|
|
1942
1926
|
}
|
1943
1927
|
});
|
1944
1928
|
if (this._showOnlySelected) {
|
1945
|
-
this._table.
|
1929
|
+
this._table.filterBySelectionEnabled = true;
|
1946
1930
|
}
|
1947
1931
|
}
|
1948
1932
|
else {
|
@@ -1959,7 +1943,6 @@ export class LayerTable {
|
|
1959
1943
|
const editsDiscarded = await this._validateActiveEdits(addedIds, this.selectedIds);
|
1960
1944
|
if (editsDiscarded) {
|
1961
1945
|
this._table.highlightIds.removeAll();
|
1962
|
-
this._skipOnChange = true;
|
1963
1946
|
this._table.highlightIds.addMany(ids);
|
1964
1947
|
this.selectedIds = ids;
|
1965
1948
|
this._finishOnChange();
|
@@ -1976,12 +1959,7 @@ export class LayerTable {
|
|
1976
1959
|
*/
|
1977
1960
|
_toggleShowSelected() {
|
1978
1961
|
this._showOnlySelected = !this._showOnlySelected;
|
1979
|
-
|
1980
|
-
this._table.filterBySelection();
|
1981
|
-
}
|
1982
|
-
else {
|
1983
|
-
this._table.objectIds.removeAll();
|
1984
|
-
}
|
1962
|
+
this._table.filterBySelectionEnabled = this._showOnlySelected;
|
1985
1963
|
}
|
1986
1964
|
/**
|
1987
1965
|
* Clears the selected indexes
|
@@ -1989,6 +1967,7 @@ export class LayerTable {
|
|
1989
1967
|
*/
|
1990
1968
|
_clearSelection() {
|
1991
1969
|
this.selectedIds = [];
|
1970
|
+
this._outOFExtentOids = [];
|
1992
1971
|
this._table?.highlightIds.removeAll();
|
1993
1972
|
this._table?.rowHighlightIds.removeAll();
|
1994
1973
|
this._finishOnChange();
|
@@ -2028,7 +2007,6 @@ export class LayerTable {
|
|
2028
2007
|
const editsDiscarded = await this._validateActiveEdits(ids, currentIndexes);
|
2029
2008
|
if (editsDiscarded) {
|
2030
2009
|
this._table.highlightIds.removeAll();
|
2031
|
-
this._skipOnChange = true;
|
2032
2010
|
this._table.highlightIds.addMany(ids);
|
2033
2011
|
this.selectedIds = ids;
|
2034
2012
|
this._finishOnChange();
|
@@ -2086,8 +2064,8 @@ export class LayerTable {
|
|
2086
2064
|
async _refresh() {
|
2087
2065
|
const editsDiscarded = await this._validateActiveEdits([], this.selectedIds);
|
2088
2066
|
if (editsDiscarded) {
|
2089
|
-
await this._table
|
2090
|
-
this._allIds = await queryAllIds(
|
2067
|
+
await this._table?.refresh();
|
2068
|
+
this._allIds = await this.queryAllIds();
|
2091
2069
|
this.featureSelectionChange.emit(this.selectedIds);
|
2092
2070
|
}
|
2093
2071
|
}
|
@@ -2117,6 +2095,7 @@ export class LayerTable {
|
|
2117
2095
|
this._fetchingData = true;
|
2118
2096
|
const layer = await getLayerOrTable(this.mapView, id);
|
2119
2097
|
layer && await layer.when(() => {
|
2098
|
+
this._shouldUpdateTableOnExtentChange = true;
|
2120
2099
|
this._layer = layer;
|
2121
2100
|
this._getFullTextSearchInfo();
|
2122
2101
|
});
|
@@ -2796,9 +2775,13 @@ export class LayerTable {
|
|
2796
2775
|
},
|
2797
2776
|
"filterUpdate": {
|
2798
2777
|
"complexType": {
|
2799
|
-
"signature": "(
|
2778
|
+
"signature": "(filterActive: boolean, keepTableUpdatingOnMapExtentChange?: boolean) => Promise<void>",
|
2800
2779
|
"parameters": [{
|
2801
|
-
"name": "
|
2780
|
+
"name": "filterActive",
|
2781
|
+
"type": "boolean",
|
2782
|
+
"docs": ""
|
2783
|
+
}, {
|
2784
|
+
"name": "keepTableUpdatingOnMapExtentChange",
|
2802
2785
|
"type": "boolean",
|
2803
2786
|
"docs": ""
|
2804
2787
|
}],
|
@@ -2815,6 +2798,27 @@ export class LayerTable {
|
|
2815
2798
|
"tags": []
|
2816
2799
|
}
|
2817
2800
|
},
|
2801
|
+
"validateTableUpdate": {
|
2802
|
+
"complexType": {
|
2803
|
+
"signature": "(shouldUpdateTableOnExtentChange: boolean) => Promise<void>",
|
2804
|
+
"parameters": [{
|
2805
|
+
"name": "shouldUpdateTableOnExtentChange",
|
2806
|
+
"type": "boolean",
|
2807
|
+
"docs": ""
|
2808
|
+
}],
|
2809
|
+
"references": {
|
2810
|
+
"Promise": {
|
2811
|
+
"location": "global",
|
2812
|
+
"id": "global::Promise"
|
2813
|
+
}
|
2814
|
+
},
|
2815
|
+
"return": "Promise<void>"
|
2816
|
+
},
|
2817
|
+
"docs": {
|
2818
|
+
"text": "Validate if the table should update",
|
2819
|
+
"tags": []
|
2820
|
+
}
|
2821
|
+
},
|
2818
2822
|
"validateActiveEdits": {
|
2819
2823
|
"complexType": {
|
2820
2824
|
"signature": "() => Promise<boolean>",
|
@@ -2910,6 +2914,12 @@ export class LayerTable {
|
|
2910
2914
|
"target": "window",
|
2911
2915
|
"capture": false,
|
2912
2916
|
"passive": false
|
2917
|
+
}, {
|
2918
|
+
"name": "closeEdit",
|
2919
|
+
"method": "closeEdit",
|
2920
|
+
"target": "window",
|
2921
|
+
"capture": false,
|
2922
|
+
"passive": false
|
2913
2923
|
}, {
|
2914
2924
|
"name": "selectionChanged",
|
2915
2925
|
"method": "selectionChanged",
|
@@ -126,14 +126,17 @@ export class SolutionItemAccordion {
|
|
126
126
|
//
|
127
127
|
//--------------------------------------------------------------------------
|
128
128
|
/**
|
129
|
-
*
|
129
|
+
* Deselects all items in the accordion and closes the accordion item containing it.
|
130
130
|
* Only applies when selectionMode is "single" or "single-persist".
|
131
131
|
*/
|
132
132
|
async deselectAll() {
|
133
133
|
if (this.listSelectionMode === "single" || this.listSelectionMode === "single-persist") {
|
134
134
|
const items = this.el.shadowRoot.querySelectorAll("calcite-list-item");
|
135
135
|
items.forEach(item => {
|
136
|
-
item.selected
|
136
|
+
if (item.selected) {
|
137
|
+
item.selected = false;
|
138
|
+
item.parentElement.parentElement.expanded = false;
|
139
|
+
}
|
137
140
|
});
|
138
141
|
}
|
139
142
|
}
|
@@ -178,7 +181,7 @@ export class SolutionItemAccordion {
|
|
178
181
|
* Renders the component.
|
179
182
|
*/
|
180
183
|
render() {
|
181
|
-
return (h(Host, { key: '
|
184
|
+
return (h(Host, { key: '23845e68bd1920f17f27b1679df20915230f99c3' }, this._getAccordion()));
|
182
185
|
}
|
183
186
|
//--------------------------------------------------------------------------
|
184
187
|
//
|
@@ -522,12 +525,16 @@ export class SolutionItemAccordion {
|
|
522
525
|
"Promise": {
|
523
526
|
"location": "global",
|
524
527
|
"id": "global::Promise"
|
528
|
+
},
|
529
|
+
"HTMLCalciteAccordionItemElement": {
|
530
|
+
"location": "global",
|
531
|
+
"id": "global::HTMLCalciteAccordionItemElement"
|
525
532
|
}
|
526
533
|
},
|
527
534
|
"return": "Promise<void>"
|
528
535
|
},
|
529
536
|
"docs": {
|
530
|
-
"text": "
|
537
|
+
"text": "Deselects all items in the accordion and closes the accordion item containing it.\r\nOnly applies when selectionMode is \"single\" or \"single-persist\".",
|
531
538
|
"tags": []
|
532
539
|
}
|
533
540
|
},
|
@@ -191,7 +191,7 @@ const CardManager = /*@__PURE__*/ proxyCustomElement(class CardManager extends H
|
|
191
191
|
const heading = isTable ? this._translations.createRecord : this._translations.createFeature;
|
192
192
|
const guideMsg = this.customInfoText ? this.customInfoText : this.selectingFeatureFromMap ? this._translations.selectFeaturesFromMapToStart : this._translations.selectFeaturesToStart;
|
193
193
|
const showCreateFeatureOrRecordBtn = this.enableCreateFeatures && this.layer?.capabilities?.operations?.supportsAdd;
|
194
|
-
return (h(Host, { key: '5557aa4d80b859335e38db3f4255f4a61d00560f' }, h("div", { key: '6756e3314fc3444a982010a3cfa702d77f05f316', class: "overflow-auto height-full" }, h("calcite-shell", { key: '715eb7ed692a1d00347d44f20df370cf9a91ded5', class: "position-relative " + featuresClass }, h("div", { key: 'baf4e97c1884f477e4077a6dc8e59d98c77593a4', class: "position-static z-index-500" }, h("info-card", { key: '
|
194
|
+
return (h(Host, { key: '5557aa4d80b859335e38db3f4255f4a61d00560f' }, h("div", { key: '6756e3314fc3444a982010a3cfa702d77f05f316', class: "overflow-auto height-full" }, h("calcite-shell", { key: '715eb7ed692a1d00347d44f20df370cf9a91ded5', class: "position-relative " + featuresClass }, h("div", { key: 'baf4e97c1884f477e4077a6dc8e59d98c77593a4', class: "position-static z-index-500" }, h("info-card", { key: '0b9b30182fbc3482e9edf49b79f68aec8cf86adc', enableEditGeometry: this.enableEditGeometry, graphics: this._graphics, isLoading: this._cardLoading, isMobile: this.isMobile, locale: this.locale, mapView: this.mapView, showCloseBtn: true }))), h("calcite-shell", { key: '94b646061956a78dec4f96d9d1d9dedc5ad6aee7', class: "position-relative " + messageClass }, h("calcite-panel", { key: '00b660d474234f8156f3d4c627626f5891754051' }, h("div", { key: 'adb0732ff59c4fdedb19367a32ad9e3e060ddb60', class: "padding-1" }, h("calcite-notice", { key: 'a2c88bd4a0827111b0d1f3056ae571b47e5b380b', icon: this.selectingFeatureFromMap ? "map" : "table", iconFlipRtl: true, open: true }, h("div", { key: 'bffc2630de3f0376b6ea5827c89f65dc605a5356', slot: "message" }, guideMsg))), !this.isMobile && showCreateFeatureOrRecordBtn && h("calcite-button", { key: '08bef5c20d6b60e17abcfc9fc19d7d1eb5d04b1c', disabled: !this.layer, onClick: () => this._createFeatureBtnClicked(), slot: "footer", width: "full" }, isTable ? this._translations.createRecord : this._translations.createFeature))), h("calcite-shell", { key: '833a8de60b491008006034c1696fcb29f1bb6a08', class: "position-relative " + createFeatureClass }, h("calcite-flow-item", { key: 'dd2ae4509e4bec5a90f33484f8a28f422c0eeee4' }, h("calcite-panel", { key: '8fa68650f1933a88cdaf1fee8391cf433b7b54e9', heading: heading }, h("calcite-action", { key: '2b205887ff8703e01ef356cae09ce5d15dbec7c6', class: "back-button hydrated", icon: "chevron-left", onClick: this._backFromCreateFeature.bind(this), scale: "s", slot: "header-actions-start", text: "" }), this.getEditorComponent(), this._showSubmitBtn && h("calcite-button", { key: '0977a3974583266f6d90e18c8fbbc3e18f803983', appearance: "solid", class: "footer-top-button footer-button", onClick: () => void this._createFeature.submit(), slot: "footer", width: "full" }, this._translations.create)))))));
|
195
195
|
}
|
196
196
|
/**
|
197
197
|
* Returns the editor component for adding feature
|