forked from sheetjs/sheetjs
version bump 0.14.1: AutoFilter issues
- `stream.to_json` fix (fixes #167 h/t @Alex0007) - AutoFilter `_FilterDatabase` Defined Name (fixes #1262 h/t @nitramL)
This commit is contained in:
parent
1b731a3ef4
commit
1eb1ec985a
@ -1 +1 @@
|
||||
XLSX.version = '0.14.0';
|
||||
XLSX.version = '0.14.1';
|
||||
|
@ -191,8 +191,21 @@ function parse_ws_xml_autofilter(data/*:string*/) {
|
||||
var o = { ref: (data.match(/ref="([^"]*)"/)||[])[1]};
|
||||
return o;
|
||||
}
|
||||
function write_ws_xml_autofilter(data)/*:string*/ {
|
||||
return writextag("autoFilter", null, {ref:data.ref});
|
||||
function write_ws_xml_autofilter(data, ws, wb, idx)/*:string*/ {
|
||||
var ref = typeof data.ref == "string" ? data.ref : encode_range(data.ref);
|
||||
if(!wb.Workbook) wb.Workbook = {};
|
||||
if(!wb.Workbook.Names) wb.Workbook.Names = [];
|
||||
var names/*: Array<any> */ = wb.Workbook.Names;
|
||||
var range = decode_range(ref);
|
||||
if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); }
|
||||
for(var i = 0; i < names.length; ++i) {
|
||||
var name = names[i];
|
||||
if(name.Name != '_xlnm._FilterDatabase') continue;
|
||||
if(name.Sheet != idx) continue;
|
||||
name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break;
|
||||
}
|
||||
if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
|
||||
return writextag("autoFilter", null, {ref:ref});
|
||||
}
|
||||
|
||||
/* 18.3.1.88 sheetViews CT_SheetViews */
|
||||
@ -515,7 +528,7 @@ function write_ws_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ {
|
||||
/* protectedRanges */
|
||||
/* scenarios */
|
||||
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter']);
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter'], ws, wb, idx);
|
||||
|
||||
/* sortState */
|
||||
/* dataConsolidate */
|
||||
|
@ -135,14 +135,11 @@ function parse_workbook(blob, options/*:ParseOpts*/)/*:Workbook*/ {
|
||||
delete line.ixfe; delete line.XF;
|
||||
lastcell = cell;
|
||||
last_cell = encode_cell(cell);
|
||||
if(range.s) {
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
}
|
||||
if(range.e) {
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
}
|
||||
if(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}};
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
if(options.cellFormula && line.f) {
|
||||
for(var afi = 0; afi < arrayf.length; ++afi) {
|
||||
if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue;
|
||||
|
@ -101,9 +101,9 @@ if(has_buf && typeof require != 'undefined') (function() {
|
||||
stream._read = function() {
|
||||
if(R > r.e.r) return stream.push(null);
|
||||
while(R <= r.e.r) {
|
||||
++R;
|
||||
//if ((rowinfo[R-1]||{}).hidden) continue;
|
||||
var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o);
|
||||
++R;
|
||||
if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) {
|
||||
stream.push(row.row);
|
||||
break;
|
||||
|
22
dist/xlsx.core.min.js
generated
vendored
22
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
2
dist/xlsx.core.min.map
generated
vendored
File diff suppressed because one or more lines are too long
57
dist/xlsx.extendscript.js
generated
vendored
57
dist/xlsx.extendscript.js
generated
vendored
@ -9160,7 +9160,7 @@ module.exports = ZStream;
|
||||
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
|
||||
var XLSX = {};
|
||||
function make_xlsx_lib(XLSX){
|
||||
XLSX.version = '0.14.0';
|
||||
XLSX.version = '0.14.1';
|
||||
var current_codepage = 1200, current_ansi = 1252;
|
||||
/*global cptable:true, window */
|
||||
if(typeof module !== "undefined" && typeof require !== 'undefined') {
|
||||
@ -12748,21 +12748,24 @@ function sheet_add_aoa(_ws, data, opts) {
|
||||
for(var C = 0; C != data[R].length; ++C) {
|
||||
if(typeof data[R][C] === 'undefined') continue;
|
||||
var cell = ({v: data[R][C] });
|
||||
if(Array.isArray(cell.v)) { cell.f = data[R][C][1]; cell.v = cell.v[0]; }
|
||||
var __R = _R + R, __C = _C + C;
|
||||
if(range.s.r > __R) range.s.r = __R;
|
||||
if(range.s.c > __C) range.s.c = __C;
|
||||
if(range.e.r < __R) range.e.r = __R;
|
||||
if(range.e.c < __C) range.e.c = __C;
|
||||
if(cell.v === null) { if(cell.f) cell.t = 'n'; else if(!o.cellStubs) continue; else cell.t = 'z'; }
|
||||
else if(typeof cell.v === 'number') cell.t = 'n';
|
||||
else if(typeof cell.v === 'boolean') cell.t = 'b';
|
||||
else if(cell.v instanceof Date) {
|
||||
cell.z = o.dateNF || SSF._table[14];
|
||||
if(o.cellDates) { cell.t = 'd'; cell.w = SSF.format(cell.z, datenum(cell.v)); }
|
||||
else { cell.t = 'n'; cell.v = datenum(cell.v); cell.w = SSF.format(cell.z, cell.v); }
|
||||
if(data[R][C] && typeof data[R][C] === 'object' && !Array.isArray(data[R][C]) && !(data[R][C] instanceof Date)) cell = data[R][C];
|
||||
else {
|
||||
if(Array.isArray(cell.v)) { cell.f = data[R][C][1]; cell.v = cell.v[0]; }
|
||||
if(cell.v === null) { if(cell.f) cell.t = 'n'; else if(!o.cellStubs) continue; else cell.t = 'z'; }
|
||||
else if(typeof cell.v === 'number') cell.t = 'n';
|
||||
else if(typeof cell.v === 'boolean') cell.t = 'b';
|
||||
else if(cell.v instanceof Date) {
|
||||
cell.z = o.dateNF || SSF._table[14];
|
||||
if(o.cellDates) { cell.t = 'd'; cell.w = SSF.format(cell.z, datenum(cell.v)); }
|
||||
else { cell.t = 'n'; cell.v = datenum(cell.v); cell.w = SSF.format(cell.z, cell.v); }
|
||||
}
|
||||
else cell.t = 's';
|
||||
}
|
||||
else cell.t = 's';
|
||||
if(dense) {
|
||||
if(!ws[__R]) ws[__R] = [];
|
||||
ws[__R][__C] = cell;
|
||||
@ -22128,8 +22131,21 @@ function parse_ws_xml_autofilter(data) {
|
||||
var o = { ref: (data.match(/ref="([^"]*)"/)||[])[1]};
|
||||
return o;
|
||||
}
|
||||
function write_ws_xml_autofilter(data) {
|
||||
return writextag("autoFilter", null, {ref:data.ref});
|
||||
function write_ws_xml_autofilter(data, ws, wb, idx) {
|
||||
var ref = typeof data.ref == "string" ? data.ref : encode_range(data.ref);
|
||||
if(!wb.Workbook) wb.Workbook = {};
|
||||
if(!wb.Workbook.Names) wb.Workbook.Names = [];
|
||||
var names = wb.Workbook.Names;
|
||||
var range = decode_range(ref);
|
||||
if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); }
|
||||
for(var i = 0; i < names.length; ++i) {
|
||||
var name = names[i];
|
||||
if(name.Name != '_xlnm._FilterDatabase') continue;
|
||||
if(name.Sheet != idx) continue;
|
||||
name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break;
|
||||
}
|
||||
if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
|
||||
return writextag("autoFilter", null, {ref:ref});
|
||||
}
|
||||
|
||||
/* 18.3.1.88 sheetViews CT_SheetViews */
|
||||
@ -22452,7 +22468,7 @@ function write_ws_xml(idx, opts, wb, rels) {
|
||||
/* protectedRanges */
|
||||
/* scenarios */
|
||||
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter']);
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter'], ws, wb, idx);
|
||||
|
||||
/* sortState */
|
||||
/* dataConsolidate */
|
||||
@ -25560,14 +25576,11 @@ function parse_workbook(blob, options) {
|
||||
delete line.ixfe; delete line.XF;
|
||||
lastcell = cell;
|
||||
last_cell = encode_cell(cell);
|
||||
if(range.s) {
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
}
|
||||
if(range.e) {
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
}
|
||||
if(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}};
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
if(options.cellFormula && line.f) {
|
||||
for(var afi = 0; afi < arrayf.length; ++afi) {
|
||||
if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue;
|
||||
@ -30087,9 +30100,9 @@ if(has_buf && typeof require != 'undefined') (function() {
|
||||
stream._read = function() {
|
||||
if(R > r.e.r) return stream.push(null);
|
||||
while(R <= r.e.r) {
|
||||
++R;
|
||||
//if ((rowinfo[R-1]||{}).hidden) continue;
|
||||
var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o);
|
||||
++R;
|
||||
if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) {
|
||||
stream.push(row.row);
|
||||
break;
|
||||
|
24
dist/xlsx.full.min.js
generated
vendored
24
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
2
dist/xlsx.full.min.map
generated
vendored
File diff suppressed because one or more lines are too long
57
dist/xlsx.js
generated
vendored
57
dist/xlsx.js
generated
vendored
@ -4,7 +4,7 @@
|
||||
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
|
||||
var XLSX = {};
|
||||
function make_xlsx_lib(XLSX){
|
||||
XLSX.version = '0.14.0';
|
||||
XLSX.version = '0.14.1';
|
||||
var current_codepage = 1200, current_ansi = 1252;
|
||||
/*global cptable:true, window */
|
||||
if(typeof module !== "undefined" && typeof require !== 'undefined') {
|
||||
@ -3592,21 +3592,24 @@ function sheet_add_aoa(_ws, data, opts) {
|
||||
for(var C = 0; C != data[R].length; ++C) {
|
||||
if(typeof data[R][C] === 'undefined') continue;
|
||||
var cell = ({v: data[R][C] });
|
||||
if(Array.isArray(cell.v)) { cell.f = data[R][C][1]; cell.v = cell.v[0]; }
|
||||
var __R = _R + R, __C = _C + C;
|
||||
if(range.s.r > __R) range.s.r = __R;
|
||||
if(range.s.c > __C) range.s.c = __C;
|
||||
if(range.e.r < __R) range.e.r = __R;
|
||||
if(range.e.c < __C) range.e.c = __C;
|
||||
if(cell.v === null) { if(cell.f) cell.t = 'n'; else if(!o.cellStubs) continue; else cell.t = 'z'; }
|
||||
else if(typeof cell.v === 'number') cell.t = 'n';
|
||||
else if(typeof cell.v === 'boolean') cell.t = 'b';
|
||||
else if(cell.v instanceof Date) {
|
||||
cell.z = o.dateNF || SSF._table[14];
|
||||
if(o.cellDates) { cell.t = 'd'; cell.w = SSF.format(cell.z, datenum(cell.v)); }
|
||||
else { cell.t = 'n'; cell.v = datenum(cell.v); cell.w = SSF.format(cell.z, cell.v); }
|
||||
if(data[R][C] && typeof data[R][C] === 'object' && !Array.isArray(data[R][C]) && !(data[R][C] instanceof Date)) cell = data[R][C];
|
||||
else {
|
||||
if(Array.isArray(cell.v)) { cell.f = data[R][C][1]; cell.v = cell.v[0]; }
|
||||
if(cell.v === null) { if(cell.f) cell.t = 'n'; else if(!o.cellStubs) continue; else cell.t = 'z'; }
|
||||
else if(typeof cell.v === 'number') cell.t = 'n';
|
||||
else if(typeof cell.v === 'boolean') cell.t = 'b';
|
||||
else if(cell.v instanceof Date) {
|
||||
cell.z = o.dateNF || SSF._table[14];
|
||||
if(o.cellDates) { cell.t = 'd'; cell.w = SSF.format(cell.z, datenum(cell.v)); }
|
||||
else { cell.t = 'n'; cell.v = datenum(cell.v); cell.w = SSF.format(cell.z, cell.v); }
|
||||
}
|
||||
else cell.t = 's';
|
||||
}
|
||||
else cell.t = 's';
|
||||
if(dense) {
|
||||
if(!ws[__R]) ws[__R] = [];
|
||||
ws[__R][__C] = cell;
|
||||
@ -12972,8 +12975,21 @@ function parse_ws_xml_autofilter(data) {
|
||||
var o = { ref: (data.match(/ref="([^"]*)"/)||[])[1]};
|
||||
return o;
|
||||
}
|
||||
function write_ws_xml_autofilter(data) {
|
||||
return writextag("autoFilter", null, {ref:data.ref});
|
||||
function write_ws_xml_autofilter(data, ws, wb, idx) {
|
||||
var ref = typeof data.ref == "string" ? data.ref : encode_range(data.ref);
|
||||
if(!wb.Workbook) wb.Workbook = {};
|
||||
if(!wb.Workbook.Names) wb.Workbook.Names = [];
|
||||
var names = wb.Workbook.Names;
|
||||
var range = decode_range(ref);
|
||||
if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); }
|
||||
for(var i = 0; i < names.length; ++i) {
|
||||
var name = names[i];
|
||||
if(name.Name != '_xlnm._FilterDatabase') continue;
|
||||
if(name.Sheet != idx) continue;
|
||||
name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break;
|
||||
}
|
||||
if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
|
||||
return writextag("autoFilter", null, {ref:ref});
|
||||
}
|
||||
|
||||
/* 18.3.1.88 sheetViews CT_SheetViews */
|
||||
@ -13296,7 +13312,7 @@ function write_ws_xml(idx, opts, wb, rels) {
|
||||
/* protectedRanges */
|
||||
/* scenarios */
|
||||
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter']);
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter'], ws, wb, idx);
|
||||
|
||||
/* sortState */
|
||||
/* dataConsolidate */
|
||||
@ -16404,14 +16420,11 @@ function parse_workbook(blob, options) {
|
||||
delete line.ixfe; delete line.XF;
|
||||
lastcell = cell;
|
||||
last_cell = encode_cell(cell);
|
||||
if(range.s) {
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
}
|
||||
if(range.e) {
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
}
|
||||
if(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}};
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
if(options.cellFormula && line.f) {
|
||||
for(var afi = 0; afi < arrayf.length; ++afi) {
|
||||
if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue;
|
||||
@ -20931,9 +20944,9 @@ if(has_buf && typeof require != 'undefined') (function() {
|
||||
stream._read = function() {
|
||||
if(R > r.e.r) return stream.push(null);
|
||||
while(R <= r.e.r) {
|
||||
++R;
|
||||
//if ((rowinfo[R-1]||{}).hidden) continue;
|
||||
var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o);
|
||||
++R;
|
||||
if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) {
|
||||
stream.push(row.row);
|
||||
break;
|
||||
|
26
dist/xlsx.min.js
generated
vendored
26
dist/xlsx.min.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/xlsx.min.map
generated
vendored
2
dist/xlsx.min.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xlsx",
|
||||
"version": "0.14.0",
|
||||
"version": "0.14.1",
|
||||
"author": "sheetjs",
|
||||
"description": "SheetJS Spreadsheet data parser and writer",
|
||||
"keywords": [
|
||||
|
36
xlsx.flow.js
36
xlsx.flow.js
@ -4,7 +4,7 @@
|
||||
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
|
||||
var XLSX = {};
|
||||
function make_xlsx_lib(XLSX){
|
||||
XLSX.version = '0.14.0';
|
||||
XLSX.version = '0.14.1';
|
||||
var current_codepage = 1200, current_ansi = 1252;
|
||||
/*:: declare var cptable:any; */
|
||||
/*global cptable:true, window */
|
||||
@ -13076,8 +13076,21 @@ function parse_ws_xml_autofilter(data/*:string*/) {
|
||||
var o = { ref: (data.match(/ref="([^"]*)"/)||[])[1]};
|
||||
return o;
|
||||
}
|
||||
function write_ws_xml_autofilter(data)/*:string*/ {
|
||||
return writextag("autoFilter", null, {ref:data.ref});
|
||||
function write_ws_xml_autofilter(data, ws, wb, idx)/*:string*/ {
|
||||
var ref = typeof data.ref == "string" ? data.ref : encode_range(data.ref);
|
||||
if(!wb.Workbook) wb.Workbook = {};
|
||||
if(!wb.Workbook.Names) wb.Workbook.Names = [];
|
||||
var names/*: Array<any> */ = wb.Workbook.Names;
|
||||
var range = decode_range(ref);
|
||||
if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); }
|
||||
for(var i = 0; i < names.length; ++i) {
|
||||
var name = names[i];
|
||||
if(name.Name != '_xlnm._FilterDatabase') continue;
|
||||
if(name.Sheet != idx) continue;
|
||||
name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break;
|
||||
}
|
||||
if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
|
||||
return writextag("autoFilter", null, {ref:ref});
|
||||
}
|
||||
|
||||
/* 18.3.1.88 sheetViews CT_SheetViews */
|
||||
@ -13400,7 +13413,7 @@ function write_ws_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ {
|
||||
/* protectedRanges */
|
||||
/* scenarios */
|
||||
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter']);
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter'], ws, wb, idx);
|
||||
|
||||
/* sortState */
|
||||
/* dataConsolidate */
|
||||
@ -16520,14 +16533,11 @@ function parse_workbook(blob, options/*:ParseOpts*/)/*:Workbook*/ {
|
||||
delete line.ixfe; delete line.XF;
|
||||
lastcell = cell;
|
||||
last_cell = encode_cell(cell);
|
||||
if(range.s) {
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
}
|
||||
if(range.e) {
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
}
|
||||
if(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}};
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
if(options.cellFormula && line.f) {
|
||||
for(var afi = 0; afi < arrayf.length; ++afi) {
|
||||
if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue;
|
||||
@ -21063,9 +21073,9 @@ if(has_buf && typeof require != 'undefined') (function() {
|
||||
stream._read = function() {
|
||||
if(R > r.e.r) return stream.push(null);
|
||||
while(R <= r.e.r) {
|
||||
++R;
|
||||
//if ((rowinfo[R-1]||{}).hidden) continue;
|
||||
var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o);
|
||||
++R;
|
||||
if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) {
|
||||
stream.push(row.row);
|
||||
break;
|
||||
|
36
xlsx.js
generated
36
xlsx.js
generated
@ -4,7 +4,7 @@
|
||||
/*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
|
||||
var XLSX = {};
|
||||
function make_xlsx_lib(XLSX){
|
||||
XLSX.version = '0.14.0';
|
||||
XLSX.version = '0.14.1';
|
||||
var current_codepage = 1200, current_ansi = 1252;
|
||||
/*global cptable:true, window */
|
||||
if(typeof module !== "undefined" && typeof require !== 'undefined') {
|
||||
@ -12975,8 +12975,21 @@ function parse_ws_xml_autofilter(data) {
|
||||
var o = { ref: (data.match(/ref="([^"]*)"/)||[])[1]};
|
||||
return o;
|
||||
}
|
||||
function write_ws_xml_autofilter(data) {
|
||||
return writextag("autoFilter", null, {ref:data.ref});
|
||||
function write_ws_xml_autofilter(data, ws, wb, idx) {
|
||||
var ref = typeof data.ref == "string" ? data.ref : encode_range(data.ref);
|
||||
if(!wb.Workbook) wb.Workbook = {};
|
||||
if(!wb.Workbook.Names) wb.Workbook.Names = [];
|
||||
var names = wb.Workbook.Names;
|
||||
var range = decode_range(ref);
|
||||
if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); }
|
||||
for(var i = 0; i < names.length; ++i) {
|
||||
var name = names[i];
|
||||
if(name.Name != '_xlnm._FilterDatabase') continue;
|
||||
if(name.Sheet != idx) continue;
|
||||
name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break;
|
||||
}
|
||||
if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
|
||||
return writextag("autoFilter", null, {ref:ref});
|
||||
}
|
||||
|
||||
/* 18.3.1.88 sheetViews CT_SheetViews */
|
||||
@ -13299,7 +13312,7 @@ function write_ws_xml(idx, opts, wb, rels) {
|
||||
/* protectedRanges */
|
||||
/* scenarios */
|
||||
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter']);
|
||||
if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter'], ws, wb, idx);
|
||||
|
||||
/* sortState */
|
||||
/* dataConsolidate */
|
||||
@ -16407,14 +16420,11 @@ function parse_workbook(blob, options) {
|
||||
delete line.ixfe; delete line.XF;
|
||||
lastcell = cell;
|
||||
last_cell = encode_cell(cell);
|
||||
if(range.s) {
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
}
|
||||
if(range.e) {
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
}
|
||||
if(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}};
|
||||
if(cell.r < range.s.r) range.s.r = cell.r;
|
||||
if(cell.c < range.s.c) range.s.c = cell.c;
|
||||
if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
|
||||
if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
|
||||
if(options.cellFormula && line.f) {
|
||||
for(var afi = 0; afi < arrayf.length; ++afi) {
|
||||
if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue;
|
||||
@ -20934,9 +20944,9 @@ if(has_buf && typeof require != 'undefined') (function() {
|
||||
stream._read = function() {
|
||||
if(R > r.e.r) return stream.push(null);
|
||||
while(R <= r.e.r) {
|
||||
++R;
|
||||
//if ((rowinfo[R-1]||{}).hidden) continue;
|
||||
var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o);
|
||||
++R;
|
||||
if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) {
|
||||
stream.push(row.row);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user