@esri/solutions-components 0.5.9 → 0.5.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/data/images/onboarding.png +0 -0
- package/dist/assets/t9n/public-notification/resources.json +1 -1
- package/dist/assets/t9n/public-notification/resources_ar.json +5 -4
- package/dist/assets/t9n/public-notification/resources_bg.json +5 -4
- package/dist/assets/t9n/public-notification/resources_bs.json +5 -4
- package/dist/assets/t9n/public-notification/resources_ca.json +5 -4
- package/dist/assets/t9n/public-notification/resources_cs.json +5 -4
- package/dist/assets/t9n/public-notification/resources_da.json +5 -4
- package/dist/assets/t9n/public-notification/resources_de.json +5 -4
- package/dist/assets/t9n/public-notification/resources_el.json +5 -4
- package/dist/assets/t9n/public-notification/resources_en.json +1 -1
- package/dist/assets/t9n/public-notification/resources_es.json +5 -4
- package/dist/assets/t9n/public-notification/resources_et.json +5 -4
- package/dist/assets/t9n/public-notification/resources_fi.json +5 -4
- package/dist/assets/t9n/public-notification/resources_fr.json +5 -4
- package/dist/assets/t9n/public-notification/resources_he.json +5 -4
- package/dist/assets/t9n/public-notification/resources_hr.json +5 -4
- package/dist/assets/t9n/public-notification/resources_hu.json +5 -4
- package/dist/assets/t9n/public-notification/resources_id.json +5 -4
- package/dist/assets/t9n/public-notification/resources_it.json +5 -4
- package/dist/assets/t9n/public-notification/resources_ja.json +5 -4
- package/dist/assets/t9n/public-notification/resources_ko.json +5 -4
- package/dist/assets/t9n/public-notification/resources_lt.json +5 -4
- package/dist/assets/t9n/public-notification/resources_lv.json +5 -4
- package/dist/assets/t9n/public-notification/resources_nb.json +5 -4
- package/dist/assets/t9n/public-notification/resources_nl.json +5 -4
- package/dist/assets/t9n/public-notification/resources_pl.json +5 -4
- package/dist/assets/t9n/public-notification/resources_pt-BR.json +5 -4
- package/dist/assets/t9n/public-notification/resources_pt-PT.json +5 -4
- package/dist/assets/t9n/public-notification/resources_ro.json +5 -4
- package/dist/assets/t9n/public-notification/resources_ru.json +5 -4
- package/dist/assets/t9n/public-notification/resources_sk.json +5 -4
- package/dist/assets/t9n/public-notification/resources_sl.json +5 -4
- package/dist/assets/t9n/public-notification/resources_sr.json +5 -4
- package/dist/assets/t9n/public-notification/resources_sv.json +5 -4
- package/dist/assets/t9n/public-notification/resources_th.json +5 -4
- package/dist/assets/t9n/public-notification/resources_tr.json +5 -4
- package/dist/assets/t9n/public-notification/resources_uk.json +5 -4
- package/dist/assets/t9n/public-notification/resources_vi.json +5 -4
- package/dist/assets/t9n/public-notification/resources_zh-CN.json +5 -4
- package/dist/assets/t9n/public-notification/resources_zh-HK.json +5 -4
- package/dist/assets/t9n/public-notification/resources_zh-TW.json +5 -4
- package/dist/cjs/buffer-tools_4.cjs.entry.js +18 -4
- package/dist/cjs/calcite-input-text_5.cjs.entry.js +6 -11
- package/dist/cjs/{downloadUtils-4ef4b28b.js → downloadUtils-7a0fd3c0.js} +77 -20
- package/dist/cjs/{index.es-cbe67d5b.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 +72 -23
- 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-draw-tools/map-draw-tools.js +15 -1
- 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.css +210 -203
- package/dist/collection/components/public-notification/public-notification.js +73 -22
- package/dist/collection/demos/new-public-notification.html +6 -4
- package/dist/collection/utils/downloadUtils.js +74 -19
- package/dist/collection/utils/downloadUtils.ts +93 -26
- package/dist/collection/utils/interfaces.ts +2 -2
- package/dist/components/buffer-tools2.js +2 -2
- package/dist/components/downloadUtils.js +75 -20
- package/dist/components/layer-table2.js +7 -2
- package/dist/components/map-draw-tools2.js +16 -2
- package/dist/components/map-select-tools2.js +3 -1
- package/dist/components/pdf-download2.js +3 -9
- package/dist/components/public-notification.js +74 -24
- package/dist/esm/buffer-tools_4.entry.js +18 -4
- package/dist/esm/calcite-combobox_3.entry.js +1 -1
- package/dist/esm/calcite-input-text_5.entry.js +7 -12
- package/dist/esm/{downloadUtils-2ebeb46d.js → downloadUtils-a447bab1.js} +77 -22
- package/dist/esm/{index.es-6dd27a48.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 +74 -25
- 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-657caece.js → p-345f517c.js} +5 -5
- package/dist/solutions-components/{p-390d7de8.js → p-4b426bab.js} +1 -1
- package/dist/solutions-components/p-62492a2d.entry.js +17 -0
- package/dist/solutions-components/{p-ad82c173.js → p-80757ebd.js} +1 -1
- package/dist/solutions-components/{p-83e3db8e.entry.js → p-db099e05.entry.js} +1 -1
- package/dist/solutions-components/p-f3fbc327.entry.js +6 -0
- package/dist/solutions-components/{p-b4d4b50a.entry.js → p-f516f183.entry.js} +3 -3
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +93 -26
- package/dist/solutions-components/utils/interfaces.ts +2 -2
- package/dist/types/components/map-draw-tools/map-draw-tools.d.ts +6 -0
- package/dist/types/components/map-select-tools/map-select-tools.d.ts +5 -0
- package/dist/types/components/public-notification/public-notification.d.ts +29 -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 +2 -2
- package/dist/solutions-components/p-6f27bea2.entry.js +0 -17
- package/dist/solutions-components/p-db82a9ce.entry.js +0 -6
- package/dist/solutions-components/p-deb90ce7.entry.js +0 -6
@@ -2261,39 +2261,52 @@ const lineSeparatorChar = "|";
|
|
2261
2261
|
/**
|
2262
2262
|
* Downloads csv of mailing labels for the provided list of ids
|
2263
2263
|
*
|
2264
|
-
* @param
|
2265
|
-
* @param layer Layer providing features and attributes for download
|
2266
|
-
* @param ids List of ids to download
|
2264
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
2267
2265
|
* @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
|
2268
2266
|
* all attributes are exported
|
2269
2267
|
* @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
|
2270
2268
|
* @param addColumnTitle Indicates if column headings should be included in output
|
2271
2269
|
* @returns Promise resolving when function is done
|
2272
2270
|
*/
|
2273
|
-
async function downloadCSV(
|
2274
|
-
|
2275
|
-
|
2271
|
+
async function downloadCSV(exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false) {
|
2272
|
+
let labels = await consolidateLabels(exportInfos, formatUsingLayerPopup, addColumnTitle, true);
|
2273
|
+
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
2274
|
+
const layerIds = Object.keys(exportInfos);
|
2275
|
+
let layerLabels = [];
|
2276
|
+
labels.forEach(label => {
|
2277
|
+
const id = label[0];
|
2278
|
+
// layerIds are stored as value separator at the end of the values for a given layer
|
2279
|
+
if (layerIds.indexOf(id) < 0) {
|
2280
|
+
layerLabels.push(label);
|
2281
|
+
}
|
2282
|
+
else {
|
2283
|
+
const selectionSetNames = _getSelectionSetNames(exportInfos, new RegExp(`\\b${id}\\b`));
|
2284
|
+
// once we see the layerId we have reached the end of it's values and should export
|
2285
|
+
exportCSV(_createFilename(selectionSetNames), layerLabels);
|
2286
|
+
layerLabels = [];
|
2287
|
+
}
|
2288
|
+
});
|
2276
2289
|
return Promise.resolve();
|
2277
2290
|
}
|
2278
2291
|
/**
|
2279
2292
|
* Downloads csv of mailing labels for the provided list of ids
|
2280
2293
|
*
|
2281
|
-
* @param
|
2282
|
-
* @param layer Layer providing features and attributes for download
|
2283
|
-
* @param ids List of ids to download
|
2294
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
2284
2295
|
* @param labelPageDescription Provides PDF page layout info
|
2285
2296
|
* @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
|
2286
2297
|
* @param title Title for each page
|
2287
2298
|
* @param initialImageDataUrl Data URL of image for first page
|
2288
2299
|
* @returns Promise resolving when function is done
|
2289
2300
|
*/
|
2290
|
-
async function downloadPDF(
|
2291
|
-
let labels = await
|
2301
|
+
async function downloadPDF(exportInfos, labelPageDescription, removeDuplicates = false, title = "", initialImageDataUrl = "") {
|
2302
|
+
let labels = await consolidateLabels(exportInfos);
|
2303
|
+
const selectionSetNames = _getSelectionSetNames(exportInfos);
|
2292
2304
|
labels =
|
2293
2305
|
// Remove empty lines in labels
|
2294
2306
|
labels.map(labelLines => labelLines.filter(line => line.length > 0))
|
2295
2307
|
// Remove empty labels
|
2296
2308
|
.filter(label => label.length > 0);
|
2309
|
+
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
2297
2310
|
exportPDF(_createFilename(selectionSetNames), labels, labelPageDescription, title, initialImageDataUrl);
|
2298
2311
|
return Promise.resolve();
|
2299
2312
|
}
|
@@ -2510,13 +2523,12 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
|
|
2510
2523
|
*
|
2511
2524
|
* @param layer Layer from which to fetch features
|
2512
2525
|
* @param ids List of ids to download
|
2513
|
-
* @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
|
2514
2526
|
* @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
|
2515
2527
|
* all attributes are exported
|
2516
2528
|
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
2517
2529
|
* @returns Promise resolving when function is done
|
2518
2530
|
*/
|
2519
|
-
async function _prepareLabels(layer, ids,
|
2531
|
+
async function _prepareLabels(layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false) {
|
2520
2532
|
var _a, _b, _c, _d, _e, _f;
|
2521
2533
|
const [intl] = await loadModules(["esri/intl"]);
|
2522
2534
|
// Get the features to export
|
@@ -2641,12 +2653,6 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
|
|
2641
2653
|
});
|
2642
2654
|
});
|
2643
2655
|
}
|
2644
|
-
// Remove duplicates
|
2645
|
-
if (removeDuplicates) {
|
2646
|
-
const labelsAsStrings = labels.map(label => JSON.stringify(label));
|
2647
|
-
const uniqueLabels = new Set(labelsAsStrings);
|
2648
|
-
labels = Array.from(uniqueLabels, labelString => JSON.parse(labelString));
|
2649
|
-
}
|
2650
2656
|
// Add header names
|
2651
2657
|
if (includeHeaderNames) {
|
2652
2658
|
let headerNames = [];
|
@@ -2663,6 +2669,55 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
|
|
2663
2669
|
}
|
2664
2670
|
return Promise.resolve(labels);
|
2665
2671
|
}
|
2672
|
+
/**
|
2673
|
+
* Remove any duplicate labels
|
2674
|
+
*
|
2675
|
+
* @param labels Labels to evaluate for duplicates
|
2676
|
+
* @returns labels with duplicates removed
|
2677
|
+
*/
|
2678
|
+
function removeDuplicateLabels(labels) {
|
2679
|
+
const labelsAsStrings = labels.map(label => JSON.stringify(label));
|
2680
|
+
const uniqueLabels = new Set(labelsAsStrings);
|
2681
|
+
return Array.from(uniqueLabels, labelString => JSON.parse(labelString));
|
2682
|
+
}
|
2683
|
+
/**
|
2684
|
+
* Extract selectionSetNames from the provided exportInfos
|
2685
|
+
*
|
2686
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
2687
|
+
* @returns selectionSetNames that will be used for export filenames
|
2688
|
+
*/
|
2689
|
+
function _getSelectionSetNames(exportInfos, id = /.+/) {
|
2690
|
+
let selectionSetNames = [];
|
2691
|
+
Object.keys(exportInfos).forEach(k => {
|
2692
|
+
const exportInfo = exportInfos[k];
|
2693
|
+
if (id.test(k)) {
|
2694
|
+
selectionSetNames = selectionSetNames.concat(exportInfo.selectionSetNames);
|
2695
|
+
}
|
2696
|
+
});
|
2697
|
+
return selectionSetNames;
|
2698
|
+
}
|
2699
|
+
/**
|
2700
|
+
* Create and consolidate labels from all layers
|
2701
|
+
*
|
2702
|
+
* @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
|
2703
|
+
* @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
|
2704
|
+
* all attributes are exported
|
2705
|
+
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
2706
|
+
* @returns selectionSetNames that will be used for export filenames
|
2707
|
+
*/
|
2708
|
+
async function consolidateLabels(exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false) {
|
2709
|
+
const labelRequests = [];
|
2710
|
+
Object.keys(exportInfos).forEach(k => {
|
2711
|
+
const labelInfo = exportInfos[k];
|
2712
|
+
labelRequests.push(_prepareLabels(labelInfo.layerView.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames));
|
2713
|
+
if (isCSVExport) {
|
2714
|
+
// add the layer id as a temp value separator that we can use to split values for CSV export
|
2715
|
+
labelRequests.push(Promise.resolve([[k]]));
|
2716
|
+
}
|
2717
|
+
});
|
2718
|
+
const labels = await Promise.all(labelRequests);
|
2719
|
+
return labels.reduce((prev, cur) => prev.concat(cur), []);
|
2720
|
+
}
|
2666
2721
|
//#endregion
|
2667
2722
|
|
2668
|
-
export { _typeof_1 as _, downloadPDF as a, downloadCSV as d };
|
2723
|
+
export { _typeof_1 as _, downloadPDF as a, consolidateLabels as c, downloadCSV as d, removeDuplicateLabels as r };
|
@@ -195,8 +195,13 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
195
195
|
* @returns a promise that will resolve when the operation is complete
|
196
196
|
*/
|
197
197
|
_exportToCSV() {
|
198
|
-
|
199
|
-
|
198
|
+
const exportInfos = {};
|
199
|
+
exportInfos[this._layerView.layer.id] = {
|
200
|
+
selectionSetNames: [],
|
201
|
+
ids: this._getSelectedIds(),
|
202
|
+
layerView: this._layerView
|
203
|
+
};
|
204
|
+
void downloadCSV(exportInfos, false, // formatUsingLayerPopup
|
200
205
|
true);
|
201
206
|
}
|
202
207
|
/**
|
@@ -12,7 +12,7 @@ import { d as defineCustomElement$3 } from './action.js';
|
|
12
12
|
import { d as defineCustomElement$2 } from './icon.js';
|
13
13
|
import { d as defineCustomElement$1 } from './loader.js';
|
14
14
|
|
15
|
-
const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir=\"rtl\"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=\"rtl\"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:\"Avenir Next\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}";
|
15
|
+
const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir=\"rtl\"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=\"rtl\"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:\"Avenir Next\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-sketch__section.esri-sketch__tool-section:first-of-type{display:none}";
|
16
16
|
|
17
17
|
const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
18
18
|
constructor() {
|
@@ -185,6 +185,7 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
185
185
|
}
|
186
186
|
};
|
187
187
|
this._sketchWidget = new this.Sketch(Object.assign(Object.assign({}, sketchOptions), { container: this._sketchElement, creationMode: "single", visibleElements: {
|
188
|
+
duplicateButton: false,
|
188
189
|
selectionTools: {
|
189
190
|
"lasso-selection": false,
|
190
191
|
"rectangle-selection": false
|
@@ -193,7 +194,8 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
193
194
|
},
|
194
195
|
undoRedoMenu: false,
|
195
196
|
settingsMenu: this.drawMode === EDrawMode.SKETCH
|
196
|
-
}
|
197
|
+
} // temp workaround since we need duplicateButton flag that is not in 4.26 types but will be in the 4.27 modules we get from IA
|
198
|
+
}));
|
197
199
|
this._sketchViewModel = new this.SketchViewModel(Object.assign({}, sketchOptions));
|
198
200
|
this._sketchWidget.viewModel.polylineSymbol = this.polylineSymbol;
|
199
201
|
this._sketchWidget.viewModel.pointSymbol = this.pointSymbol;
|
@@ -226,6 +228,7 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
226
228
|
});
|
227
229
|
this._sketchWidget.on("delete", () => {
|
228
230
|
this.graphics = [];
|
231
|
+
this._setDefaultCreateTool();
|
229
232
|
this.sketchGraphicsChange.emit({
|
230
233
|
graphics: this.graphics,
|
231
234
|
useOIDs: false
|
@@ -245,6 +248,7 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
245
248
|
useOIDs: false
|
246
249
|
});
|
247
250
|
});
|
251
|
+
this._setDefaultCreateTool();
|
248
252
|
}
|
249
253
|
/**
|
250
254
|
* Clear any stored graphics and remove all graphics from the graphics layer
|
@@ -257,6 +261,16 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
257
261
|
this.graphics = [];
|
258
262
|
(_a = this._sketchGraphicsLayer) === null || _a === void 0 ? void 0 : _a.removeAll();
|
259
263
|
}
|
264
|
+
/**
|
265
|
+
* Set the default create tool when we have no existing graphics
|
266
|
+
*
|
267
|
+
* @protected
|
268
|
+
*/
|
269
|
+
_setDefaultCreateTool() {
|
270
|
+
if (!this.graphics || this.graphics.length === 0) {
|
271
|
+
this._sketchWidget.viewModel.create("rectangle");
|
272
|
+
}
|
273
|
+
}
|
260
274
|
/**
|
261
275
|
* Emit the undo event
|
262
276
|
*
|
@@ -65,6 +65,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
65
65
|
this.noResultText = undefined;
|
66
66
|
this.searchConfiguration = undefined;
|
67
67
|
this.selectionSet = undefined;
|
68
|
+
this.selectionLayerIds = [];
|
68
69
|
this.selectLayerView = undefined;
|
69
70
|
this.sketchLineSymbol = undefined;
|
70
71
|
this.sketchPointSymbol = undefined;
|
@@ -207,7 +208,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
207
208
|
*/
|
208
209
|
_getUseLayerFeaturesOptions() {
|
209
210
|
const useLayerFeaturesClass = this._useLayerFeaturesEnabled ? "div-visible" : "div-not-visible";
|
210
|
-
return (h("div", null, h("div", { class: "padding-top-1 display-flex" }, h("calcite-label", { class: "label-margin-0 w-100", layout: "inline-space-between" }, h("div", { class: "tooltip-container" }, this._translations.useLayerFeatures, h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "use-layer-features-icon", scale: "s" }))), h("calcite-popover", { closable: true, label: "", referenceElement: "use-layer-features-icon" }, h("span", { class: "tooltip-message" }, this._translations.useLayerFeaturesTooltip)), h("calcite-switch", { checked: this._useLayerFeaturesEnabled, onCalciteSwitchChange: () => { this._useLayerFeaturesEnabledChanged(); } })), h("div", { class: useLayerFeaturesClass + " padding-top-1" }, h("map-layer-picker", { enabledLayerIds: this.
|
211
|
+
return (h("div", null, h("div", { class: "padding-top-1 display-flex" }, h("calcite-label", { class: "label-margin-0 w-100", layout: "inline-space-between" }, h("div", { class: "tooltip-container" }, this._translations.useLayerFeatures, h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "use-layer-features-icon", scale: "s" }))), h("calcite-popover", { closable: true, label: "", referenceElement: "use-layer-features-icon" }, h("span", { class: "tooltip-message" }, this._translations.useLayerFeaturesTooltip)), h("calcite-switch", { checked: this._useLayerFeaturesEnabled, onCalciteSwitchChange: () => { this._useLayerFeaturesEnabledChanged(); } })), h("div", { class: useLayerFeaturesClass + " padding-top-1" }, h("map-layer-picker", { enabledLayerIds: this.selectionLayerIds, mapView: this.mapView, onLayerSelectionChange: (evt) => { void this._layerSelectionChange(evt); }, selectedLayerIds: this.layerViews.map(l => l.layer.id), selectionMode: "single" }))));
|
211
212
|
}
|
212
213
|
/**
|
213
214
|
* Renders the number of selected features
|
@@ -792,6 +793,7 @@ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
792
793
|
"noResultText": [1, "no-result-text"],
|
793
794
|
"searchConfiguration": [1040],
|
794
795
|
"selectionSet": [16],
|
796
|
+
"selectionLayerIds": [16],
|
795
797
|
"selectLayerView": [16],
|
796
798
|
"sketchLineSymbol": [16],
|
797
799
|
"sketchPointSymbol": [16],
|
@@ -237,11 +237,8 @@ const PdfDownload = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
237
237
|
* @returns Promise resolving when function is done
|
238
238
|
*/
|
239
239
|
async downloadCSV(exportInfos, removeDuplicates, addColumnTitle = true) {
|
240
|
-
|
241
|
-
|
242
|
-
void downloadCSV(exportInfo.selectionSetNames, exportInfo.layerView.layer, exportInfo.ids, true, // formatUsingLayerPopup
|
243
|
-
removeDuplicates, addColumnTitle);
|
244
|
-
});
|
240
|
+
void downloadCSV(exportInfos, true, // formatUsingLayerPopup
|
241
|
+
removeDuplicates, addColumnTitle);
|
245
242
|
}
|
246
243
|
/**
|
247
244
|
* Downloads pdf of mailing labels for the provided list of ids
|
@@ -253,10 +250,7 @@ const PdfDownload = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
253
250
|
* @returns Promise resolving when function is done
|
254
251
|
*/
|
255
252
|
async downloadPDF(exportInfos, removeDuplicates = false, title = "", initialImageDataUrl = "") {
|
256
|
-
|
257
|
-
const exportInfo = exportInfos[k];
|
258
|
-
void downloadPDF(exportInfo.selectionSetNames, exportInfo.layerView.layer, exportInfo.ids, this._labelInfoElement.selectedOption.value, removeDuplicates, title, initialImageDataUrl);
|
259
|
-
});
|
253
|
+
void downloadPDF(exportInfos, this._labelInfoElement.selectedOption.value, removeDuplicates, title, initialImageDataUrl);
|
260
254
|
}
|
261
255
|
//--------------------------------------------------------------------------
|
262
256
|
//
|
@@ -3,12 +3,13 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
6
|
+
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Host } from '@stencil/core/internal/client';
|
7
7
|
import { a as EExportType, b as EPageType, c as EWorkflowType } from './interfaces.js';
|
8
8
|
import { l as loadModules } from './loadModules.js';
|
9
9
|
import { g as goToSelection, h as highlightFeatures, d as defineCustomElement$5 } from './map-layer-picker2.js';
|
10
10
|
import { s as state } from './publicNotificationStore.js';
|
11
11
|
import { g as getLocaleComponentStrings } from './locale.js';
|
12
|
+
import { c as consolidateLabels, r as removeDuplicateLabels } from './downloadUtils.js';
|
12
13
|
import { d as defineCustomElement$D } from './buffer-tools2.js';
|
13
14
|
import { d as defineCustomElement$C } from './action.js';
|
14
15
|
import { d as defineCustomElement$B } from './action-bar.js';
|
@@ -47,13 +48,17 @@ import { d as defineCustomElement$4 } from './map-select-tools2.js';
|
|
47
48
|
import { d as defineCustomElement$3 } from './pdf-download2.js';
|
48
49
|
import { d as defineCustomElement$2 } from './refine-selection2.js';
|
49
50
|
|
50
|
-
const publicNotificationCss = ":host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir=\"rtl\"]{float:left}.float-left{float:left}.float-left[dir=\"rtl\"]{float:right}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir=\"rtl\"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-ui-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{-webkit-margin-before:0.125rem;margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}";
|
51
|
+
const publicNotificationCss = ":host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir=\"rtl\"]{float:left}.float-left{float:left}.float-left[dir=\"rtl\"]{float:right}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir=\"rtl\"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-ui-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{-webkit-margin-before:0.125rem;margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}.img-container{-o-object-fit:scale-down;object-fit:scale-down;width:100%;height:100%}";
|
51
52
|
|
52
53
|
const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
53
54
|
constructor() {
|
54
55
|
super();
|
55
56
|
this.__registerHost();
|
56
57
|
this.searchConfigurationChange = createEvent(this, "searchConfigurationChange", 7);
|
58
|
+
/**
|
59
|
+
* string: The url to the onboarding image
|
60
|
+
*/
|
61
|
+
this._onboardingImageUrl = "";
|
57
62
|
/**
|
58
63
|
* number: The number of selected features
|
59
64
|
*/
|
@@ -79,6 +84,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
79
84
|
this._addTitle = false;
|
80
85
|
this._downloadActive = true;
|
81
86
|
this._exportType = EExportType.PDF;
|
87
|
+
this._numDuplicates = 0;
|
82
88
|
this._pageType = EPageType.LIST;
|
83
89
|
this._saveEnabled = false;
|
84
90
|
this._selectionSets = [];
|
@@ -145,6 +151,9 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
145
151
|
if ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.popup) {
|
146
152
|
this.mapView.popup.autoOpenEnabled = pageType !== EPageType.LIST ? false : this._popupsEnabled;
|
147
153
|
}
|
154
|
+
if (pageType === EPageType.EXPORT) {
|
155
|
+
this._numDuplicates = await this._getNumDuplicates();
|
156
|
+
}
|
148
157
|
this._clearHighlight();
|
149
158
|
if (oldPageType === EPageType.SELECT || oldPageType === EPageType.REFINE) {
|
150
159
|
// clear any draw shapes or buffers
|
@@ -172,6 +181,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
172
181
|
await this._getTranslations();
|
173
182
|
await this._initModules();
|
174
183
|
this._initSymbols();
|
184
|
+
this._onboardingImageUrl = getAssetPath(`../assets/data/images/onboarding.png`);
|
175
185
|
}
|
176
186
|
/**
|
177
187
|
* Renders the component.
|
@@ -330,7 +340,16 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
330
340
|
*/
|
331
341
|
_getListPage() {
|
332
342
|
const hasSets = this._hasSelections();
|
333
|
-
return (h("calcite-panel", null, this._getLabel(this._translations.myLists), this._getNotice(hasSets ? this._translations.listHasSetsTip : this._translations.selectLayerAndAdd, "padding-sides-1 padding-bottom-1"), hasSets ? this._getSelectionSetList() : (
|
343
|
+
return (h("calcite-panel", null, this._getLabel(this._translations.myLists), this._getNotice(hasSets ? this._translations.listHasSetsTip : this._translations.selectLayerAndAdd, "padding-sides-1 padding-bottom-1"), hasSets ? this._getSelectionSetList() : (this._getOnboardingImage()), h("div", { class: "display-flex padding-1" }, h("calcite-button", { onClick: () => { this._setPageType(EPageType.SELECT); }, width: "full" }, this._translations.add))));
|
344
|
+
}
|
345
|
+
/**
|
346
|
+
* Display an image to help illustrate the basic workflow of the widget
|
347
|
+
*
|
348
|
+
* @returns the image node to display
|
349
|
+
* @protected
|
350
|
+
*/
|
351
|
+
_getOnboardingImage() {
|
352
|
+
return (h("div", { class: "display-flex padding-sides-1" }, h("img", { class: "img-container", src: this._onboardingImageUrl })));
|
334
353
|
}
|
335
354
|
/**
|
336
355
|
* Create the selection sets list node for the List page
|
@@ -352,7 +371,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
352
371
|
validSet = numIds > 0;
|
353
372
|
}
|
354
373
|
if (validSet) {
|
355
|
-
prev.push((h("calcite-list-item", {
|
374
|
+
prev.push((h("calcite-list-item", { label: cur.label, onClick: () => this._gotoSelection(cur, this.mapView) }, h("div", { slot: "content" }, h("div", { class: "list-label" }, cur.label), h("div", { class: "list-description" }, (_a = cur === null || cur === void 0 ? void 0 : cur.layerView) === null || _a === void 0 ? void 0 : _a.layer.title), h("div", { class: "list-description" }, this._translations.selectedFeatures.replace("{{n}}", ids.length.toString()))), this._getAction(true, "pencil", "", (evt) => this._openSelection(cur, evt), false, "actions-end"), this._getAction(true, "x", "", (evt) => this._deleteSelection(i, evt), false, "actions-end"))));
|
356
375
|
}
|
357
376
|
return prev;
|
358
377
|
}, []))));
|
@@ -388,39 +407,67 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
388
407
|
return validateRefineSet && hasRefineSet ? ids.length > 0 || this._selectionSets.length > 1 : this._selectionSets.length > 0;
|
389
408
|
}
|
390
409
|
/**
|
391
|
-
* Check if any
|
410
|
+
* Check if any duplicate labels exist
|
392
411
|
*
|
393
412
|
* @returns true if duplicates are found
|
394
413
|
*
|
395
414
|
* @protected
|
396
415
|
*/
|
397
|
-
|
398
|
-
const
|
399
|
-
|
416
|
+
async _getNumDuplicates() {
|
417
|
+
const exportInfos = this._getExportInfos();
|
418
|
+
const labels = await consolidateLabels(exportInfos);
|
419
|
+
const duplicatesRemoved = removeDuplicateLabels(labels);
|
420
|
+
return labels.length - duplicatesRemoved.length;
|
400
421
|
}
|
401
422
|
/**
|
402
|
-
*
|
423
|
+
* Get key details about what to export
|
403
424
|
*
|
404
|
-
* @
|
405
|
-
*
|
406
|
-
* @returns the number of duplicates
|
425
|
+
* @returns IExportInfos that contain ids and layer
|
407
426
|
*
|
408
427
|
* @protected
|
409
428
|
*/
|
410
|
-
|
411
|
-
return
|
429
|
+
_getExportInfos() {
|
430
|
+
return this._selectionSets.reduce((prev, cur) => {
|
431
|
+
if (cur.download) {
|
432
|
+
if (cur.workflowType !== EWorkflowType.REFINE) {
|
433
|
+
const id = cur.layerView.layer.id;
|
434
|
+
this._updateIds(id, cur.layerView, cur.selectedIds, prev);
|
435
|
+
}
|
436
|
+
else {
|
437
|
+
// REFINE stores ids differently as it can contain ids from multiple layers
|
438
|
+
// REFINE will only ever be 1 ISelectionSet
|
439
|
+
Object.keys(cur.refineInfos).forEach(k => {
|
440
|
+
const refineIds = cur.refineInfos[k];
|
441
|
+
this._updateIds(k, refineIds.layerView, refineIds.addIds, prev);
|
442
|
+
});
|
443
|
+
}
|
444
|
+
}
|
445
|
+
return prev;
|
446
|
+
}, {});
|
412
447
|
}
|
413
448
|
/**
|
414
|
-
*
|
449
|
+
* Consolidate ids for each layer
|
415
450
|
*
|
416
|
-
* @
|
451
|
+
* @param id the layer id from the selectionSet
|
452
|
+
* @param layerView the layerView from the selectionSet
|
453
|
+
* @param ids the selectedIds from the selectionSet
|
454
|
+
* @param obj the object that will store the consolidated ids and layer info
|
455
|
+
*
|
456
|
+
* @returns IExportInfo key details that will be used for export
|
417
457
|
*
|
418
458
|
* @protected
|
419
459
|
*/
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
}
|
460
|
+
_updateIds(id, layerView, ids, obj) {
|
461
|
+
if (obj[id]) {
|
462
|
+
obj[id].ids = obj[id].ids.concat(ids);
|
463
|
+
}
|
464
|
+
else {
|
465
|
+
obj[id] = {
|
466
|
+
layerView,
|
467
|
+
ids
|
468
|
+
};
|
469
|
+
}
|
470
|
+
return obj;
|
424
471
|
}
|
425
472
|
/**
|
426
473
|
* Create the Select page that shows the selection workflows
|
@@ -430,7 +477,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
430
477
|
*/
|
431
478
|
_getSelectPage() {
|
432
479
|
const noticeText = this._translations.selectSearchTip;
|
433
|
-
return (h("calcite-panel", null, this._getLabel(this._translations.stepTwoFull, true), this._getNotice(noticeText), h("div", null, h("map-select-tools", { bufferColor: this.bufferColor, bufferOutlineColor: this.bufferOutlineColor, class: "font-bold", customLabelEnabled: this.customLabelEnabled, defaultBufferDistance: this.defaultBufferDistance, defaultBufferUnit: this.defaultBufferUnit, enabledLayerIds: this.
|
480
|
+
return (h("calcite-panel", null, this._getLabel(this._translations.stepTwoFull, true), this._getNotice(noticeText), h("div", null, h("map-select-tools", { bufferColor: this.bufferColor, bufferOutlineColor: this.bufferOutlineColor, class: "font-bold", customLabelEnabled: this.customLabelEnabled, defaultBufferDistance: this.defaultBufferDistance, defaultBufferUnit: this.defaultBufferUnit, enabledLayerIds: this.addresseeLayerIds, isUpdate: !!this._activeSelection, mapView: this.mapView, noResultText: this.noResultText, onSelectionSetChange: (evt) => this._updateForSelection(evt), ref: (el) => { this._selectTools = el; }, searchConfiguration: this._searchConfiguration, selectionLayerIds: this.selectionLayerIds, selectionSet: this._activeSelection, sketchLineSymbol: this.sketchLineSymbol, sketchPointSymbol: this.sketchPointSymbol, sketchPolygonSymbol: this.sketchPolygonSymbol })), this._getPageNavButtons(this._translations.done, this._numSelected === 0, () => { void this._saveSelection(); }, this._translations.cancel, false, () => { void this._home(); })));
|
434
481
|
}
|
435
482
|
/**
|
436
483
|
* Create the main download page that has the shared aspects of both PDF and CSV
|
@@ -441,8 +488,8 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
441
488
|
*/
|
442
489
|
_getExportPage() {
|
443
490
|
const hasSelections = this._hasSelections(this.showRefineSelection);
|
444
|
-
const
|
445
|
-
return (h("calcite-panel", null, h("div", null, this._getLabel(this._translations.export, false), hasSelections ? (h("div", null, this._getNotice(this._translations.exportTip, "padding-sides-1"), this._getLabel(this._translations.exportListsLabel), this._getExportSelectionLists(), h("div", { class: "padding-sides-1" }, h("div", { class: "display-flex" }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { ref: (el) => { this._removeDuplicates = el; } }), h("div", { class: "display-flex" }, this._translations.removeDuplicate, h("div", { class: "info-message padding-start-1-2" }, h("calcite-input-message", { class: "info-blue margin-top-0", scale: "m" }, ` ${this._translations.numDuplicates.replace("{{n}}",
|
491
|
+
const displayDuplicatesClass = this._numDuplicates > 0 ? "display-block" : "display-none";
|
492
|
+
return (h("calcite-panel", null, h("div", null, this._getLabel(this._translations.export, false), hasSelections ? (h("div", null, this._getNotice(this._translations.exportTip, "padding-sides-1"), this._getLabel(this._translations.exportListsLabel), this._getExportSelectionLists(), h("div", { class: "padding-sides-1 " + displayDuplicatesClass }, h("div", { class: "display-flex" }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { ref: (el) => { this._removeDuplicates = el; } }), h("div", { class: "display-flex" }, this._translations.removeDuplicate, h("div", { class: "info-message padding-start-1-2" }, h("calcite-input-message", { class: "info-blue margin-top-0", scale: "m" }, ` ${this._translations.numDuplicates.replace("{{n}}", this._numDuplicates.toString())}`)))), h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "remove-duplicates-icon", scale: "s" })), h("calcite-popover", { closable: true, label: "", referenceElement: "remove-duplicates-icon" }, h("span", { class: "tooltip-message" }, this._translations.duplicatesTip))), h("div", { class: "border-bottom" }), h("div", { class: "padding-top-sides-1" }, h("calcite-segmented-control", { class: "w-100", onCalciteSegmentedControlChange: (evt) => this._exportTypeChange(evt) }, h("calcite-segmented-control-item", { checked: this._exportType === EExportType.PDF, class: "w-50 end-border", value: EExportType.PDF }, this._translations.pdf), h("calcite-segmented-control-item", { checked: this._exportType === EExportType.CSV, class: "w-50", value: EExportType.CSV }, this._translations.csv))), h("div", { class: "padding-bottom-1" }, this._getExportOptions()), h("div", { class: "padding-1 display-flex" }, h("calcite-button", { disabled: !this._downloadActive, onClick: () => void this._export(), width: "full" }, this._translations.export)))) : (this._getNotice(this._translations.downloadNoLists, "padding-sides-1 padding-bottom-1")))));
|
446
493
|
}
|
447
494
|
/**
|
448
495
|
* Store the user selected export type CSV || PDF
|
@@ -522,13 +569,14 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
522
569
|
*/
|
523
570
|
_getExportSelectionLists() {
|
524
571
|
return this._selectionSets.reduce((prev, cur) => {
|
572
|
+
var _a;
|
525
573
|
const ids = this._getSelectionSetIds(cur);
|
526
574
|
const validSet = cur.workflowType !== EWorkflowType.REFINE || ids.length > 0;
|
527
575
|
if (!this._downloadActive && cur.download && validSet) {
|
528
576
|
this._downloadActive = true;
|
529
577
|
}
|
530
578
|
if (validSet) {
|
531
|
-
prev.push((h("div", { class: "display-flex padding-sides-1 padding-bottom-1" }, h("calcite-checkbox", { checked: cur.download, class: "align-center", onClick: () => { void this._toggleDownload(cur.id); } }), h("calcite-list", { class: "list-border margin-start-1-2 width-full", id: "download-list" }, h("calcite-list-item", {
|
579
|
+
prev.push((h("div", { class: "display-flex padding-sides-1 padding-bottom-1" }, h("calcite-checkbox", { checked: cur.download, class: "align-center", onClick: () => { void this._toggleDownload(cur.id); } }), h("calcite-list", { class: "list-border margin-start-1-2 width-full", id: "download-list" }, h("calcite-list-item", { disabled: !cur.download, label: cur.label, onClick: () => { void this._toggleDownload(cur.id); } }, h("div", { slot: "content" }, h("div", { class: "list-label" }, cur.label), h("div", { class: "list-description" }, (_a = cur === null || cur === void 0 ? void 0 : cur.layerView) === null || _a === void 0 ? void 0 : _a.layer.title), h("div", { class: "list-description" }, this._translations.selectedFeatures.replace("{{n}}", ids.length.toString()))))))));
|
532
580
|
}
|
533
581
|
return prev;
|
534
582
|
}, []) || (h("div", null));
|
@@ -548,6 +596,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
548
596
|
return ss;
|
549
597
|
});
|
550
598
|
this._downloadActive = isActive;
|
599
|
+
this._numDuplicates = await this._getNumDuplicates();
|
551
600
|
await this._highlightFeatures();
|
552
601
|
}
|
553
602
|
/**
|
@@ -811,6 +860,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
811
860
|
"_addTitle": [32],
|
812
861
|
"_downloadActive": [32],
|
813
862
|
"_exportType": [32],
|
863
|
+
"_numDuplicates": [32],
|
814
864
|
"_pageType": [32],
|
815
865
|
"_saveEnabled": [32],
|
816
866
|
"_selectionSets": [32],
|
@@ -22,7 +22,7 @@ import './resources-e83f65b3.js';
|
|
22
22
|
import './observers-81c91acd.js';
|
23
23
|
import './index-4c4a4f3d.js';
|
24
24
|
|
25
|
-
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}";
|
25
|
+
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%}";
|
26
26
|
|
27
27
|
const BufferTools = class {
|
28
28
|
constructor(hostRef) {
|
@@ -181,7 +181,7 @@ const BufferTools = class {
|
|
181
181
|
* @protected
|
182
182
|
*/
|
183
183
|
_getTextBoxDisplay() {
|
184
|
-
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())));
|
184
|
+
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())));
|
185
185
|
}
|
186
186
|
/**
|
187
187
|
* Render distance control as a slider
|
@@ -1122,7 +1122,7 @@ const Slider = class {
|
|
1122
1122
|
};
|
1123
1123
|
Slider.style = sliderCss;
|
1124
1124
|
|
1125
|
-
const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir=\"rtl\"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=\"rtl\"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:\"Avenir Next\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}";
|
1125
|
+
const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir=\"rtl\"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=\"rtl\"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:\"Avenir Next\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-sketch__section.esri-sketch__tool-section:first-of-type{display:none}";
|
1126
1126
|
|
1127
1127
|
const MapDrawTools = class {
|
1128
1128
|
constructor(hostRef) {
|
@@ -1294,6 +1294,7 @@ const MapDrawTools = class {
|
|
1294
1294
|
}
|
1295
1295
|
};
|
1296
1296
|
this._sketchWidget = new this.Sketch(Object.assign(Object.assign({}, sketchOptions), { container: this._sketchElement, creationMode: "single", visibleElements: {
|
1297
|
+
duplicateButton: false,
|
1297
1298
|
selectionTools: {
|
1298
1299
|
"lasso-selection": false,
|
1299
1300
|
"rectangle-selection": false
|
@@ -1302,7 +1303,8 @@ const MapDrawTools = class {
|
|
1302
1303
|
},
|
1303
1304
|
undoRedoMenu: false,
|
1304
1305
|
settingsMenu: this.drawMode === EDrawMode.SKETCH
|
1305
|
-
}
|
1306
|
+
} // temp workaround since we need duplicateButton flag that is not in 4.26 types but will be in the 4.27 modules we get from IA
|
1307
|
+
}));
|
1306
1308
|
this._sketchViewModel = new this.SketchViewModel(Object.assign({}, sketchOptions));
|
1307
1309
|
this._sketchWidget.viewModel.polylineSymbol = this.polylineSymbol;
|
1308
1310
|
this._sketchWidget.viewModel.pointSymbol = this.pointSymbol;
|
@@ -1335,6 +1337,7 @@ const MapDrawTools = class {
|
|
1335
1337
|
});
|
1336
1338
|
this._sketchWidget.on("delete", () => {
|
1337
1339
|
this.graphics = [];
|
1340
|
+
this._setDefaultCreateTool();
|
1338
1341
|
this.sketchGraphicsChange.emit({
|
1339
1342
|
graphics: this.graphics,
|
1340
1343
|
useOIDs: false
|
@@ -1354,6 +1357,7 @@ const MapDrawTools = class {
|
|
1354
1357
|
useOIDs: false
|
1355
1358
|
});
|
1356
1359
|
});
|
1360
|
+
this._setDefaultCreateTool();
|
1357
1361
|
}
|
1358
1362
|
/**
|
1359
1363
|
* Clear any stored graphics and remove all graphics from the graphics layer
|
@@ -1366,6 +1370,16 @@ const MapDrawTools = class {
|
|
1366
1370
|
this.graphics = [];
|
1367
1371
|
(_a = this._sketchGraphicsLayer) === null || _a === void 0 ? void 0 : _a.removeAll();
|
1368
1372
|
}
|
1373
|
+
/**
|
1374
|
+
* Set the default create tool when we have no existing graphics
|
1375
|
+
*
|
1376
|
+
* @protected
|
1377
|
+
*/
|
1378
|
+
_setDefaultCreateTool() {
|
1379
|
+
if (!this.graphics || this.graphics.length === 0) {
|
1380
|
+
this._sketchWidget.viewModel.create("rectangle");
|
1381
|
+
}
|
1382
|
+
}
|
1369
1383
|
/**
|
1370
1384
|
* Emit the undo event
|
1371
1385
|
*
|
@@ -19,7 +19,7 @@ import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as
|
|
19
19
|
import { C as ComboboxChildSelector, b as getItemAncestors, c as getItemChildren, h as hasActiveChildren, d as ComboboxItem$1, e as ComboboxItemGroup, g as getAncestors, a as getDepth } from './utils-1095d24d.js';
|
20
20
|
import { d as debounce } from './debounce-4c884e5c.js';
|
21
21
|
import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-d3eebe7f.js';
|
22
|
-
import { i as getMapLayerIds, k as getMapLayerHash } from './mapViewUtils-
|
22
|
+
import { i as getMapLayerIds, k as getMapLayerHash } from './mapViewUtils-27dfdc29.js';
|
23
23
|
import { s as state } from './publicNotificationStore-c36d95bf.js';
|
24
24
|
import './resources-e83f65b3.js';
|
25
25
|
import './key-218d8d4d.js';
|