@cosmotech/core 1.6.1 → 1.6.5

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.
package/dist/index.esm.js CHANGED
@@ -11062,7 +11062,7 @@ module.exports = ZStream;
11062
11062
  /*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
11063
11063
  var XLSX = {};
11064
11064
  function make_xlsx_lib(XLSX){
11065
- XLSX.version = '0.17.4';
11065
+ XLSX.version = '0.17.5';
11066
11066
  var current_codepage = 1200, current_ansi = 1252;
11067
11067
  /*global cptable:true, window */
11068
11068
  if(typeof commonjsRequire !== 'undefined') {
@@ -14752,7 +14752,8 @@ function safe_decode_range(range) {
14752
14752
  }
14753
14753
  o.s.r = --idx;
14754
14754
 
14755
- if(i === len || range.charCodeAt(++i) === 58) { o.e.c=o.s.c; o.e.r=o.s.r; return o; }
14755
+ if(i === len || cc != 10) { o.e.c=o.s.c; o.e.r=o.s.r; return o; }
14756
+ ++i;
14756
14757
 
14757
14758
  for(idx = 0; i != len; ++i) {
14758
14759
  if((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break;
@@ -15793,7 +15794,7 @@ function parse_rels(data, currentFilePath) {
15793
15794
  var y = parsexmltag(x);
15794
15795
  /* 9.3.2.2 OPC_Relationships */
15795
15796
  if (y[0] === '<Relationship') {
15796
- var rel = {}; rel.Type = y.Type; rel.Target = y.Target; rel.Id = y.Id; rel.TargetMode = y.TargetMode;
15797
+ var rel = {}; rel.Type = y.Type; rel.Target = y.Target; rel.Id = y.Id; if(y.TargetMode) rel.TargetMode = y.TargetMode;
15797
15798
  var canonictarget = y.TargetMode === 'External' ? y.Target : resolve_path(y.Target, currentFilePath);
15798
15799
  rels[canonictarget] = rel;
15799
15800
  hash[y.Id] = rel;
@@ -17595,7 +17596,9 @@ function parse_Lbl(blob, length, opts) {
17595
17596
  var name = parse_XLUnicodeStringNoCch(blob, cch, opts);
17596
17597
  if(flags & 0x20) name = XLSLblBuiltIn[name.charCodeAt(0)];
17597
17598
  var npflen = target - blob.l; if(opts && opts.biff == 2) --npflen;
17599
+ /*jshint -W018 */
17598
17600
  var rgce = (target == blob.l || cce === 0 || !(npflen > 0)) ? [] : parse_NameParsedFormula(blob, npflen, opts, cce);
17601
+ /*jshint +W018 */
17599
17602
  return {
17600
17603
  chKey: chKey,
17601
17604
  Name: name,
@@ -19011,12 +19014,18 @@ var WK_ = (function() {
19011
19014
  function lotus_to_workbook_buf(d, opts) {
19012
19015
  if(!d) return d;
19013
19016
  var o = opts || {};
19014
- var s = ((o.dense ? [] : {})), n = "Sheet1", sidx = 0;
19015
- var sheets = {}, snames = [n], realnames = [];
19017
+ var s = ((o.dense ? [] : {})), n = "Sheet1", next_n = "", sidx = 0;
19018
+ var sheets = {}, snames = [], realnames = [];
19016
19019
 
19017
19020
  var refguess = {s: {r:0, c:0}, e: {r:0, c:0} };
19018
19021
  var sheetRows = o.sheetRows || 0;
19019
19022
 
19023
+ if(d[2] == 0x00) {
19024
+ if(d[3] == 0x08 || d[3] == 0x09) {
19025
+ if(d.length >= 16 && d[14] == 0x05 && d[15] === 0x6c) throw new Error("Unsupported Works 3 for Mac file");
19026
+ }
19027
+ }
19028
+
19020
19029
  if(d[2] == 0x02) {
19021
19030
  o.Enum = WK1Enum;
19022
19031
  lotushopper(d, function(val, R, RT) { switch(RT) {
@@ -19025,6 +19034,8 @@ var WK_ = (function() {
19025
19034
  if(val >= 0x1000) o.qpro = true;
19026
19035
  break;
19027
19036
  case 0x06: refguess = val; break; /* RANGE */
19037
+ case 0xCC: if(val) next_n = val; break; /* SHEETNAMECS */
19038
+ case 0xDE: next_n = val; break; /* SHEETNAMELP */
19028
19039
  case 0x0F: /* LABEL */
19029
19040
  case 0x33: /* STRING */
19030
19041
  if(!o.qpro) val[1].v = val[1].v.slice(1);
@@ -19037,6 +19048,18 @@ var WK_ = (function() {
19037
19048
  val[1].z = o.dateNF || SSF._table[14];
19038
19049
  if(o.cellDates) { val[1].t = 'd'; val[1].v = numdate(val[1].v); }
19039
19050
  }
19051
+
19052
+ if(o.qpro) {
19053
+ if(val[3] > sidx) {
19054
+ s["!ref"] = encode_range(refguess);
19055
+ sheets[n] = s;
19056
+ snames.push(n);
19057
+ s = (o.dense ? [] : {});
19058
+ refguess = {s: {r:0, c:0}, e: {r:0, c:0} };
19059
+ sidx = val[3]; n = next_n || "Sheet" + (sidx + 1); next_n = "";
19060
+ }
19061
+ }
19062
+
19040
19063
  var tmpcell = o.dense ? (s[val[0].r]||[])[val[0].c] : s[encode_cell(val[0])];
19041
19064
  if(tmpcell) {
19042
19065
  tmpcell.t = val[1].t; tmpcell.v = val[1].v;
@@ -19054,6 +19077,7 @@ var WK_ = (function() {
19054
19077
  o.Enum = WK3Enum;
19055
19078
  if(d[2] == 0x0E) { o.qpro = true; d.l = 0; }
19056
19079
  lotushopper(d, function(val, R, RT) { switch(RT) {
19080
+ case 0xCC: n = val; break; /* SHEETNAMECS */
19057
19081
  case 0x16: /* LABEL16 */
19058
19082
  val[1].v = val[1].v.slice(1);
19059
19083
  /* falls through */
@@ -19066,10 +19090,10 @@ var WK_ = (function() {
19066
19090
  if(val[3] > sidx) {
19067
19091
  s["!ref"] = encode_range(refguess);
19068
19092
  sheets[n] = s;
19093
+ snames.push(n);
19069
19094
  s = (o.dense ? [] : {});
19070
19095
  refguess = {s: {r:0, c:0}, e: {r:0, c:0} };
19071
19096
  sidx = val[3]; n = "Sheet" + (sidx + 1);
19072
- snames.push(n);
19073
19097
  }
19074
19098
  if(sheetRows > 0 && val[0].r >= sheetRows) break;
19075
19099
  if(o.dense) {
@@ -19082,16 +19106,22 @@ var WK_ = (function() {
19082
19106
  case 0x1B: /* XFORMAT */
19083
19107
  if(val[0x36b0]) realnames[val[0x36b0][0]] = val[0x36b0][1];
19084
19108
  break;
19109
+ case 0x0601: /* SHEETINFOQP */
19110
+ realnames[val[0]] = val[1]; if(val[0] == sidx) n = val[1]; break;
19085
19111
  }}, o);
19086
19112
  } else throw new Error("Unrecognized LOTUS BOF " + d[2]);
19087
-
19088
19113
  s["!ref"] = encode_range(refguess);
19089
- sheets[n] = s;
19114
+ sheets[next_n || n] = s;
19115
+ snames.push(next_n || n);
19090
19116
  if(!realnames.length) return { SheetNames: snames, Sheets: sheets };
19091
19117
  var osheets = {}, rnames = [];
19118
+ /* TODO: verify no collisions */
19092
19119
  for(var i = 0; i < realnames.length; ++i) if(sheets[snames[i]]) {
19120
+ rnames.push(realnames[i] || snames[i]);
19121
+ osheets[realnames[i]] = sheets[realnames[i]] || sheets[snames[i]];
19122
+ } else {
19093
19123
  rnames.push(realnames[i]);
19094
- osheets[realnames[i]] = sheets[snames[i]];
19124
+ osheets[realnames[i]] = ({ "!ref": "A1" });
19095
19125
  }
19096
19126
  return { SheetNames: rnames, Sheets: osheets };
19097
19127
  }
@@ -19107,7 +19137,8 @@ var WK_ = (function() {
19107
19137
 
19108
19138
  write_biff_rec(ba, 0x00, write_BOF_WK1(0x0406));
19109
19139
  write_biff_rec(ba, 0x06, write_RANGE(range));
19110
- for(var R = range.s.r; R <= range.e.r; ++R) {
19140
+ var max_R = Math.min(range.e.r, 8191);
19141
+ for(var R = range.s.r; R <= max_R; ++R) {
19111
19142
  var rr = encode_row(R);
19112
19143
  for(var C = range.s.c; C <= range.e.c; ++C) {
19113
19144
  if(R === range.s.r) cols[C] = encode_col(C);
@@ -19146,7 +19177,8 @@ var WK_ = (function() {
19146
19177
  var range = safe_decode_range(ws["!ref"]);
19147
19178
  var dense = Array.isArray(ws);
19148
19179
  var cols = [];
19149
- for(var R = range.s.r; R <= range.e.r; ++R) {
19180
+ var max_R = Math.min(range.e.r, 8191);
19181
+ for(var R = range.s.r; R <= max_R; ++R) {
19150
19182
  var rr = encode_row(R);
19151
19183
  for(var C = range.s.c; C <= range.e.c; ++C) {
19152
19184
  if(R === range.s.r) cols[C] = encode_col(C);
@@ -19192,6 +19224,7 @@ var WK_ = (function() {
19192
19224
  if(rows < range.e.r) rows = range.e.r;
19193
19225
  if(cols < range.e.c) cols = range.e.c;
19194
19226
  }
19227
+ if(rows > 8191) rows = 8191;
19195
19228
  out.write_shift(2, rows);
19196
19229
  out.write_shift(1, wscnt);
19197
19230
  out.write_shift(1, cols);
@@ -19204,12 +19237,23 @@ var WK_ = (function() {
19204
19237
  return out;
19205
19238
  }
19206
19239
 
19207
- function parse_RANGE(blob) {
19240
+ function parse_RANGE(blob, length, opts) {
19208
19241
  var o = {s:{c:0,r:0},e:{c:0,r:0}};
19242
+ if(length == 8 && opts.qpro) {
19243
+ o.s.c = blob.read_shift(1);
19244
+ blob.l++;
19245
+ o.s.r = blob.read_shift(2);
19246
+ o.e.c = blob.read_shift(1);
19247
+ blob.l++;
19248
+ o.e.r = blob.read_shift(2);
19249
+ return o;
19250
+ }
19209
19251
  o.s.c = blob.read_shift(2);
19210
19252
  o.s.r = blob.read_shift(2);
19253
+ if(length == 12 && opts.qpro) blob.l += 2;
19211
19254
  o.e.c = blob.read_shift(2);
19212
19255
  o.e.r = blob.read_shift(2);
19256
+ if(length == 12 && opts.qpro) blob.l += 2;
19213
19257
  if(o.s.c == 0xFFFF) o.s.c = o.e.c = o.s.r = o.e.r = 0;
19214
19258
  return o;
19215
19259
  }
@@ -19223,10 +19267,10 @@ var WK_ = (function() {
19223
19267
  }
19224
19268
 
19225
19269
  function parse_cell(blob, length, opts) {
19226
- var o = [{c:0,r:0}, {t:'n',v:0}, 0];
19270
+ var o = [{c:0,r:0}, {t:'n',v:0}, 0, 0];
19227
19271
  if(opts.qpro && opts.vers != 0x5120) {
19228
19272
  o[0].c = blob.read_shift(1);
19229
- blob.l++;
19273
+ o[3] = blob.read_shift(1);
19230
19274
  o[0].r = blob.read_shift(2);
19231
19275
  blob.l+=2;
19232
19276
  } else {
@@ -19334,7 +19378,7 @@ var WK_ = (function() {
19334
19378
 
19335
19379
  function wk1_fmla_to_csf(blob, o) {
19336
19380
  prep_blob(blob, 0);
19337
- var out = [], argc = 0, R = "", C = "";
19381
+ var out = [], argc = 0, R = "", C = "", argL = "", argR = "";
19338
19382
  while(blob.l < blob.length) {
19339
19383
  var cc = blob[blob.l++];
19340
19384
  switch(cc) {
@@ -19366,7 +19410,7 @@ var WK_ = (function() {
19366
19410
  case 0x16: out.push("NOT(" + out.pop() + ")"); break;
19367
19411
 
19368
19412
  case 0x14: case 0x15: {
19369
- var argR = out.pop(), argL = out.pop();
19413
+ argR = out.pop(); argL = out.pop();
19370
19414
  out.push(["AND", "OR"][cc - 0x14] + "(" + argL + "," + argR + ")");
19371
19415
  } break;
19372
19416
 
@@ -19512,6 +19556,27 @@ var WK_ = (function() {
19512
19556
  return o;
19513
19557
  }
19514
19558
 
19559
+ function parse_SHEETNAMECS(blob, length) {
19560
+ return blob[blob.l + length - 1] == 0 ? blob.read_shift(length, 'cstr') : "";
19561
+ }
19562
+
19563
+ function parse_SHEETNAMELP(blob, length) {
19564
+ var len = blob[blob.l++];
19565
+ if(len > length - 1) len = length - 1;
19566
+ var o = ""; while(o.length < len) o += String.fromCharCode(blob[blob.l++]);
19567
+ return o;
19568
+ }
19569
+
19570
+ function parse_SHEETINFOQP(blob, length, opts) {
19571
+ if(!opts.qpro || length < 21) return;
19572
+ var id = blob.read_shift(1);
19573
+ blob.l += 17;
19574
+ blob.read_shift(1);
19575
+ blob.l += 2;
19576
+ var nm = blob.read_shift(length - 21, 'cstr');
19577
+ return [id, nm];
19578
+ }
19579
+
19515
19580
  function parse_XFORMAT(blob, length) {
19516
19581
  var o = {}, tgt = blob.l + length;
19517
19582
  while(blob.l < tgt) {
@@ -19599,6 +19664,8 @@ var WK_ = (function() {
19599
19664
  0x0067: { n:"RRANGES??" },
19600
19665
  0x0068: { n:"FNAME??" },
19601
19666
  0x0069: { n:"MRANGES??" },
19667
+ 0x00CC: { n:"SHEETNAMECS", f:parse_SHEETNAMECS },
19668
+ 0x00DE: { n:"SHEETNAMELP", f:parse_SHEETNAMELP },
19602
19669
  0xFFFF: { n:"" }
19603
19670
  };
19604
19671
 
@@ -19664,6 +19731,7 @@ var WK_ = (function() {
19664
19731
  0x00BC: { n:"??" },
19665
19732
  0x00C3: { n:"??" },
19666
19733
  0x00C9: { n:"??" },
19734
+ 0x00CC: { n:"SHEETNAMECS", f:parse_SHEETNAMECS },
19667
19735
  0x00CD: { n:"??" },
19668
19736
  0x00CE: { n:"??" },
19669
19737
  0x00CF: { n:"??" },
@@ -19708,6 +19776,7 @@ var WK_ = (function() {
19708
19776
  0x029A: { n:"??" },
19709
19777
  0x0300: { n:"??" },
19710
19778
  0x0304: { n:"??" },
19779
+ 0x0601: { n:"SHEETINFOQP", f:parse_SHEETINFOQP },
19711
19780
  0x0640: { n:"??" },
19712
19781
  0x0642: { n:"??" },
19713
19782
  0x0701: { n:"??" },
@@ -27480,6 +27549,7 @@ function parse_xlml_xml(d, _opts) {
27480
27549
  else str = utf8read(str);
27481
27550
  }
27482
27551
  var opening = str.slice(0, 1024).toLowerCase(), ishtml = false;
27552
+ opening = opening.replace(/".*?"/g, "");
27483
27553
  if((opening.indexOf(">") & 1023) > Math.min((opening.indexOf(",") & 1023), (opening.indexOf(";")&1023))) { var _o = dup(opts); _o.type = "string"; return PRN.to_workbook(str, _o); }
27484
27554
  if(opening.indexOf("<?xml") == -1) ["html", "table", "head", "meta", "script", "style", "div"].forEach(function(tag) { if(opening.indexOf("<" + tag) >= 0) ishtml = true; });
27485
27555
  if(ishtml) return HTML_.to_workbook(str, opts);
@@ -29353,7 +29423,9 @@ if(!cur_sheet) Workbook.WBProps.CodeName = val || "ThisWorkbook";
29353
29423
  if(!options.bookSheets) wb.Sheets=Sheets;
29354
29424
  if(!wb.SheetNames.length && Preamble["!ref"]) {
29355
29425
  wb.SheetNames.push("Sheet1");
29426
+ /*jshint -W069 */
29356
29427
  if(wb.Sheets) wb.Sheets["Sheet1"] = Preamble;
29428
+ /*jshint +W069 */
29357
29429
  } else wb.Preamble=Preamble;
29358
29430
  if(wb.Sheets) FilterDatabases.forEach(function(r,i) { wb.Sheets[wb.SheetNames[i]]['!autofilter'] = r; });
29359
29431
  wb.Strings = sst;
@@ -29448,6 +29520,8 @@ else {
29448
29520
  else if((_data=CFB.find(cfb, 'PerfectOffice_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options));
29449
29521
  /* Quattro Pro 9 */
29450
29522
  else if((_data=CFB.find(cfb, 'NativeContent_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options));
29523
+ /* Works 4 for Mac */
29524
+ else if((_data=CFB.find(cfb, 'MN0')) && _data.content) throw new Error("Unsupported Works 4 for Mac file");
29451
29525
  else throw new Error("Cannot find Workbook stream");
29452
29526
  if(options.bookVBA && cfb.FullPaths && CFB.find(cfb, '/_VBA_PROJECT_CUR/VBA/dir')) WorkbookP.vbaraw = make_vba_xls(cfb);
29453
29527
  }
@@ -30325,7 +30399,9 @@ var XLSBRecordEnum = {
30325
30399
  };
30326
30400
 
30327
30401
  var XLSBRE = evert_key(XLSBRecordEnum, 'n');
30402
+ /*jshint -W069 */
30328
30403
  XLSBRE["BrtFRTArchID$"] = 0x0010;
30404
+ /*jshint +W069 */
30329
30405
 
30330
30406
  /* [MS-XLS] 2.3 Record Enumeration (and other sources) */
30331
30407
  var XLSRecordEnum = {
@@ -31173,6 +31249,15 @@ function write_biff8_buf(wb, opts) {
31173
31249
  }
31174
31250
 
31175
31251
  function write_biff_buf(wb, opts) {
31252
+ for(var i = 0; i <= wb.SheetNames.length; ++i) {
31253
+ var ws = wb.Sheets[wb.SheetNames[i]];
31254
+ if(!ws || !ws["!ref"]) continue;
31255
+ var range = decode_range(ws["!ref"]);
31256
+ if(range.e.c > 255) { // note: 255 is IV
31257
+ console.error("Worksheet '" + wb.SheetNames[i] + "' extends beyond column IV (255). Data may be lost.");
31258
+ }
31259
+ }
31260
+
31176
31261
  var o = opts || {};
31177
31262
  switch(o.biff || 2) {
31178
31263
  case 8: case 5: return write_biff8_buf(wb, opts);
@@ -31986,14 +32071,16 @@ function parse_fods(data, opts) {
31986
32071
 
31987
32072
  /* OpenDocument */
31988
32073
  var write_styles_ods = (function() {
31989
- var master_styles = '<office:master-styles>'
31990
- + '<style:master-page style:name="mp1" style:page-layout-name="mp1">'
31991
- + '<style:header/>'
31992
- + '<style:header-left style:display="false"/>'
31993
- + '<style:footer/>'
31994
- + '<style:footer-left style:display="false"/>'
31995
- + '</style:master-page>'
31996
- + '</office:master-styles>';
32074
+ var master_styles = [
32075
+ '<office:master-styles>',
32076
+ '<style:master-page style:name="mp1" style:page-layout-name="mp1">',
32077
+ '<style:header/>',
32078
+ '<style:header-left style:display="false"/>',
32079
+ '<style:footer/>',
32080
+ '<style:footer-left style:display="false"/>',
32081
+ '</style:master-page>',
32082
+ '</office:master-styles>'
32083
+ ].join("");
31997
32084
 
31998
32085
  var payload = '<office:document-styles ' + wxt_helper({
31999
32086
  'xmlns:office': "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
@@ -32410,6 +32497,11 @@ function parse_zip(zip, opts) {
32410
32497
  if(safegetzipfile(zip, 'objectdata.xml')) return parse_ods(zip, opts);
32411
32498
  /* Numbers */
32412
32499
  if(safegetzipfile(zip, 'Index/Document.iwa')) throw new Error('Unsupported NUMBERS file');
32500
+ if(!safegetzipfile(zip, '[Content_Types].xml')) {
32501
+ if(safegetzipfile(zip, 'index.xml.gz')) throw new Error('Unsupported NUMBERS 08 file');
32502
+ if(safegetzipfile(zip, 'index.xml')) throw new Error('Unsupported NUMBERS 09 file');
32503
+ throw new Error('Unsupported ZIP file');
32504
+ }
32413
32505
 
32414
32506
  var entries = zipentries(zip);
32415
32507
  var dir = parse_ct((getzipstr(zip, '[Content_Types].xml')));
@@ -32827,12 +32919,20 @@ function readSync(data, opts) {
32827
32919
  case 0x54: if(n[1] === 0x41 && n[2] === 0x42 && n[3] === 0x4C) return DIF.to_workbook(d, o); break;
32828
32920
  case 0x50: return (n[1] === 0x4B && n[2] < 0x09 && n[3] < 0x09) ? read_zip(d, o) : read_prn(data, d, o, str);
32829
32921
  case 0xEF: return n[3] === 0x3C ? parse_xlml(d, o) : read_prn(data, d, o, str);
32830
- case 0xFF: if(n[1] === 0xFE) { return read_utf16(d, o); } break;
32831
- case 0x00: if(n[1] === 0x00 && n[2] >= 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o); break;
32922
+ case 0xFF:
32923
+ if(n[1] === 0xFE) { return read_utf16(d, o); }
32924
+ else if(n[1] === 0x00 && n[2] === 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o);
32925
+ break;
32926
+ case 0x00:
32927
+ if(n[1] === 0x00) {
32928
+ if(n[2] >= 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o);
32929
+ if(n[2] === 0x00 && (n[3] === 0x08 || n[3] === 0x09)) return WK_.to_workbook(d, o);
32930
+ }
32931
+ break;
32832
32932
  case 0x03: case 0x83: case 0x8B: case 0x8C: return DBF.to_workbook(d, o);
32833
32933
  case 0x7B: if(n[1] === 0x5C && n[2] === 0x72 && n[3] === 0x74) return RTF.to_workbook(d, o); break;
32834
32934
  case 0x0A: case 0x0D: case 0x20: return read_plaintext_raw(d, o);
32835
- case 0x89: if(n[1] === 0x50 && n[2] === 0x4E && n[3] === 0x47) throw new Error("PNG Image File is not a spreadsheet"); break;
32935
+ case 0x89: if(n[1] === 0x50 && n[2] === 0x4E && n[3] === 0x47) throw new Error("PNG Image File is not a spreadsheet"); break;
32836
32936
  }
32837
32937
  if(DBF.versions.indexOf(n[0]) > -1 && n[2] <= 12 && n[3] <= 31) return DBF.to_workbook(d, o);
32838
32938
  return read_prn(data, d, o, str);
@@ -33379,7 +33479,10 @@ return utils;
33379
33479
  })(utils);
33380
33480
 
33381
33481
  if(has_buf && typeof commonjsRequire != 'undefined') (function() {
33382
- var Readable = require$$0.Readable;
33482
+ var strmod = require$$0;
33483
+ if(!strmod) return;
33484
+ var Readable = strmod.Readable;
33485
+ if(!Readable) return;
33383
33486
 
33384
33487
  var write_csv_stream = function(sheet, opts) {
33385
33488
  var stream = Readable();
@@ -33516,7 +33619,7 @@ if(typeof CFB !== "undefined") XLSX.CFB = CFB;
33516
33619
  /*global define */
33517
33620
  make_xlsx_lib(exports);
33518
33621
  /* NOTE: the following extra line is needed for "Lightning Locker Service" */
33519
- if(typeof window !== 'undefined' && !window.XLSX) window.XLSX = XLSX;
33622
+ if(typeof window !== 'undefined' && !window.XLSX) try { window.XLSX = XLSX; } catch(e) {}
33520
33623
  }(xlsx, xlsx.exports));
33521
33624
 
33522
33625
  var _castCellValueToStr = cellValue => {
@@ -41264,101 +41367,6 @@ function subMilliseconds(dirtyDate, dirtyAmount) {
41264
41367
  return addMilliseconds(dirtyDate, -amount);
41265
41368
  }
41266
41369
 
41267
- function addLeadingZeros(number, targetLength) {
41268
- var sign = number < 0 ? '-' : '';
41269
- var output = Math.abs(number).toString();
41270
-
41271
- while (output.length < targetLength) {
41272
- output = '0' + output;
41273
- }
41274
-
41275
- return sign + output;
41276
- }
41277
-
41278
- /*
41279
- * | | Unit | | Unit |
41280
- * |-----|--------------------------------|-----|--------------------------------|
41281
- * | a | AM, PM | A* | |
41282
- * | d | Day of month | D | |
41283
- * | h | Hour [1-12] | H | Hour [0-23] |
41284
- * | m | Minute | M | Month |
41285
- * | s | Second | S | Fraction of second |
41286
- * | y | Year (abs) | Y | |
41287
- *
41288
- * Letters marked by * are not implemented but reserved by Unicode standard.
41289
- */
41290
-
41291
- var formatters$2 = {
41292
- // Year
41293
- y: function (date, token) {
41294
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
41295
- // | Year | y | yy | yyy | yyyy | yyyyy |
41296
- // |----------|-------|----|-------|-------|-------|
41297
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
41298
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
41299
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
41300
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
41301
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
41302
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
41303
-
41304
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
41305
- return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
41306
- },
41307
- // Month
41308
- M: function (date, token) {
41309
- var month = date.getUTCMonth();
41310
- return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
41311
- },
41312
- // Day of the month
41313
- d: function (date, token) {
41314
- return addLeadingZeros(date.getUTCDate(), token.length);
41315
- },
41316
- // AM or PM
41317
- a: function (date, token) {
41318
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
41319
-
41320
- switch (token) {
41321
- case 'a':
41322
- case 'aa':
41323
- return dayPeriodEnumValue.toUpperCase();
41324
-
41325
- case 'aaa':
41326
- return dayPeriodEnumValue;
41327
-
41328
- case 'aaaaa':
41329
- return dayPeriodEnumValue[0];
41330
-
41331
- case 'aaaa':
41332
- default:
41333
- return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
41334
- }
41335
- },
41336
- // Hour [1-12]
41337
- h: function (date, token) {
41338
- return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
41339
- },
41340
- // Hour [0-23]
41341
- H: function (date, token) {
41342
- return addLeadingZeros(date.getUTCHours(), token.length);
41343
- },
41344
- // Minute
41345
- m: function (date, token) {
41346
- return addLeadingZeros(date.getUTCMinutes(), token.length);
41347
- },
41348
- // Second
41349
- s: function (date, token) {
41350
- return addLeadingZeros(date.getUTCSeconds(), token.length);
41351
- },
41352
- // Fraction of second
41353
- S: function (date, token) {
41354
- var numberOfDigits = token.length;
41355
- var milliseconds = date.getUTCMilliseconds();
41356
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
41357
- return addLeadingZeros(fractionalSeconds, token.length);
41358
- }
41359
- };
41360
- var formatters$3 = formatters$2;
41361
-
41362
41370
  var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
41363
41371
  // See issue: https://github.com/date-fns/date-fns/issues/376
41364
41372
 
@@ -41521,6 +41529,101 @@ function getUTCWeek(dirtyDate, options) {
41521
41529
  return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
41522
41530
  }
41523
41531
 
41532
+ function addLeadingZeros(number, targetLength) {
41533
+ var sign = number < 0 ? '-' : '';
41534
+ var output = Math.abs(number).toString();
41535
+
41536
+ while (output.length < targetLength) {
41537
+ output = '0' + output;
41538
+ }
41539
+
41540
+ return sign + output;
41541
+ }
41542
+
41543
+ /*
41544
+ * | | Unit | | Unit |
41545
+ * |-----|--------------------------------|-----|--------------------------------|
41546
+ * | a | AM, PM | A* | |
41547
+ * | d | Day of month | D | |
41548
+ * | h | Hour [1-12] | H | Hour [0-23] |
41549
+ * | m | Minute | M | Month |
41550
+ * | s | Second | S | Fraction of second |
41551
+ * | y | Year (abs) | Y | |
41552
+ *
41553
+ * Letters marked by * are not implemented but reserved by Unicode standard.
41554
+ */
41555
+
41556
+ var formatters$2 = {
41557
+ // Year
41558
+ y: function (date, token) {
41559
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
41560
+ // | Year | y | yy | yyy | yyyy | yyyyy |
41561
+ // |----------|-------|----|-------|-------|-------|
41562
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
41563
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
41564
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
41565
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
41566
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
41567
+ var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
41568
+
41569
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
41570
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
41571
+ },
41572
+ // Month
41573
+ M: function (date, token) {
41574
+ var month = date.getUTCMonth();
41575
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
41576
+ },
41577
+ // Day of the month
41578
+ d: function (date, token) {
41579
+ return addLeadingZeros(date.getUTCDate(), token.length);
41580
+ },
41581
+ // AM or PM
41582
+ a: function (date, token) {
41583
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
41584
+
41585
+ switch (token) {
41586
+ case 'a':
41587
+ case 'aa':
41588
+ return dayPeriodEnumValue.toUpperCase();
41589
+
41590
+ case 'aaa':
41591
+ return dayPeriodEnumValue;
41592
+
41593
+ case 'aaaaa':
41594
+ return dayPeriodEnumValue[0];
41595
+
41596
+ case 'aaaa':
41597
+ default:
41598
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
41599
+ }
41600
+ },
41601
+ // Hour [1-12]
41602
+ h: function (date, token) {
41603
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
41604
+ },
41605
+ // Hour [0-23]
41606
+ H: function (date, token) {
41607
+ return addLeadingZeros(date.getUTCHours(), token.length);
41608
+ },
41609
+ // Minute
41610
+ m: function (date, token) {
41611
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
41612
+ },
41613
+ // Second
41614
+ s: function (date, token) {
41615
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
41616
+ },
41617
+ // Fraction of second
41618
+ S: function (date, token) {
41619
+ var numberOfDigits = token.length;
41620
+ var milliseconds = date.getUTCMilliseconds();
41621
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
41622
+ return addLeadingZeros(fractionalSeconds, token.length);
41623
+ }
41624
+ };
41625
+ var formatters$3 = formatters$2;
41626
+
41524
41627
  var dayPeriodEnum = {
41525
41628
  am: 'am',
41526
41629
  pm: 'pm',
@@ -42347,7 +42450,7 @@ var formatters = {
42347
42450
  }
42348
42451
  };
42349
42452
 
42350
- function formatTimezoneShort(offset, delimiter) {
42453
+ function formatTimezoneShort(offset, dirtyDelimiter) {
42351
42454
  var sign = offset > 0 ? '-' : '+';
42352
42455
  var absOffset = Math.abs(offset);
42353
42456
  var hours = Math.floor(absOffset / 60);
@@ -42357,6 +42460,7 @@ function formatTimezoneShort(offset, delimiter) {
42357
42460
  return sign + String(hours);
42358
42461
  }
42359
42462
 
42463
+ var delimiter = dirtyDelimiter || '';
42360
42464
  return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
42361
42465
  }
42362
42466
 
@@ -42762,7 +42866,7 @@ var unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
42762
42866
  * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
42763
42867
  * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
42764
42868
  *
42765
- * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
42869
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
42766
42870
  * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
42767
42871
  *
42768
42872
  * ### v2.0.0 breaking changes:
@@ -44134,7 +44238,7 @@ var parsers = {
44134
44238
  date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
44135
44239
  return date;
44136
44240
  },
44137
- incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']
44241
+ incompatibleTokens: ['b', 'B', 'H', 'k', 't', 'T']
44138
44242
  },
44139
44243
  // AM, PM, midnight
44140
44244
  b: {
@@ -44176,7 +44280,7 @@ var parsers = {
44176
44280
  date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
44177
44281
  return date;
44178
44282
  },
44179
- incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']
44283
+ incompatibleTokens: ['a', 'B', 'H', 'k', 't', 'T']
44180
44284
  },
44181
44285
  // in the morning, in the afternoon, in the evening, at night
44182
44286
  B: {
@@ -44312,7 +44416,7 @@ var parsers = {
44312
44416
 
44313
44417
  return date;
44314
44418
  },
44315
- incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']
44419
+ incompatibleTokens: ['h', 'H', 'k', 't', 'T']
44316
44420
  },
44317
44421
  // Hour [1-24]
44318
44422
  k: {
@@ -44670,7 +44774,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
44670
44774
  * | | | tt | ... | 2 |
44671
44775
  * | Fraction of second | 30 | S | 0, 1, ..., 9 | |
44672
44776
  * | | | SS | 00, 01, ..., 99 | |
44673
- * | | | SSS | 000, 0001, ..., 999 | |
44777
+ * | | | SSS | 000, 001, ..., 999 | |
44674
44778
  * | | | SSSS | ... | 2 |
44675
44779
  * | Milliseconds timestamp | 20 | T | 512969520900 | |
44676
44780
  * | | | TT | ... | 2 |
@@ -45193,7 +45297,7 @@ function cleanEscapedString(input) {
45193
45297
  * | | | tt | ... | 2 |
45194
45298
  * | Fraction of second | 30 | S | 0, 1, ..., 9 | |
45195
45299
  * | | | SS | 00, 01, ..., 99 | |
45196
- * | | | SSS | 000, 0001, ..., 999 | |
45300
+ * | | | SSS | 000, 001, ..., 999 | |
45197
45301
  * | | | SSSS | ... | 2 |
45198
45302
  * | Milliseconds timestamp | 20 | T | 512969520900 | |
45199
45303
  * | | | TT | ... | 2 |
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cosmotech/core",
3
3
  "private": false,
4
- "version": "1.6.1",
4
+ "version": "1.6.5",
5
5
  "description": "",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.esm.js",
@@ -27,6 +27,9 @@
27
27
  "url": "https://github.com/Cosmo-Tech/webapp-component-core/issues"
28
28
  },
29
29
  "homepage": "https://github.com/Cosmo-Tech/webapp-component-core#readme",
30
+ "browser": {
31
+ "fs": false
32
+ },
30
33
  "devDependencies": {
31
34
  "@babel/cli": "^7.14.3",
32
35
  "@babel/core": "^7.14.3",