@esri/solutions-components 0.3.8 → 0.4.0
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/buffer-tools_6.cjs.entry.js +37 -33
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
- package/dist/cjs/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-d5d5499f.js → calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-da276a1c.js} +112 -32
- package/dist/cjs/calcite-input-message_5.cjs.entry.js +2 -2
- package/dist/cjs/{index.es-43f519b3.js → index.es-176629d8.js} +2 -2
- package/dist/cjs/layer-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{mapViewUtils-24d1d859.js → mapViewUtils-d250b1ed.js} +11 -6
- package/dist/cjs/public-notification.cjs.entry.js +24 -11
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/buffer-tools/buffer-tools.js +22 -20
- package/dist/collection/components/map-select-tools/map-select-tools.js +78 -13
- package/dist/collection/components/pdf-download/pdf-download.js +9 -19
- package/dist/collection/components/public-notification/public-notification.js +44 -30
- package/dist/collection/components/refine-selection/refine-selection.js +34 -14
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +47 -21
- package/dist/collection/demos/buffer-tools.html +1 -1
- package/dist/collection/demos/new-public-notification.html +1 -11
- package/dist/collection/utils/interfaces.ts +8 -0
- package/dist/collection/utils/mapViewUtils.js +11 -6
- package/dist/collection/utils/mapViewUtils.ts +11 -6
- package/dist/components/buffer-tools2.js +19 -16
- package/dist/components/map-layer-picker2.js +11 -6
- package/dist/components/map-select-tools2.js +72 -15
- package/dist/components/pdf-download2.js +9 -4
- package/dist/components/public-notification.js +23 -11
- package/dist/components/refine-selection-tools2.js +20 -18
- package/dist/components/refine-selection2.js +32 -15
- package/dist/esm/buffer-tools_6.entry.js +37 -33
- package/dist/esm/calcite-combobox_3.entry.js +1 -1
- package/dist/esm/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-b60306b8.js → calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-c6f63458.js} +112 -32
- package/dist/esm/calcite-input-message_5.entry.js +2 -2
- package/dist/esm/{index.es-4a2bee8f.js → index.es-54a6f3a3.js} +2 -2
- package/dist/esm/layer-table.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mapViewUtils-c2fb048d.js → mapViewUtils-63e118f8.js} +11 -6
- package/dist/esm/public-notification.entry.js +24 -11
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/buffer-tools.html +1 -1
- package/dist/solutions-components/demos/new-public-notification.html +1 -11
- package/dist/solutions-components/{p-21ae3f97.entry.js → p-117174e8.entry.js} +1 -1
- package/dist/solutions-components/{p-1b7c13f8.js → p-1e459361.js} +1 -1
- package/dist/solutions-components/{p-b4be1c30.entry.js → p-6d28f991.entry.js} +1 -1
- package/dist/solutions-components/{p-547cbe8a.js → p-80f5e33c.js} +12 -12
- package/dist/solutions-components/{p-c5f670fb.entry.js → p-8927862a.entry.js} +1 -1
- package/dist/solutions-components/{p-709c3f22.entry.js → p-8a0c0935.entry.js} +2 -2
- package/dist/solutions-components/p-cc2e20c8.js +36 -0
- package/dist/solutions-components/p-e69c58e5.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +8 -0
- package/dist/solutions-components/utils/mapViewUtils.ts +11 -6
- package/dist/types/components/buffer-tools/buffer-tools.d.ts +2 -2
- package/dist/types/components/map-select-tools/map-select-tools.d.ts +19 -1
- package/dist/types/components/pdf-download/pdf-download.d.ts +0 -5
- package/dist/types/components/public-notification/public-notification.d.ts +11 -6
- package/dist/types/components/refine-selection/refine-selection.d.ts +6 -4
- package/dist/types/components/refine-selection-tools/refine-selection-tools.d.ts +6 -10
- package/dist/types/components.d.ts +24 -28
- package/dist/types/preact.d.ts +2 -1
- package/dist/types/utils/interfaces.d.ts +7 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-b47d1a9a.entry.js +0 -6
- package/dist/solutions-components/p-cd7606eb.js +0 -36
|
@@ -29,7 +29,6 @@ import { queryFeaturesByID } from "../../utils/queryUtils";
|
|
|
29
29
|
export class PdfDownload {
|
|
30
30
|
constructor() {
|
|
31
31
|
this.disabled = false;
|
|
32
|
-
this.enabledSizeValues = [];
|
|
33
32
|
this.layerView = undefined;
|
|
34
33
|
this._translations = undefined;
|
|
35
34
|
}
|
|
@@ -119,8 +118,15 @@ export class PdfDownload {
|
|
|
119
118
|
_convertPopupToLabelSpec(popupInfo) {
|
|
120
119
|
// Replace <br>, <br/> with |
|
|
121
120
|
popupInfo = popupInfo.replace(/<br\s*\/?>/gi, "|");
|
|
122
|
-
// Remove remaining HTML tags
|
|
123
|
-
|
|
121
|
+
// Remove remaining HTML tags, replace 0xA0 that popup uses for spaces, replace some char representations,
|
|
122
|
+
// and split the label back into individual lines
|
|
123
|
+
let labelSpec = popupInfo
|
|
124
|
+
.replace(/<[\s.]*[^<>]*\/?>/gi, "")
|
|
125
|
+
.replace(/\xA0/gi, " ")
|
|
126
|
+
.replace(/</gi, "<")
|
|
127
|
+
.replace(/>/gi, ">")
|
|
128
|
+
.replace(/ /gi, " ")
|
|
129
|
+
.split("|");
|
|
124
130
|
// Trim lines and remove empties
|
|
125
131
|
labelSpec = labelSpec.map(line => line.trim()).filter(line => line.length > 0);
|
|
126
132
|
return labelSpec;
|
|
@@ -239,22 +245,6 @@ export class PdfDownload {
|
|
|
239
245
|
"reflect": false,
|
|
240
246
|
"defaultValue": "false"
|
|
241
247
|
},
|
|
242
|
-
"enabledSizeValues": {
|
|
243
|
-
"type": "unknown",
|
|
244
|
-
"mutable": false,
|
|
245
|
-
"complexType": {
|
|
246
|
-
"original": "number[]",
|
|
247
|
-
"resolved": "number[]",
|
|
248
|
-
"references": {}
|
|
249
|
-
},
|
|
250
|
-
"required": false,
|
|
251
|
-
"optional": false,
|
|
252
|
-
"docs": {
|
|
253
|
-
"tags": [],
|
|
254
|
-
"text": "string[]: Optional list of enabled size values for PDF export\r\n If empty all sizes will be enabled"
|
|
255
|
-
},
|
|
256
|
-
"defaultValue": "[]"
|
|
257
|
-
},
|
|
258
248
|
"layerView": {
|
|
259
249
|
"type": "unknown",
|
|
260
250
|
"mutable": false,
|
|
@@ -34,7 +34,6 @@ export class PublicNotification {
|
|
|
34
34
|
this.customLabelEnabled = undefined;
|
|
35
35
|
this.defaultBufferDistance = undefined;
|
|
36
36
|
this.defaultBufferUnit = undefined;
|
|
37
|
-
this.exportOptions = undefined;
|
|
38
37
|
this.featureEffect = undefined;
|
|
39
38
|
this.featureHighlightEnabled = undefined;
|
|
40
39
|
this.mapView = undefined;
|
|
@@ -67,6 +66,25 @@ export class PublicNotification {
|
|
|
67
66
|
this._popupsEnabled = v === null || v === void 0 ? void 0 : v.popup.autoOpenEnabled;
|
|
68
67
|
}
|
|
69
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Called each time the searchConfiguration prop is changed.
|
|
71
|
+
*
|
|
72
|
+
* @returns Promise when complete
|
|
73
|
+
*/
|
|
74
|
+
async watchSearchConfigurationHandler(newValue, oldValue) {
|
|
75
|
+
//TODO adding this here to see if its any different than having in map-select-tools
|
|
76
|
+
// I would have thought that the prop would have made it through on the next render of map-select-tools
|
|
77
|
+
// however we are still seeing a broken search...need to understand why and don't see a clean way to debug in devext
|
|
78
|
+
console.log("PN watchSearchConfigurationHandler");
|
|
79
|
+
console.log("PN newValue");
|
|
80
|
+
console.log(newValue);
|
|
81
|
+
console.log("PN oldValue");
|
|
82
|
+
console.log(oldValue);
|
|
83
|
+
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
84
|
+
console.log("Emit event from parent");
|
|
85
|
+
this.searchConfigurationChange.emit(newValue);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
70
88
|
/**
|
|
71
89
|
* Called each time the selectionSets prop is changed.
|
|
72
90
|
*/
|
|
@@ -134,13 +152,8 @@ export class PublicNotification {
|
|
|
134
152
|
* Renders the component.
|
|
135
153
|
*/
|
|
136
154
|
render() {
|
|
137
|
-
var _a, _b, _c, _d, _e, _f;
|
|
138
155
|
const hasSelections = this._selectionSets.length > 0;
|
|
139
|
-
|
|
140
|
-
(_c = this.exportOptions) === null || _c === void 0 ? void 0 : _c.csvOptions.enabled : true;
|
|
141
|
-
const pdfEnabled = typeof ((_e = (_d = this.exportOptions) === null || _d === void 0 ? void 0 : _d.pdfOptions) === null || _e === void 0 ? void 0 : _e.enabled) === "boolean" ?
|
|
142
|
-
(_f = this.exportOptions) === null || _f === void 0 ? void 0 : _f.pdfOptions.enabled : true;
|
|
143
|
-
return (h(Host, null, h("calcite-shell", null, h("calcite-action-bar", { class: "border-bottom-1 action-bar-size", "expand-disabled": true, layout: "horizontal", slot: "header" }, this._getActionGroup("list-check", false, EPageType.LIST, this._translations.myLists), this.showRefineSelection ? this._getActionGroup("test-data", !hasSelections, EPageType.REFINE, this._translations.refineSelection) : undefined, pdfEnabled ? this._getActionGroup("file-pdf", !hasSelections, EPageType.PDF, this._translations.downloadPDF) : undefined, csvEnabled ? this._getActionGroup("file-csv", !hasSelections, EPageType.CSV, this._translations.downloadCSV) : undefined), this._getPage(this._pageType))));
|
|
156
|
+
return (h(Host, null, h("calcite-shell", null, h("calcite-action-bar", { class: "border-bottom-1 action-bar-size", "expand-disabled": true, layout: "horizontal", slot: "header" }, this._getActionGroup("list-check", false, EPageType.LIST, this._translations.myLists), this.showRefineSelection ? this._getActionGroup("test-data", !hasSelections, EPageType.REFINE, this._translations.refineSelection) : undefined, this._getActionGroup("file-pdf", !hasSelections, EPageType.PDF, this._translations.downloadPDF), this._getActionGroup("file-csv", !hasSelections, EPageType.CSV, this._translations.downloadCSV)), this._getPage(this._pageType))));
|
|
144
157
|
}
|
|
145
158
|
//--------------------------------------------------------------------------
|
|
146
159
|
//
|
|
@@ -344,10 +357,8 @@ export class PublicNotification {
|
|
|
344
357
|
* @protected
|
|
345
358
|
*/
|
|
346
359
|
_getDownloadPage(type) {
|
|
347
|
-
var _a, _b;
|
|
348
360
|
const isPdf = type === EExportType.PDF;
|
|
349
|
-
|
|
350
|
-
return (h("calcite-panel", null, h("div", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "font-bold" }, isPdf ? this._translations.pdfDownloads : this._translations.csvDownloads), h("calcite-label", null, this._translations.notifications)), this._getSelectionLists(), h("div", { class: "margin-side-1 padding-top-1 border-bottom" }), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { disabled: !this._downloadActive, ref: (el) => { this._removeDuplicates = el; } }), this._translations.removeDuplicate)), h("div", { class: isPdf && multiPdfOptions ? "" : "display-none" }, this._getLabel(this._translations.selectPDFLabelOption, false), h("div", { class: "padding-sides-1" }, h("pdf-download", { disabled: !this._downloadActive, enabledSizeValues: (_b = this.exportOptions) === null || _b === void 0 ? void 0 : _b.pdfOptions.enabledSizeValues, layerView: this.addresseeLayer, ref: (el) => { this._downloadTools = el; } }))), h("div", { class: "padding-1 display-flex" }, h("calcite-button", { disabled: !this._downloadActive, onClick: isPdf ? () => this._downloadPDF() : () => this._downloadCSV(), width: "full" }, isPdf ? this._translations.downloadPDF : this._translations.downloadCSV)))));
|
|
361
|
+
return (h("calcite-panel", null, h("div", null, h("div", { class: "padding-top-sides-1" }, h("calcite-label", { class: "font-bold" }, isPdf ? this._translations.pdfDownloads : this._translations.csvDownloads), h("calcite-label", null, this._translations.notifications)), this._getSelectionLists(), h("div", { class: "margin-side-1 padding-top-1 border-bottom" }), h("div", { class: "padding-top-sides-1" }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { disabled: !this._downloadActive, ref: (el) => { this._removeDuplicates = el; } }), this._translations.removeDuplicate)), h("div", { class: isPdf ? "" : "display-none" }, this._getLabel(this._translations.selectPDFLabelOption, false), h("div", { class: "padding-sides-1" }, h("pdf-download", { disabled: !this._downloadActive, layerView: this.addresseeLayer, ref: (el) => { this._downloadTools = el; } }))), h("div", { class: "padding-1 display-flex" }, h("calcite-button", { disabled: !this._downloadActive, onClick: isPdf ? () => this._downloadPDF() : () => this._downloadCSV(), width: "full" }, isPdf ? this._translations.downloadPDF : this._translations.downloadCSV)))));
|
|
351
362
|
}
|
|
352
363
|
/**
|
|
353
364
|
* Create the stacked navigation buttons for a page
|
|
@@ -812,26 +823,6 @@ export class PublicNotification {
|
|
|
812
823
|
"attribute": "default-buffer-unit",
|
|
813
824
|
"reflect": false
|
|
814
825
|
},
|
|
815
|
-
"exportOptions": {
|
|
816
|
-
"type": "unknown",
|
|
817
|
-
"mutable": false,
|
|
818
|
-
"complexType": {
|
|
819
|
-
"original": "IExportOptions",
|
|
820
|
-
"resolved": "IExportOptions",
|
|
821
|
-
"references": {
|
|
822
|
-
"IExportOptions": {
|
|
823
|
-
"location": "import",
|
|
824
|
-
"path": "../../utils/interfaces"
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
},
|
|
828
|
-
"required": false,
|
|
829
|
-
"optional": false,
|
|
830
|
-
"docs": {
|
|
831
|
-
"tags": [],
|
|
832
|
-
"text": "IExportOptions: Set of options that control export capabilities\r\n If not provided all export capabilities will be enabled."
|
|
833
|
-
}
|
|
834
|
-
},
|
|
835
826
|
"featureEffect": {
|
|
836
827
|
"type": "unknown",
|
|
837
828
|
"mutable": false,
|
|
@@ -1008,6 +999,26 @@ export class PublicNotification {
|
|
|
1008
999
|
"resolved": "string",
|
|
1009
1000
|
"references": {}
|
|
1010
1001
|
}
|
|
1002
|
+
}, {
|
|
1003
|
+
"method": "searchConfigurationChange",
|
|
1004
|
+
"name": "searchConfigurationChange",
|
|
1005
|
+
"bubbles": true,
|
|
1006
|
+
"cancelable": true,
|
|
1007
|
+
"composed": true,
|
|
1008
|
+
"docs": {
|
|
1009
|
+
"tags": [],
|
|
1010
|
+
"text": "Emitted on demand when searchConfiguration gets a new value"
|
|
1011
|
+
},
|
|
1012
|
+
"complexType": {
|
|
1013
|
+
"original": "ISearchConfiguration",
|
|
1014
|
+
"resolved": "ISearchConfiguration",
|
|
1015
|
+
"references": {
|
|
1016
|
+
"ISearchConfiguration": {
|
|
1017
|
+
"location": "import",
|
|
1018
|
+
"path": "../../utils/interfaces"
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1011
1022
|
}];
|
|
1012
1023
|
}
|
|
1013
1024
|
static get elementRef() { return "el"; }
|
|
@@ -1015,6 +1026,9 @@ export class PublicNotification {
|
|
|
1015
1026
|
return [{
|
|
1016
1027
|
"propName": "mapView",
|
|
1017
1028
|
"methodName": "mapViewWatchHandler"
|
|
1029
|
+
}, {
|
|
1030
|
+
"propName": "searchConfiguration",
|
|
1031
|
+
"methodName": "watchSearchConfigurationHandler"
|
|
1018
1032
|
}, {
|
|
1019
1033
|
"propName": "_selectionSets",
|
|
1020
1034
|
"methodName": "selectionSetsWatchHandler"
|
|
@@ -41,6 +41,19 @@ export class RefineSelection {
|
|
|
41
41
|
this.SketchViewModel = undefined;
|
|
42
42
|
this._translations = undefined;
|
|
43
43
|
}
|
|
44
|
+
//--------------------------------------------------------------------------
|
|
45
|
+
//
|
|
46
|
+
// Watch handlers
|
|
47
|
+
//
|
|
48
|
+
//--------------------------------------------------------------------------
|
|
49
|
+
/**
|
|
50
|
+
* Called each time the addresseeLayer is changed.
|
|
51
|
+
* Add a new clean refine set for the new addressee layer.
|
|
52
|
+
*/
|
|
53
|
+
addresseeLayerWatchHandler() {
|
|
54
|
+
const selectionSets = this.selectionSets.filter(ss => ss.workflowType !== EWorkflowType.REFINE);
|
|
55
|
+
this.selectionSets = this._initRefineSelectionSet(selectionSets);
|
|
56
|
+
}
|
|
44
57
|
/**
|
|
45
58
|
* Handles changes to refine selection ids.
|
|
46
59
|
*
|
|
@@ -62,12 +75,16 @@ export class RefineSelection {
|
|
|
62
75
|
*/
|
|
63
76
|
async componentWillLoad() {
|
|
64
77
|
await this._getTranslations();
|
|
78
|
+
const refineSet = this._getRefineSelectionSet(this.selectionSets);
|
|
79
|
+
if (!refineSet) {
|
|
80
|
+
this.selectionSets = this._initRefineSelectionSet(this.selectionSets);
|
|
81
|
+
}
|
|
65
82
|
}
|
|
66
83
|
/**
|
|
67
84
|
* Renders the component.
|
|
68
85
|
*/
|
|
69
86
|
render() {
|
|
70
|
-
return (h(Host, null, h("div", { class: "padding-1" }, h("div", null, h("calcite-radio-group", { class: "w-100", onCalciteRadioGroupChange: (evt) => this._modeChanged(evt) }, h("calcite-radio-group-item", { checked: this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.ADD), value: ESelectionMode.ADD }, this._translations.add), h("calcite-radio-group-item", { checked: !this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.REMOVE), value: ESelectionMode.REMOVE }, this._translations.remove)), h("refine-selection-tools", { border: true, enabledLayerIds: this.enabledLayerIds, ids: utils.getSelectionIds(this.selectionSets), layerViews: [this.addresseeLayer], mapView: this.mapView, mode: this._addEnabled ? ESelectionMode.ADD : ESelectionMode.REMOVE, ref: (el) => { this._refineTools = el; }, refineMode: ERefineMode.ALL, useLayerPicker: false })), h("br", null), (h("calcite-list", { class: "list-border" }, this._getRefineSelectionSetList())))));
|
|
87
|
+
return (h(Host, null, h("div", { class: "padding-1" }, h("div", null, h("calcite-radio-group", { class: "w-100", onCalciteRadioGroupChange: (evt) => this._modeChanged(evt) }, h("calcite-radio-group-item", { checked: this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.ADD), value: ESelectionMode.ADD }, this._translations.add), h("calcite-radio-group-item", { checked: !this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.REMOVE), value: ESelectionMode.REMOVE }, this._translations.remove)), h("refine-selection-tools", { border: true, enabledLayerIds: this.enabledLayerIds, ids: utils.getSelectionIds(this.selectionSets), layerViews: [this.addresseeLayer], mapView: this.mapView, mode: this._addEnabled ? ESelectionMode.ADD : ESelectionMode.REMOVE, ref: (el) => { this._refineTools = el; }, refineMode: ERefineMode.ALL, refineSelectionSet: this._getRefineSelectionSet(this.selectionSets), useLayerPicker: false })), h("br", null), (h("calcite-list", { class: "list-border" }, this._getRefineSelectionSetList())))));
|
|
71
88
|
}
|
|
72
89
|
//--------------------------------------------------------------------------
|
|
73
90
|
//
|
|
@@ -133,7 +150,7 @@ export class RefineSelection {
|
|
|
133
150
|
if (removeIds.length > 0) {
|
|
134
151
|
this.selectionSets = this.selectionSets.reduce((prev, cur) => {
|
|
135
152
|
cur.selectedIds = cur.selectedIds.filter(id => removeIds.indexOf(id) < 0);
|
|
136
|
-
if (cur.selectedIds.length > 0) {
|
|
153
|
+
if (cur.selectedIds.length > 0 || cur.workflowType === EWorkflowType.REFINE) {
|
|
137
154
|
prev.push(cur);
|
|
138
155
|
}
|
|
139
156
|
return prev;
|
|
@@ -152,9 +169,7 @@ export class RefineSelection {
|
|
|
152
169
|
*/
|
|
153
170
|
_updateRefineSelectionSet(addIds, removeIds) {
|
|
154
171
|
const selectionSet = this._getRefineSelectionSet(this.selectionSets);
|
|
155
|
-
this.
|
|
156
|
-
this._updateRefineIds(selectionSet, addIds, removeIds) :
|
|
157
|
-
this._addRefineSelectionSet(addIds, removeIds);
|
|
172
|
+
this._updateRefineIds(selectionSet, addIds, removeIds);
|
|
158
173
|
this.selectionSetsChanged.emit(this.selectionSets);
|
|
159
174
|
}
|
|
160
175
|
/**
|
|
@@ -187,15 +202,12 @@ export class RefineSelection {
|
|
|
187
202
|
/**
|
|
188
203
|
* Add a new refine selection set
|
|
189
204
|
*
|
|
190
|
-
* @param addIds any ids to add
|
|
191
|
-
* @param removeIds any ids to remove
|
|
192
|
-
*
|
|
193
205
|
* @returns updated selection sets
|
|
194
206
|
* @protected
|
|
195
207
|
*/
|
|
196
|
-
|
|
208
|
+
_initRefineSelectionSet(selectionSets) {
|
|
197
209
|
return [
|
|
198
|
-
...
|
|
210
|
+
...selectionSets,
|
|
199
211
|
({
|
|
200
212
|
buffer: undefined,
|
|
201
213
|
distance: 0,
|
|
@@ -206,13 +218,15 @@ export class RefineSelection {
|
|
|
206
218
|
layerView: this.addresseeLayer,
|
|
207
219
|
refineSelectLayers: [],
|
|
208
220
|
searchResult: undefined,
|
|
209
|
-
selectedIds:
|
|
221
|
+
selectedIds: [],
|
|
210
222
|
unit: "feet",
|
|
211
223
|
workflowType: EWorkflowType.REFINE,
|
|
212
224
|
refineIds: {
|
|
213
|
-
addIds:
|
|
214
|
-
removeIds:
|
|
215
|
-
}
|
|
225
|
+
addIds: [],
|
|
226
|
+
removeIds: []
|
|
227
|
+
},
|
|
228
|
+
redoStack: [],
|
|
229
|
+
undoStack: []
|
|
216
230
|
})
|
|
217
231
|
];
|
|
218
232
|
}
|
|
@@ -405,6 +419,12 @@ export class RefineSelection {
|
|
|
405
419
|
}];
|
|
406
420
|
}
|
|
407
421
|
static get elementRef() { return "el"; }
|
|
422
|
+
static get watchers() {
|
|
423
|
+
return [{
|
|
424
|
+
"propName": "addresseeLayer",
|
|
425
|
+
"methodName": "addresseeLayerWatchHandler"
|
|
426
|
+
}];
|
|
427
|
+
}
|
|
408
428
|
static get listeners() {
|
|
409
429
|
return [{
|
|
410
430
|
"name": "refineSelectionIdsChange",
|
|
@@ -31,14 +31,6 @@ export class RefineSelectionTools {
|
|
|
31
31
|
* {<layer id>: Graphic[]}: Collection of graphics returned from queries to the layer
|
|
32
32
|
*/
|
|
33
33
|
this._featuresCollection = {};
|
|
34
|
-
/**
|
|
35
|
-
* IRefineOperation[]: Array to maintain the possible redo operations
|
|
36
|
-
*/
|
|
37
|
-
this._redoStack = [];
|
|
38
|
-
/**
|
|
39
|
-
* IRefineOperation[]: Array to maintain the possible undo operations
|
|
40
|
-
*/
|
|
41
|
-
this._undoStack = [];
|
|
42
34
|
this.active = false;
|
|
43
35
|
this.border = false;
|
|
44
36
|
this.enabledLayerIds = [];
|
|
@@ -49,6 +41,7 @@ export class RefineSelectionTools {
|
|
|
49
41
|
this.mapView = undefined;
|
|
50
42
|
this.mode = undefined;
|
|
51
43
|
this.refineMode = undefined;
|
|
44
|
+
this.refineSelectionSet = undefined;
|
|
52
45
|
this.useLayerPicker = true;
|
|
53
46
|
this._selectEnabled = false;
|
|
54
47
|
this._selectionMode = undefined;
|
|
@@ -129,10 +122,11 @@ export class RefineSelectionTools {
|
|
|
129
122
|
* Renders the component.
|
|
130
123
|
*/
|
|
131
124
|
render() {
|
|
125
|
+
var _a, _b;
|
|
132
126
|
const showLayerPickerClass = this.useLayerPicker ? "div-visible" : "div-not-visible";
|
|
133
127
|
const drawClass = this.border ? " border" : "";
|
|
134
128
|
const showUndoRedo = this.refineMode === ERefineMode.ALL ? "div-visible" : "div-not-visible";
|
|
135
|
-
return (h(Host, null, h("div", null, h("map-layer-picker", { class: showLayerPickerClass, enabledLayerIds: this.enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, selectedLayerIds: this.layerViews.map(l => l.layer.id), selectionMode: "single" }), h("div", { class: "margin-top-1" + drawClass }, h("div", { class: "esri-sketch esri-widget" }, h("div", { class: "esri-sketch__panel" }, h("div", { class: "esri-sketch__tool-section esri-sketch__section" }, h("calcite-action", { disabled: !this._selectEnabled, icon: "
|
|
129
|
+
return (h(Host, null, h("div", null, h("map-layer-picker", { class: showLayerPickerClass, enabledLayerIds: this.enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, selectedLayerIds: this.layerViews.map(l => l.layer.id), selectionMode: "single" }), h("div", { class: "margin-top-1" + drawClass }, h("div", { class: "esri-sketch esri-widget" }, h("div", { class: "esri-sketch__panel" }, h("div", { class: "esri-sketch__tool-section esri-sketch__section" }, h("calcite-action", { disabled: !this._selectEnabled, icon: "pin", onClick: () => this._setSelectionMode(ESelectionType.POINT), scale: "s", text: this._translations.select }), h("calcite-action", { disabled: !this._selectEnabled, icon: "line", onClick: () => this._setSelectionMode(ESelectionType.LINE), scale: "s", text: this._translations.selectLine }), h("calcite-action", { disabled: !this._selectEnabled, icon: "polygon", onClick: () => this._setSelectionMode(ESelectionType.POLY), scale: "s", text: this._translations.selectPolygon }), h("calcite-action", { disabled: !this._selectEnabled, icon: "rectangle", onClick: () => this._setSelectionMode(ESelectionType.RECT), scale: "s", text: this._translations.selectRectangle })), h("div", { class: showUndoRedo + " esri-sketch__tool-section esri-sketch__section" }, h("calcite-action", { disabled: ((_a = this.refineSelectionSet) === null || _a === void 0 ? void 0 : _a.undoStack) ? this.refineSelectionSet.undoStack.length === 0 : true, icon: "undo", onClick: () => this._undo(), scale: "s", text: this._translations.undo }), h("calcite-action", { disabled: ((_b = this.refineSelectionSet) === null || _b === void 0 ? void 0 : _b.redoStack) ? this.refineSelectionSet.redoStack.length === 0 : true, icon: "redo", onClick: () => this._redo(), scale: "s", text: this._translations.redo }))))))));
|
|
136
130
|
}
|
|
137
131
|
//--------------------------------------------------------------------------
|
|
138
132
|
//
|
|
@@ -244,7 +238,7 @@ export class RefineSelectionTools {
|
|
|
244
238
|
return prev;
|
|
245
239
|
}, []);
|
|
246
240
|
}
|
|
247
|
-
this.refineSelectionGraphicsChange.emit(graphics);
|
|
241
|
+
this.refineSelectionGraphicsChange.emit({ graphics, useOIDs: false });
|
|
248
242
|
this._clear();
|
|
249
243
|
});
|
|
250
244
|
});
|
|
@@ -318,11 +312,14 @@ export class RefineSelectionTools {
|
|
|
318
312
|
});
|
|
319
313
|
});
|
|
320
314
|
if (this.refineMode === ERefineMode.SUBSET) {
|
|
321
|
-
this.refineSelectionGraphicsChange.emit(
|
|
315
|
+
this.refineSelectionGraphicsChange.emit({
|
|
316
|
+
graphics,
|
|
317
|
+
useOIDs: this.layerViews[0].layer.title === this.layerView.layer.title
|
|
318
|
+
});
|
|
322
319
|
}
|
|
323
320
|
else {
|
|
324
321
|
const oids = Array.isArray(graphics) ? graphics.map(g => { var _a; return g.attributes[(_a = g === null || g === void 0 ? void 0 : g.layer) === null || _a === void 0 ? void 0 : _a.objectIdField]; }) : [];
|
|
325
|
-
await this._updateIds(oids, this.mode, this.
|
|
322
|
+
await this._updateIds(oids, this.mode, this.refineSelectionSet.undoStack, this.mode);
|
|
326
323
|
}
|
|
327
324
|
this._clear();
|
|
328
325
|
});
|
|
@@ -365,12 +362,16 @@ export class RefineSelectionTools {
|
|
|
365
362
|
if (mode === ESelectionMode.ADD) {
|
|
366
363
|
idUpdates.addIds = oids.filter(id => this.ids.indexOf(id) < 0);
|
|
367
364
|
this.ids = [...this.ids, ...idUpdates.addIds];
|
|
368
|
-
|
|
365
|
+
if (idUpdates.addIds.length > 0) {
|
|
366
|
+
operationStack.push({ mode: operationMode, ids: idUpdates.addIds });
|
|
367
|
+
}
|
|
369
368
|
}
|
|
370
369
|
else {
|
|
371
370
|
idUpdates.removeIds = oids.filter(id => this.ids.indexOf(id) > -1);
|
|
372
371
|
this.ids = this.ids.filter(id => idUpdates.removeIds.indexOf(id) < 0);
|
|
373
|
-
|
|
372
|
+
if (idUpdates.removeIds.length > 0) {
|
|
373
|
+
operationStack.push({ mode: operationMode, ids: idUpdates.removeIds });
|
|
374
|
+
}
|
|
374
375
|
}
|
|
375
376
|
await this._highlightFeatures(this.ids).then(() => {
|
|
376
377
|
this.refineSelectionIdsChange.emit(idUpdates);
|
|
@@ -384,8 +385,8 @@ export class RefineSelectionTools {
|
|
|
384
385
|
* @protected
|
|
385
386
|
*/
|
|
386
387
|
_undo() {
|
|
387
|
-
const undoOp = this.
|
|
388
|
-
void this._updateIds(undoOp.ids, undoOp.mode === ESelectionMode.ADD ? ESelectionMode.REMOVE : ESelectionMode.ADD, this.
|
|
388
|
+
const undoOp = this.refineSelectionSet.undoStack.pop();
|
|
389
|
+
void this._updateIds(undoOp.ids, undoOp.mode === ESelectionMode.ADD ? ESelectionMode.REMOVE : ESelectionMode.ADD, this.refineSelectionSet.redoStack, undoOp.mode);
|
|
389
390
|
}
|
|
390
391
|
/**
|
|
391
392
|
* Redo the most current ADD or REMOVE operation
|
|
@@ -395,8 +396,8 @@ export class RefineSelectionTools {
|
|
|
395
396
|
* @protected
|
|
396
397
|
*/
|
|
397
398
|
_redo() {
|
|
398
|
-
const redoOp = this.
|
|
399
|
-
void this._updateIds(redoOp.ids, redoOp.mode, this.
|
|
399
|
+
const redoOp = this.refineSelectionSet.redoStack.pop();
|
|
400
|
+
void this._updateIds(redoOp.ids, redoOp.mode, this.refineSelectionSet.undoStack, redoOp.mode);
|
|
400
401
|
}
|
|
401
402
|
/**
|
|
402
403
|
* Fetches the component's translations
|
|
@@ -610,6 +611,26 @@ export class RefineSelectionTools {
|
|
|
610
611
|
"attribute": "refine-mode",
|
|
611
612
|
"reflect": false
|
|
612
613
|
},
|
|
614
|
+
"refineSelectionSet": {
|
|
615
|
+
"type": "unknown",
|
|
616
|
+
"mutable": true,
|
|
617
|
+
"complexType": {
|
|
618
|
+
"original": "ISelectionSet",
|
|
619
|
+
"resolved": "ISelectionSet",
|
|
620
|
+
"references": {
|
|
621
|
+
"ISelectionSet": {
|
|
622
|
+
"location": "import",
|
|
623
|
+
"path": "../../utils/interfaces"
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
"required": false,
|
|
628
|
+
"optional": false,
|
|
629
|
+
"docs": {
|
|
630
|
+
"tags": [],
|
|
631
|
+
"text": "utils/interfaces/ISelectionSet: Refine selection set"
|
|
632
|
+
}
|
|
633
|
+
},
|
|
613
634
|
"useLayerPicker": {
|
|
614
635
|
"type": "boolean",
|
|
615
636
|
"mutable": false,
|
|
@@ -649,9 +670,14 @@ export class RefineSelectionTools {
|
|
|
649
670
|
"text": "Emitted on demand when selection graphics change."
|
|
650
671
|
},
|
|
651
672
|
"complexType": {
|
|
652
|
-
"original": "
|
|
653
|
-
"resolved": "
|
|
654
|
-
"references": {
|
|
673
|
+
"original": "IRefineSelectionEvent",
|
|
674
|
+
"resolved": "IRefineSelectionEvent",
|
|
675
|
+
"references": {
|
|
676
|
+
"IRefineSelectionEvent": {
|
|
677
|
+
"location": "import",
|
|
678
|
+
"path": "../../utils/interfaces"
|
|
679
|
+
}
|
|
680
|
+
}
|
|
655
681
|
}
|
|
656
682
|
}, {
|
|
657
683
|
"method": "refineSelectionIdsChange",
|
|
@@ -93,16 +93,6 @@
|
|
|
93
93
|
//demo.addresseeLayerIds = ["18434515eb8-layer-12"];
|
|
94
94
|
//demo.defaultBufferDistance = 100;
|
|
95
95
|
//demo.defaultBufferUnit = "kilometers";
|
|
96
|
-
demo.exportOptions = {
|
|
97
|
-
csvOptions: {
|
|
98
|
-
enabled: true, // I question if this should be exposed
|
|
99
|
-
addColumnTitle: false
|
|
100
|
-
},
|
|
101
|
-
pdfOptions: {
|
|
102
|
-
enabled: true, // I question if this should be exposed
|
|
103
|
-
enabledSizeValues: [6,10,14,20]
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
96
|
demo.featureEffect = {
|
|
107
97
|
includedEffect: "invert(100%)",
|
|
108
98
|
excludedEffect: "blur(5px)"
|
|
@@ -111,7 +101,7 @@
|
|
|
111
101
|
demo.noResultText = "No results found";
|
|
112
102
|
//demo.selectionLayerIds = ["1843422bf6b-layer-7"];
|
|
113
103
|
demo.showSearchSettings = true;
|
|
114
|
-
demo.customLabelEnabled =
|
|
104
|
+
demo.customLabelEnabled = true;
|
|
115
105
|
// demo.bufferColor = [227, 0, 0, 0.8];
|
|
116
106
|
// demo.bufferOutlineColor = [0, 255, 0];
|
|
117
107
|
demo.showRefineSelection = true;
|
|
@@ -385,6 +385,14 @@ export interface ISelectionSet {
|
|
|
385
385
|
geometries: __esri.Geometry[];
|
|
386
386
|
refineSelectLayers: __esri.FeatureLayerView[];
|
|
387
387
|
refineIds: IRefineIds;
|
|
388
|
+
redoStack?: IRefineOperation[];
|
|
389
|
+
undoStack?: IRefineOperation[];
|
|
390
|
+
skipGeomQuery?: boolean;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export interface IRefineSelectionEvent {
|
|
394
|
+
graphics: __esri.Graphic[];
|
|
395
|
+
useOIDs: boolean;
|
|
388
396
|
}
|
|
389
397
|
|
|
390
398
|
export interface IRefineIds {
|
|
@@ -30,8 +30,10 @@ import { queryExtent } from "./queryUtils";
|
|
|
30
30
|
export async function getMapLayerHash(mapView) {
|
|
31
31
|
let layerHash = {};
|
|
32
32
|
await mapView.when(() => {
|
|
33
|
-
layerHash = mapView.map.
|
|
34
|
-
|
|
33
|
+
layerHash = mapView.map.allLayers.toArray().reduce((prev, cur) => {
|
|
34
|
+
if (cur.type === "feature") {
|
|
35
|
+
prev[cur.id] = cur.title;
|
|
36
|
+
}
|
|
35
37
|
return prev;
|
|
36
38
|
}, {});
|
|
37
39
|
});
|
|
@@ -48,9 +50,12 @@ export async function getMapLayerHash(mapView) {
|
|
|
48
50
|
export async function getMapLayerIds(mapView) {
|
|
49
51
|
let layerIds = [];
|
|
50
52
|
await mapView.when(() => {
|
|
51
|
-
layerIds = mapView.map.
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
layerIds = mapView.map.allLayers.toArray().reduce((prev, cur) => {
|
|
54
|
+
if (cur.type === "feature") {
|
|
55
|
+
prev.push(cur.id);
|
|
56
|
+
}
|
|
57
|
+
return prev;
|
|
58
|
+
}, []);
|
|
54
59
|
});
|
|
55
60
|
return layerIds;
|
|
56
61
|
}
|
|
@@ -79,7 +84,7 @@ export async function getMapLayerView(mapView, id) {
|
|
|
79
84
|
export async function getMapLayer(mapView, id) {
|
|
80
85
|
let layers = [];
|
|
81
86
|
await mapView.when(() => {
|
|
82
|
-
layers = mapView.map.
|
|
87
|
+
layers = mapView.map.allLayers.toArray().filter((l) => {
|
|
83
88
|
return l.id === id;
|
|
84
89
|
});
|
|
85
90
|
});
|
|
@@ -30,8 +30,10 @@ export async function getMapLayerHash(
|
|
|
30
30
|
): Promise<ILayerHash> {
|
|
31
31
|
let layerHash = {};
|
|
32
32
|
await mapView.when(() => {
|
|
33
|
-
layerHash = mapView.map.
|
|
34
|
-
|
|
33
|
+
layerHash = mapView.map.allLayers.toArray().reduce((prev, cur) => {
|
|
34
|
+
if (cur.type === "feature") {
|
|
35
|
+
prev[cur.id] = cur.title;
|
|
36
|
+
}
|
|
35
37
|
return prev;
|
|
36
38
|
}, {});
|
|
37
39
|
});
|
|
@@ -51,9 +53,12 @@ export async function getMapLayerIds(
|
|
|
51
53
|
): Promise<string[]> {
|
|
52
54
|
let layerIds = [];
|
|
53
55
|
await mapView.when(() => {
|
|
54
|
-
layerIds = mapView.map.
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
layerIds = mapView.map.allLayers.toArray().reduce((prev, cur) => {
|
|
57
|
+
if (cur.type === "feature") {
|
|
58
|
+
prev.push(cur.id);
|
|
59
|
+
}
|
|
60
|
+
return prev;
|
|
61
|
+
}, []);
|
|
57
62
|
});
|
|
58
63
|
return layerIds;
|
|
59
64
|
}
|
|
@@ -90,7 +95,7 @@ export async function getMapLayer(
|
|
|
90
95
|
): Promise<__esri.FeatureLayer> {
|
|
91
96
|
let layers = [];
|
|
92
97
|
await mapView.when(() => {
|
|
93
|
-
layers = mapView.map.
|
|
98
|
+
layers = mapView.map.allLayers.toArray().filter((l) => {
|
|
94
99
|
return l.id === id;
|
|
95
100
|
});
|
|
96
101
|
});
|
|
@@ -27,8 +27,8 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
27
27
|
this.appearance = "text";
|
|
28
28
|
this.distance = 0;
|
|
29
29
|
this.geometries = [];
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
30
|
+
this.max = undefined;
|
|
31
|
+
this.min = 0;
|
|
32
32
|
this.sliderTicks = 10;
|
|
33
33
|
this.unionResults = true;
|
|
34
34
|
this.unit = "meters";
|
|
@@ -113,16 +113,19 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
113
113
|
* @protected
|
|
114
114
|
*/
|
|
115
115
|
_setDistance(event) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
const v = parseInt(event.detail.value, 10);
|
|
117
|
+
if (this.distance !== v && v >= this.min) {
|
|
118
|
+
this.distanceChanged.emit({
|
|
119
|
+
oldValue: this.distance,
|
|
120
|
+
newValue: event.detail.value
|
|
121
|
+
});
|
|
122
|
+
this.distance = v;
|
|
123
|
+
if (this.distance > 0) {
|
|
124
|
+
this._buffer();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this.bufferComplete.emit(undefined);
|
|
128
|
+
}
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
131
|
/**
|
|
@@ -165,7 +168,7 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
165
168
|
* @protected
|
|
166
169
|
*/
|
|
167
170
|
_getTextBoxDisplay() {
|
|
168
|
-
return (h("div", { class: "c-container" }, h("calcite-input", { class: "padding-end-1", "number-button-type": "vertical", onCalciteInputInput: (evt) => this._setDistance(evt), placeholder: "0", type: "number", value: this.distance ? this.distance.toString() : undefined }), h("calcite-select", { class: "flex-1", label: "label", onCalciteSelectChange: () => this._setUnit(this._unitElement.value), ref: (el) => { this._unitElement = el; } }, this._getUnits())));
|
|
171
|
+
return (h("div", { class: "c-container" }, h("calcite-input", { class: "padding-end-1", max: this.max && this.max > 0 ? this.max : undefined, min: this.min, "number-button-type": "vertical", onCalciteInputInput: (evt) => this._setDistance(evt), placeholder: "0", type: "number", value: this.distance ? this.distance.toString() : undefined }), h("calcite-select", { class: "flex-1", label: "label", onCalciteSelectChange: () => this._setUnit(this._unitElement.value), ref: (el) => { this._unitElement = el; } }, this._getUnits())));
|
|
169
172
|
}
|
|
170
173
|
/**
|
|
171
174
|
* Render distance control as a slider
|
|
@@ -176,7 +179,7 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
176
179
|
* @protected
|
|
177
180
|
*/
|
|
178
181
|
_getSliderDisplay() {
|
|
179
|
-
return (h("div", null, h("calcite-slider", { labelHandles: true, max: this.
|
|
182
|
+
return (h("div", null, h("calcite-slider", { labelHandles: true, max: this.max && this.max > 0 ? this.max : undefined, min: this.min, ticks: this.sliderTicks })));
|
|
180
183
|
}
|
|
181
184
|
/**
|
|
182
185
|
* Fetches the component's translations
|
|
@@ -212,8 +215,8 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
212
215
|
"appearance": [1025],
|
|
213
216
|
"distance": [1026],
|
|
214
217
|
"geometries": [1040],
|
|
215
|
-
"
|
|
216
|
-
"
|
|
218
|
+
"max": [1026],
|
|
219
|
+
"min": [1026],
|
|
217
220
|
"sliderTicks": [1026, "slider-ticks"],
|
|
218
221
|
"unionResults": [1028, "union-results"],
|
|
219
222
|
"unit": [1025],
|