@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.
Files changed (30) hide show
  1. package/dist/cjs/card-manager_3.cjs.entry.js +10 -2
  2. package/dist/cjs/{downloadUtils-7d4985c0.js → downloadUtils-abf7decd.js} +8 -11
  3. package/dist/cjs/{index.es-8cef354a.js → index.es-478ec781.js} +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
  6. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  7. package/dist/cjs/solutions-components.cjs.js +1 -1
  8. package/dist/collection/components/layer-table/layer-table.js +11 -1
  9. package/dist/collection/utils/downloadUtils.js +7 -10
  10. package/dist/collection/utils/downloadUtils.ts +13 -13
  11. package/dist/components/downloadUtils.js +7 -10
  12. package/dist/components/layer-table2.js +10 -1
  13. package/dist/esm/card-manager_3.entry.js +10 -2
  14. package/dist/esm/{downloadUtils-d5928e55.js → downloadUtils-be13a13d.js} +8 -11
  15. package/dist/esm/{index.es-a1725c19.js → index.es-623fddee.js} +1 -1
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/map-select-tools_3.entry.js +1 -1
  18. package/dist/esm/public-notification.entry.js +1 -1
  19. package/dist/esm/solutions-components.js +1 -1
  20. package/dist/solutions-components/{p-3e88e0bd.entry.js → p-0c427d9a.entry.js} +1 -1
  21. package/dist/solutions-components/{p-7f374ec7.js → p-2bec3d88.js} +1 -1
  22. package/dist/solutions-components/{p-ac9c29da.entry.js → p-9294f273.entry.js} +1 -1
  23. package/dist/solutions-components/{p-12fc82a9.js → p-dc4fcddc.js} +3 -3
  24. package/dist/solutions-components/p-f053c268.entry.js +6 -0
  25. package/dist/solutions-components/solutions-components.esm.js +1 -1
  26. package/dist/solutions-components/utils/downloadUtils.ts +13 -13
  27. package/dist/types/components/layer-table/layer-table.d.ts +4 -0
  28. package/dist/types/utils/downloadUtils.d.ts +3 -3
  29. package/package.json +1 -1
  30. package/dist/solutions-components/p-45698f2a.entry.js +0 -6
@@ -10,7 +10,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
10
10
  const index = require('./index-105cf2b9.js');
11
11
  const locale = require('./locale-8c42ba7a.js');
12
12
  const mapViewUtils = require('./mapViewUtils-290dbc9e.js');
13
- const downloadUtils = require('./downloadUtils-7d4985c0.js');
13
+ const downloadUtils = require('./downloadUtils-abf7decd.js');
14
14
  require('./esri-loader-a91c0ec1.js');
15
15
  require('./_commonjsHelpers-384729db.js');
16
16
  require('./interfaces-7cd0a48a.js');
@@ -239,6 +239,13 @@ const LayerTable = class {
239
239
  this._initToolInfos();
240
240
  }
241
241
  }
242
+ /**
243
+ * watch for changes in map info and update the toolbar
244
+ */
245
+ async mapInfoWatchHandler() {
246
+ this._initToolInfos();
247
+ this._updateToolbar();
248
+ }
242
249
  /**
243
250
  * watch for changes in map view and get the first layer
244
251
  */
@@ -1350,7 +1357,7 @@ const LayerTable = class {
1350
1357
  exportInfos, false, // formatUsingLayerPopup
1351
1358
  false, // removeDuplicates
1352
1359
  true, // addColumnTitle
1353
- fields, true);
1360
+ fields, true, true);
1354
1361
  this._updateToolInfoLoading("export", false);
1355
1362
  this._csvExporting = false;
1356
1363
  }
