@esri/solutions-components 0.7.8 → 0.7.10
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/assets/t9n/layer-table/resources.json +1 -0
- package/dist/assets/t9n/layer-table/resources_en.json +1 -0
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +1 -1
- package/dist/cjs/calcite-alert_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +16 -7
- package/dist/cjs/card-manager_3.cjs.entry.js +176 -22
- package/dist/cjs/crowdsource-manager.cjs.entry.js +12 -1
- package/dist/cjs/{downloadUtils-95e4a5b2.js → downloadUtils-8f50633d.js} +2 -2
- package/dist/cjs/{index.es-a88403f8.js → index.es-140aa937.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-b7d9e71c.js → mapViewUtils-569e9644.js} +17 -0
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +20 -2
- package/dist/collection/components/layer-table/layer-table.js +175 -21
- package/dist/collection/components/map-layer-picker/map-layer-picker.css +1 -0
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +69 -5
- package/dist/collection/components/map-picker/map-picker.js +1 -1
- package/dist/collection/demos/crowdsource-manager.html +2 -2
- package/dist/collection/utils/interfaces.ts +5 -0
- package/dist/collection/utils/queryUtils.js +16 -0
- package/dist/collection/utils/queryUtils.ts +21 -0
- package/dist/components/crowdsource-manager.js +15 -3
- package/dist/components/layer-table2.js +175 -21
- package/dist/components/map-layer-picker2.js +17 -6
- package/dist/components/map-picker2.js +1 -1
- package/dist/components/map-select-tools2.js +1 -1
- package/dist/components/queryUtils.js +17 -1
- package/dist/components/refine-selection2.js +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +1 -1
- package/dist/esm/calcite-alert_3.entry.js +1 -1
- package/dist/esm/calcite-combobox_6.entry.js +16 -7
- package/dist/esm/card-manager_3.entry.js +176 -22
- package/dist/esm/crowdsource-manager.entry.js +12 -1
- package/dist/esm/{downloadUtils-83dd2143.js → downloadUtils-9dee8bc0.js} +2 -2
- package/dist/esm/{index.es-0c98e2f3.js → index.es-54e86c8e.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-3ff1c264.js → mapViewUtils-066602d5.js} +17 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/crowdsource-manager.html +2 -2
- package/dist/solutions-components/{p-546a3d3c.entry.js → p-13bfc206.entry.js} +2 -2
- package/dist/solutions-components/{p-d6050d57.js → p-1bdd64a0.js} +2 -2
- package/dist/solutions-components/{p-b7e2c75b.js → p-531d91d6.js} +1 -1
- package/dist/solutions-components/{p-dcd6e7b9.entry.js → p-6656c53e.entry.js} +1 -1
- package/dist/solutions-components/{p-a5d924a9.entry.js → p-683cded6.entry.js} +1 -1
- package/dist/solutions-components/{p-95ebc2e5.entry.js → p-c2b20b85.entry.js} +1 -1
- package/dist/solutions-components/p-c7ff24df.entry.js +6 -0
- package/dist/solutions-components/{p-b030a151.js → p-dfdb8411.js} +1 -1
- package/dist/solutions-components/p-f7870ec1.entry.js +6 -0
- package/dist/solutions-components/p-ffae568b.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +5 -0
- package/dist/solutions-components/utils/queryUtils.ts +21 -0
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +8 -0
- package/dist/types/components/layer-table/layer-table.d.ts +54 -1
- package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +15 -1
- package/dist/types/components.d.ts +23 -2
- package/dist/types/preact.d.ts +2 -1
- package/dist/types/utils/interfaces.d.ts +4 -0
- package/dist/types/utils/queryUtils.d.ts +11 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-1b9709ce.entry.js +0 -6
- package/dist/solutions-components/p-4f1c4004.entry.js +0 -6
- package/dist/solutions-components/p-c556ed60.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, g as getLayerOrTable } from './mapViewUtils.js';
|
|
10
|
-
import { b as
|
|
10
|
+
import { b as queryFeatureIds, c as queryAllIds, d as queryFeaturesByGlobalID } from './queryUtils.js';
|
|
11
11
|
import { d as downloadCSV } from './downloadUtils.js';
|
|
12
12
|
import { d as defineCustomElement$C } from './action.js';
|
|
13
13
|
import { d as defineCustomElement$B } from './action-bar.js';
|
|
@@ -59,6 +59,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
59
59
|
* number[]: A list of all IDs for the current layer
|
|
60
60
|
*/
|
|
61
61
|
this._allIds = [];
|
|
62
|
+
/**
|
|
63
|
+
* boolean: When true the ctrl key is currently pressed
|
|
64
|
+
*/
|
|
65
|
+
this._ctrlIsPressed = false;
|
|
62
66
|
/**
|
|
63
67
|
* boolean: When true the default global id provided via url param has been honored and should now be ignored
|
|
64
68
|
*/
|
|
@@ -67,6 +71,14 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
67
71
|
* boolean: When true the default OID provided via url param has been honored and should now be ignored
|
|
68
72
|
*/
|
|
69
73
|
this._defaultOidHonored = false;
|
|
74
|
+
/**
|
|
75
|
+
* boolean: When true the shift key is currently pressed
|
|
76
|
+
*/
|
|
77
|
+
this._shiftIsPressed = false;
|
|
78
|
+
/**
|
|
79
|
+
* boolean: When true any onChange handeling will be skipped
|
|
80
|
+
*/
|
|
81
|
+
this._skipOnChange = false;
|
|
70
82
|
/**
|
|
71
83
|
* bool: When true the table is being sorted
|
|
72
84
|
*/
|
|
@@ -271,6 +283,8 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
271
283
|
async componentDidLoad() {
|
|
272
284
|
this._resizeObserver.observe(this._toolbar);
|
|
273
285
|
document.onclick = (e) => this._handleDocumentClick(e);
|
|
286
|
+
document.onkeydown = (e) => this._handleKeyDown(e);
|
|
287
|
+
document.onkeyup = (e) => this._handleKeyUp(e);
|
|
274
288
|
}
|
|
275
289
|
/**
|
|
276
290
|
* Called after the component is rendered
|
|
@@ -325,7 +339,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
325
339
|
* @returns The dom node that contains the controls
|
|
326
340
|
*/
|
|
327
341
|
_getActionBar() {
|
|
328
|
-
return (h("calcite-action-bar", { expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, h("div", { class: "border-end", id: "solutions-map-layer-picker-container" }, h("map-layer-picker", { appearance: "transparent", defaultLayerId: this.defaultLayerId, mapView: this.mapView, onLayerSelectionChange: (evt) => this._layerSelectionChanged(evt), onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, placeholderIcon: "layers", scale: "l", showSingleLayerAsLabel: true, showTables: true, type: "dropdown" })), this._getActions()));
|
|
342
|
+
return (h("calcite-action-bar", { expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, h("div", { class: "border-end", id: "solutions-map-layer-picker-container" }, h("map-layer-picker", { appearance: "transparent", defaultLayerId: this.defaultLayerId, display: "inline-flex", height: 50, mapView: this.mapView, onLayerSelectionChange: (evt) => this._layerSelectionChanged(evt), onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, placeholderIcon: "layers", scale: "l", showSingleLayerAsLabel: true, showTables: true, type: "dropdown" })), this._getActions()));
|
|
329
343
|
}
|
|
330
344
|
/**
|
|
331
345
|
* Get the actions that are used for various interactions with the table
|
|
@@ -750,18 +764,8 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
750
764
|
this._initColumnsInfo();
|
|
751
765
|
this._checkEditEnabled();
|
|
752
766
|
await this._table.when(() => {
|
|
753
|
-
this._table.highlightIds.on("change", () => {
|
|
754
|
-
|
|
755
|
-
this._selectedIndexes = this._table.highlightIds.toArray().reverse();
|
|
756
|
-
if (this._showOnlySelected) {
|
|
757
|
-
if (this._featuresSelected()) {
|
|
758
|
-
this._table.filterBySelection();
|
|
759
|
-
}
|
|
760
|
-
else {
|
|
761
|
-
this._toggleShowSelected();
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
this.featureSelectionChange.emit(this._selectedIndexes);
|
|
767
|
+
this._table.highlightIds.on("change", (evt) => {
|
|
768
|
+
void this._handleOnChange(evt);
|
|
765
769
|
});
|
|
766
770
|
this.reactiveUtils.watch(() => this._table.activeSortOrders, (sortOrders) => {
|
|
767
771
|
var _a, _b, _c, _d;
|
|
@@ -771,6 +775,93 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
771
775
|
});
|
|
772
776
|
}
|
|
773
777
|
}
|
|
778
|
+
async _handleOnChange(evt) {
|
|
779
|
+
const ids = [...this._table.highlightIds.toArray()];
|
|
780
|
+
if (!this._skipOnChange) {
|
|
781
|
+
if (!this._ctrlIsPressed && !this._shiftIsPressed) {
|
|
782
|
+
if (this._selectedIndexes.length > 0) {
|
|
783
|
+
this._skipOnChange = true;
|
|
784
|
+
// only readd in specific case where we have multiple selected and then click one of the currently selected
|
|
785
|
+
const reAdd = this._selectedIndexes.length > 1 && evt.removed.length === 1;
|
|
786
|
+
const newIndexes = reAdd ? evt.removed : ids.filter(id => this._selectedIndexes.indexOf(id) < 0);
|
|
787
|
+
this._clearSelection();
|
|
788
|
+
this._selectedIndexes = [...newIndexes];
|
|
789
|
+
if (newIndexes.length > 0) {
|
|
790
|
+
this._table.highlightIds.add(newIndexes[0]);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
else {
|
|
794
|
+
// https://github.com/Esri/solutions-components/issues/365
|
|
795
|
+
this._selectedIndexes = ids.reverse();
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
else if (this._ctrlIsPressed) {
|
|
799
|
+
this._selectedIndexes = ids.reverse();
|
|
800
|
+
}
|
|
801
|
+
else if (this._shiftIsPressed) {
|
|
802
|
+
this._skipOnChange = true;
|
|
803
|
+
this._previousCurrentId = this._currentId;
|
|
804
|
+
this._currentId = [...this._table.highlightIds.toArray()].reverse()[0];
|
|
805
|
+
if (this._previousCurrentId !== this._currentId) {
|
|
806
|
+
// query the layer based on current sort and filters then grab between the current id and previous id
|
|
807
|
+
const orderBy = this._table.activeSortOrders.reduce((prev, cur) => {
|
|
808
|
+
prev.push(`${cur.fieldName} ${cur.direction}`);
|
|
809
|
+
return prev;
|
|
810
|
+
}, []);
|
|
811
|
+
const oids = await queryFeatureIds(this._layer, this._layer.definitionExpression, orderBy);
|
|
812
|
+
let isBetween = false;
|
|
813
|
+
const _start = this._table.viewModel.getObjectIdIndex(this._previousCurrentId);
|
|
814
|
+
const _end = this._table.viewModel.getObjectIdIndex(this._currentId);
|
|
815
|
+
const startIndex = _start < _end ? _start : _end;
|
|
816
|
+
const endIndex = _end > _start ? _end : _start;
|
|
817
|
+
this._selectedIndexes = oids.reduce((prev, cur) => {
|
|
818
|
+
const id = cur;
|
|
819
|
+
const index = this._table.viewModel.getObjectIdIndex(id);
|
|
820
|
+
if ((id === this._currentId || id === this._previousCurrentId)) {
|
|
821
|
+
isBetween = !isBetween;
|
|
822
|
+
if (prev.indexOf(id) < 0) {
|
|
823
|
+
prev.push(id);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
// The oids are sorted so after we have reached the start or end oid add all ids even if the index is -1.
|
|
827
|
+
// Index of -1 will occur for features between the start and and oid if
|
|
828
|
+
// you select a row then scroll faster than the FeatureTable loads the data to select the next id
|
|
829
|
+
if (isBetween && prev.indexOf(id) < 0) {
|
|
830
|
+
prev.push(id);
|
|
831
|
+
}
|
|
832
|
+
// Also add index based check.
|
|
833
|
+
// In some cases the FeatureTable and Layer query will have differences in how null/undefined field values are sorted
|
|
834
|
+
if ((this._selectedIndexes.indexOf(id) > -1 || (index >= startIndex && index <= endIndex)) && prev.indexOf(id) < 0 && index > -1) {
|
|
835
|
+
prev.push(id);
|
|
836
|
+
}
|
|
837
|
+
return prev;
|
|
838
|
+
}, []);
|
|
839
|
+
this._table.highlightIds.addMany(this._selectedIndexes.filter(i => ids.indexOf(i) < 0));
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
this._finishOnChange();
|
|
843
|
+
}
|
|
844
|
+
else {
|
|
845
|
+
this._skipOnChange = false;
|
|
846
|
+
}
|
|
847
|
+
this._currentId = [...this._table.highlightIds.toArray()].reverse()[0];
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Handle any updates after a selection change has occured and emit the results
|
|
851
|
+
*
|
|
852
|
+
* @returns void
|
|
853
|
+
*/
|
|
854
|
+
_finishOnChange() {
|
|
855
|
+
if (this._showOnlySelected) {
|
|
856
|
+
if (this._featuresSelected()) {
|
|
857
|
+
this._table.filterBySelection();
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
this._toggleShowSelected();
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
this.featureSelectionChange.emit(this._selectedIndexes);
|
|
864
|
+
}
|
|
774
865
|
/**
|
|
775
866
|
* Reset basic table props
|
|
776
867
|
*
|
|
@@ -906,6 +997,24 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
906
997
|
}
|
|
907
998
|
}
|
|
908
999
|
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Keep track of key down for ctrl and shift
|
|
1002
|
+
*
|
|
1003
|
+
* @returns void
|
|
1004
|
+
*/
|
|
1005
|
+
_handleKeyDown(e) {
|
|
1006
|
+
this._ctrlIsPressed = e.ctrlKey;
|
|
1007
|
+
this._shiftIsPressed = e.shiftKey;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Keep track of key up for ctrl and shift
|
|
1011
|
+
*
|
|
1012
|
+
* @returns void
|
|
1013
|
+
*/
|
|
1014
|
+
_handleKeyUp(e) {
|
|
1015
|
+
this._ctrlIsPressed = e.ctrlKey;
|
|
1016
|
+
this._shiftIsPressed = e.shiftKey;
|
|
1017
|
+
}
|
|
909
1018
|
/**
|
|
910
1019
|
* Show filter component in modal
|
|
911
1020
|
*
|
|
@@ -913,15 +1022,19 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
913
1022
|
*/
|
|
914
1023
|
_filterModal() {
|
|
915
1024
|
var _a, _b, _c;
|
|
916
|
-
return (h("calcite-modal", { "aria-labelledby": "modal-title", kind: "brand", onCalciteModalClose: () => this._closeFilter(), open: this._filterOpen, widthScale: "s" }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, (_b = (_a = this._translations) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.replace("{{title}}", (_c = this._layer) === null || _c === void 0 ? void 0 : _c.title)), h("div", { slot: "content" }, h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtn: true, closeBtnOnClick: () => this._closeFilter(), layerExpressions: this._layerExpressions, ref: (el) => this._filterList = el, view: this.mapView }))));
|
|
1025
|
+
return (h("calcite-modal", { "aria-labelledby": "modal-title", kind: "brand", onCalciteModalClose: async () => this._closeFilter(), open: this._filterOpen, widthScale: "s" }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, (_b = (_a = this._translations) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.replace("{{title}}", (_c = this._layer) === null || _c === void 0 ? void 0 : _c.title)), h("div", { slot: "content" }, h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtn: true, closeBtnOnClick: async () => this._closeFilter(), layerExpressions: this._layerExpressions, ref: (el) => this._filterList = el, view: this.mapView }))));
|
|
917
1026
|
}
|
|
918
1027
|
/**
|
|
919
1028
|
* Close the filter modal
|
|
920
1029
|
*
|
|
921
1030
|
* @returns void
|
|
922
1031
|
*/
|
|
923
|
-
_closeFilter() {
|
|
924
|
-
this._filterOpen
|
|
1032
|
+
async _closeFilter() {
|
|
1033
|
+
if (this._filterOpen) {
|
|
1034
|
+
// reset allIds
|
|
1035
|
+
this._allIds = await queryAllIds(this._layer);
|
|
1036
|
+
this._filterOpen = false;
|
|
1037
|
+
}
|
|
925
1038
|
}
|
|
926
1039
|
/**
|
|
927
1040
|
* Show delete confirmation message
|
|
@@ -994,8 +1107,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
994
1107
|
_selectAll() {
|
|
995
1108
|
const ids = this._allIds;
|
|
996
1109
|
this._table.highlightIds.removeAll();
|
|
1110
|
+
this._skipOnChange = true;
|
|
997
1111
|
this._table.highlightIds.addMany(ids);
|
|
998
1112
|
this._selectedIndexes = ids;
|
|
1113
|
+
this._finishOnChange();
|
|
999
1114
|
}
|
|
1000
1115
|
/**
|
|
1001
1116
|
* Toggle the show only selected flag
|
|
@@ -1037,9 +1152,9 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
1037
1152
|
* @returns void
|
|
1038
1153
|
*/
|
|
1039
1154
|
_initLayerExpressions() {
|
|
1040
|
-
var _a;
|
|
1041
|
-
const layerExpressions = (_a = this.mapInfo
|
|
1042
|
-
this._layerExpressions = layerExpressions.filter((exp) => exp.id === this._layer.id);
|
|
1155
|
+
var _a, _b;
|
|
1156
|
+
const layerExpressions = (_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.layerExpressions;
|
|
1157
|
+
this._layerExpressions = layerExpressions ? layerExpressions.filter((exp) => exp.id === this._layer.id) : [];
|
|
1043
1158
|
}
|
|
1044
1159
|
/**
|
|
1045
1160
|
* Select all rows that are not currently selectd
|
|
@@ -1055,8 +1170,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
1055
1170
|
}
|
|
1056
1171
|
return prev;
|
|
1057
1172
|
}, []).sort((a, b) => a - b);
|
|
1173
|
+
this._skipOnChange = true;
|
|
1058
1174
|
this._table.highlightIds.addMany(ids);
|
|
1059
1175
|
this._selectedIndexes = ids;
|
|
1176
|
+
this._finishOnChange();
|
|
1060
1177
|
}
|
|
1061
1178
|
/**
|
|
1062
1179
|
* Export all selected rows as CSV
|
|
@@ -1142,6 +1259,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
1142
1259
|
fieldInfos.some(fieldInfo => {
|
|
1143
1260
|
if (fieldInfo.name === columnTemplate.fieldName) {
|
|
1144
1261
|
columnTemplate.label = fieldInfo.alias;
|
|
1262
|
+
columnTemplate.menuConfig = this._getMenuConfig(fieldInfo.name);
|
|
1145
1263
|
return true;
|
|
1146
1264
|
}
|
|
1147
1265
|
});
|
|
@@ -1150,12 +1268,48 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
|
1150
1268
|
return {
|
|
1151
1269
|
type: "field",
|
|
1152
1270
|
fieldName: fieldInfo.name,
|
|
1153
|
-
label: fieldInfo.alias
|
|
1271
|
+
label: fieldInfo.alias,
|
|
1272
|
+
menuConfig: this._getMenuConfig(fieldInfo.name)
|
|
1154
1273
|
};
|
|
1155
1274
|
});
|
|
1156
1275
|
}
|
|
1157
1276
|
return columnTemplates;
|
|
1158
1277
|
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Get the menu config that adds the ability to hide the current column
|
|
1280
|
+
*
|
|
1281
|
+
* @returns void
|
|
1282
|
+
* @protected
|
|
1283
|
+
*/
|
|
1284
|
+
_getMenuConfig(name) {
|
|
1285
|
+
return {
|
|
1286
|
+
items: [
|
|
1287
|
+
{
|
|
1288
|
+
label: this._translations.hideField,
|
|
1289
|
+
iconClass: "esri-icon-non-visible",
|
|
1290
|
+
autoCloseMenu: true,
|
|
1291
|
+
clickFunction: () => {
|
|
1292
|
+
this._handleHideClick(name);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
]
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Hide the table column for the provided name
|
|
1300
|
+
*
|
|
1301
|
+
* @returns void
|
|
1302
|
+
* @protected
|
|
1303
|
+
*/
|
|
1304
|
+
_handleHideClick(name) {
|
|
1305
|
+
this._columnsInfo[name] = false;
|
|
1306
|
+
this._table.hideColumn(name);
|
|
1307
|
+
this._table.tableTemplate.columnTemplates.forEach((columnTemplate) => {
|
|
1308
|
+
if (columnTemplate.fieldName === name) {
|
|
1309
|
+
columnTemplate.visible = false;
|
|
1310
|
+
}
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1159
1313
|
/**
|
|
1160
1314
|
* Fetches the component's translations
|
|
1161
1315
|
*
|
|
@@ -23,12 +23,13 @@ import { d as defineCustomElement$3 } from './option.js';
|
|
|
23
23
|
import { d as defineCustomElement$2 } from './select.js';
|
|
24
24
|
import { d as defineCustomElement$1 } from './tooltip.js';
|
|
25
25
|
|
|
26
|
-
const mapLayerPickerCss = ":host{display:block}.map-layer-picker-container{width:100
|
|
26
|
+
const mapLayerPickerCss = ":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";
|
|
27
27
|
|
|
28
28
|
const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class MapLayerPicker extends HTMLElement {
|
|
29
29
|
constructor() {
|
|
30
30
|
super();
|
|
31
31
|
this.__registerHost();
|
|
32
|
+
this.idsFound = createEvent(this, "idsFound", 7);
|
|
32
33
|
this.noLayersFound = createEvent(this, "noLayersFound", 7);
|
|
33
34
|
this.layerSelectionChange = createEvent(this, "layerSelectionChange", 7);
|
|
34
35
|
//--------------------------------------------------------------------------
|
|
@@ -42,8 +43,10 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class MapLayerPicker ext
|
|
|
42
43
|
this.defaultLayerHonored = false;
|
|
43
44
|
this.appearance = "transparent";
|
|
44
45
|
this.defaultLayerId = "";
|
|
46
|
+
this.display = "inline-block";
|
|
45
47
|
this.enabledLayerIds = [];
|
|
46
48
|
this.enabledTableIds = [];
|
|
49
|
+
this.height = undefined;
|
|
47
50
|
this.mapView = undefined;
|
|
48
51
|
this.onlyShowUpdatableLayers = undefined;
|
|
49
52
|
this.placeholderIcon = "";
|
|
@@ -98,7 +101,9 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class MapLayerPicker ext
|
|
|
98
101
|
*/
|
|
99
102
|
render() {
|
|
100
103
|
const id = "map-layer-picker";
|
|
101
|
-
|
|
104
|
+
let style = this.height > 0 ? { "height": `${this.height.toString()}px` } : {};
|
|
105
|
+
style = Object.assign(Object.assign({}, style), { "display": this.display });
|
|
106
|
+
return (h(Host, null, h("div", { class: "map-layer-picker-container", style: style }, h("div", { class: "map-layer-picker", style: style }, !this._hasValidLayers ? this._getInvalidPlaceholder() :
|
|
102
107
|
!this._hasMultipleLayers && this.showSingleLayerAsLabel ? this._getSingleLayerPlaceholder() :
|
|
103
108
|
this.type === "combobox" ? this._getCombobox(id) :
|
|
104
109
|
this.type === "select" ? this._getSelect(id) : this._getDropdown(id), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": id }, h("span", null, this._translations.switchLayer))))));
|
|
@@ -235,14 +240,18 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class MapLayerPicker ext
|
|
|
235
240
|
async _setLayers() {
|
|
236
241
|
if (this.mapView) {
|
|
237
242
|
await this._initLayerTableHash();
|
|
238
|
-
const
|
|
243
|
+
const layerIds = this.onlyShowUpdatableLayers ?
|
|
239
244
|
this._getEditableIds(this._layerNameHash) : Object.keys(this._layerNameHash);
|
|
240
|
-
const
|
|
245
|
+
const tableIds = this.showTables ? this.onlyShowUpdatableLayers ?
|
|
241
246
|
this._getEditableIds(this._tableNameHash) : Object.keys(this._tableNameHash) : [];
|
|
242
247
|
this.ids = [
|
|
243
|
-
...
|
|
244
|
-
...
|
|
248
|
+
...layerIds.reverse().filter(n => { var _a; return ((_a = this.enabledLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledLayerIds.reverse().indexOf(n) > -1 : true; }),
|
|
249
|
+
...tableIds.reverse().filter(n => { var _a; return ((_a = this.enabledTableIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledTableIds.reverse().indexOf(n) > -1 : true; }),
|
|
245
250
|
];
|
|
251
|
+
this.idsFound.emit({
|
|
252
|
+
layerIds,
|
|
253
|
+
tableIds
|
|
254
|
+
});
|
|
246
255
|
}
|
|
247
256
|
}
|
|
248
257
|
/**
|
|
@@ -320,8 +329,10 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class MapLayerPicker ext
|
|
|
320
329
|
}, [0, "map-layer-picker", {
|
|
321
330
|
"appearance": [1],
|
|
322
331
|
"defaultLayerId": [1, "default-layer-id"],
|
|
332
|
+
"display": [1],
|
|
323
333
|
"enabledLayerIds": [16],
|
|
324
334
|
"enabledTableIds": [16],
|
|
335
|
+
"height": [2],
|
|
325
336
|
"mapView": [16],
|
|
326
337
|
"onlyShowUpdatableLayers": [4, "only-show-updatable-layers"],
|
|
327
338
|
"placeholderIcon": [1, "placeholder-icon"],
|
|
@@ -141,7 +141,7 @@ const MapPicker = /*@__PURE__*/ proxyCustomElement(class MapPicker extends HTMLE
|
|
|
141
141
|
* @protected
|
|
142
142
|
*/
|
|
143
143
|
_getMapNameList(show) {
|
|
144
|
-
const listClass = show ? "map-list" : "display-none";
|
|
144
|
+
const listClass = show ? "map-list border-bottom-1" : "display-none";
|
|
145
145
|
return (h("div", { class: listClass }, h("calcite-list", { id: "mapList", ref: (el) => this._list = el, selectionAppearance: "border", selectionMode: "single" }, this.mapInfos.map(mapInfo => {
|
|
146
146
|
return (h("calcite-list-item", { label: mapInfo.name, onClick: () => this._webMapSelected(mapInfo), selected: mapInfo.id === this._loadedId, value: mapInfo.id }));
|
|
147
147
|
}))));
|
|
@@ -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, e as getFeatureLayerView } from './mapViewUtils.js';
|
|
9
|
-
import {
|
|
9
|
+
import { e as queryObjectIds, g as getQueryGeoms, f 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';
|
|
@@ -122,6 +122,22 @@ async function queryFeaturesByGeometry(start, layer, geometry, featuresCollectio
|
|
|
122
122
|
queryFeaturesByGeometry(start += num, layer, geometry, featuresCollection) :
|
|
123
123
|
Promise.resolve(featuresCollection);
|
|
124
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Query the layer for feature ids that match the provided where clause.
|
|
127
|
+
* If no where clause is provided all features will be returned.
|
|
128
|
+
*
|
|
129
|
+
* @param layer the layer to retrieve features from
|
|
130
|
+
* @param where the where clause for the query
|
|
131
|
+
* @param orderBy any sort order to apply to the query
|
|
132
|
+
*
|
|
133
|
+
* @returns Promise with the ids from the layer that match the where and are sorted as defined by orderBy
|
|
134
|
+
*/
|
|
135
|
+
async function queryFeatureIds(layer, where, orderBy) {
|
|
136
|
+
const query = layer.createQuery();
|
|
137
|
+
query.where = where ? where : "1=1";
|
|
138
|
+
query.orderByFields = orderBy;
|
|
139
|
+
return await layer.queryObjectIds(query);
|
|
140
|
+
}
|
|
125
141
|
/**
|
|
126
142
|
* Query the layer for the extent of features with the provided OIDs
|
|
127
143
|
*
|
|
@@ -179,4 +195,4 @@ async function _intersectQuery(geometry, layer) {
|
|
|
179
195
|
return layer.queryObjectIds(q);
|
|
180
196
|
}
|
|
181
197
|
|
|
182
|
-
export { queryExtent as a,
|
|
198
|
+
export { queryExtent as a, queryFeatureIds as b, queryAllIds as c, queryFeaturesByGlobalID as d, queryObjectIds as e, queryFeaturesByGeometry as f, 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 { e as getFeatureLayerView, f as getIdSets, i as highlightAllFeatures } from './mapViewUtils.js';
|
|
9
|
-
import {
|
|
9
|
+
import { f 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$s } from './action.js';
|
|
@@ -521,7 +521,7 @@ const MapPicker = class {
|
|
|
521
521
|
* @protected
|
|
522
522
|
*/
|
|
523
523
|
_getMapNameList(show) {
|
|
524
|
-
const listClass = show ? "map-list" : "display-none";
|
|
524
|
+
const listClass = show ? "map-list border-bottom-1" : "display-none";
|
|
525
525
|
return (h("div", { class: listClass }, h("calcite-list", { id: "mapList", ref: (el) => this._list = el, selectionAppearance: "border", selectionMode: "single" }, this.mapInfos.map(mapInfo => {
|
|
526
526
|
return (h("calcite-list-item", { label: mapInfo.name, onClick: () => this._webMapSelected(mapInfo), selected: mapInfo.id === this._loadedId, value: mapInfo.id }));
|
|
527
527
|
}))));
|
|
@@ -13,7 +13,7 @@ import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as
|
|
|
13
13
|
import { K as KindIcons } from './resources-6e00e0d1.js';
|
|
14
14
|
import { l as loadModules } from './loadModules-cea493da.js';
|
|
15
15
|
import { g as getLocaleComponentStrings } from './locale-834c52c6.js';
|
|
16
|
-
import {
|
|
16
|
+
import { m as getAllLayers } from './mapViewUtils-066602d5.js';
|
|
17
17
|
import './guid-36c6c6a5.js';
|
|
18
18
|
import './resources-cdc36705.js';
|
|
19
19
|
import './key-af303047.js';
|
|
@@ -22,7 +22,7 @@ import { d as debounce } from './debounce-229b1a22.js';
|
|
|
22
22
|
import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-1149b5cb.js';
|
|
23
23
|
import { i as isActivationKey } from './key-af303047.js';
|
|
24
24
|
import { g as getLocaleComponentStrings } from './locale-834c52c6.js';
|
|
25
|
-
import {
|
|
25
|
+
import { n as getMapLayerHash, o as getMapTableHash } from './mapViewUtils-066602d5.js';
|
|
26
26
|
import { s as state } from './publicNotificationStore-9362d7ae.js';
|
|
27
27
|
import './resources-cdc36705.js';
|
|
28
28
|
import './browser-b4c16201.js';
|
|
@@ -1895,11 +1895,12 @@ const DropdownItem = class {
|
|
|
1895
1895
|
};
|
|
1896
1896
|
DropdownItem.style = dropdownItemCss;
|
|
1897
1897
|
|
|
1898
|
-
const mapLayerPickerCss = ":host{display:block}.map-layer-picker-container{width:100
|
|
1898
|
+
const mapLayerPickerCss = ":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";
|
|
1899
1899
|
|
|
1900
1900
|
const MapLayerPicker = class {
|
|
1901
1901
|
constructor(hostRef) {
|
|
1902
1902
|
registerInstance(this, hostRef);
|
|
1903
|
+
this.idsFound = createEvent(this, "idsFound", 7);
|
|
1903
1904
|
this.noLayersFound = createEvent(this, "noLayersFound", 7);
|
|
1904
1905
|
this.layerSelectionChange = createEvent(this, "layerSelectionChange", 7);
|
|
1905
1906
|
//--------------------------------------------------------------------------
|
|
@@ -1913,8 +1914,10 @@ const MapLayerPicker = class {
|
|
|
1913
1914
|
this.defaultLayerHonored = false;
|
|
1914
1915
|
this.appearance = "transparent";
|
|
1915
1916
|
this.defaultLayerId = "";
|
|
1917
|
+
this.display = "inline-block";
|
|
1916
1918
|
this.enabledLayerIds = [];
|
|
1917
1919
|
this.enabledTableIds = [];
|
|
1920
|
+
this.height = undefined;
|
|
1918
1921
|
this.mapView = undefined;
|
|
1919
1922
|
this.onlyShowUpdatableLayers = undefined;
|
|
1920
1923
|
this.placeholderIcon = "";
|
|
@@ -1969,7 +1972,9 @@ const MapLayerPicker = class {
|
|
|
1969
1972
|
*/
|
|
1970
1973
|
render() {
|
|
1971
1974
|
const id = "map-layer-picker";
|
|
1972
|
-
|
|
1975
|
+
let style = this.height > 0 ? { "height": `${this.height.toString()}px` } : {};
|
|
1976
|
+
style = Object.assign(Object.assign({}, style), { "display": this.display });
|
|
1977
|
+
return (h(Host, null, h("div", { class: "map-layer-picker-container", style: style }, h("div", { class: "map-layer-picker", style: style }, !this._hasValidLayers ? this._getInvalidPlaceholder() :
|
|
1973
1978
|
!this._hasMultipleLayers && this.showSingleLayerAsLabel ? this._getSingleLayerPlaceholder() :
|
|
1974
1979
|
this.type === "combobox" ? this._getCombobox(id) :
|
|
1975
1980
|
this.type === "select" ? this._getSelect(id) : this._getDropdown(id), h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": id }, h("span", null, this._translations.switchLayer))))));
|
|
@@ -2106,14 +2111,18 @@ const MapLayerPicker = class {
|
|
|
2106
2111
|
async _setLayers() {
|
|
2107
2112
|
if (this.mapView) {
|
|
2108
2113
|
await this._initLayerTableHash();
|
|
2109
|
-
const
|
|
2114
|
+
const layerIds = this.onlyShowUpdatableLayers ?
|
|
2110
2115
|
this._getEditableIds(this._layerNameHash) : Object.keys(this._layerNameHash);
|
|
2111
|
-
const
|
|
2116
|
+
const tableIds = this.showTables ? this.onlyShowUpdatableLayers ?
|
|
2112
2117
|
this._getEditableIds(this._tableNameHash) : Object.keys(this._tableNameHash) : [];
|
|
2113
2118
|
this.ids = [
|
|
2114
|
-
...
|
|
2115
|
-
...
|
|
2119
|
+
...layerIds.reverse().filter(n => { var _a; return ((_a = this.enabledLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledLayerIds.reverse().indexOf(n) > -1 : true; }),
|
|
2120
|
+
...tableIds.reverse().filter(n => { var _a; return ((_a = this.enabledTableIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledTableIds.reverse().indexOf(n) > -1 : true; }),
|
|
2116
2121
|
];
|
|
2122
|
+
this.idsFound.emit({
|
|
2123
|
+
layerIds,
|
|
2124
|
+
tableIds
|
|
2125
|
+
});
|
|
2117
2126
|
}
|
|
2118
2127
|
}
|
|
2119
2128
|
/**
|