Skip to content

Commit 2aa4151

Browse files
committed
0.1.4 - TypeScript 2.0 compatibility and merged latest excel-builder.js changes.
1 parent 393f0ed commit 2aa4151

File tree

12 files changed

+63
-53
lines changed

12 files changed

+63
-53
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.
33
This project does its best to adhere to [Semantic Versioning](http://semver.org/).
44

55

6+
--------
7+
### [0.1.4](N/A) - 2016-12-31
8+
#### Changed
9+
* TypeScript 2.0 compatibility tweaks
10+
* Merged up to latest excel-builder.js commit from 2016-10-30 (https://github.com/stephenliberty/excel-builder.js/commit/162004ecb6b745f33924fff3f22692638a296306)
11+
12+
613
--------
714
### [0.1.3](N/A) - 2016-06-21
815
#### Changed

ExcelBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var ExcelBuilder = (function () {
6565
zip.file(path, content, { base64: true, binary: true });
6666
}
6767
});
68-
return zip.generate({
68+
return zip.generateAsync({
6969
base64: (!options || options.base64 !== false)
7070
});
7171
};

ExcelBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ExcelBuilder {
6969
zip.file(path, content, { base64: true, binary: true });
7070
}
7171
})
72-
return zip.generate({
72+
return zip.generateAsync({
7373
base64: (!options || options.base64 !== false)
7474
});
7575
}

StyleSheet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ var StyleSheet = (function () {
475475
var end = doc.createElement("stop");
476476
var endColor = doc.createElement("color");
477477
end.setAttribute("position", data.end.pureAt || 1);
478-
if (isStr(data.start) || data.end.color) {
478+
if (isStr(data.end) || data.end.color) {
479479
endColor.setAttribute("rgb", data.end.color || data.end);
480480
}
481481
else if (typeof data.end.theme) {

StyleSheet.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,19 +519,19 @@ class StyleSheet {
519519
fillDef.setAttribute("bottom", data.bottom);
520520
}
521521
var start = doc.createElement("stop");
522-
start.setAttribute("position", data.start.pureAt || 0);
522+
start.setAttribute("position", (<any>data.start).pureAt || 0);
523523
var startColor = doc.createElement("color");
524524
if (isStr(data.start) || data.start.color) {
525-
startColor.setAttribute("rgb", data.start.color || data.start);
525+
startColor.setAttribute("rgb", (<any>data.start).color || data.start);
526526
} else if (typeof data.start.theme) {
527527
startColor.setAttribute("theme", data.start.theme);
528528
}
529529

530530
var end = doc.createElement("stop");
531531
var endColor = doc.createElement("color");
532-
end.setAttribute("position", data.end.pureAt || 1);
533-
if (isStr(data.start) || data.end.color) {
534-
endColor.setAttribute("rgb", data.end.color || data.end);
532+
end.setAttribute("position", (<any>data.end).pureAt || 1);
533+
if (isStr(data.end) || data.end.color) {
534+
endColor.setAttribute("rgb", (<any>data.end).color || data.end);
535535
} else if (typeof data.end.theme) {
536536
endColor.setAttribute("theme", data.end.theme);
537537
}
@@ -740,8 +740,8 @@ module StyleSheet {
740740
right?;
741741
top?;
742742
bottom?;
743-
start?: string & { pureAt?: number; color?; theme?; };
744-
end?: string & { pureAt?: number; color?; theme?; };
743+
start?: string | { pureAt?: number; color?; theme?; };
744+
end?: string | { pureAt?: number; color?; theme?; };
745745
}
746746

747747
}

Util.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -110,28 +110,28 @@ var Util = (function () {
110110
Util.LETTER_REFS[x] = string;
111111
return string.concat(y);
112112
};
113-
Util._idSpaces = {};
114-
Util._id = 0;
115-
Util.LETTER_REFS = {};
116-
Util.schemas = {
117-
"worksheet": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
118-
"sharedStrings": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
119-
"stylesheet": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
120-
"relationships": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
121-
"relationshipPackage": "http://schemas.openxmlformats.org/package/2006/relationships",
122-
"contentTypes": "http://schemas.openxmlformats.org/package/2006/content-types",
123-
"spreadsheetml": "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
124-
"markupCompat": "http://schemas.openxmlformats.org/markup-compatibility/2006",
125-
"x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac",
126-
"officeDocument": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
127-
"package": "http://schemas.openxmlformats.org/package/2006/relationships",
128-
"table": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
129-
"spreadsheetDrawing": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
130-
"drawing": "http://schemas.openxmlformats.org/drawingml/2006/main",
131-
"drawingRelationship": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
132-
"image": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
133-
"chart": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"
134-
};
135113
return Util;
136114
}());
115+
Util._idSpaces = {};
116+
Util._id = 0;
117+
Util.LETTER_REFS = {};
118+
Util.schemas = {
119+
"worksheet": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
120+
"sharedStrings": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
121+
"stylesheet": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
122+
"relationships": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
123+
"relationshipPackage": "http://schemas.openxmlformats.org/package/2006/relationships",
124+
"contentTypes": "http://schemas.openxmlformats.org/package/2006/content-types",
125+
"spreadsheetml": "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
126+
"markupCompat": "http://schemas.openxmlformats.org/markup-compatibility/2006",
127+
"x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac",
128+
"officeDocument": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
129+
"package": "http://schemas.openxmlformats.org/package/2006/relationships",
130+
"table": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
131+
"spreadsheetDrawing": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
132+
"drawing": "http://schemas.openxmlformats.org/drawingml/2006/main",
133+
"drawingRelationship": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
134+
"image": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
135+
"chart": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"
136+
};
137137
module.exports = Util;

Util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class Util {
4141

4242
static defaults<T1, T2>(obj: T1, overrides: T2): T1 & T2 {
4343
for (var key in overrides) {
44-
if (overrides.hasOwnProperty(key) && (obj[key] === undefined)) {
45-
obj[key] = overrides[key];
44+
if (overrides.hasOwnProperty(key) && (obj[<string>key] === undefined)) {
45+
obj[<string>key] = overrides[key];
4646
}
4747
}
4848
return <any>obj;

XmlDom.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ var XmlDom = (function () {
1515
};
1616
return XmlDom;
1717
}());
18-
var XmlDom;
1918
(function (XmlDom) {
2019
var Node = (function () {
2120
function Node() {

ZipWorker.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ onmessage = function (event) {
1010
postMessage({
1111
base64: !!event.data.base64
1212
}, undefined);
13-
postMessage({
14-
status: "done",
15-
data: zip.generate({
16-
base64: !!event.data.base64
17-
})
18-
}, undefined);
13+
zip.generateAsync({
14+
base64: !!event.data.base64
15+
}).then(function (data) {
16+
postMessage({
17+
status: 'done',
18+
data: data
19+
}, undefined);
20+
});
1921
};

ZipWorker.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ onmessage = function (event: { data: any; }) {
1414
base64: !!event.data.base64
1515
}, undefined);
1616

17-
postMessage({
18-
status: "done",
19-
data: zip.generate({
20-
base64: !!event.data.base64
21-
})
22-
}, undefined);
17+
zip.generateAsync({
18+
base64: !!event.data.base64
19+
}).then(function (data) {
20+
postMessage({
21+
status: 'done',
22+
data: data
23+
}, undefined);
24+
});
2325
};

0 commit comments

Comments
 (0)