@@ -1495,6 +1502,7 @@ const LayerTable = class {
1495
1502
  "enableShare": ["enableShareWatchHandler"],
1496
1503
  "_controlsThatFit": ["_controlsThatFitWatchHandler"],
1497
1504
  "isMobile": ["isMobileWatchHandler"],
1505
+ "mapInfo": ["mapInfoWatchHandler"],
1498
1506
  "mapView": ["mapViewWatchHandler"],
1499
1507
  "_layer": ["_layerWatchHandler"],
1500
1508
  "selectedIds": ["selectedIdsWatchHandler"]
@@ -1510,7 +1510,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
1510
1510
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1511
1511
  * ====================================================================
1512
1512
  */
1513
- function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):Promise.resolve().then(function () { return require('./index.es-8cef354a.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},
1513
+ function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):Promise.resolve().then(function () { return require('./index.es-478ec781.js'); })).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
1514
1514
  /** ====================================================================
1515
1515
  * @license
1516
1516
  * jsPDF XMP metadata plugin
@@ -2364,12 +2364,12 @@ const lineSeparatorChar = "|";
2364
2364
  * @param includeHeaderNames Add the label format at the front of the list of generated labels
2365
2365
  * @returns selectionSetNames that will be used for export filenames
2366
2366
  */
2367
- async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false, fields = [], useFieldAliasNames = false) {
2367
+ async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = true, includeHeaderNames = false, isCSVExport = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
2368
2368
  const labelRequests = [];
2369
2369
  Object.keys(exportInfos).forEach(k => {
2370
2370
  var _a;
2371
2371
  const labelInfo = exportInfos[k];
2372
- labelRequests.push(_prepareLabels(webmap, ((_a = labelInfo.layerView) === null || _a === void 0 ? void 0 : _a.layer) || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames));
2372
+ labelRequests.push(_prepareLabels(webmap, ((_a = labelInfo.layerView) === null || _a === void 0 ? void 0 : _a.layer) || labelInfo.layer, labelInfo.ids, formatUsingLayerPopup, includeHeaderNames, fields, useFieldAliasNames, filterFields));
2373
2373
  if (isCSVExport) {
2374
2374
  // add the layer id as a temp value separator that we can use to split values for CSV export
2375
2375
  labelRequests.push(Promise.resolve([[k]]));
@@ -2389,8 +2389,8 @@ async function consolidateLabels(webmap, exportInfos, formatUsingLayerPopup = tr
2389
2389
  * @param addColumnTitle Indicates if column headings should be included in output
2390
2390
  * @returns Promise resolving when function is done
2391
2391
  */
2392
- async function downloadCSV(webmap, exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false, fields = [], useFieldAliasNames = false) {
2393
- let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames);
2392
+ async function downloadCSV(webmap, exportInfos, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
2393
+ let labels = await consolidateLabels(webmap, exportInfos, formatUsingLayerPopup, addColumnTitle, true, fields, useFieldAliasNames, filterFields);
2394
2394
  labels = removeDuplicates ? removeDuplicateLabels(labels) : labels;
2395
2395
  const layerIds = Object.keys(exportInfos);
2396
2396
  let layerLabels = [];
@@ -2926,10 +2926,7 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
2926
2926
  * @param includeHeaderNames Add the label format at the front of the list of generated labels
2927
2927
  * @returns Promise resolving when function is done
2928
2928
  */
2929
- async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false, fields = [], useFieldAliasNames = false) {
2930
- if (fields.length === 0) {
2931
- fields = layer.fields.map(f => f.name.toLowerCase());
2932
- }
2929
+ async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true, includeHeaderNames = false, fields = undefined, useFieldAliasNames = false, filterFields = false) {
2933
2930
  // Get the label formatting, if any
2934
2931
  const labelFormatProps = await _getLabelFormat(webmap, layer, formatUsingLayerPopup);
2935
2932
  // Because the label may actually come from a related layer, we'll use the layer that comes back from _getLabelFormat.
@@ -2996,7 +2993,7 @@ async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true,
2996
2993
  const attributeDomains = {};
2997
2994
  if (featureLayer.fields) {
2998
2995
  featureLayer.fields.forEach(field => {
2999
- if (fields.indexOf(field.name.toLowerCase()) > -1) {
2996
+ if (filterFields ? fields.indexOf(field.name.toLowerCase()) > -1 : true) {
3000
2997
  const lowercaseFieldname = field.name.toLowerCase();
3001
2998
  attributeOrigNames[lowercaseFieldname] = field.name;
3002
2999
  attributeDomains[lowercaseFieldname] = field.domain;
@@ -3007,7 +3004,7 @@ async function _prepareLabels(webmap, layer, ids, formatUsingLayerPopup = true,
3007
3004
  else {
3008
3005
  // Feature layer is missing fields, so get info from first feature
3009
3006
  Object.keys(featureSet[0]).forEach(fieldName => {
3010
- if (fields.indexOf(fieldName.toLowerCase()) > -1) {
3007
+ if (filterFields ? fields.indexOf(fieldName.toLowerCase()) > -1 : true) {
3011
3008
  const lowercaseFieldname = fieldName.toLowerCase();
3012
3009
  attributeOrigNames[lowercaseFieldname] = fieldName;
3013
3010
  }
@@ -6,7 +6,7 @@
6
6
  'use strict';
7
7
 
8
8
  const _commonjsHelpers = require('./_commonjsHelpers-384729db.js');
9
- const downloadUtils = require('./downloadUtils-7d4985c0.js');
9
+ const downloadUtils = require('./downloadUtils-abf7decd.js');
10
10
  require('./index-105cf2b9.js');
11
11
  require('./locale-8c42ba7a.js');
12
12
  require('./esri-loader-a91c0ec1.js');