@esri/solutions-components 0.8.61 → 0.8.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/cjs/calcite-alert_4.cjs.entry.js +2 -2
  2. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +1 -1
  3. package/dist/cjs/card-manager_3.cjs.entry.js +33 -24
  4. package/dist/cjs/{downloadUtils-f4b01945.js → downloadUtils-85009d64.js} +5 -2
  5. package/dist/cjs/feature-list.cjs.entry.js +2 -2
  6. package/dist/cjs/{index.es-08ff626f.js → index.es-cc49d45d.js} +1 -1
  7. package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
  8. package/dist/cjs/{popupUtils-64405c62.js → popupUtils-fe880b9e.js} +1 -1
  9. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  10. package/dist/cjs/solution-configuration.cjs.entry.js +1 -1
  11. package/dist/cjs/solution-contents_3.cjs.entry.js +1 -1
  12. package/dist/cjs/{solution-store-d9f3ea44.js → solution-store-4e35404b.js} +10 -0
  13. package/dist/cjs/store-manager.cjs.entry.js +1 -1
  14. package/dist/collection/components/layer-table/layer-table.js +32 -23
  15. package/dist/collection/utils/downloadUtils.js +4 -1
  16. package/dist/collection/utils/downloadUtils.ts +4 -1
  17. package/dist/components/downloadUtils.js +4 -1
  18. package/dist/components/layer-table2.js +32 -23
  19. package/dist/components/solution-store.js +10 -0
  20. package/dist/esm/calcite-alert_4.entry.js +2 -2
  21. package/dist/esm/calcite-shell-panel_14.entry.js +1 -1
  22. package/dist/esm/card-manager_3.entry.js +33 -24
  23. package/dist/esm/{downloadUtils-408e0384.js → downloadUtils-f2c49e23.js} +5 -2
  24. package/dist/esm/feature-list.entry.js +2 -2
  25. package/dist/esm/{index.es-cac1405b.js → index.es-680dba03.js} +1 -1
  26. package/dist/esm/map-select-tools_3.entry.js +1 -1
  27. package/dist/esm/{popupUtils-142f616a.js → popupUtils-21b9dbe5.js} +1 -1
  28. package/dist/esm/public-notification.entry.js +1 -1
  29. package/dist/esm/solution-configuration.entry.js +1 -1
  30. package/dist/esm/solution-contents_3.entry.js +1 -1
  31. package/dist/esm/{solution-store-1c36ce1d.js → solution-store-840c5489.js} +10 -0
  32. package/dist/esm/store-manager.entry.js +1 -1
  33. package/dist/solutions-components/{p-7b9207e4.entry.js → p-1412173c.entry.js} +1 -1
  34. package/dist/solutions-components/{p-54562381.entry.js → p-14900698.entry.js} +1 -1
  35. package/dist/solutions-components/{p-67c3ac62.js → p-17946a3f.js} +2 -2
  36. package/dist/solutions-components/{p-120a2091.entry.js → p-1d285ae1.entry.js} +1 -1
  37. package/dist/solutions-components/{p-d783ae9a.entry.js → p-2a8b04de.entry.js} +1 -1
  38. package/dist/solutions-components/{p-742b5af7.js → p-2fb21ae5.js} +1 -1
  39. package/dist/solutions-components/{p-90864588.entry.js → p-42c2d9d8.entry.js} +1 -1
  40. package/dist/solutions-components/{p-faed40ad.entry.js → p-72347474.entry.js} +1 -1
  41. package/dist/solutions-components/{p-fea7535c.js → p-75cb415f.js} +1 -1
  42. package/dist/solutions-components/{p-057f9296.entry.js → p-8100a48d.entry.js} +1 -1
  43. package/dist/solutions-components/{p-6f4a40fa.entry.js → p-bf0bb8c2.entry.js} +1 -1
  44. package/dist/solutions-components/{p-2afdcdfc.js → p-c1936856.js} +1 -1
  45. package/dist/solutions-components/p-cd8d6e52.entry.js +6 -0
  46. package/dist/solutions-components/solutions-components.esm.js +1 -1
  47. package/dist/solutions-components/utils/downloadUtils.ts +4 -1
  48. package/dist/types/components/layer-table/layer-table.d.ts +8 -0
  49. package/package.json +6 -6
  50. package/dist/solutions-components/p-03b07165.entry.js +0 -6
@@ -17,7 +17,7 @@ const t9n = require('./t9n-ef615628.js');
17
17
  const resources = require('./resources-6146eb17.js');
18
18
  const locale$1 = require('./locale-31289fc5.js');
19
19
  const mapViewUtils = require('./mapViewUtils-78b14528.js');
20
- const popupUtils = require('./popupUtils-64405c62.js');
20
+ const popupUtils = require('./popupUtils-fe880b9e.js');
21
21
  require('./guid-a7528dfa.js');
22
22
  require('./resources-1c0e54c1.js');
23
23
  require('./key-7ed07912.js');
