styled-exceljs 0.21.1 → 0.21.2

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.
@@ -160,7 +160,7 @@ var DO_NOT_EXPORT_CODEPAGE = true;
160
160
  /*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false, DataView:false, Deno:false, Set:false, Float32Array:false */
161
161
  var XLSX = {};
162
162
  function make_xlsx_lib(XLSX){
163
- XLSX.version = '0.21.1';
163
+ XLSX.version = '0.21.2';
164
164
  var current_codepage = 1200, current_ansi = 1252;
165
165
  /*global cptable:true, window */
166
166
  var $cptable;
@@ -11266,7 +11266,7 @@ function resolve_style_obj_color(obj, themes) {
11266
11266
 
11267
11267
  /* 18.3.1.13 width calculations */
11268
11268
  /* [MS-OI29500] 2.1.595 Column Width & Formatting */
11269
- var DEF_MDW = 6, MAX_MDW = 15, MIN_MDW = 1, MDW = DEF_MDW;
11269
+ var DEF_MDW = 7, MAX_MDW = 15, MIN_MDW = 1, MDW = DEF_MDW;
11270
11270
  function width2px(width) { return Math.floor(( width + (Math.round(128/MDW))/256 )* MDW ); }
11271
11271
  function px2char(px) { return (Math.floor((px - 5)/MDW * 100 + 0.5))/100; }
11272
11272
  function char2width(chr) { return (Math.round((chr * MDW + 5)/MDW*256))/256; }
@@ -16913,7 +16913,8 @@ function parse_ws_xml_cols(columns, cols) {
16913
16913
  var colm=parseInt(coll.min, 10)-1, colM=parseInt(coll.max,10)-1;
16914
16914
  if(coll.outlineLevel) coll.level = (+coll.outlineLevel || 0);
16915
16915
  delete coll.min; delete coll.max; coll.width = +coll.width;
16916
- if(!seencol && coll.width) { seencol = true; find_mdw_colw(coll.width); }
16916
+ /* OOXML widths share the workbook Normal-font MDW; do not infer a different scale per sheet. */
16917
+ if(!seencol && coll.width) { seencol = true; MDW = DEF_MDW; }
16917
16918
  process_col(coll);
16918
16919
  while(colm <= colM) columns[colm++] = dup(coll);
16919
16920
  }
@@ -18083,7 +18084,7 @@ function parse_ws_bin(data, _opts, idx, rels, wb, themes, styles) {
18083
18084
  if(!opts.cellStyles) break;
18084
18085
  while(val.e >= val.s) {
18085
18086
  colinfo[val.e--] = { width: val.w/256, hidden: !!(val.flags & 0x01), level: val.level };
18086
- if(!seencol) { seencol = true; find_mdw_colw(val.w/256); }
18087
+ if(!seencol) { seencol = true; MDW = DEF_MDW; }
18087
18088
  process_col(colinfo[val.e+1]);
18088
18089
  }
18089
18090
  break;
@@ -21623,7 +21624,7 @@ wb.opts.Date1904 = Workbook.WBProps.date1904 = val; break;
21623
21624
  while(val.e >= val.s) {
21624
21625
  colinfo[val.e--] = { width: val.w/256, level: (val.level || 0), hidden: !!(val.flags & 1) };
21625
21626
  if(val.ixfe != null && XFs[val.ixfe]) colinfo[val.e+1].s = resolve_xls_style(XFs[val.ixfe], val.ixfe);
21626
- if(!seencol) { seencol = true; find_mdw_colw(val.w/256); }
21627
+ if(!seencol) { seencol = true; MDW = DEF_MDW; }
21627
21628
  process_col(colinfo[val.e+1]);
21628
21629
  }
21629
21630
  } break;
@@ -26267,7 +26268,8 @@ var numbers_lut_new = function() {
26267
26268
  function numbers_format_cell(cell, t, flags, ofmt, nfmt) {
26268
26269
  var _a, _b, _c, _d;
26269
26270
  var ctype = t & 255, ver = t >> 8;
26270
- var fmt = ver >= 5 ? nfmt : ofmt;
26271
+ /* Missing legacy/new format tables mean the default format. */
26272
+ var fmt = (ver >= 5 ? nfmt : ofmt) || [];
26271
26273
  dur:
26272
26274
  if (flags & (ver > 4 ? 8 : 4) && cell.t == "n" && ctype == 7) {
26273
26275
  var dstyle = ((_a = fmt[7]) == null ? void 0 : _a[0]) ? varint_to_i32(fmt[7][0].data) : -1;
@@ -28182,6 +28184,7 @@ function drawing_mime(path) {
28182
28184
  case "bmp": return "image/bmp";
28183
28185
  case "svg": return "image/svg+xml";
28184
28186
  case "jpg": case "jpeg": return "image/jpeg";
28187
+ case "tif": case "tiff": return "image/tiff";
28185
28188
  default: return "application/octet-stream";
28186
28189
  }
28187
28190
  }
@@ -28197,7 +28200,9 @@ function parse_sheet_drawing(sheet, type, zip, path, idx, opts, wb) {
28197
28200
  if(!img || !img.target) return;
28198
28201
  var ipath = resolve_path(img.target, dfile);
28199
28202
  var ibin = getzipbin(zip, ipath, true);
28200
- if(ibin) img.dataURI = "data:" + drawing_mime(ipath) + ";base64," + Base64_encode_arr(ibin);
28203
+ var contentType = drawing_mime(ipath);
28204
+ if(ibin) img.dataURI = "data:" + contentType + ";base64," + Base64_encode_arr(ibin);
28205
+ img.contentType = contentType;
28201
28206
  img.path = ipath;
28202
28207
  });
28203
28208
  if(opts.charts && draw.charts && draw.charts.length) {