@esri/solutions-components 0.7.43 → 0.7.44
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/card-manager_3.cjs.entry.js +10 -2
- package/dist/cjs/{downloadUtils-7d4985c0.js → downloadUtils-abf7decd.js} +8 -11
- package/dist/cjs/{index.es-8cef354a.js → index.es-478ec781.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/layer-table/layer-table.js +11 -1
- package/dist/collection/utils/downloadUtils.js +7 -10
- package/dist/collection/utils/downloadUtils.ts +13 -13
- package/dist/components/downloadUtils.js +7 -10
- package/dist/components/layer-table2.js +10 -1
- package/dist/esm/card-manager_3.entry.js +10 -2
- package/dist/esm/{downloadUtils-d5928e55.js → downloadUtils-be13a13d.js} +8 -11
- package/dist/esm/{index.es-a1725c19.js → index.es-623fddee.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +1 -1
- package/dist/esm/public-notification.entry.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-3e88e0bd.entry.js → p-0c427d9a.entry.js} +1 -1
- package/dist/solutions-components/{p-7f374ec7.js → p-2bec3d88.js} +1 -1
- package/dist/solutions-components/{p-ac9c29da.entry.js → p-9294f273.entry.js} +1 -1
- package/dist/solutions-components/{p-12fc82a9.js → p-dc4fcddc.js} +3 -3
- package/dist/solutions-components/p-f053c268.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +13 -13
- package/dist/types/components/layer-table/layer-table.d.ts +4 -0
- package/dist/types/utils/downloadUtils.d.ts +3 -3
- package/package.json +1 -1
- package/dist/solutions-components/p-45698f2a.entry.js +0 -6
@@ -154,6 +154,13 @@ export class LayerTable {
|
|
154
154
|
this._initToolInfos();
|
155
155
|
}
|
156
156
|
}
|
157
|
+
/**
|
158
|
+
* watch for changes in map info and update the toolbar
|
159
|
+
*/
|
160
|
+
async mapInfoWatchHandler() {
|
161
|
+
this._initToolInfos();
|
162
|
+
this._updateToolbar();
|
163
|
+
}
|
157
164
|
/**
|
158
165
|
* watch for changes in map view and get the first layer
|
159
166
|
*/
|
@@ -1265,7 +1272,7 @@ export class LayerTable {
|
|
1265
1272
|
exportInfos, false, // formatUsingLayerPopup
|
1266
1273
|
false, // removeDuplicates
|
1267
1274
|
true, // addColumnTitle
|
1268
|
-
fields, true);
|
1275
|
+
fields, true, true);
|
1269
1276
|
this._updateToolInfoLoading("export", false);
|
1270
1277
|
this._csvExporting = false;
|
1271
1278
|
}
|
@@ -1780,6 +1787,9 @@ export class LayerTable {
|
|
1780
1787
|
}, {
|
1781
1788
|
"propName": "isMobile",
|
1782
1789
|
"methodName": "isMobileWatchHandler"
|
1790
|
+
}, {
|
1791
|
+
"propName": "mapInfo",
|
1792
|
+
"methodName": "mapInfoWatchHandler"
|
1783
1793
|
}, {
|
1784
1794
|
"propName": "mapView",
|
1785
1795
|
"methodName": "mapViewWatchHandler"
|
@@ -40,12 +40,12 @@ import { queryRelated } from "@esri/arcgis-rest-feature-layer";
|
|
40
40
|
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
41
41
|
* @returns selectionSetNames that will be used for export filenames
|
42
42
|
*/
|
43
|
-
export async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false, fields =
|
43
|
+
export async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
|
44
44
|
const labelRequests = [];
|
45
45
|
Object.keys(exportInfos).forEach(k => {
|
46
46
|
var _a;
|
47
47
|
const labelInfo = exportInfos[k];
|
48
|
-
labelRequests.push(_prepareLabels(webmap, ((_a = labelInfo.layerView) === null || _a === void 0 ? void 0 : _a.layer) || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames));
|
48
|
+
labelRequests.push(_prepareLabels(webmap, ((_a = labelInfo.layerView) === null || _a === void 0 ? void 0 : _a.layer) || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames, filterFields));
|
49
49
|
if (isCSVExport) {
|
50
50
|
// add the layer id as a temp value separator that we can use to split values for CSV export
|
51
51
|
labelRequests.push(Promise.resolve([[k]]));
|
@@ -65,8 +65,8 @@ export async function consolidateLabels(webmap, exportInfos, formatUsingLayerPop
|
|
65
65
|
* @param addColumnTitle Indicates if column headings should be included in output
|
66
66
|
* @returns Promise resolving when function is done
|
67
67
|
*/
|
68
|
-
export async function downloadCSV(webmap, exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false, fields =
|
69
|
-
let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames);
|
68
|
+
export async function downloadCSV(webmap, exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
|
69
|
+
let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames, filterFields);
|
70
70
|
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
71
71
|
const layerIds = Object.keys(exportInfos);
|
72
72
|
let layerLabels = [];
|
@@ -605,10 +605,7 @@ export function _prepareAttributeValue(attributeValue, attributeType, attributeD
|
|
605
605
|
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
606
606
|
* @returns Promise resolving when function is done
|
607
607
|
*/
|
608
|
-
export async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false, fields =
|
609
|
-
if (fields.length === 0) {
|
610
|
-
fields = layer.fields.map(f => f.name.toLowerCase());
|
611
|
-
}
|
608
|
+
export async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
|
612
609
|
// Get the label formatting, if any
|
613
610
|
const labelFormatProps = await _getLabelFormat(webmap, layer, formatUsingLayerPopup);
|
614
611
|
// Because the label may actually come from a related layer, we'll use the layer that comes back from _getLabelFormat.
|
@@ -675,7 +672,7 @@ export async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup =
|
|
675
672
|
const attributeDomains = {};
|
676
673
|
if (featureLayer.fields) {
|
677
674
|
featureLayer.fields.forEach(field => {
|
678
|
-
if (fields.indexOf(field.name.toLowerCase()) > -1) {
|
675
|
+
if (filterFields ? fields.indexOf(field.name.toLowerCase()) > -1 : true) {
|
679
676
|
const lowercaseFieldname = field.name.toLowerCase();
|
680
677
|
attributeOrigNames[lowercaseFieldname] = field.name;
|
681
678
|
attributeDomains[lowercaseFieldname] = field.domain;
|
@@ -686,7 +683,7 @@ export async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup =
|
|
686
683
|
else {
|
687
684
|
// Feature layer is missing fields, so get info from first feature
|
688
685
|
Object.keys(featureSet[0]).forEach(fieldName => {
|
689
|
-
if (fields.indexOf(fieldName.toLowerCase()) > -1) {
|
686
|
+
if (filterFields ? fields.indexOf(fieldName.toLowerCase()) > -1 : true) {
|
690
687
|
const lowercaseFieldname = fieldName.toLowerCase();
|
691
688
|
attributeOrigNames[lowercaseFieldname] = fieldName;
|
692
689
|
}
|
@@ -126,15 +126,16 @@ export async function consolidateLabels(
|
|
126
126
|
formatUsingLayerPopup = true,
|
127
127
|
includeHeaderNames = false,
|
128
128
|
isCSVExport = false,
|
129
|
-
fields =
|
130
|
-
useFieldAliasNames = false
|
129
|
+
fields = undefined,
|
130
|
+
useFieldAliasNames = false,
|
131
|
+
filterFields = false
|
131
132
|
): Promise<string[][]> {
|
132
133
|
const labelRequests = [];
|
133
134
|
|
134
135
|
Object.keys(exportInfos).forEach(k => {
|
135
136
|
const labelInfo: IExportInfo = exportInfos[k];
|
136
137
|
labelRequests.push(
|
137
|
-
_prepareLabels(webmap, labelInfo.layerView?.layer || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames)
|
138
|
+
_prepareLabels(webmap, labelInfo.layerView?.layer || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames, filterFields)
|
138
139
|
);
|
139
140
|
if (isCSVExport) {
|
140
141
|
// add the layer id as a temp value separator that we can use to split values for CSV export
|
@@ -163,10 +164,11 @@ export async function downloadCSV(
|
|
163
164
|
formatUsingLayerPopup: boolean,
|
164
165
|
removeDuplicates = false,
|
165
166
|
addColumnTitle = false,
|
166
|
-
fields =
|
167
|
-
useFieldAliasNames = false
|
167
|
+
fields = undefined,
|
168
|
+
useFieldAliasNames = false,
|
169
|
+
filterFields = false
|
168
170
|
): Promise<void> {
|
169
|
-
let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames);
|
171
|
+
let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames, filterFields);
|
170
172
|
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
171
173
|
|
172
174
|
const layerIds = Object.keys(exportInfos);
|
@@ -843,12 +845,10 @@ export async function _prepareLabels(
|
|
843
845
|
ids: number[],
|
844
846
|
formatUsingLayerPopup = true,
|
845
847
|
includeHeaderNames = false,
|
846
|
-
fields =
|
847
|
-
useFieldAliasNames = false
|
848
|
+
fields = undefined,
|
849
|
+
useFieldAliasNames = false,
|
850
|
+
filterFields = false
|
848
851
|
): Promise<string[][]> {
|
849
|
-
if (fields.length === 0) {
|
850
|
-
fields = layer.fields.map(f => f.name.toLowerCase())
|
851
|
-
}
|
852
852
|
// Get the label formatting, if any
|
853
853
|
const labelFormatProps: ILabelFormatProps = await _getLabelFormat(webmap, layer, formatUsingLayerPopup);
|
854
854
|
|
@@ -929,7 +929,7 @@ export async function _prepareLabels(
|
|
929
929
|
if (featureLayer.fields) {
|
930
930
|
featureLayer.fields.forEach(
|
931
931
|
field => {
|
932
|
-
if (fields.indexOf(field.name.toLowerCase()) > -1) {
|
932
|
+
if (filterFields ? fields.indexOf(field.name.toLowerCase()) > -1 : true) {
|
933
933
|
const lowercaseFieldname = field.name.toLowerCase();
|
934
934
|
attributeOrigNames[lowercaseFieldname] = field.name;
|
935
935
|
attributeDomains[lowercaseFieldname] = field.domain;
|
@@ -941,7 +941,7 @@ export async function _prepareLabels(
|
|
941
941
|
// Feature layer is missing fields, so get info from first feature
|
942
942
|
Object.keys(featureSet[0]).forEach(
|
943
943
|
fieldName => {
|
944
|
-
if (fields.indexOf(fieldName.toLowerCase()) > -1) {
|
944
|
+
if (filterFields ? fields.indexOf(fieldName.toLowerCase()) > -1 : true) {
|
945
945
|
const lowercaseFieldname = fieldName.toLowerCase();
|
946
946
|
attributeOrigNames[lowercaseFieldname] = fieldName;
|
947
947
|
}
|
@@ -2362,12 +2362,12 @@ const lineSeparatorChar = "|";
|
|
2362
2362
|
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
2363
2363
|
* @returns selectionSetNames that will be used for export filenames
|
2364
2364
|
*/
|
2365
|
-
async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false, fields =
|
2365
|
+
async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
|
2366
2366
|
const labelRequests = [];
|
2367
2367
|
Object.keys(exportInfos).forEach(k => {
|
2368
2368
|
var _a;
|
2369
2369
|
const labelInfo = exportInfos[k];
|
2370
|
-
labelRequests.push(_prepareLabels(webmap, ((_a = labelInfo.layerView) === null || _a === void 0 ? void 0 : _a.layer) || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames));
|
2370
|
+
labelRequests.push(_prepareLabels(webmap, ((_a = labelInfo.layerView) === null || _a === void 0 ? void 0 : _a.layer) || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames, filterFields));
|
2371
2371
|
if (isCSVExport) {
|
2372
2372
|
// add the layer id as a temp value separator that we can use to split values for CSV export
|
2373
2373
|
labelRequests.push(Promise.resolve([[k]]));
|
@@ -2387,8 +2387,8 @@ async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = tr
|
|
2387
2387
|
* @param addColumnTitle Indicates if column headings should be included in output
|
2388
2388
|
* @returns Promise resolving when function is done
|
2389
2389
|
*/
|
2390
|
-
async function downloadCSV(webmap, exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false, fields =
|
2391
|
-
let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames);
|
2390
|
+
async function downloadCSV(webmap, exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
|
2391
|
+
let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames, filterFields);
|
2392
2392
|
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
2393
2393
|
const layerIds = Object.keys(exportInfos);
|
2394
2394
|
let layerLabels = [];
|
@@ -2924,10 +2924,7 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
|
|
2924
2924
|
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
2925
2925
|
* @returns Promise resolving when function is done
|
2926
2926
|
*/
|
2927
|
-
async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false, fields =
|
2928
|
-
if (fields.length === 0) {
|
2929
|
-
fields = layer.fields.map(f => f.name.toLowerCase());
|
2930
|
-
}
|
2927
|
+
async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
|
2931
2928
|
// Get the label formatting, if any
|
2932
2929
|
const labelFormatProps = await _getLabelFormat(webmap, layer, formatUsingLayerPopup);
|
2933
2930
|
// Because the label may actually come from a related layer, we'll use the layer that comes back from _getLabelFormat.
|
@@ -2994,7 +2991,7 @@ async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true,
|
|
2994
2991
|
const attributeDomains = {};
|
2995
2992
|
if (featureLayer.fields) {
|
2996
2993
|
featureLayer.fields.forEach(field => {
|
2997
|
-
if (fields.indexOf(field.name.toLowerCase()) > -1) {
|
2994
|
+
if (filterFields ? fields.indexOf(field.name.toLowerCase()) > -1 : true) {
|
2998
2995
|
const lowercaseFieldname = field.name.toLowerCase();
|
2999
2996
|
attributeOrigNames[lowercaseFieldname] = field.name;
|
3000
2997
|
attributeDomains[lowercaseFieldname] = field.domain;
|
@@ -3005,7 +3002,7 @@ async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true,
|
|
3005
3002
|
else {
|
3006
3003
|
// Feature layer is missing fields, so get info from first feature
|
3007
3004
|
Object.keys(featureSet[0]).forEach(fieldName => {
|
3008
|
-
if (fields.indexOf(fieldName.toLowerCase()) > -1) {
|
3005
|
+
if (filterFields ? fields.indexOf(fieldName.toLowerCase()) > -1 : true) {
|
3009
3006
|
const lowercaseFieldname = fieldName.toLowerCase();
|
3010
3007
|
attributeOrigNames[lowercaseFieldname] = fieldName;
|
3011
3008
|
}
|
@@ -183,6 +183,13 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
183
183
|
this._initToolInfos();
|
184
184
|
}
|
185
185
|
}
|
186
|
+
/**
|
187
|
+
* watch for changes in map info and update the toolbar
|
188
|
+
*/
|
189
|
+
async mapInfoWatchHandler() {
|
190
|
+
this._initToolInfos();
|
191
|
+
this._updateToolbar();
|
192
|
+
}
|
186
193
|
/**
|
187
194
|
* watch for changes in map view and get the first layer
|
188
195
|
*/
|
@@ -1294,7 +1301,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1294
1301
|
exportInfos, false, // formatUsingLayerPopup
|
1295
1302
|
false, // removeDuplicates
|
1296
1303
|
true, // addColumnTitle
|
1297
|
-
fields, true);
|
1304
|
+
fields, true, true);
|
1298
1305
|
this._updateToolInfoLoading("export", false);
|
1299
1306
|
this._csvExporting = false;
|
1300
1307
|
}
|
@@ -1439,6 +1446,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1439
1446
|
"enableShare": ["enableShareWatchHandler"],
|
1440
1447
|
"_controlsThatFit": ["_controlsThatFitWatchHandler"],
|
1441
1448
|
"isMobile": ["isMobileWatchHandler"],
|
1449
|
+
"mapInfo": ["mapInfoWatchHandler"],
|
1442
1450
|
"mapView": ["mapViewWatchHandler"],
|
1443
1451
|
"_layer": ["_layerWatchHandler"],
|
1444
1452
|
"selectedIds": ["selectedIdsWatchHandler"]
|
@@ -1479,6 +1487,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
|
|
1479
1487
|
"enableShare": ["enableShareWatchHandler"],
|
1480
1488
|
"_controlsThatFit": ["_controlsThatFitWatchHandler"],
|
1481
1489
|
"isMobile": ["isMobileWatchHandler"],
|
1490
|
+
"mapInfo": ["mapInfoWatchHandler"],
|
1482
1491
|
"mapView": ["mapViewWatchHandler"],
|
1483
1492
|
"_layer": ["_layerWatchHandler"],
|
1484
1493
|
"selectedIds": ["selectedIdsWatchHandler"]
|
@@ -6,7 +6,7 @@
|
|
6
6
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-164d485a.js';
|
7
7
|
import { g as getLocaleComponentStrings, l as loadModules } from './locale-25a5ae3e.js';
|
8
8
|
import { q as queryFeaturesByID, g as getLayerOrTable, c as goToSelection, e as queryAllIds, f as queryFeatureIds, i as queryFeaturesByGlobalID } from './mapViewUtils-a177d4f9.js';
|
9
|
-
import { d as downloadCSV } from './downloadUtils-
|
9
|
+
import { d as downloadCSV } from './downloadUtils-be13a13d.js';
|
10
10
|
import './esri-loader-eda07632.js';
|
11
11
|
import './_commonjsHelpers-d5f9d613.js';
|
12
12
|
import './interfaces-586e863c.js';
|
@@ -235,6 +235,13 @@ const LayerTable = class {
|
|
235
235
|
this._initToolInfos();
|
236
236
|
}
|
237
237
|
}
|
238
|
+
/**
|
239
|
+
* watch for changes in map info and update the toolbar
|
240
|
+
*/
|
241
|
+
async mapInfoWatchHandler() {
|
242
|
+
this._initToolInfos();
|
243
|
+
this._updateToolbar();
|
244
|
+
}
|
238
245
|
/**
|
239
246
|
* watch for changes in map view and get the first layer
|
240
247
|
*/
|
@@ -1346,7 +1353,7 @@ const LayerTable = class {
|
|
1346
1353
|
exportInfos, false, // formatUsingLayerPopup
|
1347
1354
|
false, // removeDuplicates
|
1348
1355
|
true, // addColumnTitle
|
1349
|
-
fields, true);
|
1356
|
+
fields, true, true);
|
1350
1357
|
this._updateToolInfoLoading("export", false);
|
1351
1358
|
this._csvExporting = false;
|
1352
1359
|
}
|
@@ -1491,6 +1498,7 @@ const LayerTable = class {
|
|
1491
1498
|
"enableShare": ["enableShareWatchHandler"],
|
1492
1499
|
"_controlsThatFit": ["_controlsThatFitWatchHandler"],
|
1493
1500
|
"isMobile": ["isMobileWatchHandler"],
|
1501
|
+
"mapInfo": ["mapInfoWatchHandler"],
|
1494
1502
|
"mapView": ["mapViewWatchHandler"],
|
1495
1503
|
"_layer": ["_layerWatchHandler"],
|
1496
1504
|
"selectedIds": ["selectedIdsWatchHandler"]
|
@@ -1508,7 +1508,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
|
|
1508
1508
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1509
1509
|
* ====================================================================
|
1510
1510
|
*/
|
1511
|
-
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-
|
1511
|
+
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-623fddee.js')).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
|
1512
1512
|
/** ====================================================================
|
1513
1513
|
* @license
|
1514
1514
|
* jsPDF XMP metadata plugin
|
@@ -2362,12 +2362,12 @@ const lineSeparatorChar = "|";
|
|
2362
2362
|
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
2363
2363
|
* @returns selectionSetNames that will be used for export filenames
|
2364
2364
|
*/
|
2365
|
-
async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false, fields =
|
2365
|
+
async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
|
2366
2366
|
const labelRequests = [];
|
2367
2367
|
Object.keys(exportInfos).forEach(k => {
|
2368
2368
|
var _a;
|
2369
2369
|
const labelInfo = exportInfos[k];
|
2370
|
-
labelRequests.push(_prepareLabels(webmap, ((_a = labelInfo.layerView) === null || _a === void 0 ? void 0 : _a.layer) || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames));
|
2370
|
+
labelRequests.push(_prepareLabels(webmap, ((_a = labelInfo.layerView) === null || _a === void 0 ? void 0 : _a.layer) || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames, filterFields));
|
2371
2371
|
if (isCSVExport) {
|
2372
2372
|
// add the layer id as a temp value separator that we can use to split values for CSV export
|
2373
2373
|
labelRequests.push(Promise.resolve([[k]]));
|
@@ -2387,8 +2387,8 @@ async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = tr
|
|
2387
2387
|
* @param addColumnTitle Indicates if column headings should be included in output
|
2388
2388
|
* @returns Promise resolving when function is done
|
2389
2389
|
*/
|
2390
|
-
async function downloadCSV(webmap, exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false, fields =
|
2391
|
-
let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames);
|
2390
|
+
async function downloadCSV(webmap, exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
|
2391
|
+
let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames, filterFields);
|
2392
2392
|
labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
|
2393
2393
|
const layerIds = Object.keys(exportInfos);
|
2394
2394
|
let layerLabels = [];
|
@@ -2924,10 +2924,7 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
|
|
2924
2924
|
* @param includeHeaderNames Add the label format at the front of the list of generated labels
|
2925
2925
|
* @returns Promise resolving when function is done
|
2926
2926
|
*/
|
2927
|
-
async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false, fields =
|
2928
|
-
if (fields.length === 0) {
|
2929
|
-
fields = layer.fields.map(f => f.name.toLowerCase());
|
2930
|
-
}
|
2927
|
+
async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
|
2931
2928
|
// Get the label formatting, if any
|
2932
2929
|
const labelFormatProps = await _getLabelFormat(webmap, layer, formatUsingLayerPopup);
|
2933
2930
|
// Because the label may actually come from a related layer, we'll use the layer that comes back from _getLabelFormat.
|
@@ -2994,7 +2991,7 @@ async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true,
|
|
2994
2991
|
const attributeDomains = {};
|
2995
2992
|
if (featureLayer.fields) {
|
2996
2993
|
featureLayer.fields.forEach(field => {
|
2997
|
-
if (fields.indexOf(field.name.toLowerCase()) > -1) {
|
2994
|
+
if (filterFields ? fields.indexOf(field.name.toLowerCase()) > -1 : true) {
|
2998
2995
|
const lowercaseFieldname = field.name.toLowerCase();
|
2999
2996
|
attributeOrigNames[lowercaseFieldname] = field.name;
|
3000
2997
|
attributeDomains[lowercaseFieldname] = field.domain;
|
@@ -3005,7 +3002,7 @@ async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true,
|
|
3005
3002
|
else {
|
3006
3003
|
// Feature layer is missing fields, so get info from first feature
|
3007
3004
|
Object.keys(featureSet[0]).forEach(fieldName => {
|
3008
|
-
if (fields.indexOf(fieldName.toLowerCase()) > -1) {
|
3005
|
+
if (filterFields ? fields.indexOf(fieldName.toLowerCase()) > -1 : true) {
|
3009
3006
|
const lowercaseFieldname = fieldName.toLowerCase();
|
3010
3007
|
attributeOrigNames[lowercaseFieldname] = fieldName;
|
3011
3008
|
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { a as commonjsGlobal, c as createCommonjsModule, g as getDefaultExportFromCjs } from './_commonjsHelpers-d5f9d613.js';
|
7
|
-
import { _ as _typeof_1 } from './downloadUtils-
|
7
|
+
import { _ as _typeof_1 } from './downloadUtils-be13a13d.js';
|
8
8
|
import './index-164d485a.js';
|
9
9
|
import './locale-25a5ae3e.js';
|
10
10
|
import './esri-loader-eda07632.js';
|