diff --git a/lib/msexcel-builder.js b/lib/msexcel-builder.js index 1a202a1..69388e7 100644 --- a/lib/msexcel-builder.js +++ b/lib/msexcel-builder.js @@ -123,7 +123,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, @@ -543,6 +543,7 @@ this.mfills = []; // fill style this.mbders = []; // border style this.mstyle = []; // cell style + this.numFmtNextId = 164; this.with_default(); } @@ -554,6 +555,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, @@ -571,7 +573,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; @@ -627,12 +629,15 @@ } else if (typeof numfmt === 'string') { for (key in this.numberFormats) { if (this.numberFormats[key] === numfmt) { - return key; - } else { - this.numberFormats; + return parseInt(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[++this.numFmtNextId] = numfmt; + return this.numFmtNextId; } } @@ -645,7 +650,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 = 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; @@ -657,19 +663,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'); @@ -709,10 +736,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 @@ -731,9 +758,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', { @@ -786,9 +813,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, @@ -823,7 +850,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 2ef2061..d79cd2d 100644 --- a/lib/msexcel-builder.js.map +++ b/lib/msexcel-builder.js.map @@ -6,8 +6,8 @@ "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,EAAA,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;;;EAKL,IAAI,kDAAA,IAAW,2BAAf;IACE,EAAA,GAAK,MAAM,CAAC,WADd;GAAA,MAEK,IAAI,OAAO,OAAP,KAAkB,WAAtB;IACH,EAAA,GAAK,OAAA,CAAQ,IAAR,EADF;GAjBF;;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4C,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;GAziBG;;;EA+iBH,MAAA,GACE;IAAA,aAAA,EAAe,4kBAAf;IACA,mBAAA,EAAoB,8lBADpB;IAEA,qBAAA,EAAsB,4wNAFtB;IAGA,eAAA,EAAgB;EAHhB;AAhjBC", "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\nif (window? && window.xmlbuilder?)\n fs = window.xmlbuilder\nelse if (typeof require != 'undefined')\n fs = require 'fs'\n\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 _sheetViews: {\n workbookViewId: '0'\n }\n\n\n _pageSetup: {paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'}\n\n sheetViews: (obj) ->\n for key, val of obj\n @_sheetViews[key] = val\n\n\n pageSetup : (obj) ->\n for key, val of obj\n @_pageSetup[key] = val\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',@_sheetViews)\n\n\n\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',@_pageSetup)\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 else\n @numberFormats\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 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###\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\nif (window? && window.xmlbuilder?)\n fs = window.xmlbuilder\nelse if (typeof require != 'undefined')\n fs = require 'fs'\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 _sheetViews: {\n workbookViewId: '0'\n }\n\n\n _pageSetup: {paperSize:'9',orientation:'portrait',horizontalDpi:'200',verticalDpi:'200'}\n\n sheetViews: (obj) ->\n for key, val of obj\n @_sheetViews[key] = val\n\n\n pageSetup : (obj) ->\n for key, val of obj\n @_pageSetup[key] = val\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',@_sheetViews)\n\n\n\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',@_pageSetup)\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 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 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 deleted file mode 100644 index 7f21f1a..0000000 --- a/package-lock.json +++ /dev/null @@ -1,916 +0,0 @@ -{ - "name": "msexcel-builder", - "version": "0.3.3", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "abab": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.4.tgz", - "integrity": "sha512-Eu9ELJWCz/c1e9gTiCY+FceWxcqzjYEbqMgtndnuSqZSUCOL73TWNK2mHfIj4Cw2E/ongOp+JISVNCmovt2KYQ==", - "dev": true - }, - "acorn": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", - "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", - "dev": true - }, - "acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, - "requires": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - } - }, - "acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true - }, - "ajv": { - "version": "6.12.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", - "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "async": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "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=", - "dev": true - }, - "cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true - }, - "cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", - "dev": true, - "requires": { - "cssom": "~0.3.6" - }, - "dependencies": { - "cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - } - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", - "dev": true, - "requires": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" - } - }, - "decimal.js": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.0.tgz", - "integrity": "sha512-vDPw+rDgn3bZe1+F/pyEwb1oMG2XTlRVgAa6B4KccTEpYgF8w6eQllVbQcfIJnZyvzFtFpxnpGtx8dd7DJp/Rw==", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", - "dev": true, - "requires": { - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true - } - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "dev": true, - "requires": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "dev": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", - "dev": true, - "requires": { - "whatwg-encoding": "^1.0.5" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", - "dev": true - }, - "is-potential-custom-element-name": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz", - "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "jquery": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", - "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==", - "dev": true - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsdom": { - "version": "16.4.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.4.0.tgz", - "integrity": "sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w==", - "dev": true, - "requires": { - "abab": "^2.0.3", - "acorn": "^7.1.1", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", - "cssstyle": "^2.2.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.0", - "domexception": "^2.0.1", - "escodegen": "^1.14.1", - "html-encoding-sniffer": "^2.0.1", - "is-potential-custom-element-name": "^1.0.0", - "nwsapi": "^2.2.0", - "parse5": "5.1.1", - "request": "^2.88.2", - "request-promise-native": "^1.0.8", - "saxes": "^5.0.0", - "symbol-tree": "^3.2.4", - "tough-cookie": "^3.0.1", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0", - "ws": "^7.2.3", - "xml-name-validator": "^3.0.0" - } - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "jszip": { - "version": "3.1.2", - "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.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=" - } - } - } - } - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", - "dev": true - }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, - "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", - "dev": true - }, - "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "dev": true, - "requires": { - "mime-db": "1.44.0" - } - }, - "nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", - "dev": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - } - } - }, - "request-promise-core": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", - "dev": true, - "requires": { - "lodash": "^4.17.19" - } - }, - "request-promise-native": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "dev": true, - "requires": { - "request-promise-core": "1.1.4", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, - "dependencies": { - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - } - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", - "dev": true, - "requires": { - "xmlchars": "^2.2.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true - }, - "symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "tough-cookie": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", - "dev": true, - "requires": { - "ip-regex": "^2.1.0", - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tr46": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz", - "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==", - "dev": true, - "requires": { - "punycode": "^2.1.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, - "requires": { - "browser-process-hrtime": "^1.0.0" - } - }, - "w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", - "dev": true, - "requires": { - "xml-name-validator": "^3.0.0" - } - }, - "webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true - }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.24" - } - }, - "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true - }, - "whatwg-url": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.1.0.tgz", - "integrity": "sha512-vEIkwNi9Hqt4TV9RdnaBPNt+E2Sgmo3gePebCRgZ1R7g6d23+53zCTnuB0amKI4AXq6VM8jj2DUAa0S1vjJxkw==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^2.0.2", - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true - } - } - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, - "ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", - "dev": true - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "xmlbuilder": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz", - "integrity": "sha1-UZy0ymhtAFqEINNJbz8MruzKWA8=" - }, - "xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - } - } -} diff --git a/package.json b/package.json index 3d5851e..c34e5bb 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ "xlsx", "excel" ], - "version": "0.3.4", + "version": "0.3.8", "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": { @@ -29,5 +29,9 @@ "devDependencies": { "jquery": "^3.5.1", "jsdom": "^16.4.0" + }, + "browser": { + "fs": false, + "path": false } } diff --git a/src/msexcel-builder.coffee b/src/msexcel-builder.coffee index 45ed739..e9ad31f 100644 --- a/src/msexcel-builder.coffee +++ b/src/msexcel-builder.coffee @@ -3,6 +3,7 @@ Author : chuanyi.zheng@gmail.com History: 2012/11/07 first created ### + if (window? && window.JSZip?) JSZip = window.JSZip else if (typeof require != 'undefined' ) @@ -22,7 +23,6 @@ if (window? && window.xmlbuilder?) else if (typeof require != 'undefined') fs = require 'fs' - ####tool = # i2a : (i) -> # return 'ABCDEFGHIJKLMNOPQ###RSTUVWXYZ123'.charAt(i-1) @@ -67,7 +67,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] @@ -317,13 +317,13 @@ class Style 56: '"上午/下午 "hh"時"mm"分"ss"秒 "' } - constructor: (@book)-> @cache = {} @mfonts = [] # font style @mfills = [] # fill style @mbders = [] # border style @mstyle = [] # cell style + @numFmtNextId = 164 @with_default() with_default:()-> @@ -334,6 +334,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)-> @@ -342,7 +343,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 @@ -353,7 +354,7 @@ class Style @mfonts.push font @cache[k] = @mfonts.length return @mfonts.length - + fill2id: (fill)-> fill or= {} fill.type or= 'none' @@ -389,11 +390,17 @@ class Style else if typeof numfmt == 'string' for key of @numberFormats if @numberFormats[key] == numfmt - return key; - else - @numberFormats - - throw "Number format "+numfmt + " not found. Custom number formats not implemented yet" + 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" + numfmt = numfmt + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + @numberFormats[++@numFmtNextId] = numfmt + return @numFmtNextId style2id:(style)-> style.align or= @def_align @@ -403,7 +410,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= @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 @@ -415,6 +423,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') @@ -448,7 +467,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 @@ -457,7 +482,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() diff --git a/test/out/example3.xlsx b/test/out/example3.xlsx index 050358b..022fe72 100644 Binary files a/test/out/example3.xlsx and b/test/out/example3.xlsx differ