version bump 0.20.3

This commit is contained in:
SheetJS 2024-07-12 11:47:14 -04:00
parent f215b8f79f
commit 8a7cfd47bd
19 changed files with 392 additions and 157 deletions

@ -6,6 +6,7 @@ changes may not be included if they are not expected to break existing code.
## v0.20.3
* Correct parsing of NUMBERS and ODS merge cells (h/t @s-ashwin)
* More precise treatment of infinite and NaN values
* XLML Streaming Write
* Parse `Int8Array` objects (for compatibility with JS engines in Java)

@ -1 +1 @@
XLSX.version = '0.20.2strm';
XLSX.version = '0.20.3';

@ -1117,7 +1117,7 @@ function s5s_to_iwa_comment(s5s) {
return out;
}
function parse_TST_TableModelArchive(M, root, ws, opts) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
var pb = parse_shallow(root.data);
var range = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
range.e.r = (varint_to_i32(pb[6][0].data) >>> 0) - 1;
@ -1196,11 +1196,11 @@ function parse_TST_TableModelArchive(M, root, ws, opts) {
};
});
}
if ((_k = pb[47]) == null ? void 0 : _k[0]) {
if (!((_k = ws["!merges"]) == null ? void 0 : _k.length) && ((_l = pb[47]) == null ? void 0 : _l[0])) {
var merge_owner = parse_shallow(pb[47][0].data);
if ((_l = merge_owner[2]) == null ? void 0 : _l[0]) {
if ((_m = merge_owner[2]) == null ? void 0 : _m[0]) {
var formula_store = parse_shallow(merge_owner[2][0].data);
if (((_m = formula_store[3]) == null ? void 0 : _m[0]) && !ws["!merges"]) {
if ((_n = formula_store[3]) == null ? void 0 : _n[0]) {
ws["!merges"] = mappa(formula_store[3], function(u) {
var _a2, _b2, _c2, _d2, _e2;
var formula_pair = parse_shallow(u);

24
dist/xlsx.core.min.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/xlsx.core.min.map generated vendored

File diff suppressed because one or more lines are too long

87
dist/xlsx.extendscript.js generated vendored

@ -160,7 +160,7 @@ var DO_NOT_EXPORT_CODEPAGE = true;
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false, DataView:false, Deno:false, Set:false, Float32Array:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.20.2strm';
XLSX.version = '0.20.3';
var current_codepage = 1200, current_ansi = 1252;
/*global cptable:true, window */
var $cptable;
@ -11386,10 +11386,12 @@ function parse_fonts(t, styles, themes, opts) {
/* 18.8.2 b CT_BooleanProperty */
case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break;
case '<b/>': font.bold = 1; break;
case '</b>': case '</b': break;
/* 18.8.26 i CT_BooleanProperty */
case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break;
case '<i/>': font.italic = 1; break;
case '</i>': case '</i': break;
/* 18.4.13 u CT_UnderlineProperty */
case '<u':
@ -11401,49 +11403,55 @@ function parse_fonts(t, styles, themes, opts) {
case "doubleAccounting": font.underline = 0x22; break;
} break;
case '<u/>': font.underline = 1; break;
case '</u>': case '</u': break;
/* 18.4.10 strike CT_BooleanProperty */
case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break;
case '<strike/>': font.strike = 1; break;
case '</strike>': case '</strike': break;
/* 18.4.2 outline CT_BooleanProperty */
case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break;
case '<outline/>': font.outline = 1; break;
case '</outline>': case '</outline': break;
/* 18.8.36 shadow CT_BooleanProperty */
case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break;
case '<shadow/>': font.shadow = 1; break;
case '</shadow>': case '</shadow': break;
/* 18.8.12 condense CT_BooleanProperty */
case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break;
case '<condense/>': font.condense = 1; break;
case '</condense>': case '</condense': break;
/* 18.8.17 extend CT_BooleanProperty */
case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break;
case '<extend/>': font.extend = 1; break;
case '</extend>': case '</extend': break;
/* 18.4.11 sz CT_FontSize */
case '<sz': if(y.val) font.sz = +y.val; break;
case '<sz/>': case '</sz>': break;
case '<sz/>': case '</sz>': case '</sz': break;
/* 18.4.14 vertAlign CT_VerticalAlignFontProperty */
case '<vertAlign': if(y.val) font.vertAlign = y.val; break;
case '<vertAlign/>': case '</vertAlign>': break;
case '<vertAlign/>': case '</vertAlign>': case '</vertAlign': break;
/* 18.8.18 family CT_FontFamily */
case '<family': if(y.val) font.family = parseInt(y.val,10); break;
case '<family/>': case '</family>': break;
case '<family/>': case '</family>': case '</family': break;
/* 18.8.35 scheme CT_FontScheme */
case '<scheme': if(y.val) font.scheme = y.val; break;
case '<scheme/>': case '</scheme>': break;
case '<scheme/>': case '</scheme>': case '</scheme': break;
/* 18.4.1 charset CT_IntProperty */
case '<charset':
if(y.val == '1') break;
y.codepage = CS2CP[parseInt(y.val, 10)];
break;
case '<charset/>': case '</charset>': break;
case '<charset/>': case '</charset>': case '</charset': break;
/* 18.?.? color CT_Color */
case '<color':
@ -11466,11 +11474,11 @@ function parse_fonts(t, styles, themes, opts) {
}
break;
case '<color/>': case '</color>': break;
case '<color/>': case '</color>': case '</color': break;
/* note: sometimes mc:AlternateContent appears bare */
case '<AlternateContent': pass = true; break;
case '</AlternateContent>': pass = false; break;
case '</AlternateContent>': case '</AlternateContent': pass = false; break;
/* 18.2.10 extLst CT_ExtensionList ? */
case '<extLst': case '<extLst>': case '</extLst>': break;
@ -23211,10 +23219,18 @@ function parse_content_xml(d, _opts, _nfm) {
if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol};
C = -1; break;
case 'covered-table-cell': // 9.1.5 <table:covered-table-cell>
if(Rn[1] !== '/') ++C;
if(opts.sheetStubs) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
if(Rn[1] !== '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1",10) || 1;
if(opts.sheetStubs) {
while(colpeat-- > 0) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
++C;
} --C;
}
else C += colpeat - 1;
}
textp = ""; textR = [];
break; /* stub */
@ -23222,7 +23238,7 @@ function parse_content_xml(d, _opts, _nfm) {
if(Rn[0].charAt(Rn[0].length-2) === '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10)||1;
q = ({t:'z', v:null});
if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));
if(ctag["style-name"] && styles[ctag["style-name"]]) q.z = styles[ctag["style-name"]];
@ -23266,10 +23282,12 @@ function parse_content_xml(d, _opts, _nfm) {
q.F = arrayf[i][1];
}
if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) {
mR = parseInt(ctag['number-rows-spanned'],10) || 0;
mC = parseInt(ctag['number-columns-spanned'],10) || 0;
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
mR = parseInt(ctag['number-rows-spanned']||"1",10) || 1;
mC = parseInt(ctag['number-columns-spanned']||"1",10) || 1;
if(mR * mC > 1) {
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
}
}
/* 19.675.2 table:number-columns-repeated */
@ -23701,7 +23719,6 @@ function parse_fods(data, opts) {
wb.bookType = "fods";
return wb;
}
/* OpenDocument */
var write_styles_ods = /* @__PURE__ */(function() {
var master_styles = [
@ -25333,7 +25350,7 @@ function s5s_to_iwa_comment(s5s) {
return out;
}
function parse_TST_TableModelArchive(M, root, ws, opts) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
var pb = parse_shallow(root.data);
var range = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
range.e.r = (varint_to_i32(pb[6][0].data) >>> 0) - 1;
@ -25412,6 +25429,38 @@ function parse_TST_TableModelArchive(M, root, ws, opts) {
};
});
}
if (!((_k = ws["!merges"]) == null ? void 0 : _k.length) && ((_l = pb[47]) == null ? void 0 : _l[0])) {
var merge_owner = parse_shallow(pb[47][0].data);
if ((_m = merge_owner[2]) == null ? void 0 : _m[0]) {
var formula_store = parse_shallow(merge_owner[2][0].data);
if ((_n = formula_store[3]) == null ? void 0 : _n[0]) {
ws["!merges"] = mappa(formula_store[3], function(u) {
var _a2, _b2, _c2, _d2, _e2;
var formula_pair = parse_shallow(u);
var formula = parse_shallow(formula_pair[2][0].data);
var AST_node_array = parse_shallow(formula[1][0].data);
if (!((_a2 = AST_node_array[1]) == null ? void 0 : _a2[0]))
return;
var AST_node0 = parse_shallow(AST_node_array[1][0].data);
var AST_node_type = varint_to_i32(AST_node0[1][0].data);
if (AST_node_type != 67)
return;
var AST_colon_tract = parse_shallow(AST_node0[40][0].data);
if (!((_b2 = AST_colon_tract[3]) == null ? void 0 : _b2[0]) || !((_c2 = AST_colon_tract[4]) == null ? void 0 : _c2[0]))
return;
var colrange = parse_shallow(AST_colon_tract[3][0].data);
var rowrange = parse_shallow(AST_colon_tract[4][0].data);
var c = varint_to_i32(colrange[1][0].data);
var C = ((_d2 = colrange[2]) == null ? void 0 : _d2[0]) ? varint_to_i32(colrange[2][0].data) : c;
var r = varint_to_i32(rowrange[1][0].data);
var R = ((_e2 = rowrange[2]) == null ? void 0 : _e2[0]) ? varint_to_i32(rowrange[2][0].data) : r;
return { s: { r: r, c: c }, e: { r: R, c: C } };
}).filter(function(x) {
return x != null;
});
}
}
}
}
function parse_TST_TableInfoArchive(M, root, opts) {
var pb = parse_shallow(root.data);

22
dist/xlsx.full.min.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/xlsx.full.min.map generated vendored

File diff suppressed because one or more lines are too long

18
dist/xlsx.mini.min.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/xlsx.mini.min.map generated vendored

File diff suppressed because one or more lines are too long

@ -1117,7 +1117,7 @@ function s5s_to_iwa_comment(s5s) {
return out;
}
function parse_TST_TableModelArchive(M, root, ws, opts) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
var pb = parse_shallow(root.data);
var range = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
range.e.r = (varint_to_i32(pb[6][0].data) >>> 0) - 1;
@ -1196,11 +1196,11 @@ function parse_TST_TableModelArchive(M, root, ws, opts) {
};
});
}
if ((_k = pb[47]) == null ? void 0 : _k[0]) {
if (!((_k = ws["!merges"]) == null ? void 0 : _k.length) && ((_l = pb[47]) == null ? void 0 : _l[0])) {
var merge_owner = parse_shallow(pb[47][0].data);
if ((_l = merge_owner[2]) == null ? void 0 : _l[0]) {
if ((_m = merge_owner[2]) == null ? void 0 : _m[0]) {
var formula_store = parse_shallow(merge_owner[2][0].data);
if (((_m = formula_store[3]) == null ? void 0 : _m[0]) && !ws["!merges"]) {
if ((_n = formula_store[3]) == null ? void 0 : _n[0]) {
ws["!merges"] = mappa(formula_store[3], function(u) {
var _a2, _b2, _c2, _d2, _e2;
var formula_pair = parse_shallow(u);

@ -1,6 +1,6 @@
{
"name": "xlsx",
"version": "0.20.2+strm",
"version": "0.20.3",
"author": "sheetjs",
"description": "SheetJS Spreadsheet data parser and writer",
"keywords": [

@ -2572,6 +2572,8 @@ function get_dom_element(html) {
domelt.innerHTML = html;
if(document.body) document.body.appendChild(domelt);
inserted_dom_elements.push(domelt);
var elts = domelt.getElementsByTagName("TABLE");
if(elts && elts[0]) return elts[0];
return domelt.children[0];
}
if(!JSDOM) throw new Error("Browser test fail");

2
tests/core.js generated

@ -2572,6 +2572,8 @@ function get_dom_element(html) {
domelt.innerHTML = html;
if(document.body) document.body.appendChild(domelt);
inserted_dom_elements.push(domelt);
var elts = domelt.getElementsByTagName("TABLE");
if(elts && elts[0]) return elts[0];
return domelt.children[0];
}
if(!JSDOM) throw new Error("Browser test fail");

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false, DataView:false, Deno:false, Set:false, Float32Array:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.20.2strm';
XLSX.version = '0.20.3';
var current_codepage = 1200, current_ansi = 1252;
/*:: declare var cptable:any; */
/*global cptable:true, window */
@ -11321,10 +11321,12 @@ function parse_fonts(t, styles, themes, opts) {
/* 18.8.2 b CT_BooleanProperty */
case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break;
case '<b/>': font.bold = 1; break;
case '</b>': case '</b': break;
/* 18.8.26 i CT_BooleanProperty */
case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break;
case '<i/>': font.italic = 1; break;
case '</i>': case '</i': break;
/* 18.4.13 u CT_UnderlineProperty */
case '<u':
@ -11336,49 +11338,55 @@ function parse_fonts(t, styles, themes, opts) {
case "doubleAccounting": font.underline = 0x22; break;
} break;
case '<u/>': font.underline = 1; break;
case '</u>': case '</u': break;
/* 18.4.10 strike CT_BooleanProperty */
case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break;
case '<strike/>': font.strike = 1; break;
case '</strike>': case '</strike': break;
/* 18.4.2 outline CT_BooleanProperty */
case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break;
case '<outline/>': font.outline = 1; break;
case '</outline>': case '</outline': break;
/* 18.8.36 shadow CT_BooleanProperty */
case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break;
case '<shadow/>': font.shadow = 1; break;
case '</shadow>': case '</shadow': break;
/* 18.8.12 condense CT_BooleanProperty */
case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break;
case '<condense/>': font.condense = 1; break;
case '</condense>': case '</condense': break;
/* 18.8.17 extend CT_BooleanProperty */
case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break;
case '<extend/>': font.extend = 1; break;
case '</extend>': case '</extend': break;
/* 18.4.11 sz CT_FontSize */
case '<sz': if(y.val) font.sz = +y.val; break;
case '<sz/>': case '</sz>': break;
case '<sz/>': case '</sz>': case '</sz': break;
/* 18.4.14 vertAlign CT_VerticalAlignFontProperty */
case '<vertAlign': if(y.val) font.vertAlign = y.val; break;
case '<vertAlign/>': case '</vertAlign>': break;
case '<vertAlign/>': case '</vertAlign>': case '</vertAlign': break;
/* 18.8.18 family CT_FontFamily */
case '<family': if(y.val) font.family = parseInt(y.val,10); break;
case '<family/>': case '</family>': break;
case '<family/>': case '</family>': case '</family': break;
/* 18.8.35 scheme CT_FontScheme */
case '<scheme': if(y.val) font.scheme = y.val; break;
case '<scheme/>': case '</scheme>': break;
case '<scheme/>': case '</scheme>': case '</scheme': break;
/* 18.4.1 charset CT_IntProperty */
case '<charset':
if(y.val == '1') break;
y.codepage = CS2CP[parseInt(y.val, 10)];
break;
case '<charset/>': case '</charset>': break;
case '<charset/>': case '</charset>': case '</charset': break;
/* 18.?.? color CT_Color */
case '<color':
@ -11401,11 +11409,11 @@ function parse_fonts(t, styles, themes, opts) {
}
break;
case '<color/>': case '</color>': break;
case '<color/>': case '</color>': case '</color': break;
/* note: sometimes mc:AlternateContent appears bare */
case '<AlternateContent': pass = true; break;
case '</AlternateContent>': pass = false; break;
case '</AlternateContent>': case '</AlternateContent': pass = false; break;
/* 18.2.10 extLst CT_ExtensionList ? */
case '<extLst': case '<extLst>': case '</extLst>': break;
@ -23165,10 +23173,18 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol};
C = -1; break;
case 'covered-table-cell': // 9.1.5 <table:covered-table-cell>
if(Rn[1] !== '/') ++C;
if(opts.sheetStubs) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
if(Rn[1] !== '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1",10) || 1;
if(opts.sheetStubs) {
while(colpeat-- > 0) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
++C;
} --C;
}
else C += colpeat - 1;
}
textp = ""; textR = [];
break; /* stub */
@ -23176,7 +23192,7 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
if(Rn[0].charAt(Rn[0].length-2) === '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10)||1;
q = ({t:'z', v:null/*:: , z:null, w:"",c:[]*/}/*:any*/);
if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));
if(ctag["style-name"] && styles[ctag["style-name"]]) q.z = styles[ctag["style-name"]];
@ -23220,10 +23236,12 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
q.F = arrayf[i][1];
}
if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) {
mR = parseInt(ctag['number-rows-spanned'],10) || 0;
mC = parseInt(ctag['number-columns-spanned'],10) || 0;
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
mR = parseInt(ctag['number-rows-spanned']||"1",10) || 1;
mC = parseInt(ctag['number-columns-spanned']||"1",10) || 1;
if(mR * mC > 1) {
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
}
}
/* 19.675.2 table:number-columns-repeated */
@ -23655,7 +23673,6 @@ function parse_fods(data/*:string*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
wb.bookType = "fods";
return wb;
}
/* OpenDocument */
var write_styles_ods/*:{(wb:any, opts:any):string}*/ = /* @__PURE__ */(function() {
var master_styles = [
@ -25287,7 +25304,7 @@ function s5s_to_iwa_comment(s5s) {
return out;
}
function parse_TST_TableModelArchive(M, root, ws, opts) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
var pb = parse_shallow(root.data);
var range = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
range.e.r = (varint_to_i32(pb[6][0].data) >>> 0) - 1;
@ -25366,6 +25383,38 @@ function parse_TST_TableModelArchive(M, root, ws, opts) {
};
});
}
if (!((_k = ws["!merges"]) == null ? void 0 : _k.length) && ((_l = pb[47]) == null ? void 0 : _l[0])) {
var merge_owner = parse_shallow(pb[47][0].data);
if ((_m = merge_owner[2]) == null ? void 0 : _m[0]) {
var formula_store = parse_shallow(merge_owner[2][0].data);
if ((_n = formula_store[3]) == null ? void 0 : _n[0]) {
ws["!merges"] = mappa(formula_store[3], function(u) {
var _a2, _b2, _c2, _d2, _e2;
var formula_pair = parse_shallow(u);
var formula = parse_shallow(formula_pair[2][0].data);
var AST_node_array = parse_shallow(formula[1][0].data);
if (!((_a2 = AST_node_array[1]) == null ? void 0 : _a2[0]))
return;
var AST_node0 = parse_shallow(AST_node_array[1][0].data);
var AST_node_type = varint_to_i32(AST_node0[1][0].data);
if (AST_node_type != 67)
return;
var AST_colon_tract = parse_shallow(AST_node0[40][0].data);
if (!((_b2 = AST_colon_tract[3]) == null ? void 0 : _b2[0]) || !((_c2 = AST_colon_tract[4]) == null ? void 0 : _c2[0]))
return;
var colrange = parse_shallow(AST_colon_tract[3][0].data);
var rowrange = parse_shallow(AST_colon_tract[4][0].data);
var c = varint_to_i32(colrange[1][0].data);
var C = ((_d2 = colrange[2]) == null ? void 0 : _d2[0]) ? varint_to_i32(colrange[2][0].data) : c;
var r = varint_to_i32(rowrange[1][0].data);
var R = ((_e2 = rowrange[2]) == null ? void 0 : _e2[0]) ? varint_to_i32(rowrange[2][0].data) : r;
return { s: { r: r, c: c }, e: { r: R, c: C } };
}).filter(function(x) {
return x != null;
});
}
}
}
}
function parse_TST_TableInfoArchive(M, root, opts) {
var pb = parse_shallow(root.data);

87
xlsx.js generated

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false, DataView:false, Deno:false, Set:false, Float32Array:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.20.2strm';
XLSX.version = '0.20.3';
var current_codepage = 1200, current_ansi = 1252;
/*global cptable:true, window */
var $cptable;
@ -11230,10 +11230,12 @@ function parse_fonts(t, styles, themes, opts) {
/* 18.8.2 b CT_BooleanProperty */
case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break;
case '<b/>': font.bold = 1; break;
case '</b>': case '</b': break;
/* 18.8.26 i CT_BooleanProperty */
case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break;
case '<i/>': font.italic = 1; break;
case '</i>': case '</i': break;
/* 18.4.13 u CT_UnderlineProperty */
case '<u':
@ -11245,49 +11247,55 @@ function parse_fonts(t, styles, themes, opts) {
case "doubleAccounting": font.underline = 0x22; break;
} break;
case '<u/>': font.underline = 1; break;
case '</u>': case '</u': break;
/* 18.4.10 strike CT_BooleanProperty */
case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break;
case '<strike/>': font.strike = 1; break;
case '</strike>': case '</strike': break;
/* 18.4.2 outline CT_BooleanProperty */
case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break;
case '<outline/>': font.outline = 1; break;
case '</outline>': case '</outline': break;
/* 18.8.36 shadow CT_BooleanProperty */
case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break;
case '<shadow/>': font.shadow = 1; break;
case '</shadow>': case '</shadow': break;
/* 18.8.12 condense CT_BooleanProperty */
case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break;
case '<condense/>': font.condense = 1; break;
case '</condense>': case '</condense': break;
/* 18.8.17 extend CT_BooleanProperty */
case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break;
case '<extend/>': font.extend = 1; break;
case '</extend>': case '</extend': break;
/* 18.4.11 sz CT_FontSize */
case '<sz': if(y.val) font.sz = +y.val; break;
case '<sz/>': case '</sz>': break;
case '<sz/>': case '</sz>': case '</sz': break;
/* 18.4.14 vertAlign CT_VerticalAlignFontProperty */
case '<vertAlign': if(y.val) font.vertAlign = y.val; break;
case '<vertAlign/>': case '</vertAlign>': break;
case '<vertAlign/>': case '</vertAlign>': case '</vertAlign': break;
/* 18.8.18 family CT_FontFamily */
case '<family': if(y.val) font.family = parseInt(y.val,10); break;
case '<family/>': case '</family>': break;
case '<family/>': case '</family>': case '</family': break;
/* 18.8.35 scheme CT_FontScheme */
case '<scheme': if(y.val) font.scheme = y.val; break;
case '<scheme/>': case '</scheme>': break;
case '<scheme/>': case '</scheme>': case '</scheme': break;
/* 18.4.1 charset CT_IntProperty */
case '<charset':
if(y.val == '1') break;
y.codepage = CS2CP[parseInt(y.val, 10)];
break;
case '<charset/>': case '</charset>': break;
case '<charset/>': case '</charset>': case '</charset': break;
/* 18.?.? color CT_Color */
case '<color':
@ -11310,11 +11318,11 @@ function parse_fonts(t, styles, themes, opts) {
}
break;
case '<color/>': case '</color>': break;
case '<color/>': case '</color>': case '</color': break;
/* note: sometimes mc:AlternateContent appears bare */
case '<AlternateContent': pass = true; break;
case '</AlternateContent>': pass = false; break;
case '</AlternateContent>': case '</AlternateContent': pass = false; break;
/* 18.2.10 extLst CT_ExtensionList ? */
case '<extLst': case '<extLst>': case '</extLst>': break;
@ -23055,10 +23063,18 @@ function parse_content_xml(d, _opts, _nfm) {
if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol};
C = -1; break;
case 'covered-table-cell': // 9.1.5 <table:covered-table-cell>
if(Rn[1] !== '/') ++C;
if(opts.sheetStubs) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
if(Rn[1] !== '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1",10) || 1;
if(opts.sheetStubs) {
while(colpeat-- > 0) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
++C;
} --C;
}
else C += colpeat - 1;
}
textp = ""; textR = [];
break; /* stub */
@ -23066,7 +23082,7 @@ function parse_content_xml(d, _opts, _nfm) {
if(Rn[0].charAt(Rn[0].length-2) === '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10)||1;
q = ({t:'z', v:null});
if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));
if(ctag["style-name"] && styles[ctag["style-name"]]) q.z = styles[ctag["style-name"]];
@ -23110,10 +23126,12 @@ function parse_content_xml(d, _opts, _nfm) {
q.F = arrayf[i][1];
}
if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) {
mR = parseInt(ctag['number-rows-spanned'],10) || 0;
mC = parseInt(ctag['number-columns-spanned'],10) || 0;
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
mR = parseInt(ctag['number-rows-spanned']||"1",10) || 1;
mC = parseInt(ctag['number-columns-spanned']||"1",10) || 1;
if(mR * mC > 1) {
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
}
}
/* 19.675.2 table:number-columns-repeated */
@ -23545,7 +23563,6 @@ function parse_fods(data, opts) {
wb.bookType = "fods";
return wb;
}
/* OpenDocument */
var write_styles_ods = /* @__PURE__ */(function() {
var master_styles = [
@ -25177,7 +25194,7 @@ function s5s_to_iwa_comment(s5s) {
return out;
}
function parse_TST_TableModelArchive(M, root, ws, opts) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
var pb = parse_shallow(root.data);
var range = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
range.e.r = (varint_to_i32(pb[6][0].data) >>> 0) - 1;
@ -25256,6 +25273,38 @@ function parse_TST_TableModelArchive(M, root, ws, opts) {
};
});
}
if (!((_k = ws["!merges"]) == null ? void 0 : _k.length) && ((_l = pb[47]) == null ? void 0 : _l[0])) {
var merge_owner = parse_shallow(pb[47][0].data);
if ((_m = merge_owner[2]) == null ? void 0 : _m[0]) {
var formula_store = parse_shallow(merge_owner[2][0].data);
if ((_n = formula_store[3]) == null ? void 0 : _n[0]) {
ws["!merges"] = mappa(formula_store[3], function(u) {
var _a2, _b2, _c2, _d2, _e2;
var formula_pair = parse_shallow(u);
var formula = parse_shallow(formula_pair[2][0].data);
var AST_node_array = parse_shallow(formula[1][0].data);
if (!((_a2 = AST_node_array[1]) == null ? void 0 : _a2[0]))
return;
var AST_node0 = parse_shallow(AST_node_array[1][0].data);
var AST_node_type = varint_to_i32(AST_node0[1][0].data);
if (AST_node_type != 67)
return;
var AST_colon_tract = parse_shallow(AST_node0[40][0].data);
if (!((_b2 = AST_colon_tract[3]) == null ? void 0 : _b2[0]) || !((_c2 = AST_colon_tract[4]) == null ? void 0 : _c2[0]))
return;
var colrange = parse_shallow(AST_colon_tract[3][0].data);
var rowrange = parse_shallow(AST_colon_tract[4][0].data);
var c = varint_to_i32(colrange[1][0].data);
var C = ((_d2 = colrange[2]) == null ? void 0 : _d2[0]) ? varint_to_i32(colrange[2][0].data) : c;
var r = varint_to_i32(rowrange[1][0].data);
var R = ((_e2 = rowrange[2]) == null ? void 0 : _e2[0]) ? varint_to_i32(rowrange[2][0].data) : r;
return { s: { r: r, c: c }, e: { r: R, c: C } };
}).filter(function(x) {
return x != null;
});
}
}
}
}
function parse_TST_TableInfoArchive(M, root, opts) {
var pb = parse_shallow(root.data);

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false, DataView:false, Deno:false, Set:false, Float32Array:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.20.2strm';
XLSX.version = '0.20.3';
var current_codepage = 1200, current_ansi = 1252;
/*:: declare var cptable:any; */
/*global cptable:true, window */
@ -7435,10 +7435,12 @@ function parse_fonts(t, styles, themes, opts) {
/* 18.8.2 b CT_BooleanProperty */
case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break;
case '<b/>': font.bold = 1; break;
case '</b>': case '</b': break;
/* 18.8.26 i CT_BooleanProperty */
case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break;
case '<i/>': font.italic = 1; break;
case '</i>': case '</i': break;
/* 18.4.13 u CT_UnderlineProperty */
case '<u':
@ -7450,49 +7452,55 @@ function parse_fonts(t, styles, themes, opts) {
case "doubleAccounting": font.underline = 0x22; break;
} break;
case '<u/>': font.underline = 1; break;
case '</u>': case '</u': break;
/* 18.4.10 strike CT_BooleanProperty */
case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break;
case '<strike/>': font.strike = 1; break;
case '</strike>': case '</strike': break;
/* 18.4.2 outline CT_BooleanProperty */
case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break;
case '<outline/>': font.outline = 1; break;
case '</outline>': case '</outline': break;
/* 18.8.36 shadow CT_BooleanProperty */
case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break;
case '<shadow/>': font.shadow = 1; break;
case '</shadow>': case '</shadow': break;
/* 18.8.12 condense CT_BooleanProperty */
case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break;
case '<condense/>': font.condense = 1; break;
case '</condense>': case '</condense': break;
/* 18.8.17 extend CT_BooleanProperty */
case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break;
case '<extend/>': font.extend = 1; break;
case '</extend>': case '</extend': break;
/* 18.4.11 sz CT_FontSize */
case '<sz': if(y.val) font.sz = +y.val; break;
case '<sz/>': case '</sz>': break;
case '<sz/>': case '</sz>': case '</sz': break;
/* 18.4.14 vertAlign CT_VerticalAlignFontProperty */
case '<vertAlign': if(y.val) font.vertAlign = y.val; break;
case '<vertAlign/>': case '</vertAlign>': break;
case '<vertAlign/>': case '</vertAlign>': case '</vertAlign': break;
/* 18.8.18 family CT_FontFamily */
case '<family': if(y.val) font.family = parseInt(y.val,10); break;
case '<family/>': case '</family>': break;
case '<family/>': case '</family>': case '</family': break;
/* 18.8.35 scheme CT_FontScheme */
case '<scheme': if(y.val) font.scheme = y.val; break;
case '<scheme/>': case '</scheme>': break;
case '<scheme/>': case '</scheme>': case '</scheme': break;
/* 18.4.1 charset CT_IntProperty */
case '<charset':
if(y.val == '1') break;
y.codepage = CS2CP[parseInt(y.val, 10)];
break;
case '<charset/>': case '</charset>': break;
case '<charset/>': case '</charset>': case '</charset': break;
/* 18.?.? color CT_Color */
case '<color':
@ -7515,11 +7523,11 @@ function parse_fonts(t, styles, themes, opts) {
}
break;
case '<color/>': case '</color>': break;
case '<color/>': case '</color>': case '</color': break;
/* note: sometimes mc:AlternateContent appears bare */
case '<AlternateContent': pass = true; break;
case '</AlternateContent>': pass = false; break;
case '</AlternateContent>': case '</AlternateContent': pass = false; break;
/* 18.2.10 extLst CT_ExtensionList ? */
case '<extLst': case '<extLst>': case '</extLst>': break;
@ -10482,10 +10490,18 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol};
C = -1; break;
case 'covered-table-cell': // 9.1.5 <table:covered-table-cell>
if(Rn[1] !== '/') ++C;
if(opts.sheetStubs) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
if(Rn[1] !== '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1",10) || 1;
if(opts.sheetStubs) {
while(colpeat-- > 0) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
++C;
} --C;
}
else C += colpeat - 1;
}
textp = ""; textR = [];
break; /* stub */
@ -10493,7 +10509,7 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
if(Rn[0].charAt(Rn[0].length-2) === '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10)||1;
q = ({t:'z', v:null/*:: , z:null, w:"",c:[]*/}/*:any*/);
if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));
if(ctag["style-name"] && styles[ctag["style-name"]]) q.z = styles[ctag["style-name"]];
@ -10537,10 +10553,12 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
q.F = arrayf[i][1];
}
if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) {
mR = parseInt(ctag['number-rows-spanned'],10) || 0;
mC = parseInt(ctag['number-columns-spanned'],10) || 0;
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
mR = parseInt(ctag['number-rows-spanned']||"1",10) || 1;
mC = parseInt(ctag['number-columns-spanned']||"1",10) || 1;
if(mR * mC > 1) {
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
}
}
/* 19.675.2 table:number-columns-repeated */
@ -10972,7 +10990,6 @@ function parse_fods(data/*:string*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
wb.bookType = "fods";
return wb;
}
/* OpenDocument */
var write_styles_ods/*:{(wb:any, opts:any):string}*/ = /* @__PURE__ */(function() {
var master_styles = [

@ -4,7 +4,7 @@
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false, DataView:false, Deno:false, Set:false, Float32Array:false */
var XLSX = {};
function make_xlsx_lib(XLSX){
XLSX.version = '0.20.2strm';
XLSX.version = '0.20.3';
var current_codepage = 1200, current_ansi = 1252;
/*global cptable:true, window */
var $cptable;
@ -7349,10 +7349,12 @@ function parse_fonts(t, styles, themes, opts) {
/* 18.8.2 b CT_BooleanProperty */
case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break;
case '<b/>': font.bold = 1; break;
case '</b>': case '</b': break;
/* 18.8.26 i CT_BooleanProperty */
case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break;
case '<i/>': font.italic = 1; break;
case '</i>': case '</i': break;
/* 18.4.13 u CT_UnderlineProperty */
case '<u':
@ -7364,49 +7366,55 @@ function parse_fonts(t, styles, themes, opts) {
case "doubleAccounting": font.underline = 0x22; break;
} break;
case '<u/>': font.underline = 1; break;
case '</u>': case '</u': break;
/* 18.4.10 strike CT_BooleanProperty */
case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break;
case '<strike/>': font.strike = 1; break;
case '</strike>': case '</strike': break;
/* 18.4.2 outline CT_BooleanProperty */
case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break;
case '<outline/>': font.outline = 1; break;
case '</outline>': case '</outline': break;
/* 18.8.36 shadow CT_BooleanProperty */
case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break;
case '<shadow/>': font.shadow = 1; break;
case '</shadow>': case '</shadow': break;
/* 18.8.12 condense CT_BooleanProperty */
case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break;
case '<condense/>': font.condense = 1; break;
case '</condense>': case '</condense': break;
/* 18.8.17 extend CT_BooleanProperty */
case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break;
case '<extend/>': font.extend = 1; break;
case '</extend>': case '</extend': break;
/* 18.4.11 sz CT_FontSize */
case '<sz': if(y.val) font.sz = +y.val; break;
case '<sz/>': case '</sz>': break;
case '<sz/>': case '</sz>': case '</sz': break;
/* 18.4.14 vertAlign CT_VerticalAlignFontProperty */
case '<vertAlign': if(y.val) font.vertAlign = y.val; break;
case '<vertAlign/>': case '</vertAlign>': break;
case '<vertAlign/>': case '</vertAlign>': case '</vertAlign': break;
/* 18.8.18 family CT_FontFamily */
case '<family': if(y.val) font.family = parseInt(y.val,10); break;
case '<family/>': case '</family>': break;
case '<family/>': case '</family>': case '</family': break;
/* 18.8.35 scheme CT_FontScheme */
case '<scheme': if(y.val) font.scheme = y.val; break;
case '<scheme/>': case '</scheme>': break;
case '<scheme/>': case '</scheme>': case '</scheme': break;
/* 18.4.1 charset CT_IntProperty */
case '<charset':
if(y.val == '1') break;
y.codepage = CS2CP[parseInt(y.val, 10)];
break;
case '<charset/>': case '</charset>': break;
case '<charset/>': case '</charset>': case '</charset': break;
/* 18.?.? color CT_Color */
case '<color':
@ -7429,11 +7437,11 @@ function parse_fonts(t, styles, themes, opts) {
}
break;
case '<color/>': case '</color>': break;
case '<color/>': case '</color>': case '</color': break;
/* note: sometimes mc:AlternateContent appears bare */
case '<AlternateContent': pass = true; break;
case '</AlternateContent>': pass = false; break;
case '</AlternateContent>': case '</AlternateContent': pass = false; break;
/* 18.2.10 extLst CT_ExtensionList ? */
case '<extLst': case '<extLst>': case '</extLst>': break;
@ -10394,10 +10402,18 @@ function parse_content_xml(d, _opts, _nfm) {
if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol};
C = -1; break;
case 'covered-table-cell': // 9.1.5 <table:covered-table-cell>
if(Rn[1] !== '/') ++C;
if(opts.sheetStubs) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
if(Rn[1] !== '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1",10) || 1;
if(opts.sheetStubs) {
while(colpeat-- > 0) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
++C;
} --C;
}
else C += colpeat - 1;
}
textp = ""; textR = [];
break; /* stub */
@ -10405,7 +10421,7 @@ function parse_content_xml(d, _opts, _nfm) {
if(Rn[0].charAt(Rn[0].length-2) === '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10)||1;
q = ({t:'z', v:null});
if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));
if(ctag["style-name"] && styles[ctag["style-name"]]) q.z = styles[ctag["style-name"]];
@ -10449,10 +10465,12 @@ function parse_content_xml(d, _opts, _nfm) {
q.F = arrayf[i][1];
}
if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) {
mR = parseInt(ctag['number-rows-spanned'],10) || 0;
mC = parseInt(ctag['number-columns-spanned'],10) || 0;
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
mR = parseInt(ctag['number-rows-spanned']||"1",10) || 1;
mC = parseInt(ctag['number-columns-spanned']||"1",10) || 1;
if(mR * mC > 1) {
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
}
}
/* 19.675.2 table:number-columns-repeated */
@ -10884,7 +10902,6 @@ function parse_fods(data, opts) {
wb.bookType = "fods";
return wb;
}
/* OpenDocument */
var write_styles_ods = /* @__PURE__ */(function() {
var master_styles = [

87
xlsx.mjs generated

@ -3,7 +3,7 @@
/*exported XLSX */
/*global process:false, Buffer:false, ArrayBuffer:false, DataView:false, Deno:false */
var XLSX = {};
XLSX.version = '0.20.2strm';
XLSX.version = '0.20.3';
var current_codepage = 1200, current_ansi = 1252;
/*:: declare var cptable:any; */
/*global cptable:true, window */
@ -11316,10 +11316,12 @@ function parse_fonts(t, styles, themes, opts) {
/* 18.8.2 b CT_BooleanProperty */
case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break;
case '<b/>': font.bold = 1; break;
case '</b>': case '</b': break;
/* 18.8.26 i CT_BooleanProperty */
case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break;
case '<i/>': font.italic = 1; break;
case '</i>': case '</i': break;
/* 18.4.13 u CT_UnderlineProperty */
case '<u':
@ -11331,49 +11333,55 @@ function parse_fonts(t, styles, themes, opts) {
case "doubleAccounting": font.underline = 0x22; break;
} break;
case '<u/>': font.underline = 1; break;
case '</u>': case '</u': break;
/* 18.4.10 strike CT_BooleanProperty */
case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break;
case '<strike/>': font.strike = 1; break;
case '</strike>': case '</strike': break;
/* 18.4.2 outline CT_BooleanProperty */
case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break;
case '<outline/>': font.outline = 1; break;
case '</outline>': case '</outline': break;
/* 18.8.36 shadow CT_BooleanProperty */
case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break;
case '<shadow/>': font.shadow = 1; break;
case '</shadow>': case '</shadow': break;
/* 18.8.12 condense CT_BooleanProperty */
case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break;
case '<condense/>': font.condense = 1; break;
case '</condense>': case '</condense': break;
/* 18.8.17 extend CT_BooleanProperty */
case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break;
case '<extend/>': font.extend = 1; break;
case '</extend>': case '</extend': break;
/* 18.4.11 sz CT_FontSize */
case '<sz': if(y.val) font.sz = +y.val; break;
case '<sz/>': case '</sz>': break;
case '<sz/>': case '</sz>': case '</sz': break;
/* 18.4.14 vertAlign CT_VerticalAlignFontProperty */
case '<vertAlign': if(y.val) font.vertAlign = y.val; break;
case '<vertAlign/>': case '</vertAlign>': break;
case '<vertAlign/>': case '</vertAlign>': case '</vertAlign': break;
/* 18.8.18 family CT_FontFamily */
case '<family': if(y.val) font.family = parseInt(y.val,10); break;
case '<family/>': case '</family>': break;
case '<family/>': case '</family>': case '</family': break;
/* 18.8.35 scheme CT_FontScheme */
case '<scheme': if(y.val) font.scheme = y.val; break;
case '<scheme/>': case '</scheme>': break;
case '<scheme/>': case '</scheme>': case '</scheme': break;
/* 18.4.1 charset CT_IntProperty */
case '<charset':
if(y.val == '1') break;
y.codepage = CS2CP[parseInt(y.val, 10)];
break;
case '<charset/>': case '</charset>': break;
case '<charset/>': case '</charset>': case '</charset': break;
/* 18.?.? color CT_Color */
case '<color':
@ -11396,11 +11404,11 @@ function parse_fonts(t, styles, themes, opts) {
}
break;
case '<color/>': case '</color>': break;
case '<color/>': case '</color>': case '</color': break;
/* note: sometimes mc:AlternateContent appears bare */
case '<AlternateContent': pass = true; break;
case '</AlternateContent>': pass = false; break;
case '</AlternateContent>': case '</AlternateContent': pass = false; break;
/* 18.2.10 extLst CT_ExtensionList ? */
case '<extLst': case '<extLst>': case '</extLst>': break;
@ -23160,10 +23168,18 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol};
C = -1; break;
case 'covered-table-cell': // 9.1.5 <table:covered-table-cell>
if(Rn[1] !== '/') ++C;
if(opts.sheetStubs) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
if(Rn[1] !== '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1",10) || 1;
if(opts.sheetStubs) {
while(colpeat-- > 0) {
if(opts.dense) { if(!ws["!data"][R]) ws["!data"][R] = []; ws["!data"][R][C] = {t:'z'}; }
else ws[encode_cell({r:R,c:C})] = {t:'z'};
++C;
} --C;
}
else C += colpeat - 1;
}
textp = ""; textR = [];
break; /* stub */
@ -23171,7 +23187,7 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
if(Rn[0].charAt(Rn[0].length-2) === '/') {
++C;
ctag = parsexmltag(Rn[0], false);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
colpeat = parseInt(ctag['number-columns-repeated']||"1", 10)||1;
q = ({t:'z', v:null/*:: , z:null, w:"",c:[]*/}/*:any*/);
if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));
if(ctag["style-name"] && styles[ctag["style-name"]]) q.z = styles[ctag["style-name"]];
@ -23215,10 +23231,12 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
q.F = arrayf[i][1];
}
if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) {
mR = parseInt(ctag['number-rows-spanned'],10) || 0;
mC = parseInt(ctag['number-columns-spanned'],10) || 0;
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
mR = parseInt(ctag['number-rows-spanned']||"1",10) || 1;
mC = parseInt(ctag['number-columns-spanned']||"1",10) || 1;
if(mR * mC > 1) {
mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
merges.push(mrange);
}
}
/* 19.675.2 table:number-columns-repeated */
@ -23650,7 +23668,6 @@ function parse_fods(data/*:string*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
wb.bookType = "fods";
return wb;
}
/* OpenDocument */
var write_styles_ods/*:{(wb:any, opts:any):string}*/ = /* @__PURE__ */(function() {
var master_styles = [
@ -25282,7 +25299,7 @@ function s5s_to_iwa_comment(s5s) {
return out;
}
function parse_TST_TableModelArchive(M, root, ws, opts) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
var pb = parse_shallow(root.data);
var range = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
range.e.r = (varint_to_i32(pb[6][0].data) >>> 0) - 1;
@ -25361,6 +25378,38 @@ function parse_TST_TableModelArchive(M, root, ws, opts) {
};
});
}
if (!((_k = ws["!merges"]) == null ? void 0 : _k.length) && ((_l = pb[47]) == null ? void 0 : _l[0])) {
var merge_owner = parse_shallow(pb[47][0].data);
if ((_m = merge_owner[2]) == null ? void 0 : _m[0]) {
var formula_store = parse_shallow(merge_owner[2][0].data);
if ((_n = formula_store[3]) == null ? void 0 : _n[0]) {
ws["!merges"] = mappa(formula_store[3], function(u) {
var _a2, _b2, _c2, _d2, _e2;
var formula_pair = parse_shallow(u);
var formula = parse_shallow(formula_pair[2][0].data);
var AST_node_array = parse_shallow(formula[1][0].data);
if (!((_a2 = AST_node_array[1]) == null ? void 0 : _a2[0]))
return;
var AST_node0 = parse_shallow(AST_node_array[1][0].data);
var AST_node_type = varint_to_i32(AST_node0[1][0].data);
if (AST_node_type != 67)
return;
var AST_colon_tract = parse_shallow(AST_node0[40][0].data);
if (!((_b2 = AST_colon_tract[3]) == null ? void 0 : _b2[0]) || !((_c2 = AST_colon_tract[4]) == null ? void 0 : _c2[0]))
return;
var colrange = parse_shallow(AST_colon_tract[3][0].data);
var rowrange = parse_shallow(AST_colon_tract[4][0].data);
var c = varint_to_i32(colrange[1][0].data);
var C = ((_d2 = colrange[2]) == null ? void 0 : _d2[0]) ? varint_to_i32(colrange[2][0].data) : c;
var r = varint_to_i32(rowrange[1][0].data);
var R = ((_e2 = rowrange[2]) == null ? void 0 : _e2[0]) ? varint_to_i32(rowrange[2][0].data) : r;
return { s: { r: r, c: c }, e: { r: R, c: C } };
}).filter(function(x) {
return x != null;
});
}
}
}
}
function parse_TST_TableInfoArchive(M, root, opts) {
var pb = parse_shallow(root.data);