From f69f26b8bb645eab5230c9c67a1c72d5f26d7460 Mon Sep 17 00:00:00 2001 From: Arthur Brito Date: Thu, 12 Jul 2018 10:04:52 -0300 Subject: [PATCH 01/10] Exclude fs and path dependencies in browser --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 5d8ea77..95426fe 100644 --- a/package.json +++ b/package.json @@ -25,5 +25,9 @@ "async": "~0.2.6", "jszip": "^3.1.2", "xmlbuilder": ">=0.4.2" + }, + "browser": { + "fs": false, + "path": false } } From 2d8daf302f6649ae5373e9efbc88e7378e14aabc Mon Sep 17 00:00:00 2001 From: Jonathan Mackenzie Date: Tue, 31 Mar 2020 14:42:44 +1030 Subject: [PATCH 02/10] Fixed #14 Added custom number formatters Fixed git URL Bumped version --- lib/msexcel-builder.js | 39 ++++++++++++++++++++++---------------- lib/msexcel-builder.js.map | 8 ++++---- package-lock.json | 24 +++++++++++------------ package.json | 6 +++--- src/msexcel-builder.coffee | 14 ++++++++++++-- 5 files changed, 54 insertions(+), 37 deletions(-) diff --git a/lib/msexcel-builder.js b/lib/msexcel-builder.js index f670460..85ac6fa 100644 --- a/lib/msexcel-builder.js +++ b/lib/msexcel-builder.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 2.0.2 +// Generated by CoffeeScript 2.5.1 (function() { /* MS Excel 2007 Creameater v0.0.1 @@ -77,7 +77,7 @@ PartName: '/docProps/app.xml', ContentType: 'application/vnd.openxmlformats-officedocument.extended-properties+xml' }); - for (i = l = 1, ref = this.book.sheets.length; 1 <= ref ? l <= ref : l >= ref; i = 1 <= ref ? ++l : --l) { + for (i = l = 1, ref = this.book.sheets.length; (1 <= ref ? l <= ref : l >= ref); i = 1 <= ref ? ++l : --l) { types.ele('Override', { PartName: '/xl/worksheets/sheet' + i + '.xml', ContentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml' @@ -123,7 +123,7 @@ size: this.book.sheets.length, baseType: 'lpstr' }); - for (i = l = 1, ref = this.book.sheets.length; 1 <= ref ? l <= ref : l >= ref; i = 1 <= ref ? ++l : --l) { + for (i = l = 1, ref = this.book.sheets.length; (1 <= ref ? l <= ref : l >= ref); i = 1 <= ref ? ++l : --l) { tmp.ele('vt:lpstr', this.book.sheets[i - 1].name); } props.ele('Company'); @@ -167,7 +167,7 @@ windowHeight: '11640' }); tmp = wb.ele('sheets'); - for (i = l = 1, ref = this.book.sheets.length; 1 <= ref ? l <= ref : l >= ref; i = 1 <= ref ? ++l : --l) { + for (i = l = 1, ref = this.book.sheets.length; (1 <= ref ? l <= ref : l >= ref); i = 1 <= ref ? ++l : --l) { tmp.ele('sheet', { name: this.book.sheets[i - 1].name, sheetId: '' + i, @@ -205,7 +205,7 @@ standalone: true }); rs.att('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); - for (i = l = 1, ref = this.book.sheets.length; 1 <= ref ? l <= ref : l >= ref; i = 1 <= ref ? ++l : --l) { + for (i = l = 1, ref = this.book.sheets.length; (1 <= ref ? l <= ref : l >= ref); i = 1 <= ref ? ++l : --l) { rs.ele('Relationship', { Id: 'rId' + i, Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet', @@ -260,7 +260,7 @@ sst.att('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); sst.att('count', '' + this.arr.length); sst.att('uniqueCount', '' + this.arr.length); - for (i = l = 0, ref = this.arr.length; 0 <= ref ? l < ref : l > ref; i = 0 <= ref ? ++l : --l) { + for (i = l = 0, ref = this.arr.length; (0 <= ref ? l < ref : l > ref); i = 0 <= ref ? ++l : --l) { si = sst.ele('si'); si.ele('t', this.arr[i]); si.ele('phoneticPr', { @@ -282,9 +282,9 @@ this.rows = rows1; this.name = this.name.replace(/[\/*:?\[\]]/g, '-'); this.data = {}; - for (i = l = 1, ref = this.rows; 1 <= ref ? l <= ref : l >= ref; i = 1 <= ref ? ++l : --l) { + for (i = l = 1, ref = this.rows; (1 <= ref ? l <= ref : l >= ref); i = 1 <= ref ? ++l : --l) { this.data[i] = {}; - for (j = n = 1, ref1 = this.cols; 1 <= ref1 ? n <= ref1 : n >= ref1; j = 1 <= ref1 ? ++n : --n) { + for (j = n = 1, ref1 = this.cols; (1 <= ref1 ? n <= ref1 : n >= ref1); j = 1 <= ref1 ? ++n : --n) { this.data[i][j] = { v: 0 }; @@ -430,7 +430,7 @@ } } sd = ws.ele('sheetData'); - for (i = n = 1, ref1 = this.rows; 1 <= ref1 ? n <= ref1 : n >= ref1; i = 1 <= ref1 ? ++n : --n) { + for (i = n = 1, ref1 = this.rows; (1 <= ref1 ? n <= ref1 : n >= ref1); i = 1 <= ref1 ? ++n : --n) { r = sd.ele('row', { r: '' + i, spans: '1:' + this.cols @@ -440,7 +440,7 @@ r.att('ht', ht); r.att('customHeight', '1'); } - for (j = p = 1, ref2 = this.cols; 1 <= ref2 ? p <= ref2 : p >= ref2; j = 1 <= ref2 ? ++p : --p) { + for (j = p = 1, ref2 = this.cols; (1 <= ref2 ? p <= ref2 : p >= ref2); j = 1 <= ref2 ? ++p : --p) { ix = this.data[i][j]; sid = this.style_id(j, i); if ((ix.v !== null && ix.v !== void 0) || (sid !== 1)) { @@ -586,16 +586,23 @@ } numfmt2id(numfmt) { - var key; + var fmtid, key; if (typeof numfmt === 'number') { return numfmt; } else if (typeof numfmt === 'string') { + fmtid = 0; for (key in this.numberFormats) { + fmtid = Math.max(fmtid, parseInt(key)); if (this.numberFormats[key] === numfmt) { return key; } } - throw "Number format " + numfmt + " not found. Custom number formats not implemented yet"; + if (!numfmt) { + throw "Invalid format specification"; + } + numfmt = numfmt.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); + this.numberFormats[fmtid] = numfmt; + return fmtid; } } @@ -837,7 +844,7 @@ return Style; - })(); + }).call(this); Workbook = class Workbook { constructor(fpath1, fname1) { @@ -849,7 +856,7 @@ // create temp folder & copy template data // init this.sheets = []; - this.ss = new SharedStrings; + this.ss = new SharedStrings(); this.ct = new ContentTypes(this); this.da = new DocPropsApp(this); this.wb = new XlWorkbook(this); @@ -899,8 +906,8 @@ zip.file('xl/sharedStrings.xml', this.ss.toxml()); // 5 - build xl/_rels/workbook.xml.rels zip.file('xl/_rels/workbook.xml.rels', this.re.toxml()); - // 6 - build xl/worksheets/sheet(1-N).xml - for (i = l = 0, ref = this.sheets.length; 0 <= ref ? l < ref : l > ref; i = 0 <= ref ? ++l : --l) { +// 6 - build xl/worksheets/sheet(1-N).xml + for (i = l = 0, ref = this.sheets.length; (0 <= ref ? l < ref : l > ref); i = 0 <= ref ? ++l : --l) { zip.file('xl/worksheets/sheet' + (i + 1) + '.xml', this.sheets[i].toxml()); } // 7 - build xl/styles.xml diff --git a/lib/msexcel-builder.js.map b/lib/msexcel-builder.js.map index 3bd0d88..28fdbb7 100644 --- a/lib/msexcel-builder.js.map +++ b/lib/msexcel-builder.js.map @@ -1,13 +1,13 @@ { "version": 3, "file": "msexcel-builder.js", - "sourceRoot": "../src", + "sourceRoot": "..", "sources": [ - "msexcel-builder.coffee" + "src/msexcel-builder.coffee" ], "names": [], - "mappings": ";AAAA;EAAA;;;;;AAAA,MAAA,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,KAAA,EAAA,aAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EAAA;;EAKA,IAAI,kDAAA,IAAW,sBAAf;IACE,KAAA,GAAQ,MAAM,CAAC,MADjB;GAAA,MAEK,IAAI,OAAO,OAAP,KAAkB,WAAtB;IACH,KAAA,GAAQ,OAAA,CAAQ,OAAR,EADL;GAAA,MAAA;IAGH,MAAO,oBAHJ;;;EAKL,IAAI,kDAAA,IAAW,2BAAf;IACE,GAAA,GAAM,MAAM,CAAC,WADf;GAAA,MAEK,IAAI,OAAO,OAAP,KAAkB,WAAtB;IACH,GAAA,GAAM,OAAA,CAAQ,YAAR,EADH;GAAA,MAAA;IAGH,MAAO,yBAHJ;GAdL;;;;;EAuBA,IAA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;;EAxDV;;EA4DA,aAAA,GAAgB,QAAA,CAAC,EAAD,CAAA;WACd,EAAE,CAAC,OAAH,CAAA,CAAA,GAAe,QAAf,GAA0B;EADZ;;EAGhB,IAAI,kDAAA,IAAW,wBAAf;IACE,MAAM,CAAC,OAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;;;EAKA,IAAG,CAAC,gDAAD,CAAH;IACE,MAAM,CAAC,YAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;GA/fG;;;EAqgBH,MAAA,GACE;IAAA,aAAA,EAAe,4kBAAf;IACA,mBAAA,EAAoB,8lBADpB;IAEA,qBAAA,EAAsB,4wNAFtB;IAGA,eAAA,EAAgB;EAHhB;AAtgBC", "sourcesContent": [ - "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n for key of @numberFormats\n if @numberFormats[key] == numfmt\n return key;\n\n throw \"Number format \"+numfmt + \" not found. Custom number formats not implemented yet\"\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{numFmtId: o.numfmt_id||'0',fontId:(o.font_id-1),fillId:o.fill_id+1,borderId:(o.bder_id-1),xfId:'0'})\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" + "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n fmtid = 0\n for key of @numberFormats\n fmtid = Math.max(fmtid, parseInt key)\n if @numberFormats[key] == numfmt\n return key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[fmtid] = numfmt\n return fmtid\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{numFmtId: o.numfmt_id||'0',fontId:(o.font_id-1),fillId:o.fill_id+1,borderId:(o.bder_id-1),xfId:'0'})\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" ] } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 63eafb9..ddd1aed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,11 +14,11 @@ "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.2.tgz", "integrity": "sha1-LC7AtijoyI0Rn56JvRzU1j/xi5I=", "requires": { - "core-js": "2.3.0", - "es6-promise": "3.0.2", - "lie": "3.1.0", - "pako": "1.0.3", - "readable-stream": "2.0.6" + "core-js": "~2.3.0", + "es6-promise": "~3.0.2", + "lie": "~3.1.0", + "pako": "~1.0.2", + "readable-stream": "~2.0.6" }, "dependencies": { "core-js": { @@ -36,7 +36,7 @@ "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.0.tgz", "integrity": "sha1-ZeATnq75rnkaH1yMU2ksjTtHGPQ=", "requires": { - "immediate": "3.0.6" + "immediate": "~3.0.5" }, "dependencies": { "immediate": { @@ -56,12 +56,12 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" }, "dependencies": { "core-util-is": { diff --git a/package.json b/package.json index 95426fe..652d6ea 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ "xlsx", "excel" ], - "version": "0.3.3", + "version": "0.3.4", "repository": { "type": "git", - "url": "git://github.com/chuanyi/msexcel-builder.git" + "url": "git://github.com/protobi/msexcel-builder.git" }, "bugs": { - "url": "https://github.com/chuanyi/msexcel-builder/issues" + "url": "https://github.com/protobi/msexcel-builder/issues" }, "main": "./lib/msexcel-builder.js", "engines": { diff --git a/src/msexcel-builder.coffee b/src/msexcel-builder.coffee index 6895689..52849ab 100644 --- a/src/msexcel-builder.coffee +++ b/src/msexcel-builder.coffee @@ -362,11 +362,21 @@ class Style if typeof numfmt == 'number' return numfmt else if typeof numfmt == 'string' + fmtid = 0 for key of @numberFormats + fmtid = Math.max(fmtid, parseInt key) if @numberFormats[key] == numfmt return key; - - throw "Number format "+numfmt + " not found. Custom number formats not implemented yet" + # if it's not in numberFormats, we parse the string and add it the end of numberFormats + if ! numfmt + throw "Invalid format specification" + numfmt = numfmt + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + @numberFormats[fmtid] = numfmt + return fmtid style2id:(style)-> style.align or= @def_align From 359e187b6b81d77762fdb5af03bfb9669f075637 Mon Sep 17 00:00:00 2001 From: Jonathan Mackenzie Date: Tue, 31 Mar 2020 16:23:42 +1030 Subject: [PATCH 03/10] Fixed #14 Added custom number formatters Fixed git URL Bumped version --- lib/msexcel-builder.js | 2 +- lib/msexcel-builder.js.map | 4 ++-- src/msexcel-builder.coffee | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/msexcel-builder.js b/lib/msexcel-builder.js index 85ac6fa..2237442 100644 --- a/lib/msexcel-builder.js +++ b/lib/msexcel-builder.js @@ -602,7 +602,7 @@ } numfmt = numfmt.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); this.numberFormats[fmtid] = numfmt; - return fmtid; + return parseInt(fmtid); } } diff --git a/lib/msexcel-builder.js.map b/lib/msexcel-builder.js.map index 28fdbb7..2f29c0e 100644 --- a/lib/msexcel-builder.js.map +++ b/lib/msexcel-builder.js.map @@ -6,8 +6,8 @@ "src/msexcel-builder.coffee" ], "names": [], - "mappings": ";AAIG;EAAA;;;;;AAAA,MAAA,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,KAAA,EAAA,aAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EAAA;;EACH,IAAI,kDAAA,IAAW,sBAAf;IACE,KAAA,GAAQ,MAAM,CAAC,MADjB;GAAA,MAEK,IAAI,OAAO,OAAP,KAAkB,WAAtB;IACH,KAAA,GAAQ,OAAA,CAAQ,OAAR,EADL;GAAA,MAAA;IAGH,MAAO,oBAHJ;;;EAKL,IAAI,kDAAA,IAAW,2BAAf;IACE,GAAA,GAAM,MAAM,CAAC,WADf;GAAA,MAEK,IAAI,OAAO,OAAP,KAAkB,WAAtB;IACH,GAAA,GAAM,OAAA,CAAQ,YAAR,EADH;GAAA,MAAA;IAGH,MAAO,yBAHJ;GAVF;;;;;EAmBH,IAAA,GACE;IAAA,GAAA,EAAK,QAAA,CAAC,MAAD,CAAA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BAAA,GAAsB,CAAC,CAAA,GAAE,CAAH,CAAtB,GAA4B,MAArC,EAA4C,IAAC,CAAA,MAAM,CAAC,CAAD,CAAG,CAAC,KAAX,CAAA,CAA5C;MADF,CAhBJ;;MAmBI,GAAG,CAAC,IAAJ,CAAS,eAAT,EAAyB,IAAC,CAAA,EAAE,CAAC,KAAJ,CAAA,CAAzB;aACA,EAAA,CAAG,IAAH,EAAS,GAAT;IAtBQ;;IAwBV,MAAQ,CAAA,CAAA,EAAA;;aAEN,OAAO,CAAC,KAAR,CAAc,iCAAd;IAFM;;EAxDV;;EA4DA,aAAA,GAAgB,QAAA,CAAC,EAAD,CAAA;WACd,EAAE,CAAC,OAAH,CAAA,CAAA,GAAe,QAAf,GAA0B;EADZ;;EAGhB,IAAI,kDAAA,IAAW,wBAAf;IACE,MAAM,CAAC,OAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;;;EAKA,IAAG,CAAC,gDAAD,CAAH;IACE,MAAM,CAAC,YAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;GA/fG;;;EAqgBH,MAAA,GACE;IAAA,aAAA,EAAe,4kBAAf;IACA,mBAAA,EAAoB,8lBADpB;IAEA,qBAAA,EAAsB,4wNAFtB;IAGA,eAAA,EAAgB;EAHhB;AAtgBC", "sourcesContent": [ - "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n fmtid = 0\n for key of @numberFormats\n fmtid = Math.max(fmtid, parseInt key)\n if @numberFormats[key] == numfmt\n return key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[fmtid] = numfmt\n return fmtid\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{numFmtId: o.numfmt_id||'0',fontId:(o.font_id-1),fillId:o.fill_id+1,borderId:(o.bder_id-1),xfId:'0'})\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" + "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n fmtid = 0\n for key of @numberFormats\n fmtid = Math.max(fmtid, parseInt key)\n if @numberFormats[key] == numfmt\n return key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[fmtid] = numfmt\n return parseInt fmtid\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{numFmtId: o.numfmt_id||'0',fontId:(o.font_id-1),fillId:o.fill_id+1,borderId:(o.bder_id-1),xfId:'0'})\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" ] } \ No newline at end of file diff --git a/src/msexcel-builder.coffee b/src/msexcel-builder.coffee index 52849ab..e54558f 100644 --- a/src/msexcel-builder.coffee +++ b/src/msexcel-builder.coffee @@ -376,7 +376,7 @@ class Style .replace(/>/g, '>') .replace(/"/g, '"') @numberFormats[fmtid] = numfmt - return fmtid + return parseInt fmtid style2id:(style)-> style.align or= @def_align From 43ad7c4cd01615209cae9bdb78052851fcf9cb1f Mon Sep 17 00:00:00 2001 From: Jonathan Mackenzie Date: Tue, 31 Mar 2020 16:52:39 +1030 Subject: [PATCH 04/10] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 652d6ea..7fce70c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "xlsx", "excel" ], - "version": "0.3.4", + "version": "0.3.5", "repository": { "type": "git", "url": "git://github.com/protobi/msexcel-builder.git" From e66f6797d592bcafc86caa869e1dd6e9ea6dee10 Mon Sep 17 00:00:00 2001 From: Jonathan Mackenzie Date: Wed, 1 Apr 2020 10:55:02 +1030 Subject: [PATCH 05/10] Attempting to fix number formats --- lib/msexcel-builder.js | 5 +++-- lib/msexcel-builder.js.map | 4 ++-- src/msexcel-builder.coffee | 13 ++++++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/msexcel-builder.js b/lib/msexcel-builder.js index 2237442..d99476d 100644 --- a/lib/msexcel-builder.js +++ b/lib/msexcel-builder.js @@ -594,7 +594,7 @@ for (key in this.numberFormats) { fmtid = Math.max(fmtid, parseInt(key)); if (this.numberFormats[key] === numfmt) { - return key; + return parseInt(key); } } if (!numfmt) { @@ -615,7 +615,8 @@ style.font_id || (style.font_id = this.def_font_id); style.fill_id || (style.fill_id = this.def_fill_id); style.bder_id || (style.bder_id = this.def_bder_id); - k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate; + style.numfmt_id || (style.numfmt_id = void 0); + k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate + '_' + style.numfmt_id; id = this.cache[k]; if (id) { return id; diff --git a/lib/msexcel-builder.js.map b/lib/msexcel-builder.js.map index 2f29c0e..e0ebbb9 100644 --- a/lib/msexcel-builder.js.map +++ b/lib/msexcel-builder.js.map @@ -6,8 +6,8 @@ "src/msexcel-builder.coffee" ], "names": [], - "mappings": ";AAIG;EAAA;;;;;AAAA,MAAA,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,KAAA,EAAA,aAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EAAA;;EACH,IAAI,kDAAA,IAAW,sBAAf;IACE,KAAA,GAAQ,MAAM,CAAC,MADjB;GAAA,MAEK,IAAI,OAAO,OAAP,KAAkB,WAAtB;IACH,KAAA,GAAQ,OAAA,CAAQ,OAAR,EADL;GAAA,MAAA;IAGH,MAAO,oBAHJ;;;EAKL,IAAI,kDAAA,IAAW,2BAAf;IACE,GAAA,GAAM,MAAM,CAAC,WADf;GAAA,MAEK,IAAI,OAAO,OAAP,KAAkB,WAAtB;IACH,GAAA,GAAM,OAAA,CAAQ,YAAR,EADH;GAAA,MAAA;IAGH,MAAO,yBAHJ;GAVF;;;;;EAmBH,IAAA,GACE;IAAA,GAAA,EAAK,QAAA,CAAC,MAAD,CAAA;AACP,UAAA,MAAA,EAAA;MAAI,IAAA,GAAO;MACP,MAAA,GAAS;AACT,aAAM,MAAA,GAAS,CAAf;QACE,IAAA,GAAO,CAAC,MAAA,GAAS,CAAV,CAAA,GAAe;QACtB,MAAA,GAAS,MAAM,CAAC,YAAP,CAAoB,IAAA,GAAO,EAA3B,CAAA,GAAiC;QAC1C,MAAA,GAAS,CAAC,MAAA,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;MAmBI,GAAG,CAAC,IAAJ,CAAS,eAAT,EAAyB,IAAC,CAAA,EAAE,CAAC,KAAJ,CAAA,CAAzB;aACA,EAAA,CAAG,IAAH,EAAS,GAAT;IAtBQ;;IAwBV,MAAQ,CAAA,CAAA,EAAA;;aAEN,OAAO,CAAC,KAAR,CAAc,iCAAd;IAFM;;EAxDV;;EA4DA,aAAA,GAAgB,QAAA,CAAC,EAAD,CAAA;WACd,EAAE,CAAC,OAAH,CAAA,CAAA,GAAe,QAAf,GAA0B;EADZ;;EAGhB,IAAI,kDAAA,IAAW,wBAAf;IACE,MAAM,CAAC,OAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;;;EAKA,IAAG,CAAC,gDAAD,CAAH;IACE,MAAM,CAAC,YAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;GAtgBG;;;EA4gBH,MAAA,GACE;IAAA,aAAA,EAAe,4kBAAf;IACA,mBAAA,EAAoB,8lBADpB;IAEA,qBAAA,EAAsB,4wNAFtB;IAGA,eAAA,EAAgB;EAHhB;AA7gBC", "sourcesContent": [ - "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n fmtid = 0\n for key of @numberFormats\n fmtid = Math.max(fmtid, parseInt key)\n if @numberFormats[key] == numfmt\n return key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[fmtid] = numfmt\n return parseInt fmtid\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{numFmtId: o.numfmt_id||'0',fontId:(o.font_id-1),fillId:o.fill_id+1,borderId:(o.bder_id-1),xfId:'0'})\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" + "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n fmtid = 0\n for key of @numberFormats\n fmtid = Math.max(fmtid, parseInt key)\n if @numberFormats[key] == numfmt\n return parseInt key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[fmtid] = numfmt\n return parseInt fmtid\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n style.numfmt_id or= undefined\n k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate + '_' + style.numfmt_id\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{\n numFmtId: o.numfmt_id||'0',\n fontId:(o.font_id-1),\n fillId:o.fill_id+1,\n borderId:(o.bder_id-1),\n xfId:'0'\n })\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" ] } \ No newline at end of file diff --git a/src/msexcel-builder.coffee b/src/msexcel-builder.coffee index e54558f..47ed4e1 100644 --- a/src/msexcel-builder.coffee +++ b/src/msexcel-builder.coffee @@ -366,7 +366,7 @@ class Style for key of @numberFormats fmtid = Math.max(fmtid, parseInt key) if @numberFormats[key] == numfmt - return key; + return parseInt key; # if it's not in numberFormats, we parse the string and add it the end of numberFormats if ! numfmt throw "Invalid format specification" @@ -386,7 +386,8 @@ class Style style.font_id or= @def_font_id style.fill_id or= @def_fill_id style.bder_id or= @def_bder_id - k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate + style.numfmt_id or= undefined + k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate + '_' + style.numfmt_id id = @cache[k] if id return id @@ -431,7 +432,13 @@ class Style ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'}) cs = ss.ele('cellXfs',{count:@mstyle.length}) for o in @mstyle - e = cs.ele('xf',{numFmtId: o.numfmt_id||'0',fontId:(o.font_id-1),fillId:o.fill_id+1,borderId:(o.bder_id-1),xfId:'0'}) + e = cs.ele('xf',{ + numFmtId: o.numfmt_id||'0', + fontId:(o.font_id-1), + fillId:o.fill_id+1, + borderId:(o.bder_id-1), + xfId:'0' + }) e.att('applyFont','1') if o.font_id isnt 1 e.att('applyFill','1') if o.fill_id isnt 1 e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined From 18a7b8ca5b6e99c7ec6bdec89aacc138e835c5c4 Mon Sep 17 00:00:00 2001 From: Jonathan Mackenzie Date: Wed, 1 Apr 2020 12:45:12 +1030 Subject: [PATCH 06/10] Fixing invalid number format id --- lib/msexcel-builder.js | 14 +++++++------- lib/msexcel-builder.js.map | 4 ++-- src/msexcel-builder.coffee | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/msexcel-builder.js b/lib/msexcel-builder.js index d99476d..24b6e89 100644 --- a/lib/msexcel-builder.js +++ b/lib/msexcel-builder.js @@ -508,6 +508,7 @@ this.mfills = []; // fill style this.mbders = []; // border style this.mstyle = []; // cell style + this.numFmtNextId = 164; this.with_default(); } @@ -519,6 +520,7 @@ this.def_valign = '-'; this.def_rotate = '-'; this.def_wrap = '-'; + this.def_numfmt_id = 0; return this.def_style_id = this.style2id({ font_id: this.def_font_id, fill_id: this.def_fill_id, @@ -586,13 +588,11 @@ } numfmt2id(numfmt) { - var fmtid, key; + var key; if (typeof numfmt === 'number') { return numfmt; } else if (typeof numfmt === 'string') { - fmtid = 0; for (key in this.numberFormats) { - fmtid = Math.max(fmtid, parseInt(key)); if (this.numberFormats[key] === numfmt) { return parseInt(key); } @@ -601,8 +601,8 @@ throw "Invalid format specification"; } numfmt = numfmt.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); - this.numberFormats[fmtid] = numfmt; - return parseInt(fmtid); + this.numberFormats[++this.numFmtNextId] = numfmt; + return this.numFmtNextId; } } @@ -615,8 +615,8 @@ style.font_id || (style.font_id = this.def_font_id); style.fill_id || (style.fill_id = this.def_fill_id); style.bder_id || (style.bder_id = this.def_bder_id); - style.numfmt_id || (style.numfmt_id = void 0); - k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate + '_' + style.numfmt_id; + style.numfmt_id || (style.numfmt_id = this.def_numfmt_id); + k = 's_' + [style.font_id, style.fill_id, style.bder_id, style.align, style.valign, style.wrap, style.rotate, style.numfmt_id].join('_'); id = this.cache[k]; if (id) { return id; diff --git a/lib/msexcel-builder.js.map b/lib/msexcel-builder.js.map index e0ebbb9..deca75d 100644 --- a/lib/msexcel-builder.js.map +++ b/lib/msexcel-builder.js.map @@ -6,8 +6,8 @@ "src/msexcel-builder.coffee" ], "names": [], - "mappings":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AAf;IACE,MAAM,CAAC,OAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;;;EAKA,IAAG,CAAC,gDAAD,CAAH;IACE,MAAM,CAAC,YAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;GAtgBG;;;EA4gBH,MAAA,GACE;IAAA,aAAA,EAAe,4kBAAf;IACA,mBAAA,EAAoB,8lBADpB;IAEA,qBAAA,EAAsB,4wNAFtB;IAGA,eAAA,EAAgB;EAHhB;AA7gBC", "sourcesContent": [ - "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n fmtid = 0\n for key of @numberFormats\n fmtid = Math.max(fmtid, parseInt key)\n if @numberFormats[key] == numfmt\n return parseInt key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[fmtid] = numfmt\n return parseInt fmtid\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n style.numfmt_id or= undefined\n k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate + '_' + style.numfmt_id\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{\n numFmtId: o.numfmt_id||'0',\n fontId:(o.font_id-1),\n fillId:o.fill_id+1,\n borderId:(o.bder_id-1),\n xfId:'0'\n })\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" + "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @numFmtNextId = 164\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_numfmt_id = 0\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n for key of @numberFormats\n if @numberFormats[key] == numfmt\n return parseInt key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[++@numFmtNextId] = numfmt\n return @numFmtNextId\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n style.numfmt_id or= @def_numfmt_id\n k = 's_' + [style.font_id, style.fill_id, style.bder_id, style.align, style.valign, style.wrap, style.rotate, style.numfmt_id].join('_')\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{\n numFmtId: o.numfmt_id||'0',\n fontId:(o.font_id-1),\n fillId:o.fill_id+1,\n borderId:(o.bder_id-1),\n xfId:'0'\n })\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" ] } \ No newline at end of file diff --git a/src/msexcel-builder.coffee b/src/msexcel-builder.coffee index 47ed4e1..722655f 100644 --- a/src/msexcel-builder.coffee +++ b/src/msexcel-builder.coffee @@ -299,6 +299,7 @@ class Style @mfills = [] # fill style @mbders = [] # border style @mstyle = [] # cell style + @numFmtNextId = 164 @with_default() with_default:()-> @@ -309,6 +310,7 @@ class Style @def_valign = '-' @def_rotate = '-' @def_wrap = '-' + @def_numfmt_id = 0 @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate}) font2id: (font)-> @@ -362,9 +364,7 @@ class Style if typeof numfmt == 'number' return numfmt else if typeof numfmt == 'string' - fmtid = 0 for key of @numberFormats - fmtid = Math.max(fmtid, parseInt key) if @numberFormats[key] == numfmt return parseInt key; # if it's not in numberFormats, we parse the string and add it the end of numberFormats @@ -375,8 +375,8 @@ class Style .replace(//g, '>') .replace(/"/g, '"') - @numberFormats[fmtid] = numfmt - return parseInt fmtid + @numberFormats[++@numFmtNextId] = numfmt + return @numFmtNextId style2id:(style)-> style.align or= @def_align @@ -386,8 +386,8 @@ class Style style.font_id or= @def_font_id style.fill_id or= @def_fill_id style.bder_id or= @def_bder_id - style.numfmt_id or= undefined - k = 's_' + style.font_id + '_' + style.fill_id + '_' + style.bder_id + '_' + style.align + '_' + style.valign + '_' + style.wrap + '_' + style.rotate + '_' + style.numfmt_id + style.numfmt_id or= @def_numfmt_id + k = 's_' + [style.font_id, style.fill_id, style.bder_id, style.align, style.valign, style.wrap, style.rotate, style.numfmt_id].join('_') id = @cache[k] if id return id From 123cd479b098d9339ae9cf8b7fc5817d984eb669 Mon Sep 17 00:00:00 2001 From: Jonathan Mackenzie Date: Wed, 1 Apr 2020 13:27:14 +1030 Subject: [PATCH 07/10] Added custom number formats when converting to xml --- lib/msexcel-builder.js | 47 +++++++++++++++++++++++++++----------- src/msexcel-builder.coffee | 11 +++++++++ 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/lib/msexcel-builder.js b/lib/msexcel-builder.js index 24b6e89..d021b84 100644 --- a/lib/msexcel-builder.js +++ b/lib/msexcel-builder.js @@ -628,19 +628,40 @@ } toxml() { - var bders, cs, e, ea, es, fills, fonts, l, len, len1, len2, len3, n, o, p, q, ref, ref1, ref2, ref3, ss; + var bders, cs, customNumFmts, e, ea, es, fills, fmt, fonts, key, l, len, len1, len2, len3, len4, n, numFmts, o, p, q, ref, ref1, ref2, ref3, ref4, ss, t; ss = xml.create('styleSheet', { version: '1.0', encoding: 'UTF-8', standalone: true }); ss.att('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); + // add all numFmts >= 164 as + customNumFmts = []; + ref = this.numberFormats; + for (key in ref) { + fmt = ref[key]; + if (parseInt(key >= 164)) { + customNumFmts.push({ + numFmtId: key, + formatCode: fmt + }); + } + } + if (customNumFmts.length > 0) { + numFmts = ss.ele('numFmts', { + count: customNumFmts.length + }); + for (l = 0, len = customNumFmts.length; l < len; l++) { + o = customNumFmts[l]; + numFmts.ele('numFmt', o); + } + } fonts = ss.ele('fonts', { count: this.mfonts.length }); - ref = this.mfonts; - for (l = 0, len = ref.length; l < len; l++) { - o = ref[l]; + ref1 = this.mfonts; + for (n = 0, len1 = ref1.length; n < len1; n++) { + o = ref1[n]; e = fonts.ele('font'); if (o.bold !== '-') { e.ele('b'); @@ -680,10 +701,10 @@ fills.ele('fill').ele('patternFill', { patternType: 'gray125' }); - ref1 = this.mfills; + ref2 = this.mfills; // - for (n = 0, len1 = ref1.length; n < len1; n++) { - o = ref1[n]; + for (p = 0, len2 = ref2.length; p < len2; p++) { + o = ref2[p]; e = fills.ele('fill'); es = e.ele('patternFill', { patternType: o.type @@ -702,9 +723,9 @@ bders = ss.ele('borders', { count: this.mbders.length }); - ref2 = this.mbders; - for (p = 0, len2 = ref2.length; p < len2; p++) { - o = ref2[p]; + ref3 = this.mbders; + for (q = 0, len3 = ref3.length; q < len3; q++) { + o = ref3[q]; e = bders.ele('border'); if (o.left !== '-') { e.ele('left', { @@ -757,9 +778,9 @@ cs = ss.ele('cellXfs', { count: this.mstyle.length }); - ref3 = this.mstyle; - for (q = 0, len3 = ref3.length; q < len3; q++) { - o = ref3[q]; + ref4 = this.mstyle; + for (t = 0, len4 = ref4.length; t < len4; t++) { + o = ref4[t]; e = cs.ele('xf', { numFmtId: o.numfmt_id || '0', fontId: o.font_id - 1, diff --git a/src/msexcel-builder.coffee b/src/msexcel-builder.coffee index 722655f..42ad944 100644 --- a/src/msexcel-builder.coffee +++ b/src/msexcel-builder.coffee @@ -399,6 +399,17 @@ class Style toxml: ()-> ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true}) ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main') + # add all numFmts >= 164 as + customNumFmts = []; + for key, fmt of @numberFormats + if parseInt key >= 164 + customNumFmts.push({numFmtId:key, formatCode: fmt}); + if customNumFmts.length > 0 + numFmts = ss.ele('numFmts', { + count: customNumFmts.length + }); + for o in customNumFmts + numFmts.ele('numFmt', o) fonts = ss.ele('fonts',{count:@mfonts.length}) for o in @mfonts e = fonts.ele('font') From 576149f8a324eb17bbe756512c2c82752ac7f028 Mon Sep 17 00:00:00 2001 From: Jonathan Mackenzie Date: Wed, 1 Apr 2020 13:31:54 +1030 Subject: [PATCH 08/10] Added custom number formats when converting to xml --- lib/msexcel-builder.js | 2 +- lib/msexcel-builder.js.map | 4 ++-- src/msexcel-builder.coffee | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/msexcel-builder.js b/lib/msexcel-builder.js index d021b84..036cbe7 100644 --- a/lib/msexcel-builder.js +++ b/lib/msexcel-builder.js @@ -640,7 +640,7 @@ ref = this.numberFormats; for (key in ref) { fmt = ref[key]; - if (parseInt(key >= 164)) { + if (parseInt(key) >= 164) { customNumFmts.push({ numFmtId: key, formatCode: fmt diff --git a/lib/msexcel-builder.js.map b/lib/msexcel-builder.js.map index deca75d..5c050b3 100644 --- a/lib/msexcel-builder.js.map +++ b/lib/msexcel-builder.js.map @@ -6,8 +6,8 @@ "src/msexcel-builder.coffee" ], "names": [], - "mappings": ";AAIG;EAAA;;;;;AAAA,MAAA,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,KAAA,EAAA,aAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EAAA;;EACH,IAAI,kDAAA,IAAW,sBAAf;IACE,KAA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CAAA,CAAA,EAAA;;aAEN,OAAO,CAAC,KAAR,CAAc,iCAAd;IAFM;;EAxDV;;EA4DA,aAAA,GAAgB,QAAA,CAAC,EAAD,CAAA;WACd,EAAE,CAAC,OAAH,CAAA,CAAA,GAAe,QAAf,GAA0B;EADZ;;EAGhB,IAAI,kDAAA,IAAW,wBAAf;IACE,MAAM,CAAC,OAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;;;EAKA,IAAG,CAAC,gDAAD,CAAH;IACE,MAAM,CAAC,YAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;GAjhBG;;;EAuhBH,MAAA,GACE;IAAA,aAAA,EAAe,4kBAAf;IACA,mBAAA,EAAoB,8lBADpB;IAEA,qBAAA,EAAsB,4wNAFtB;IAGA,eAAA,EAAgB;EAHhB;AAxhBC", "sourcesContent": [ - "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @numFmtNextId = 164\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_numfmt_id = 0\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n for key of @numberFormats\n if @numberFormats[key] == numfmt\n return parseInt key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[++@numFmtNextId] = numfmt\n return @numFmtNextId\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n style.numfmt_id or= @def_numfmt_id\n k = 's_' + [style.font_id, style.fill_id, style.bder_id, style.align, style.valign, style.wrap, style.rotate, style.numfmt_id].join('_')\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{\n numFmtId: o.numfmt_id||'0',\n fontId:(o.font_id-1),\n fillId:o.fill_id+1,\n borderId:(o.bder_id-1),\n xfId:'0'\n })\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" + "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @numFmtNextId = 164\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_numfmt_id = 0\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n for key of @numberFormats\n if @numberFormats[key] == numfmt\n return parseInt key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[++@numFmtNextId] = numfmt\n return @numFmtNextId\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n style.numfmt_id or= @def_numfmt_id\n k = 's_' + [style.font_id, style.fill_id, style.bder_id, style.align, style.valign, style.wrap, style.rotate, style.numfmt_id].join('_')\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n # add all numFmts >= 164 as \n customNumFmts = [];\n for key, fmt of @numberFormats\n if parseInt(key) >= 164\n customNumFmts.push({numFmtId:key, formatCode: fmt});\n if customNumFmts.length > 0\n numFmts = ss.ele('numFmts', {\n count: customNumFmts.length\n });\n for o in customNumFmts\n numFmts.ele('numFmt', o)\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{\n numFmtId: o.numfmt_id||'0',\n fontId:(o.font_id-1),\n fillId:o.fill_id+1,\n borderId:(o.bder_id-1),\n xfId:'0'\n })\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" ] } \ No newline at end of file diff --git a/src/msexcel-builder.coffee b/src/msexcel-builder.coffee index 42ad944..43e474e 100644 --- a/src/msexcel-builder.coffee +++ b/src/msexcel-builder.coffee @@ -402,7 +402,7 @@ class Style # add all numFmts >= 164 as customNumFmts = []; for key, fmt of @numberFormats - if parseInt key >= 164 + if parseInt(key) >= 164 customNumFmts.push({numFmtId:key, formatCode: fmt}); if customNumFmts.length > 0 numFmts = ss.ele('numFmts', { From e8cc574e23fb617d6afa664cd2255c06b7f782cf Mon Sep 17 00:00:00 2001 From: Jonathan Mackenzie Date: Wed, 1 Apr 2020 13:47:58 +1030 Subject: [PATCH 09/10] Version bump --- package-lock.json | 173 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 86 insertions(+), 89 deletions(-) diff --git a/package-lock.json b/package-lock.json index ddd1aed..69adc82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "msexcel-builder", - "version": "0.3.3", + "version": "0.3.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -9,99 +9,96 @@ "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=" }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, "jszip": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.2.tgz", - "integrity": "sha1-LC7AtijoyI0Rn56JvRzU1j/xi5I=", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.2.2.tgz", + "integrity": "sha512-NmKajvAFQpbg3taXQXr/ccS2wcucR1AZ+NtyWp2Nq7HHVsXhcJFR8p0Baf32C2yVvBylFWVeKf+WI2AnvlPhpA==", "requires": { - "core-js": "~2.3.0", - "es6-promise": "~3.0.2", - "lie": "~3.1.0", + "lie": "~3.3.0", "pako": "~1.0.2", - "readable-stream": "~2.0.6" - }, - "dependencies": { - "core-js": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", - "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=" - }, - "es6-promise": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", - "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=" - }, - "lie": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.0.tgz", - "integrity": "sha1-ZeATnq75rnkaH1yMU2ksjTtHGPQ=", - "requires": { - "immediate": "~3.0.5" - }, - "dependencies": { - "immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" - } - } - }, - "pako": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.3.tgz", - "integrity": "sha1-X1FbDGci4ZgpIK6ABerLC3ynPM8=" - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - } - } - } + "readable-stream": "~2.3.6", + "set-immediate-shim": "~1.0.1" + } + }, + "lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "requires": { + "immediate": "~3.0.5" + } + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, "xmlbuilder": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz", - "integrity": "sha1-UZy0ymhtAFqEINNJbz8MruzKWA8=" + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.0.tgz", + "integrity": "sha512-xae5hmPQnmSFhpiuV3NGXq+FWGOvWy/rIzxVLnRtSSABbPZWltTQCe6WlHDpCq5pGvnGwNsWnS1FdkW7Tx9FNQ==" } } } diff --git a/package.json b/package.json index 7fce70c..7e8205e 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "xlsx", "excel" ], - "version": "0.3.5", + "version": "0.3.6", "repository": { "type": "git", "url": "git://github.com/protobi/msexcel-builder.git" From 3641a047c30fcf35acf45df63d9043920a776ecb Mon Sep 17 00:00:00 2001 From: Jonathan Mackenzie Date: Fri, 12 Jun 2020 11:09:42 +0930 Subject: [PATCH 10/10] Set defaults to english Bumped version --- lib/msexcel-builder.js | 6 +++--- lib/msexcel-builder.js.map | 4 ++-- package.json | 2 +- src/msexcel-builder.coffee | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/msexcel-builder.js b/lib/msexcel-builder.js index 036cbe7..836e112 100644 --- a/lib/msexcel-builder.js +++ b/lib/msexcel-builder.js @@ -117,7 +117,7 @@ size: 2, baseType: 'variant' }); - tmp.ele('vt:variant').ele('vt:lpstr', '工作表'); + tmp.ele('vt:variant').ele('vt:lpstr', 'Worksheets'); tmp.ele('vt:variant').ele('vt:i4', '' + this.book.sheets.length); tmp = props.ele('TitlesOfParts').ele('vt:vector', { size: this.book.sheets.length, @@ -538,7 +538,7 @@ font.iter || (font.iter = '-'); font.sz || (font.sz = '11'); font.color || (font.color = '-'); - font.name || (font.name = '宋体'); + font.name || (font.name = 'Calibri'); font.scheme || (font.scheme = 'minor'); font.family || (font.family = '2'); k = 'font_' + font.bold + font.iter + font.sz + font.color + font.name + font.scheme + font.family; @@ -815,7 +815,7 @@ ss.ele('cellStyles', { count: '1' }).ele('cellStyle', { - name: '常规', + name: 'Normal', xfId: '0', builtinId: '0' }); diff --git a/lib/msexcel-builder.js.map b/lib/msexcel-builder.js.map index 5c050b3..aed9c6f 100644 --- a/lib/msexcel-builder.js.map +++ b/lib/msexcel-builder.js.map @@ -6,8 +6,8 @@ "src/msexcel-builder.coffee" ], "names": [], - "mappings": ";AAIG;EAAA;;;;;AAAA,MAAA,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,KAAA,EAAA,aAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EAAA;;EACH,IAAI,kDAAA,IAAW,sBAAf;IACE,KAAA,GAAQ,MAAM,CAAC,MADjB;GAAA,MAEK,IAAI,OAAO,OAAP,KAAkB,WAAtB;IACH,KAAA,GAAQ,OAAA,CAAQ,OAAR,EADL;GAAA,MAAA;IAGH,MAAO,oBAHJ;;;EAKL,IAAI,kDAAA,IAAW,2BAAf;IACE,GAAA,GAAM,MAAM,CAAC,WADf;GAAA,MAEK,IAAI,OAAO,OAAP,KAAkB,WAAtB;IACH,GAAA,GAAM,OAAA,CAAQ,YAAR,EADH;GAAA,MAAA;IAGH,MAAO,yBAHJ;GAVF;;;;;EAmBH,IAAA,GACE;IAAA,GAAA,EAAK,QAAA,CAAC,MAAD,CAAA;AACP,UAAA,MAAA,EAAA;MAAI,IAAA,GAAO;MACP,MAAA,GAAS;AACT,aAAM,MAAA,GAAS,CAAf;QACE,IAAA,GAAO,CAAC,MAAA,GAAS,CAAV,CAAA,GAAe;QACtB,MAAA,GAAS,MAAM,CAAC,YAAP,CAAoB,IAAA,GAAO,EA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AA,CAAC,EAAD,CAAA;WACd,EAAE,CAAC,OAAH,CAAA,CAAA,GAAe,QAAf,GAA0B;EADZ;;EAGhB,IAAI,kDAAA,IAAW,wBAAf;IACE,MAAM,CAAC,OAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;;;EAKA,IAAG,CAAC,gDAAD,CAAH;IACE,MAAM,CAAC,YAAP,GACE;MAAA,cAAA,EAAgB,QAAA,CAAC,KAAD,EAAQ,KAAR,CAAA;AACd,eAAO,IAAI,QAAJ,CAAa,KAAb,EAAoB,KAApB;MADO;IAAhB,EAFJ;GAjhBG;;;EAuhBH,MAAA,GACE;IAAA,aAAA,EAAe,4kBAAf;IACA,mBAAA,EAAoB,8lBADpB;IAEA,qBAAA,EAAsB,4wNAFtB;IAGA,eAAA,EAAgB;EAHhB;AAxhBC", "sourcesContent": [ - "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','工作表')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @numFmtNextId = 164\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_numfmt_id = 0\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= '宋体'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n for key of @numberFormats\n if @numberFormats[key] == numfmt\n return parseInt key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[++@numFmtNextId] = numfmt\n return @numFmtNextId\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n style.numfmt_id or= @def_numfmt_id\n k = 's_' + [style.font_id, style.fill_id, style.bder_id, style.align, style.valign, style.wrap, style.rotate, style.numfmt_id].join('_')\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n # add all numFmts >= 164 as \n customNumFmts = [];\n for key, fmt of @numberFormats\n if parseInt(key) >= 164\n customNumFmts.push({numFmtId:key, formatCode: fmt});\n if customNumFmts.length > 0\n numFmts = ss.ele('numFmts', {\n count: customNumFmts.length\n });\n for o in customNumFmts\n numFmts.ele('numFmt', o)\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{\n numFmtId: o.numfmt_id||'0',\n fontId:(o.font_id-1),\n fillId:o.fill_id+1,\n borderId:(o.bder_id-1),\n xfId:'0'\n })\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" + "###\n MS Excel 2007 Creameater v0.0.1\n Author : chuanyi.zheng@gmail.com\n History: 2012/11/07 first created\n###\nif (window? && window.JSZip?)\n JSZip = window.JSZip\nelse if (typeof require != 'undefined' )\n JSZip = require 'jszip'\nelse\n throw (\"JSZip not defined\")\n\nif (window? && window.xmlbuilder?)\n xml = window.xmlbuilder\nelse if (typeof require != 'undefined')\n xml = require 'xmlbuilder'\nelse\n throw (\"xmlbuilder not defined\")\n\n####tool =\n# i2a : (i) ->\n# return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1)\n\ntool =\n i2a: (column) ->\n temp = undefined\n letter = ''\n while column > 0\n temp = (column - 1) % 26\n letter = String.fromCharCode(temp + 65) + letter\n column = (column - temp - 1) / 26\n return letter\n\n\nclass ContentTypes\n constructor: (@book)->\n\n toxml:()->\n types = xml.create('Types',{version:'1.0',encoding:'UTF-8',standalone:true})\n types.att('xmlns','http://schemas.openxmlformats.org/package/2006/content-types')\n types.ele('Override',{PartName:'/xl/theme/theme1.xml',ContentType:'application/vnd.openxmlformats-officedocument.theme+xml'})\n types.ele('Override',{PartName:'/xl/styles.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'})\n types.ele('Default',{Extension:'rels',ContentType:'application/vnd.openxmlformats-package.relationships+xml'})\n types.ele('Default',{Extension:'xml',ContentType:'application/xml'})\n types.ele('Override',{PartName:'/xl/workbook.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'})\n types.ele('Override',{PartName:'/docProps/app.xml',ContentType:'application/vnd.openxmlformats-officedocument.extended-properties+xml'})\n for i in [1..@book.sheets.length]\n types.ele('Override',{PartName:'/xl/worksheets/sheet'+i+'.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'})\n types.ele('Override',{PartName:'/xl/sharedStrings.xml',ContentType:'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'})\n types.ele('Override',{PartName:'/docProps/core.xml',ContentType:'application/vnd.openxmlformats-package.core-properties+xml'})\n return types.end()\n\nclass DocPropsApp\n constructor: (@book)->\n\n toxml: ()->\n props = xml.create('Properties',{version:'1.0',encoding:'UTF-8',standalone:true})\n props.att('xmlns','http://schemas.openxmlformats.org/officeDocument/2006/extended-properties')\n props.att('xmlns:vt','http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')\n props.ele('Application','Microsoft Excel')\n props.ele('DocSecurity','0')\n props.ele('ScaleCrop','false')\n tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'})\n tmp.ele('vt:variant').ele('vt:lpstr','Worksheets')\n tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length)\n tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'})\n for i in [1..@book.sheets.length]\n tmp.ele('vt:lpstr',@book.sheets[i-1].name)\n props.ele('Company')\n props.ele('LinksUpToDate','false')\n props.ele('SharedDoc','false')\n props.ele('HyperlinksChanged','false')\n props.ele('AppVersion','12.0000')\n return props.end()\n\nclass XlWorkbook\n constructor: (@book)->\n\n toxml: ()->\n wb = xml.create('workbook',{version:'1.0',encoding:'UTF-8',standalone:true})\n wb.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n wb.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n wb.ele('fileVersion ',{appName:'xl',lastEdited:'4',lowestEdited:'4',rupBuild:'4505'})\n wb.ele('workbookPr',{filterPrivacy:'1',defaultThemeVersion:'124226'})\n wb.ele('bookViews').ele('workbookView ',{xWindow:'0',yWindow:'90',windowWidth:'19200',windowHeight:'11640'})\n tmp = wb.ele('sheets')\n for i in [1..@book.sheets.length]\n tmp.ele('sheet',{name:@book.sheets[i-1].name,sheetId:''+i,'r:id':'rId'+i})\n\n\n definedNames = wb.ele('definedNames') # one entry per autofilter\n @book.sheets.forEach((sheet, idx) ->\n if (sheet.autofilter)\n definedNames.ele('definedName', {name: '_xlnm._FilterDatabase', hidden: '1', localSheetId: idx}).raw(\"'\"+sheet.name + \"'!\" + sheet.getRange())\n )\n wb.ele('calcPr',{calcId:'124519'})\n return wb.end()\n\nclass XlRels\n constructor: (@book)->\n\n toxml: ()->\n rs = xml.create('Relationships',{version:'1.0',encoding:'UTF-8',standalone:true})\n rs.att('xmlns','http://schemas.openxmlformats.org/package/2006/relationships')\n for i in [1..@book.sheets.length]\n rs.ele('Relationship',{Id:'rId'+i,Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',Target:'worksheets/sheet'+i+'.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+1),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',Target:'theme/theme1.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+2),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',Target:'styles.xml'})\n rs.ele('Relationship',{Id:'rId'+(@book.sheets.length+3),Type:'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',Target:'sharedStrings.xml'})\n return rs.end()\n\nclass SharedStrings\n constructor: ()->\n @cache = {}\n @arr = []\n\n str2id: (s)->\n id = @cache[s]\n if id\n return id\n else\n @arr.push s\n @cache[s] = @arr.length\n return @arr.length\n\n toxml: ()->\n sst = xml.create('sst',{version:'1.0',encoding:'UTF-8',standalone:true})\n sst.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n sst.att('count',''+@arr.length)\n sst.att('uniqueCount',''+@arr.length)\n for i in [0...@arr.length]\n si = sst.ele('si')\n si.ele('t',@arr[i])\n si.ele('phoneticPr',{fontId:1,type:'noConversion'})\n return sst.end()\n\nclass Sheet\n constructor: (@book, @name, @cols, @rows) ->\n @name = @name.replace(/[/*:?\\[\\]]/g,'-');\n\n\n @data = {}\n for i in [1..@rows]\n @data[i] = {}\n for j in [1..@cols]\n @data[i][j] = {v:0}\n @merges = []\n @col_wd = []\n @row_ht = {}\n @styles = {}\n \n\n set: (col, row, str) ->\n if str instanceof Date\n @set col, row, JSDateToExcel str\n # for some reason the number format doesn't apply if the fill is not also set. BUG? Mystery?\n @fill col, row,\n type: \"solid\",\n fgColor: \"FFFFFF\"\n @numberFormat col, row, 'd-mmm'\n else if typeof str == 'object'\n for key of str\n @[key] col, row, str[key]\n else if typeof str == 'string'\n if str != null and str != ''\n @data[row][col].v = @book.ss.str2id('' + str)\n return @data[row][col].dataType = 'string'\n else if typeof str == 'number'\n @data[row][col].v = str\n return @data[row][col].dataType = 'number'\n else\n @data[row][col].v = str\n return\n\n merge: (from_cell, to_cell) ->\n @merges.push({from:from_cell, to:to_cell})\n\n width: (col, wd) ->\n @col_wd.push {c:col,cw:wd}\n\n height: (row, ht) ->\n @row_ht[row] = ht\n\n font: (col, row, font_s)->\n @styles['font_'+col+'_'+row] = @book.st.font2id(font_s)\n\n fill: (col, row, fill_s)->\n @styles['fill_'+col+'_'+row] = @book.st.fill2id(fill_s)\n\n border: (col, row, bder_s)->\n @styles['bder_'+col+'_'+row] = @book.st.bder2id(bder_s)\n\n numberFormat: (col, row, numfmt_s)->\n @styles['numfmt_'+col+'_'+row] = @book.st.numfmt2id(numfmt_s)\n\n align: (col, row, align_s)->\n @styles['algn_'+col+'_'+row] = align_s\n\n valign: (col, row, valign_s)->\n @styles['valgn_'+col+'_'+row] = valign_s\n\n rotate: (col, row, textRotation)->\n @styles['rotate_'+col+'_'+row] = textRotation\n\n wrap: (col, row, wrap_s)->\n @styles['wrap_'+col+'_'+row] = wrap_s\n\n autoFilter: ( filter_s) ->\n @autofilter = if typeof filter_s == 'string' then filter_s else @getRange()\n \n style_id: (col, row) ->\n inx = '_'+col+'_'+row\n style = {numfmt_id: @styles['numfmt'+inx],font_id:@styles['font'+inx],fill_id:@styles['fill'+inx],bder_id:@styles['bder'+inx],align:@styles['algn'+inx],valign:@styles['valgn'+inx],rotate:@styles['rotate'+inx],wrap:@styles['wrap'+inx]}\n id = @book.st.style2id(style)\n return id\n\n getRange: () ->\n return '$A$1:$'+ tool.i2a(@cols)+'$'+@rows\n\n toxml: () ->\n ws = xml.create('worksheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ws.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n ws.att('xmlns:r','http://schemas.openxmlformats.org/officeDocument/2006/relationships')\n ws.ele('dimension',{ref:'A1'})\n ws.ele('sheetViews').ele('sheetView',{workbookViewId:'0'})\n ws.ele('sheetFormatPr',{defaultRowHeight:'13.5'})\n if @col_wd.length > 0\n cols = ws.ele('cols')\n for cw in @col_wd\n cols.ele('col',{min:''+cw.c,max:''+cw.c,width:cw.cw,customWidth:'1'})\n sd = ws.ele('sheetData')\n for i in [1..@rows]\n r = sd.ele('row',{r:''+i,spans:'1:'+@cols})\n ht = @row_ht[i]\n if ht\n r.att('ht',ht)\n r.att('customHeight','1')\n for j in [1..@cols]\n ix = @data[i][j]\n sid = @style_id(j, i)\n if (ix.v isnt null and ix.v isnt undefined) or (sid isnt 1)\n c = r.ele('c',{r:''+tool.i2a(j)+i})\n c.att('s',''+(sid-1)) if sid isnt 1\n if ix.dataType == 'string'\n c.att('t','s')\n c.ele('v',''+(ix.v-1))\n else if ix.dataType == 'number'\n c.ele 'v', ''+ix.v\n\n if @merges.length > 0\n mc = ws.ele('mergeCells',{count:@merges.length})\n for m in @merges\n mc.ele('mergeCell',{ref:(''+tool.i2a(m.from.col)+m.from.row+':'+tool.i2a(m.to.col)+m.to.row)})\n if typeof @autofilter == 'string'\n ws.ele('autoFilter', {ref: @autofilter})\n ws.ele('phoneticPr',{fontId:'1',type:'noConversion'})\n ws.ele('pageMargins',{left:'0.7',right:'0.7',top:'0.75',bottom:'0.75',header:'0.3',footer:'0.3'})\n ws.ele('pageSetup',{paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'})\n return ws.end()\n\nclass Style\n\n numberFormats: {\n 0: 'General'\n 1: '0'\n 2: '0.00'\n 3: '#,##0'\n 4: '#,##0.00'\n 9: '0%'\n 10: '0.00%'\n 11: '0.00E+00'\n 12: '# ?/?'\n 13: '# ??/??'\n 14: 'm/d/yy'\n 15: 'd-mmm-yy'\n 16: 'd-mmm'\n 17: 'mmm-yy'\n 18: 'h:mm AM/PM'\n 19: 'h:mm:ss AM/PM'\n 20: 'h:mm'\n 21: 'h:mm:ss'\n 22: 'm/d/yy h:mm'\n 37: '#,##0 ;(#,##0)'\n 38: '#,##0 ;[Red](#,##0)'\n 39: '#,##0.00;(#,##0.00)'\n 40: '#,##0.00;[Red](#,##0.00)'\n 45: 'mm:ss'\n 46: '[h]:mm:ss'\n 47: 'mmss.0'\n 48: '##0.0E+0'\n 49: '@'\n 56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n }\n\n\n constructor: (@book)->\n @cache = {}\n @mfonts = [] # font style\n @mfills = [] # fill style\n @mbders = [] # border style\n @mstyle = [] # cell style\n @numFmtNextId = 164\n @with_default()\n\n with_default:()->\n @def_font_id = @font2id(null)\n @def_fill_id = @fill2id(null)\n @def_bder_id = @bder2id(null)\n @def_align = '-'\n @def_valign = '-'\n @def_rotate = '-'\n @def_wrap = '-'\n @def_numfmt_id = 0\n @def_style_id = @style2id({font_id:@def_font_id,fill_id:@def_fill_id,bder_id:@def_bder_id,align:@def_align,valign:@def_valign,rotate:@def_rotate})\n\n font2id: (font)->\n font or= {}\n font.bold or= '-'\n font.iter or= '-'\n font.sz or= '11'\n font.color or= '-'\n font.name or= 'Calibri'\n font.scheme or='minor'\n font.family or= '2'\n k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family\n id = @cache[k]\n if id\n return id\n else\n @mfonts.push font\n @cache[k] = @mfonts.length\n return @mfonts.length\n\n fill2id: (fill)->\n fill or= {}\n fill.type or= 'none'\n fill.bgColor or= '-'\n fill.fgColor or= '-'\n k = 'fill_' + fill.type + fill.bgColor + fill.fgColor\n id = @cache[k]\n if id\n return id\n else\n @mfills.push fill\n @cache[k] = @mfills.length\n return @mfills.length\n\n bder2id: (bder)->\n bder or= {}\n bder.left or= '-'\n bder.right or= '-'\n bder.top or= '-'\n bder.bottom or= '-'\n k = 'bder_'+bder.left+'_'+bder.right+'_'+bder.top+'_'+bder.bottom\n id = @cache[k]\n if id\n return id\n else\n @mbders.push bder\n @cache[k] = @mbders.length\n return @mbders.length\n\n numfmt2id: (numfmt) ->\n if typeof numfmt == 'number'\n return numfmt\n else if typeof numfmt == 'string'\n for key of @numberFormats\n if @numberFormats[key] == numfmt\n return parseInt key;\n # if it's not in numberFormats, we parse the string and add it the end of numberFormats\n if ! numfmt\n throw \"Invalid format specification\"\n numfmt = numfmt\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n @numberFormats[++@numFmtNextId] = numfmt\n return @numFmtNextId\n\n style2id:(style)->\n style.align or= @def_align\n style.valign or= @def_valign\n style.rotate or= @def_rotate\n style.wrap or= @def_wrap\n style.font_id or= @def_font_id\n style.fill_id or= @def_fill_id\n style.bder_id or= @def_bder_id\n style.numfmt_id or= @def_numfmt_id\n k = 's_' + [style.font_id, style.fill_id, style.bder_id, style.align, style.valign, style.wrap, style.rotate, style.numfmt_id].join('_')\n id = @cache[k]\n if id\n return id\n else\n @mstyle.push style\n @cache[k] = @mstyle.length\n return @mstyle.length\n\n toxml: ()->\n ss = xml.create('styleSheet',{version:'1.0',encoding:'UTF-8',standalone:true})\n ss.att('xmlns','http://schemas.openxmlformats.org/spreadsheetml/2006/main')\n # add all numFmts >= 164 as \n customNumFmts = [];\n for key, fmt of @numberFormats\n if parseInt(key) >= 164\n customNumFmts.push({numFmtId:key, formatCode: fmt});\n if customNumFmts.length > 0\n numFmts = ss.ele('numFmts', {\n count: customNumFmts.length\n });\n for o in customNumFmts\n numFmts.ele('numFmt', o)\n fonts = ss.ele('fonts',{count:@mfonts.length})\n for o in @mfonts\n e = fonts.ele('font')\n e.ele('b') if o.bold isnt '-'\n e.ele('i') if o.iter isnt '-'\n e.ele('sz',{val:o.sz})\n e.ele('color',{rgb:o.color}) if o.color isnt '-'\n e.ele('name',{val:o.name})\n e.ele('family',{val:o.family})\n e.ele('charset',{val:'134'})\n e.ele('scheme',{val:'minor'}) if o.scheme isnt '-'\n fills = ss.ele('fills',{count:@mfills.length+2})\n fills.ele('fill').ele('patternFill', {patternType: 'none'})\n fills.ele('fill').ele('patternFill', {patternType: 'gray125'})\n #\n\n for o in @mfills\n e = fills.ele('fill')\n es = e.ele('patternFill',{patternType:o.type})\n es.ele('fgColor',{rgb : o.fgColor}) if o.fgColor isnt '-'\n es.ele('bgColor',{indexed:o.bgColor}) if o.bgColor isnt '-'\n bders = ss.ele('borders',{count:@mbders.length})\n for o in @mbders\n\n e = bders.ele('border')\n if o.left isnt '-' then e.ele('left',{style:o.left}).ele('color',{auto:'1'}) else e.ele('left')\n if o.right isnt '-' then e.ele('right',{style:o.right}).ele('color',{auto:'1'}) else e.ele('right')\n if o.top isnt '-' then e.ele('top',{style:o.top}).ele('color',{auto:'1'}) else e.ele('top')\n if o.bottom isnt '-' then e.ele('bottom',{style:o.bottom}).ele('color',{auto:'1'}) else e.ele('bottom')\n e.ele('diagonal')\n ss.ele('cellStyleXfs',{count:'1'}).ele('xf',{numFmtId:'0',fontId:'0',fillId:'0',borderId:'0'}).ele('alignment',{vertical:'center'})\n cs = ss.ele('cellXfs',{count:@mstyle.length})\n for o in @mstyle\n e = cs.ele('xf',{\n numFmtId: o.numfmt_id||'0',\n fontId:(o.font_id-1),\n fillId:o.fill_id+1,\n borderId:(o.bder_id-1),\n xfId:'0'\n })\n e.att('applyFont','1') if o.font_id isnt 1\n e.att('applyFill','1') if o.fill_id isnt 1\n e.att('applyNumberFormat','1') if o.numfmt_id isnt undefined\n e.att('applyBorder','1') if o.bder_id isnt 1\n if o.align isnt '-' or o.valign isnt '-' or o.wrap isnt '-'\n e.att('applyAlignment','1')\n ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)})\n ea.att('wrapText','1') if o.wrap isnt '-'\n ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'Normal',xfId:'0',builtinId:'0'})\n ss.ele('dxfs',{count:'0'})\n ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'})\n return ss.end()\n\nclass Workbook\n constructor: (@fpath, @fname) ->\n @id = ''+parseInt(Math.random()*9999999)\n # create temp folder & copy template data\n # init\n @sheets = []\n @ss = new SharedStrings\n @ct = new ContentTypes(@)\n @da = new DocPropsApp(@)\n @wb = new XlWorkbook(@)\n @re = new XlRels(@)\n @st = new Style(@)\n\n createSheet: (name, cols, rows) ->\n sheet = new Sheet(@,name,cols,rows)\n @sheets.push sheet\n return sheet\n\n save: (target, cb) ->\n if (arguments.length == 1 && typeof target == 'function')\n cb = target\n target = @fpath + '/' + @fname\n\n @generate (err, zip) ->\n buffer = undefined\n buffer = zip.generateAsync({ type: 'nodebuffer' }).then((buffer) ->\n if err\n return cb(err)\n require('fs').writeFile target, buffer, cb\n )\n\n # takes a callback function(err, zip) and returns a JSZip object on success\n generate: (cb) =>\n\n zip = new JSZip()\n\n for key of baseXl\n zip.file key, baseXl[key]\n\n # 1 - build [Content_Types].xml\n zip.file('[Content_Types].xml',@ct.toxml())\n # 2 - build docProps/app.xml\n zip.file('docProps/app.xml',@da.toxml())\n # 3 - build xl/workbook.xml\n zip.file('xl/workbook.xml',@wb.toxml())\n # 4 - build xl/sharedStrings.xml\n zip.file('xl/sharedStrings.xml',@ss.toxml())\n # 5 - build xl/_rels/workbook.xml.rels\n zip.file('xl/_rels/workbook.xml.rels',@re.toxml())\n # 6 - build xl/worksheets/sheet(1-N).xml\n for i in [0...@sheets.length]\n zip.file('xl/worksheets/sheet'+(i+1)+'.xml',@sheets[i].toxml())\n # 7 - build xl/styles.xml\n zip.file('xl/styles.xml',@st.toxml())\n cb null, zip\n\n cancel: () ->\n # delete temp folder\n console.error \"workbook.cancel() is deprecated\"\n\nJSDateToExcel = (dt) ->\n dt.valueOf() / 86400000 + 25569\n\nif (module? && module.exports?)\n module.exports =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\nif (window?)\n window.excelbuilder =\n createWorkbook: (fpath, fname)->\n return new Workbook(fpath, fname)\n\n# Base content formerly stored in /lib/tmpl but placed in code so as to avoid dependence on file system\nbaseXl =\n '_rels/.rels': ''\n 'docProps/core.xml':'Administrator2006-09-13T11:21:51Z2006-09-13T11:21:55Z'\n 'xl/theme/theme1.xml':''\n 'xl/styles.xml':''" ] } \ No newline at end of file diff --git a/package.json b/package.json index 7e8205e..89a9aa0 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "xlsx", "excel" ], - "version": "0.3.6", + "version": "0.3.7", "repository": { "type": "git", "url": "git://github.com/protobi/msexcel-builder.git" diff --git a/src/msexcel-builder.coffee b/src/msexcel-builder.coffee index 43e474e..2722d7b 100644 --- a/src/msexcel-builder.coffee +++ b/src/msexcel-builder.coffee @@ -61,7 +61,7 @@ class DocPropsApp props.ele('DocSecurity','0') props.ele('ScaleCrop','false') tmp = props.ele('HeadingPairs').ele('vt:vector',{size:2,baseType:'variant'}) - tmp.ele('vt:variant').ele('vt:lpstr','工作表') + tmp.ele('vt:variant').ele('vt:lpstr','Worksheets') tmp.ele('vt:variant').ele('vt:i4',''+@book.sheets.length) tmp = props.ele('TitlesOfParts').ele('vt:vector',{size:@book.sheets.length,baseType:'lpstr'}) for i in [1..@book.sheets.length] @@ -319,7 +319,7 @@ class Style font.iter or= '-' font.sz or= '11' font.color or= '-' - font.name or= '宋体' + font.name or= 'Calibri' font.scheme or='minor' font.family or= '2' k = 'font_'+font.bold+font.iter+font.sz+font.color+font.name+font.scheme+font.family @@ -458,7 +458,7 @@ class Style e.att('applyAlignment','1') ea = e.ele('alignment',{textRotation:(if o.rotate is '-' then '0' else o.rotate),horizontal:(if o.align is '-' then 'left' else o.align), vertical:(if o.valign is '-' then 'top' else o.valign)}) ea.att('wrapText','1') if o.wrap isnt '-' - ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'常规',xfId:'0',builtinId:'0'}) + ss.ele('cellStyles',{count:'1'}).ele('cellStyle',{name:'Normal',xfId:'0',builtinId:'0'}) ss.ele('dxfs',{count:'0'}) ss.ele('tableStyles',{count:'0',defaultTableStyle:'TableStyleMedium9',defaultPivotStyle:'PivotStyleLight16'}) return ss.end()