Skip to content

Commit

Permalink
version bump 0.16.9: utf-8 codenames
Browse files Browse the repository at this point in the history
  • Loading branch information
SheetJSDev committed Nov 20, 2020
1 parent f7835d6 commit 20212e1
Show file tree
Hide file tree
Showing 21 changed files with 139 additions and 72 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1093,9 +1093,13 @@ In addition to the base sheet keys, worksheets also add:
will write all cells in the merge range if they exist, so be sure that only
the first cell (upper-left) in the range is set.

- `ws['!outline']`: configure how outlines should behave.
Example: `{above: true}` - equivalent of unchecking the Excel option "Summary rows below detail".
`{left: true}` - equivalent of unchecking the Excel option "Summary option to the right of detail."
- `ws['!outline']`: configure how outlines should behave. Options default to
the default settings in Excel 2019:

| key | Excel feature | default |
|:----------|:----------------------------------------------|:--------|
| `above` | Uncheck "Summary rows below detail" | `false` |
| `left` | Uncheck "Summary rows to the right of detail" | `false` |

- `ws['!protect']`: object of write sheet protection properties. The `password`
key specifies the password for formats that support password-protected sheets
Expand Down
2 changes: 1 addition & 1 deletion bits/01_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
XLSX.version = '0.16.8';
XLSX.version = '0.16.9';
4 changes: 2 additions & 2 deletions bits/67_wsxml.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function write_ws_xml_merges(merges/*:Array<Range>*/)/*:string*/ {
function parse_ws_xml_sheetpr(sheetPr/*:string*/, s, wb/*:WBWBProps*/, idx/*:number*/) {
var data = parsexmltag(sheetPr);
if(!wb.Sheets[idx]) wb.Sheets[idx] = {};
if(data.codeName) wb.Sheets[idx].CodeName = data.codeName;
if(data.codeName) wb.Sheets[idx].CodeName = unescapexml(utf8read(data.codeName));
}
function write_ws_xml_sheetpr(ws, wb, idx, opts, o) {
var needed = false;
Expand All @@ -111,7 +111,7 @@ function write_ws_xml_sheetpr(ws, wb, idx, opts, o) {
var cname = wb.SheetNames[idx];
try { if(wb.Workbook) cname = wb.Workbook.Sheets[idx].CodeName || cname; } catch(e) {}
needed = true;
props.codeName = escapexml(cname);
props.codeName = utf8write(escapexml(cname));
}

if(ws && ws["!outline"]) {
Expand Down
2 changes: 1 addition & 1 deletion bits/80_parseods.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ var parse_content_xml = (function() {
case 'line-break': break; // 6.1.5 <text:line-break>
case 'span': break; // 6.1.7 <text:span>
case 'p': case '文本串': // 5.1.3 <text:p>
if(['master-styles'].indexOf(state[satte.length-1][0]) > -1) break;
if(['master-styles'].indexOf(state[state.length-1][0]) > -1) break;
if(Rn[1]==='/' && (!ctag || !ctag['string-value'])) {
var ptp = parse_text_p(str.slice(textpidx,Rn.index), textptag);
textp = (textp.length > 0 ? textp + "\n" : "") + ptp[0];
Expand Down
14 changes: 7 additions & 7 deletions dist/xlsx.core.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xlsx.core.min.map

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions dist/xlsx.extendscript.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions dist/xlsx.full.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xlsx.full.min.map

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions dist/xlsx.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions dist/xlsx.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xlsx.min.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/xlsx.mini.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xlsx.mini.min.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions docbits/54_shobject.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ In addition to the base sheet keys, worksheets also add:
will write all cells in the merge range if they exist, so be sure that only
the first cell (upper-left) in the range is set.

- `ws['!outline']`: configure how outlines should behave. Options default to
the default settings in Excel 2019:

| key | Excel feature | default |
|:----------|:----------------------------------------------|:--------|
| `above` | Uncheck "Summary rows below detail" | `false` |
| `left` | Uncheck "Summary rows to the right of detail" | `false` |

- `ws['!protect']`: object of write sheet protection properties. The `password`
key specifies the password for formats that support password-protected sheets
(XLSX/XLSB/XLS). The writer uses the XOR obfuscation method. The following
Expand Down
8 changes: 8 additions & 0 deletions misc/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,14 @@ In addition to the base sheet keys, worksheets also add:
will write all cells in the merge range if they exist, so be sure that only
the first cell (upper-left) in the range is set.

- `ws['!outline']`: configure how outlines should behave. Options default to
the default settings in Excel 2019:

| key | Excel feature | default |
|:----------|:----------------------------------------------|:--------|
| `above` | Uncheck "Summary rows below detail" | `false` |
| `left` | Uncheck "Summary rows to the right of detail" | `false` |

- `ws['!protect']`: object of write sheet protection properties. The `password`
key specifies the password for formats that support password-protected sheets
(XLSX/XLSB/XLS). The writer uses the XOR obfuscation method. The following
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xlsx",
"version": "0.16.8",
"version": "0.16.9",
"author": "sheetjs",
"description": "SheetJS Spreadsheet data parser and writer",
"keywords": [
Expand Down Expand Up @@ -38,6 +38,7 @@
"commander": "~2.17.1",
"crc-32": "~1.2.0",
"exit-on-epipe": "~1.0.1",
"fflate": "^0.3.8",
"ssf": "~0.11.2",
"word": "~0.3.0",
"wmf": "~1.0.1"
Expand Down
18 changes: 13 additions & 5 deletions xlsx.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.16.8';
XLSX.version = '0.16.9';
var current_codepage = 1200, current_ansi = 1252;
/*:: declare var cptable:any; */
/*global cptable:true, window */
Expand Down Expand Up @@ -13407,7 +13407,7 @@ function write_ws_xml_merges(merges/*:Array<Range>*/)/*:string*/ {
function parse_ws_xml_sheetpr(sheetPr/*:string*/, s, wb/*:WBWBProps*/, idx/*:number*/) {
var data = parsexmltag(sheetPr);
if(!wb.Sheets[idx]) wb.Sheets[idx] = {};
if(data.codeName) wb.Sheets[idx].CodeName = data.codeName;
if(data.codeName) wb.Sheets[idx].CodeName = unescapexml(utf8read(data.codeName));
}
function write_ws_xml_sheetpr(ws, wb, idx, opts, o) {
var needed = false;
Expand All @@ -13416,7 +13416,14 @@ function write_ws_xml_sheetpr(ws, wb, idx, opts, o) {
var cname = wb.SheetNames[idx];
try { if(wb.Workbook) cname = wb.Workbook.Sheets[idx].CodeName || cname; } catch(e) {}
needed = true;
props.codeName = escapexml(cname);
props.codeName = utf8write(escapexml(cname));
}

if(ws && ws["!outline"]) {
var outlineprops = {summaryBelow:1, summaryRight:1};
if(ws["!outline"].above) outlineprops.summaryBelow = 0;
if(ws["!outline"].left) outlineprops.summaryRight = 0;
payload = (payload||"") + writextag('outlinePr', null, outlineprops);
}

if(!needed && !payload) return;
Expand Down Expand Up @@ -13593,7 +13600,7 @@ function write_ws_xml_cell(cell/*:Cell*/, ref, ws, opts/*::, idx, wb*/)/*:string
}

var parse_ws_xml_data = (function() {
var cellregex = /<(?:\w+:)?c[ >]/, rowregex = /<\/(?:\w+:)?row>/;
var cellregex = /<(?:\w+:)?c[ \/>]/, rowregex = /<\/(?:\w+:)?row>/;
var rregex = /r=["']([^"']*)["']/, isregex = /<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/;
var refregex = /ref=["']([^"']*)["']/;
var match_v = matchtag("v"), match_f = matchtag("f");
Expand Down Expand Up @@ -20016,6 +20023,7 @@ var parse_content_xml = (function() {
case 'scripts': // 3.12 <office:scripts>
case 'styles': // TODO <office:styles>
case 'font-face-decls': // 3.14 <office:font-face-decls>
case 'master-styles': //3.15.4 <office:master-styles> -- relevant for FODS
if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;}
else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);
break;
Expand Down Expand Up @@ -20082,7 +20090,6 @@ var parse_content_xml = (function() {
case 'script': break; // 3.13 <office:script>
case 'libraries': break; // TODO: <ooo:libraries>
case 'automatic-styles': break; // 3.15.3 <office:automatic-styles>
case 'master-styles': break; // TODO: <office:master-styles>

case 'default-style': // TODO: <style:default-style>
case 'page-layout': break; // TODO: <style:page-layout>
Expand Down Expand Up @@ -20179,6 +20186,7 @@ var parse_content_xml = (function() {
case 'line-break': break; // 6.1.5 <text:line-break>
case 'span': break; // 6.1.7 <text:span>
case 'p': case '文本串': // 5.1.3 <text:p>
if(['master-styles'].indexOf(state[state.length-1][0]) > -1) break;
if(Rn[1]==='/' && (!ctag || !ctag['string-value'])) {
var ptp = parse_text_p(str.slice(textpidx,Rn.index), textptag);
textp = (textp.length > 0 ? textp + "\n" : "") + ptp[0];
Expand Down
18 changes: 13 additions & 5 deletions xlsx.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 20212e1

Please sign in to comment.