@esri/solutions-components 0.5.8 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/buffer-tools/resources_ar.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_bg.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_bs.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_ca.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_cs.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_da.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_de.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_el.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_es.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_et.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_fi.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_fr.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_he.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_hr.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_hu.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_id.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_it.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_ja.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_ko.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_lt.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_lv.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_nb.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_nl.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_pl.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_pt-BR.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_pt-PT.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_ro.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_ru.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_sk.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_sl.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_sr.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_sv.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_th.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_tr.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_uk.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_vi.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_zh-CN.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_zh-HK.json +4 -4
- package/dist/assets/t9n/buffer-tools/resources_zh-TW.json +4 -4
- package/dist/assets/t9n/map-draw-tools/resources_ar.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_bg.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_bs.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_ca.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_cs.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_da.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_de.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_el.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_es.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_et.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_fi.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_fr.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_he.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_hr.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_hu.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_id.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_it.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_ja.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_ko.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_lt.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_lv.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_nb.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_nl.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_pl.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_pt-BR.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_pt-PT.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_ro.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_ru.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_sk.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_sl.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_sr.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_sv.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_th.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_tr.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_uk.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_vi.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_zh-CN.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_zh-HK.json +3 -3
- package/dist/assets/t9n/map-draw-tools/resources_zh-TW.json +3 -3
- package/dist/assets/t9n/map-select-tools/resources_ar.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_bg.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_bs.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_ca.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_cs.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_da.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_de.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_el.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_es.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_et.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_fi.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_fr.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_he.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_hr.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_hu.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_id.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_it.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_ja.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_ko.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_lt.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_lv.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_nb.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_nl.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_pl.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_pt-BR.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_pt-PT.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_ro.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_ru.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_sk.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_sl.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_sr.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_sv.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_th.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_tr.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_uk.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_vi.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_zh-CN.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_zh-HK.json +13 -11
- package/dist/assets/t9n/map-select-tools/resources_zh-TW.json +13 -11
- package/dist/assets/t9n/pdf-download/resources_ar.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_bg.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_bs.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_ca.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_cs.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_da.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_de.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_el.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_es.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_et.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_fi.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_fr.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_he.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_hr.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_hu.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_id.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_it.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_ja.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_ko.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_lt.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_lv.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_nb.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_nl.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_pl.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_pt-BR.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_pt-PT.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_ro.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_ru.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_sk.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_sl.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_sr.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_sv.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_th.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_tr.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_uk.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_vi.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_zh-CN.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_zh-HK.json +1 -1
- package/dist/assets/t9n/pdf-download/resources_zh-TW.json +1 -1
- package/dist/assets/t9n/public-notification/resources.json +11 -9
- package/dist/assets/t9n/public-notification/resources_ar.json +40 -38
- package/dist/assets/t9n/public-notification/resources_bg.json +40 -38
- package/dist/assets/t9n/public-notification/resources_bs.json +40 -38
- package/dist/assets/t9n/public-notification/resources_ca.json +40 -38
- package/dist/assets/t9n/public-notification/resources_cs.json +40 -38
- package/dist/assets/t9n/public-notification/resources_da.json +40 -38
- package/dist/assets/t9n/public-notification/resources_de.json +40 -38
- package/dist/assets/t9n/public-notification/resources_el.json +40 -38
- package/dist/assets/t9n/public-notification/resources_en.json +11 -9
- package/dist/assets/t9n/public-notification/resources_es.json +40 -38
- package/dist/assets/t9n/public-notification/resources_et.json +40 -38
- package/dist/assets/t9n/public-notification/resources_fi.json +40 -38
- package/dist/assets/t9n/public-notification/resources_fr.json +40 -38
- package/dist/assets/t9n/public-notification/resources_he.json +40 -38
- package/dist/assets/t9n/public-notification/resources_hr.json +40 -38
- package/dist/assets/t9n/public-notification/resources_hu.json +40 -38
- package/dist/assets/t9n/public-notification/resources_id.json +40 -38
- package/dist/assets/t9n/public-notification/resources_it.json +40 -38
- package/dist/assets/t9n/public-notification/resources_ja.json +40 -38
- package/dist/assets/t9n/public-notification/resources_ko.json +40 -38
- package/dist/assets/t9n/public-notification/resources_lt.json +40 -38
- package/dist/assets/t9n/public-notification/resources_lv.json +40 -38
- package/dist/assets/t9n/public-notification/resources_nb.json +40 -38
- package/dist/assets/t9n/public-notification/resources_nl.json +40 -38
- package/dist/assets/t9n/public-notification/resources_pl.json +40 -38
- package/dist/assets/t9n/public-notification/resources_pt-BR.json +40 -38
- package/dist/assets/t9n/public-notification/resources_pt-PT.json +40 -38
- package/dist/assets/t9n/public-notification/resources_ro.json +40 -38
- package/dist/assets/t9n/public-notification/resources_ru.json +40 -38
- package/dist/assets/t9n/public-notification/resources_sk.json +40 -38
- package/dist/assets/t9n/public-notification/resources_sl.json +40 -38
- package/dist/assets/t9n/public-notification/resources_sr.json +40 -38
- package/dist/assets/t9n/public-notification/resources_sv.json +40 -38
- package/dist/assets/t9n/public-notification/resources_th.json +40 -38
- package/dist/assets/t9n/public-notification/resources_tr.json +40 -38
- package/dist/assets/t9n/public-notification/resources_uk.json +40 -38
- package/dist/assets/t9n/public-notification/resources_vi.json +40 -38
- package/dist/assets/t9n/public-notification/resources_zh-CN.json +40 -38
- package/dist/assets/t9n/public-notification/resources_zh-HK.json +40 -38
- package/dist/assets/t9n/public-notification/resources_zh-TW.json +40 -38
- package/dist/assets/t9n/refine-selection/resources.json +3 -1
- package/dist/assets/t9n/refine-selection/resources_en.json +3 -1
- package/dist/cjs/buffer-tools_4.cjs.entry.js +3 -3
- package/dist/cjs/calcite-input-text_5.cjs.entry.js +8 -13
- package/dist/cjs/{downloadUtils-8d66f03e.js → downloadUtils-7a0fd3c0.js} +77 -28
- package/dist/cjs/{index.es-4f5dfcc6.js → index.es-9965b78c.js} +1 -1
- package/dist/cjs/layer-table_2.cjs.entry.js +8 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +56 -21
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/buffer-tools/buffer-tools.css +4 -0
- package/dist/collection/components/buffer-tools/buffer-tools.js +1 -1
- package/dist/collection/components/layer-table/layer-table.js +7 -2
- package/dist/collection/components/map-draw-tools/map-draw-tools.css +4 -0
- package/dist/collection/components/map-select-tools/map-select-tools.js +18 -1
- package/dist/collection/components/pdf-download/pdf-download.js +3 -9
- package/dist/collection/components/public-notification/public-notification.js +57 -21
- package/dist/collection/components/refine-selection/refine-selection.css +21 -0
- package/dist/collection/components/refine-selection/refine-selection.js +1 -1
- package/dist/collection/demos/new-public-notification.html +6 -4
- package/dist/collection/utils/downloadUtils.js +74 -27
- package/dist/collection/utils/downloadUtils.ts +93 -34
- package/dist/collection/utils/interfaces.ts +2 -2
- package/dist/components/buffer-tools2.js +2 -2
- package/dist/components/downloadUtils.js +75 -28
- package/dist/components/layer-table2.js +7 -2
- package/dist/components/map-draw-tools2.js +1 -1
- package/dist/components/map-select-tools2.js +3 -1
- package/dist/components/pdf-download2.js +3 -9
- package/dist/components/public-notification.js +57 -21
- package/dist/components/refine-selection2.js +36 -24
- package/dist/esm/buffer-tools_4.entry.js +3 -3
- package/dist/esm/calcite-combobox_3.entry.js +1 -1
- package/dist/esm/calcite-input-text_5.entry.js +9 -14
- package/dist/esm/{downloadUtils-b9785635.js → downloadUtils-a447bab1.js} +77 -30
- package/dist/esm/{index.es-70994c40.js → index.es-b9cb902a.js} +2 -2
- package/dist/esm/layer-table_2.entry.js +9 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mapViewUtils-ebbd4733.js → mapViewUtils-27dfdc29.js} +1 -1
- package/dist/esm/public-notification.entry.js +57 -22
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/new-public-notification.html +6 -4
- package/dist/solutions-components/p-2f4e1ddf.entry.js +6 -0
- package/dist/solutions-components/{p-be943993.js → p-345f517c.js} +5 -5
- package/dist/solutions-components/{p-390d7de8.js → p-4b426bab.js} +1 -1
- package/dist/solutions-components/{p-b4d4b50a.entry.js → p-52b747fa.entry.js} +3 -3
- package/dist/solutions-components/p-62492a2d.entry.js +17 -0
- package/dist/solutions-components/{p-5d5e10d4.js → p-80757ebd.js} +1 -1
- package/dist/solutions-components/p-cf00a2ef.entry.js +6 -0
- package/dist/solutions-components/{p-83e3db8e.entry.js → p-db099e05.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +93 -34
- package/dist/solutions-components/utils/interfaces.ts +2 -2
- package/dist/types/components/map-select-tools/map-select-tools.d.ts +5 -0
- package/dist/types/components/public-notification/public-notification.d.ts +18 -11
- package/dist/types/components.d.ts +8 -0
- package/dist/types/utils/downloadUtils.d.ts +22 -8
- package/dist/types/utils/interfaces.d.ts +2 -2
- package/package.json +1 -1
- package/dist/solutions-components/p-10336554.entry.js +0 -6
- package/dist/solutions-components/p-c3e3d0bb.entry.js +0 -17
- package/dist/solutions-components/p-f66a7ea7.entry.js +0 -6
- package/dist/solutions-components_commit.txt +0 -8
@@ -83,4 +83,25 @@ html[dir="rtl"] .main-label {
|
|
83
83
|
padding: 0 7px;
|
84
84
|
margin: 6px 0;
|
85
85
|
border-right: 1px solid rgba(110,110,110,.3);
|
86
|
+
}
|
87
|
+
|
88
|
+
.display-flex {
|
89
|
+
display: flex;
|
90
|
+
}
|
91
|
+
|
92
|
+
.font-bold {
|
93
|
+
font-weight: bold;
|
94
|
+
}
|
95
|
+
|
96
|
+
.width-full {
|
97
|
+
width: 100%;
|
98
|
+
}
|
99
|
+
|
100
|
+
.label-margin-0 {
|
101
|
+
--calcite-label-margin-bottom: 0;
|
102
|
+
}
|
103
|
+
|
104
|
+
.padding-start-1-2 {
|
105
|
+
-webkit-padding-start: 0.5rem;
|
106
|
+
padding-inline-start: 0.5rem;
|
86
107
|
}
|
@@ -77,7 +77,7 @@ export class RefineSelection {
|
|
77
77
|
render() {
|
78
78
|
var _a, _b;
|
79
79
|
const layerPickerClass = this._enabledLayerIds.length > 1 ? "display-block" : "display-none";
|
80
|
-
return (h(Host, null, h("div", { class: layerPickerClass + " padding-top-sides-1" }, h("map-layer-picker", { enabledLayerIds: this._enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, ref: (el) => { this._layerPicker = el; }, selectedLayerIds: [this._refineLayer.layer.id], selectionMode: "single" })), h("div", { class: "padding-1" }, h("div", { class: "padding-bottom-1" }, h("calcite-segmented-control", { class: "w-100" }, h("calcite-segmented-control-item", { checked: this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.ADD), value: ESelectionMode.ADD }, this._translations.add), h("calcite-segmented-control-item", { checked: !this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.REMOVE), value: ESelectionMode.REMOVE }, this._translations.remove))), h("div", null, h("map-draw-tools", { active: true, drawMode: EDrawMode.REFINE, mapView: this.mapView, onDrawRedo: () => this._redo(), onDrawUndo: () => this._undo(), onSketchGraphicsChange: (evt) => this._sketchGraphicsChanged(evt), pointSymbol: this.sketchPointSymbol, polygonSymbol: this.sketchPolygonSymbol, polylineSymbol: this.sketchLineSymbol, redoEnabled: ((_a = this._refineSelectionSet) === null || _a === void 0 ? void 0 : _a.redoStack.length) > 0, ref: (el) => { this._drawTools = el; }, undoEnabled: ((_b = this._refineSelectionSet) === null || _b === void 0 ? void 0 : _b.undoStack.length) > 0 })), h("br", null), (h("calcite-list", { class: "list-border" }, this._getRefineSelectionSetList())))));
|
80
|
+
return (h(Host, null, h("div", { class: layerPickerClass + " padding-top-sides-1" }, h("div", { class: "display-flex" }, h("calcite-label", { class: "font-bold width-full label-margin-0" }, h("div", { class: "display-flex" }, this._translations.inputLayer, h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "refine-input-layer", scale: "s" })), h("map-layer-picker", { enabledLayerIds: this._enabledLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, ref: (el) => { this._layerPicker = el; }, selectedLayerIds: [this._refineLayer.layer.id], selectionMode: "single" })), h("calcite-popover", { closable: true, label: "", referenceElement: "refine-input-layer" }, h("span", { class: "tooltip-message" }, this._translations.inputLayerTip)))), h("div", { class: "padding-1" }, h("div", { class: "padding-bottom-1" }, h("calcite-segmented-control", { class: "w-100" }, h("calcite-segmented-control-item", { checked: this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.ADD), value: ESelectionMode.ADD }, this._translations.add), h("calcite-segmented-control-item", { checked: !this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.REMOVE), value: ESelectionMode.REMOVE }, this._translations.remove))), h("div", null, h("map-draw-tools", { active: true, drawMode: EDrawMode.REFINE, mapView: this.mapView, onDrawRedo: () => this._redo(), onDrawUndo: () => this._undo(), onSketchGraphicsChange: (evt) => this._sketchGraphicsChanged(evt), pointSymbol: this.sketchPointSymbol, polygonSymbol: this.sketchPolygonSymbol, polylineSymbol: this.sketchLineSymbol, redoEnabled: ((_a = this._refineSelectionSet) === null || _a === void 0 ? void 0 : _a.redoStack.length) > 0, ref: (el) => { this._drawTools = el; }, undoEnabled: ((_b = this._refineSelectionSet) === null || _b === void 0 ? void 0 : _b.undoStack.length) > 0 })), h("br", null), (h("calcite-list", { class: "list-border" }, this._getRefineSelectionSetList())))));
|
81
81
|
}
|
82
82
|
//--------------------------------------------------------------------------
|
83
83
|
//
|
@@ -55,12 +55,12 @@
|
|
55
55
|
|
56
56
|
<link
|
57
57
|
rel="stylesheet"
|
58
|
-
href="https://js.arcgis.com/4.
|
58
|
+
href="https://js.arcgis.com/4.26/esri/themes/light/main.css"
|
59
59
|
/>
|
60
60
|
<link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
|
61
61
|
<link rel="stylesheet" href="../solutions-components.css" type="text/css">
|
62
62
|
|
63
|
-
<script src="https://js.arcgis.com/4.
|
63
|
+
<script src="https://js.arcgis.com/4.26/"></script>
|
64
64
|
<script type="module" src="../solutions-components.esm.js"></script>
|
65
65
|
|
66
66
|
<script>
|
@@ -90,7 +90,8 @@
|
|
90
90
|
});
|
91
91
|
demo.mapView.ui.add(legend, "top-left");
|
92
92
|
});
|
93
|
-
//
|
93
|
+
// solutions layer id
|
94
|
+
//demo.addresseeLayerIds = ["TaxParcels_3419"];
|
94
95
|
//demo.defaultBufferDistance = 100;
|
95
96
|
//demo.defaultBufferUnit = "kilometers";
|
96
97
|
demo.featureEffect = {
|
@@ -99,7 +100,8 @@
|
|
99
100
|
};
|
100
101
|
demo.featureHighlightEnabled = true;
|
101
102
|
demo.noResultText = "No results found";
|
102
|
-
//
|
103
|
+
// solutions layer id
|
104
|
+
//demo.selectionLayerIds = ["SiteAddresses_8878"];
|
103
105
|
demo.showSearchSettings = true;
|
104
106
|
demo.customLabelEnabled = true;
|
105
107
|
// demo.bufferColor = [227, 0, 0, 0.8];
|
@@ -30,39 +30,52 @@ const lineSeparatorChar = "|";
|
|
30
30
|
/**
|
31
31
|
* Downloads csv of mailing labels for the provided list of ids
|
32
32
|
*
|
33
|
-
* @param
|
34
|
-
* @param layer Layer providing features and attributes for download
|
35
|
-
* @param ids List of ids to download
|
33
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
36
34
|
* @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
|
37
35
|
* all attributes are exported
|
38
36
|
* @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
|
39
37
|
* @param addColumnTitle Indicates if column headings should be included in output
|
40
38
|
* @returns Promise resolving when function is done
|
41
39
|
*/
|
42
|
-
export async function downloadCSV(
|
43
|
-
|
44
|
-
|
40
|
+
export async function downloadCSV(exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false) {
|
41
|
+
let labels = await consolidateLabels(exportInfos, formatUsingLayerPopup, addColumnTitle, true);
|
42
|
+
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
43
|
+
const layerIds = Object.keys(exportInfos);
|
44
|
+
let layerLabels = [];
|
45
|
+
labels.forEach(label => {
|
46
|
+
const id = label[0];
|
47
|
+
// layerIds are stored as value separator at the end of the values for a given layer
|
48
|
+
if (layerIds.indexOf(id) < 0) {
|
49
|
+
layerLabels.push(label);
|
50
|
+
}
|
51
|
+
else {
|
52
|
+
const selectionSetNames = _getSelectionSetNames(exportInfos, new RegExp(`\\b${id}\\b`));
|
53
|
+
// once we see the layerId we have reached the end of it's values and should export
|
54
|
+
exportCSV(_createFilename(selectionSetNames), layerLabels);
|
55
|
+
layerLabels = [];
|
56
|
+
}
|
57
|
+
});
|
45
58
|
return Promise.resolve();
|
46
59
|
}
|
47
60
|
/**
|
48
61
|
* Downloads csv of mailing labels for the provided list of ids
|
49
62
|
*
|
50
|
-
* @param
|
51
|
-
* @param layer Layer providing features and attributes for download
|
52
|
-
* @param ids List of ids to download
|
63
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
53
64
|
* @param labelPageDescription Provides PDF page layout info
|
54
65
|
* @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
|
55
66
|
* @param title Title for each page
|
56
67
|
* @param initialImageDataUrl Data URL of image for first page
|
57
68
|
* @returns Promise resolving when function is done
|
58
69
|
*/
|
59
|
-
export async function downloadPDF(
|
60
|
-
let labels = await
|
70
|
+
export async function downloadPDF(exportInfos, labelPageDescription, removeDuplicates = false, title = "", initialImageDataUrl = "") {
|
71
|
+
let labels = await consolidateLabels(exportInfos);
|
72
|
+
const selectionSetNames = _getSelectionSetNames(exportInfos);
|
61
73
|
labels =
|
62
74
|
// Remove empty lines in labels
|
63
75
|
labels.map(labelLines => labelLines.filter(line => line.length > 0))
|
64
76
|
// Remove empty labels
|
65
77
|
.filter(label => label.length > 0);
|
78
|
+
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
66
79
|
exportPDF(_createFilename(selectionSetNames), labels, labelPageDescription, title, initialImageDataUrl);
|
67
80
|
return Promise.resolve();
|
68
81
|
}
|
@@ -281,13 +294,12 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
|
|
281
294
|
*
|
282
295
|
* @param layer Layer from which to fetch features
|
283
296
|
* @param ids List of ids to download
|
284
|
-
* @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
|
285
297
|
* @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
|
286
298
|
* all attributes are exported
|
287
299
|
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
288
300
|
* @returns Promise resolving when function is done
|
289
301
|
*/
|
290
|
-
async function _prepareLabels(layer, ids,
|
302
|
+
async function _prepareLabels(layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false) {
|
291
303
|
var _a, _b, _c, _d, _e, _f;
|
292
304
|
const [intl] = await loadModules(["esri/intl"]);
|
293
305
|
// Get the features to export
|
@@ -341,7 +353,6 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
|
|
341
353
|
let labels;
|
342
354
|
// eslint-disable-next-line unicorn/prefer-ternary
|
343
355
|
if (labelFormat) {
|
344
|
-
console.log("labelFormat", labelFormat); //???
|
345
356
|
const arcadeExpressionRegExp = /\{expression\/\w+\}/g;
|
346
357
|
const attributeRegExp = /\{\w+\}/g;
|
347
358
|
// Find the label fields that we need to replace with values
|
@@ -369,28 +380,21 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
|
|
369
380
|
});
|
370
381
|
// Wait for all of the queries for related records for this label
|
371
382
|
const relatedFeatureQueryResults = await Promise.all(relatedFeatureQueries);
|
372
|
-
console.log("relatedFeatureQueryResults", relatedFeatureQueryResults); //???
|
373
383
|
relatedFeatureQueryResults.forEach((relatedFeatureQueryResult, i) => {
|
374
384
|
// We have an object with FeatureSets grouped by source layer or table objectIds
|
375
385
|
const relationshipId = relationshipIds[i];
|
376
|
-
console.log("relationshipId", relationshipId); //???
|
377
|
-
console.log("relatedFeatureQueryResult", relatedFeatureQueryResult); //???
|
378
386
|
// Run through the source layer or table objectIds
|
379
387
|
Object.keys(relatedFeatureQueryResult).forEach(relatedFeatureSetId => {
|
380
|
-
console.log("relatedFeatureSetId", relatedFeatureSetId); //???
|
381
388
|
// We have a feature set
|
382
389
|
const relatedFeatures = relatedFeatureQueryResult[relatedFeatureSetId].features;
|
383
|
-
console.log("relatedFeatures", relatedFeatures); //???
|
384
390
|
// Get the values from each feature and replace them in the label
|
385
391
|
relatedFeatures.forEach(feature => {
|
386
392
|
// Merge the base and related feature attributes and create the label
|
387
393
|
// Prefix related feature's attributes with "relationships/<id>/" to match popup
|
388
394
|
const rePrefix = "\{relationships/" + relationshipId + "/";
|
389
395
|
const reSuffix = "\}";
|
390
|
-
console.log("/rePrefix + attributeName + reSuffix/g", rePrefix + "attributeName" + reSuffix); //???
|
391
396
|
const attributes = feature.attributes;
|
392
397
|
Object.keys(attributes).forEach(attributeName => {
|
393
|
-
console.log("/rePrefix + attributeName + reSuffix/g", rePrefix + attributeName + reSuffix); //???
|
394
398
|
// Replace the value using the attribute name as a relationship
|
395
399
|
const attributeRelationshipRegExp = new RegExp(rePrefix + attributeName + reSuffix, "g");
|
396
400
|
labelPrep = labelPrep.replaceAll(attributeRelationshipRegExp, attributes[attributeName]);
|
@@ -420,12 +424,6 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
|
|
420
424
|
});
|
421
425
|
});
|
422
426
|
}
|
423
|
-
// Remove duplicates
|
424
|
-
if (removeDuplicates) {
|
425
|
-
const labelsAsStrings = labels.map(label => JSON.stringify(label));
|
426
|
-
const uniqueLabels = new Set(labelsAsStrings);
|
427
|
-
labels = Array.from(uniqueLabels, labelString => JSON.parse(labelString));
|
428
|
-
}
|
429
427
|
// Add header names
|
430
428
|
if (includeHeaderNames) {
|
431
429
|
let headerNames = [];
|
@@ -442,4 +440,53 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
|
|
442
440
|
}
|
443
441
|
return Promise.resolve(labels);
|
444
442
|
}
|
443
|
+
/**
|
444
|
+
* Remove any duplicate labels
|
445
|
+
*
|
446
|
+
* @param labels Labels to evaluate for duplicates
|
447
|
+
* @returns labels with duplicates removed
|
448
|
+
*/
|
449
|
+
export function removeDuplicateLabels(labels) {
|
450
|
+
const labelsAsStrings = labels.map(label => JSON.stringify(label));
|
451
|
+
const uniqueLabels = new Set(labelsAsStrings);
|
452
|
+
return Array.from(uniqueLabels, labelString => JSON.parse(labelString));
|
453
|
+
}
|
454
|
+
/**
|
455
|
+
* Extract selectionSetNames from the provided exportInfos
|
456
|
+
*
|
457
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
458
|
+
* @returns selectionSetNames that will be used for export filenames
|
459
|
+
*/
|
460
|
+
function _getSelectionSetNames(exportInfos, id = /.+/) {
|
461
|
+
let selectionSetNames = [];
|
462
|
+
Object.keys(exportInfos).forEach(k => {
|
463
|
+
const exportInfo = exportInfos[k];
|
464
|
+
if (id.test(k)) {
|
465
|
+
selectionSetNames = selectionSetNames.concat(exportInfo.selectionSetNames);
|
466
|
+
}
|
467
|
+
});
|
468
|
+
return selectionSetNames;
|
469
|
+
}
|
470
|
+
/**
|
471
|
+
* Create and consolidate labels from all layers
|
472
|
+
*
|
473
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
474
|
+
* @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
|
475
|
+
* all attributes are exported
|
476
|
+
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
477
|
+
* @returns selectionSetNames that will be used for export filenames
|
478
|
+
*/
|
479
|
+
export async function consolidateLabels(exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false) {
|
480
|
+
const labelRequests = [];
|
481
|
+
Object.keys(exportInfos).forEach(k => {
|
482
|
+
const labelInfo = exportInfos[k];
|
483
|
+
labelRequests.push(_prepareLabels(labelInfo.layerView.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames));
|
484
|
+
if (isCSVExport) {
|
485
|
+
// add the layer id as a temp value separator that we can use to split values for CSV export
|
486
|
+
labelRequests.push(Promise.resolve([[k]]));
|
487
|
+
}
|
488
|
+
});
|
489
|
+
const labels = await Promise.all(labelRequests);
|
490
|
+
return labels.reduce((prev, cur) => prev.concat(cur), []);
|
491
|
+
}
|
445
492
|
//#endregion
|
@@ -20,6 +20,7 @@ import { exportCSV } from "./csvUtils";
|
|
20
20
|
import { ILabel, exportPDF } from "./pdfUtils";
|
21
21
|
import { loadModules } from "./loadModules";
|
22
22
|
import { queryFeaturesByID } from "./queryUtils";
|
23
|
+
import { IExportInfo, IExportInfos } from "../utils/interfaces";
|
23
24
|
|
24
25
|
export { ILabel } from "./pdfUtils";
|
25
26
|
|
@@ -70,9 +71,7 @@ const lineSeparatorChar = "|";
|
|
70
71
|
/**
|
71
72
|
* Downloads csv of mailing labels for the provided list of ids
|
72
73
|
*
|
73
|
-
* @param
|
74
|
-
* @param layer Layer providing features and attributes for download
|
75
|
-
* @param ids List of ids to download
|
74
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
76
75
|
* @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
|
77
76
|
* all attributes are exported
|
78
77
|
* @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
|
@@ -80,16 +79,30 @@ const lineSeparatorChar = "|";
|
|
80
79
|
* @returns Promise resolving when function is done
|
81
80
|
*/
|
82
81
|
export async function downloadCSV(
|
83
|
-
|
84
|
-
layer: __esri.FeatureLayer,
|
85
|
-
ids: number[],
|
82
|
+
exportInfos: IExportInfos,
|
86
83
|
formatUsingLayerPopup: boolean,
|
87
84
|
removeDuplicates = false,
|
88
85
|
addColumnTitle = false
|
89
86
|
): Promise<void> {
|
90
|
-
|
87
|
+
let labels = await consolidateLabels(exportInfos, formatUsingLayerPopup, addColumnTitle, true);
|
88
|
+
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
89
|
+
|
90
|
+
const layerIds = Object.keys(exportInfos);
|
91
|
+
|
92
|
+
let layerLabels = [];
|
93
|
+
labels.forEach(label => {
|
94
|
+
const id = label[0];
|
95
|
+
// layerIds are stored as value separator at the end of the values for a given layer
|
96
|
+
if (layerIds.indexOf(id) < 0) {
|
97
|
+
layerLabels.push(label);
|
98
|
+
} else {
|
99
|
+
const selectionSetNames = _getSelectionSetNames(exportInfos, new RegExp(`\\b${id}\\b`));
|
91
100
|
|
92
|
-
|
101
|
+
// once we see the layerId we have reached the end of it's values and should export
|
102
|
+
exportCSV(_createFilename(selectionSetNames), layerLabels);
|
103
|
+
layerLabels = [];
|
104
|
+
}
|
105
|
+
});
|
93
106
|
|
94
107
|
return Promise.resolve();
|
95
108
|
}
|
@@ -97,9 +110,7 @@ export async function downloadCSV(
|
|
97
110
|
/**
|
98
111
|
* Downloads csv of mailing labels for the provided list of ids
|
99
112
|
*
|
100
|
-
* @param
|
101
|
-
* @param layer Layer providing features and attributes for download
|
102
|
-
* @param ids List of ids to download
|
113
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
103
114
|
* @param labelPageDescription Provides PDF page layout info
|
104
115
|
* @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
|
105
116
|
* @param title Title for each page
|
@@ -107,15 +118,14 @@ export async function downloadCSV(
|
|
107
118
|
* @returns Promise resolving when function is done
|
108
119
|
*/
|
109
120
|
export async function downloadPDF(
|
110
|
-
|
111
|
-
layer: __esri.FeatureLayer,
|
112
|
-
ids: number[],
|
121
|
+
exportInfos: IExportInfos,
|
113
122
|
labelPageDescription: ILabel,
|
114
123
|
removeDuplicates = false,
|
115
124
|
title = "",
|
116
125
|
initialImageDataUrl = ""
|
117
126
|
): Promise<void> {
|
118
|
-
let labels = await
|
127
|
+
let labels = await consolidateLabels(exportInfos);
|
128
|
+
const selectionSetNames = _getSelectionSetNames(exportInfos);
|
119
129
|
|
120
130
|
labels =
|
121
131
|
// Remove empty lines in labels
|
@@ -123,6 +133,8 @@ export async function downloadPDF(
|
|
123
133
|
// Remove empty labels
|
124
134
|
.filter(label => label.length > 0);
|
125
135
|
|
136
|
+
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
137
|
+
|
126
138
|
exportPDF(_createFilename(selectionSetNames), labels, labelPageDescription, title, initialImageDataUrl);
|
127
139
|
|
128
140
|
return Promise.resolve();
|
@@ -395,7 +407,6 @@ function _prepareAttributeValue(
|
|
395
407
|
*
|
396
408
|
* @param layer Layer from which to fetch features
|
397
409
|
* @param ids List of ids to download
|
398
|
-
* @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
|
399
410
|
* @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
|
400
411
|
* all attributes are exported
|
401
412
|
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
@@ -404,7 +415,6 @@ function _prepareAttributeValue(
|
|
404
415
|
async function _prepareLabels(
|
405
416
|
layer: __esri.FeatureLayer,
|
406
417
|
ids: number[],
|
407
|
-
removeDuplicates = true,
|
408
418
|
formatUsingLayerPopup = true,
|
409
419
|
includeHeaderNames = false
|
410
420
|
): Promise<string[][]> {
|
@@ -471,7 +481,6 @@ async function _prepareLabels(
|
|
471
481
|
let labels: string[][];
|
472
482
|
// eslint-disable-next-line unicorn/prefer-ternary
|
473
483
|
if (labelFormat) {
|
474
|
-
console.log("labelFormat", labelFormat);//???
|
475
484
|
const arcadeExpressionRegExp = /\{expression\/\w+\}/g;
|
476
485
|
const attributeRegExp = /\{\w+\}/g;
|
477
486
|
|
@@ -512,21 +521,16 @@ async function _prepareLabels(
|
|
512
521
|
|
513
522
|
// Wait for all of the queries for related records for this label
|
514
523
|
const relatedFeatureQueryResults = await Promise.all(relatedFeatureQueries);
|
515
|
-
console.log("relatedFeatureQueryResults", relatedFeatureQueryResults);//???
|
516
524
|
relatedFeatureQueryResults.forEach(
|
517
525
|
(relatedFeatureQueryResult, i) => {
|
518
526
|
// We have an object with FeatureSets grouped by source layer or table objectIds
|
519
527
|
const relationshipId = relationshipIds[i];
|
520
|
-
console.log("relationshipId", relationshipId);//???
|
521
|
-
console.log("relatedFeatureQueryResult", relatedFeatureQueryResult);//???
|
522
528
|
|
523
529
|
// Run through the source layer or table objectIds
|
524
530
|
Object.keys(relatedFeatureQueryResult).forEach(
|
525
531
|
relatedFeatureSetId => {
|
526
|
-
console.log("relatedFeatureSetId", relatedFeatureSetId);//???
|
527
532
|
// We have a feature set
|
528
533
|
const relatedFeatures = relatedFeatureQueryResult[relatedFeatureSetId].features;
|
529
|
-
console.log("relatedFeatures", relatedFeatures);//???
|
530
534
|
|
531
535
|
// Get the values from each feature and replace them in the label
|
532
536
|
relatedFeatures.forEach(
|
@@ -535,12 +539,10 @@ async function _prepareLabels(
|
|
535
539
|
// Prefix related feature's attributes with "relationships/<id>/" to match popup
|
536
540
|
const rePrefix = "\{relationships/" + relationshipId + "/";
|
537
541
|
const reSuffix = "\}";
|
538
|
-
console.log("/rePrefix + attributeName + reSuffix/g", rePrefix + "attributeName" + reSuffix);//???
|
539
542
|
|
540
543
|
const attributes = feature.attributes;
|
541
544
|
Object.keys(attributes).forEach(
|
542
545
|
attributeName => {
|
543
|
-
console.log("/rePrefix + attributeName + reSuffix/g", rePrefix + attributeName + reSuffix);//???
|
544
546
|
// Replace the value using the attribute name as a relationship
|
545
547
|
const attributeRelationshipRegExp = new RegExp(rePrefix + attributeName + reSuffix, "g");
|
546
548
|
labelPrep = labelPrep.replaceAll(attributeRelationshipRegExp, attributes[attributeName]);
|
@@ -592,15 +594,6 @@ async function _prepareLabels(
|
|
592
594
|
);
|
593
595
|
}
|
594
596
|
|
595
|
-
// Remove duplicates
|
596
|
-
if (removeDuplicates) {
|
597
|
-
const labelsAsStrings: string[] = labels.map(label => JSON.stringify(label));
|
598
|
-
const uniqueLabels = new Set(labelsAsStrings);
|
599
|
-
labels = Array.from(uniqueLabels,
|
600
|
-
labelString => JSON.parse(labelString)
|
601
|
-
);
|
602
|
-
}
|
603
|
-
|
604
597
|
// Add header names
|
605
598
|
if (includeHeaderNames) {
|
606
599
|
let headerNames = [];
|
@@ -621,4 +614,70 @@ async function _prepareLabels(
|
|
621
614
|
return Promise.resolve(labels);
|
622
615
|
}
|
623
616
|
|
617
|
+
/**
|
618
|
+
* Remove any duplicate labels
|
619
|
+
*
|
620
|
+
* @param labels Labels to evaluate for duplicates
|
621
|
+
* @returns labels with duplicates removed
|
622
|
+
*/
|
623
|
+
export function removeDuplicateLabels(
|
624
|
+
labels: string[][]
|
625
|
+
): string[][] {
|
626
|
+
const labelsAsStrings: string[] = labels.map(label => JSON.stringify(label));
|
627
|
+
const uniqueLabels = new Set(labelsAsStrings);
|
628
|
+
return Array.from(uniqueLabels,
|
629
|
+
labelString => JSON.parse(labelString)
|
630
|
+
);
|
631
|
+
}
|
632
|
+
|
633
|
+
/**
|
634
|
+
* Extract selectionSetNames from the provided exportInfos
|
635
|
+
*
|
636
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
637
|
+
* @returns selectionSetNames that will be used for export filenames
|
638
|
+
*/
|
639
|
+
function _getSelectionSetNames(
|
640
|
+
exportInfos: IExportInfos,
|
641
|
+
id = /.+/
|
642
|
+
): string[] {
|
643
|
+
let selectionSetNames: string[] = [];
|
644
|
+
Object.keys(exportInfos).forEach(k => {
|
645
|
+
const exportInfo: IExportInfo = exportInfos[k];
|
646
|
+
if (id.test(k)) {
|
647
|
+
selectionSetNames = selectionSetNames.concat(exportInfo.selectionSetNames);
|
648
|
+
}
|
649
|
+
});
|
650
|
+
return selectionSetNames;
|
651
|
+
}
|
652
|
+
|
653
|
+
/**
|
654
|
+
* Create and consolidate labels from all layers
|
655
|
+
*
|
656
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
657
|
+
* @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
|
658
|
+
* all attributes are exported
|
659
|
+
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
660
|
+
* @returns selectionSetNames that will be used for export filenames
|
661
|
+
*/
|
662
|
+
export async function consolidateLabels(
|
663
|
+
exportInfos: IExportInfos,
|
664
|
+
formatUsingLayerPopup = true,
|
665
|
+
includeHeaderNames = false,
|
666
|
+
isCSVExport = false
|
667
|
+
): Promise<string[][]> {
|
668
|
+
const labelRequests = [];
|
669
|
+
|
670
|
+
Object.keys(exportInfos).forEach(k => {
|
671
|
+
const labelInfo: IExportInfo = exportInfos[k];
|
672
|
+
labelRequests.push(_prepareLabels(labelInfo.layerView.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames));
|
673
|
+
if (isCSVExport) {
|
674
|
+
// add the layer id as a temp value separator that we can use to split values for CSV export
|
675
|
+
labelRequests.push(Promise.resolve([[k]]));
|
676
|
+
}
|
677
|
+
});
|
678
|
+
|
679
|
+
const labels = await Promise.all(labelRequests);
|
680
|
+
return labels.reduce((prev, cur) => prev.concat(cur), []);
|
681
|
+
}
|
682
|
+
|
624
683
|
//#endregion
|
@@ -437,10 +437,10 @@ export interface IMapInfo {
|
|
437
437
|
}
|
438
438
|
|
439
439
|
export interface IExportInfos {
|
440
|
-
[key: string]:
|
440
|
+
[key: string]: IExportInfo;
|
441
441
|
}
|
442
442
|
|
443
|
-
export interface
|
443
|
+
export interface IExportInfo {
|
444
444
|
ids: number[],
|
445
445
|
layerView: __esri.FeatureLayerView
|
446
446
|
selectionSetNames: string[]
|
@@ -14,7 +14,7 @@ import { d as defineCustomElement$3 } from './progress.js';
|
|
14
14
|
import { d as defineCustomElement$2 } from './select.js';
|
15
15
|
import { d as defineCustomElement$1 } from './slider.js';
|
16
16
|
|
17
|
-
const bufferToolsCss = ":host{display:block}.c-container{display:inline-flex}.flex-1{flex:\"1\"}.padding-end-1{-webkit-padding-end:1rem;padding-inline-end:1rem}";
|
17
|
+
const bufferToolsCss = ":host{display:block}.c-container{display:inline-flex}.flex-1{flex:\"1\"}.padding-end-1{-webkit-padding-end:1rem;padding-inline-end:1rem}.w-50{width:50%}";
|
18
18
|
|
19
19
|
const BufferTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
20
20
|
constructor() {
|
@@ -175,7 +175,7 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
175
175
|
* @protected
|
176
176
|
*/
|
177
177
|
_getTextBoxDisplay() {
|
178
|
-
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())));
|
178
|
+
return (h("div", { class: "c-container" }, h("calcite-input", { class: "padding-end-1 w-50", 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 w-50", label: "label", onCalciteSelectChange: () => this._setUnit(this._unitElement.value), ref: (el) => { this._unitElement = el; } }, this._getUnits())));
|
179
179
|
}
|
180
180
|
/**
|
181
181
|
* Render distance control as a slider
|