@@ -25,7 +25,7 @@ require('./observers-2a59d471.js');
25
25
  require('./esri-loader-08dc41bd.js');
26
26
  require('./_commonjsHelpers-baf43783.js');
27
27
  require('./interfaces-7cd0a48a.js');
28
- require('./downloadUtils-f4b01945.js');
28
+ require('./downloadUtils-85009d64.js');
29
29
  require('./solution-resource-a09a6fe0.js');
30
30
  require('./index-f64944ad.js');
31
31
  require('./restHelpersGet-be451f4a.js');
@@ -25,7 +25,7 @@ const sortableComponent = require('./sortableComponent-b1b229bf.js');
25
25
  const resources$2 = require('./resources-c35bef76.js');
26
26
  const resources$1 = require('./resources-5ba856a7.js');
27
27
  const locale$1 = require('./locale-31289fc5.js');
28
- const solutionStore = require('./solution-store-d9f3ea44.js');
28
+ const solutionStore = require('./solution-store-4e35404b.js');
29
29
  const interfaces = require('./interfaces-7cd0a48a.js');
30
30
  const solutionResource = require('./solution-resource-a09a6fe0.js');
31
31
  require('./index-f64944ad.js');
@@ -10,7 +10,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
10
10
  const index = require('./index-ff18be0d.js');
11
11
  const locale = require('./locale-31289fc5.js');
12
12
  const mapViewUtils = require('./mapViewUtils-78b14528.js');
13
- const downloadUtils = require('./downloadUtils-f4b01945.js');
13
+ const downloadUtils = require('./downloadUtils-85009d64.js');
14
14
  require('./esri-loader-08dc41bd.js');
15
15
  require('./_commonjsHelpers-baf43783.js');
16
16
  require('./interfaces-7cd0a48a.js');
