@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
|
@@ -525,7 +525,7 @@ const MapPicker = class {
|
|
|
525
525
|
* @protected
|
|
526
526
|
*/
|
|
527
527
|
_getMapNameList(show) {
|
|
528
|
-
const listClass = show ? "map-list" : "display-none";
|
|
528
|
+
const listClass = show ? "map-list border-bottom-1" : "display-none";
|
|
529
529
|
return (index.h("div", { class: listClass }, index.h("calcite-list", { id: "mapList", ref: (el) => this._list = el, selectionAppearance: "border", selectionMode: "single" }, this.mapInfos.map(mapInfo => {
|
|
530
530
|
return (index.h("calcite-list-item", { label: mapInfo.name, onClick: () => this._webMapSelected(mapInfo), selected: mapInfo.id === this._loadedId, value: mapInfo.id }));
|
|
531
531
|
}))));
|
|
@@ -17,7 +17,7 @@ const t9n = require('./t9n-0556abcb.js');
|
|
|
17
17
|
const resources = require('./resources-222ad22c.js');
|
|
18
18
|
const loadModules = require('./loadModules-46d14e81.js');
|
|
19
19
|
const locale$1 = require('./locale-9db09b63.js');
|
|
20
|
-
const mapViewUtils = require('./mapViewUtils-
|
|
20
|
+
const mapViewUtils = require('./mapViewUtils-569e9644.js');
|
|
21
21
|
require('./guid-1a466ca6.js');
|
|
22
22
|
require('./resources-6c60363a.js');
|
|
23
23
|
require('./key-b8c05387.js');
|
|
@@ -26,7 +26,7 @@ const debounce = require('./debounce-30afab47.js');
|
|
|
26
26
|
const conditionalSlot = require('./conditionalSlot-63e11cba.js');
|
|
27
27
|
const key = require('./key-b8c05387.js');
|
|
28
28
|
const locale$1 = require('./locale-9db09b63.js');
|
|
29
|
-
const mapViewUtils = require('./mapViewUtils-
|
|
29
|
+
const mapViewUtils = require('./mapViewUtils-569e9644.js');
|
|
30
30
|
const publicNotificationStore = require('./publicNotificationStore-3a17c2f4.js');
|
|
31
31
|
require('./resources-6c60363a.js');
|
|
32
32
|
require('./browser-9a43b900.js');
|
|
@@ -1899,11 +1899,12 @@ const DropdownItem = class {
|
|
|
1899
1899
|
};
|
|
1900
1900
|
DropdownItem.style = dropdownItemCss;
|
|
1901
1901
|
|
|
1902
|
-
const mapLayerPickerCss = ":host{display:block}.map-layer-picker-container{width:100
|
|
1902
|
+
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}";
|
|
1903
1903
|
|
|
1904
1904
|
const MapLayerPicker = class {
|
|
1905
1905
|
constructor(hostRef) {
|
|
1906
1906
|
index.registerInstance(this, hostRef);
|
|
1907
|
+
this.idsFound = index.createEvent(this, "idsFound", 7);
|
|
1907
1908
|
this.noLayersFound = index.createEvent(this, "noLayersFound", 7);
|
|
1908
1909
|
this.layerSelectionChange = index.createEvent(this, "layerSelectionChange", 7);
|
|
1909
1910
|
//--------------------------------------------------------------------------
|
|
@@ -1917,8 +1918,10 @@ const MapLayerPicker = class {
|
|
|
1917
1918
|
this.defaultLayerHonored = false;
|
|
1918
1919
|
this.appearance = "transparent";
|
|
1919
1920
|
this.defaultLayerId = "";
|
|
1921
|
+
this.display = "inline-block";
|
|
1920
1922
|
this.enabledLayerIds = [];
|
|
1921
1923
|
this.enabledTableIds = [];
|
|
1924
|
+
this.height = undefined;
|
|
1922
1925
|
this.mapView = undefined;
|
|
1923
1926
|
this.onlyShowUpdatableLayers = undefined;
|
|
1924
1927
|
this.placeholderIcon = "";
|
|
@@ -1973,7 +1976,9 @@ const MapLayerPicker = class {
|
|
|
1973
1976
|
*/
|
|
1974
1977
|
render() {
|
|
1975
1978
|
const id = "map-layer-picker";
|
|
1976
|
-
|
|
1979
|
+
let style = this.height > 0 ? { "height": `${this.height.toString()}px` } : {};
|
|
1980
|
+
style = Object.assign(Object.assign({}, style), { "display": this.display });
|
|
1981
|
+
return (index.h(index.Host, null, index.h("div", { class: "map-layer-picker-container", style: style }, index.h("div", { class: "map-layer-picker", style: style }, !this._hasValidLayers ? this._getInvalidPlaceholder() :
|
|
1977
1982
|
!this._hasMultipleLayers && this.showSingleLayerAsLabel ? this._getSingleLayerPlaceholder() :
|
|
1978
1983
|
this.type === "combobox" ? this._getCombobox(id) :
|
|
1979
1984
|
this.type === "select" ? this._getSelect(id) : this._getDropdown(id), index.h("calcite-tooltip", { label: "", placement: "bottom", "reference-element": id }, index.h("span", null, this._translations.switchLayer))))));
|
|
@@ -2110,14 +2115,18 @@ const MapLayerPicker = class {
|
|
|
2110
2115
|
async _setLayers() {
|
|
2111
2116
|
if (this.mapView) {
|
|
2112
2117
|
await this._initLayerTableHash();
|
|
2113
|
-
const
|
|
2118
|
+
const layerIds = this.onlyShowUpdatableLayers ?
|
|
2114
2119
|
this._getEditableIds(this._layerNameHash) : Object.keys(this._layerNameHash);
|
|
2115
|
-
const
|
|
2120
|
+
const tableIds = this.showTables ? this.onlyShowUpdatableLayers ?
|
|
2116
2121
|
this._getEditableIds(this._tableNameHash) : Object.keys(this._tableNameHash) : [];
|
|
2117
2122
|
this.ids = [
|
|
2118
|
-
...
|
|
2119
|
-
...
|
|
2123
|
+
...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; }),
|
|
2124
|
+
...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; }),
|
|
2120
2125
|
];
|
|
2126
|
+
this.idsFound.emit({
|
|
2127
|
+
layerIds,
|
|
2128
|
+
tableIds
|
|
2129
|
+
});
|
|
2121
2130
|
}
|
|
2122
2131
|
}
|
|
2123
2132
|
/**
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
9
9
|
|
|
10
10
|
const index = require('./index-b8a649fc.js');
|
|
11
11
|
const locale = require('./locale-9db09b63.js');
|
|
12
|
-
const mapViewUtils = require('./mapViewUtils-
|
|
12
|
+
const mapViewUtils = require('./mapViewUtils-569e9644.js');
|
|
13
13
|
const loadModules = require('./loadModules-46d14e81.js');
|
|
14
|
-
const downloadUtils = require('./downloadUtils-
|
|
14
|
+
const downloadUtils = require('./downloadUtils-8f50633d.js');
|
|
15
15
|
require('./esri-loader-a91c0ec1.js');
|
|
16
16
|
require('./_commonjsHelpers-384729db.js');
|
|
17
17
|
require('./interfaces-7cd0a48a.js');
|
|
@@ -116,6 +116,10 @@ const LayerTable = class {
|
|
|
116
116
|
* number[]: A list of all IDs for the current layer
|
|
117
117
|
*/
|
|
118
118
|
this._allIds = [];
|
|
119
|
+
/**
|
|
120
|
+
* boolean: When true the ctrl key is currently pressed
|
|
121
|
+
*/
|
|
122
|
+
this._ctrlIsPressed = false;
|
|
119
123
|
/**
|
|
120
124
|
* boolean: When true the default global id provided via url param has been honored and should now be ignored
|
|
121
125
|
*/
|
|
@@ -124,6 +128,14 @@ const LayerTable = class {
|
|
|
124
128
|
* boolean: When true the default OID provided via url param has been honored and should now be ignored
|
|
125
129
|
*/
|
|
126
130
|
this._defaultOidHonored = false;
|
|
131
|
+
/**
|
|
132
|
+
* boolean: When true the shift key is currently pressed
|
|
133
|
+
*/
|
|
134
|
+
this._shiftIsPressed = false;
|
|
135
|
+
/**
|
|
136
|
+
* boolean: When true any onChange handeling will be skipped
|
|
137
|
+
*/
|
|
138
|
+
this._skipOnChange = false;
|
|
127
139
|
/**
|
|
128
140
|
* bool: When true the table is being sorted
|
|
129
141
|
*/
|
|
@@ -328,6 +340,8 @@ const LayerTable = class {
|
|
|
328
340
|
async componentDidLoad() {
|
|
329
341
|
this._resizeObserver.observe(this._toolbar);
|
|
330
342
|
document.onclick = (e) => this._handleDocumentClick(e);
|
|
343
|
+
document.onkeydown = (e) => this._handleKeyDown(e);
|
|
344
|
+
document.onkeyup = (e) => this._handleKeyUp(e);
|
|
331
345
|
}
|
|
332
346
|
/**
|
|
333
347
|
* Called after the component is rendered
|
|
@@ -382,7 +396,7 @@ const LayerTable = class {
|
|
|
382
396
|
* @returns The dom node that contains the controls
|
|
383
397
|
*/
|
|
384
398
|
_getActionBar() {
|
|
385
|
-
return (index.h("calcite-action-bar", { expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, index.h("div", { class: "border-end", id: "solutions-map-layer-picker-container" }, index.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()));
|
|
399
|
+
return (index.h("calcite-action-bar", { expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, index.h("div", { class: "border-end", id: "solutions-map-layer-picker-container" }, index.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()));
|
|
386
400
|
}
|
|
387
401
|
/**
|
|
388
402
|
* Get the actions that are used for various interactions with the table
|
|
@@ -807,18 +821,8 @@ const LayerTable = class {
|
|
|
807
821
|
this._initColumnsInfo();
|
|
808
822
|
this._checkEditEnabled();
|
|
809
823
|
await this._table.when(() => {
|
|
810
|
-
this._table.highlightIds.on("change", () => {
|
|
811
|
-
|
|
812
|
-
this._selectedIndexes = this._table.highlightIds.toArray().reverse();
|
|
813
|
-
if (this._showOnlySelected) {
|
|
814
|
-
if (this._featuresSelected()) {
|
|
815
|
-
this._table.filterBySelection();
|
|
816
|
-
}
|
|
817
|
-
else {
|
|
818
|
-
this._toggleShowSelected();
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
this.featureSelectionChange.emit(this._selectedIndexes);
|
|
824
|
+
this._table.highlightIds.on("change", (evt) => {
|
|
825
|
+
void this._handleOnChange(evt);
|
|
822
826
|
});
|
|
823
827
|
this.reactiveUtils.watch(() => this._table.activeSortOrders, (sortOrders) => {
|
|
824
828
|
var _a, _b, _c, _d;
|
|
@@ -828,6 +832,93 @@ const LayerTable = class {
|
|
|
828
832
|
});
|
|
829
833
|
}
|
|
830
834
|
}
|
|
835
|
+
async _handleOnChange(evt) {
|
|
836
|
+
const ids = [...this._table.highlightIds.toArray()];
|
|
837
|
+
if (!this._skipOnChange) {
|
|
838
|
+
if (!this._ctrlIsPressed && !this._shiftIsPressed) {
|
|
839
|
+
if (this._selectedIndexes.length > 0) {
|
|
840
|
+
this._skipOnChange = true;
|
|
841
|
+
// only readd in specific case where we have multiple selected and then click one of the currently selected
|
|
842
|
+
const reAdd = this._selectedIndexes.length > 1 && evt.removed.length === 1;
|
|
843
|
+
const newIndexes = reAdd ? evt.removed : ids.filter(id => this._selectedIndexes.indexOf(id) < 0);
|
|
844
|
+
this._clearSelection();
|
|
845
|
+
this._selectedIndexes = [...newIndexes];
|
|
846
|
+
if (newIndexes.length > 0) {
|
|
847
|
+
this._table.highlightIds.add(newIndexes[0]);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
else {
|
|
851
|
+
// https://github.com/Esri/solutions-components/issues/365
|
|
852
|
+
this._selectedIndexes = ids.reverse();
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
else if (this._ctrlIsPressed) {
|
|
856
|
+
this._selectedIndexes = ids.reverse();
|
|
857
|
+
}
|
|
858
|
+
else if (this._shiftIsPressed) {
|
|
859
|
+
this._skipOnChange = true;
|
|
860
|
+
this._previousCurrentId = this._currentId;
|
|
861
|
+
this._currentId = [...this._table.highlightIds.toArray()].reverse()[0];
|
|
862
|
+
if (this._previousCurrentId !== this._currentId) {
|
|
863
|
+
// query the layer based on current sort and filters then grab between the current id and previous id
|
|
864
|
+
const orderBy = this._table.activeSortOrders.reduce((prev, cur) => {
|
|
865
|
+
prev.push(`${cur.fieldName} ${cur.direction}`);
|
|
866
|
+
return prev;
|
|
867
|
+
}, []);
|
|
868
|
+
const oids = await mapViewUtils.queryFeatureIds(this._layer, this._layer.definitionExpression, orderBy);
|
|
869
|
+
let isBetween = false;
|
|
870
|
+
const _start = this._table.viewModel.getObjectIdIndex(this._previousCurrentId);
|
|
871
|
+
const _end = this._table.viewModel.getObjectIdIndex(this._currentId);
|
|
872
|
+
const startIndex = _start < _end ? _start : _end;
|
|
873
|
+
const endIndex = _end > _start ? _end : _start;
|
|
874
|
+
this._selectedIndexes = oids.reduce((prev, cur) => {
|
|
875
|
+
const id = cur;
|
|
876
|
+
const index = this._table.viewModel.getObjectIdIndex(id);
|
|
877
|
+
if ((id === this._currentId || id === this._previousCurrentId)) {
|
|
878
|
+
isBetween = !isBetween;
|
|
879
|
+
if (prev.indexOf(id) < 0) {
|
|
880
|
+
prev.push(id);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
// The oids are sorted so after we have reached the start or end oid add all ids even if the index is -1.
|
|
884
|
+
// Index of -1 will occur for features between the start and and oid if
|
|
885
|
+
// you select a row then scroll faster than the FeatureTable loads the data to select the next id
|
|
886
|
+
if (isBetween && prev.indexOf(id) < 0) {
|
|
887
|
+
prev.push(id);
|
|
888
|
+
}
|
|
889
|
+
// Also add index based check.
|
|
890
|
+
// In some cases the FeatureTable and Layer query will have differences in how null/undefined field values are sorted
|
|
891
|
+
if ((this._selectedIndexes.indexOf(id) > -1 || (index >= startIndex && index <= endIndex)) && prev.indexOf(id) < 0 && index > -1) {
|
|
892
|
+
prev.push(id);
|
|
893
|
+
}
|
|
894
|
+
return prev;
|
|
895
|
+
}, []);
|
|
896
|
+
this._table.highlightIds.addMany(this._selectedIndexes.filter(i => ids.indexOf(i) < 0));
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
this._finishOnChange();
|
|
900
|
+
}
|
|
901
|
+
else {
|
|
902
|
+
this._skipOnChange = false;
|
|
903
|
+
}
|
|
904
|
+
this._currentId = [...this._table.highlightIds.toArray()].reverse()[0];
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Handle any updates after a selection change has occured and emit the results
|
|
908
|
+
*
|
|
909
|
+
* @returns void
|
|
910
|
+
*/
|
|
911
|
+
_finishOnChange() {
|
|
912
|
+
if (this._showOnlySelected) {
|
|
913
|
+
if (this._featuresSelected()) {
|
|
914
|
+
this._table.filterBySelection();
|
|
915
|
+
}
|
|
916
|
+
else {
|
|
917
|
+
this._toggleShowSelected();
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
this.featureSelectionChange.emit(this._selectedIndexes);
|
|
921
|
+
}
|
|
831
922
|
/**
|
|
832
923
|
* Reset basic table props
|
|
833
924
|
*
|
|
@@ -963,6 +1054,24 @@ const LayerTable = class {
|
|
|
963
1054
|
}
|
|
964
1055
|
}
|
|
965
1056
|
}
|
|
1057
|
+
/**
|
|
1058
|
+
* Keep track of key down for ctrl and shift
|
|
1059
|
+
*
|
|
1060
|
+
* @returns void
|
|
1061
|
+
*/
|
|
1062
|
+
_handleKeyDown(e) {
|
|
1063
|
+
this._ctrlIsPressed = e.ctrlKey;
|
|
1064
|
+
this._shiftIsPressed = e.shiftKey;
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* Keep track of key up for ctrl and shift
|
|
1068
|
+
*
|
|
1069
|
+
* @returns void
|
|
1070
|
+
*/
|
|
1071
|
+
_handleKeyUp(e) {
|
|
1072
|
+
this._ctrlIsPressed = e.ctrlKey;
|
|
1073
|
+
this._shiftIsPressed = e.shiftKey;
|
|
1074
|
+
}
|
|
966
1075
|
/**
|
|
967
1076
|
* Show filter component in modal
|
|
968
1077
|
*
|
|
@@ -970,15 +1079,19 @@ const LayerTable = class {
|
|
|
970
1079
|
*/
|
|
971
1080
|
_filterModal() {
|
|
972
1081
|
var _a, _b, _c;
|
|
973
|
-
return (index.h("calcite-modal", { "aria-labelledby": "modal-title", kind: "brand", onCalciteModalClose: () => this._closeFilter(), open: this._filterOpen, widthScale: "s" }, index.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)), index.h("div", { slot: "content" }, index.h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtn: true, closeBtnOnClick: () => this._closeFilter(), layerExpressions: this._layerExpressions, ref: (el) => this._filterList = el, view: this.mapView }))));
|
|
1082
|
+
return (index.h("calcite-modal", { "aria-labelledby": "modal-title", kind: "brand", onCalciteModalClose: async () => this._closeFilter(), open: this._filterOpen, widthScale: "s" }, index.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)), index.h("div", { slot: "content" }, index.h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtn: true, closeBtnOnClick: async () => this._closeFilter(), layerExpressions: this._layerExpressions, ref: (el) => this._filterList = el, view: this.mapView }))));
|
|
974
1083
|
}
|
|
975
1084
|
/**
|
|
976
1085
|
* Close the filter modal
|
|
977
1086
|
*
|
|
978
1087
|
* @returns void
|
|
979
1088
|
*/
|
|
980
|
-
_closeFilter() {
|
|
981
|
-
this._filterOpen
|
|
1089
|
+
async _closeFilter() {
|
|
1090
|
+
if (this._filterOpen) {
|
|
1091
|
+
// reset allIds
|
|
1092
|
+
this._allIds = await mapViewUtils.queryAllIds(this._layer);
|
|
1093
|
+
this._filterOpen = false;
|
|
1094
|
+
}
|
|
982
1095
|
}
|
|
983
1096
|
/**
|
|
984
1097
|
* Show delete confirmation message
|
|
@@ -1051,8 +1164,10 @@ const LayerTable = class {
|
|
|
1051
1164
|
_selectAll() {
|
|
1052
1165
|
const ids = this._allIds;
|
|
1053
1166
|
this._table.highlightIds.removeAll();
|
|
1167
|
+
this._skipOnChange = true;
|
|
1054
1168
|
this._table.highlightIds.addMany(ids);
|
|
1055
1169
|
this._selectedIndexes = ids;
|
|
1170
|
+
this._finishOnChange();
|
|
1056
1171
|
}
|
|
1057
1172
|
/**
|
|
1058
1173
|
* Toggle the show only selected flag
|
|
@@ -1094,9 +1209,9 @@ const LayerTable = class {
|
|
|
1094
1209
|
* @returns void
|
|
1095
1210
|
*/
|
|
1096
1211
|
_initLayerExpressions() {
|
|
1097
|
-
var _a;
|
|
1098
|
-
const layerExpressions = (_a = this.mapInfo
|
|
1099
|
-
this._layerExpressions = layerExpressions.filter((exp) => exp.id === this._layer.id);
|
|
1212
|
+
var _a, _b;
|
|
1213
|
+
const layerExpressions = (_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.layerExpressions;
|
|
1214
|
+
this._layerExpressions = layerExpressions ? layerExpressions.filter((exp) => exp.id === this._layer.id) : [];
|
|
1100
1215
|
}
|
|
1101
1216
|
/**
|
|
1102
1217
|
* Select all rows that are not currently selectd
|
|
@@ -1112,8 +1227,10 @@ const LayerTable = class {
|
|
|
1112
1227
|
}
|
|
1113
1228
|
return prev;
|
|
1114
1229
|
}, []).sort((a, b) => a - b);
|
|
1230
|
+
this._skipOnChange = true;
|
|
1115
1231
|
this._table.highlightIds.addMany(ids);
|
|
1116
1232
|
this._selectedIndexes = ids;
|
|
1233
|
+
this._finishOnChange();
|
|
1117
1234
|
}
|
|
1118
1235
|
/**
|
|
1119
1236
|
* Export all selected rows as CSV
|
|
@@ -1199,6 +1316,7 @@ const LayerTable = class {
|
|
|
1199
1316
|
fieldInfos.some(fieldInfo => {
|
|
1200
1317
|
if (fieldInfo.name === columnTemplate.fieldName) {
|
|
1201
1318
|
columnTemplate.label = fieldInfo.alias;
|
|
1319
|
+
columnTemplate.menuConfig = this._getMenuConfig(fieldInfo.name);
|
|
1202
1320
|
return true;
|
|
1203
1321
|
}
|
|
1204
1322
|
});
|
|
@@ -1207,12 +1325,48 @@ const LayerTable = class {
|
|
|
1207
1325
|
return {
|
|
1208
1326
|
type: "field",
|
|
1209
1327
|
fieldName: fieldInfo.name,
|
|
1210
|
-
label: fieldInfo.alias
|
|
1328
|
+
label: fieldInfo.alias,
|
|
1329
|
+
menuConfig: this._getMenuConfig(fieldInfo.name)
|
|
1211
1330
|
};
|
|
1212
1331
|
});
|
|
1213
1332
|
}
|
|
1214
1333
|
return columnTemplates;
|
|
1215
1334
|
}
|
|
1335
|
+
/**
|
|
1336
|
+
* Get the menu config that adds the ability to hide the current column
|
|
1337
|
+
*
|
|
1338
|
+
* @returns void
|
|
1339
|
+
* @protected
|
|
1340
|
+
*/
|
|
1341
|
+
_getMenuConfig(name) {
|
|
1342
|
+
return {
|
|
1343
|
+
items: [
|
|
1344
|
+
{
|
|
1345
|
+
label: this._translations.hideField,
|
|
1346
|
+
iconClass: "esri-icon-non-visible",
|
|
1347
|
+
autoCloseMenu: true,
|
|
1348
|
+
clickFunction: () => {
|
|
1349
|
+
this._handleHideClick(name);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
]
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Hide the table column for the provided name
|
|
1357
|
+
*
|
|
1358
|
+
* @returns void
|
|
1359
|
+
* @protected
|
|
1360
|
+
*/
|
|
1361
|
+
_handleHideClick(name) {
|
|
1362
|
+
this._columnsInfo[name] = false;
|
|
1363
|
+
this._table.hideColumn(name);
|
|
1364
|
+
this._table.tableTemplate.columnTemplates.forEach((columnTemplate) => {
|
|
1365
|
+
if (columnTemplate.fieldName === name) {
|
|
1366
|
+
columnTemplate.visible = false;
|
|
1367
|
+
}
|
|
1368
|
+
});
|
|
1369
|
+
}
|
|
1216
1370
|
/**
|
|
1217
1371
|
* Fetches the component's translations
|
|
1218
1372
|
*
|
|
@@ -57,6 +57,7 @@ const CrowdsourceManager = class {
|
|
|
57
57
|
this._layoutMode = interfaces.ELayoutMode.GRID;
|
|
58
58
|
this._mapView = undefined;
|
|
59
59
|
this._panelOpen = true;
|
|
60
|
+
this._tableOnly = false;
|
|
60
61
|
}
|
|
61
62
|
//--------------------------------------------------------------------------
|
|
62
63
|
//
|
|
@@ -106,6 +107,16 @@ const CrowdsourceManager = class {
|
|
|
106
107
|
// Events (public)
|
|
107
108
|
//
|
|
108
109
|
//--------------------------------------------------------------------------
|
|
110
|
+
/**
|
|
111
|
+
* Listen for idsFound event to be fired so we can know that all layer ids have been fetched
|
|
112
|
+
*/
|
|
113
|
+
async idsFound(evt) {
|
|
114
|
+
const ids = evt.detail;
|
|
115
|
+
this._tableOnly = ids.tableIds.length > 0 && ids.layerIds.length === 0;
|
|
116
|
+
if (this._tableOnly) {
|
|
117
|
+
this._expandPopup = true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
109
120
|
/**
|
|
110
121
|
* Listen for layoutChanged event to be fired so we can adjust the layout
|
|
111
122
|
*/
|
|
@@ -303,7 +314,7 @@ const CrowdsourceManager = class {
|
|
|
303
314
|
const tooltip = this._expandPopup ? this._translations.collapsePopup : this._translations.expandPopup;
|
|
304
315
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
|
305
316
|
const popupNodeClass = !this._expandPopup ? "height-full" : ((_a = this.mapInfos) === null || _a === void 0 ? void 0 : _a.length) === 1 ? "position-absolute-0" : "position-absolute-50";
|
|
306
|
-
return (index.h("div", { class: "calcite-mode-dark " + popupNodeClass }, index.h("calcite-panel", null, index.h("div", { class: "display-flex align-items-center", slot: "header-content" }, index.h("calcite-icon", { icon: "information", scale: "s" }), index.h("div", { class: "padding-inline-start-75" }, this._translations.information)), index.h("calcite-action", { icon: icon, id: id, onClick: () => this._togglePopup(), slot: "header-actions-end", text: "" }), index.h("calcite-tooltip", { class: themeClass, label: "", placement: "bottom", "reference-element": id }, index.h("span", null, tooltip)), this._getCardNode())));
|
|
317
|
+
return (index.h("div", { class: "calcite-mode-dark " + popupNodeClass }, index.h("calcite-panel", null, index.h("div", { class: "display-flex align-items-center", slot: "header-content" }, index.h("calcite-icon", { icon: "information", scale: "s" }), index.h("div", { class: "padding-inline-start-75" }, this._translations.information)), index.h("calcite-action", { disabled: this._tableOnly, icon: icon, id: id, onClick: () => this._togglePopup(), slot: "header-actions-end", text: "" }), !this._tableOnly ? index.h("calcite-tooltip", { class: themeClass, label: "", placement: "bottom", "reference-element": id }, index.h("span", null, tooltip)) : undefined, this._getCardNode())));
|
|
307
318
|
}
|
|
308
319
|
/**
|
|
309
320
|
* Toggle the popup information
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
const _commonjsHelpers = require('./_commonjsHelpers-384729db.js');
|
|
9
9
|
const index = require('./index-b8a649fc.js');
|
|
10
10
|
const loadModules = require('./loadModules-46d14e81.js');
|
|
11
|
-
const mapViewUtils = require('./mapViewUtils-
|
|
11
|
+
const mapViewUtils = require('./mapViewUtils-569e9644.js');
|
|
12
12
|
require('./solution-resource-abec7452.js');
|
|
13
13
|
require('./index-f64944ad.js');
|
|
14
14
|
const restHelpersGet = require('./restHelpersGet-e0737480.js');
|
|
@@ -1510,7 +1510,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
|
|
|
1510
1510
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1511
1511
|
* ====================================================================
|
|
1512
1512
|
*/
|
|
1513
|
-
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):Promise.resolve().then(function () { return require('./index.es-
|
|
1513
|
+
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):Promise.resolve().then(function () { return require('./index.es-140aa937.js'); })).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
|
|
1514
1514
|
/** ====================================================================
|
|
1515
1515
|
* @license
|
|
1516
1516
|
* jsPDF XMP metadata plugin
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
const _commonjsHelpers = require('./_commonjsHelpers-384729db.js');
|
|
9
|
-
const downloadUtils = require('./downloadUtils-
|
|
9
|
+
const downloadUtils = require('./downloadUtils-8f50633d.js');
|
|
10
10
|
require('./index-b8a649fc.js');
|
|
11
11
|
require('./loadModules-46d14e81.js');
|
|
12
12
|
require('./esri-loader-a91c0ec1.js');
|
|
13
|
-
require('./mapViewUtils-
|
|
13
|
+
require('./mapViewUtils-569e9644.js');
|
|
14
14
|
require('./interfaces-7cd0a48a.js');
|
|
15
15
|
require('./solution-resource-abec7452.js');
|
|
16
16
|
require('./index-f64944ad.js');
|