Skip to content

Commit 4377b1c

Browse files
Merge branch 'master' into dependabot/npm_and_yarn/handlebars-4.5.3
2 parents 5003720 + c5a7f4a commit 4377b1c

File tree

7 files changed

+245
-255
lines changed

7 files changed

+245
-255
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
<a name="0.6.0"></a>
6+
# [0.6.0](https://github.com/securedeveloper/react-data-export/compare/v0.5.0...v0.6.0) (2020-01-20)
7+
8+
9+
### Features
10+
11+
* if the header has style then the style should be used ([855d37a](https://github.com/securedeveloper/react-data-export/commit/855d37a))
12+
13+
14+
515
<a name="0.5.0"></a>
616
# [0.5.0](https://github.com/securedeveloper/react-data-export/compare/v0.4.2...v0.5.0) (2018-09-24)
717

dist/ExcelPlugin/utils/DataUtil.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ var excelSheetFromDataSet = function excelSheetFromDataSet(dataSet) {
7171
fixRange(range, 0, 0, rowCount, xSteps, ySteps);
7272
var colTitle = col;
7373
if ((typeof col === 'undefined' ? 'undefined' : _typeof(col)) === 'object') {
74-
colTitle = col.title;
74+
//colTitle = col.title; //moved to getHeaderCell
7575
columnsWidth.push(col.width || { wpx: 80 }); /* wch (chars), wpx (pixels) - e.g. [{wch:6},{wpx:50}] */
7676
}
7777
getHeaderCell(colTitle, cellRef, ws);
@@ -102,8 +102,8 @@ var excelSheetFromDataSet = function excelSheetFromDataSet(dataSet) {
102102

103103
function getHeaderCell(v, cellRef, ws) {
104104
var cell = {};
105-
var headerCellStyle = { font: { bold: true } };
106-
cell.v = v;
105+
var headerCellStyle = v.style ? v.style : { font: { bold: true } }; //if style is then use it
106+
cell.v = v.title;
107107
cell.t = 's';
108108
cell.s = headerCellStyle;
109109
ws[cellRef] = cell;

examples/styled_excel_sheet.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,8 @@ class App extends Component {
6262
```
6363

6464
## Output
65-
![Download Button](http://i64.tinypic.com/2mey8na.jpg)
66-
![Excel File Outpu](http://i63.tinypic.com/2qko404.jpg)
65+
![Download Button](https://blvenglu.sirv.com/github/download_styled_excel_sheet.png)
66+
![Excel File Outpu](https://blvenglu.sirv.com/github/styled_excel_sheet.png)
67+
[Codesandbox](https://codesandbox.io/s/styledexcelsheet-hf5oo "Codesandbox | styled_excel_sheet")
68+
69+

0 commit comments

Comments
 (0)