@@ -130,6 +130,10 @@ const LayerTable = class {
130
130
  * boolean: When true the default OID provided via url param has been honored and should now be ignored
131
131
  */
132
132
  this._defaultOidHonored = false;
133
+ /**
134
+ * boolean: When true the table has been successfully loaded
135
+ */
136
+ this._loaded = false;
133
137
  /**
134
138
  * boolean: When true the observer has been set and we don't need to set it again
135
139
  */
@@ -415,7 +419,7 @@ const LayerTable = class {
415
419
  const selected = this.selectedIds.length.toString();
416
420
  const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
417
421
  this._validateActiveActions();
418
- return (index.h(index.Host, { key: 'ac2aafd7877dc7c97067dbf0d7ae642799ff6af7' }, index.h("calcite-shell", { key: '06963da4964e6075f09c21506af9b0fdc2a62a4f' }, this._getTableControlRow("header"), index.h("div", { key: '1d1c5aede89e78f61f677234a81d3960acdd9a73', class: `width-full ${tableHeightClass}` }, index.h("calcite-panel", { key: 'c9b8336e1d0dc77faec304b26a04673be63173d6', class: "height-full width-full" }, index.h("calcite-loader", { key: 'abd051ee71d7d73e67480593911f7e20b3121b0c', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), index.h("div", { key: 'e9ba0160f5c74aae1fa9f0ce97e698d034bb09da', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (index.h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
422
+ return (index.h(index.Host, { key: '9707f29bc69d0b56ae548b8004af6a0872105a40' }, index.h("calcite-shell", { key: 'e44e4b3dc934efec9698f6a9a24c21a1e1755e34' }, this._getTableControlRow("header"), index.h("div", { key: '88e82fe17e8f6c2bf01f0353c30992c108c6b9f1', class: `width-full ${tableHeightClass}` }, index.h("calcite-panel", { key: '463130e64abde593fafa0333daf6dabec116a33a', class: "height-full width-full" }, index.h("calcite-loader", { key: '2aa6e9a0ebf5508253adfb5a6d71340e7de01df2', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), index.h("div", { key: '0d50f1bed585ab19a31d6875fab1f0fbdbc957d3', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (index.h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
419
423
  .replace("{{total}}", total)
420
424
  .replace("{{selected}}", selected))) : undefined)), this._filterModal()));
421
425
  }
@@ -1079,16 +1083,11 @@ const LayerTable = class {
1079
1083
  */
1080
1084
  _resetColumnTemplates() {
1081
1085
  var _a, _b;
1082
- console.log("_resetColumnTemplates");
1083
1086
  const columnTemplates = this._getColumnTemplates((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id, (_b = this._layer) === null || _b === void 0 ? void 0 : _b.fields);
1084
1087
  const hasChange = columnTemplates === null || columnTemplates === void 0 ? void 0 : columnTemplates.some((ct, i) => {
1085
1088
  var _a;
1086
1089
  return JSON.stringify((_a = this._table) === null || _a === void 0 ? void 0 : _a.tableTemplate.columnTemplates[i]) !== JSON.stringify(ct);
1087
1090
  });
1088
- console.log(this._table);
1089
- console.log(columnTemplates);
1090
- console.log(hasChange);
1091
- console.log(!this._columnsInfo);
1092
1091
  if (this._table && columnTemplates && (hasChange || !this._columnsInfo)) {
1093
1092
  this._table.tableTemplate = new this.TableTemplate({
1094
1093
  columnTemplates
@@ -1102,9 +1101,7 @@ const LayerTable = class {
1102
1101
  */
1103
1102
  async _resetTable() {
1104
1103
  var _a;
1105
- console.log("_resetTable");
1106
- console.log(this._table);
1107
- console.log(this._layer);
1104
+ this._loaded = false;
1108
1105
  this._clearSelection();
1109
1106
  this._allIds = await mapViewUtils.queryAllIds(this._layer);
1110
1107
  if (!this._table) {
@@ -1119,10 +1116,26 @@ const LayerTable = class {
1119
1116
  this._checkEditEnabled();
1120
1117
  this._table.editingEnabled = this._editEnabled && this.enableInlineEdit;
1121
1118
  await this._table.when();
1122
- console.log("after table when");
1119
+ // This is a workaround.
1120
+ // In some cases the first time the app is loaded this._table.state === "loaded" is not being hit.
1121
+ // When this issue occurs we will wait for 1 second and attempt to finish the loading process
1122
+ setTimeout(() => {
1123
+ if (!this._loaded) {
1124
+ console.log(`table.state: ${this._table.state}`);
1125
+ void this.finishLoading();
1126
+ }
1127
+ }, 1000);
1123
1128
  await this.reactiveUtils.once(() => this._table.state === "loaded")
1124
1129
  .then(async () => {
1125
- console.log("this._table.state === 'loaded'");
1130
+ await this.finishLoading();
1131
+ });
1132
+ }
1133
+ /**
1134
+ * Finish the table loading tasks
1135
+ */
1136
+ async finishLoading() {
1137
+ try {
1138
+ this._loaded = true;
1126
1139
  this._table.highlightIds.removeAll();
1127
1140
  this._table.clearSelectionFilter();
1128
1141
  this._resetColumnTemplates();
@@ -1131,7 +1144,10 @@ const LayerTable = class {
1131
1144
  await this._sortTable();
1132
1145
  this._initToolInfos();
1133
1146
  this._updateToolbar();
1134
- });
1147
+ }
1148
+ catch (e) {
1149
+ console.log(e);
1150
+ }
1135
1151
  }
1136
1152
  /**
1137
1153
  * Update the current IDs when that layers data is modified
@@ -1226,23 +1242,18 @@ const LayerTable = class {
1226
1242
  * Sort the table with the configured field and the sort order
1227
1243
  */
1228
1244
  async _sortTable() {
1229
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1230
- console.log("_sortTable");
1231
- console.log(this._table);
1232
- console.log(this._layer);
1233
- console.log((_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.layerOptions) === null || _b === void 0 ? void 0 : _b.layers);
1234
- console.log((_d = (_c = this.mapInfo) === null || _c === void 0 ? void 0 : _c.layerOptions) === null || _d === void 0 ? void 0 : _d.layers);
1245
+ var _a, _b, _c, _d, _e, _f;
1235
1246
  //By default sort the table using objectIdField and in descending order
1236
- let sortField = (_e = this._layer) === null || _e === void 0 ? void 0 : _e.objectIdField;
1247
+ let sortField = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.objectIdField;
1237
1248
  let sortOrder = 'desc';
1238
1249
  let configuredLayer;
1239
1250
  //get the sortField and sortOrder from the configuration
1240
- if (((_h = (_g = (_f = this.mapInfo) === null || _f === void 0 ? void 0 : _f.layerOptions) === null || _g === void 0 ? void 0 : _g.layers) === null || _h === void 0 ? void 0 : _h.length) > 0 && ((_j = this._layer) === null || _j === void 0 ? void 0 : _j.id)) {
1251
+ if (((_d = (_c = (_b = this.mapInfo) === null || _b === void 0 ? void 0 : _b.layerOptions) === null || _c === void 0 ? void 0 : _c.layers) === null || _d === void 0 ? void 0 : _d.length) > 0 && ((_e = this._layer) === null || _e === void 0 ? void 0 : _e.id)) {
1241
1252
  configuredLayer = this.mapInfo.layerOptions.layers.filter((layer) => layer.id === this._layer.id);
1242
1253
  if (configuredLayer && configuredLayer.length > 0) {
1243
1254
  configuredLayer = configuredLayer[0];
1244
1255
  //if sort field is defined and sortField is available in the fields then use it
1245
- if (configuredLayer.sortField && ((_k = configuredLayer.fields) === null || _k === void 0 ? void 0 : _k.includes(configuredLayer.sortField))) {
1256
+ if (configuredLayer.sortField && ((_f = configuredLayer.fields) === null || _f === void 0 ? void 0 : _f.includes(configuredLayer.sortField))) {
1246
1257
  sortField = configuredLayer.sortField;
1247
1258
  }
1248
1259
  //use sort order if configured
@@ -1250,10 +1261,8 @@ const LayerTable = class {
1250
1261
  }
1251
1262
  }
1252
1263
  if (this._table && this._layer) {
1253
- console.log("has layer and has table");
1254
1264
  await this._table.when();
1255
1265
  await this._layer.when(() => {
1256
- console.log("sort on this._layer.when");
1257
1266
  this._table.sortColumn(sortField, sortOrder);
1258
1267
  });
1259
1268
  }
@@ -1512,7 +1512,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
1512
1512
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1513
1513
  * ====================================================================
1514
1514
  */
1515
- function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):Promise.resolve().then(function () { return require('./index.es-08ff626f.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},
1515
+ function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):Promise.resolve().then(function () { return require('./index.es-cc49d45d.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},
1516
1516
  /** ====================================================================
1517
1517
  * @license
1518
1518
  * jsPDF XMP metadata plugin
@@ -2937,7 +2937,10 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
2937
2937
  value = intl.formatNumber(value, numberFormatIntlOptions);
2938
2938
  }
2939
2939
  else {
2940
- value = intl.formatNumber(value);
2940
+ value = intl.formatNumber(value, {
2941
+ maximumFractionDigits: 100,
2942
+ maximumSignificantDigits: 21
2943
+ });
2941
2944
  }
2942
2945
  break;
2943
2946
  }
@@ -9,11 +9,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  const index = require('./index-ff18be0d.js');
11
11
  const locale = require('./locale-31289fc5.js');
12
- const popupUtils = require('./popupUtils-64405c62.js');
12
+ const popupUtils = require('./popupUtils-fe880b9e.js');
13
13
  const mapViewUtils = require('./mapViewUtils-78b14528.js');
14
14
  require('./esri-loader-08dc41bd.js');
15
15
  require('./_commonjsHelpers-baf43783.js');
16
- require('./downloadUtils-f4b01945.js');
16
+ require('./downloadUtils-85009d64.js');
17
17
  require('./solution-resource-a09a6fe0.js');
18
18
  require('./index-f64944ad.js');
19
19
  require('./restHelpersGet-be451f4a.js');
@@ -6,7 +6,7 @@
6
6
  'use strict';
7
7
 
8
8
  const _commonjsHelpers = require('./_commonjsHelpers-baf43783.js');
9
- const downloadUtils = require('./downloadUtils-f4b01945.js');
9
+ const downloadUtils = require('./downloadUtils-85009d64.js');
10
10
  require('./index-ff18be0d.js');
11
11
  require('./locale-31289fc5.js');
12
12
  require('./esri-loader-08dc41bd.js');
@@ -12,7 +12,7 @@ const locale = require('./locale-31289fc5.js');
12
12
  const mapViewUtils = require('./mapViewUtils-78b14528.js');
13
13
  const interfaces = require('./interfaces-7cd0a48a.js');
14
14
  const publicNotificationStore = require('./publicNotificationStore-691f6f30.js');
15
- const downloadUtils = require('./downloadUtils-f4b01945.js');
15
+ const downloadUtils = require('./downloadUtils-85009d64.js');
16
16
  require('./esri-loader-08dc41bd.js');
17
17
  require('./_commonjsHelpers-baf43783.js');
18
18
  require('./index-97020c9d.js');
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const downloadUtils = require('./downloadUtils-f4b01945.js');
8
+ const downloadUtils = require('./downloadUtils-85009d64.js');
9
9
  const locale = require('./locale-31289fc5.js');
10
10
 
11
11
  /** @license
@@ -12,7 +12,7 @@ const interfaces = require('./interfaces-7cd0a48a.js');
12
12
  const locale = require('./locale-31289fc5.js');
13
13
  const mapViewUtils = require('./mapViewUtils-78b14528.js');
14
14
  const publicNotificationStore = require('./publicNotificationStore-691f6f30.js');
15
- const downloadUtils = require('./downloadUtils-f4b01945.js');
15
+ const downloadUtils = require('./downloadUtils-85009d64.js');
16
16
  require('./esri-loader-08dc41bd.js');
17
17
  require('./_commonjsHelpers-baf43783.js');
18
18
  require('./index-97020c9d.js');
@@ -9,7 +9,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  const index = require('./index-ff18be0d.js');
11
11
  const templates = require('./templates-f7a3bf48.js');
12
- const solutionStore = require('./solution-store-d9f3ea44.js');
12
+ const solutionStore = require('./solution-store-4e35404b.js');
13
13
  require('./solution-resource-a09a6fe0.js');
14
14
  const restHelpersGet = require('./restHelpersGet-be451f4a.js');
15
15
  require('./index-f64944ad.js');
@@ -8,7 +8,7 @@
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  const index = require('./index-ff18be0d.js');
11
- const solutionStore = require('./solution-store-d9f3ea44.js');
11
+ const solutionStore = require('./solution-store-4e35404b.js');
12
12
  const locale = require('./locale-31289fc5.js');
13
13
  const common = require('./common-7ee7ad73.js');
14
14
  require('./index-97020c9d.js');
@@ -175,6 +175,16 @@ function updateItem$1(requestOptions) {
175
175
  if (requestOptions.params.extent && isBBox(requestOptions.params.extent)) {
176
176
  requestOptions.params.extent = bboxToString(requestOptions.params.extent);
177
177
  }
178
+ /* istanbul ignore if */
179
+ if (requestOptions.params.file &&
180
+ requestOptions.params.file.constructor &&
181
+ requestOptions.params.file.constructor.name === 'ReadStream') {
182
+ // dataSize is not an official parameter for the ArcGIS REST API but is needed
183
+ // to encode the ReadStream with an appropriate length. This is to overcome
184
+ // the form-data library bug:
185
+ // https://github.com/form-data/form-data/issues/508
186
+ requestOptions.params.dataSize = requestOptions.dataSize;
187
+ }
178
188
  return restHelpersGet.request(url, requestOptions);
179
189
  });
180
190
  }
@@ -8,7 +8,7 @@
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  const index = require('./index-ff18be0d.js');
11
- const solutionStore = require('./solution-store-d9f3ea44.js');
11
+ const solutionStore = require('./solution-store-4e35404b.js');
12
12
  const templates = require('./templates-f7a3bf48.js');
13
13
  require('./index-97020c9d.js');
14
14
  require('./interfaces-7cd0a48a.js');
@@ -43,6 +43,10 @@ export class LayerTable {
43
43
  * boolean: When true the default OID provided via url param has been honored and should now be ignored
44
44
  */
45
45
  this._defaultOidHonored = false;
46
+ /**
47
+ * boolean: When true the table has been successfully loaded
48
+ */
49
+ this._loaded = false;
46
50
  /**
47
51
  * boolean: When true the observer has been set and we don't need to set it again
48
52
  */
@@ -328,7 +332,7 @@ export class LayerTable {
328
332
  const selected = this.selectedIds.length.toString();
329
333
  const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
330
334
  this._validateActiveActions();
331
- return (h(Host, { key: 'ac2aafd7877dc7c97067dbf0d7ae642799ff6af7' }, h("calcite-shell", { key: '06963da4964e6075f09c21506af9b0fdc2a62a4f' }, this._getTableControlRow("header"), h("div", { key: '1d1c5aede89e78f61f677234a81d3960acdd9a73', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: 'c9b8336e1d0dc77faec304b26a04673be63173d6', class: "height-full width-full" }, h("calcite-loader", { key: 'abd051ee71d7d73e67480593911f7e20b3121b0c', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: 'e9ba0160f5c74aae1fa9f0ce97e698d034bb09da', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
335
+ return (h(Host, { key: '9707f29bc69d0b56ae548b8004af6a0872105a40' }, h("calcite-shell", { key: 'e44e4b3dc934efec9698f6a9a24c21a1e1755e34' }, this._getTableControlRow("header"), h("div", { key: '88e82fe17e8f6c2bf01f0353c30992c108c6b9f1', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: '463130e64abde593fafa0333daf6dabec116a33a', class: "height-full width-full" }, h("calcite-loader", { key: '2aa6e9a0ebf5508253adfb5a6d71340e7de01df2', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '0d50f1bed585ab19a31d6875fab1f0fbdbc957d3', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
332
336
  .replace("{{total}}", total)
333
337
  .replace("{{selected}}", selected))) : undefined)), this._filterModal()));
334
338
  }
@@ -992,16 +996,11 @@ export class LayerTable {
992
996
  */
993
997
  _resetColumnTemplates() {
994
998
  var _a, _b;
995
- console.log("_resetColumnTemplates");
996
999
  const columnTemplates = this._getColumnTemplates((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id, (_b = this._layer) === null || _b === void 0 ? void 0 : _b.fields);
997
1000
  const hasChange = columnTemplates === null || columnTemplates === void 0 ? void 0 : columnTemplates.some((ct, i) => {
998
1001
  var _a;
999
1002
  return JSON.stringify((_a = this._table) === null || _a === void 0 ? void 0 : _a.tableTemplate.columnTemplates[i]) !== JSON.stringify(ct);
1000
1003
  });
1001
- console.log(this._table);
1002
- console.log(columnTemplates);
1003
- console.log(hasChange);
1004
- console.log(!this._columnsInfo);
1005
1004
  if (this._table && columnTemplates && (hasChange || !this._columnsInfo)) {
1006
1005
  this._table.tableTemplate = new this.TableTemplate({
1007
1006
  columnTemplates
@@ -1015,9 +1014,7 @@ export class LayerTable {
1015
1014
  */
1016
1015
  async _resetTable() {
1017
1016
  var _a;
1018
- console.log("_resetTable");
1019
- console.log(this._table);
1020
- console.log(this._layer);
1017
+ this._loaded = false;
1021
1018
  this._clearSelection();
1022
1019
  this._allIds = await queryAllIds(this._layer);
1023
1020
  if (!this._table) {
@@ -1032,10 +1029,26 @@ export class LayerTable {
1032
1029
  this._checkEditEnabled();
1033
1030
  this._table.editingEnabled = this._editEnabled && this.enableInlineEdit;
1034
1031
  await this._table.when();
1035
- console.log("after table when");
1032
+ // This is a workaround.
1033
+ // In some cases the first time the app is loaded this._table.state === "loaded" is not being hit.
1034
+ // When this issue occurs we will wait for 1 second and attempt to finish the loading process
1035
+ setTimeout(() => {
1036
+ if (!this._loaded) {
1037
+ console.log(`table.state: ${this._table.state}`);
1038
+ void this.finishLoading();
1039
+ }
1040
+ }, 1000);
1036
1041
  await this.reactiveUtils.once(() => this._table.state === "loaded")
1037
1042
  .then(async () => {
1038
- console.log("this._table.state === 'loaded'");
1043
+ await this.finishLoading();
1044
+ });
1045
+ }
1046
+ /**
1047
+ * Finish the table loading tasks
1048
+ */
1049
+ async finishLoading() {
1050
+ try {
1051
+ this._loaded = true;
1039
1052
  this._table.highlightIds.removeAll();
1040
1053
  this._table.clearSelectionFilter();
1041
1054
  this._resetColumnTemplates();
@@ -1044,7 +1057,10 @@ export class LayerTable {
1044
1057
  await this._sortTable();
1045
1058
  this._initToolInfos();
1046
1059
  this._updateToolbar();
1047
- });
1060
+ }
1061
+ catch (e) {
1062
+ console.log(e);
1063
+ }
1048
1064
  }
1049
1065
  /**
1050
1066
  * Update the current IDs when that layers data is modified
@@ -1139,23 +1155,18 @@ export class LayerTable {
1139
1155
  * Sort the table with the configured field and the sort order
1140
1156
  */
1141
1157
  async _sortTable() {
1142
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1143
- console.log("_sortTable");
1144
- console.log(this._table);
1145
- console.log(this._layer);
1146
- console.log((_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.layerOptions) === null || _b === void 0 ? void 0 : _b.layers);
1147
- console.log((_d = (_c = this.mapInfo) === null || _c === void 0 ? void 0 : _c.layerOptions) === null || _d === void 0 ? void 0 : _d.layers);
1158
+ var _a, _b, _c, _d, _e, _f;
1148
1159
  //By default sort the table using objectIdField and in descending order
1149
- let sortField = (_e = this._layer) === null || _e === void 0 ? void 0 : _e.objectIdField;
1160
+ let sortField = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.objectIdField;
1150
1161
  let sortOrder = 'desc';
1151
1162
  let configuredLayer;
1152
1163
  //get the sortField and sortOrder from the configuration
1153
- if (((_h = (_g = (_f = this.mapInfo) === null || _f === void 0 ? void 0 : _f.layerOptions) === null || _g === void 0 ? void 0 : _g.layers) === null || _h === void 0 ? void 0 : _h.length) > 0 && ((_j = this._layer) === null || _j === void 0 ? void 0 : _j.id)) {
1164
+ if (((_d = (_c = (_b = this.mapInfo) === null || _b === void 0 ? void 0 : _b.layerOptions) === null || _c === void 0 ? void 0 : _c.layers) === null || _d === void 0 ? void 0 : _d.length) > 0 && ((_e = this._layer) === null || _e === void 0 ? void 0 : _e.id)) {
1154
1165
  configuredLayer = this.mapInfo.layerOptions.layers.filter((layer) => layer.id === this._layer.id);
1155
1166
  if (configuredLayer && configuredLayer.length > 0) {
1156
1167
  configuredLayer = configuredLayer[0];
1157
1168
  //if sort field is defined and sortField is available in the fields then use it
1158
- if (configuredLayer.sortField && ((_k = configuredLayer.fields) === null || _k === void 0 ? void 0 : _k.includes(configuredLayer.sortField))) {
1169
+ if (configuredLayer.sortField && ((_f = configuredLayer.fields) === null || _f === void 0 ? void 0 : _f.includes(configuredLayer.sortField))) {
1159
1170
  sortField = configuredLayer.sortField;
1160
1171
  }
1161
1172
  //use sort order if configured
@@ -1163,10 +1174,8 @@ export class LayerTable {
1163
1174
  }
1164
1175
  }
1165
1176
  if (this._table && this._layer) {
1166
- console.log("has layer and has table");
1167
1177
  await this._table.when();
1168
1178
  await this._layer.when(() => {
1169
- console.log("sort on this._layer.when");
1170
1179
  this._table.sortColumn(sortField, sortOrder);
1171
1180
  });
1172
1181
  }
@@ -617,7 +617,10 @@ export function _prepareAttributeValue(attributeValue, attributeType, attributeD
617
617
  value = intl.formatNumber(value, numberFormatIntlOptions);
618
618
  }
619
619
  else {
620
- value = intl.formatNumber(value);
620
+ value = intl.formatNumber(value, {
621
+ maximumFractionDigits: 100,
622
+ maximumSignificantDigits: 21
623
+ });
621
624
  }
622
625
  break;
623
626
  }
@@ -859,7 +859,10 @@ export function _prepareAttributeValue(
859
859
  const numberFormatIntlOptions = intl.convertNumberFormatToIntlOptions(attributeFormat)
860
860
  value = intl.formatNumber(value, numberFormatIntlOptions);
861
861
  } else {
862
- value = intl.formatNumber(value);
862
+ value = intl.formatNumber(value, {
863
+ maximumFractionDigits: 100,
864
+ maximumSignificantDigits: 21
865
+ });
863
866
  }
864
867
  break;
865
868
  }
@@ -2935,7 +2935,10 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
2935
2935
  value = intl.formatNumber(value, numberFormatIntlOptions);
2936
2936
  }
2937
2937
  else {
2938
- value = intl.formatNumber(value);
2938
+ value = intl.formatNumber(value, {
2939
+ maximumFractionDigits: 100,
2940
+ maximumSignificantDigits: 21
2941
+ });
2939
2942
  }
2940
2943
  break;
2941
2944
  }
@@ -73,6 +73,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
73
73
  * boolean: When true the default OID provided via url param has been honored and should now be ignored
74
74
  */
75
75
  this._defaultOidHonored = false;
76
+ /**
77
+ * boolean: When true the table has been successfully loaded
78
+ */
79
+ this._loaded = false;
76
80
  /**
77
81
  * boolean: When true the observer has been set and we don't need to set it again
78
82
  */
@@ -358,7 +362,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
358
362
  const selected = this.selectedIds.length.toString();
359
363
  const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
360
364
  this._validateActiveActions();
361
- return (h(Host, { key: 'ac2aafd7877dc7c97067dbf0d7ae642799ff6af7' }, h("calcite-shell", { key: '06963da4964e6075f09c21506af9b0fdc2a62a4f' }, this._getTableControlRow("header"), h("div", { key: '1d1c5aede89e78f61f677234a81d3960acdd9a73', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: 'c9b8336e1d0dc77faec304b26a04673be63173d6', class: "height-full width-full" }, h("calcite-loader", { key: 'abd051ee71d7d73e67480593911f7e20b3121b0c', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: 'e9ba0160f5c74aae1fa9f0ce97e698d034bb09da', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
365
+ return (h(Host, { key: '9707f29bc69d0b56ae548b8004af6a0872105a40' }, h("calcite-shell", { key: 'e44e4b3dc934efec9698f6a9a24c21a1e1755e34' }, this._getTableControlRow("header"), h("div", { key: '88e82fe17e8f6c2bf01f0353c30992c108c6b9f1', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: '463130e64abde593fafa0333daf6dabec116a33a', class: "height-full width-full" }, h("calcite-loader", { key: '2aa6e9a0ebf5508253adfb5a6d71340e7de01df2', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '0d50f1bed585ab19a31d6875fab1f0fbdbc957d3', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
362
366
  .replace("{{total}}", total)
363
367
  .replace("{{selected}}", selected))) : undefined)), this._filterModal()));
364
368
  }
@@ -1022,16 +1026,11 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1022
1026
  */
1023
1027
  _resetColumnTemplates() {
1024
1028
  var _a, _b;
1025
- console.log("_resetColumnTemplates");
1026
1029
  const columnTemplates = this._getColumnTemplates((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id, (_b = this._layer) === null || _b === void 0 ? void 0 : _b.fields);
1027
1030
  const hasChange = columnTemplates === null || columnTemplates === void 0 ? void 0 : columnTemplates.some((ct, i) => {
1028
1031
  var _a;
1029
1032
  return JSON.stringify((_a = this._table) === null || _a === void 0 ? void 0 : _a.tableTemplate.columnTemplates[i]) !== JSON.stringify(ct);
1030
1033
  });
1031
- console.log(this._table);
1032
- console.log(columnTemplates);
1033
- console.log(hasChange);
1034
- console.log(!this._columnsInfo);
1035
1034
  if (this._table && columnTemplates && (hasChange || !this._columnsInfo)) {
1036
1035
  this._table.tableTemplate = new this.TableTemplate({
1037
1036
  columnTemplates
@@ -1045,9 +1044,7 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1045
1044
  */
1046
1045
  async _resetTable() {
1047
1046
  var _a;
1048
- console.log("_resetTable");
1049
- console.log(this._table);
1050
- console.log(this._layer);
1047
+ this._loaded = false;
1051
1048
  this._clearSelection();
1052
1049
  this._allIds = await queryAllIds(this._layer);
1053
1050
  if (!this._table) {
@@ -1062,10 +1059,26 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1062
1059
  this._checkEditEnabled();
1063
1060
  this._table.editingEnabled = this._editEnabled && this.enableInlineEdit;
1064
1061
  await this._table.when();
1065
- console.log("after table when");
1062
+ // This is a workaround.
1063
+ // In some cases the first time the app is loaded this._table.state === "loaded" is not being hit.
1064
+ // When this issue occurs we will wait for 1 second and attempt to finish the loading process
1065
+ setTimeout(() => {
1066
+ if (!this._loaded) {
1067
+ console.log(`table.state: ${this._table.state}`);
1068
+ void this.finishLoading();
1069
+ }
1070
+ }, 1000);
1066
1071
  await this.reactiveUtils.once(() => this._table.state === "loaded")
1067
1072
  .then(async () => {
1068
- console.log("this._table.state === 'loaded'");
1073
+ await this.finishLoading();
1074
+ });
1075
+ }
1076
+ /**
1077
+ * Finish the table loading tasks
1078
+ */
1079
+ async finishLoading() {
1080
+ try {
1081
+ this._loaded = true;
1069
1082
  this._table.highlightIds.removeAll();
1070
1083
  this._table.clearSelectionFilter();
1071
1084
  this._resetColumnTemplates();
@@ -1074,7 +1087,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1074
1087
  await this._sortTable();
1075
1088
  this._initToolInfos();
1076
1089
  this._updateToolbar();
1077
- });
1090
+ }
1091
+ catch (e) {
1092
+ console.log(e);
1093
+ }
1078
1094
  }
1079
1095
  /**
1080
1096
  * Update the current IDs when that layers data is modified
@@ -1169,23 +1185,18 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1169
1185
  * Sort the table with the configured field and the sort order
1170
1186
  */
1171
1187
  async _sortTable() {
1172
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1173
- console.log("_sortTable");
1174
- console.log(this._table);
1175
- console.log(this._layer);
1176
- console.log((_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.layerOptions) === null || _b === void 0 ? void 0 : _b.layers);
1177
- console.log((_d = (_c = this.mapInfo) === null || _c === void 0 ? void 0 : _c.layerOptions) === null || _d === void 0 ? void 0 : _d.layers);
1188
+ var _a, _b, _c, _d, _e, _f;
1178
1189
  //By default sort the table using objectIdField and in descending order
1179
- let sortField = (_e = this._layer) === null || _e === void 0 ? void 0 : _e.objectIdField;
1190
+ let sortField = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.objectIdField;
1180
1191
  let sortOrder = 'desc';
1181
1192
  let configuredLayer;
1182
1193
  //get the sortField and sortOrder from the configuration
1183
- if (((_h = (_g = (_f = this.mapInfo) === null || _f === void 0 ? void 0 : _f.layerOptions) === null || _g === void 0 ? void 0 : _g.layers) === null || _h === void 0 ? void 0 : _h.length) > 0 && ((_j = this._layer) === null || _j === void 0 ? void 0 : _j.id)) {
1194
+ if (((_d = (_c = (_b = this.mapInfo) === null || _b === void 0 ? void 0 : _b.layerOptions) === null || _c === void 0 ? void 0 : _c.layers) === null || _d === void 0 ? void 0 : _d.length) > 0 && ((_e = this._layer) === null || _e === void 0 ? void 0 : _e.id)) {
1184
1195
  configuredLayer = this.mapInfo.layerOptions.layers.filter((layer) => layer.id === this._layer.id);
1185
1196
  if (configuredLayer && configuredLayer.length > 0) {
1186
1197
  configuredLayer = configuredLayer[0];
1187
1198
  //if sort field is defined and sortField is available in the fields then use it
1188
- if (configuredLayer.sortField && ((_k = configuredLayer.fields) === null || _k === void 0 ? void 0 : _k.includes(configuredLayer.sortField))) {
1199
+ if (configuredLayer.sortField && ((_f = configuredLayer.fields) === null || _f === void 0 ? void 0 : _f.includes(configuredLayer.sortField))) {
1189
1200
  sortField = configuredLayer.sortField;
1190
1201
  }
1191
1202
  //use sort order if configured
@@ -1193,10 +1204,8 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
1193
1204
  }
1194
1205
  }
1195
1206
  if (this._table && this._layer) {
1196
- console.log("has layer and has table");
1197
1207
  await this._table.when();
1198
1208
  await this._layer.when(() => {
1199
- console.log("sort on this._layer.when");
1200
1209
  this._table.sortColumn(sortField, sortOrder);
1201
1210
  });
1202
1211
  }
@@ -173,6 +173,16 @@ function updateItem$1(requestOptions) {
173
173
  if (requestOptions.params.extent && isBBox(requestOptions.params.extent)) {
174
174
  requestOptions.params.extent = bboxToString(requestOptions.params.extent);
175
175
  }
176
+ /* istanbul ignore if */
177
+ if (requestOptions.params.file &&
178
+ requestOptions.params.file.constructor &&
179
+ requestOptions.params.file.constructor.name === 'ReadStream') {
180
+ // dataSize is not an official parameter for the ArcGIS REST API but is needed
181
+ // to encode the ReadStream with an appropriate length. This is to overcome
182
+ // the form-data library bug:
183
+ // https://github.com/form-data/form-data/issues/508
184
+ requestOptions.params.dataSize = requestOptions.dataSize;
185
+ }
176
186
  return request(url, requestOptions);
177
187
  });
178
188
  }