version bump 0.15.4: number formats

- AOA utilities properly preserve number formats
- empty cell number formats (fixes #1711 h/t @aimergenge)
This commit is contained in:
SheetJS 2019-12-22 22:19:56 -05:00
parent 7ef3f3e531
commit 6551dd0e05
19 changed files with 93 additions and 74 deletions

@ -1 +1 @@
XLSX.version = '0.15.3';
XLSX.version = '0.15.4';

@ -126,9 +126,11 @@ function sheet_add_aoa(_ws/*:?Worksheet*/, data/*:AOA*/, opts/*:?any*/)/*:Worksh
}
if(dense) {
if(!ws[__R]) ws[__R] = [];
if(ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z;
ws[__R][__C] = cell;
} else {
var cell_ref = encode_cell(({c:__C,r:__R}/*:any*/));
if(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;
ws[cell_ref] = cell;
}
}

@ -85,11 +85,11 @@ function get_cell_style(styles/*:Array<any>*/, cell/*:Cell*/, opts) {
}
function safe_format(p/*:Cell*/, fmtid/*:number*/, fillid/*:?number*/, opts, themes, styles) {
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
try {
if(opts.cellNF) p.z = SSF._table[fmtid];
} catch(e) { if(opts.WTF) throw e; }
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
if(!opts || opts.cellText !== false) try {
if(SSF._table[fmtid] == null) SSF.load(SSFImplicit[fmtid] || "General", fmtid);
if(p.t === 'e') p.w = p.w || BErr[p.v];

@ -863,6 +863,7 @@ var XLSRecordEnum = {
/*::[*/0x001d/*::]*/: { n:"Selection" },
/*::[*/0x0022/*::]*/: { n:"Date1904", f:parsebool },
/*::[*/0x0023/*::]*/: { n:"ExternName", f:parse_ExternName },
/*::[*/0x0024/*::]*/: { n:"COLWIDTH" },
/*::[*/0x0026/*::]*/: { n:"LeftMargin", f:parse_Xnum },
/*::[*/0x0027/*::]*/: { n:"RightMargin", f:parse_Xnum },
/*::[*/0x0028/*::]*/: { n:"TopMargin", f:parse_Xnum },

30
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

9
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.15.3';
XLSX.version = '0.15.4';
var current_codepage = 1200, current_ansi = 1252;
/*global cptable:true, window */
if(typeof module !== "undefined" && typeof require !== 'undefined') {
@ -12819,9 +12819,11 @@ function sheet_add_aoa(_ws, data, opts) {
}
if(dense) {
if(!ws[__R]) ws[__R] = [];
if(ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z;
ws[__R][__C] = cell;
} else {
var cell_ref = encode_cell(({c:__C,r:__R}));
if(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;
ws[cell_ref] = cell;
}
}
@ -22097,11 +22099,11 @@ function get_cell_style(styles, cell, opts) {
}
function safe_format(p, fmtid, fillid, opts, themes, styles) {
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
try {
if(opts.cellNF) p.z = SSF._table[fmtid];
} catch(e) { if(opts.WTF) throw e; }
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
if(!opts || opts.cellText !== false) try {
if(SSF._table[fmtid] == null) SSF.load(SSFImplicit[fmtid] || "General", fmtid);
if(p.t === 'e') p.w = p.w || BErr[p.v];
@ -27584,6 +27586,7 @@ var XLSRecordEnum = {
0x001d: { n:"Selection" },
0x0022: { n:"Date1904", f:parsebool },
0x0023: { n:"ExternName", f:parse_ExternName },
0x0024: { n:"COLWIDTH" },
0x0026: { n:"LeftMargin", f:parse_Xnum },
0x0027: { n:"RightMargin", f:parse_Xnum },
0x0028: { n:"TopMargin", f:parse_Xnum },

32
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

9
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.15.3';
XLSX.version = '0.15.4';
var current_codepage = 1200, current_ansi = 1252;
/*global cptable:true, window */
if(typeof module !== "undefined" && typeof require !== 'undefined') {
@ -3663,9 +3663,11 @@ function sheet_add_aoa(_ws, data, opts) {
}
if(dense) {
if(!ws[__R]) ws[__R] = [];
if(ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z;
ws[__R][__C] = cell;
} else {
var cell_ref = encode_cell(({c:__C,r:__R}));
if(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;
ws[cell_ref] = cell;
}
}
@ -12941,11 +12943,11 @@ function get_cell_style(styles, cell, opts) {
}
function safe_format(p, fmtid, fillid, opts, themes, styles) {
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
try {
if(opts.cellNF) p.z = SSF._table[fmtid];
} catch(e) { if(opts.WTF) throw e; }
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
if(!opts || opts.cellText !== false) try {
if(SSF._table[fmtid] == null) SSF.load(SSFImplicit[fmtid] || "General", fmtid);
if(p.t === 'e') p.w = p.w || BErr[p.v];
@ -18428,6 +18430,7 @@ var XLSRecordEnum = {
0x001d: { n:"Selection" },
0x0022: { n:"Date1904", f:parsebool },
0x0023: { n:"ExternName", f:parse_ExternName },
0x0024: { n:"COLWIDTH" },
0x0026: { n:"LeftMargin", f:parse_Xnum },
0x0027: { n:"RightMargin", f:parse_Xnum },
0x0028: { n:"TopMargin", f:parse_Xnum },

24
dist/xlsx.min.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/xlsx.min.map generated vendored

File diff suppressed because one or more lines are too long

10
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

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

@ -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.15.3';
XLSX.version = '0.15.4';
var current_codepage = 1200, current_ansi = 1252;
/*:: declare var cptable:any; */
/*global cptable:true, window */
@ -3756,9 +3756,11 @@ function sheet_add_aoa(_ws/*:?Worksheet*/, data/*:AOA*/, opts/*:?any*/)/*:Worksh
}
if(dense) {
if(!ws[__R]) ws[__R] = [];
if(ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z;
ws[__R][__C] = cell;
} else {
var cell_ref = encode_cell(({c:__C,r:__R}/*:any*/));
if(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;
ws[cell_ref] = cell;
}
}
@ -13043,11 +13045,11 @@ function get_cell_style(styles/*:Array<any>*/, cell/*:Cell*/, opts) {
}
function safe_format(p/*:Cell*/, fmtid/*:number*/, fillid/*:?number*/, opts, themes, styles) {
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
try {
if(opts.cellNF) p.z = SSF._table[fmtid];
} catch(e) { if(opts.WTF) throw e; }
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
if(!opts || opts.cellText !== false) try {
if(SSF._table[fmtid] == null) SSF.load(SSFImplicit[fmtid] || "General", fmtid);
if(p.t === 'e') p.w = p.w || BErr[p.v];
@ -18545,6 +18547,7 @@ var XLSRecordEnum = {
/*::[*/0x001d/*::]*/: { n:"Selection" },
/*::[*/0x0022/*::]*/: { n:"Date1904", f:parsebool },
/*::[*/0x0023/*::]*/: { n:"ExternName", f:parse_ExternName },
/*::[*/0x0024/*::]*/: { n:"COLWIDTH" },
/*::[*/0x0026/*::]*/: { n:"LeftMargin", f:parse_Xnum },
/*::[*/0x0027/*::]*/: { n:"RightMargin", f:parse_Xnum },
/*::[*/0x0028/*::]*/: { n:"TopMargin", f:parse_Xnum },

9
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.15.3';
XLSX.version = '0.15.4';
var current_codepage = 1200, current_ansi = 1252;
/*global cptable:true, window */
if(typeof module !== "undefined" && typeof require !== 'undefined') {
@ -3663,9 +3663,11 @@ function sheet_add_aoa(_ws, data, opts) {
}
if(dense) {
if(!ws[__R]) ws[__R] = [];
if(ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z;
ws[__R][__C] = cell;
} else {
var cell_ref = encode_cell(({c:__C,r:__R}));
if(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;
ws[cell_ref] = cell;
}
}
@ -12941,11 +12943,11 @@ function get_cell_style(styles, cell, opts) {
}
function safe_format(p, fmtid, fillid, opts, themes, styles) {
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
try {
if(opts.cellNF) p.z = SSF._table[fmtid];
} catch(e) { if(opts.WTF) throw e; }
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
if(!opts || opts.cellText !== false) try {
if(SSF._table[fmtid] == null) SSF.load(SSFImplicit[fmtid] || "General", fmtid);
if(p.t === 'e') p.w = p.w || BErr[p.v];
@ -18428,6 +18430,7 @@ var XLSRecordEnum = {
0x001d: { n:"Selection" },
0x0022: { n:"Date1904", f:parsebool },
0x0023: { n:"ExternName", f:parse_ExternName },
0x0024: { n:"COLWIDTH" },
0x0026: { n:"LeftMargin", f:parse_Xnum },
0x0027: { n:"RightMargin", f:parse_Xnum },
0x0028: { n:"TopMargin", f:parse_Xnum },

@ -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.15.3';
XLSX.version = '0.15.4';
var current_codepage = 1200, current_ansi = 1252;
var VALID_ANSI = [ 874, 932, 936, 949, 950 ];
@ -3680,9 +3680,11 @@ function sheet_add_aoa(_ws/*:?Worksheet*/, data/*:AOA*/, opts/*:?any*/)/*:Worksh
}
if(dense) {
if(!ws[__R]) ws[__R] = [];
if(ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z;
ws[__R][__C] = cell;
} else {
var cell_ref = encode_cell(({c:__C,r:__R}/*:any*/));
if(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;
ws[cell_ref] = cell;
}
}
@ -6075,11 +6077,11 @@ function get_cell_style(styles/*:Array<any>*/, cell/*:Cell*/, opts) {
}
function safe_format(p/*:Cell*/, fmtid/*:number*/, fillid/*:?number*/, opts, themes, styles) {
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
try {
if(opts.cellNF) p.z = SSF._table[fmtid];
} catch(e) { if(opts.WTF) throw e; }
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
if(!opts || opts.cellText !== false) try {
if(SSF._table[fmtid] == null) SSF.load(SSFImplicit[fmtid] || "General", fmtid);
if(p.t === 'e') p.w = p.w || BErr[p.v];

@ -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.15.3';
XLSX.version = '0.15.4';
var current_codepage = 1200, current_ansi = 1252;
var VALID_ANSI = [ 874, 932, 936, 949, 950 ];
@ -3590,9 +3590,11 @@ function sheet_add_aoa(_ws, data, opts) {
}
if(dense) {
if(!ws[__R]) ws[__R] = [];
if(ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z;
ws[__R][__C] = cell;
} else {
var cell_ref = encode_cell(({c:__C,r:__R}));
if(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;
ws[cell_ref] = cell;
}
}
@ -5985,11 +5987,11 @@ function get_cell_style(styles, cell, opts) {
}
function safe_format(p, fmtid, fillid, opts, themes, styles) {
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
try {
if(opts.cellNF) p.z = SSF._table[fmtid];
} catch(e) { if(opts.WTF) throw e; }
if(p.t === 'z') return;
if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
if(!opts || opts.cellText !== false) try {
if(SSF._table[fmtid] == null) SSF.load(SSFImplicit[fmtid] || "General", fmtid);
if(p.t === 'e') p.w = p.w || BErr[p.v];