@sapui5/sap.ui.export 1.141.2 → 1.142.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +2 -2
- package/src/sap/ui/export/.library +1 -1
- package/src/sap/ui/export/CommaSeparatedValues.js +188 -0
- package/src/sap/ui/export/ExportBase.js +1 -1
- package/src/sap/ui/export/ExportHandler.js +1 -1
- package/src/sap/ui/export/ExportUtils.js +2 -2
- package/src/sap/ui/export/PortableDocument.js +1 -1
- package/src/sap/ui/export/Spreadsheet.js +2 -2
- package/src/sap/ui/export/SpreadsheetExport.js +59 -48
- package/src/sap/ui/export/js/CSVBuilder.js +201 -0
- package/src/sap/ui/export/js/SpreadsheetWorker.js +4 -0
- package/src/sap/ui/export/js/XLSXBuilder.js +1 -1
- package/src/sap/ui/export/js/XLSXBuilder.js.map +1 -1
- package/src/sap/ui/export/library.js +5 -5
- package/src/sap/ui/export/provider/DataProviderBase.js +1 -1
- package/src/sap/ui/export/util/Filter.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XLSXBuilder.js","mappings":"2CAAA,IAAIA,EAAS,EAAQ,KACpBC,EAAe,EAAQ,KACvBC,EAAS,EAAQ,KACjBC,EAAgB,EAAQ,KACxBC,EAAU,EAAQ,KAClBC,EAAY,EAAQ,KACpBC,EAAe,EAAQ,KA4BxB,SAASC,EAAYC,EAAUC,EAAUC,EAAgBC,GACxD,IAAIC,EAAiBC,EAAGC,EAAgBC,EAAYC,EAEpD,KAAMR,aAAoBS,OAAWT,EAASU,QAC7C,MAAM,IAAIC,MAAM,uBAwBjB,GApBAJ,EAAa,sBACbC,EAAqB,WAErBI,KAAKC,IAAM,IAAID,KAAKE,QAAQtB,IAAIS,GAChCW,KAAKG,KAAO,IAAIH,KAAKE,QAAQpB,KAAKO,GAClCW,KAAKI,SAAW,IAAIJ,KAAKE,QAAQjB,SAE7BM,GACHL,EAAYmB,OAAOd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iB,UAAY,WAC7B,IAAIwgB,GAAehjB,KAAKmW,KAAO7C,EAAQqP,sBAAwB,IAAM,IAAM3iB,KAAKiU,IAGhF,IAAK,IAAIxU,EAAI,EAAGA,EAAIO,KAAKkU,WAAWpU,OAAQL,IAC3CujB,GAAehjB,KAAKkU,WAAWzU,GAAG+C,YAGnC,MAAMygB,EAAqBjjB,KAAKkjB,uBAYhC,OAVID,GACHD,GAAe,IAAMA,GAAapN,OAAO,GACzCoN,GAAe,IAAIC,MAAuBjjB,KAAKiU,SAI/C+O,GAAe,KACfA,GAAe,IAAMA,GAAapN,OAAO,IAGnCoN,CACR,EAQA1P,EAAQ/R,UAAU2hB,qBAAuB,WACxC,IAAIF,EAAc,GAElB,IAAK,IAAIvjB,EAAI,EAAGA,EAAIO,KAAKgV,OAAOlV,OAAQL,IACvCujB,GAAyC,iBAAnBhjB,KAAKgV,OAAOvV,GAAkBO,KAAKgV,OAAOvV,GAAKO,KAAKgV,OAAOvV,GAAG+C,YAKrF,OAFAwgB,GAAehjB,KAAKkiB,UAAUliB,KAAKmG,OAE5B6c,CACR,EAEAzf,EAAOC,QAAU8P,C,GCxLb6P,EAA2B,CAAC,ECE5BC,EDCJ,SAASC,EAAoBC,GAE5B,IAAIC,EAAeJ,EAAyBG,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAa/f,QAGrB,IAAID,EAAS4f,EAAyBG,GAAY,CAGjD9f,QAAS,CAAC,GAOX,OAHAigB,EAAoBH,GAAU/f,EAAQA,EAAOC,QAAS6f,GAG/C9f,EAAOC,OACf,CCnB0B6f,CAAoB,K","sources":["webpack://sap.ui.export-xlsx-builder/./xlsx/src/XLSXBuilder.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/Column.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/ColumnConfiguration.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/Customizing.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/BigNumber.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/BooleanType.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/CalendarBase.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/CalendarDate.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/CalendarDateTime.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/CalendarTime.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Currency.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Enumeration.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Numeric.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Text.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Timezone.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Type.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/Cell.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/Row.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/SharedString.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/SharedStrings.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/Sheet.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/App.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/ContentTypes.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/Core.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/ReferenceNode.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/Relationships.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/Workbook.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Alignment.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Border.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Fill.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Font.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/NumberFormat.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Style.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Styles.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/xml/XMLAttribute.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/xml/XMLElement.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/xml/XMLFile.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/xml/XMLNode.js","webpack://sap.ui.export-xlsx-builder/webpack/bootstrap","webpack://sap.ui.export-xlsx-builder/webpack/startup"],"sourcesContent":["var App\t\t\t\t= require(\"./objects/App\"),\r\n\tContentTypes\t= require(\"./objects/ContentTypes\"),\r\n\tCore\t\t\t= require(\"./objects/Core\"),\r\n\tRelationships\t= require(\"./objects/Relationships\"),\r\n\tSheet\t\t\t= require(\"./data/Sheet\"),\r\n\tWorkbook\t\t= require(\"./objects/Workbook\"),\r\n\tCustomizing\t\t= require(\"./binding/Customizing\");\r\n\r\n/* global JSZip3 */\r\n\r\n/**\r\n * The XLSXBuilder class represents an Office Open XML Spreadsheet\r\n * (Microsoft Excel) that can be used to insert structured and\r\n * formatted data and pack a zipped *.xlsx document.\r\n *\r\n * XLSXBuilder requires JSZip 3.x to be present.\r\n *\r\n * @param {Object[]|string[]} aBinding Binding configuration that is used for {@link Column} definition\r\n * @param {Object} [oContext] Context object containing metadata for this particular XLSX\r\n * @param {string} [oContext.application] Application that created this XLSX\r\n * @param {string} [oContext.version] Application version that was used to create this XLSX\r\n * @param {string} [oContext.title] Title of the XLSX document\r\n * @param {string} [oContext.modifiedBy] User context for the exported document\r\n * @param {string} [oContext.sheetName] The name of the data sheet that will be shown in Excel\r\n * @param {string} [oContext.metaSheetName] The name of the metadata sheet that will be shown in Excel\r\n * @param {Object[]} [oContext.metainfo] Optional Metadata that will be displayed in the additional Metadata Sheet\r\n * @param {string} [hierarchyLevel] Name of the property that contains the hierarchy level of each lime item\r\n * @param {Object} [mCustomizing] An object containing all customizing related information\r\n * @param {Object} [mCustomizing.currency] Custom configuration object that can be used for {@link Customizing} digits\r\n * @param {Object} [mCustomizing.unit] Custom configuration object that can be used for {@link Customizing} digits\r\n * @param {Object} [mCustomizing.timezone] Custom configuration object used for timezone localization\r\n *\r\n * @constructor\r\n */\r\nfunction XLSXBuilder(aBinding, oContext, hierarchyLevel, mCustomizing) {\r\n\tvar aMetadataConfig, i, oMetainfoGroup, sSheetName, sMetadataSheetName;\r\n\r\n\tif (!(aBinding instanceof Array) || !aBinding.length) {\r\n\t\tthrow new Error(\"No binding provided\");\r\n\t}\r\n\r\n\t/* Set default values */\r\n\tsSheetName = \"SAP Document Export\";\r\n\tsMetadataSheetName = \"Metadata\";\r\n\r\n\tthis.app = new this.objects.App(oContext);\r\n\tthis.core = new this.objects.Core(oContext);\r\n\tthis.workbook = new this.objects.Workbook();\r\n\r\n\tif (mCustomizing) {\r\n\t\tCustomizing.update(mCustomizing);\r\n\t}\r\n\r\n\t/* Overwrite default Sheet names if maintained */\r\n\tif (oContext) {\r\n\t\tsSheetName = oContext.sheetName ? oContext.sheetName : sSheetName;\r\n\t\tsMetadataSheetName = oContext.metaSheetName ? oContext.metaSheetName : sMetadataSheetName;\r\n\t}\r\n\r\n\tthis.sheet = this.workbook.addSheet(sSheetName, { columns: aBinding, hierarchyLevel: hierarchyLevel });\r\n\tthis.workbook.selectSheet(this.sheet);\r\n\r\n\tif (typeof oContext === \"object\" && oContext.metainfo instanceof Array) {\r\n\r\n\t\t/* Define column configuration for metadata sheet */\r\n\t\taMetadataConfig = [\r\n\t\t\t{\r\n\t\t\t\tproperty: \"key\",\r\n\t\t\t\tlabel: \"Key\",\r\n\t\t\t\twidth: 20\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tproperty: \"value\",\r\n\t\t\t\tlabel: \"Value\",\r\n\t\t\t\twidth: 20\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\t/* Add optional Metadata Sheet*/\r\n\t\tthis.metadata = this.workbook.addSheet(sMetadataSheetName, { columns: aMetadataConfig, hideHeader: true });\r\n\r\n\t\t/*\r\n\t\t * Add a copy of metadata to the Metadata Sheet. The method\r\n\t\t * #_insertIntoSheet uses Array#shift and would otherwise\r\n\t\t * manipulate the original metadata array.\r\n\t\t */\r\n\t\tfor (i = 0; i < oContext.metainfo.length; i++) {\r\n\t\t\toMetainfoGroup = oContext.metainfo[i];\r\n\r\n\t\t\tthis.metadata.createGroup(oMetainfoGroup.name, 1);\r\n\t\t\tthis._insertIntoSheet(oMetainfoGroup.items.slice(), this.metadata);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nXLSXBuilder.prototype = {\r\n\r\n\tobjects: {\r\n\t\tApp: App,\r\n\t\tContentTypes: ContentTypes,\r\n\t\tCore: Core,\r\n\t\tRelationships: Relationships,\r\n\t\tSheet: Sheet,\r\n\t\tWorkbook: Workbook\r\n\t},\r\n\r\n\t/**\r\n\t * Triggers the packaging process for the Office Open XML\r\n\t * SpreadSheet. You need to call the method insert() first,\r\n\t * otherwise the generated Document will contain no data.\r\n\t *\r\n\t * The method returns a Promise to allow the library to work\r\n\t * asynchronously.\r\n\t *\r\n\t * @function build\r\n\t * @returns {Promise} Promise that represents a packed zip file as Blob or Nodebuffer\r\n\t */\r\n\tbuild: function() {\r\n\t\tvar bFinalize, files, zip, i, j, fileConfig, FileType, xmlObject, relation, zipConfig;\r\n\r\n\t\tfiles = [\r\n\t\t\t{\r\n\t\t\t\tname: \"[Content_Types].xml\",\r\n\t\t\t\tpath: \"\",\r\n\t\t\t\ttype: this.objects.ContentTypes\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \".rels\",\r\n\t\t\t\tpath: \"_rels/\",\r\n\t\t\t\ttype: this.objects.Relationships,\r\n\t\t\t\trelationships: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttarget: \"xl/workbook.xml\",\r\n\t\t\t\t\t\ttype: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttarget: \"docProps/app.xml\",\r\n\t\t\t\t\t\ttype: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttarget: \"docProps/core.xml\",\r\n\t\t\t\t\t\ttype: \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\"\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\tzip = new JSZip3();\r\n\t\tbFinalize = true;\r\n\r\n\t\tfor (i = 0; i < files.length; i++) {\r\n\t\t\tfileConfig = files[i];\r\n\t\t\tFileType = fileConfig.type;\r\n\t\t\txmlObject = new FileType();\r\n\r\n\t\t\tif (xmlObject instanceof this.objects.Relationships) {\r\n\t\t\t\tfor (j = 0; j < fileConfig.relationships.length; j++) {\r\n\t\t\t\t\trelation = fileConfig.relationships[j];\r\n\t\t\t\t\txmlObject.addRelationship(relation.target, relation.type);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tzip.file(fileConfig.path + fileConfig.name, xmlObject.serialize());\r\n\t\t}\r\n\r\n\t\t// Add document metadata\r\n\t\tzip.file(this.app.getAbsolutePath(), this.app.serialize());\r\n\t\tzip.file(this.core.getAbsolutePath(), this.core.serialize());\r\n\r\n\t\t// Add workbook and its related files\r\n\t\tzip.file(this.workbook.getAbsolutePath(), this.workbook.serialize());\r\n\t\tzip.file(this.workbook.getRelationships().getAbsolutePath(), this.workbook.getRelationships().serialize());\r\n\r\n\t\tthis.workbook.getRelatedFiles().forEach(function(file) {\r\n\t\t\tzip.file(file.getAbsolutePath(), file.serialize(bFinalize));\r\n\t\t});\r\n\r\n\t\tzipConfig = {\r\n\t\t\tcompression: \"DEFLATE\",\r\n\t\t\ttype: JSZip3.support.nodebuffer ? \"nodebuffer\" : \"arraybuffer\"\r\n\t\t};\r\n\r\n\t\treturn zip.generateAsync(zipConfig);\r\n\t},\r\n\r\n\t/**\r\n\t * Appends the specified set of data to the Open Document Spreadsheet.\r\n\t * All data will be bound according to the {@link ColumnConfiguration}.\r\n\t *\r\n\t * @function append\r\n\t * @param {(Object[]|Object)} aData - Array of data that gets appended to the Spreadsheet\r\n\t */\r\n\tappend: function(aData) {\r\n\t\tthis._insertIntoSheet(aData, this.sheet);\r\n\t},\r\n\r\n\t/**\r\n\t * Inserts the given data into the specified Sheet. The method will throw an Error if no Sheet is provided.\r\n\t *\r\n\t * @param {Array} aData - Array of business objects that should be inserted\r\n\t * @param {Sheet} oSheet - The Sheet where the data should be inserted into\r\n\t * @private\r\n\t */\r\n\t_insertIntoSheet: function(aData, oSheet) {\r\n\t\tvar array;\r\n\r\n\t\t/* We need to check if param is null or undefined because [null].length results in 1 */\r\n\t\tif (typeof aData === \"undefined\" || aData === null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tarray = aData instanceof Array ? aData : [aData];\r\n\r\n\t\twhile (array.length) {\r\n\t\t\toSheet.insert(array.shift());\r\n\t\t}\r\n\t}\r\n};\r\n\r\nmodule.exports = XLSXBuilder;","var BigNumber\t \t\t= require(\"./type/BigNumber\"),\r\n\tBooleanType \t\t= require(\"./type/BooleanType\"),\r\n\tCalendarTime \t\t= require(\"./type/CalendarTime\"),\r\n\tCalendarDate \t\t= require(\"./type/CalendarDate\"),\r\n\tCalendarDateTime\t= require(\"./type/CalendarDateTime\"),\r\n\tCell\t\t\t\t= require(\"../data/Cell\"),\r\n\tCurrency \t\t\t= require(\"./type/Currency\"),\r\n\tCustomizing \t\t= require(\"./Customizing\"),\r\n\tEnumeration \t\t= require(\"./type/Enumeration\"),\r\n\tNumeric \t\t\t= require(\"./type/Numeric\"),\r\n\tText\t\t \t\t= require(\"./type/Text\"),\r\n\tTimezone\t\t \t= require(\"./type/Timezone\");\r\n\r\n/**\r\n * The Column class represents the field type of columns. It handles\r\n * styling, data types and data binding.\r\n *\r\n * @param {(Object|string)} oData Data object representing the Column configuration\r\n * @param {string} oData.property References the data object property that is bound as value for this column\r\n * @param {string} [oData.textAlign] Optional alignment\r\n * @param {string} [oData.label] Optional column label that will be shown in the header row\r\n * @param {string} [oData.type] Optional data type for this column. Default: Column.Type.Text\r\n * @param {string} [oData.width] Optional width of the column\r\n * @param {SharedStrings} oSharedStrings SharedStrings instance that will be used by all Cells\r\n * @param {Styles} oStyles Styles collection that is needed to register each Style a Column uses\r\n * @class\r\n * @module binding/Column\r\n */\r\nfunction Column(oData, oSharedStrings, oStyles) {\r\n\tvar oColumnData;\r\n\r\n\t/* Fallback assignment if only a key is provided */\r\n\toColumnData = typeof oData === \"string\" ? {property: oData} : oData;\r\n\tif (!oColumnData || (typeof oColumnData.property !== \"string\" && !Array.isArray(oColumnData.property))) {\r\n\t\tthrow new Error(\"The property for the column is not defined\");\r\n\t}\r\n\r\n\tthis.property = oColumnData.property;\r\n\tthis.label = oColumnData.label ? oColumnData.label : oColumnData.property;\r\n\tthis.width = oColumnData.width;\r\n\tthis.styles = oStyles;\r\n\tthis.type = this._initType(oColumnData);\r\n\tthis.cell = new Cell(this.type, oSharedStrings);\r\n}\r\n\r\n/**\r\n * Initializes the data type for this Column. Type specific\r\n * formatting information will be evaluated and applied.\r\n *\r\n * @param {Object} oData Configuration object for this Column that also contains type and formatting information\r\n * @param {string} oData.type Specifies the data type\r\n * @param {boolean} [oData.autoScale] Specifies if the scale customizing is being used\r\n * @param {string} [oData.calendar] Specifies the calendar if type is date, datetime or time\r\n * @param {boolean} [oData.delimiter] Specifies if a thousands delimiter is shown\r\n * @param {boolean} [oData.displayTimezone] Specifies if the IANA timezone will be visible in the cell\r\n * @param {boolean} [oData.displayUnit] Specifies if the UoM will be shown or not if type is number or currency\r\n * @param {string} [oData.falseValue] Specifies the displayed value if the boolean type has the value false\r\n * @param {string} [oData.format] Specifies a custom format if type is date, datetime or time\r\n * @param {string} [oData.hierarchyLevel] Specifies the name of the property that contains the hierarchy level\r\n * @param {string} [oData.inputFormat] Specifies the input format of a string based date\r\n * @param {number} [oData.scale] Specifies the decimal scale\r\n * @param {string} [oData.template] Specifies a template string that can be filled with several properties\r\n * @param {string} [oData.textAlign] Defines the horizontal alignment\r\n * @param {string} [oData.timezone] Specific timezone that will be applied to the Column\r\n * @param {string} [oData.timezoneProperty] Property name that references the timezone\r\n * @param {string} [oData.trueValue] Specifies the displayed value if the boolean type has the value true\r\n * @param {string} [oData.unit] Specifies the UoM if type is number\r\n * @param {string} [oData.unitProperty] Name of the property that contains the UoM if type is number or currency\r\n * @param {Object} [oData.valueMap] Contains a JS object or Map with key value pairs\r\n *\r\n * @returns {Type} - Returns the specific Type object that contains all the formatting\r\n * @private\r\n */\r\n// eslint-disable-next-line complexity\r\nColumn.prototype._initType = function(oData) {\r\n\tvar oType, sType;\r\n\r\n\tsType = typeof oData.type === \"string\" ? oData.type.toLowerCase() : oData.type;\r\n\r\n\tswitch (sType) {\r\n\t\tcase \"datetime\":\r\n\r\n\t\t\t/* Add translated timezone to column header of type datetime if fixed timezone is used */\r\n\t\t\tif (oData.timezone && typeof oData.timezone === \"string\" && !oData.timezoneProperty) {\r\n\t\t\t\tthis.label += ` (${Customizing.getTimezoneTranslation(oData.timezone)})`;\r\n\t\t\t}\r\n\t\t\toType = new CalendarDateTime(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"date\":\r\n\t\t\toType = new CalendarDate(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"time\":\r\n\t\t\toType = new CalendarTime(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"timezone\":\r\n\t\t\toType = new Timezone(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"percentage\":\r\n\t\tcase \"number\":\r\n\t\t\toType = new Numeric(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"currency\":\r\n\t\t\toType = new Currency(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\t\toType = new BooleanType(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"enumeration\":\r\n\t\t\toType = new Enumeration(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"bignumber\":\r\n\t\t\toType = new BigNumber(oData);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\toData.type = \"text\";\r\n\r\n\t\t\toType = new Text(oData);\r\n\t}\r\n\r\n\toType.registerAt(this.styles);\r\n\r\n\treturn oType;\r\n};\r\n\r\n/**\r\n * Returns the Cell object that is referenced by this particular\r\n * Column. Every Column references only one single Cell that gets\r\n * reused for each and every Row.\r\n *\r\n * When binding the actual data to a row, the Cell content, its\r\n * references and its styling get updated and a serialized version\r\n * of the row is stored within the sheet.\r\n *\r\n * @returns {Cell} - The Cell that belongs to this particular Column\r\n */\r\nColumn.prototype.getCell = function() {\r\n\treturn this.cell;\r\n};\r\n\r\n/**\r\n * This method binds the actual business object property to the columns cell.\r\n *\r\n * @param {object} oData - Business object that gets bound to the Cell of this Column.\r\n */\r\nColumn.prototype.bind = function(oData) {\r\n\r\n\t/*\r\n\t * Due to the fact that Cell#setValue updates the Style depending\r\n\t * on the actual Cell value (i.E. Unit of Measurement for\r\n\t * Currencies), we need to provide the original business object\r\n\t * so that the Cell knows the whole business object instead of\r\n\t * just the value of its particular property.\r\n\t */\r\n\ttry {\r\n\t\tthis.cell.setValue(this.property, oData);\r\n\t} catch (oError) {\r\n\r\n\t\t// Enhance error message with column and line item information\r\n\t\toError.message = (oError.message ? oError.message + \"\\n\\n\" : \"\") + \"Column: \" + this.label;\r\n\t\toError.message += \"\\nData: \" + JSON.stringify(oData);\r\n\r\n\t\tthrow oError;\r\n\t}\r\n};\r\n\r\nmodule.exports = Column;","var Column\t= require(\"./Column\"),\r\n\tText\t= require(\"./type/Text\"),\r\n\tRow\t\t= require(\"../data/Row\"),\r\n\tCell\t= require(\"../data/Cell\");\r\n\r\n/**\r\n * ColumnConfiguration represents the configuration of all columns within\r\n * one Sheet. The ColumnConfiguration handles the mapping of object\r\n * properties to certain columns,, labeling, type definition and also\r\n * display information like width and alignment.\r\n *\r\n * @param {Object} oConfig - An configuration object that contains all necessary column definitions\r\n * @param {Object} oConfig.columns - An array of Column definitions. {@see Column} for further details\r\n * @param {string} [oConfig.hierarchyLevel] - Name of the property that holds the hierarchy level\r\n * @param {boolean} [oConfig.hideHeader] - Flag that allows to hide the header row\r\n * @param {SharedStrings} oSharedStrings - SharedStrings instance that will be used by all Cells\r\n * @param {Styles} oStyles - Style collection that is used to register Cell or row specific styles\r\n * @module binding/ColumnBinding\r\n * @constructor\r\n */\r\nfunction ColumnConfiguration(oConfig, oSharedStrings, oStyles) {\r\n\tvar aColumns, oColumn, i;\r\n\r\n\tthis.columns = [];\r\n\tthis._row = null;\r\n\tthis.styles = oStyles;\r\n\tthis.sharedStrings = oSharedStrings;\r\n\tthis.hideHeader = oConfig.hideHeader;\r\n\r\n\tObject.defineProperty(this, \"hierarchyLevelProperty\", { value: oConfig.hierarchyLevel });\r\n\r\n\taColumns = oConfig.columns;\r\n\r\n\tfor (i = 0; i < aColumns.length; i++) {\r\n\r\n\t\t/* As specified, the hierarchy level indentation will only be applied on the first row */\r\n\t\tif (i == 0) {\r\n\t\t\tif (typeof aColumns[i] === \"string\") {\r\n\t\t\t\taColumns[i] = { property: aColumns[i] };\r\n\t\t\t}\r\n\r\n\t\t\taColumns[i].hierarchyLevel = this.hierarchyLevelProperty;\r\n\t\t}\r\n\r\n\t\toColumn = aColumns[i] instanceof Column ?\r\n\t\t\taColumns[i] : new Column(aColumns[i], this.sharedStrings, this.styles);\r\n\r\n\t\tthis.columns.push(oColumn);\r\n\t}\r\n}\r\n\r\n/**\r\n * Initializes the objects that are necessary for the binding. This\r\n * components are:\r\n * - a template Row\r\n * - a Cell for each Column\r\n * - a Style for each data type referenced by each Column\r\n *\r\n * @private\r\n */\r\nColumnConfiguration.prototype._initBinding = function() {\r\n\tvar i;\r\n\r\n\tthis._row = new Row();\r\n\r\n\tfor (i = 0; i < this.columns.length; i++) {\r\n\t\tthis._row.addCell(this.columns[i].getCell());\r\n\t}\r\n};\r\n\r\n/**\r\n * Creates an new Row and binds the provided data to the Row Cells according to the current ColumnConfiguration.\r\n *\r\n * @param {Object} oData - The data object that has to be bound to the row\r\n * @param {number} nHierarchyLevel - Hierarchy level that will be used for indent and outline\r\n * @returns {Row} - Returns the created Row that contains the provided data\r\n */\r\nColumnConfiguration.prototype.bind = function(oData, nHierarchyLevel) {\r\n\tvar i, normalizedHierarchyLevel;\r\n\r\n\tif (this._row === null) {\r\n\t\tthis._initBinding();\r\n\t}\r\n\r\n\t/* Normalise hierarchy depth to not exceed the maximum depth of 7 */\r\n\tnormalizedHierarchyLevel = Math.min(nHierarchyLevel, 7);\r\n\r\n\t/*\r\n\t * We need to add, update or delete the outline attribute because\r\n\t * we reuse the row object\r\n\t */\r\n\tif (normalizedHierarchyLevel && !this._row.outline) {\r\n\t\tthis._row.addAttribute({\r\n\t\t\tid: \"outline\",\r\n\t\t\tname: \"outlineLevel\",\r\n\t\t\tvalue: normalizedHierarchyLevel\r\n\t\t});\r\n\t} else if (normalizedHierarchyLevel && this._row.outline) {\r\n\t\tthis._row.outline.value = normalizedHierarchyLevel;\r\n\t} else if (!normalizedHierarchyLevel && this._row.outline) {\r\n\t\tthis._row.remove(\"outline\");\r\n\t}\r\n\r\n\tfor (i = 0; i < this.columns.length; i++) {\r\n\t\tthis.columns[i].bind(oData);\r\n\t}\r\n\r\n\treturn this._row;\r\n};\r\n\r\n/**\r\n * Creates the header Row according to the current ColumnConfiguration and returns it.\r\n *\r\n * @returns {Row} - Header row according to the ColumnConfiguration\r\n */\r\nColumnConfiguration.prototype.getHeader = function() {\r\n\tvar cell, row, type;\r\n\r\n\tif (this.hideHeader) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\trow = new Row();\r\n\ttype = new Text({\r\n\t\tfont: {\r\n\t\t\tname: \"Arial\",\r\n\t\t\tsize: 11,\r\n\t\t\tbold: true\r\n\t\t},\r\n\t\tfill: {\r\n\t\t\tcolor: \"F7F7F7\"\r\n\t\t}\r\n\t});\r\n\r\n\t/* Register header style */\r\n\ttype.registerAt(this.styles);\r\n\r\n\trow.setStyle(type.getStyleId({}));\r\n\trow.addAttribute({\r\n\t\tname: \"customFormat\",\r\n\t\tvalue: \"1\"\r\n\t});\r\n\r\n\tthis.columns.forEach(function(column) {\r\n\r\n\t\t/* Create new Cell and assign value */\r\n\t\tcell = new Cell(type, this.sharedStrings);\r\n\t\tcell.setValue(\"label\", column);\r\n\r\n\t\trow.addCell(cell);\r\n\t}.bind(this));\r\n\r\n\treturn row;\r\n};\r\n\r\n/**\r\n *\r\n * @param sGroupName\r\n * @return {Row}\r\n */\r\nColumnConfiguration.prototype.getGroupHeader = function(sGroupName) {\r\n\tvar cell, row, type, data;\r\n\r\n\trow = new Row();\r\n\ttype = new Text({\r\n\t\tfont: {\r\n\t\t\tname: \"Arial\",\r\n\t\t\tsize: 11,\r\n\t\t\tbold: true\r\n\t\t},\r\n\t\tfill: {\r\n\t\t\tcolor: \"F2F2F2\"\r\n\t\t}\r\n\t});\r\n\tdata = {\r\n\t\tname: sGroupName\r\n\t};\r\n\r\n\t/* Register header style */\r\n\ttype.registerAt(this.styles);\r\n\r\n\trow.setStyle(type.getStyleId(data));\r\n\trow.addAttribute({\r\n\t\tname: \"customFormat\",\r\n\t\tvalue: \"1\"\r\n\t});\r\n\r\n\trow.spans.value = \"1:\" + this.size();\r\n\r\n\t/* Create new Cell and assign value */\r\n\tcell = new Cell(type, this.sharedStrings);\r\n\tcell.setValue(\"name\", data);\r\n\r\n\trow.addCell(cell);\r\n\r\n\treturn row;\r\n};\r\n\r\n/**\r\n * Returns the size of the ColumnConfiguration - respectively the\r\n * count of the configured columns.\r\n *\r\n * @returns {number} Count of configured columns\r\n */\r\nColumnConfiguration.prototype.size = function() {\r\n\treturn this.columns.length;\r\n};\r\n\r\nmodule.exports = ColumnConfiguration;","/**\r\n * The CurrencySettings static object represents settings for the currency data type.\r\n * It provides digits for a specific currency and the default scale.\r\n */\r\nvar Customizing = {};\r\n\r\n/**\r\n * Update the default settings with customization.\r\n *\r\n * @param {object} oConfig Configuration object that is used to specify the customization\r\n * @param {object} [oConfig.currency] Custom settings object that will be used for defining currency digits\r\n * @param {object} [oConfig.unit] Map of units with their corresponding scale\r\n * @param {object} [oConfig.timezone] Map of IANA timezone IDs with their corresponding translated text\r\n *\r\n * @public\r\n * @static\r\n */\r\nCustomizing.update = function(oConfig) {\r\n\tvar sKey, iScale;\r\n\r\n\t/* Update currency scale with custom currencies */\r\n\tif (oConfig.currency) {\r\n\r\n\t\t/*\r\n\t\t * If custom currencies contain a DEFAULT value\r\n\t\t * we clear the CLDR settings to avoid a fallback\r\n\t\t * to scale settings from CLDR.\r\n\t\t */\r\n\t\tif (oConfig.currency.DEFAULT && typeof oConfig.currency.DEFAULT.scale === \"number\") {\r\n\t\t\tCustomizing.CURRENCY = {};\r\n\t\t}\r\n\r\n\t\tfor (sKey in oConfig.currency) {\r\n\t\t\tCustomizing.CURRENCY[sKey] = iScale = oConfig.currency[sKey].scale;\r\n\r\n\t\t\t/* Determine MAX_CURRENCY_SCALE */\r\n\t\t\tif (iScale > Customizing.MAX_CURRENCY_SCALE) {\r\n\t\t\t\tCustomizing.MAX_CURRENCY_SCALE = iScale;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (oConfig.unit) {\r\n\t\tfor (sKey in oConfig.unit) {\r\n\t\t\tCustomizing.UNIT[sKey] = oConfig.unit[sKey].scale;\r\n\t\t}\r\n\t}\r\n\r\n\tif (oConfig.timezone) {\r\n\t\tObject.assign(Customizing.TIMEZONE, oConfig.timezone);\r\n\t}\r\n};\r\n\r\nCustomizing.getScaleForCurrency = function(sCurrencyCode) {\r\n\tvar iScale;\r\n\r\n\tiScale = Customizing.CURRENCY[sCurrencyCode];\r\n\r\n\t/* If the currency uses the default scale */\r\n\tif (typeof iScale !== \"number\") {\r\n\t\tiScale = Customizing.CURRENCY.DEFAULT;\r\n\t}\r\n\r\n\treturn iScale;\r\n};\r\n\r\nCustomizing.getScaleForUnit = function(sUnit) {\r\n\treturn Customizing.UNIT[sUnit];\r\n};\r\n\r\n/**\r\n * Returns the translated timezone text for a given IANA timezone ID.\r\n * If no translation is available, the ID is returned.\r\n *\r\n * @param {string} sTimezone IANA timezone ID\r\n * @returns {string} Translated timezone text or IANA ID if no translation is available\r\n */\r\nCustomizing.getTimezoneTranslation = function(sTimezone) {\r\n\treturn Customizing.TIMEZONE[sTimezone] || sTimezone;\r\n};\r\n\r\n/**\r\n * Defines the display default scale that is used for alignment. This has no effect on the technical scale of currency\r\n * values. It is only used for alignment purposes so that different currencies with different scale are still aligned\r\n * correctly.\r\n *\r\n * @type {number}\r\n */\r\nCustomizing.MAX_CURRENCY_SCALE = 3;\r\n\r\n/**\r\n * Contains all known units with their corresponding scale\r\n *\r\n * @type {object}\r\n */\r\nCustomizing.UNIT = {};\r\n\r\n/**\r\n * @type {object}\r\n */\r\nCustomizing.TIMEZONE = {};\r\n\r\n/** Currency customizing with default values copied from CLDR\r\n *\r\n * @type {object}\r\n */\r\nCustomizing.CURRENCY = {\r\n\t\"ADP\": 0,\r\n\t\"AFN\": 0,\r\n\t\"ALL\": 0,\r\n\t\"BHD\": 3,\r\n\t\"BIF\": 0,\r\n\t\"BYR\": 0,\r\n\t\"CLF\": 4,\r\n\t\"CLP\": 0,\r\n\t\"DEFAULT\": 2,\r\n\t\"DJF\": 0,\r\n\t\"ESP\": 0,\r\n\t\"GNF\": 0,\r\n\t\"HUF\": 0,\r\n\t\"IQD\": 0,\r\n\t\"IRR\": 0,\r\n\t\"ISK\": 0,\r\n\t\"ITL\": 0,\r\n\t\"JOD\": 3,\r\n\t\"JPY\": 0,\r\n\t\"KMF\": 0,\r\n\t\"KPW\": 0,\r\n\t\"KRW\": 0,\r\n\t\"KWD\": 3,\r\n\t\"LAK\": 0,\r\n\t\"LBP\": 0,\r\n\t\"LUF\": 0,\r\n\t\"LYD\": 3,\r\n\t\"MGA\": 0,\r\n\t\"MGF\": 0,\r\n\t\"MMK\": 0,\r\n\t\"MRO\": 0,\r\n\t\"OMR\": 3,\r\n\t\"PYG\": 0,\r\n\t\"RSD\": 0,\r\n\t\"RWF\": 0,\r\n\t\"SLL\": 0,\r\n\t\"SOS\": 0,\r\n\t\"STD\": 0,\r\n\t\"SYP\": 0,\r\n\t\"TMM\": 0,\r\n\t\"TND\": 3,\r\n\t\"TRL\": 0,\r\n\t\"TWD\": 0,\r\n\t\"UGX\": 0,\r\n\t\"UYI\": 0,\r\n\t\"UYW\": 4,\r\n\t\"VND\": 0,\r\n\t\"VUV\": 0,\r\n\t\"XAF\": 0,\r\n\t\"XOF\": 0,\r\n\t\"XPF\": 0,\r\n\t\"YER\": 0,\r\n\t\"ZMK\": 0,\r\n\t\"ZWD\": 0\r\n};\r\n\r\nmodule.exports = Customizing;","var Type = require(\"./Type\"),\r\n\tScaleSettings = require(\"../Customizing\"),\r\n\tAlignment = require(\"../../style/Alignment\");\r\n\r\n/**\r\n * The BigNumber class represents string formatted number with\r\n * specific formatting. It provides font and sizing details that\r\n * can be used by the Styles class.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this BigNumber type\r\n * @constructor\r\n */\r\nfunction BigNumber(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.type = oConfig ? oConfig.type : null;\r\n\tthis.displayUnit = oConfig && typeof oConfig.displayUnit === \"boolean\" ? oConfig.displayUnit : true;\r\n\tthis.unit = oConfig ? oConfig.unit : null;\r\n\tthis.unitProperty = oConfig ? oConfig.unitProperty : null;\r\n\tthis.delimiter = oConfig ? oConfig.delimiter : false;\r\n\tthis.scale = oConfig ? oConfig.scale : null;\r\n\r\n\t/**\r\n\t * Due to default text alignment LTR, we need to invert the\r\n\t * alignment so that it reflects the default number alignment\r\n\t */\r\n\tthis.alignment = this.alignment === null ? Alignment.horizontal.RIGHT : Alignment.horizontal.LEFT;\r\n}\r\n\r\nBigNumber.prototype = Object.create(Type.prototype);\r\nBigNumber.prototype.constructor = BigNumber;\r\n\r\n/**\r\n * Returns the unit specific scale.\r\n *\r\n * @param {string} sUnit ISO unit of measure or currency code string\r\n * @returns {number|null} A number that represents the unit specific scale\r\n * @public\r\n */\r\nBigNumber.prototype.getScale = function(sUnit) {\r\n\tvar fnResolveScale, iScale;\r\n\r\n\tfnResolveScale = this.type === \"currency\" ? ScaleSettings.getScaleForCurrency : ScaleSettings.getScaleForUnit;\r\n\tiScale = fnResolveScale(sUnit);\r\n\r\n\tif (isNaN(iScale)) {\r\n\t\tiScale = this.scale;\r\n\t}\r\n\r\n\treturn iScale;\r\n};\r\n\r\n/**\r\n * Returns the data value of the business object that is bound by\r\n * this type. If a template is configured, it will automatically fill\r\n * the template with the values from the business object and returns\r\n * the processed string.\r\n *\r\n * @param {string} property Name of the property that shall be accessed.\r\n * @param {Object} oData Business object that contains the data.\r\n *\r\n * @returns {string|number|boolean|null} The value of the given property after type specific processing.\r\n * Returns null if no value is present or the value cannot be processed by this type.\r\n */\r\nBigNumber.prototype.getValue = function(property, oData) {\r\n\tvar iScale, sResult, sUnit, sValue;\r\n\r\n\tsValue = oData[property];\r\n\r\n\t/* Convert number to string for BigNumber conversion */\r\n\tif (typeof sValue == \"number\") {\r\n\t\tsValue = sValue.toString();\r\n\t}\r\n\r\n\t/* The value must be passed as a string containing only numerical characters with an optional decimal separator */\r\n\tif (typeof sValue != \"string\" || !sValue.match(/^(-){0,1}[0-9]+(\\.[0-9]+)*$/g)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tsUnit = oData[this.unitProperty] || this.unit;\r\n\tiScale = this.getScale(sUnit);\r\n\r\n\r\n\tsResult = this._parseValue(sValue, iScale, this.delimiter);\r\n\r\n\tif (this.displayUnit) {\r\n\t\tsResult += (sUnit ? \" \" + sUnit : \"\");\r\n\t}\r\n\r\n\treturn sResult;\r\n};\r\n\r\n/**\r\n * Parses a string representation of a numeric value according to the given requirements.\r\n *\r\n * @param {string} sValue String representation of a numeric value\r\n * @param {number|null} [iScale] Defines the scale of the numeric value ( >= 0)\r\n * @param {boolean} [bDelimiter] Defines if thousand delimiters should be visible in the output\r\n * @returns {string} Parsed representation\r\n * @private\r\n */\r\nBigNumber.prototype._parseValue = function(sValue, iScale, bDelimiter) {\r\n\tvar aSplitted, aInteger, i, sDecimal, sInteger, sSign;\r\n\r\n\taSplitted = sValue.split(\".\");\r\n\tsInteger = aSplitted[0];\r\n\tsDecimal = aSplitted.length > 1 ? aSplitted[1] : \"\";\r\n\r\n\t/* Add thousand delimiter to the integer value */\r\n\tif (bDelimiter) {\r\n\r\n\t\t/* Remove sign before inserting the delimiter */\r\n\t\taInteger = sInteger.split(\"\");\r\n\t\tsSign = aInteger[0] === \"-\" ? aInteger.shift() : \"\";\r\n\r\n\t\tsInteger = sSign + aInteger.reduceRight(function(accumulator, currentValue) {\r\n\t\t\treturn currentValue + (accumulator.length % 4 == 3 ? \",\" + accumulator : accumulator);\r\n\t\t}, \"\");\r\n\t}\r\n\r\n\tif (typeof iScale === \"number\") {\r\n\t\tif (iScale < sDecimal.length) {\r\n\t\t\tsDecimal = sDecimal.substring(0, iScale);\r\n\t\t} else {\r\n\t\t\tfor (i = sDecimal.length; i < iScale; i++) {\r\n\t\t\t\tsDecimal += \"0\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn sInteger + (sDecimal ? \".\" + sDecimal : \"\");\r\n};\r\n\r\nmodule.exports = BigNumber;","var Type = require(\"./Type\");\r\n\r\n/**\r\n * The BooleanType class represents a boolean data type. BooleanType\r\n * data can work in two different ways. The first way is the Office\r\n * Open XML Spreadsheet built-in type that always shows TRUE/FALSE in\r\n * the users locale. This value can easily be used within formulas.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this numeric representation\r\n * @param {string} [oConfig.trueValue] Contains the value that gets displayed if the Boolean is true\r\n * @param {string} [oConfig.falseValue] Contains the value that gets displayed if the Boolean is false\r\n * @constructor\r\n */\r\nfunction BooleanType(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.trueValue = oConfig ? oConfig.trueValue : null;\r\n\tthis.falseValue = oConfig ? oConfig.falseValue : null;\r\n}\r\n\r\nBooleanType.prototype = Object.create(Type.prototype);\r\nBooleanType.prototype.constructor = BooleanType;\r\n\r\nBooleanType.DEFAULT = {\r\n\tnumberFormat: 0\r\n};\r\n\r\n/**\r\n * This method indicates if the properties trueValue and falseValue\r\n * are configured correctly and the BooleanType supports a custom\r\n * format.\r\n *\r\n * @returns {boolean} Whether to use a custom formatted BooleanType or the built-in type.\r\n */\r\nBooleanType.prototype.isCustomFormatted = function() {\r\n\treturn !!this.trueValue\r\n\t\t&& typeof this.trueValue === \"string\"\r\n\t\t&& !!this.falseValue\r\n\t\t&& typeof this.falseValue === \"string\";\r\n};\r\n\r\n/**\r\n * Creates the format according to the provided configuration. If the\r\n * format matches any builtin format, it will return a reference to\r\n * its ID instead of the format.\r\n *\r\n * Both cases can serve the Style class that consumes this information.\r\n *\r\n * @returns {Object} Configuration object for NumberFormat initialization\r\n * @protected\r\n */\r\nBooleanType.prototype._createConfiguration = function() {\r\n\tvar config;\r\n\r\n\tconfig = Object.getPrototypeOf(BooleanType.prototype)._createConfiguration.call(this);\r\n\tconfig.numberFormat = this.isCustomFormatted() ?\r\n\t\t{ format: `\"${this.trueValue}\";;\"${this.falseValue}\"` } : BooleanType.DEFAULT.numberFormat;\r\n\r\n\treturn config;\r\n};\r\n\r\nmodule.exports = BooleanType;","var Type = require(\"./Type\");\r\n\r\n/**\r\n * The <code>CalendarBase</code> class represents a date/datetime/time data type.\r\n * It handles the formatting and offers several options such as calendar, custom\r\n * format string, and a subtype.\r\n *\r\n * @param {Object} [oConfig] A configuration object that is used to specify the formatting\r\n * @param {string} [oConfig.format] A custom format string that will be used as template\r\n * @param {string} [oConfig.calendar] Specifies the calendar that will be used (default: gregorian)\r\n * @param {string} [oConfig.inputFormat] Specifies the format of the string-formatted date value (uppercase YYYYMMDD)\r\n * @constructor\r\n */\r\nfunction CalendarBase(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.format = oConfig ? oConfig.format : null;\r\n\tthis.calendar = oConfig && typeof oConfig.calendar === \"string\" ? oConfig.calendar.toLowerCase() : null;\r\n\tthis.inputFormat = oConfig && typeof oConfig.inputFormat == \"string\" ? oConfig.inputFormat.toUpperCase() : null;\r\n}\r\n\r\nCalendarBase.prototype = Object.create(Type.prototype);\r\nCalendarBase.prototype.constructor = CalendarBase;\r\n\r\nCalendarBase.LOCAL_TIMEZONE = new Intl.DateTimeFormat().resolvedOptions().timeZone;\r\n\r\nCalendarBase.DEFAULT = {\r\n\tnumberFormat: 14\r\n};\r\n\r\nCalendarBase.BUILTIN = {\r\n\t14: \"mm-dd-yy\",\r\n\t15: \"d-mmm-yy\",\r\n\t16: \"d-mmm\",\r\n\t17: \"mmm-yy\",\r\n\t18: \"h:mm AM/PM\",\r\n\t19: \"h:mm:ss AM/PM\",\r\n\t20: \"h:mm\",\r\n\t21: \"h:mm:ss\",\r\n\t22: \"m/d/yy h:mm\",\r\n\t45: \"mm:ss\",\r\n\t46: \"[h]:mm:ss\",\r\n\t47: \"mmss.0\"\r\n};\r\n\r\nCalendarBase.oSymbols = {\r\n\t\"Y\": {\r\n\t\tapply: function(sValue, oDate) {\r\n\t\t\toDate.setUTCFullYear(sValue);\r\n\t\t}\r\n\t},\r\n\t\"M\": {\r\n\t\tapply: function(sValue, oDate) {\r\n\t\t\toDate.setUTCMonth(sValue - 1);\r\n\t\t}\r\n\t},\r\n\t\"D\": {\r\n\t\tapply: function(sValue, oDate) {\r\n\t\t\toDate.setUTCDate(sValue);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Creates the <code>Style</code> configuration object according to\r\n * the configuration of this<code>CalendarBase</code> instance.\r\n *\r\n * @param {Object} oData Business object that gets bound to the styling template\r\n * @return {Object} Style descriptor object\r\n * @protected\r\n */\r\nCalendarBase.prototype._createConfiguration = function(oData) {\r\n\tvar oConfig, sKey, sTemplate;\r\n\r\n\toConfig = Object.getPrototypeOf(CalendarBase.prototype)._createConfiguration.call(this, oData);\r\n\r\n\tsTemplate = this.getDefaultFormat(oData);\r\n\r\n\t/* Evaluate calendar */\r\n\tswitch (this.calendar) {\r\n\t\tcase \"islamic\":\r\n\t\t\tsTemplate = \"b2\" + sTemplate;\r\n\t\t\tbreak;\r\n\t\tcase \"japanese\":\r\n\t\t\tsTemplate = \"[$-ja-JP]\" + sTemplate;\r\n\t\t\tbreak;\r\n\t\tdefault: // Gregorian calendar is the default case\r\n\t}\r\n\r\n\toConfig.numberFormat = {\r\n\t\tformat: sTemplate\r\n\t};\r\n\r\n\t/* Find possible builtin match */\r\n\tfor (sKey in CalendarBase.BUILTIN) {\r\n\t\tif (CalendarBase.BUILTIN[sKey] === sTemplate) {\r\n\t\t\toConfig.numberFormat = parseInt(sKey, 10);\r\n\t\t}\r\n\t}\r\n\r\n\treturn oConfig;\r\n};\r\n\r\n/**\r\n * Returns the default NumberFormat for the specific type\r\n * and takes a predefined custom format into account.\r\n *\r\n * @returns {string|null} NumberFormat template of the type or null\r\n * @private\r\n */\r\nCalendarBase.prototype.getDefaultFormat = function() {\r\n\tvar sTemplate;\r\n\r\n\tif (typeof this.format === \"string\" && this.format.match(/^[gdhmsy\\s-,.:/]+(AM\\/PM)?$/)) {\r\n\t\tsTemplate = this.format;\r\n\t} else if (this.calendar === \"islamic\") {\r\n\t\tsTemplate = \"d mmmm yyyy\";\r\n\t} else if (this.calendar === \"japanese\") {\r\n\t\tsTemplate = \"ge.m.d\";\r\n\t}\r\n\r\n\treturn sTemplate;\r\n};\r\n\r\n/**\r\n * Returns the value of the given property that is assigned in the line item.\r\n *\r\n * @param {string} sProperty Name of the property that contains the value\r\n * @param {Object} oData Line item that contains data\r\n * @return {number|null} XLSX-specific date/time format in days since 30.12.1899\r\n */\r\nCalendarBase.prototype.getValue = function(sProperty, oData) {\r\n\tvar iTimestamp, vValue;\r\n\r\n\tvValue = oData[sProperty];\r\n\r\n\tif (vValue === null || typeof vValue === \"undefined\" || vValue === \"\") {\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/* Date, SAPUI5 OData Time representation or String/Number wrapper */\r\n\tif (typeof vValue === \"object\") {\r\n\t\tvValue = typeof vValue.ms === 'number' ? vValue.ms : vValue.valueOf();\r\n\t}\r\n\r\n\t/* 1. Unix timestamp as number */\r\n\tif (typeof vValue === \"number\" && !isNaN(vValue)) {\r\n\t\tiTimestamp = vValue;\r\n\t}\r\n\r\n\t/* 2. String based date/time representation */\r\n\tif (typeof vValue === \"string\") {\r\n\t\tiTimestamp = this._parseStringValue(vValue);\r\n\t}\r\n\r\n\treturn typeof iTimestamp === \"number\"\r\n\t\t? this.dateToExcel(iTimestamp, oData) : null;\r\n};\r\n\r\n/**\r\n * Converts a textual date/time representation to a numeric timestamp.\r\n *\r\n * @param {string} sValue String representation of the date/time\r\n * @return {number|null} Numeric timestamp\r\n * @private\r\n */\r\nCalendarBase.prototype._parseStringValue = function(sValue) {\r\n\r\n\t/* 1. Pattern formatted date string */\r\n\tif (this.inputFormat && typeof this.inputFormat === \"string\") {\r\n\t\treturn CalendarBase._parseStringDate(sValue, this.inputFormat);\r\n\t}\r\n\r\n\t/* 2. OData date string \"/Date(1234567890)/\" */\r\n\tif (CalendarBase.odataDateRegex.test(sValue)) {\r\n\t\treturn CalendarBase._parseOdataDate(sValue);\r\n\t}\r\n\r\n\t/* 3. DateTimeOffset representation 1986-04-13T01:08:00.000+01:00 */\r\n\tif (CalendarBase.odataDateTimeOffsetRegex.test(sValue)) {\r\n\t\treturn Date.parse(sValue);\r\n\t}\r\n\r\n\t/* 4. Unix timestamp as string */\r\n\tif (isFinite(sValue)) {\r\n\t\treturn parseInt(sValue, 10);\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\n/** START Copied and adapted from datajs **/\r\n/**\r\n * Extracts the milliseconds if the value is a date/time instance or formatted string.\r\n *\r\n * @param {any} vValue the value (may be <code>undefined</code> or <code>null</code>)\r\n * @return {any} the number of milliseconds or the value itself\r\n */\r\nCalendarBase._parseODataDuration = function(vValue) {\r\n\tvar parts, days, hours, minutes, seconds, ms;\r\n\t// / <summary>Parses a string in xsd:duration format.</summary>\r\n\t// / <param name=\"duration\" type=\"String\">Duration value.</param>\r\n\t// / <remarks>\r\n\t// / This method will return the input, if the input string has a year or a month component.\r\n\t// / </remarks>\r\n\t// / <returns type=\"Object\">Object representing the time</returns>\r\n\r\n\tparts = CalendarBase.odataDurationRegex.exec(vValue);\r\n\r\n\t// Unsupported duration value for Edm.Time OData spec (if year of month is present)\r\n\t/* EDITED\r\n\tif (parts[2] || parts[3]) {\r\n\t\treturn vValue;\r\n\t}\r\n\t */\r\n\r\n\tdays = parseInt(parts[4] || 0, 10);\r\n\thours = parseInt(parts[5] || 0, 10);\r\n\tminutes = parseInt(parts[6] || 0, 10);\r\n\tseconds = parseFloat(parts[7] || 0);\r\n\r\n\tms = parts[8];\r\n\tif (ms) {\r\n\t\t// Parse ms duration value ignoring any precision/scale as that part is anyway ignored by JS Date conversion!\r\n\t\tms = parseFloat(\"0.\" + ms) * 1000;\r\n\t} else {\r\n\t\tms = 0;\r\n\t}\r\n\r\n\tms += (seconds * 1000) + (minutes * 60000) + (hours * 3600000) + (days * 86400000);\r\n\r\n\tif (parts[1] === \"-\") {\r\n\t\tms = -ms;\r\n\t}\r\n\r\n\treturn ms;\r\n};\r\n\r\nCalendarBase._parseTimeOfDay = function(vValue) {\r\n\tvar parts, hours, minutes, seconds;\r\n\tvar date = new Date(0);\r\n\r\n\tparts = CalendarBase.timeOfDayRegex.exec(vValue);\r\n\thours = parseInt(parts[1] || 0, 10);\r\n\tminutes = parseInt(parts[2] || 0, 10);\r\n\tseconds = parseFloat(parts[4] || 0);\r\n\tdate.setUTCHours(hours, minutes, seconds);\r\n\r\n\treturn date.getTime();\r\n};\r\n\r\n/**\r\n * Parses an OData date string and returns the corresponding timestamp\r\n *\r\n * @param {string} sValue OData date string i.E. \"/Date(1524141637807)/\"\r\n * @return {number} Unix timestamp according to OData date including offset\r\n * @private\r\n */\r\nCalendarBase._parseOdataDate = function(sValue) {\r\n\tvar matchArray, date, offset;\r\n\r\n\t/* The RegExp matches up to 4 groups:\r\n\t\t * 0: Full match\r\n\t\t * 1: Timestamp (mandatory)\r\n\t\t * 2: Timezone offset sign [ + | - ] (optional)\r\n\t\t * 3: Timezone offset minutes [0-9]{2,3} (optional)\r\n\t\t */\r\n\tmatchArray = CalendarBase.odataDateRegex.exec(sValue);\r\n\tdate = new Date(parseInt(matchArray[1], 10));\r\n\r\n\tif (matchArray[2] && matchArray[3]) {\r\n\t\toffset = parseInt(matchArray[2] + matchArray[3], 10);\r\n\t\tdate.setUTCMinutes(date.getUTCMinutes() - offset);\r\n\t}\r\n\r\n\treturn date.getTime();\r\n};\r\n\r\n/* The regular expression corresponds to something like this:\r\n * /Date(123+60)/\r\n *\r\n * This first number is date ticks, the + may be a - and is optional,\r\n * with the second number indicating a timezone offset in minutes.\r\n *\r\n * On the wire, the leading and trailing forward slashes are\r\n * escaped without being required to so the chance of collisions is reduced;\r\n * however, by the time we see the objects, the characters already\r\n * look like regular forward slashes.\r\n*/\r\nCalendarBase.odataDateRegex = /^\\/Date\\((-?\\d+)(\\+|-)?(\\d+)?\\)\\/$/;\r\n\r\n// The captured indices for this expression are:\r\n// 0 - complete input\r\n// 1 - direction\r\n// 2,3,4 - years, months, days\r\n// 5,6,7,8 - hours, minutes, seconds, milliseconds\r\nCalendarBase.odataDurationRegex =\r\n\t/^([+-])?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(?:\\.(\\d+))?S)?)?/;\r\n\r\n/** END Copied and adapted from datajs */\r\n\r\n/* eslint-disable-next-line */\r\nCalendarBase.odataDateTimeOffsetRegex = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\\d|3[0-1])T([0-1]\\d|2[0-3])(:[0-5]\\d)(:[0-5]\\d(\\.\\d{1,12})?)?(Z|[+\\-](0\\d|1[0-2]):[0-5]\\d)/;\r\n\r\nCalendarBase.dateStringRegex = /([Y]{4,}|[M]{2}|[D]{2})/g;\r\n\r\n/* Edm.TimeOfDay can be 00:00-23:59:59.999999999999 which allows to ommit seconds and fractual seconds */\r\nCalendarBase.timeOfDayRegex = /^([0-1]\\d|2[0-3]):([0-5]\\d)(:([0-5]\\d)(.\\d{1,12})?)?$/;\r\n\r\n/**\r\n * Converts a JavaScript Date timestamp to an Office Open XML date\r\n * representation. Office Open XML date epoch starts at 00.01.1900\r\n * which is 31.12.1899 and is represented as a number of days since\r\n * beginning of the epoch.\r\n *\r\n * The Javascript Date epoch starts at 01.01.1970 and is represented\r\n * as a number of milliseconds before or after the beginning of the\r\n * epoch.\r\n *\r\n * The amount of days between 01.01.1900 and 01.01.1970 is exactly\r\n * 25567. According to the wrong offset in Excel (00.01.1900 instead\r\n * of 01.01.1900) and the known leap year bug in Excel, we need to\r\n * add two additional days.\r\n *\r\n * https://support.microsoft.com/en-us/help/214326/excel-incorrectly-assumes-that-the-year-1900-is-a-leap-year\r\n *\r\n * Time specific information is represented as fraction. This means\r\n * that the value 30.5 represents 30.5 days after the 31.12.1899\r\n * where.5 stands for half a day. A day is defined as 24 hours, so\r\n * half a day means 12 hours since the beginning of the day at\r\n * 00:00:00. If the integer part of the value is greater than 0 date\r\n * specific information will be present in the cell.\r\n *\r\n * This also applies for time formatted cells. Although the cell only\r\n * displays the time specific part, the editing bar still shows the\r\n * date specific part. Therefore it is necessary to remove the date\r\n * specific part from the value in the XLSX file.\r\n *\r\n * The input format can contain milliseconds, which cannot be\r\n * displayed, since no literal is provided for this in the number\r\n * formatting of the Office Open XML Spreadsheet Format. This causes\r\n * milliseconds to be rounded to the nearest second, which can result\r\n * in a difference of one second. Therefore, milliseconds are\r\n * intentionally cut off during conversion.\r\n *\r\n * @param {number} nTimestamp JavaScript Date timestamp\r\n * @return {number} Amount of days since 31.12.1899\r\n * @private\r\n */\r\nCalendarBase.prototype.dateToExcel = function(nTimestamp) {\r\n\tvar iOffset, fExcelValue;\r\n\r\n\t/* Increase the offset if date is after February 28th 1900 */\r\n\tiOffset = nTimestamp >= -2203891200000 ? 2 : 1;\r\n\r\n\t/**\r\n\t * Fallback if date is before UTC 31.12.1899 00:00:00\r\n\t * which corresponds to 0 in Excel\r\n\t */\r\n\tfExcelValue = Math.max(((nTimestamp - (nTimestamp % 1000)) / (86400 * 1000)) + (25567 + iOffset), 0);\r\n\r\n\treturn fExcelValue;\r\n};\r\n\r\n/**\r\n * The method parses a given string value according to the provided\r\n * date pattern.\r\n *\r\n * Restrictions:\r\n * Currently only the symbols d, m, y are supported which correspond\r\n * to day, month, year.\r\n *\r\n * @param {string} sValue Date formatted string\r\n * @param {string} sPattern ISO 8601 pattern that gets applied\r\n * @return {number|null} UNIX timestamp that represents the parsed date string\r\n * @private\r\n */\r\nCalendarBase._parseStringDate = function(sValue, sPattern) {\r\n\tvar aMatch, oDate, sSubstring;\r\n\r\n\toDate = new Date(0);\r\n\r\n\tdo {\r\n\t\taMatch = CalendarBase.dateStringRegex.exec(sPattern);\r\n\r\n\t\tif (aMatch !== null) {\r\n\t\t\tsSubstring = sValue.slice(aMatch.index, aMatch.index + aMatch[0].length);\r\n\r\n\t\t\tCalendarBase.oSymbols[aMatch[0].charAt(0)].apply(parseInt(sSubstring, 10), oDate);\r\n\t\t}\r\n\t} while (aMatch !== null);\r\n\r\n\treturn oDate.getTime();\r\n};\r\n\r\nmodule.exports = CalendarBase;","var CalendarBase = require('./CalendarBase');\r\n\r\n/**\r\n * The CalendarDate class represents a date/datetime/time data type.\r\n * It handles the formatting and accepts several options like\r\n * calendar, a custom format string and a subtype.\r\n *\r\n * @param {Object} [oConfig] A configuration object that is used to specify the formatting\r\n * @param {string} [oConfig.utc] Specifies if the CalendarDate is exported in UTC\r\n * @constructor\r\n */\r\nfunction CalendarDate(oConfig) {\r\n\tCalendarBase.call(this, oConfig);\r\n\r\n\tthis.utc = true;\r\n}\r\n\r\nCalendarDate.prototype = Object.create(CalendarBase.prototype);\r\nCalendarDate.prototype.constructor = CalendarDate;\r\n\r\n\r\n/**\r\n * Returns the default NumberFormat for the specific type.\r\n *\r\n * @returns {string} NumberFormat template for type Date\r\n * @private\r\n */\r\nCalendarDate.prototype.getDefaultFormat = function() {\r\n\treturn Object.getPrototypeOf(CalendarDate.prototype).getDefaultFormat.call(this)\r\n\t\t|| CalendarBase.BUILTIN[14];\r\n};\r\n\r\nmodule.exports = CalendarDate;","var CalendarBase = require(\"./CalendarBase\");\r\nvar Customizing = require(\"../Customizing\");\r\n\r\n/**\r\n * The CalendarDateTime class represents a date/datetime/time data type.\r\n * It handles the formatting and accepts several options like\r\n * calendar, a custom format string and a subtype.\r\n *\r\n * @param {Object} [oConfig] A configuration object that is used to specify the formatting\r\n * @param {boolean} [oConfig.displayTimezone=true] Whether the IANA timezone is being displayed\r\n * @param {string} [oConfig.timezone] Specific timezone that will be applied\r\n * @param {string} [oConfig.timezoneProperty] Property name that references the timezone\r\n * @constructor\r\n */\r\nfunction CalendarDateTime(oConfig) {\r\n\tCalendarBase.call(this, oConfig);\r\n\r\n\tthis.timezone = oConfig ? oConfig.timezone : null;\r\n\tthis.timezoneProperty = oConfig ? oConfig.timezoneProperty : null;\r\n\tthis.displayTimezone = oConfig && typeof oConfig.displayTimezone === \"boolean\" ? oConfig.displayTimezone : true;\r\n\r\n\tthis.styleIds = {};\r\n}\r\n\r\nCalendarDateTime.prototype = Object.create(CalendarBase.prototype);\r\nCalendarDateTime.prototype.constructor = CalendarDateTime;\r\n\r\nCalendarDateTime._oCache = new Map();\r\n\r\n/**\r\n * Returns the default NumberFormat for the specific type.\r\n *\r\n * @param {Object} oData Business object that gets bound to the styling template\r\n * @returns {string} NumberFormat template for type DateTime\r\n * @private\r\n */\r\nCalendarDateTime.prototype.getDefaultFormat = function(oData) {\r\n\tvar sTemplate, sTimezone;\r\n\r\n\tsTemplate =\tObject.getPrototypeOf(CalendarDateTime.prototype).getDefaultFormat.call(this)\r\n\t\t|| CalendarBase.BUILTIN[22];\r\n\r\n\tif ((this.calendar === \"islamic\" && sTemplate === \"d mmmm yyyy\")\r\n\t\t|| (this.calendar === \"japanese\" && sTemplate === \"ge.m.d\")) {\r\n\t\tsTemplate += \" hh:mm\";\r\n\t}\r\n\r\n\t/* Apply timezone on the cell format only for line item specific timezone */\r\n\tif (this.timezoneProperty && this.displayTimezone) {\r\n\t\tsTimezone = Customizing.getTimezoneTranslation(this.getTimezone(oData));\r\n\t\tsTemplate = `_-${sTemplate}* \"${sTimezone}\"`;\r\n\t}\r\n\r\n\treturn sTemplate;\r\n};\r\n\r\n/**\r\n * Returns the IANA timezone string that is used either for the whole\r\n * column or depending on the row data. The specific timezone is obtained\r\n * in the following order (properties):\r\n *\r\n * 1. timezoneProperty \t(dynamic)\r\n * 2. timezone\t\t\t(static)\r\n * 3. utc\t\t\t\t(UTC)\r\n *\r\n * @param {Object} oData Business object that represents a row\r\n * @returns {string|null} Specific IANA timezone string or null if no timezone could be evaluated\r\n */\r\nCalendarDateTime.prototype.getTimezone = function(oData) {\r\n\tif (oData && oData[this.timezoneProperty] && typeof oData[this.timezoneProperty] === 'string') {\r\n\t\treturn oData[this.timezoneProperty];\r\n\t}\r\n\r\n\tif (this.timezone) {\r\n\t\treturn this.timezone;\r\n\t}\r\n\r\n\treturn 'UTC';\r\n};\r\n\r\n/**\r\n * Returns the assigned ID of the Type specific Style that is\r\n * registered in the Styles class.\r\n *\r\n * @param {Object} oData Business Object that contains the property for the UoM\r\n * @param {string|number} [vValue] Explicit cell value that might be used for semantic formatting\r\n * @returns {number} ID of the registered Style\r\n */\r\nCalendarDateTime.prototype.getStyleId = function(oData, vValue) {\r\n\tvar iStyleId, sTimezone;\r\n\r\n\t/* Handle simple numeric without unitProperty */\r\n\tif (!this.timezoneProperty) {\r\n\t\treturn Object.getPrototypeOf(CalendarDateTime.prototype).getStyleId.call(this, oData, vValue);\r\n\t}\r\n\r\n\tif (!oData) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tsTimezone = this.getTimezone(oData);\r\n\tiStyleId = this.styleIds[sTimezone];\r\n\r\n\tif (typeof iStyleId === \"undefined\") {\r\n\t\tthis.styleIds[sTimezone] = this.styles.addStyle(this._createConfiguration(oData));\r\n\t}\r\n\r\n\treturn this.styleIds[sTimezone];\r\n};\r\n\r\n/**\r\n * Converts a JavaScript Date timestamp to an Office Open XML date\r\n * representation. Office Open XML date epoch starts at 00.01.1900\r\n * which is 31.12.1899 and is represented as a number of days since\r\n * beginning of the epoch.\r\n *\r\n * The Javascript Date epoch starts at 01.01.1970 and is represented\r\n * as a number of milliseconds before or after the beginning of the\r\n * epoch.\r\n *\r\n * The amount of days between 01.01.1900 and 01.01.1970 is exactly\r\n * 25567. According to the wrong offset in Excel (00.01.1900 instead\r\n * of 01.01.1900) and the known leap year bug in Excel, we need to\r\n * add two additional days.\r\n *\r\n * https://support.microsoft.com/en-us/help/214326/excel-incorrectly-assumes-that-the-year-1900-is-a-leap-year\r\n *\r\n * Time specific information is represented as fraction. This means\r\n * that the value 30.5 represents 30.5 days after the 31.12.1899\r\n * where.5 stands for half a day. A day is defined as 24 hours, so\r\n * half a day means 12 hours since the beginning of the day at\r\n * 00:00:00. If the integer part of the value is greater than 0 date\r\n * specific information will be present in the cell.\r\n *\r\n * This also applies for time formatted cells. Although the cell only\r\n * displays the time specific part, the editing bar still shows the\r\n * date specific part. Therefore it is necessary to remove the date\r\n * specific part from the value in the XLSX file.\r\n *\r\n * The input format can contain milliseconds, which cannot be\r\n * displayed, since no literal is provided for this in the number\r\n * formatting of the Office Open XML Spreadsheet Format. This causes\r\n * milliseconds to be rounded to the nearest second, which can result\r\n * in a difference of one second. Therefore, milliseconds are\r\n * intentionally cut off during conversion.\r\n *\r\n * @param {number} nTimestamp JavaScript Date timestamp\r\n * @param {string} [oData] Defines if the timestamp remains untouched or if a timezone specific offset is considered\r\n * @return {number} Amount of days since 31.12.1899\r\n * @private\r\n */\r\nCalendarDateTime.prototype.dateToExcel = function(nTimestamp, oData) {\r\n\tvar iDateDifference, fExcelValue, iTimezoneOffset, oDate, oFormat, oParts, sTimezone;\r\n\r\n\tsTimezone = this.getTimezone(oData);\r\n\tfExcelValue = Object.getPrototypeOf(CalendarDateTime.prototype).dateToExcel.call(this, nTimestamp);\r\n\r\n\tif (sTimezone && sTimezone !== \"UTC\") {\r\n\t\toFormat = CalendarDateTime.getTimezoneFormat(sTimezone);\r\n\r\n\t\t/* Calculate offset */\r\n\t\toDate = new Date(nTimestamp);\r\n\t\toParts = oFormat.formatToParts(new Date(nTimestamp)).reduce(function(acc, item) {\r\n\t\t\tswitch (item.type) {\r\n\t\t\t\tcase \"day\":\r\n\t\t\t\tcase \"hour\":\r\n\t\t\t\tcase \"minute\":\r\n\t\t\t\t\tacc[item.type] = item.value;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault: /* Do nothing */\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t\tiDateDifference = oDate.getUTCDate() - parseInt(oParts.day, 10);\r\n\r\n\t\t/*\r\n\t\t * Once the date difference is more than 1 day,\r\n\t\t * the day refers to a different month. This\r\n\t\t * translates into the opposite offset.\r\n\t\t */\r\n\t\tif (iDateDifference > 1) {\r\n\t\t\tiDateDifference = -1;\r\n\t\t} else if (iDateDifference < -1) {\r\n\t\t\tiDateDifference = 1;\r\n\t\t}\r\n\r\n\t\tiTimezoneOffset = iDateDifference * 24 * 60;\r\n\t\tiTimezoneOffset += (oDate.getUTCHours() - parseInt(oParts.hour, 10)) * 60;\r\n\t\tiTimezoneOffset += (oDate.getUTCMinutes() - parseInt(oParts.minute, 10));\r\n\r\n\t\t/* Apply offset to Excel date time representation */\r\n\t\tfExcelValue -= (iTimezoneOffset / 1440); // 1440 minutes per day\r\n\t}\r\n\r\n\treturn fExcelValue;\r\n};\r\n\r\n/**\r\n * Returns a Intl.DateTimeFormat for the given timezone.\r\n *\r\n * @param {string} sTimezone Timezone that will be used by the format\r\n * @returns {Intl.DateTimeFormat} Timezone specific format\r\n */\r\nCalendarDateTime.getTimezoneFormat = function(sTimezone) {\r\n\tvar oCachedEntry, oInstance, oOptions;\r\n\r\n\toCachedEntry = CalendarDateTime._oCache.get(sTimezone);\r\n\r\n\tif (oCachedEntry) {\r\n\t\treturn oCachedEntry;\r\n\t}\r\n\r\n\toOptions = {\r\n\t\thourCycle: \"h23\",\r\n\t\thour: \"2-digit\",\r\n\t\tminute: \"2-digit\",\r\n\t\tday: \"2-digit\",\r\n\t\ttimeZone: sTimezone,\r\n\t\tera: \"narrow\"\r\n\t};\r\n\r\n\toInstance = new Intl.DateTimeFormat(\"en-US\", oOptions);\r\n\r\n\tCalendarDateTime._oCache.set(sTimezone, oInstance);\r\n\r\n\treturn oInstance;\r\n};\r\n\r\nmodule.exports = CalendarDateTime;","var CalendarBase = require(\"./CalendarBase\");\r\n\r\n/**\r\n * The CalendarDate class represents a date/datetime/time data type.\r\n * It handles the formatting and accepts several options like\r\n * calendar, a custom format string and a subtype.\r\n *\r\n * @param {Object} [oConfig] A configuration object that is used to specify the formatting\r\n * @constructor\r\n */\r\nfunction CalendarTime(oConfig) {\r\n\tCalendarBase.call(this, oConfig);\r\n\r\n\tthis.utc = true;\r\n}\r\n\r\nCalendarTime.prototype = Object.create(CalendarBase.prototype);\r\nCalendarTime.prototype.constructor = CalendarTime;\r\n\r\n/**\r\n * Returns the value of the given property that is assigned in the line item.\r\n *\r\n * @param {string} sProperty Name of the property that contains the value\r\n * @param {Object} oData Line item that contains data\r\n * @return {number|null} XLSX specific date/time format in days since 30.12.1899\r\n */\r\nCalendarTime.prototype.getValue = function(sProperty, oData) {\r\n\tvar iExcelTimestamp;\r\n\r\n\tiExcelTimestamp = Object.getPrototypeOf(CalendarTime.prototype).getValue.call(this, sProperty, oData);\r\n\r\n\t/* Remove date specific part to only represent time */\r\n\treturn typeof iExcelTimestamp === \"number\" ? iExcelTimestamp % 1 : null;\r\n};\r\n\r\n/**\r\n * Returns the default NumberFormat for the specific type.\r\n *\r\n * @returns {string} NumberFormat template for type DateTime\r\n * @private\r\n */\r\nCalendarTime.prototype.getDefaultFormat = function() {\r\n\treturn Object.getPrototypeOf(CalendarTime.prototype).getDefaultFormat.call(this)\r\n\t\t|| CalendarBase.BUILTIN[21];\r\n};\r\n\r\n/**\r\n * Converts a textual date/time representation to a numeric timestamp.\r\n *\r\n * @param {string} sValue String representation of the date/time\r\n * @return {number|null} Numeric timestamp\r\n * @private\r\n */\r\nCalendarTime.prototype._parseStringValue = function(sValue) {\r\n\tvar fParsedValue;\r\n\r\n\tfParsedValue = Object.getPrototypeOf(CalendarTime.prototype)._parseStringValue.call(this, sValue);\r\n\r\n\tif (typeof fParsedValue === \"number\") {\r\n\t\treturn fParsedValue;\r\n\t}\r\n\r\n\t/* 2. OData Edm.TimeOfDay */\r\n\tif (CalendarBase.timeOfDayRegex.test(sValue)) {\r\n\t\treturn CalendarBase._parseTimeOfDay(sValue);\r\n\t}\r\n\r\n\t/* 3. OData duration string \"PT01H23M45S\" */\r\n\tif (CalendarBase.odataDurationRegex.test(sValue)) {\r\n\t\treturn CalendarBase._parseODataDuration(sValue);\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\n\r\nmodule.exports = CalendarTime;","var Numeric = require(\"./Numeric\"),\r\n\tCustomizing = require(\"../Customizing\");\r\n\r\n/**\r\n * The Currency class represents a currency data type. It handles the\r\n * formatting and accepts several options like second property for\r\n * the unit of measurement or if the unit of measurement should be\r\n * displayed.\r\n *\r\n * It styles currencies with its particular amount of decimals.\r\n *\r\n * @param {Object} oConfig A configuration object that is used to specify the formatting\r\n * @constructor\r\n */\r\nfunction Currency(oConfig) {\r\n\tNumeric.call(this, oConfig);\r\n}\r\n\r\nCurrency.prototype = Object.create(Numeric.prototype);\r\nCurrency.prototype.constructor = Currency;\r\n\r\n/**\r\n * Returns the currency specific scale.\r\n *\r\n * @param {string} sCurrencyCode ISO currency code like USD for $ and EUR for € etc.\r\n * @returns {number} A number between 2 and 3 depending on the scale of the given currency\r\n * @public\r\n */\r\nCurrency.prototype.getScale = function(sCurrencyCode) {\r\n\treturn Customizing.getScaleForCurrency(sCurrencyCode);\r\n};\r\n\r\n/**\r\n * Returns the numberFormat id of the built-in format or a numberFormat object with the formatting template\r\n *\r\n * @param {string} sUnit Unit of measure that is used to resolve the unit specific scale\r\n * @returns {string} Template for the NumberFormat\r\n */\r\nCurrency.prototype.getNumberFormatTemplate = function(sUnit) {\r\n\tlet scale, template = '#,##0';\r\n\r\n\t/* Apply fixed scale, only if no unitProperty is provided */\r\n\tif (!sUnit && typeof this.scale === \"number\") {\r\n\t\tscale = this.scale;\r\n\t} else {\r\n\t\tscale = this.getScale(sUnit);\r\n\t}\r\n\r\n\t/* Apply separator or placeholder */\r\n\ttemplate += (scale > 0) ? \".\" : \"_.\";\r\n\r\n\tfor (let i = 0; i < scale; i++) {\r\n\t\ttemplate += \"0\";\r\n\t}\r\n\r\n\tfor (let j = Customizing.MAX_CURRENCY_SCALE - scale; j > 0; j--) {\r\n\t\ttemplate += \"_0\";\r\n\t}\r\n\r\n\t/* Add unit of measurement if required */\r\n\tif (this.displayUnit) {\r\n\t\tconst unitTemplate = sUnit ? `\"${sUnit}\"` : \"_E_U_R\";\r\n\r\n\t\t// Applies unit of measure or a placeholder if unit is empty\r\n\t\ttemplate += `\\\\ ${unitTemplate}`;\r\n\t}\r\n\r\n\treturn `* ${template};* \\\\-\\\\ ${template}`;\r\n};\r\n\r\n/**\r\n * Creates the Style configuration needed for registering the Type\r\n * specific styling in the Styles class.\r\n *\r\n * @param {Object} oData Business object that gets bound to the styling template\r\n * @returns {Object} Styling configuration object\r\n * @protected\r\n */\r\nCurrency.prototype._createConfiguration = function(oData) {\r\n\tconst unit = this.getUnit(oData);\r\n\tconst template = this.getNumberFormatTemplate(unit);\r\n\r\n\treturn { numberFormat: { format: template } };\r\n};\r\n\r\nmodule.exports = Currency;","var Type = require(\"./Type\");\r\n\r\n/**\r\n * The Enumeration class represents an enumeration data type.\r\n * The Enumeration allows to assign particular values for\r\n * corresponding keys.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this type\r\n * @param {Object} [oData.valueMap] Contains a JS object or Map with key value pairs\r\n * @constructor\r\n */\r\nfunction Enumeration(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis._valueMap = oConfig && oConfig.valueMap ? oConfig.valueMap : {};\r\n}\r\n\r\nEnumeration.prototype = Object.create(Type.prototype);\r\nEnumeration.prototype.constructor = Enumeration;\r\n\r\n/**\r\n * Returns the mapped value for the key that is present in the\r\n * business object.\r\n *\r\n * @param {string} sProperty Name of the property that contains the key\r\n * @param {Object} oData Business object that contains the data\r\n * @returns {string} The value of the given property after type specific processing\r\n * @protected\r\n */\r\nEnumeration.prototype.getValue = function(sProperty, oData) {\r\n\tvar key, result;\r\n\r\n\tkey = oData[sProperty];\r\n\tresult = this._valueMap instanceof Map ? this._valueMap.get(key) : this._valueMap[key];\r\n\r\n\treturn result || \"\";\r\n};\r\n\r\nmodule.exports = Enumeration;","var Type = require(\"./Type\"),\r\n\tCustomizing = require(\"../Customizing\");\r\n\r\n/**\r\n * The Numeric class represents a numeric data type. Numeric data can\r\n * handle several options like thousands delimiter, decimal (scale)\r\n * and different types like \"percent\" and \"exponential\".\r\n *\r\n * @param {Object} [oConfig] Configuration object for this numeric representation\r\n * @param {boolean} [oConfig.autoScale] Applies dynamic scale depending on the specific unit\r\n * @param {boolean} [oConfig.delimiter] Indicates if a thousands delimiter should be used\r\n * @param {boolean} [oConfig.displayUnit] Indicating whether the unit of measurement will be shown (default: true)\r\n * @param {number} [oConfig.scale] A fixed scale that will be applied to all cells within this column,\r\n * regardless of its particular unit of measurement\r\n * @param {string} [oConfig.type] Specific type that is handled by this Numeric class\r\n * @param {string} [oConfig.unit] Specifies a particular unit of measurement\r\n * @param {string} [oConfig.unitProperty] Specifies a property that contains the unit of measure\r\n * @constructor\r\n */\r\nfunction Numeric(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.autoScale = oConfig ? oConfig.autoScale : false;\r\n\tthis.delimiter = oConfig ? oConfig.delimiter : false;\r\n\tthis.displayUnit = oConfig && typeof oConfig.displayUnit === \"boolean\" ? oConfig.displayUnit : true;\r\n\tthis.unit = oConfig ? oConfig.unit : null;\r\n\tthis.unitProperty = oConfig ? oConfig.unitProperty : null;\r\n\tthis.scale = oConfig ? oConfig.scale : null;\r\n\tthis.type = oConfig && typeof oConfig.type === \"string\" ? oConfig.type.toLowerCase() : null;\r\n\r\n\tthis.styleIds = {};\r\n}\r\n\r\nNumeric.prototype = Object.create(Type.prototype);\r\nNumeric.prototype.constructor = Numeric;\r\n\r\nNumeric.DEFAULT = {\r\n\tnumberFormat: 0\r\n};\r\n\r\nNumeric.builtin = {\r\n\t1: \"0\",\r\n\t2: \"0.00\",\r\n\t3: \"#,##0\",\r\n\t4: \"#,##0.00\",\r\n\t9: \"0%\",\r\n\t10: \"0.00%\",\r\n\t11: \"0.00E+00\",\r\n\t12: \"# ?/?\",\r\n\t13: \"# ??/??\",\r\n\t37: \"#,##0;(#,##0)\",\r\n\t38: \"#,##0;[Red](#,##0)\",\r\n\t39: \"#,##0.00;(#,##0.00)\",\r\n\t40: \"#,##0.00;[Red](#,##0.00)\",\r\n\t48: \"##0.0E+0\"\r\n};\r\n\r\nNumeric.scientificRegEx = /^-?\\d?(\\.\\d)?\\d*[eE][+-]?\\d{1,3}$/;\r\n\r\n\r\n/**\r\n * Returns the unit specific scale.\r\n *\r\n * @param {string} sUnit Any unit of measure that has been configured within the customizing\r\n * @returns {number|null|undefined} A positive integer that represents the decimal scale or null/undefined in\r\n * case neither dynamic nor fixed scale is available\r\n * @public\r\n */\r\nNumeric.prototype.getScale = function(sUnit) {\r\n\tvar iScale;\r\n\r\n\tif (this.autoScale) {\r\n\t\tiScale = Customizing.getScaleForUnit(sUnit);\r\n\t}\r\n\r\n\tif (isNaN(iScale)) {\r\n\t\tiScale = this.scale;\r\n\t}\r\n\r\n\treturn iScale;\r\n};\r\n\r\n/**\r\n * Returns the numberFormat id of the built-in format or a numberFormat object with the formatting template\r\n *\r\n * @param {string} sUnit Unit of measure that is used to resolve the unit specific scale\r\n * @returns {string} Template for the NumberFormat\r\n */\r\nNumeric.prototype.getNumberFormatTemplate = function(sUnit) {\r\n\tconst scale = this.getScale(sUnit);\r\n\r\n\t// Use built-in template as base\r\n\tlet template = Numeric.builtin[1];\r\n\r\n\t/* Add decimal */\r\n\tif (typeof scale === \"number\" && scale > 0) {\r\n\t\ttemplate += \".\";\r\n\r\n\t\tfor (let i = 0; i < scale; i++) {\r\n\t\t\ttemplate += \"0\";\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.delimiter) {\r\n\t\ttemplate = \"#,##\" + template;\r\n\t}\r\n\r\n\tif (this.type === \"percentage\") {\r\n\t\ttemplate += '%';\r\n\t} else if (sUnit && this.displayUnit) {\r\n\t\ttemplate += '\\\\ \"' + sUnit + '\"';\r\n\t}\r\n\r\n\treturn template;\r\n};\r\n\r\n/**\r\n * Creates the format according to the provided configuration. If the\r\n * format matches any builtin format, it will return a reference to\r\n * its ID instead of the format.\r\n *\r\n * Both cases can serve the Style class that consumes this information.\r\n *\r\n * @param {Object} oData Business object that contains additional data that is used for the formatting\r\n * @returns {Object} Configuration object for NumberFormat initialization\r\n * @protected\r\n */\r\nNumeric.prototype._createConfiguration = function(oData) {\r\n\tconst config = Object.getPrototypeOf(Numeric.prototype)._createConfiguration.call(this, oData);\r\n\r\n\t/*\r\n\t * Evaluate unit of measurement first, because a plain built-in\r\n\t * format is used as template but we need to be able to return\r\n\t * to the DEFAULT value in case the unit is empty or invalid.\r\n\t */\r\n\tconst unit = this.getUnit(oData);\r\n\tconst scale = this.getScale(unit);\r\n\r\n\tif (!this.delimiter && typeof scale !== \"number\" && !unit) {\r\n\t\tconfig.numberFormat = Numeric.DEFAULT.numberFormat;\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\t// Use built-in template as base\r\n\tconst template = this.getNumberFormatTemplate(unit);\r\n\r\n\tconfig.numberFormat = {\r\n\t\tformat: template\r\n\t};\r\n\r\n\t/* Find possible builtin match */\r\n\tfor (const key in Numeric.builtin) {\r\n\t\tif (Numeric.builtin[key] === template) {\r\n\t\t\tconfig.numberFormat = parseInt(key, 10);\r\n\t\t}\r\n\t}\r\n\r\n\treturn config;\r\n};\r\n\r\n/**\r\n * Returns the assigned ID of the Type specific Style that is\r\n * registered in the Styles class.\r\n *\r\n * @param {Object} oData Business Object that contains the property for the UoM\r\n * @param {string|number} [value] Explicit cell value that might be used for semantic formatting\r\n * @returns {number} ID of the registered Style\r\n */\r\nNumeric.prototype.getStyleId = function(oData, value) {\r\n\tvar styleId, unit;\r\n\r\n\t/* Handle simple numeric without unitProperty */\r\n\tif (!this.unitProperty) {\r\n\t\treturn Object.getPrototypeOf(Numeric.prototype).getStyleId.call(this, oData, value);\r\n\t}\r\n\r\n\tif (!oData) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tunit = oData[this.unitProperty];\r\n\tstyleId = this.styleIds[unit];\r\n\r\n\tif (typeof styleId === \"undefined\") {\r\n\t\tthis.styleIds[unit] = this.styles.addStyle(this._createConfiguration(oData));\r\n\t}\r\n\r\n\treturn this.styleIds[unit];\r\n};\r\n\r\n/**\r\n * Returns the data value of the business object that is bound by\r\n * this type. The value is normalized so that different input\r\n * representations will result in the same format.\r\n *\r\n * @param {string} sProperty Name of the property that shall be accessed\r\n * @param {Object} oData Business object that contains the data\r\n *\r\n * @returns {string|number|boolean|null} The value of the given property after type specific processing.\r\n */\r\nNumeric.prototype.getValue = function(sProperty, oData) {\r\n\tvar aSegments, iScale, iExponent, sValue = oData[sProperty];\r\n\r\n\tif (typeof sValue == \"string\" && Numeric.scientificRegEx.test(sValue)) {\r\n\r\n\t\taSegments = sValue.split(/\\.|[eE]/g);\r\n\t\tiScale = aSegments.length === 3 ? aSegments[1].length : 0;\r\n\t\tiExponent = Number(aSegments[aSegments.length - 1]);\r\n\r\n\t\t/* According to OData V4 Edm.Double is an IEEE 754 binary64 floating-point number (15-17 decimal digits) */\r\n\t\tsValue = Number(sValue).toFixed(Math.max(iScale - iExponent, 0));\r\n\r\n\t\t/* Write back the transformed value to avoid subsequent transformations */\r\n\t\toData[sProperty] = sValue;\r\n\t}\r\n\r\n\treturn sValue;\r\n};\r\n\r\n/**\r\n * Checks if the given value can be displayed in the IEEE 754\r\n * specification format. The function ignores leading and trailing\r\n * zeros and compares if the length of the actual value does not exceed\r\n * 15 digits plus an optional decimal separator.\r\n *\r\n * The number might exceed 15 digits if it contains leading or\r\n * trailing zeros.\r\n *\r\n * @param {string} sValue Numeric value that needs to be checked\r\n * @param {Object} oData Business object that contains additional information like unit and scale\r\n * @returns {boolean} Whether the number needs to be formatted as BigNumber or not\r\n */\r\nNumeric.prototype.isIEEE754Compliant = function(sValue, oData) {\r\n\tvar bCompliant = false;\r\n\tvar sUnit = this.getUnit(oData);\r\n\tvar iScale = this.getScale(sUnit);\r\n\r\n\tif (typeof sValue == \"number\") {\r\n\t\t// eslint-disable-next-line no-param-reassign\r\n\t\tsValue = \"\" + sValue;\r\n\t}\r\n\r\n\tif (typeof sValue == \"string\") {\r\n\t\tbCompliant = sValue\r\n\t\t\t.trim()\r\n\t\t\t.replace(/^-*0*|0+$/g, \"\")\r\n\t\t\t.split(\".\")\r\n\t\t\t.reduce(function(acc, value, index) {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * The array cannot have more than 2 entries, so we take the scale\r\n\t\t\t\t * into account for all indices higher than 0.\r\n\t\t\t\t */\r\n\t\t\t\tvar length = index > 0 && typeof iScale === \"number\" ? Math.min(iScale, value.length) : value.length;\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t* Returns 1 if the value left of the separator is\r\n\t\t\t\t* zero and was cut of by removing leading and trailing zeros\r\n\t\t\t\t*/\r\n\t\t\t\treturn acc + length || 1;\r\n\t\t\t}, 0) <= 15;\r\n\t}\r\n\r\n\treturn bCompliant;\r\n};\r\n\r\n/**\r\n * Resolves the unit of measurement that is required for the specific formatting.\r\n * @param {Object} oData Data object that represents the row.\r\n * @returns {string} Unit of measurement or empty string.\r\n * @protected\r\n */\r\nNumeric.prototype.getUnit = function(oData) {\r\n\tvar unit;\r\n\r\n\t/* Obtain unit of measurement if available */\r\n\tif (this.type === \"percentage\") {\r\n\t\tunit = \"%\";\r\n\t} else if (typeof this.unitProperty === \"string\" && oData) {\r\n\t\tunit = oData[this.unitProperty];\r\n\t} else if (typeof this.unit === \"string\") {\r\n\t\tunit = this.unit;\r\n\t}\r\n\r\n\t/* Ignore invalid units */\r\n\tif (typeof unit !== \"string\" || unit === '\"') {\r\n\t\tunit = \"\";\r\n\t}\r\n\r\n\treturn unit || \"\";\r\n};\r\n\r\nmodule.exports = Numeric;","var Type = require(\"./Type\");\r\nvar Alignment = require(\"../../style/Alignment\");\r\n\r\nvar sCompliantLineBreak = String.fromCharCode(13, 10);\r\n\r\n/**\r\n * The Text class represents textual information without any\r\n * particular formatting. It provides font and sizing details that\r\n * can be used by the Styles class.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this Text type\r\n * @param {Object} [oConfig.font] Font configuration object\r\n * @param {number} [oConfig.font.size] Font size\r\n * @param {string} [oConfig.font.name] Font name i.E. Arial, Verdana, etc.\r\n * @param {Object} [oConfig.fill] Cell fill configuration object\r\n * @param {string} [oConfig.fill.color] Cell fill background color\r\n * @param {string} [oConfig.fill.type] Cell fill type\r\n * @param {string} [oConfig.template] Text template for this Type\r\n * @param {string} [oConfig.hierarchyLevel] Property name that is used for hierarchy level indentation\r\n * @param {boolean} [oConfig.wrap] Indicates the wrapping behavior of the text cell\r\n * @param {string} [oConfig.inputFormat] RegExp that identifies parts of the value to process it with a template\r\n * @constructor\r\n */\r\nfunction Text(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.font = oConfig ? oConfig.font : null;\r\n\tthis.fill = oConfig ? oConfig.fill : null;\r\n\tthis.template = oConfig ? oConfig.template : null;\r\n\tthis.hierarchyLevel = oConfig ? oConfig.hierarchyLevel : null;\r\n\tthis.wrap = oConfig ? oConfig.wrap : false;\r\n\tthis.inputFormat = oConfig ? oConfig.inputFormat : null;\r\n\r\n\tthis._mStyleIds = {};\r\n}\r\n\r\nText.prototype = Object.create(Type.prototype);\r\nText.prototype.constructor = Text;\r\n\r\nText.DEFAULT = {\r\n\tfont: {\r\n\t\tsize: 11,\r\n\t\tname: \"Arial\"\r\n\t}\r\n};\r\n\r\nText.formulaRegex = /^[\\s]*[=+\\-@]/;\r\n\r\n/**\r\n * Ensures that all line breaks use CR + LF.\r\n *\r\n * @param {string} sValue Text that may contain line breaks\r\n * @return {string} Initial text with replaced line breaks\r\n */\r\nText.convertLineBreaks = function(sValue) {\r\n\r\n\tif (typeof sValue !== \"string\") {\r\n\t\treturn sValue;\r\n\t}\r\n\r\n\treturn sValue.replace(/\\r/g, \"\").replace(/\\n/g, sCompliantLineBreak);\r\n};\r\n\r\n/**\r\n * This method creates the XLSX specific style configuration depending on the cell content\r\n *\r\n * @param {Object} oData Line item that will be used to evaluate the cell content\r\n * @returns {Object} Style configuration used by the Styles class\r\n * @protected\r\n */\r\nText.prototype._createConfiguration = function(oData) {\r\n\tvar config;\r\n\r\n\tconfig = Object.getPrototypeOf(Text.prototype)._createConfiguration.call(this);\r\n\tconfig.fill = this.fill;\r\n\tconfig.font = this.font;\r\n\r\n\t/* Overwrites existing alignment for a proper indent */\r\n\tif (this.hierarchyLevel) {\r\n\t\tconfig.align = {\r\n\t\t\thorizontal: Alignment.horizontal.LEFT,\r\n\t\t\tindent: 2 * oData[this.hierarchyLevel]\r\n\t\t};\r\n\t}\r\n\r\n\t/* Wrapping can be applied on hierarchies with indentation */\r\n\tif (this.wrap) {\r\n\t\tconfig.align = config.align || {};\r\n\r\n\t\tconfig.align.wrap = this.wrap;\r\n\t}\r\n\r\n\treturn config;\r\n};\r\n\r\n/**\r\n * Returns the assigned ID of the Type specific Style that is\r\n * registered in the Styles class.\r\n *\r\n * @param {Object} oData Business Object that contains the property for hierarchy levels\r\n * @param {string|number} [sValue] Explicit cell value that might be used for semantic formatting\r\n * @returns {number} ID of the registered Style\r\n */\r\nText.prototype.getStyleId = function(oData, sValue) {\r\n\tvar bRequiresPrefix, sIdentifier, oConfig;\r\n\r\n\tif (!oData) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tbRequiresPrefix = sValue && Text.formulaRegex.test(sValue);\r\n\r\n\t/* Handle simple styling without hierarchy information or prefix */\r\n\tif (!this.hierarchyLevel && !bRequiresPrefix) {\r\n\t\treturn Object.getPrototypeOf(Text.prototype).getStyleId.call(this);\r\n\t}\r\n\r\n\t/* Create local identifier to differentiate between cached styleIds */\r\n\tsIdentifier = \"id_\" + oData[this.hierarchyLevel] + (bRequiresPrefix ? \"_prefix\" : \"\");\r\n\r\n\tif (typeof this._mStyleIds[sIdentifier] === \"undefined\") {\r\n\t\toConfig = this._createConfiguration(oData);\r\n\t\toConfig.quotePrefix = bRequiresPrefix;\r\n\t\tthis._mStyleIds[sIdentifier] = this.styles.addStyle(oConfig);\r\n\t}\r\n\r\n\treturn this._mStyleIds[sIdentifier];\r\n};\r\n\r\n/**\r\n * Returns the data value of the business object that is bound by\r\n * this type. If a template is configured, it will automatically fill\r\n * the template with the values from the business object and returns\r\n * the processed string.\r\n *\r\n * @param {string|Array} properties Name of the property or array of properties that shall be accessed.\r\n * @param {Object} oData Business object that contains the data.\r\n *\r\n * @returns {string|number|boolean} The value of the given property after type specific processing.\r\n */\r\nText.prototype.getValue = function(properties, oData) {\r\n\tvar aMatch, reRegEx, sResult, bSkip, sValue, aValues, aInputMatch;\r\n\r\n\tif (!this.template) {\r\n\t\tsValue = typeof properties === \"string\" ? oData[properties] : oData[properties[0]];\r\n\r\n\t\tsValue = this.wrap ? Text.convertLineBreaks(sValue) : sValue;\r\n\r\n\t\treturn sValue;\r\n\t}\r\n\r\n\tif (typeof this.inputFormat === \"string\") {\r\n\t\taInputMatch = new RegExp(this.inputFormat).exec(oData[properties]);\r\n\r\n\t\t/* Keeps the initial value in case the input does not match the regex pattern */\r\n\t\taValues = Array.isArray(aInputMatch) ? aInputMatch.slice(1) : [oData[properties]];\r\n\t} else {\r\n\t\taValues = properties.reduce(function(acc, property) {\r\n\t\t\tacc.push(oData[property]);\r\n\r\n\t\t\treturn acc;\r\n\t\t}, []);\r\n\t}\r\n\r\n\t// Obtain if the further processing should be skipped due to missing values for the template\r\n\tbSkip = aValues.every(function(value) {\r\n\t\treturn value === null\r\n\t\t\t|| typeof value === \"undefined\"\r\n\t\t\t|| (typeof value === \"string\" && value === \"\");\r\n\t});\r\n\r\n\tif (bSkip) {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tsResult = this.template;\r\n\treRegEx = /{([0-9]+)}/g;\r\n\r\n\taMatch = reRegEx.exec(this.template);\r\n\twhile (aMatch !== null) {\r\n\r\n\t\tsValue = aValues[aMatch[1]];\r\n\r\n\t\t// Overwrite empty or undefined values by an empty string\r\n\t\tif (sValue === null || typeof sValue === \"undefined\") {\r\n\t\t\tsValue = \"\";\r\n\t\t}\r\n\r\n\t\t// Replaces the matched placeholder by the indexed property value\r\n\t\tsResult = sResult.replace(aMatch[0], sValue);\r\n\r\n\t\taMatch = reRegEx.exec(this.template);\r\n\t}\r\n\r\n\treturn sResult;\r\n};\r\n\r\nmodule.exports = Text;","var Customizing = require(\"../Customizing\");\r\nvar Type = require(\"./Type\");\r\n\r\n/**\r\n * The Timezone class represents a data type similar to\r\n * Enumeration but refers to the timezone customizing.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this type\r\n * @constructor\r\n */\r\nfunction Timezone(oConfig) {\r\n\tType.call(this, oConfig);\r\n}\r\n\r\nTimezone.prototype = Object.create(Type.prototype);\r\nTimezone.prototype.constructor = Timezone;\r\n\r\n/**\r\n * Returns the mapped value for the key that is present in the\r\n * business object. If no translation is available for the given key,\r\n * the key is returned.\r\n *\r\n * @param {string} sProperty Name of the property that contains the key\r\n * @param {Object} oData Business object that contains the data\r\n * @returns {string} The value of the given property after type specific processing\r\n * @protected\r\n */\r\nTimezone.prototype.getValue = function(sProperty, oData) {\r\n\tconst sKey = oData[sProperty];\r\n\r\n\treturn Customizing.getTimezoneTranslation(sKey);\r\n};\r\n\r\nmodule.exports = Timezone;","/**\r\n * The Type class defines a supported data type, like strings,\r\n * numeric values, decimals, dates, currencies and so on. It is NOT\r\n * part of the XML representation of the generated Excel document.\r\n *\r\n * This class is marked as abstract therefore only its sub-classes\r\n * should be used.\r\n *\r\n * @param {Object} oConfig Type specific configuration\r\n * @constructor\r\n * @abstract\r\n */\r\nfunction Type(oConfig) {\r\n\tthis.styleId = null;\r\n\tthis.alignment = oConfig && oConfig.textAlign ? oConfig.textAlign : null;\r\n}\r\n\r\n/**\r\n * Creates the type specific configuration that is used to register\r\n * its corresponding style in the Styles class.\r\n *\r\n * All subclass implementations have to call the superclass method to\r\n * ensure that alignment information will not be lost.\r\n *\r\n * @param {Object} oData Line item that will be used to evaluate the cell content\r\n * @returns {Object} Configuration object that may contain alignment information\r\n * @protected\r\n */\r\nType.prototype._createConfiguration = function(oData) {\r\n\treturn this.alignment ? { align: {\thorizontal: this.alignment }} : {};\r\n};\r\n\r\n/**\r\n * Returns the assigned ID of the Type specific Style that is\r\n * registered in the Styles class.\r\n *\r\n * @param {Object} [oData] Business object that contains the actual data\r\n * @param {string|number} [vValue] Explicit cell value that might be used for semantic formatting\r\n * @returns {number} ID of the registered Style\r\n */\r\nType.prototype.getStyleId = function(oData, vValue) {\r\n\tif (this.styleId === null) {\r\n\t\tthis.styleId = this.styles.addStyle(this._createConfiguration(oData));\r\n\t}\r\n\r\n\treturn this.styleId;\r\n};\r\n\r\n/**\r\n * Registers the Style configuration of this Type in the given Styles\r\n * class.\r\n *\r\n * @param {Styles} oStyles Styles instance where the Type specific styling will be registered\r\n */\r\nType.prototype.registerAt = function(oStyles) {\r\n\tthis.styles = oStyles;\r\n};\r\n\r\n/**\r\n * Returns the data value of the business object that is bound by\r\n * this type.\r\n *\r\n * @param {string} sProperty Name of the property that shall be accessed.\r\n * @param {Object} oData Business object that contains the data.\r\n *\r\n * @returns {string|number|boolean|null} The value of the given property after type specific processing.\r\n */\r\nType.prototype.getValue = function(sProperty, oData) {\r\n\treturn oData[sProperty];\r\n};\r\n\r\nmodule.exports = Type;","var XMLNode\t\t \t\t= require(\"../xml/XMLNode\"),\r\n\tBigNumber\t\t\t= require(\"../binding/type/BigNumber\"),\r\n\tCalendarDate \t\t= require(\"../binding/type/CalendarDate\"),\r\n\tCalendarDateTime \t= require(\"../binding/type/CalendarDateTime\"),\r\n\tCalendarTime \t\t= require(\"../binding/type/CalendarTime\"),\r\n\tNumeric \t\t\t= require(\"../binding/type/Numeric\"),\r\n\tBooleanType \t\t= require(\"../binding/type/BooleanType\"),\r\n\tCurrency \t\t\t= require(\"../binding/type/Currency\");\r\n\r\n/**\r\n * The Cell class represents a single cell within the spreadsheet\r\n * that has to be assigned to a particular row. A Cell stores\r\n * information supporting several types of data.\r\n *\r\n * @param {Type} oType - The data type of the cell\r\n * @param {SharedStrings} oSharedStrings - SharedStrings instance that will be used by all Cells\r\n * @class\r\n */\r\nfunction Cell(oType, oSharedStrings) {\r\n\tXMLNode.call(this, Cell.metadata);\r\n\r\n\tObject.defineProperty(this, \"type\", { value: Cell.DataType.SharedString, writable: true });\r\n\r\n\tthis._shared = oSharedStrings;\r\n\tthis._oFallbackType = null;\r\n\tthis._applyType(oType);\r\n}\r\n\r\nCell.prototype = Object.create(XMLNode.prototype);\r\nCell.prototype.constructor = Cell;\r\n\r\nCell.DataType = {\r\n\tBoolean: \"b\",\r\n\tDate: \"d\",\r\n\tInlineString: \"inlineStr\", // We do not support inline strings\r\n\tNumber: \"n\",\r\n\tSharedString: \"s\",\r\n\tFormularString: \"str\"\r\n};\r\n\r\nCell._cellTypeProperty = \"cellType\";\r\n\r\nCell.metadata = {\r\n\ttag: \"c\",\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tid: \"reference\",\r\n\t\t\tname: \"r\",\r\n\t\t\tvalue: \"\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"style\",\r\n\t\t\tname: \"s\",\r\n\t\t\tvalue: \"0\" // Default style id\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"text\",\r\n\t\t\ttag: \"v\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Applies the given type to the current Cell and maps to the\r\n * corresponding Office Open XML type definition.\r\n *\r\n * @param {Type} oType - Value of type {@link Type}\r\n * @private\r\n */\r\nCell.prototype._applyType = function(oType) {\r\n\r\n\tthis.bindingType = oType;\r\n\r\n\tswitch (oType.constructor) {\r\n\t\tcase BooleanType:\r\n\t\t\tthis.type = Cell.DataType.Boolean;\r\n\r\n\t\t\tif (!oType.isCustomFormatted()) {\r\n\t\t\t\tthis.addAttribute({\r\n\t\t\t\t\tid: Cell._cellTypeProperty,\r\n\t\t\t\t\tname: \"t\",\r\n\t\t\t\t\tvalue: Cell.DataType.Boolean\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase CalendarDate:\r\n\t\tcase CalendarDateTime:\r\n\t\tcase CalendarTime:\r\n\t\t\tthis.type = Cell.DataType.Date;\r\n\t\t\tbreak;\r\n\r\n\t\tcase Numeric:\r\n\t\tcase Currency:\r\n\t\t\tthis.type = Cell.DataType.Number;\r\n\r\n\t\t\t/*\r\n\t\t\t * As long as _applyType is only called once during\r\n\t\t\t * initialization, the fallbackType can be registered\r\n\t\t\t * without any additional check.\r\n\t\t\t */\r\n\t\t\tthis._oFallbackType = new BigNumber(oType);\r\n\t\t\tthis._oFallbackType.registerAt(oType.styles);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tdefault: // Text is the default case\r\n\t\t\tthis.addAttribute({\r\n\t\t\t\tid: Cell._cellTypeProperty,\r\n\t\t\t\tname: \"t\",\r\n\t\t\t\tvalue: Cell.DataType.SharedString // Default cell type\r\n\t\t\t});\r\n\t\t\tthis.type = Cell.DataType.SharedString;\r\n\t}\r\n};\r\n\r\n/**\r\n * Applies the specified Style to the cell.\r\n *\r\n * @param {number|string} nStyle - Instance of Excel.objects.Style\r\n */\r\nCell.prototype.setStyle = function(nStyle) {\r\n\tthis.style.value = nStyle;\r\n};\r\n\r\n/**\r\n * Applies the specified cell location as reference. The reference\r\n * must match the regular expression of Open Document SpreadsheetML\r\n * sheet format. Starting with at least one uppercase letter for the\r\n * column followed by a number without leading zeros for the row.\r\n * [A-Z]+[1-9]+[0-9]*\r\n *\r\n * @param {string} sReference - Reference of the cells' location\r\n */\r\nCell.prototype.setReference = function(sReference) {\r\n\tif (typeof sReference != \"string\"\r\n\t\t|| !sReference.match(/^[A-Z]+[1-9]+[0-9]*$/g)) {\r\n\t\tthrow new Error(`The given Cell reference \"${sReference}\" does not match the reference pattern.`);\r\n\t}\r\n\r\n\tthis.reference.value = sReference;\r\n};\r\n\r\n/**\r\n * Assigns the value to the current Cell. The method requires a\r\n * property reference and a business object that gets bound depending\r\n * on the property. It is also possible to provide an array of\r\n * properties in case of aggregated columns.\r\n *\r\n * @param {(string|Array)} sProperty - single property or Array of properties\r\n * @param {Object} oBusinessObject - BusinessObject that gets bound to this Cell\r\n */\r\nCell.prototype.setValue = function(sProperty, oBusinessObject) {\r\n\tvar value, bindingType;\r\n\r\n\tbindingType = this.bindingType;\r\n\tvalue = bindingType.getValue(sProperty, oBusinessObject);\r\n\r\n\tif (!this._isValuePresent(value)) {\r\n\r\n\t\t/*\r\n\t\t * We need to clear the value due to the fact\r\n\t\t * that we are re-using the Cell for each row\r\n\t\t */\r\n\t\tthis.text.value = \"\";\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tswitch (this.type) {\r\n\t\tcase Cell.DataType.Boolean:\r\n\r\n\t\t\t/* String representations other than \"true\" will result in the boolean value false */\r\n\t\t\tif (typeof value === \"string\") {\r\n\t\t\t\tvalue = value.toLowerCase() === \"true\";\r\n\t\t\t}\r\n\t\t\tthis.text.value = value ? \"1\" : \"0\";\r\n\r\n\t\t\tbreak;\r\n\t\tcase Cell.DataType.Date:\r\n\t\t\tthis.text.value = value;\r\n\r\n\t\t\tbreak;\r\n\t\tcase Cell.DataType.Number:\r\n\t\t\tif (bindingType.isIEEE754Compliant(value, oBusinessObject)) {\r\n\t\t\t\tthis.text.value = value;\r\n\r\n\t\t\t\tif (this[Cell._cellTypeProperty]) {\r\n\t\t\t\t\tthis.remove(Cell._cellTypeProperty);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t/* Handle fallback case and insert value as SharedString */\r\n\t\t\tbindingType = this._oFallbackType;\r\n\t\t\tvalue = bindingType.getValue(sProperty, oBusinessObject);\r\n\r\n\t\t\tif (!this[Cell._cellTypeProperty]) {\r\n\t\t\t\tthis.addAttribute({\r\n\t\t\t\t\tid: Cell._cellTypeProperty,\r\n\t\t\t\t\tname: \"t\",\r\n\t\t\t\t\tvalue: Cell.DataType.SharedString // Default cell type\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// CAUTION: break is omitted intentionally\r\n\r\n\t\tdefault: // SharedString is the default case\r\n\t\t\tthis.text.value = this._shared.insert(value);\r\n\t}\r\n\r\n\t/*\r\n\t * Forces a style update once the value changed. This allows cell\r\n\t * specific styles for currency types. Due to the fact that the\r\n\t * Style ID gets cached within the Type, there is no performance\r\n\t * impact even on large data sets.\r\n\t */\r\n\tthis.setStyle(bindingType.getStyleId(oBusinessObject, value));\r\n};\r\n\r\n/**\r\n * Checks whether there is a value provided or not. Allowed values\r\n * are Stringsas well as numeric and boolean values. Empty Strings\r\n * will be evaluated as no value, but the numeric value 0 is a value.\r\n *\r\n * @param {(string|number|boolean|Array)} data - The value that gets checked\r\n * @returns {boolean} - true if a value is present, false if not\r\n * @private\r\n */\r\nCell.prototype._isValuePresent = function(data) {\r\n\treturn ((typeof data === \"string\" && !!data)\r\n\t\t|| typeof data === \"number\"\r\n\t\t|| typeof data === \"boolean\"\r\n\t\t|| data instanceof Date);\r\n};\r\n\r\n/**\r\n * Specialized serialization of the Cell which prevents that empty\r\n * cells are getting serialized at all. This can reduce the size of\r\n * the parent Sheet.\r\n *\r\n * @function serialize\r\n * @returns {string} XML formatted string representation of the cell\r\n */\r\nCell.prototype.serialize = function() {\r\n\tif (!this._isValuePresent(this.text.value)) {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\treturn XMLNode.prototype.serialize.call(this);\r\n};\r\n\r\nmodule.exports = Cell;","/**\r\n * Created by Sebastian Bender on 16.03.2017.\r\n */\r\nvar XMLNode = require(\"../xml/XMLNode\");\r\nvar Cell\t= require(\"./Cell\");\r\n\r\n/**\r\n * The Row is representing a single row according to the Office Open\r\n * XML standard. A Row provides information about its index (line\r\n * number) and can contain several Cell objects.\r\n *\r\n * @class\r\n */\r\nfunction Row() {\r\n\tXMLNode.call(this, Row.metadata);\r\n}\r\n\r\nRow.prototype = Object.create(XMLNode.prototype);\r\nRow.prototype.constructor = Row;\r\n\r\nRow.metadata = {\r\n\ttag: \"row\",\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tid: \"reference\",\r\n\t\t\tname: \"r\",\r\n\t\t\tvalue: \"\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"spans\",\r\n\t\t\tname: \"spans\",\r\n\t\t\tvalue: \"1:1\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Calculates the Office Open XML Spreadsheet column reference for a\r\n * numeric value. Referring to the standard, the column is described\r\n * as a alphabetical value consisting of at least one uppercase character.\r\n * This function maps these alphabetical representation to numerical\r\n * zero-based indices.\r\n *\r\n * i.E. the column index 27 (which is the 28th column) results in \"AB\"\r\n *\r\n * @param {number} nIndex - Numerical index for the requested column\r\n * @returns {string} - The alphabetical column reference for the given index.\r\n */\r\nRow.getColumnReferenceByIndex = function(nIndex) {\r\n\treturn nIndex < 26 ?\r\n\t\tString.fromCharCode(65 + nIndex) :\r\n\t\tRow.getColumnReferenceByIndex(Math.floor(nIndex / 26) - 1) + String.fromCharCode(65 + (nIndex % 26));\r\n};\r\n\r\n\r\n/**\r\n * Update the \"spans\" attribute on this particular {@link Row} for\r\n * optimization purposes. This property optimizes the loading and\r\n * rendering in Microsoft Excel.\r\n *\r\n * @private\r\n */\r\nRow.prototype._updateSpans = function() {\r\n\tthis.spans.value = \"1:\" + this.childs.length;\r\n};\r\n\r\n/**\r\n * Adds the specified {@link Cell} to the current {@link Row}. If the\r\n * current row already has a reference or style, it will propagate\r\n * this information to the newly added Cell.\r\n *\r\n * @param {object} oCell - Instance of Excel.objects.Cell\r\n */\r\nRow.prototype.addCell = function(oCell) {\r\n\tvar count;\r\n\r\n\tif (!oCell || !(oCell instanceof Cell)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tcount = this.childs.push(oCell);\r\n\tthis._updateSpans();\r\n\r\n\t/* Applies the cell reference if row reference is already present */\r\n\tif (this.reference.value) {\r\n\t\toCell.setReference(Row.getColumnReferenceByIndex(count - 1) + this.reference.value);\r\n\t}\r\n\r\n\tif (this.style) {\r\n\t\toCell.setStyle(this.style.value);\r\n\t}\r\n};\r\n\r\n\r\n/**\r\n * Updates the reference of the current {@link Row}. The Row reference\r\n * represents the line number within the Sheet. It will\r\n * automatically update all assigned Cell references.\r\n *\r\n * @param {string} sReference - Row number within the sheet\r\n */\r\nRow.prototype.setReference = function(sReference) {\r\n\tvar i, reference;\r\n\r\n\treference = typeof sReference == \"number\" ? String(sReference) : sReference;\r\n\tif (!reference || !reference.match(/^[1-9]+[0-9]*$/g)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/* Only update if necessary */\r\n\tif (this.reference.value != reference) {\r\n\t\tthis.reference.value = reference;\r\n\t\tfor (i = 0; i < this.childs.length; i++) {\r\n\t\t\tthis.childs[i].setReference(Row.getColumnReferenceByIndex(i) + reference);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Applies the given {@link Style} to the current {@link Row}.\r\n *\r\n * @param {(number|string)} nStyle - A number or string representing the Style id\r\n */\r\nRow.prototype.setStyle = function(nStyle) {\r\n\tvar i, style;\r\n\r\n\tif (!this.style) {\r\n\t\tstyle = this.addAttribute({name: \"s\"});\r\n\t\tObject.defineProperty(this, \"style\", {value: style});\r\n\t}\r\n\r\n\tthis.style.value = nStyle;\r\n\tfor (i = 0; i < this.childs.length; i++) {\r\n\t\tthis.childs[i].setStyle(nStyle);\r\n\t}\r\n};\r\n\r\nmodule.exports = Row;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The SharedString class represents each shared String within the\r\n * SharedStrings file.\r\n *\r\n * @param {string} sValue - The String that gets represented by this SharedString object\r\n * @class\r\n */\r\nfunction SharedString(sValue) {\r\n\tXMLNode.call(this, SharedString.metadata);\r\n\r\n\tthis.setValue(sValue);\r\n}\r\n\r\nSharedString.prototype = Object.create(XMLNode.prototype);\r\nSharedString.prototype.constructor = SharedString;\r\n\r\nSharedString.spacePreserveAttributeId = \"spacePreserve\";\r\n\r\n// eslint-disable-next-line no-control-regex, max-len\r\nSharedString.controlCharacterTestRegex = /[\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x0B\\x0C\\x0E\\x0F\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1A\\x1B\\x1C\\x1D\\x1E\\x1F]/m;\r\n// eslint-disable-next-line no-control-regex, max-len\r\nSharedString.controlCharacterReplaceRegex = /[\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x0B\\x0C\\x0E\\x0F\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1A\\x1B\\x1C\\x1D\\x1E\\x1F]/gm;\r\n\r\n// Matches space either at the beginning or the end\r\nSharedString.spacePreserveRegex = /^ | $/;\r\n\r\nSharedString.metadata = {\r\n\ttag: \"si\",\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"text\",\r\n\t\t\ttag: \"t\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Replaces XML incompatible control characters with their corresponding Office Open XML escape sequence.\r\n *\r\n * @param {string} sValue - String that contains ASCII control characters\r\n * @returns {string} - Escaped string\r\n * @private\r\n */\r\nSharedString._escapeControlCharacters = function(sValue) {\r\n\tvar sCharHex;\r\n\r\n\treturn sValue.replace(SharedString.controlCharacterReplaceRegex, function(sMatch) {\r\n\t\tsCharHex = sMatch.codePointAt(0).toString(16).toUpperCase();\r\n\r\n\t\t/* Works only with control characters in ASCII range - do NOT use with Emojis */\r\n\t\treturn \"_x00\" + (sCharHex.length === 1 ? \"0\" : \"\") + sCharHex + \"_\";\r\n\t});\r\n};\r\n\r\n/**\r\n * Assigns the given value to the current SharedString instance.\r\n *\r\n * @function\r\n * @param {string} sValue - The string value that should be added\r\n */\r\nSharedString.prototype.setValue = function(sValue) {\r\n\r\n\tthis.text.remove(SharedString.spacePreserveAttributeId);\r\n\r\n\tif (SharedString.controlCharacterTestRegex.test(sValue)) {\r\n\t\tsValue = SharedString._escapeControlCharacters(sValue);\r\n\t}\r\n\r\n\tif (SharedString.spacePreserveRegex.test(sValue)) {\r\n\t\tthis.text.addAttribute({\r\n\t\t\tid: SharedString.spacePreserveAttributeId,\r\n\t\t\tname: \"space\",\r\n\t\t\tprefix: \"xml\",\r\n\t\t\tvalue: \"preserve\"\r\n\t\t});\r\n\t}\r\n\r\n\tif (sValue && typeof sValue == \"string\") {\r\n\t\tthis.text.value = sValue;\r\n\t} else {\r\n\r\n\t\t/**\r\n\t\t * There are other implementations for creating a string\r\n\t\t * representation out of a number that might be more\r\n\t\t * convenient like new String(number).toString() or\r\n\t\t * number.toString() but \"\" + number is the best performing.\r\n\t\t */\r\n\t\tthis.text.value = \"\" + sValue;\r\n\t}\r\n};\r\n\r\n/**\r\n * Serializes the XMLNode and transforms the concatenated string into a sequential string.\r\n * @return {string} - String representation of the SharedString\r\n *\r\n * @override\r\n */\r\nSharedString.prototype.serialize = function() {\r\n\tvar sSerialized;\r\n\r\n\tsSerialized = Object.getPrototypeOf(SharedString.prototype).serialize.call(this);\r\n\r\n\treturn (\" \" + sSerialized).substr(1);\r\n};\r\n\r\nmodule.exports = SharedString;","var XMLFile\t\t\t= require(\"../xml/XMLFile\"),\r\n\tSharedString\t= require(\"./SharedString\");\r\n\r\n/**\r\n * The SharedStrings class represents the list of shared String\r\n * objects that is used in the Office Open XMl Spreadsheet. The\r\n * SharedStrings object reduces redundancy within the data by\r\n * providing a reference to unique Strings instead of repeating\r\n * them.\r\n *\r\n * Due to the fact that the Strings are shared within the whole\r\n * workbook, each instance of the document export only has one\r\n * single instance of SharedString and therefore it uses the\r\n * Singleton pattern to ensure this.\r\n *\r\n * @class\r\n */\r\nfunction SharedStrings() {\r\n\tXMLFile.call(this, SharedStrings.metadata);\r\n\r\n\tObject.defineProperty(this, \"map\", {value: new Map(), writable: false});\r\n\tObject.defineProperty(this, \"_shared\", {value: new SharedString(\"\"), writable: false});\r\n\r\n\tSharedStrings.instance = this;\r\n}\r\n\r\nSharedStrings.prototype = Object.create(XMLFile.prototype);\r\nSharedStrings.prototype.constructor = SharedStrings;\r\n\r\nSharedStrings.MAX_CELL_LENGTH = 32767;\r\n\r\n/**\r\n * Retrieves the Singleton instance of SharedStrings. If no instance is present, it will create one.\r\n *\r\n * @function\r\n * @returns {object} - Singleton instance\r\n */\r\nSharedStrings.getInstance = function() {\r\n\tif (!SharedStrings.instance) {\r\n\t\tSharedStrings.instance = new SharedStrings();\r\n\t}\r\n\r\n\treturn SharedStrings.instance;\r\n};\r\n\r\nSharedStrings.metadata = {\r\n\tfilename: \"sharedStrings.xml\",\r\n\ttag: \"sst\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"count\",\r\n\t\t\tname: \"count\",\r\n\t\t\tvalue: 0\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"uniqueCount\",\r\n\t\t\tname: \"uniqueCount\",\r\n\t\t\tvalue: 0\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Adds the specified string value to the set of SharedStrings. The\r\n * method creates a SharedString proxy object that contains\r\n * information about the string itself as well as its index. The\r\n * index is zero-based and can be used for referencing within Cell\r\n * objects.\r\n *\r\n * @function insert\r\n * @param {string} sValue - The string that has to be inserted\r\n * @return {object} - The SharedString instance that represents the provided string value\r\n */\r\nSharedStrings.prototype.insert = function(sValue) {\r\n\tvar index;\r\n\r\n\tthis.count.value = this.count.value + 1;\r\n\r\n\tif (sValue.length > SharedStrings.MAX_CELL_LENGTH) {\r\n\t\tsValue = sValue.substring(0, SharedStrings.MAX_CELL_LENGTH + 1);\r\n\t}\r\n\r\n\tif (this.map.has(sValue)) {\r\n\t\treturn this.map.get(sValue);\r\n\t}\r\n\r\n\tthis._shared.setValue(sValue);\r\n\tindex = this.map.size;\r\n\tthis.map.set(sValue, index);\r\n\r\n\t/* The SharedString needs to be added to the child nodes as well for serialization purposes */\r\n\tthis.childs.push(this._shared.serialize());\r\n\tthis.uniqueCount.value = this.childs.length;\r\n\r\n\treturn index;\r\n};\r\n\r\n/**\r\n * Cleanup hook that gets executed when the XMLFile#serialize function\r\n * is called with the finalize flag.\r\n *\r\n * @private\r\n */\r\nSharedStrings.prototype.cleanup = function() {\r\n\tthis.map.clear();\r\n};\r\n\r\nmodule.exports = SharedStrings;","var XMLFile\t\t = require(\"../xml/XMLFile\"),\r\n\tRow\t\t\t = require(\"./Row\");\r\n\r\n/**\r\n * This class represents a Sheet within an Office Open XML Spreadsheet.\r\n * @param {Object} oColumnConfiguration - ColumnConfiguration object that provides information about the columns\r\n * @constructor\r\n */\r\nfunction Sheet(oColumnConfiguration) {\r\n\tXMLFile.call(this, Sheet.metadata);\r\n\r\n\tObject.defineProperty(this, \"_columns\", {value: oColumnConfiguration, writable: false});\r\n\r\n\tthis._hierarchyProperty = oColumnConfiguration._hierarchyProperty;\r\n\tthis._hierarchyLevel = 0;\r\n\tthis._rowCount = 0;\r\n\tthis._createCols();\r\n\tthis._createHeader();\r\n}\r\n\r\nSheet.prototype = Object.create(XMLFile.prototype);\r\nSheet.prototype.constructor = Sheet;\r\n\r\nSheet.metadata = {\r\n\ttag: \"worksheet\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"r\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"mc\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\ttag: \"sheetPr\",\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttag: \"outlinePr\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"summaryBelow\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"dimension\",\r\n\t\t\ttag: \"dimension\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"reference\",\r\n\t\t\t\t\tname: \"ref\",\r\n\t\t\t\t\tvalue: \"A1\" // Default dimension of an empty Sheet\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"views\",\r\n\t\t\ttag: \"sheetViews\",\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"defaultView\",\r\n\t\t\t\t\ttag: \"sheetView\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"workbookViewId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\tproperties: [\r\n\r\n\t\t\t\t\t\t/* Freezes the header row */\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tid: \"pane\",\r\n\t\t\t\t\t\t\ttag: \"pane\",\r\n\t\t\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tname: \"ySplit\",\r\n\t\t\t\t\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tname: \"topLeftCell\",\r\n\t\t\t\t\t\t\t\t\tvalue: \"A2\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tname: \"activePane\",\r\n\t\t\t\t\t\t\t\t\tvalue: \"bottomLeft\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tname: \"state\",\r\n\t\t\t\t\t\t\t\t\tvalue: \"frozen\"\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t]\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"format\",\r\n\t\t\ttag: \"sheetFormatPr\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"defaultRowHeight\",\r\n\t\t\t\t\tvalue: \"15\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"columns\",\r\n\t\t\ttag: \"cols\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"data\",\r\n\t\t\ttag: \"sheetData\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"filter\",\r\n\t\t\ttag: \"autoFilter\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"reference\",\r\n\t\t\t\t\tname: \"ref\",\r\n\t\t\t\t\tvalue: \"A1\" // Default dimension of an empty Sheet\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"pageMargins\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"left\",\r\n\t\t\t\t\tvalue: \"0.75\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"right\",\r\n\t\t\t\t\tvalue: \"0.75\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"top\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"bottom\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"header\",\r\n\t\t\t\t\tvalue: \"0.5\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"footer\",\r\n\t\t\t\t\tvalue: \"0.5\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\nSheet.MAX_ROWS = 1048576;\r\n\r\n/**\r\n * Creates the column specific information within the worksheet.\r\n * Column specific information is i.E. the width or the use of the\r\n * bestFit functionality.\r\n *\r\n * @private\r\n */\r\nSheet.prototype._createCols = function() {\r\n\tvar col, i, minWidth, width,\r\n\t\tautoFitButtonOffset = 2.4;\r\n\r\n\t/**\r\n\t * Inner function for calculating the column width. The function\r\n\t * will ceil the width to the next step of 0.25 so that the\r\n\t * result mod step is 0.\r\n\t * @param {number} nWidth - The width that needs to be adjusted\r\n\t * @returns {number} A width rounded to the accuracy of 0.25\r\n\t */\r\n\tfunction roundWidth(nWidth) {\r\n\t\tvar factor, step;\r\n\r\n\t\tstep = 0.25;\r\n\t\tfactor = 1 / step;\r\n\r\n\t\treturn Math.ceil(nWidth * factor) / factor;\r\n\t}\r\n\r\n\tfor (i = 0; i < this._columns.size(); i++) {\r\n\t\tcol = this._columns.columns[i];\r\n\t\tminWidth = this._calculateColumnWidth(col.label.length) + autoFitButtonOffset;\r\n\t\twidth = roundWidth(Math.max(this._calculateColumnWidth(col.width), minWidth));\r\n\r\n\t\tthis.columns.addChild({\r\n\t\t\ttag: \"col\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"min\",\r\n\t\t\t\t\tvalue: (i + 1)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"max\",\r\n\t\t\t\t\tvalue: (i + 1)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"bestFit\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"width\",\r\n\t\t\t\t\tvalue: Math.max(width, minWidth)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"customWidth\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t});\r\n\t}\r\n};\r\n\r\n/**\r\n * This method calculates the optimal column width for the given\r\n * amount of characters. It removes the dependency on font size or\r\n * pixel width. This calculation is based on Office Open SpreadsheetML\r\n * (ISO/IEC 29500-1:2016) section 18.3.1.13\r\n *\r\n * @param {number} nCharacters - Amount of characters that should fit into the column\r\n * @return {number} Excel internal width value corresponding to the used font size\r\n * @private\r\n */\r\nSheet.prototype._calculateColumnWidth = function(nCharacters) {\r\n\tvar defaultPaddingAndBorder = 5,\r\n\t\tdefaultFontWidth = 8;\r\n\r\n\tif (typeof nCharacters !== \"number\") {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\treturn Math.floor(((nCharacters * defaultFontWidth) + defaultPaddingAndBorder) / defaultFontWidth * 256) / 256;\r\n};\r\n\r\n/**\r\n * Sets the maximal hierarchy depth of this Sheet. The value will\r\n * only be changed if the given depth is higher than the previous\r\n * depth.\r\n *\r\n * @param {number} nHierarchyDepth - Numerical hierarchy depth\r\n * @private\r\n */\r\nSheet.prototype._setHierarchyDepth = function(nHierarchyDepth) {\r\n\r\n\t/* The maximum supported hierarchy depth is 7 */\r\n\tif (typeof nHierarchyDepth !== \"number\" || nHierarchyDepth < 1 || nHierarchyDepth > 7) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// eslint-disable-next-line no-param-reassign\r\n\tnHierarchyDepth = nHierarchyDepth || 0;\r\n\r\n\tif (!this.format.hierarchyDepth) {\r\n\t\tthis.format.addAttribute({\r\n\t\t\tid: \"hierarchyDepth\",\r\n\t\t\tname: \"outlineLevelRow\",\r\n\t\t\tvalue: nHierarchyDepth\r\n\t\t});\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis.format.hierarchyDepth.value = Math.max(this.format.hierarchyDepth.value, nHierarchyDepth);\r\n};\r\n\r\n/**\r\n * Requests the header Row from the ColumnConfiguration and adds it to the\r\n * sheet.\r\n *\r\n * @private\r\n */\r\nSheet.prototype._createHeader = function() {\r\n\tvar headerRow = this._columns.getHeader();\r\n\r\n\tif (headerRow === null) {\r\n\t\tthis.remove(\"filter\");\r\n\t\tthis.views.defaultView.remove(\"pane\");\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis._appendRow(headerRow);\r\n};\r\n\r\n/**\r\n * Adds the specified Row to the sheetData element of this Sheet and\r\n * automatically propagates its row index to the row and its cells.\r\n *\r\n * @param {Object} oRow - The Row object that should be appended to the current Sheet\r\n * @private\r\n */\r\nSheet.prototype._appendRow = function(oRow) {\r\n\tvar dimension, sSerializedRow;\r\n\r\n\tthis._rowCount++;\r\n\toRow.setReference(\"\" + (this._rowCount));\r\n\r\n\tsSerializedRow = oRow.serialize();\r\n\r\n\t/* Bundle two rows into one string */\r\n\tif (this._rowCount % 2 === 0) {\r\n\t\tsSerializedRow = this.data.childs.pop() + sSerializedRow;\r\n\t}\r\n\r\n\t/*\r\n\t * Serializing the rows would create concatenated strings that are represented by a binary\r\n\t * tree that references all substrings as leaves. This increases the memory usage massively.\r\n\t *\r\n\t * To avoid this string representation we need to convert the concatenated string to a\r\n\t * sequential string by using String#substr. This reduces memory consumption\r\n\t * and due to less Garbage Collection runs, also the runtime, although there is additional\r\n\t * effort to convert the strings.\r\n\t *\r\n\t * Additional information can be found here:\r\n\t * https://bugs.chromium.org/p/v8/issues/detail?id=2869\r\n\t */\r\n\tthis.data.childs.push((\" \" + sSerializedRow).substr(1));\r\n\r\n\t/* Update sheet dimension */\r\n\tdimension = \"A1:\" + Row.getColumnReferenceByIndex(this._columns.size() - 1) + this._rowCount;\r\n\r\n\tthis.dimension.reference.value = dimension;\r\n\r\n\tif (this.filter) {\r\n\t\tthis.filter.reference.value = dimension;\r\n\t}\r\n\r\n\r\n};\r\n\r\n/**\r\n * Creates a new group inside the sheet with the given hierarchy\r\n * level. All subsequent data rows will be assigned to this group.\r\n *\r\n * @function createGroup\r\n * @param {string} sName - Name of the group that will be displayed in the group header\r\n * @param {number} nLevel - Hierarchy level that will be used for outlining\r\n */\r\nSheet.prototype.createGroup = function(sName, nLevel) {\r\n\tvar groupHeaderRow;\r\n\r\n\tthis._hierarchyLevel = nLevel;\r\n\tgroupHeaderRow = this._columns.getGroupHeader(sName);\r\n\r\n\tthis._appendRow(groupHeaderRow);\r\n};\r\n\r\n/**\r\n * Requests a row from the ColumnConfiguration containing the given data\r\n * and adds it to the sheetData element of this Sheet.\r\n *\r\n * The maximum row limit is 1,048,576 but the user rather runs out of\r\n * memory than reaching this limit.\r\n *\r\n * @function insert\r\n * @param {Object} oData - Data object to be inserted\r\n */\r\nSheet.prototype.insert = function(oData) {\r\n\tvar nHierarchyLevel;\r\n\r\n\tif (this._rowCount >= Sheet.MAX_ROWS) {\r\n\t\tthrow new Error(\"Row limit reached.\");\r\n\t}\r\n\r\n\tnHierarchyLevel =\r\n\t\tthis._columns.hierarchyLevelProperty ? oData[this._columns.hierarchyLevelProperty] : this._hierarchyLevel;\r\n\r\n\t/* Create row and apply binding */\r\n\tthis._appendRow(this._columns.bind(oData, nHierarchyLevel));\r\n\tthis._setHierarchyDepth(nHierarchyLevel);\r\n};\r\n\r\n/**\r\n * Cleanup hook that gets executed when the XMLFile#serialize function\r\n * is called with the finalize flag.\r\n *\r\n * @private\r\n */\r\nSheet.prototype.cleanup = function() {\r\n\tthis.remove(\"data\");\r\n};\r\n\r\n/**\r\n * Returns the current row count of the Worksheet.\r\n *\r\n * @returns {number} - The amount of rows that are contained in this Worksheet\r\n *\r\n * @public\r\n */\r\nSheet.prototype.getRowCount = function() {\r\n\treturn this._rowCount;\r\n};\r\n\r\nmodule.exports = Sheet;","var XMLFile = require(\"../xml/XMLFile\");\r\n\r\n/**\r\n * This class represents the app.xml within the generated Excel. The\r\n * App contains information about the application that created the\r\n * Office Open XML Spreadsheet.\r\n *\r\n * @param {Object} [oContext] Context object containing metadata for this particular Excel\r\n * @param {string} [oContext.application] Application that created this Excel\r\n * @param {string} [oContext.version] Application version that was used to create this Excel\r\n * @constructor\r\n */\r\nfunction App(oContext) {\r\n\tXMLFile.call(this, App.metadata);\r\n\r\n\tif (oContext) {\r\n\r\n\t\tif (oContext.application) {\r\n\t\t\tthis.application.value = oContext.application;\r\n\t\t}\r\n\r\n\t\tif (oContext.version) {\r\n\t\t\tthis.version.value = oContext.version;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nApp.prototype = Object.create(XMLFile.prototype);\r\nApp.prototype.constructor = App;\r\n\r\nApp.metadata = {\r\n\tpath: \"docProps/\",\r\n\tfilename: \"app.xml\",\r\n\ttag: \"Properties\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"vt\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"application\",\r\n\t\t\ttag: \"Application\",\r\n\t\t\tvalue: \"SAP UI5\" // Default value, can be overridden\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"DocSecurity\",\r\n\t\t\tvalue: \"0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Company\",\r\n\t\t\tvalue: \"SAP SE\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"SharedDoc\",\r\n\t\t\tvalue: \"false\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"version\",\r\n\t\t\ttag: \"AppVersion\",\r\n\t\t\tvalue: \"1.118\" // Default value, can be overridden\r\n\t\t}\r\n\t]\r\n};\r\n\r\nmodule.exports = App;","var XMLFile = require(\"../xml/XMLFile\");\r\n\r\n/**\r\n * This class represents the [Content_Types].xml within the generated Excel.\r\n *\r\n * @constructor\r\n */\r\nfunction ContentTypes() {\r\n\tXMLFile.call(this, ContentTypes.metadata);\r\n}\r\n\r\nContentTypes.prototype = Object.create(XMLFile.prototype);\r\nContentTypes.prototype.constructor = ContentTypes;\r\n\r\n\r\nContentTypes.FILENAME = \"\";\r\nContentTypes.metadata = {\r\n\tfilename: \"[Content_Types].xml\",\r\n\ttag: \"Types\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/package/2006/content-types\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\ttag: \"Default\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"Extension\",\r\n\t\t\t\t\tvalue: \"xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Default\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"Extension\",\r\n\t\t\t\t\tvalue: \"rels\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-package.relationships+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/xl/workbook.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/xl/worksheets/sheet1.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/xl/styles.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/xl/sharedStrings.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/docProps/core.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-package.core-properties+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/docProps/app.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.extended-properties+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\nmodule.exports = ContentTypes;","var XMLFile = require(\"../xml/XMLFile\");\r\n\r\n/**\r\n * This class represents the core.xml within the generated Excel. The\r\n * Core contains basic information about the content and the owner of\r\n * the file.\r\n *\r\n * @param {Object} [oContext] - Context object containing metadata for this particular Excel\r\n * @param {string} [oContext.title] - Title of the Excel document\r\n * @param {string} [oContext.modifiedBy] - User context for the exported document\r\n * @constructor\r\n */\r\nfunction Core(oContext) {\r\n\tXMLFile.call(this, Core.metadata);\r\n\r\n\tif (oContext) {\r\n\r\n\t\tif (oContext.title) {\r\n\t\t\tthis.title.value = oContext.title;\r\n\t\t}\r\n\r\n\t\tif (oContext.modifiedBy) {\r\n\t\t\tthis.modifiedBy.value = oContext.modifiedBy;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nCore.prototype = Object.create(XMLFile.prototype);\r\nCore.prototype.constructor = Core;\r\n\r\nCore.metadata = {\r\n\tpath: \"docProps/\",\r\n\tfilename: \"core.xml\",\r\n\ttag: \"cp:coreProperties\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"cp\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"dc\",\r\n\t\t\tvalue: \"http://purl.org/dc/elements/1.1/\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"dcterms\",\r\n\t\t\tvalue: \"http://purl.org/dc/terms/\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"dcmitype\",\r\n\t\t\tvalue: \"http://purl.org/dc/dcmitype/\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"xsi\",\r\n\t\t\tvalue: \"http://www.w3.org/2001/XMLSchema-instance\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"title\",\r\n\t\t\ttag: \"dc:title\",\r\n\t\t\tvalue: \"Table Export\" // Default value, can be overridden\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"dc:creator\",\r\n\t\t\tvalue: \"SAP UI5 Document Export\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"cp:keywords\",\r\n\t\t\tvalue: \"SAP UI5 EXPORT\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"modifiedBy\",\r\n\t\t\ttag: \"cp:lastModifiedBy\",\r\n\t\t\tvalue: \"SAP UI5\" // Default value, can be overridden\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"dcterms:created\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tprefix: \"xsi\",\r\n\t\t\t\t\tname: \"type\",\r\n\t\t\t\t\tvalue: \"dcterms:W3CDTF\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tvalue: new Date().toISOString()\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"modified\",\r\n\t\t\ttag: \"dcterms:modified\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tprefix: \"xsi\",\r\n\t\t\t\t\tname: \"type\",\r\n\t\t\t\t\tvalue: \"dcterms:W3CDTF\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tvalue: new Date().toISOString()\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Updates the state of the Core class and returns the serialized string.\r\n *\r\n * @return {string} - Serialized representation of the Core instance\r\n */\r\nCore.prototype.serialize = function() {\r\n\tthis.modified.value = new Date().toISOString();\r\n\r\n\treturn Object.getPrototypeOf(Core.prototype).serialize.call(this);\r\n};\r\n\r\nmodule.exports = Core;","var XMLFile\t\t\t= require(\"../xml/XMLFile\"),\r\n\tRelationships\t= require(\"./Relationships\");\r\n\r\n/**\r\n * This class represents an Office Open XML Spreadsheet object\r\n * that is related to other objects via Relationships. The object\r\n * manages its Relationships by itself to encapsulate the complexity.\r\n *\r\n * A ReferenceNode also provides information about its path so that\r\n * all relationships that are connected to this ReferenceNode are are\r\n * relative to its path.\r\n *\r\n * @param {Object} oConfig Configuration object that is used by the super class XMLFile\r\n * @constructor\r\n */\r\nfunction ReferenceNode(oConfig) {\r\n\tXMLFile.call(this, oConfig);\r\n\r\n\tthis._relatedFiles = [];\r\n\tthis._relationships = new Relationships(this);\r\n\r\n\tthis.addRelatedFile(this._relationships);\r\n}\r\n\r\nReferenceNode.prototype = Object.create(XMLFile.prototype);\r\nReferenceNode.prototype.constructor = ReferenceNode;\r\n\r\n\r\nReferenceNode.prototype.addRelatedFile = function(oXMLFile) {\r\n\tif (!(oXMLFile instanceof XMLFile)) {\r\n\t\tthrow new Error(\"A related file must be of type XMLFile\");\r\n\t}\r\n\r\n\tthis._relatedFiles.push(oXMLFile);\r\n};\r\n\r\nReferenceNode.prototype.getRelationships = function() {\r\n\treturn this._relationships;\r\n};\r\n\r\n/**\r\n * Returns an Array of {@link XMLFile} objects that are reference by\r\n * this {@link ReferenceNode}. The method provides a flat copy of the\r\n * original data to avoid manipulation.\r\n *\r\n * @returns {Array} Array containing referenced files\r\n */\r\nReferenceNode.prototype.getRelatedFiles = function() {\r\n\treturn this._relatedFiles.slice();\r\n};\r\n\r\nmodule.exports = ReferenceNode;","var\tXMLFile = require(\"../xml/XMLFile\"),\r\n\tXMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * @param {ReferenceNode} oReferenceNode - ReferenceNode object that is the root of this Relationships XMLFile\r\n * @constructor\r\n */\r\nfunction Relationships(oReferenceNode) {\r\n\tXMLFile.call(this, Relationships.metadata);\r\n\r\n\tif (oReferenceNode instanceof XMLFile) {\r\n\t\tthis.setFileName(oReferenceNode.getFileName() + \".rels\");\r\n\t\tthis.setPath(oReferenceNode.getPath() + \"_rels/\");\r\n\t}\r\n}\r\n\r\nRelationships.prototype = Object.create(XMLFile.prototype);\r\nRelationships.prototype.constructor = Relationships;\r\n\r\nRelationships.metadata = {\r\n\tfilename: \".rels\",\r\n\tpath: \"_rels/\",\r\n\ttag: \"Relationships\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/package/2006/relationships\"\r\n\t\t}\r\n\t],\r\n\tproperties: []\r\n};\r\n\r\n/**\r\n * Creates a new Relationship entry for the current collection.\r\n * The Relationship references are defined by the ISO/IEC 29500-1:2016 standard.\r\n *\r\n * @param {string} sTarget - Target file within the generated Excel\r\n * @param {string} sType - XMLNS reference of the targets file type\r\n * @returns {string} The newly created relationship id that can be referenced i.E. \"rId4\"\r\n */\r\nRelationships.prototype.addRelationship = function(sTarget, sType) {\r\n\tvar id = \"rId\" + (this.childs.length + 1);\r\n\r\n\tthis.childs.push(new XMLNode({\r\n\t\ttag: \"Relationship\",\r\n\t\tattributes: [\r\n\t\t\t{\r\n\t\t\t\tname: \"Id\",\r\n\t\t\t\tvalue: id\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \"Type\",\r\n\t\t\t\tvalue: sType\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \"Target\",\r\n\t\t\t\tvalue: sTarget\r\n\t\t\t}\r\n\t\t]\r\n\t}));\r\n\r\n\treturn id;\r\n};\r\n\r\nmodule.exports = Relationships;","var ColumnConfiguration\t= require(\"../binding/ColumnConfiguration\"),\r\n\tReferenceNode\t\t= require(\"./ReferenceNode\"),\r\n\tSharedStrings\t\t= require(\"../data/SharedStrings\"),\r\n\tSheet\t\t\t\t= require(\"../data/Sheet\"),\r\n\tStyles\t\t\t\t= require(\"../style/Styles\");\r\n\r\n/**\r\n * This class represents the workbook.xml file within the generated\r\n * Office Open XML Spreadsheet. The workbook is the central element\r\n * of the Office Open XML Spreadsheet that references all the content.\r\n *\r\n * @constructor\r\n */\r\nfunction Workbook() {\r\n\tvar key;\r\n\r\n\tReferenceNode.call(this, Workbook.metadata);\r\n\r\n\t/* Create and register central Styles instance for this workbook */\r\n\tthis._styles = new Styles();\r\n\tthis._styles.setPath(this.getPath());\r\n\tthis.addRelatedFile(this._styles);\r\n\r\n\t/* Create and register central SharedStrings instance for this workbook */\r\n\tthis._sharedStrings = new SharedStrings();\r\n\tthis._sharedStrings.setPath(this.getPath());\r\n\tthis.addRelatedFile(this._sharedStrings);\r\n\r\n\tfor (key in Workbook.RELATIONS) {\r\n\t\tthis._relationships.addRelationship(Workbook.RELATIONS[key].target, Workbook.RELATIONS[key].type);\r\n\t}\r\n\r\n\tthis._registeredSheets = [];\r\n}\r\n\r\nWorkbook.prototype = Object.create(ReferenceNode.prototype);\r\nWorkbook.prototype.constructor = Workbook;\r\n\r\nWorkbook.RELATIONS = {\r\n\tsharedStrings: {\r\n\t\ttarget: \"sharedStrings.xml\",\r\n\t\ttype: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\"\r\n\t},\r\n\tstyles: {\r\n\t\ttarget: \"styles.xml\",\r\n\t\ttype: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\"\r\n\t}\r\n};\r\n\r\nWorkbook.metadata = {\r\n\tfilename: \"workbook.xml\",\r\n\tpath: \"xl/\",\r\n\ttag: \"workbook\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"r\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"mc\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\ttag: \"bookViews\",\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttag: \"workbookView\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"xWindow\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"yWindow\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"windowWidth\",\r\n\t\t\t\t\t\t\tvalue: \"22260\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"windowHeight\",\r\n\t\t\t\t\t\t\tvalue: \"12645\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"sheets\",\r\n\t\t\ttag: \"sheets\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"definedNames\",\r\n\t\t\ttag: \"definedNames\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Adds a new {@link Sheet} to this {@link Workbook}\r\n *\r\n * @param {string} sName - Name of the {@link Sheet} that is used as label in Microsoft Excel\r\n * @param {Object} oConfig - The column configuration of this Sheet\r\n * @param {Array} oConfig.columns - Array containing the configuration for each column\r\n * @param {boolean} [oConfig.bHideHeader] - Hides the header row (optional - default: false)\r\n * @returns {Sheet} - The newly added {@link Sheet}\r\n */\r\nWorkbook.prototype.addSheet = function(sName, oConfig) {\r\n\tvar oColumnConfiguration, nCount, sId, oSheet, sSheetFileName;\r\n\r\n\tnCount = this.sheets.childs.length + 1;\r\n\tsSheetFileName = \"sheet\" + nCount + \".xml\";\r\n\tsId = this._relationships.addRelationship(\"worksheets/\" + sSheetFileName,\r\n\t\t\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\");\r\n\r\n\tthis.sheets.addChild({\r\n\t\ttag: \"sheet\",\r\n\t\tattributes: [\r\n\t\t\t{\r\n\t\t\t\tid: \"name\",\r\n\t\t\t\tname: \"name\",\r\n\t\t\t\tvalue: sName\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \"sheetId\",\r\n\t\t\t\tvalue: \"\" + nCount\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \"id\",\r\n\t\t\t\tprefix: \"r\",\r\n\t\t\t\tvalue: sId\r\n\t\t\t}\r\n\t\t]\r\n\t});\r\n\r\n\toColumnConfiguration = new ColumnConfiguration(oConfig, this._sharedStrings, this._styles);\r\n\toSheet = new Sheet(oColumnConfiguration);\r\n\toSheet.setFileName(sSheetFileName);\r\n\toSheet.setPath(this.getPath() + \"worksheets/\");\r\n\r\n\tthis.addRelatedFile(oSheet);\r\n\tthis._registeredSheets.push(oSheet);\r\n\r\n\treturn oSheet;\r\n};\r\n\r\n/**\r\n * Set the given sheet as selected. Unselects all other sheets in the workbook.\r\n *\r\n * @param {Sheet} oSheet - The Sheet object that should be selected\r\n */\r\nWorkbook.prototype.selectSheet = function(oSheet) {\r\n\r\n\tif (!(oSheet instanceof Sheet) || this._registeredSheets.indexOf(oSheet) < 0) {\r\n\t\tthrow new Error(\"Could not select sheet. Sheet not found.\");\r\n\t}\r\n\r\n\t/* Remove selection on all sheets */\r\n\tthis._registeredSheets.forEach(function(sheetElement, index, array) {\r\n\t\tsheetElement.views.defaultView.remove(\"selected\");\r\n\t});\r\n\r\n\t/* Select the particular Sheet */\r\n\toSheet.views.defaultView.addAttribute({\r\n\t\tid: \"selected\",\r\n\t\tname: \"tabSelected\",\r\n\t\tvalue: \"1\" // Refers to W3C XML Schema boolean (true)\r\n\t});\r\n};\r\n\r\n/**\r\n * Registers definedNames for sheets that use autoFilter\r\n * functionality before processing the super class serialization.\r\n *\r\n * @returns {string} - The serialized String representation of this workbook\r\n */\r\nWorkbook.prototype.serialize = function() {\r\n\tvar that = this;\r\n\r\n\t/**\r\n\t * Creates the value for the definedName. It automatically\r\n\t * retrieves the dimension of the sheet that is used by the\r\n\t * filter and escapes its representation.\r\n\t *\r\n\t * @param {string} sSheetName - The title of the sheet\r\n\t * @param {Sheet} oSheet - The sheet object containing the filter dimension\r\n\t * @returns {string} - Escaped definedName value\r\n\t * @private\r\n\t */\r\n\tfunction createDefinedName(sSheetName, oSheet) {\r\n\t\tvar sDefinedName, sDimension;\r\n\r\n\t\tsDimension = oSheet.filter.reference.value;\r\n\t\tsDefinedName = /^[a-zA-Z0-9]+$/.test(sSheetName) ? sSheetName : `'${sSheetName}'`;\r\n\t\tsDefinedName += \"!\";\r\n\t\tsDefinedName += sDimension.replace(/([A-Z]+)|(\\d+)/g, function(match) {\r\n\t\t\treturn \"$\" + match;\r\n\t\t});\r\n\r\n\t\treturn sDefinedName;\r\n\t}\r\n\r\n\t/* Create definedNames before serializing the workbook */\r\n\tthis._registeredSheets.forEach(function(oSheet, iIndex, aArray) {\r\n\t\tvar sSheetName = that.sheets.childs[iIndex].name.value;\r\n\r\n\t\tif (oSheet.filter) {\r\n\t\t\tthat.definedNames.addChild({\r\n\t\t\t\ttag: \"definedName\",\r\n\t\t\t\tattributes: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: \"name\",\r\n\t\t\t\t\t\tvalue: \"_xlnm._FilterDatabase\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: \"localSheetId\",\r\n\t\t\t\t\t\tvalue: iIndex\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: \"hidden\",\r\n\t\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t\t}\r\n\t\t\t\t],\r\n\t\t\t\tvalue: createDefinedName(sSheetName, oSheet)\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n\treturn Object.getPrototypeOf(Workbook.prototype).serialize.call(this);\r\n};\r\n\r\nmodule.exports = Workbook;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The Alignment class defines the alignment of content within the\r\n * sheet cells. The Alignment is assigned to a particular Style that\r\n * is registered in the Styles class.\r\n *\r\n * @constructor\r\n */\r\nfunction Alignment() {\r\n\tXMLNode.call(this, Alignment.metadata);\r\n}\r\n\r\nAlignment.prototype = Object.create(XMLNode.prototype);\r\nAlignment.prototype.constructor = Alignment;\r\n\r\nAlignment.metadata = {\r\n\ttag: \"alignment\"\r\n};\r\n\r\nAlignment.horizontal = {\r\n\tLEFT: \"left\",\r\n\tCENTER: \"center\",\r\n\tRIGHT: \"right\",\r\n\tcontains: function(sAlign) {\r\n\r\n\t\treturn _contains(sAlign, Alignment.horizontal);\r\n\t}\r\n};\r\n\r\nAlignment.vertical = {\r\n\tTOP: \"top\",\r\n\tMIDDLE: \"middle\",\r\n\tBOTTOM: \"bottom\",\r\n\tcontains: function(sAlign) {\r\n\r\n\t\treturn _contains(sAlign, Alignment.vertical);\r\n\t}\r\n};\r\n\r\n/**\r\n * Checks whether the requested alignment is contained or not. An\r\n * alignment that is contained can be assigned within styles. Other\r\n * alignments that are not contained are not supported and thus not\r\n * assignable. It differentiates between horizontal and vertical\r\n * alignments, depending on the aggregation that was provided.\r\n *\r\n * @param {string} sAlign - The alignment that should be checked\r\n * @param {Array} oAggregation - The aggregation the alignment might be in\r\n * @returns {boolean} - Returns true if the alignment is supported\r\n * @private\r\n */\r\nfunction _contains(sAlign, oAggregation) {\r\n\tvar key, contained = false;\r\n\r\n\tfor (key in oAggregation) {\r\n\t\tcontained = contained ? contained : oAggregation[key] === sAlign && typeof oAggregation[key] !== \"function\";\r\n\t}\r\n\r\n\treturn contained;\r\n}\r\n\r\nAlignment.prototype.isDefault = function() {\r\n\treturn this.attributes.length == 0;\r\n};\r\n\r\n/**\r\n * Assigns the given indent to this Alignment object.\r\n *\r\n * @param {number} nIndent - Numerical value used as indentation\r\n */\r\nAlignment.prototype.setIndent = function(nIndent) {\r\n\r\n\t/* Remove indent */\r\n\tif (typeof nIndent != \"number\" || nIndent <= 0) {\r\n\t\tthis.remove(\"indent\");\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis._setAlignmentAttribute(\"indent\", nIndent);\r\n\r\n\t/* A correct indent requires an explicit horizontal alignment */\r\n\tif (!this.horizontal) {\r\n\t\tthis.setHorizontalAlignment(Alignment.horizontal.LEFT);\r\n\t}\r\n};\r\n\r\n\r\n/**\r\n * Configures the wrapText attribute of the alignment which is used\r\n * for multiline text support.\r\n *\r\n * @param {boolean} bWrap - Defines if wrapping is enabled or disabled\r\n */\r\nAlignment.prototype.setWrapText = function(bWrap) {\r\n\tvar wrappingAttribute = \"wrapText\";\r\n\r\n\r\n\tif (bWrap) {\r\n\t\tthis._setAlignmentAttribute(wrappingAttribute, \"1\");\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (this[wrappingAttribute]) {\r\n\t\tthis.remove(wrappingAttribute);\r\n\t}\r\n};\r\n\r\n/**\r\n * Applies the given alignment as horizontal alignment.\r\n *\r\n * @param {string} sAlign - Horizontal alignment that gets applied\r\n */\r\nAlignment.prototype.setHorizontalAlignment = function(sAlign) {\r\n\r\n\t/* Ignore invalid values */\r\n\tif (!Alignment.horizontal.contains(sAlign)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis._setAlignmentAttribute(\"horizontal\", sAlign);\r\n};\r\n\r\n/**\r\n * Applies the given alignment as vertical alignment.\r\n *\r\n * @param {string} sAlign - Vertical alignment that gets applied\r\n */\r\nAlignment.prototype.setVerticalAlignment = function(sAlign) {\r\n\r\n\t/* Ignore invalid values */\r\n\tif (!Alignment.vertical.contains(sAlign)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis._setAlignmentAttribute(\"vertical\", sAlign);\r\n};\r\n\r\n/**\r\n * Assigns the given value as a named property on this Alignment object.\r\n *\r\n * @param {string} sId - The named property id\r\n * @param {number|string} value - Textual or numerical value\r\n * @private\r\n */\r\nAlignment.prototype._setAlignmentAttribute = function(sId, value) {\r\n\r\n\t/* Create attribute if not present */\r\n\tif (!this[sId]) {\r\n\t\tthis.addAttribute({\r\n\t\t\tid: sId,\r\n\t\t\tname: sId\r\n\t\t});\r\n\t}\r\n\r\n\tthis[sId].value = value;\r\n};\r\n\r\n/**\r\n * Access the given alignment attribute and return its value. This is a shorthand\r\n * function to access the value without having to check for the existence of the\r\n * attribute itself.\r\n *\r\n * @param {string} sId - Alignment attribute that will be returned\r\n * @return {string|number} - value of the given alignment attribute\r\n * @private\r\n */\r\nAlignment.prototype._getAlignmentAttribute = function(sId) {\r\n\treturn this[sId] && this[sId].value;\r\n};\r\n\r\nAlignment.prototype.equals = function(oAlignment) {\r\n\treturn typeof oAlignment !== \"undefined\" && oAlignment !== null\r\n\t\t&& this._getAlignmentAttribute(\"vertical\") == oAlignment._getAlignmentAttribute(\"vertical\")\r\n\t\t&& this._getAlignmentAttribute(\"horizontal\") == oAlignment._getAlignmentAttribute(\"horizontal\")\r\n\t\t&& this._getAlignmentAttribute(\"indent\") == oAlignment._getAlignmentAttribute(\"indent\")\r\n\t\t&& this._getAlignmentAttribute(\"wrapText\") == oAlignment._getAlignmentAttribute(\"wrapText\");\r\n};\r\n\r\nmodule.exports = Alignment;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * This class represents border configuration for Office Open XML Spreadsheets.\r\n * @constructor\r\n */\r\nfunction Border() {\r\n\tXMLNode.call(this, Border.metadata);\r\n}\r\n\r\nBorder.prototype = Object.create(XMLNode.prototype);\r\nBorder.prototype.constructor = Border;\r\n\r\nBorder.metadata = {\r\n\ttag: \"border\",\r\n\tproperties: [\r\n\t\t{\r\n\t\t\ttag: \"left\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"right\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"top\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"bottom\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"diagonal\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Checks if the current Border is equal to the given parameter.\r\n *\r\n * @param {Border} oBorder Border that get\"s compared to the current one\r\n * @return {boolean} Returns true if both Borders have the same configuration\r\n */\r\nBorder.prototype.equals = function(oBorder) {\r\n\r\n\t/**\r\n\t * Once it is a Border object we always return true because we\r\n\t * don't provide more than one border type\r\n\t */\r\n\treturn oBorder instanceof Border;\r\n};\r\n\r\nmodule.exports = Border;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * This Class represents a background fill of cells within the Office\r\n * Open Spreadsheet document. The Fill accepts a configuration object\r\n * which might have either an \"color\" or an \"type\" property.\r\n *\r\n * @param {Object} oData - Configuration object for this Fill\r\n * @param {string} [oData.color] - HEX string defining the colored fill\r\n * @param {string} [oData.type] - Color independent fill type\r\n * @constructor\r\n */\r\nfunction Fill(oData) {\r\n\tXMLNode.call(this, Fill.metadata);\r\n\r\n\tif (oData) {\r\n\t\tif (oData.color) {\r\n\t\t\tthis.setFill(oData.color);\r\n\t\t} else if (oData.type) {\r\n\t\t\tthis.setType(oData.type);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nFill.prototype = Object.create(XMLNode.prototype);\r\nFill.prototype.constructor = Fill;\r\n\r\nFill.DEFAULT_TYPE = \"none\";\r\n\r\nFill.metadata = {\r\n\ttag: \"fill\",\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"fill\",\r\n\t\t\ttag: \"patternFill\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"type\",\r\n\t\t\t\t\tname: \"patternType\",\r\n\t\t\t\t\tvalue: Fill.DEFAULT_TYPE\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Checks if the current Fill is equal to the one that was provided.\r\n *\r\n * @param {Fill} oFill - The Fill that gets compared to the current Fill\r\n * @returns {boolean} - Returns true if the compared objects are of the same type and contain the same color fill\r\n */\r\nFill.prototype.equals = function(oFill) {\r\n\tif (!(oFill instanceof Fill)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn this.getType() === oFill.getType()\r\n\t\t&& this.getFill() === oFill.getFill();\r\n};\r\n\r\n/**\r\n * Returns the color of the current Fill.\r\n *\r\n * @returns {string|null} - String containing the color HEX color of the Fill or null of no color is assigned\r\n */\r\nFill.prototype.getFill = function() {\r\n\r\n\t/* The opacity needs to be removed before returning the HEX color */\r\n\treturn this.fill.childs.length ? this.fill.color.rgb.value.substring(2) : null;\r\n};\r\n\r\nFill.prototype.setFill = function(sColor) {\r\n\tthis.reset();\r\n\r\n\tif (sColor && typeof sColor === \"string\" && /^[A-Fa-f0-9]{6}$/.test(sColor)) {\r\n\t\tthis.fill.type.value = \"solid\";\r\n\r\n\t\t/**\r\n\t\t * Apply the provided color as forground color of the\r\n\t\t * background. We add \"FF\" in front of the HEX-color\r\n\t\t * for opacity.\r\n\t\t */\r\n\t\tthis.fill.addChild({\r\n\t\t\tid: \"color\",\r\n\t\t\ttag: \"fgColor\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"rgb\",\r\n\t\t\t\t\tname: \"rgb\",\r\n\t\t\t\t\tvalue: \"FF\" + sColor\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t});\r\n\r\n\t\t/**\r\n\t\t * Add default background layer which will be used once the\r\n\t\t * foreground color uses transparency\r\n\t\t */\r\n\t\tthis.fill.addChild({\r\n\t\t\ttag: \"bgColor\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"indexed\",\r\n\t\t\t\t\tvalue: \"64\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t});\r\n\t}\r\n};\r\n\r\n/**\r\n * Returns the current Fill type.\r\n *\r\n * @returns {string} - Current Fill type\r\n */\r\nFill.prototype.getType = function() {\r\n\treturn this.fill.type.value;\r\n};\r\n\r\n/**\r\n * Assigns the given type as Fill type. The Fill will be reset to\r\n * default before the type is applied.\r\n *\r\n * @param {string} sType - Type that needs to be assigned\r\n */\r\nFill.prototype.setType = function(sType) {\r\n\tthis.reset();\r\n\r\n\tthis.fill.type.value = sType;\r\n};\r\n\r\n/**\r\n * Resets the current fill to avoid side effects that might occur\r\n * when the fill is modified.\r\n */\r\nFill.prototype.reset = function() {\r\n\tthis.fill.type.value = \"none\";\r\n\tthis.fill.childs.length = 0;\r\n};\r\n\r\nmodule.exports = Fill;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The Font class represents a Font configuration within an Office\r\n * Open XML Spreadsheet.\r\n *\r\n * @param {Object} oData - Configuration object for this Font\r\n * @param {boolean} [oData.bold] - Boolean value indicating if the Font should be bold\r\n * @param {string} [oData.name] - The name of the font that gets used by this Font object i.E. Arial, Verdana, etc.\r\n * @param {number|String} [oData.size] - The font size that is been used\r\n * @param {number} [oData.family] - The font family reference {@see getFamily}\r\n * @constructor\r\n */\r\nfunction Font(oData) {\r\n\tXMLNode.call(this, Font.metadata);\r\n\r\n\tif (oData && oData instanceof Object) {\r\n\t\tthis.setName(oData.name)\r\n\t\t\t.setSize(oData.size)\r\n\t\t\t.setFamily(oData.family)\r\n\t\t\t.setBold(!!oData.bold);\r\n\t}\r\n}\r\n\r\nFont.prototype = Object.create(XMLNode.prototype);\r\nFont.prototype.constructor = Font;\r\n\r\nFont.DEFAULT_SIZE = 11;\r\nFont.DEFAULT_NAME = \"Arial\";\r\n\r\nFont.metadata = {\r\n\ttag: \"font\",\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"size\",\r\n\t\t\ttag: \"sz\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"valueAttribute\",\r\n\t\t\t\t\tname: \"val\",\r\n\t\t\t\t\tvalue: Font.DEFAULT_SIZE\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"color\",\r\n\t\t\ttag: \"color\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"valueAttribute\",\r\n\t\t\t\t\tname: \"theme\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"name\",\r\n\t\t\ttag: \"name\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"valueAttribute\",\r\n\t\t\t\t\tname: \"val\",\r\n\t\t\t\t\tvalue: Font.DEFAULT_NAME\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"family\",\r\n\t\t\ttag: \"family\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"valueAttribute\",\r\n\t\t\t\t\tname: \"val\",\r\n\t\t\t\t\tvalue: 2\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Checks if the current Font is equal to the given parameter.\r\n *\r\n * @param {Font} oFont - The Font to compare with\r\n * @return {boolean} - Returns true if both Font objects contain the same configuration.\r\n */\r\nFont.prototype.equals = function(oFont) {\r\n\tif (!(oFont instanceof Font)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn this.getName() == oFont.getName()\r\n\t\t&& this.getSize() == oFont.getSize()\r\n\t\t&& this.isBold() == oFont.isBold()\r\n\t\t&& this.getColor() == oFont.getColor()\r\n\t\t&& this.getFamily() == oFont.getFamily();\r\n};\r\n\r\n/**\r\n * Returns whether the Font will be displayed bold or not.\r\n *\r\n * @returns {boolean} - Returns true if the Font is bold\r\n */\r\nFont.prototype.isBold = function() {\r\n\treturn !!this.bold;\r\n};\r\n\r\n/**\r\n * Returns the size of this Font.\r\n *\r\n * @returns {number} - The size of the Font\r\n */\r\nFont.prototype.getSize = function() {\r\n\treturn this.size.valueAttribute.value;\r\n};\r\n\r\n/**\r\n * Returns the name of this Font. I.E. Arial, Calibri, etc.\r\n *\r\n * @returns {string} - The name of the Font\r\n */\r\nFont.prototype.getName = function() {\r\n\treturn this.name.valueAttribute.value;\r\n};\r\n\r\n/**\r\n * Returns the color reference of this Font.\r\n *\r\n * @returns {string} - The color as HEX string\r\n */\r\nFont.prototype.getColor = function() {\r\n\treturn this.color.valueAttribute.value;\r\n};\r\n\r\n/**\r\n * Returns the Font family reference of this Font. The reference is\r\n * defined within the Office Open XML specification.\r\n * 1 : Roman (Times New Roman, SAP-icons)\r\n * 2 : Swiss (Arial, Calibri, Segoe UI, Tahoma, Verdana)\r\n * 3 : Modern\r\n * 4 : Script\r\n * 5 : Decorative\r\n * 6-14 : Reserved for future use\r\n *\r\n * @returns {number} - The Font family ID\r\n */\r\nFont.prototype.getFamily = function() {\r\n\treturn this.family.valueAttribute.value;\r\n};\r\n\r\n/**\r\n * This method can be used to set the Font to bold or not.\r\n *\r\n * @param {boolean} bBold - A boolean value that indicates if the Font should be bold or not\r\n * @return {Font} - Returns the current Font object for chaining\r\n */\r\nFont.prototype.setBold = function(bBold) {\r\n\tvar boldProperty = \"bold\";\r\n\r\n\t/* Early return if bold status is already correct */\r\n\tif (bBold === !!this[boldProperty]) {\r\n\t\treturn this;\r\n\t}\r\n\r\n\tif (bBold) {\r\n\t\tthis.addChild({\r\n\t\t\tid: boldProperty,\r\n\t\t\ttag: \"b\"\r\n\t\t});\r\n\t} else {\r\n\t\tthis.remove(boldProperty);\r\n\t}\r\n\r\n\treturn this;\r\n};\r\n\r\n/**\r\n * This method is used to set the Font family reference for the used font.\r\n *\r\n * @see {@link getFamily}\r\n * @param {number} nFamily - Number that references the Font family\r\n * @returns {Font} - Returns the current Font object for chaining\r\n */\r\nFont.prototype.setFamily = function(nFamily) {\r\n\r\n\tif (nFamily > 0 && nFamily < 15) {\r\n\t\tthis.family.valueAttribute.value = nFamily;\r\n\t}\r\n\r\n\treturn this;\r\n};\r\n\r\n/**\r\n * Assigns the given font name to this object.\r\n *\r\n * @param {string} sName - Name of the font i.E. Arial, Calibri, etc.\r\n * @return {Font} - Returns the current Font object for chaining\r\n */\r\nFont.prototype.setName = function(sName) {\r\n\tif (sName && typeof sName === \"string\") {\r\n\t\tthis.name.valueAttribute.value = sName;\r\n\t}\r\n\r\n\t/*\r\n\t * If the font name is Calibri we need to add another child node:\r\n\t *\r\n\t *\t{\r\n\t *\t\ttag: \"scheme\",\r\n\t *\t\tattributes: [\r\n\t *\t\t\t{\r\n\t *\t\t\t\tname: \"val\",\r\n\t *\t\t\t\tvalue: \"minor\"\r\n\t *\t\t\t}\r\n\t *\t\t]\r\n\t *\t}\r\n\t */\r\n\r\n\treturn this;\r\n};\r\n\r\n/**\r\n * Assigns the given font size to this object.\r\n *\r\n * @param {number} nSize - Textual representation of the font size\r\n * @return {Font} - Returns the current Font object for chaining\r\n */\r\nFont.prototype.setSize = function(nSize) {\r\n\r\n\t/* Check preconditions */\r\n\tif (typeof nSize !== \"number\" || isNaN(nSize) || nSize < 1 || nSize > 96) {\r\n\t\tthrow new Error(`The size ${nSize} is not supported.`);\r\n\t}\r\n\r\n\tthis.size.valueAttribute.value = nSize;\r\n\r\n\treturn this;\r\n};\r\n\r\nmodule.exports = Font;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The NumberFormat class is used to store custom formatting for\r\n * numeric values. In addition to a variety of built-in formats that\r\n * cannot be used as identifier for a particular format, the user can\r\n * create up to 250 different number formats.\r\n *\r\n * (https://support.office.com/en-us/article/Excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3)\r\n *\r\n * @param {Object} oData Configuration object that is used for initialization\r\n * @param {string} oData.format Custom format that will be applied\r\n * @constructor\r\n */\r\nfunction NumberFormat(oData) {\r\n\tXMLNode.call(this, NumberFormat.metadata);\r\n\r\n\tthis.format.value = oData && oData.format ? oData.format : NumberFormat.DEFAULT;\r\n}\r\n\r\nNumberFormat.prototype = Object.create(XMLNode.prototype);\r\nNumberFormat.prototype.constructor = NumberFormat;\r\n\r\nNumberFormat.metadata = {\r\n\ttag: \"numFmt\",\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tid: \"formatId\",\r\n\t\t\tname: \"numFmtId\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"format\",\r\n\t\t\tname: \"formatCode\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\nNumberFormat.BUILTIN_IDS = [ 0, 1, 2, 3, 4, 9, 10, 11, 12, 13, 14, 15,\r\n\t16, 17, 18, 19, 20, 21, 22, 37, 38, 39, 40, 45, 46, 47, 48, 49 ];\r\nNumberFormat.ID_OFFSET = 164;\r\nNumberFormat.DEFAULT = \"#,##0.00\";\r\n\r\n/**\r\n * This method returns the ID of this NumberFormat. If there was no\r\n * ID assigned yet, it will return undefined.\r\n *\r\n * @returns {number} The ID of this NumberFormat\r\n */\r\nNumberFormat.prototype.getId = function() {\r\n\treturn this.formatId.value;\r\n};\r\n\r\n\r\n/**\r\n * Returns the format of this NumberFormat as a string.\r\n *\r\n * @returns {string} The format template that gets applied\r\n */\r\nNumberFormat.prototype.getFormat = function() {\r\n\treturn this.format.value;\r\n};\r\n\r\n\r\n/**\r\n * Assigns the provided ID to the current NumberFormat.\r\n *\r\n * @param {number|string} sId The ID of this NumberFormat that can be referenced\r\n */\r\nNumberFormat.prototype.setId = function(sId) {\r\n\tvar iId = typeof sId === \"number\" ? sId : parseInt(sId, 10);\r\n\r\n\t/* Checks if NaN, below zero or builtin ID */\r\n\tif (isNaN(iId) || iId < 0 || NumberFormat._isBuiltin(iId)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis.formatId.value = sId;\r\n};\r\n\r\n\r\n/**\r\n * Sets a specific format.\r\n *\r\n * @param {string} sFormat The format that gets applied by this NumberFormat\r\n */\r\nNumberFormat.prototype.setFormat = function(sFormat) {\r\n\tthis.format.value = sFormat;\r\n};\r\n\r\n\r\n/**\r\n * Checks if a given ID is a builtin ID or not. Builtin IDs cannot be used for custom NumberFormats.\r\n *\r\n * @param {number} iId ID that needs to be checked if it is a builtin ID\r\n *\r\n * @returns {boolean} Returns true if the provided ID is a builtin ID that cannot be used\r\n * @private\r\n */\r\nNumberFormat._isBuiltin = function(iId) {\r\n\treturn NumberFormat.BUILTIN_IDS.indexOf(iId) > -1;\r\n};\r\n\r\n\r\n/**\r\n * Compares another NumberFormat to the current one. This method will\r\n * match NumberFormat objects by its format regardless of their ID.\r\n *\r\n * @param {NumberFormat} oNumberFormat The NumberFormat to compare with\r\n * @returns {boolean} Returns true if the format template is equal to the one from the compared object\r\n */\r\nNumberFormat.prototype.equals = function(oNumberFormat) {\r\n\tif (!(oNumberFormat instanceof NumberFormat)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn this.getFormat() === oNumberFormat.getFormat();\r\n};\r\n\r\nmodule.exports = NumberFormat;","var XMLNode = require(\"../xml/XMLNode\");\r\nvar Alignment = require(\"./Alignment\");\r\n\r\n/**\r\n * Represents a particular Style within the Office Open XML Spreadsheet.\r\n * Instances of this type will be created by the Styles Class after\r\n * registering a new Style.\r\n *\r\n * @constructor\r\n */\r\nfunction Style() {\r\n\tXMLNode.call(this, Style.metadata);\r\n}\r\n\r\nStyle.prototype = Object.create(XMLNode.prototype);\r\nStyle.prototype.constructor = Style;\r\n\r\nStyle.metadata = {\r\n\ttag: \"xf\",\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tid: \"numberFormat\",\r\n\t\t\tname: \"numFmtId\",\r\n\t\t\tvalue: \"0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"font\",\r\n\t\t\tname: \"fontId\",\r\n\t\t\tvalue: \"0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"fill\",\r\n\t\t\tname: \"fillId\",\r\n\t\t\tvalue: \"0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"border\",\r\n\t\t\tname: \"borderId\",\r\n\t\t\tvalue: \"0\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\nStyle.DEFAULT = {\r\n\tfont: {\r\n\t\tname: \"Arial\",\r\n\t\tsize: 11,\r\n\t\tfamily: \"2\",\r\n\t\tcolor: \"1\",\r\n\t\tbold: false\r\n\t},\r\n\tfill: {\r\n\t\ttype: \"none\"\r\n\t}\r\n};\r\n\r\nStyle.prototype.getAlignment = function() {\r\n\treturn this.alignment ? this.alignment : null;\r\n};\r\n\r\nStyle.prototype.getFontId = function() {\r\n\treturn this.font.value;\r\n};\r\n\r\nStyle.prototype.getFillId = function() {\r\n\treturn this.fill.value;\r\n};\r\n\r\nStyle.prototype.getBorderId = function() {\r\n\treturn this.border.value;\r\n};\r\n\r\nStyle.prototype.getNumberFormatId = function() {\r\n\treturn this.numberFormat.value;\r\n};\r\n\r\nStyle.prototype.hasQuotePrefix = function() {\r\n\treturn \"quotePrefix\" in this;\r\n};\r\n\r\n/**\r\n * Applies the alignment to the Style. The alignment must match the\r\n * predefined options of <code>Alignment</code> as far as it is not\r\n * null. Other values will be ignored.\r\n *\r\n * The value <code>null</code> will delete the current alignment.\r\n *\r\n * @param {Object} oAlign Alignment configuration that gets applied or null\r\n * @param {string} [oAlign.horizontal] Horizontal alignment\r\n * @param {string} [oAlign.vertical] Vertical alignment\r\n * @param {number} [oAlign.indent] Cell indentation\r\n */\r\nStyle.prototype.setAlignment = function(oAlign) {\r\n\tvar alignment, alignProperty;\r\n\r\n\talignProperty = \"alignment\";\r\n\r\n\t// Removes the applyAlignment automatically when sAlign is null\r\n\tthis._apply(oAlign, \"Alignment\");\r\n\r\n\tif (typeof oAlign === \"undefined\" || oAlign === null) {\r\n\t\tthis.remove(alignProperty);\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (!(alignProperty in this)) {\r\n\t\talignment = new Alignment();\r\n\r\n\t\tthis.addChild(alignment);\r\n\t\tObject.defineProperty(this, alignProperty, {value: alignment, writable: false, configurable: true});\r\n\t}\r\n\r\n\tthis[alignProperty].setHorizontalAlignment(oAlign.horizontal);\r\n\tthis[alignProperty].setVerticalAlignment(oAlign.vertical);\r\n\tthis[alignProperty].setWrapText(oAlign.wrap);\r\n\tthis[alignProperty].setIndent(oAlign.indent);\r\n};\r\n\r\nStyle.prototype.setFontId = function(nFontId) {\r\n\tthis._apply(nFontId, \"Font\");\r\n\r\n\tthis.font.value = nFontId;\r\n};\r\n\r\nStyle.prototype.setFillId = function(nFillId) {\r\n\tthis._apply(nFillId, \"Fill\");\r\n\r\n\tthis.fill.value = nFillId;\r\n};\r\n\r\nStyle.prototype.setBorderId = function(sBorderId) {\r\n\tthis.border.value = sBorderId;\r\n};\r\n\r\nStyle.prototype.setNumberFormatId = function(nNumFmtId) {\r\n\tthis._apply(nNumFmtId, \"NumberFormat\");\r\n\r\n\tthis.numberFormat.value = nNumFmtId;\r\n};\r\n\r\nStyle.prototype.setQuotePrefix = function(bQuotePrefix) {\r\n\tvar sAttributeName = \"quotePrefix\";\r\n\r\n\tif (bQuotePrefix && !this.hasQuotePrefix()) {\r\n\t\tthis.addAttribute({\r\n\t\t\tid: sAttributeName,\r\n\t\t\tname: sAttributeName,\r\n\t\t\tvalue: \"1\"\r\n\t\t});\r\n\t} else if (!bQuotePrefix && this.hasQuotePrefix()) {\r\n\t\tthis.remove(sAttributeName);\r\n\t}\r\n};\r\n\r\nStyle.prototype._apply = function(nId, sType) {\r\n\tvar applyProperty = \"apply\" + sType;\r\n\r\n\tthis.remove(applyProperty);\r\n\r\n\tif (nId) {\r\n\t\tthis.addAttribute({\r\n\t\t\tid: applyProperty,\r\n\t\t\tname: applyProperty,\r\n\t\t\tvalue: \"1\"\r\n\t\t});\r\n\t}\r\n};\r\n\r\nStyle.prototype.equals = function(oStyle) {\r\n\tif (!(oStyle instanceof Style)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn this.getFontId() === oStyle.getFontId()\r\n\t\t&& this.getFillId() === oStyle.getFillId()\r\n\t\t&& this.getBorderId() === oStyle.getBorderId()\r\n\t\t&& this.getNumberFormatId() === oStyle.getNumberFormatId()\r\n\t\t&& this.hasQuotePrefix() === oStyle.hasQuotePrefix()\r\n\t\t&& ( (!this.alignment && !oStyle.alignment) || (this.alignment && this.alignment.equals(oStyle.alignment)) );\r\n};\r\n\r\nmodule.exports = Style;","var XMLFile\t\t\t= require(\"../xml/XMLFile\"),\r\n\tStyle\t\t\t= require(\"./Style\"),\r\n\tFont\t\t\t= require(\"./Font\"),\r\n\tFill\t\t\t= require(\"./Fill\"),\r\n\tBorder\t\t\t= require(\"./Border\"),\r\n\tNumberFormat\t= require(\"./NumberFormat\");\r\n\r\n/**\r\n *\r\n * @class\r\n * @module style/Styles\r\n */\r\nfunction Styles() {\r\n\tXMLFile.call(this, Styles.metadata);\r\n\r\n\t/* Microsoft Excel fix - specific fill that needs to be present */\r\n\tthis.addFill({ type: \"none\" }); // Add a default fill at index 0\r\n\tthis.addFill({ type: \"gray125\" }); // Needs to have index 1\r\n\tthis.addStyle(Style.DEFAULT); // Apply base style to feed the hard-coded cellStyles and cellStyleXfs\r\n}\r\n\r\nStyles.prototype = Object.create(XMLFile.prototype);\r\nStyles.prototype.constructor = Styles;\r\n\r\nStyles.metadata = {\r\n\tfilename: \"styles.xml\",\r\n\ttag: \"styleSheet\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"mc\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t,\r\n\t\t{\r\n\t\t\tname: \"mc\",\r\n\t\t\tsuffix: \"Ignorable\",\r\n\t\t\tvalue: \"x14ac x16r2 xr\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"x14ac\",\r\n\t\t\tvalue: \"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"x16r2\",\r\n\t\t\tvalue: \"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"xr\",\r\n\t\t\tvalue: \"http://schemas.microsoft.com/office/spreadsheetml/2014/revision\"\r\n\t\t}\r\n\t\t*/\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"numberFormats\",\r\n\t\t\ttag: \"numFmts\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"fonts\",\r\n\t\t\ttag: \"fonts\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"fills\",\r\n\t\t\ttag: \"fills\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"borders\",\r\n\t\t\ttag: \"borders\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"cellStyleXfs\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttag: \"xf\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"numFmtId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"fontId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"fillId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"borderId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"cellXfs\",\r\n\t\t\ttag: \"cellXfs\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"cellStyles\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttag: \"cellStyle\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"name\",\r\n\t\t\t\t\t\t\tvalue: \"Normal\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"xfId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"builtinId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"dxfs\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"tableStyles\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"defaultTableStyle\",\r\n\t\t\t\t\tvalue: \"TableStyleMedium2\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"defaultPivotStyle\",\r\n\t\t\t\t\tvalue: \"PivotStyleLight16\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\n\r\n/**\r\n * Adds the specified Style to the Styles class according to the\r\n * Style configuration. The method will return a Style object that\r\n * references Font, Fill, Border and an optional NumberFormat. If\r\n * some of the referenced Font, Fill, Border or NumberFormat objects\r\n * are not present yet, it will create them automatically, otherwise\r\n * it will re-use existing ones.\r\n *\r\n * The method ensures that particular Style combinations exist only\r\n * once and there are no duplicates.\r\n *\r\n * @param {Object} oData Configuration object that defines the Style information\r\n * @param {Object} [oData.font] Configuration object that defines the Font information\r\n * @param {string} [oData.font.name] Name of the used Font i.E. \"Arial\"\r\n * @param {string} [oData.font.size] Preferred Font size i.E. \"12\"\r\n * @param {boolean} [oData.font.bold] Defines the Font weight\r\n * @param {Object} [oData.fill] Configuration object that defines the Fill information\r\n * @param {string} [oData.fill.color] HEX string defining the color of the cell fill\r\n * @param {string} [oData.fill.type] Defines the type of the fill i.E. \"none\" or \"solid\"\r\n * @param {Object} [oData.border] Configuration object that defines the Border information\r\n * @param {Object|number} [oData.numberFormat] Configuration object that defines the NumberFormat information\r\n * @param {string} [oData.numberFormat.format] Formatting template that will be used\r\n * @param {Object} [oData.align] Defines the text alignment within the cell\r\n * @param {string} [oData.align.horizontal] Horizontal alignment\r\n * @param {string} [oData.align.vertical] Vertical alignment\r\n * @param {number} [oData.align.indent] Cell indentation\r\n * @param {boolean} [oData.quotePrefix] Defines whether the style configuration should add a quotePrefix attribute\r\n * @returns {number} The ID of the unique Style object that needs to be referenced\r\n */\r\nStyles.prototype.addStyle = function(oData) {\r\n\tvar style, fontId, fillId, borderId, numberFormatId;\r\n\r\n\t/* Add Font, Fill, Border and NumberFormat if needed */\r\n\tfontId = this.addFont(oData.font);\r\n\tfillId = this.addFill(oData.fill);\r\n\tborderId = this.addBorder(oData.border);\r\n\r\n\t/* Fallback to avoid custom NumberFormats that won't be used if oData.numberFormat is undefined */\r\n\tif (typeof oData.numberFormat === \"undefined\") {\r\n\t\toData.numberFormat = 0;\r\n\t}\r\n\r\n\tnumberFormatId =\r\n\t\tNumberFormat._isBuiltin(oData.numberFormat) ? oData.numberFormat : this.addNumberFormat(oData.numberFormat);\r\n\r\n\t/* Create temporary Style */\r\n\tstyle = new Style();\r\n\r\n\tstyle.setFontId(fontId);\r\n\tstyle.setFillId(fillId);\r\n\tstyle.getBorderId(borderId);\r\n\tstyle.setNumberFormatId(numberFormatId);\r\n\tstyle.setAlignment(oData.align);\r\n\tstyle.setQuotePrefix(oData.quotePrefix);\r\n\r\n\t/* Add Style if not already present */\r\n\treturn this._addToAggregation(style, this.cellXfs);\r\n};\r\n\r\n\r\n/**\r\n * Adds the specific item to the provided aggregation. This Method\r\n * should only be called by the library itself due to possible\r\n * failures. It automatically updates the count within the XML\r\n * representation of this aggregation.\r\n *\r\n * This method should only be used for Font, Fill, Border or\r\n * NumberFormat objects.\r\n *\r\n * @param {Font|Fill|Border|NumberFormat|Style} oNewItem The item that needs to be appended to the aggregation\r\n * @param {Array} aAggregation An array that represents the aggregation\r\n * @returns {number} The zero-based index of the element after it was inserted\r\n * @private\r\n */\r\nStyles.prototype._addToAggregation = function(oNewItem, aAggregation) {\r\n\tvar count, i;\r\n\r\n\ti = -1;\r\n\r\n\taAggregation.childs.forEach(function(existingItem, index, array) {\r\n\t\tif (existingItem.equals(oNewItem)) {\r\n\t\t\ti = index;\r\n\t\t}\r\n\t});\r\n\r\n\tif (i === -1) {\r\n\t\taAggregation.addChild(oNewItem);\r\n\t\tcount = aAggregation.childs.length;\r\n\r\n\t\taAggregation.count.value = count;\r\n\t\ti = count - 1;\r\n\t}\r\n\r\n\treturn i;\r\n};\r\n\r\n\r\n/**\r\n * This method adds a RGB color to the Styles collection that is\r\n * referenced by several Styles.\r\n *\r\n * If this particular color is already present, it will not add it a\r\n * second time.\r\n *\r\n * @param {string} sHexColor HEX string representing a RGB color\r\n */\r\nStyles.prototype.addColor = function(sHexColor) {\r\n\tvar alreadyPresent;\r\n\r\n\tif (!this.colors) {\r\n\t\tthis.addChild({\r\n\t\t\tid: \"colors\",\r\n\t\t\ttag: \"colors\",\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"mru\",\r\n\t\t\t\t\ttag: \"mruColors\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t});\r\n\t}\r\n\r\n\talreadyPresent = this.colors.mru.childs.some(function(color) {\r\n\t\treturn color.rgb.value === \"FF\" + sHexColor;\r\n\t});\r\n\r\n\tif (alreadyPresent) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis.colors.mru.addChild({\r\n\t\ttag: \"color\",\r\n\t\tattributes: [\r\n\t\t\t{\r\n\t\t\t\tid: \"rgb\",\r\n\t\t\t\tname: \"rgb\",\r\n\t\t\t\tvalue: \"FF\" + sHexColor\r\n\t\t\t}\r\n\t\t]\r\n\t});\r\n};\r\n\r\n\r\n/**\r\n * This method adds a Font to the Styles collection that can be\r\n * referenced by several Styles. The Font is instantiated according\r\n * to the provided configuration object.\r\n *\r\n * If this particular Font is already present, it will not add it a\r\n * second time. This ensures that each referenced Font is unique\r\n * according to the criteria of Font#equals.\r\n *\r\n * The method returns the index which deals as an identifier for this\r\n * Font.\r\n *\r\n * @param {Object} oData Configuration object for this Font\r\n * @returns {number} The index of this Font used for reference by Style objects\r\n */\r\nStyles.prototype.addFont = function(oData) {\r\n\tvar oFont = new Font(oData);\r\n\r\n\treturn this._addToAggregation(oFont, this.fonts);\r\n};\r\n\r\n\r\n/**\r\n * This method adds a Fill to the Styles collection that can be\r\n * referenced by several Styles. The Fill is instantiated according\r\n * to the provided configuration object.\r\n *\r\n * If this particular Fill is already present, it will not add it a\r\n * second time. This ensures that each referenced Fill is unique\r\n * according to the criteria of Fill#equals.\r\n *\r\n * The method returns the index which deals as an identifier for this\r\n * Fill.\r\n *\r\n * @param {Object} oData Configuration object for this Fill\r\n * @returns {number} The index of this Fill used for reference by Style objects\r\n */\r\nStyles.prototype.addFill = function(oData) {\r\n\tvar index, oFill;\r\n\r\n\toFill = new Fill(oData);\r\n\r\n\tindex = this._addToAggregation(oFill, this.fills);\r\n\r\n\tif (oFill.getFill() !== null) {\r\n\t\tthis.addColor(oFill.getFill());\r\n\t}\r\n\r\n\treturn index;\r\n};\r\n\r\n\r\n/**\r\n * This method adds a Border to the Styles collection that can be\r\n * referenced by several Styles. The Border is instantiated according\r\n * to the provided configuration object.\r\n *\r\n * If this particular Border is already present, it will not add it a\r\n * second time. This ensures that each referenced Border is unique\r\n * according to the criteria of Border#equals.\r\n *\r\n * The method returns the index which deals as an identifier for this\r\n * Border.\r\n *\r\n * @param {Object} oData Configuration object for this Border\r\n * @returns {number} The index of this Border used for reference by Style objects\r\n */\r\nStyles.prototype.addBorder = function(oData) {\r\n\tvar oBorder = new Border(oData);\r\n\r\n\treturn this._addToAggregation(oBorder, this.borders);\r\n};\r\n\r\n\r\n/**\r\n * This method adds a NumberFormat to the Styles collection that can\r\n * be referenced by several Styles. The NumberFormat is instantiated\r\n * according to the provided configuration object.\r\n *\r\n * If this particular NumberFormat is already present, it will not\r\n * add it a second time. This ensures that each referenced\r\n * NumberFormat is unique according to the criteria of\r\n * NumberFormat#equals.\r\n *\r\n * The method returns the index which deals as an identifier for this\r\n * NumberFormat.\r\n *\r\n * @param {Object} oData Configuration object for this NumberFormat\r\n * @returns {number} The index of this NumberFormat used for reference by Style objects\r\n */\r\nStyles.prototype.addNumberFormat = function(oData) {\r\n\tvar index, numberFormat;\r\n\r\n\tnumberFormat = new NumberFormat(oData);\r\n\tindex = this._addToAggregation(numberFormat, this.numberFormats);\r\n\r\n\tnumberFormat.setId(NumberFormat.ID_OFFSET + index);\r\n\r\n\treturn numberFormat.getId();\r\n};\r\n\r\nmodule.exports = Styles;","var XMLElement = require(\"./XMLElement\");\r\n\r\n/**\r\n * The class XMLAttribute is a wrapper for representing XML-like attributes attributes.\r\n * It is mainly used for defining namespaces and namespace-related attributes.\r\n *\r\n * @param {object} oConfig Object representation of the XMLNode containing at least the tag of the element.\r\n * @param {string} oConfig.name String representation of the XML tag.\r\n * @param {string} [oConfig.prefix] Prefix of the {@link XMLAttribute} that will be used for XML namespace purposes.\r\n * @param {string} [oConfig.suffix] Suffix of the {@link XMLAttribute} that will be used for XML namespace purposes.\r\n * @param {string} [oConfig.value] Textual value of the {@link XMLAttribute}.\r\n * @class\r\n * @module xml/XMLAttribute\r\n */\r\nfunction XMLAttribute(oConfig) {\r\n\tXMLElement.call(this, oConfig);\r\n\r\n\tthis.name = oConfig.name ? oConfig.name : \"\";\r\n\tthis.prefix = oConfig.prefix ? oConfig.prefix : \"\";\r\n\tthis.suffix = oConfig.suffix ? oConfig.suffix : \"\";\r\n}\r\n\r\nXMLAttribute.prototype = Object.create(XMLElement.prototype);\r\nXMLAttribute.prototype.constructor = XMLAttribute;\r\n\r\n/**\r\n * Performes a String serialization of the XMLAttribute. The representation is formatted as follows:\r\n * <prefix>:<name>:<suffix>=\"<value>\"\r\n *\r\n * i.E. xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n * for { name: \"xmlns\", suffix: \"xsi\", value: \"http://www.w3.org/2001/XMLSchema-instance\" }\r\n *\r\n * Note that the serialized String always comes with a leading whitespace to allow easy concatenation.\r\n *\r\n * @function serialize\r\n * @returns {string} String representation of the XMLAttribute\r\n */\r\nXMLAttribute.prototype.serialize = function() {\r\n\t// eslint-disable-next-line max-len\r\n\treturn ` ${this.prefix ? this.prefix + \":\" : \"\"}${this.name}${this.suffix ? \":\" + this.suffix : \"\"}=\"${this.xmlEncode(this.value)}\"`;\r\n};\r\n\r\nmodule.exports = XMLAttribute;","/**\r\n * The XMLElement is an abstract base class that can store a\r\n * particular value and escape XML specific characters.\r\n *\r\n * @param {Object} oConfig - Configuration object that contains the value of this XML Element\r\n * @constructor\r\n * @abstract\r\n */\r\nfunction XMLElement(oConfig) {\r\n\tthis.value = oConfig && (oConfig.value || typeof oConfig.value === \"number\") ? oConfig.value : \"\";\r\n}\r\n\r\n/**\r\n * Escapes the given String value to fulfill the requirements of\r\n * XML encoded characters. If the String does not contain any\r\n * character that needs to be encoded, the original String will\r\n * be returned.\r\n *\r\n * This significantly increases the performance because the\r\n * initial regular expression match is much faster than the\r\n * String replace function. We assume that only a few Strings\r\n * need to be encoded.\r\n *\r\n * The following characters need to be encoded:\r\n * < (lower than)\r\n * > (greater than)\r\n * \" (quotes)\r\n * & (ampersand)\r\n *\r\n * @param {string} sValue - The value that needs to be XML encoded\r\n * @returns {string} - XML encoded String\r\n */\r\nXMLElement.prototype.xmlEncode = function(sValue) {\r\n\treturn typeof sValue === \"string\" && sValue.match(/[><\"&]+/) !== null ? this._replace(sValue) : sValue;\r\n};\r\n\r\n/**\r\n * @see _xmlEncode\r\n * @param {string} sValue - The string that contains characters that needs to be replaced\r\n * @returns {string} - XML encoded String\r\n * @private\r\n */\r\nXMLElement.prototype._replace = function(sValue) {\r\n\r\n\t/**\r\n\t * Perform ampersand replacement first to avoid encoding the\r\n\t * control ampersand of other encoded characters.\r\n\t *\r\n\t * i.E. >& should be encoded as >& instead of &gt;&\r\n\t */\r\n\treturn sValue\r\n\t\t.replace(/&/g, \"&\")\r\n\t\t.replace(/</g, \"<\")\r\n\t\t.replace(/>/g, \">\")\r\n\t\t.replace(/\"/g, \""\");\r\n};\r\n\r\nmodule.exports = XMLElement;","var XMLNode\t\t = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The XMLFile class is a subclass of XMLNode that enriches the\r\n * object by path and file name information.\r\n *\r\n * @param {Object} oConfig - The configuration object for this XMLFile\r\n * @param {string} oConfig.path - The relative path of this XMLFile\r\n * @param {string} oConfig.filename - The file name of this XMLFile\r\n * @class\r\n */\r\nfunction XMLFile(oConfig) {\r\n\tXMLNode.call(this, oConfig);\r\n\r\n\tthis._filename = oConfig.filename;\r\n\tthis._path = oConfig.path;\r\n}\r\n\r\nXMLFile.prototype = Object.create(XMLNode.prototype);\r\nXMLFile.prototype.constructor = XMLFile;\r\n\r\n/**\r\n * Returns the name of this particular file including its file extension.\r\n *\r\n * @returns {string} Name of the file\r\n */\r\nXMLFile.prototype.getFileName = function() {\r\n\treturn this._filename;\r\n};\r\n\r\n/**\r\n * Assigns the given string as name of the file. The name must contain a file extension.\r\n *\r\n * @param {string} sFileName - Name of the file\r\n */\r\nXMLFile.prototype.setFileName = function(sFileName) {\r\n\r\n\tif (!sFileName.match(/^\\S+\\.\\S{3,4}$/)) {\r\n\t\tthrow new Error(\"Invalid file name: \" + sFileName);\r\n\t}\r\n\r\n\tthis._filename = sFileName;\r\n};\r\n\r\n/**\r\n * Returns the path of the file without any filename.\r\n *\r\n * @returns {string} - Path of the file\r\n */\r\nXMLFile.prototype.getPath = function() {\r\n\treturn this._path;\r\n};\r\n\r\n/**\r\n * Returns the absolute Path to the file.\r\n *\r\n * @returns {string} - Absolute path including the filename\r\n */\r\nXMLFile.prototype.getAbsolutePath = function() {\r\n\treturn this.getPath() + this.getFileName();\r\n};\r\n\r\n/**\r\n * Assigns the given path to this XMLFile. The path needs to end with\r\n * a slash to match the criteria.\r\n *\r\n * @param {string} sPath - Relative path of this XMLFile\r\n */\r\nXMLFile.prototype.setPath = function(sPath) {\r\n\r\n\t/* IE compatible endsWith */\r\n\tif (!sPath || sPath.lastIndexOf(\"/\") !== (sPath.length - 1)) {\r\n\t\tthrow new Error(\"Invalid file path: \" + sPath);\r\n\t}\r\n\r\n\tthis._path = sPath;\r\n};\r\n\r\n/**\r\n * Performs a serialization of this XMLFile based on the XMLNode#serialize\r\n * implementation. The optional parameter allows to finalize this XMLFile\r\n * so that all aggregations will be cleared and the cleanup hook\r\n * XMLFile#cleanup will be executed. The aggregations will be cleared\r\n * outside of the cleanup function. This will ensure proper cleanup\r\n * even is the subclass is not calling the super class function.\r\n *\r\n * @param {boolean} [bFinalize]\r\n * Forces the XMLFile to destroy its aggregations. It will call the\r\n * cleanup function of the instance. This can be used as a hook for\r\n * subclasses that inherit from XMLFile. This frees additional memory\r\n * but should be used with caution because after serialization all\r\n * content will be lost.\r\n *\r\n * @returns {string} The serialized XMLFile\r\n *\r\n * @Overrides XMLNode#serialize\r\n */\r\nXMLFile.prototype.serialize = function(bFinalize) {\r\n\tconst sSerializedString = Object.getPrototypeOf(XMLFile.prototype).serialize.call(this);\r\n\r\n\tif (bFinalize) {\r\n\t\tthis.childs.length = 0;\r\n\r\n\t\tthis.cleanup();\r\n\t}\r\n\r\n\treturn sSerializedString;\r\n};\r\n\r\n/**\r\n * Abstract function that can be overridden as a cleanup hook.\r\n * @abstract\r\n */\r\nXMLFile.prototype.cleanup = function() {\r\n\r\n\t/* Do nothing */\r\n};\r\n\r\nmodule.exports = XMLFile;","var XMLElement = require(\"./XMLElement\");\r\nvar XMLAttribute = require(\"./XMLAttribute\");\r\n\r\n/**\r\n * JSON representation of XML nodes. Each node has a tag an can have multiple {@link XMLAttribute} entries assigned.\r\n * It can also have multiple child {@link XMLNode} elements assigned. The node can contain a value.\r\n *\r\n * @param {object|string} oConfig - Object representation of the XMLNode containing at least the tag of the element.\r\n * @param {string} oConfig.tag - String representation of the XML tag.\r\n * @param {object[]} [oConfig.attributes] - Aggregation for adding {@link XMLAttributes} to the current node.\r\n * @param {object[]} [oConfig.properties] - Aggregation for adding {@link XMLNode} objects as child objects to this node\r\n * @param {string} [oConfig.value] - String value inside the XML tag.\r\n * @class\r\n * @module xml/XMLNode\r\n */\r\nfunction XMLNode(oConfig) {\r\n\tXMLElement.call(this, oConfig);\r\n\r\n\t/* Shorthand functionality to simply assign the XMLNode tag name instead of a configuration object */\r\n\tconst config = typeof oConfig === \"string\" ? {tag: oConfig} : oConfig;\r\n\r\n\tObject.defineProperty(this, \"root\", {value: !!config.root, writable: false});\r\n\tthis.tag = typeof config.tag == \"string\" ? config.tag : \"\";\r\n\tthis.attributes = [];\r\n\tthis.childs = [];\r\n\r\n\t/* Initialize the XML node by filling the aggregations if present */\r\n\tif (config.attributes) {\r\n\t\tfor (let i = 0; i < config.attributes.length; i++) {\r\n\t\t\tthis.addAttribute(config.attributes[i]);\r\n\t\t}\r\n\t}\r\n\r\n\tif (config.properties) {\r\n\t\tfor (let j = 0; j < config.properties.length; j++) {\r\n\t\t\tthis.addChild(config.properties[j]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nXMLNode.prototype = Object.create(XMLElement.prototype);\r\nXMLNode.prototype.constructor = XMLNode;\r\n\r\nXMLNode.processingInformation = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\r\n\r\n\r\n/**\r\n * Adds the provided XMLAttribute object to the XMLNode.\r\n * If no XMLAttribute is provided it will create one instead.\r\n * The method returns the XMLAttribute for chaining.\r\n *\r\n * @function addAttribute\r\n * @param {Object} oConfig - XMLAttribute or configuration object that represents a XMLAttribute\r\n * @returns {Object} - An instance of XMLAttribute that was added to this node\r\n */\r\nXMLNode.prototype.addAttribute = function(oConfig) {\r\n\tconst attribute = oConfig instanceof XMLAttribute ? oConfig : new XMLAttribute(oConfig);\r\n\r\n\tthis.attributes.push(attribute);\r\n\r\n\tif (oConfig.id) {\r\n\t\tObject.defineProperty(this, oConfig.id, {value: attribute, writable: false, configurable: true});\r\n\t}\r\n\r\n\treturn attribute;\r\n};\r\n\r\n\r\n/**\r\n * Adds the provided XMLNode object as child to the current XMLNode.\r\n * If no XMLNode is provided it will create one instead.\r\n * The method returns the XMLNode for chaining.\r\n *\r\n * @function addChild\r\n * @param {Object} oConfig - XMLNode or configuration object that represents a XMLNode\r\n * @returns {object} - An instance of XMLNode that was added to this node\r\n */\r\nXMLNode.prototype.addChild = function(oConfig) {\r\n\r\n\t/* Additional Attributes of the child node will be added in the Constructor */\r\n\tconst node = oConfig instanceof XMLNode ? oConfig : new XMLNode(oConfig);\r\n\r\n\tthis.childs.push(node);\r\n\r\n\tif (oConfig.id) {\r\n\t\tObject.defineProperty(this, oConfig.id, {value: node, writable: false, configurable: true});\r\n\t}\r\n\r\n\treturn node;\r\n};\r\n\r\n\r\n/**\r\n * Removes the property from this object and also deletes the\r\n * referenced item within the child nodes or attributes\r\n * aggregation.\r\n *\r\n * The method returns the previously referenced object or null if\r\n * the property name is not present on this particular XMLNode or\r\n * if no item is referenced.\r\n *\r\n * Builtin properties of XMLNode cannot be removed with this\r\n * function. These are \"root\", \"tag\", \"attributes\", \"childs\",\r\n * \"value\".\r\n *\r\n * @param {string} sProperty - Name of the property that should be removed\r\n * @returns {XMLNode|XMLAttribute|null} - The referenced object that gets removed as well\r\n */\r\nXMLNode.prototype.remove = function(sProperty) {\r\n\r\n\t/* Only proceed if property is present */\r\n\tif (!(sProperty in this)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet aAggregation;\r\n\tconst referencedElement = this[sProperty];\r\n\r\n\t/* Check if referenced element is a XMLAttribute */\r\n\tif (referencedElement instanceof XMLAttribute) {\r\n\t\taAggregation = this.attributes;\r\n\t} else if (referencedElement instanceof XMLNode && !(sProperty in new XMLNode(\"\"))) {\r\n\t\taAggregation = this.childs;\r\n\t} else {\r\n\r\n\t\t/* Early return if referenced element is neither an XMLAttribute nor XMLNode */\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst index = aAggregation.indexOf(referencedElement);\r\n\r\n\taAggregation.splice(index, 1); // It is ensured that index > -1 otherwise #addChild or #addAttribute fail\r\n\tdelete this[sProperty];\r\n\r\n\treturn referencedElement;\r\n};\r\n\r\n/**\r\n * Allows recursive serialization of the object and its descendants. If the XMLNode is marked as root node,\r\n * it will automatically add the XML processing information in front of the serialized representation.\r\n *\r\n * @function serialize\r\n * @returns {string} - String representation of the XMLNode\r\n */\r\nXMLNode.prototype.serialize = function() {\r\n\tlet sSerialized = (this.root ? XMLNode.processingInformation : \"\") + \"<\" + this.tag;\r\n\r\n\t/* Insert attributes including namespace information */\r\n\tfor (let i = 0; i < this.attributes.length; i++) {\r\n\t\tsSerialized += this.attributes[i].serialize();\r\n\t}\r\n\r\n\tconst sSerializedContent = this.getSerializedContent();\r\n\r\n\tif (sSerializedContent) {\r\n\t\tsSerialized = (\" \" + sSerialized).substr(1);\r\n\t\tsSerialized += `>${sSerializedContent}</${this.tag}>`;\r\n\t} else {\r\n\r\n\t\t/* Shorthand tag support */\r\n\t\tsSerialized += \"/>\";\r\n\t\tsSerialized = (\" \" + sSerialized).substr(1);\r\n\t}\r\n\r\n\treturn sSerialized;\r\n};\r\n\r\n/**\r\n * Returns the serialized content of the XMLNode.\r\n * The conent includes child nodes as well as a value.\r\n *\r\n * @returns {String} Serialized string representation of the content\r\n */\r\nXMLNode.prototype.getSerializedContent = function() {\r\n\tlet sSerialized = \"\";\r\n\r\n\tfor (let i = 0; i < this.childs.length; i++) {\r\n\t\tsSerialized += typeof this.childs[i] === \"string\" ? this.childs[i] : this.childs[i].serialize();\r\n\t}\r\n\r\n\tsSerialized += this.xmlEncode(this.value);\r\n\r\n\treturn sSerialized;\r\n};\r\n\r\nmodule.exports = XMLNode;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(838);\n"],"names":["App","ContentTypes","Core","Relationships","Sheet","Workbook","Customizing","XLSXBuilder","aBinding","oContext","hierarchyLevel","mCustomizing","aMetadataConfig","i","oMetainfoGroup","sSheetName","sMetadataSheetName","Array","length","Error","this","app","objects","core","workbook","update","sheetName","metaSheetName","sheet","addSheet","columns","selectSheet","metainfo","property","label","width","metadata","hideHeader","createGroup","name","_insertIntoSheet","items","slice","prototype","build","files","zip","j","fileConfig","xmlObject","relation","zipConfig","path","type","relationships","target","JSZip3","FileType","addRelationship","file","serialize","getAbsolutePath","getRelationships","getRelatedFiles","forEach","compression","support","nodebuffer","generateAsync","append","aData","oSheet","array","insert","shift","module","exports","BigNumber","BooleanType","CalendarTime","CalendarDate","CalendarDateTime","Cell","Currency","Enumeration","Numeric","Text","Timezone","Column","oData","oSharedStrings","oStyles","oColumnData","isArray","styles","_initType","cell","oType","toLowerCase","timezone","timezoneProperty","getTimezoneTranslation","registerAt","getCell","bind","setValue","oError","message","JSON","stringify","Row","ColumnConfiguration","oConfig","aColumns","oColumn","_row","sharedStrings","Object","defineProperty","value","hierarchyLevelProperty","push","_initBinding","addCell","nHierarchyLevel","normalizedHierarchyLevel","Math","min","outline","addAttribute","id","remove","getHeader","row","font","size","bold","fill","color","setStyle","getStyleId","column","getGroupHeader","sGroupName","data","spans","sKey","iScale","currency","DEFAULT","scale","CURRENCY","MAX_CURRENCY_SCALE","unit","UNIT","assign","TIMEZONE","sCurrencyCode","sUnit","sTimezone","Type","ScaleSettings","Alignment","call","displayUnit","unitProperty","delimiter","alignment","horizontal","RIGHT","LEFT","create","constructor","getScale","getScaleForCurrency","getScaleForUnit","isNaN","getValue","sResult","sValue","toString","match","_parseValue","bDelimiter","aSplitted","aInteger","sDecimal","sInteger","split","reduceRight","accumulator","currentValue","substring","trueValue","falseValue","numberFormat","isCustomFormatted","_createConfiguration","config","getPrototypeOf","format","CalendarBase","calendar","inputFormat","toUpperCase","LOCAL_TIMEZONE","Intl","DateTimeFormat","resolvedOptions","timeZone","BUILTIN","oSymbols","apply","oDate","setUTCFullYear","setUTCMonth","setUTCDate","sTemplate","getDefaultFormat","parseInt","sProperty","iTimestamp","vValue","ms","valueOf","_parseStringValue","dateToExcel","_parseStringDate","odataDateRegex","test","_parseOdataDate","odataDateTimeOffsetRegex","Date","parse","isFinite","_parseODataDuration","parts","days","hours","minutes","seconds","odataDurationRegex","exec","parseFloat","_parseTimeOfDay","date","timeOfDayRegex","setUTCHours","getTime","matchArray","offset","setUTCMinutes","getUTCMinutes","dateStringRegex","nTimestamp","iOffset","max","sPattern","aMatch","sSubstring","index","charAt","utc","displayTimezone","styleIds","_oCache","Map","getTimezone","addStyle","iDateDifference","fExcelValue","iTimezoneOffset","oFormat","oParts","getTimezoneFormat","formatToParts","reduce","acc","item","getUTCDate","day","getUTCHours","hour","minute","oCachedEntry","oInstance","oOptions","get","hourCycle","era","set","iExcelTimestamp","fParsedValue","getNumberFormatTemplate","template","getUnit","_valueMap","valueMap","key","autoScale","builtin","scientificRegEx","aSegments","iExponent","Number","toFixed","isIEEE754Compliant","bCompliant","trim","replace","sCompliantLineBreak","String","fromCharCode","wrap","_mStyleIds","formulaRegex","convertLineBreaks","align","indent","bRequiresPrefix","sIdentifier","quotePrefix","properties","reRegEx","aValues","aInputMatch","RegExp","every","styleId","textAlign","XMLNode","DataType","SharedString","writable","_shared","_oFallbackType","_applyType","Boolean","InlineString","FormularString","_cellTypeProperty","tag","attributes","bindingType","nStyle","style","setReference","sReference","reference","oBusinessObject","_isValuePresent","text","getColumnReferenceByIndex","nIndex","floor","_updateSpans","childs","oCell","count","spacePreserveAttributeId","controlCharacterTestRegex","controlCharacterReplaceRegex","spacePreserveRegex","_escapeControlCharacters","sCharHex","sMatch","codePointAt","prefix","substr","XMLFile","SharedStrings","instance","MAX_CELL_LENGTH","getInstance","filename","root","map","has","uniqueCount","cleanup","clear","oColumnConfiguration","_hierarchyProperty","_hierarchyLevel","_rowCount","_createCols","_createHeader","suffix","MAX_ROWS","col","minWidth","nWidth","_columns","_calculateColumnWidth","ceil","addChild","nCharacters","_setHierarchyDepth","nHierarchyDepth","hierarchyDepth","headerRow","views","defaultView","_appendRow","oRow","dimension","sSerializedRow","pop","filter","sName","nLevel","groupHeaderRow","getRowCount","application","version","FILENAME","title","modifiedBy","toISOString","modified","ReferenceNode","_relatedFiles","_relationships","addRelatedFile","oXMLFile","oReferenceNode","setFileName","getFileName","setPath","getPath","sTarget","sType","Styles","_styles","_sharedStrings","RELATIONS","_registeredSheets","nCount","sId","sSheetFileName","sheets","indexOf","sheetElement","that","createDefinedName","sDefinedName","sDimension","iIndex","aArray","definedNames","_contains","sAlign","oAggregation","contained","CENTER","contains","vertical","TOP","MIDDLE","BOTTOM","isDefault","setIndent","nIndent","_setAlignmentAttribute","setHorizontalAlignment","setWrapText","bWrap","wrappingAttribute","setVerticalAlignment","_getAlignmentAttribute","equals","oAlignment","Border","oBorder","Fill","setFill","setType","DEFAULT_TYPE","oFill","getType","getFill","rgb","sColor","reset","Font","setName","setSize","setFamily","family","setBold","DEFAULT_SIZE","DEFAULT_NAME","oFont","getName","getSize","isBold","getColor","getFamily","valueAttribute","bBold","boldProperty","nFamily","nSize","NumberFormat","BUILTIN_IDS","ID_OFFSET","getId","formatId","getFormat","setId","iId","_isBuiltin","setFormat","sFormat","oNumberFormat","Style","getAlignment","getFontId","getFillId","getBorderId","border","getNumberFormatId","hasQuotePrefix","setAlignment","oAlign","alignProperty","_apply","configurable","setFontId","nFontId","setFillId","nFillId","setBorderId","sBorderId","setNumberFormatId","nNumFmtId","setQuotePrefix","bQuotePrefix","sAttributeName","nId","applyProperty","oStyle","addFill","fontId","fillId","borderId","numberFormatId","addFont","addBorder","addNumberFormat","_addToAggregation","cellXfs","oNewItem","aAggregation","existingItem","addColor","sHexColor","colors","mru","some","fonts","fills","borders","numberFormats","XMLElement","XMLAttribute","xmlEncode","_replace","_filename","_path","sFileName","sPath","lastIndexOf","bFinalize","sSerializedString","processingInformation","attribute","node","referencedElement","splice","sSerialized","sSerializedContent","getSerializedContent","__webpack_module_cache__","__webpack_exports__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"XLSXBuilder.js","mappings":"2CAAA,IAAIA,EAAS,EAAQ,KACpBC,EAAe,EAAQ,KACvBC,EAAS,EAAQ,KACjBC,EAAgB,EAAQ,KACxBC,EAAU,EAAQ,KAClBC,EAAY,EAAQ,KACpBC,EAAe,EAAQ,KA4BxB,SAASC,EAAYC,EAAUC,EAAUC,EAAgBC,GACxD,IAAIC,EAAiBC,EAAGC,EAAgBC,EAAYC,EAEpD,KAAMR,aAAoBS,OAAWT,EAASU,QAC7C,MAAM,IAAIC,MAAM,uBAwBjB,GApBAJ,EAAa,sBACbC,EAAqB,WAErBI,KAAKC,IAAM,IAAID,KAAKE,QAAQtB,IAAIS,GAChCW,KAAKG,KAAO,IAAIH,KAAKE,QAAQpB,KAAKO,GAClCW,KAAKI,SAAW,IAAIJ,KAAKE,QAAQjB,SAE7BM,GACHL,EAAYmB,OAAOd,GAIhBF,IACHM,EAAaN,EAASiB,UAAYjB,EAASiB,UAAYX,EACvDC,EAAqBP,EAASkB,cAAgBlB,EAASkB,cAAgBX,GAGxEI,KAAKQ,MAAQR,KAAKI,SAASK,SAASd,EAAY,CAAEe,QAAStB,EAAUE,eAAgBA,IACrFU,KAAKI,SAASO,YAAYX,KAAKQ,OAEP,iBAAbnB,GAAyBA,EAASuB,oBAAoBf,MAwBhE,IArBAL,EAAkB,CACjB,CACCqB,SAAU,MACVC,MAAO,MACPC,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AGnC,MAAM2gB,EAAqBnjB,KAAKojB,uBAYhC,OAVID,GACHD,GAAe,IAAMA,GAAapN,OAAO,GACzCoN,GAAe,IAAIC,MAAuBnjB,KAAKmU,SAI/C+O,GAAe,KACfA,GAAe,IAAMA,GAAapN,OAAO,IAGnCoN,CACR,EAQA1P,EAAQjS,UAAU6hB,qBAAuB,WACxC,IAAIF,EAAc,GAElB,IAAK,IAAIzjB,EAAI,EAAGA,EAAIO,KAAKkV,OAAOpV,OAAQL,IACvCyjB,GAAyC,iBAAnBljB,KAAKkV,OAAOzV,GAAkBO,KAAKkV,OAAOzV,GAAKO,KAAKkV,OAAOzV,GAAG+C,YAKrF,OAFA0gB,GAAeljB,KAAKoiB,UAAUpiB,KAAKmG,OAE5B+c,CACR,EAEA3f,EAAOC,QAAUgQ,C,GCxLb6P,EAA2B,CAAC,ECE5BC,EDCJ,SAASC,EAAoBC,GAE5B,IAAIC,EAAeJ,EAAyBG,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAajgB,QAGrB,IAAID,EAAS8f,EAAyBG,GAAY,CAGjDhgB,QAAS,CAAC,GAOX,OAHAmgB,EAAoBH,GAAUjgB,EAAQA,EAAOC,QAAS+f,GAG/ChgB,EAAOC,OACf,CCnB0B+f,CAAoB,K","sources":["webpack://sap.ui.export-xlsx-builder/./xlsx/src/XLSXBuilder.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/Column.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/ColumnConfiguration.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/Customizing.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/BigNumber.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/BooleanType.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/CalendarBase.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/CalendarDate.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/CalendarDateTime.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/CalendarTime.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Currency.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Enumeration.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Numeric.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Text.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Timezone.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/binding/type/Type.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/Cell.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/Row.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/SharedString.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/SharedStrings.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/data/Sheet.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/App.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/ContentTypes.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/Core.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/ReferenceNode.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/Relationships.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/objects/Workbook.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Alignment.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Border.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Fill.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Font.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/NumberFormat.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Style.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/style/Styles.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/xml/XMLAttribute.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/xml/XMLElement.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/xml/XMLFile.js","webpack://sap.ui.export-xlsx-builder/./xlsx/src/xml/XMLNode.js","webpack://sap.ui.export-xlsx-builder/webpack/bootstrap","webpack://sap.ui.export-xlsx-builder/webpack/startup"],"sourcesContent":["var App\t\t\t\t= require(\"./objects/App\"),\r\n\tContentTypes\t= require(\"./objects/ContentTypes\"),\r\n\tCore\t\t\t= require(\"./objects/Core\"),\r\n\tRelationships\t= require(\"./objects/Relationships\"),\r\n\tSheet\t\t\t= require(\"./data/Sheet\"),\r\n\tWorkbook\t\t= require(\"./objects/Workbook\"),\r\n\tCustomizing\t\t= require(\"./binding/Customizing\");\r\n\r\n/* global JSZip3 */\r\n\r\n/**\r\n * The XLSXBuilder class represents an Office Open XML Spreadsheet\r\n * (Microsoft Excel) that can be used to insert structured and\r\n * formatted data and pack a zipped *.xlsx document.\r\n *\r\n * XLSXBuilder requires JSZip 3.x to be present.\r\n *\r\n * @param {Object[]|string[]} aBinding Binding configuration that is used for {@link Column} definition\r\n * @param {Object} [oContext] Context object containing metadata for this particular XLSX\r\n * @param {string} [oContext.application] Application that created this XLSX\r\n * @param {string} [oContext.version] Application version that was used to create this XLSX\r\n * @param {string} [oContext.title] Title of the XLSX document\r\n * @param {string} [oContext.modifiedBy] User context for the exported document\r\n * @param {string} [oContext.sheetName] The name of the data sheet that will be shown in Excel\r\n * @param {string} [oContext.metaSheetName] The name of the metadata sheet that will be shown in Excel\r\n * @param {Object[]} [oContext.metainfo] Optional Metadata that will be displayed in the additional Metadata Sheet\r\n * @param {string} [hierarchyLevel] Name of the property that contains the hierarchy level of each lime item\r\n * @param {Object} [mCustomizing] An object containing all customizing related information\r\n * @param {Object} [mCustomizing.currency] Custom configuration object that can be used for {@link Customizing} digits\r\n * @param {Object} [mCustomizing.unit] Custom configuration object that can be used for {@link Customizing} digits\r\n * @param {Object} [mCustomizing.timezone] Custom configuration object used for timezone localization\r\n *\r\n * @constructor\r\n */\r\nfunction XLSXBuilder(aBinding, oContext, hierarchyLevel, mCustomizing) {\r\n\tvar aMetadataConfig, i, oMetainfoGroup, sSheetName, sMetadataSheetName;\r\n\r\n\tif (!(aBinding instanceof Array) || !aBinding.length) {\r\n\t\tthrow new Error(\"No binding provided\");\r\n\t}\r\n\r\n\t/* Set default values */\r\n\tsSheetName = \"SAP Document Export\";\r\n\tsMetadataSheetName = \"Metadata\";\r\n\r\n\tthis.app = new this.objects.App(oContext);\r\n\tthis.core = new this.objects.Core(oContext);\r\n\tthis.workbook = new this.objects.Workbook();\r\n\r\n\tif (mCustomizing) {\r\n\t\tCustomizing.update(mCustomizing);\r\n\t}\r\n\r\n\t/* Overwrite default Sheet names if maintained */\r\n\tif (oContext) {\r\n\t\tsSheetName = oContext.sheetName ? oContext.sheetName : sSheetName;\r\n\t\tsMetadataSheetName = oContext.metaSheetName ? oContext.metaSheetName : sMetadataSheetName;\r\n\t}\r\n\r\n\tthis.sheet = this.workbook.addSheet(sSheetName, { columns: aBinding, hierarchyLevel: hierarchyLevel });\r\n\tthis.workbook.selectSheet(this.sheet);\r\n\r\n\tif (typeof oContext === \"object\" && oContext.metainfo instanceof Array) {\r\n\r\n\t\t/* Define column configuration for metadata sheet */\r\n\t\taMetadataConfig = [\r\n\t\t\t{\r\n\t\t\t\tproperty: \"key\",\r\n\t\t\t\tlabel: \"Key\",\r\n\t\t\t\twidth: 20\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tproperty: \"value\",\r\n\t\t\t\tlabel: \"Value\",\r\n\t\t\t\twidth: 20\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\t/* Add optional Metadata Sheet*/\r\n\t\tthis.metadata = this.workbook.addSheet(sMetadataSheetName, { columns: aMetadataConfig, hideHeader: true });\r\n\r\n\t\t/*\r\n\t\t * Add a copy of metadata to the Metadata Sheet. The method\r\n\t\t * #_insertIntoSheet uses Array#shift and would otherwise\r\n\t\t * manipulate the original metadata array.\r\n\t\t */\r\n\t\tfor (i = 0; i < oContext.metainfo.length; i++) {\r\n\t\t\toMetainfoGroup = oContext.metainfo[i];\r\n\r\n\t\t\tthis.metadata.createGroup(oMetainfoGroup.name, 1);\r\n\t\t\tthis._insertIntoSheet(oMetainfoGroup.items.slice(), this.metadata);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nXLSXBuilder.prototype = {\r\n\r\n\tobjects: {\r\n\t\tApp: App,\r\n\t\tContentTypes: ContentTypes,\r\n\t\tCore: Core,\r\n\t\tRelationships: Relationships,\r\n\t\tSheet: Sheet,\r\n\t\tWorkbook: Workbook\r\n\t},\r\n\r\n\t/**\r\n\t * Triggers the packaging process for the Office Open XML\r\n\t * SpreadSheet. You need to call the method insert() first,\r\n\t * otherwise the generated Document will contain no data.\r\n\t *\r\n\t * The method returns a Promise to allow the library to work\r\n\t * asynchronously.\r\n\t *\r\n\t * @function build\r\n\t * @returns {Promise} Promise that represents a packed zip file as Blob or Nodebuffer\r\n\t */\r\n\tbuild: function() {\r\n\t\tvar bFinalize, files, zip, i, j, fileConfig, FileType, xmlObject, relation, zipConfig;\r\n\r\n\t\tfiles = [\r\n\t\t\t{\r\n\t\t\t\tname: \"[Content_Types].xml\",\r\n\t\t\t\tpath: \"\",\r\n\t\t\t\ttype: this.objects.ContentTypes\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \".rels\",\r\n\t\t\t\tpath: \"_rels/\",\r\n\t\t\t\ttype: this.objects.Relationships,\r\n\t\t\t\trelationships: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttarget: \"xl/workbook.xml\",\r\n\t\t\t\t\t\ttype: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttarget: \"docProps/app.xml\",\r\n\t\t\t\t\t\ttype: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttarget: \"docProps/core.xml\",\r\n\t\t\t\t\t\ttype: \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\"\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\tzip = new JSZip3();\r\n\t\tbFinalize = true;\r\n\r\n\t\tfor (i = 0; i < files.length; i++) {\r\n\t\t\tfileConfig = files[i];\r\n\t\t\tFileType = fileConfig.type;\r\n\t\t\txmlObject = new FileType();\r\n\r\n\t\t\tif (xmlObject instanceof this.objects.Relationships) {\r\n\t\t\t\tfor (j = 0; j < fileConfig.relationships.length; j++) {\r\n\t\t\t\t\trelation = fileConfig.relationships[j];\r\n\t\t\t\t\txmlObject.addRelationship(relation.target, relation.type);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tzip.file(fileConfig.path + fileConfig.name, xmlObject.serialize());\r\n\t\t}\r\n\r\n\t\t// Add document metadata\r\n\t\tzip.file(this.app.getAbsolutePath(), this.app.serialize());\r\n\t\tzip.file(this.core.getAbsolutePath(), this.core.serialize());\r\n\r\n\t\t// Add workbook and its related files\r\n\t\tzip.file(this.workbook.getAbsolutePath(), this.workbook.serialize());\r\n\t\tzip.file(this.workbook.getRelationships().getAbsolutePath(), this.workbook.getRelationships().serialize());\r\n\r\n\t\tthis.workbook.getRelatedFiles().forEach(function(file) {\r\n\t\t\tzip.file(file.getAbsolutePath(), file.serialize(bFinalize));\r\n\t\t});\r\n\r\n\t\tzipConfig = {\r\n\t\t\tcompression: \"DEFLATE\",\r\n\t\t\ttype: JSZip3.support.nodebuffer ? \"nodebuffer\" : \"arraybuffer\"\r\n\t\t};\r\n\r\n\t\treturn zip.generateAsync(zipConfig);\r\n\t},\r\n\r\n\t/**\r\n\t * Appends the specified set of data to the Open Document Spreadsheet.\r\n\t * All data will be bound according to the {@link ColumnConfiguration}.\r\n\t *\r\n\t * @function append\r\n\t * @param {(Object[]|Object)} aData - Array of data that gets appended to the Spreadsheet\r\n\t */\r\n\tappend: function(aData) {\r\n\t\tthis._insertIntoSheet(aData, this.sheet);\r\n\t},\r\n\r\n\t/**\r\n\t * Inserts the given data into the specified Sheet. The method will throw an Error if no Sheet is provided.\r\n\t *\r\n\t * @param {Array} aData - Array of business objects that should be inserted\r\n\t * @param {Sheet} oSheet - The Sheet where the data should be inserted into\r\n\t * @private\r\n\t */\r\n\t_insertIntoSheet: function(aData, oSheet) {\r\n\t\tvar array;\r\n\r\n\t\t/* We need to check if param is null or undefined because [null].length results in 1 */\r\n\t\tif (typeof aData === \"undefined\" || aData === null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tarray = aData instanceof Array ? aData : [aData];\r\n\r\n\t\twhile (array.length) {\r\n\t\t\toSheet.insert(array.shift());\r\n\t\t}\r\n\t}\r\n};\r\n\r\nmodule.exports = XLSXBuilder;","var BigNumber\t \t\t= require(\"./type/BigNumber\"),\r\n\tBooleanType \t\t= require(\"./type/BooleanType\"),\r\n\tCalendarTime \t\t= require(\"./type/CalendarTime\"),\r\n\tCalendarDate \t\t= require(\"./type/CalendarDate\"),\r\n\tCalendarDateTime\t= require(\"./type/CalendarDateTime\"),\r\n\tCell\t\t\t\t= require(\"../data/Cell\"),\r\n\tCurrency \t\t\t= require(\"./type/Currency\"),\r\n\tCustomizing \t\t= require(\"./Customizing\"),\r\n\tEnumeration \t\t= require(\"./type/Enumeration\"),\r\n\tNumeric \t\t\t= require(\"./type/Numeric\"),\r\n\tText\t\t \t\t= require(\"./type/Text\"),\r\n\tTimezone\t\t \t= require(\"./type/Timezone\");\r\n\r\n/**\r\n * The Column class represents the field type of columns. It handles\r\n * styling, data types and data binding.\r\n *\r\n * @param {(Object|string)} oData Data object representing the Column configuration\r\n * @param {string} oData.property References the data object property that is bound as value for this column\r\n * @param {string} [oData.textAlign] Optional alignment\r\n * @param {string} [oData.label] Optional column label that will be shown in the header row\r\n * @param {string} [oData.type] Optional data type for this column. Default: Column.Type.Text\r\n * @param {string} [oData.width] Optional width of the column\r\n * @param {SharedStrings} oSharedStrings SharedStrings instance that will be used by all Cells\r\n * @param {Styles} oStyles Styles collection that is needed to register each Style a Column uses\r\n * @class\r\n * @module binding/Column\r\n */\r\nfunction Column(oData, oSharedStrings, oStyles) {\r\n\tvar oColumnData;\r\n\r\n\t/* Fallback assignment if only a key is provided */\r\n\toColumnData = typeof oData === \"string\" ? {property: oData} : oData;\r\n\tif (!oColumnData || (typeof oColumnData.property !== \"string\" && !Array.isArray(oColumnData.property))) {\r\n\t\tthrow new Error(\"The property for the column is not defined\");\r\n\t}\r\n\r\n\tthis.property = oColumnData.property;\r\n\tthis.label = oColumnData.label ? oColumnData.label : oColumnData.property;\r\n\tthis.width = oColumnData.width;\r\n\tthis.styles = oStyles;\r\n\tthis.type = this._initType(oColumnData);\r\n\tthis.cell = new Cell(this.type, oSharedStrings);\r\n}\r\n\r\n/**\r\n * Initializes the data type for this Column. Type specific\r\n * formatting information will be evaluated and applied.\r\n *\r\n * @param {Object} oData Configuration object for this Column that also contains type and formatting information\r\n * @param {string} oData.type Specifies the data type\r\n * @param {boolean} [oData.autoScale] Specifies if the scale customizing is being used\r\n * @param {string} [oData.calendar] Specifies the calendar if type is date, datetime or time\r\n * @param {boolean} [oData.delimiter] Specifies if a thousands delimiter is shown\r\n * @param {boolean} [oData.displayTimezone] Specifies if the IANA timezone will be visible in the cell\r\n * @param {boolean} [oData.displayUnit] Specifies if the UoM will be shown or not if type is number or currency\r\n * @param {string} [oData.falseValue] Specifies the displayed value if the boolean type has the value false\r\n * @param {string} [oData.format] Specifies a custom format if type is date, datetime or time\r\n * @param {string} [oData.hierarchyLevel] Specifies the name of the property that contains the hierarchy level\r\n * @param {string} [oData.inputFormat] Specifies the input format of a string based date\r\n * @param {number} [oData.scale] Specifies the decimal scale\r\n * @param {string} [oData.template] Specifies a template string that can be filled with several properties\r\n * @param {string} [oData.textAlign] Defines the horizontal alignment\r\n * @param {string} [oData.timezone] Specific timezone that will be applied to the Column\r\n * @param {string} [oData.timezoneProperty] Property name that references the timezone\r\n * @param {string} [oData.trueValue] Specifies the displayed value if the boolean type has the value true\r\n * @param {string} [oData.unit] Specifies the UoM if type is number\r\n * @param {string} [oData.unitProperty] Name of the property that contains the UoM if type is number or currency\r\n * @param {Object} [oData.valueMap] Contains a JS object or Map with key value pairs\r\n *\r\n * @returns {Type} - Returns the specific Type object that contains all the formatting\r\n * @private\r\n */\r\n// eslint-disable-next-line complexity\r\nColumn.prototype._initType = function(oData) {\r\n\tvar oType, sType;\r\n\r\n\tsType = typeof oData.type === \"string\" ? oData.type.toLowerCase() : oData.type;\r\n\r\n\tswitch (sType) {\r\n\t\tcase \"datetime\":\r\n\r\n\t\t\t/* Add translated timezone to column header of type datetime if fixed timezone is used */\r\n\t\t\tif (oData.timezone && typeof oData.timezone === \"string\" && !oData.timezoneProperty) {\r\n\t\t\t\tthis.label += ` (${Customizing.getTimezoneTranslation(oData.timezone)})`;\r\n\t\t\t}\r\n\t\t\toType = new CalendarDateTime(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"date\":\r\n\t\t\toType = new CalendarDate(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"time\":\r\n\t\t\toType = new CalendarTime(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"timezone\":\r\n\t\t\toType = new Timezone(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"percentage\":\r\n\t\tcase \"number\":\r\n\t\t\toType = new Numeric(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"currency\":\r\n\t\t\toType = new Currency(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\t\toType = new BooleanType(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"enumeration\":\r\n\t\t\toType = new Enumeration(oData);\r\n\t\t\tbreak;\r\n\t\tcase \"bignumber\":\r\n\t\t\toType = new BigNumber(oData);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\toData.type = \"text\";\r\n\r\n\t\t\toType = new Text(oData);\r\n\t}\r\n\r\n\toType.registerAt(this.styles);\r\n\r\n\treturn oType;\r\n};\r\n\r\n/**\r\n * Returns the Cell object that is referenced by this particular\r\n * Column. Every Column references only one single Cell that gets\r\n * reused for each and every Row.\r\n *\r\n * When binding the actual data to a row, the Cell content, its\r\n * references and its styling get updated and a serialized version\r\n * of the row is stored within the sheet.\r\n *\r\n * @returns {Cell} - The Cell that belongs to this particular Column\r\n */\r\nColumn.prototype.getCell = function() {\r\n\treturn this.cell;\r\n};\r\n\r\n/**\r\n * This method binds the actual business object property to the columns cell.\r\n *\r\n * @param {object} oData - Business object that gets bound to the Cell of this Column.\r\n */\r\nColumn.prototype.bind = function(oData) {\r\n\r\n\t/*\r\n\t * Due to the fact that Cell#setValue updates the Style depending\r\n\t * on the actual Cell value (i.E. Unit of Measurement for\r\n\t * Currencies), we need to provide the original business object\r\n\t * so that the Cell knows the whole business object instead of\r\n\t * just the value of its particular property.\r\n\t */\r\n\ttry {\r\n\t\tthis.cell.setValue(this.property, oData);\r\n\t} catch (oError) {\r\n\r\n\t\t// Enhance error message with column and line item information\r\n\t\toError.message = (oError.message ? oError.message + \"\\n\\n\" : \"\") + \"Column: \" + this.label;\r\n\t\toError.message += \"\\nData: \" + JSON.stringify(oData);\r\n\r\n\t\tthrow oError;\r\n\t}\r\n};\r\n\r\nmodule.exports = Column;","var Column\t= require(\"./Column\"),\r\n\tText\t= require(\"./type/Text\"),\r\n\tRow\t\t= require(\"../data/Row\"),\r\n\tCell\t= require(\"../data/Cell\");\r\n\r\n/**\r\n * ColumnConfiguration represents the configuration of all columns within\r\n * one Sheet. The ColumnConfiguration handles the mapping of object\r\n * properties to certain columns,, labeling, type definition and also\r\n * display information like width and alignment.\r\n *\r\n * @param {Object} oConfig - An configuration object that contains all necessary column definitions\r\n * @param {Object} oConfig.columns - An array of Column definitions. {@see Column} for further details\r\n * @param {string} [oConfig.hierarchyLevel] - Name of the property that holds the hierarchy level\r\n * @param {boolean} [oConfig.hideHeader] - Flag that allows to hide the header row\r\n * @param {SharedStrings} oSharedStrings - SharedStrings instance that will be used by all Cells\r\n * @param {Styles} oStyles - Style collection that is used to register Cell or row specific styles\r\n * @module binding/ColumnBinding\r\n * @constructor\r\n */\r\nfunction ColumnConfiguration(oConfig, oSharedStrings, oStyles) {\r\n\tvar aColumns, oColumn, i;\r\n\r\n\tthis.columns = [];\r\n\tthis._row = null;\r\n\tthis.styles = oStyles;\r\n\tthis.sharedStrings = oSharedStrings;\r\n\tthis.hideHeader = oConfig.hideHeader;\r\n\r\n\tObject.defineProperty(this, \"hierarchyLevelProperty\", { value: oConfig.hierarchyLevel });\r\n\r\n\taColumns = oConfig.columns;\r\n\r\n\tfor (i = 0; i < aColumns.length; i++) {\r\n\r\n\t\t/* As specified, the hierarchy level indentation will only be applied on the first row */\r\n\t\tif (i == 0) {\r\n\t\t\tif (typeof aColumns[i] === \"string\") {\r\n\t\t\t\taColumns[i] = { property: aColumns[i] };\r\n\t\t\t}\r\n\r\n\t\t\taColumns[i].hierarchyLevel = this.hierarchyLevelProperty;\r\n\t\t}\r\n\r\n\t\toColumn = aColumns[i] instanceof Column ?\r\n\t\t\taColumns[i] : new Column(aColumns[i], this.sharedStrings, this.styles);\r\n\r\n\t\tthis.columns.push(oColumn);\r\n\t}\r\n}\r\n\r\n/**\r\n * Initializes the objects that are necessary for the binding. This\r\n * components are:\r\n * - a template Row\r\n * - a Cell for each Column\r\n * - a Style for each data type referenced by each Column\r\n *\r\n * @private\r\n */\r\nColumnConfiguration.prototype._initBinding = function() {\r\n\tvar i;\r\n\r\n\tthis._row = new Row();\r\n\r\n\tfor (i = 0; i < this.columns.length; i++) {\r\n\t\tthis._row.addCell(this.columns[i].getCell());\r\n\t}\r\n};\r\n\r\n/**\r\n * Creates an new Row and binds the provided data to the Row Cells according to the current ColumnConfiguration.\r\n *\r\n * @param {Object} oData - The data object that has to be bound to the row\r\n * @param {number} nHierarchyLevel - Hierarchy level that will be used for indent and outline\r\n * @returns {Row} - Returns the created Row that contains the provided data\r\n */\r\nColumnConfiguration.prototype.bind = function(oData, nHierarchyLevel) {\r\n\tvar i, normalizedHierarchyLevel;\r\n\r\n\tif (this._row === null) {\r\n\t\tthis._initBinding();\r\n\t}\r\n\r\n\t/* Normalise hierarchy depth to not exceed the maximum depth of 7 */\r\n\tnormalizedHierarchyLevel = Math.min(nHierarchyLevel, 7);\r\n\r\n\t/*\r\n\t * We need to add, update or delete the outline attribute because\r\n\t * we reuse the row object\r\n\t */\r\n\tif (normalizedHierarchyLevel && !this._row.outline) {\r\n\t\tthis._row.addAttribute({\r\n\t\t\tid: \"outline\",\r\n\t\t\tname: \"outlineLevel\",\r\n\t\t\tvalue: normalizedHierarchyLevel\r\n\t\t});\r\n\t} else if (normalizedHierarchyLevel && this._row.outline) {\r\n\t\tthis._row.outline.value = normalizedHierarchyLevel;\r\n\t} else if (!normalizedHierarchyLevel && this._row.outline) {\r\n\t\tthis._row.remove(\"outline\");\r\n\t}\r\n\r\n\tfor (i = 0; i < this.columns.length; i++) {\r\n\t\tthis.columns[i].bind(oData);\r\n\t}\r\n\r\n\treturn this._row;\r\n};\r\n\r\n/**\r\n * Creates the header Row according to the current ColumnConfiguration and returns it.\r\n *\r\n * @returns {Row} - Header row according to the ColumnConfiguration\r\n */\r\nColumnConfiguration.prototype.getHeader = function() {\r\n\tvar cell, row, type;\r\n\r\n\tif (this.hideHeader) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\trow = new Row();\r\n\ttype = new Text({\r\n\t\tfont: {\r\n\t\t\tname: \"Arial\",\r\n\t\t\tsize: 11,\r\n\t\t\tbold: true\r\n\t\t},\r\n\t\tfill: {\r\n\t\t\tcolor: \"F7F7F7\"\r\n\t\t}\r\n\t});\r\n\r\n\t/* Register header style */\r\n\ttype.registerAt(this.styles);\r\n\r\n\trow.setStyle(type.getStyleId({}));\r\n\trow.addAttribute({\r\n\t\tname: \"customFormat\",\r\n\t\tvalue: \"1\"\r\n\t});\r\n\r\n\tthis.columns.forEach(function(column) {\r\n\r\n\t\t/* Create new Cell and assign value */\r\n\t\tcell = new Cell(type, this.sharedStrings);\r\n\t\tcell.setValue(\"label\", column);\r\n\r\n\t\trow.addCell(cell);\r\n\t}.bind(this));\r\n\r\n\treturn row;\r\n};\r\n\r\n/**\r\n *\r\n * @param sGroupName\r\n * @return {Row}\r\n */\r\nColumnConfiguration.prototype.getGroupHeader = function(sGroupName) {\r\n\tvar cell, row, type, data;\r\n\r\n\trow = new Row();\r\n\ttype = new Text({\r\n\t\tfont: {\r\n\t\t\tname: \"Arial\",\r\n\t\t\tsize: 11,\r\n\t\t\tbold: true\r\n\t\t},\r\n\t\tfill: {\r\n\t\t\tcolor: \"F2F2F2\"\r\n\t\t}\r\n\t});\r\n\tdata = {\r\n\t\tname: sGroupName\r\n\t};\r\n\r\n\t/* Register header style */\r\n\ttype.registerAt(this.styles);\r\n\r\n\trow.setStyle(type.getStyleId(data));\r\n\trow.addAttribute({\r\n\t\tname: \"customFormat\",\r\n\t\tvalue: \"1\"\r\n\t});\r\n\r\n\trow.spans.value = \"1:\" + this.size();\r\n\r\n\t/* Create new Cell and assign value */\r\n\tcell = new Cell(type, this.sharedStrings);\r\n\tcell.setValue(\"name\", data);\r\n\r\n\trow.addCell(cell);\r\n\r\n\treturn row;\r\n};\r\n\r\n/**\r\n * Returns the size of the ColumnConfiguration - respectively the\r\n * count of the configured columns.\r\n *\r\n * @returns {number} Count of configured columns\r\n */\r\nColumnConfiguration.prototype.size = function() {\r\n\treturn this.columns.length;\r\n};\r\n\r\nmodule.exports = ColumnConfiguration;","/**\r\n * The CurrencySettings static object represents settings for the currency data type.\r\n * It provides digits for a specific currency and the default scale.\r\n */\r\nvar Customizing = {};\r\n\r\n/**\r\n * Update the default settings with customization.\r\n *\r\n * @param {object} oConfig Configuration object that is used to specify the customization\r\n * @param {object} [oConfig.currency] Custom settings object that will be used for defining currency digits\r\n * @param {object} [oConfig.unit] Map of units with their corresponding scale\r\n * @param {object} [oConfig.timezone] Map of IANA timezone IDs with their corresponding translated text\r\n *\r\n * @public\r\n * @static\r\n */\r\nCustomizing.update = function(oConfig) {\r\n\tvar sKey, iScale;\r\n\r\n\t/* Update currency scale with custom currencies */\r\n\tif (oConfig.currency) {\r\n\r\n\t\t/*\r\n\t\t * If custom currencies contain a DEFAULT value\r\n\t\t * we clear the CLDR settings to avoid a fallback\r\n\t\t * to scale settings from CLDR.\r\n\t\t */\r\n\t\tif (oConfig.currency.DEFAULT && typeof oConfig.currency.DEFAULT.scale === \"number\") {\r\n\t\t\tCustomizing.CURRENCY = {};\r\n\t\t}\r\n\r\n\t\tfor (sKey in oConfig.currency) {\r\n\t\t\tCustomizing.CURRENCY[sKey] = iScale = oConfig.currency[sKey].scale;\r\n\r\n\t\t\t/* Determine MAX_CURRENCY_SCALE */\r\n\t\t\tif (iScale > Customizing.MAX_CURRENCY_SCALE) {\r\n\t\t\t\tCustomizing.MAX_CURRENCY_SCALE = iScale;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (oConfig.unit) {\r\n\t\tfor (sKey in oConfig.unit) {\r\n\t\t\tCustomizing.UNIT[sKey] = oConfig.unit[sKey].scale;\r\n\t\t}\r\n\t}\r\n\r\n\tif (oConfig.timezone) {\r\n\t\tObject.assign(Customizing.TIMEZONE, oConfig.timezone);\r\n\t}\r\n};\r\n\r\nCustomizing.getScaleForCurrency = function(sCurrencyCode) {\r\n\tvar iScale;\r\n\r\n\tiScale = Customizing.CURRENCY[sCurrencyCode];\r\n\r\n\t/* If the currency uses the default scale */\r\n\tif (typeof iScale !== \"number\") {\r\n\t\tiScale = Customizing.CURRENCY.DEFAULT;\r\n\t}\r\n\r\n\treturn iScale;\r\n};\r\n\r\nCustomizing.getScaleForUnit = function(sUnit) {\r\n\treturn Customizing.UNIT[sUnit];\r\n};\r\n\r\n/**\r\n * Returns the translated timezone text for a given IANA timezone ID.\r\n * If no translation is available, the ID is returned.\r\n *\r\n * @param {string} sTimezone IANA timezone ID\r\n * @returns {string} Translated timezone text or IANA ID if no translation is available\r\n */\r\nCustomizing.getTimezoneTranslation = function(sTimezone) {\r\n\treturn Customizing.TIMEZONE[sTimezone] || sTimezone;\r\n};\r\n\r\n/**\r\n * Defines the display default scale that is used for alignment. This has no effect on the technical scale of currency\r\n * values. It is only used for alignment purposes so that different currencies with different scale are still aligned\r\n * correctly.\r\n *\r\n * @type {number}\r\n */\r\nCustomizing.MAX_CURRENCY_SCALE = 3;\r\n\r\n/**\r\n * Contains all known units with their corresponding scale\r\n *\r\n * @type {object}\r\n */\r\nCustomizing.UNIT = {};\r\n\r\n/**\r\n * @type {object}\r\n */\r\nCustomizing.TIMEZONE = {};\r\n\r\n/** Currency customizing with default values copied from CLDR\r\n *\r\n * @type {object}\r\n */\r\nCustomizing.CURRENCY = {\r\n\t\"ADP\": 0,\r\n\t\"AFN\": 0,\r\n\t\"ALL\": 0,\r\n\t\"BHD\": 3,\r\n\t\"BIF\": 0,\r\n\t\"BYR\": 0,\r\n\t\"CLF\": 4,\r\n\t\"CLP\": 0,\r\n\t\"DEFAULT\": 2,\r\n\t\"DJF\": 0,\r\n\t\"ESP\": 0,\r\n\t\"GNF\": 0,\r\n\t\"HUF\": 0,\r\n\t\"IQD\": 0,\r\n\t\"IRR\": 0,\r\n\t\"ISK\": 0,\r\n\t\"ITL\": 0,\r\n\t\"JOD\": 3,\r\n\t\"JPY\": 0,\r\n\t\"KMF\": 0,\r\n\t\"KPW\": 0,\r\n\t\"KRW\": 0,\r\n\t\"KWD\": 3,\r\n\t\"LAK\": 0,\r\n\t\"LBP\": 0,\r\n\t\"LUF\": 0,\r\n\t\"LYD\": 3,\r\n\t\"MGA\": 0,\r\n\t\"MGF\": 0,\r\n\t\"MMK\": 0,\r\n\t\"MRO\": 0,\r\n\t\"OMR\": 3,\r\n\t\"PYG\": 0,\r\n\t\"RSD\": 0,\r\n\t\"RWF\": 0,\r\n\t\"SLL\": 0,\r\n\t\"SOS\": 0,\r\n\t\"STD\": 0,\r\n\t\"SYP\": 0,\r\n\t\"TMM\": 0,\r\n\t\"TND\": 3,\r\n\t\"TRL\": 0,\r\n\t\"TWD\": 0,\r\n\t\"UGX\": 0,\r\n\t\"UYI\": 0,\r\n\t\"UYW\": 4,\r\n\t\"VND\": 0,\r\n\t\"VUV\": 0,\r\n\t\"XAF\": 0,\r\n\t\"XOF\": 0,\r\n\t\"XPF\": 0,\r\n\t\"YER\": 0,\r\n\t\"ZMK\": 0,\r\n\t\"ZWD\": 0\r\n};\r\n\r\nmodule.exports = Customizing;","var Type = require(\"./Type\"),\r\n\tScaleSettings = require(\"../Customizing\"),\r\n\tAlignment = require(\"../../style/Alignment\");\r\n\r\n/**\r\n * The BigNumber class represents string formatted number with\r\n * specific formatting. It provides font and sizing details that\r\n * can be used by the Styles class.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this BigNumber type\r\n * @constructor\r\n */\r\nfunction BigNumber(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.type = oConfig ? oConfig.type : null;\r\n\tthis.displayUnit = oConfig && typeof oConfig.displayUnit === \"boolean\" ? oConfig.displayUnit : true;\r\n\tthis.unit = oConfig ? oConfig.unit : null;\r\n\tthis.unitProperty = oConfig ? oConfig.unitProperty : null;\r\n\tthis.delimiter = oConfig ? oConfig.delimiter : false;\r\n\tthis.scale = oConfig ? oConfig.scale : null;\r\n\r\n\t/**\r\n\t * Due to default text alignment LTR, we need to invert the\r\n\t * alignment so that it reflects the default number alignment\r\n\t */\r\n\tthis.alignment = this.alignment === null ? Alignment.horizontal.RIGHT : Alignment.horizontal.LEFT;\r\n}\r\n\r\nBigNumber.prototype = Object.create(Type.prototype);\r\nBigNumber.prototype.constructor = BigNumber;\r\n\r\n/**\r\n * Returns the unit specific scale.\r\n *\r\n * @param {string} sUnit ISO unit of measure or currency code string\r\n * @returns {number|null} A number that represents the unit specific scale\r\n * @public\r\n */\r\nBigNumber.prototype.getScale = function(sUnit) {\r\n\tvar fnResolveScale, iScale;\r\n\r\n\tfnResolveScale = this.type === \"currency\" ? ScaleSettings.getScaleForCurrency : ScaleSettings.getScaleForUnit;\r\n\tiScale = fnResolveScale(sUnit);\r\n\r\n\tif (isNaN(iScale)) {\r\n\t\tiScale = this.scale;\r\n\t}\r\n\r\n\treturn iScale;\r\n};\r\n\r\n/**\r\n * Returns the data value of the business object that is bound by\r\n * this type. If a template is configured, it will automatically fill\r\n * the template with the values from the business object and returns\r\n * the processed string.\r\n *\r\n * @param {string} property Name of the property that shall be accessed.\r\n * @param {Object} oData Business object that contains the data.\r\n *\r\n * @returns {string|number|boolean|null} The value of the given property after type specific processing.\r\n * Returns null if no value is present or the value cannot be processed by this type.\r\n */\r\nBigNumber.prototype.getValue = function(property, oData) {\r\n\tvar iScale, sResult, sUnit, sValue;\r\n\r\n\tsValue = oData[property];\r\n\r\n\t/* Convert number to string for BigNumber conversion */\r\n\tif (typeof sValue == \"number\") {\r\n\t\tsValue = sValue.toString();\r\n\t}\r\n\r\n\t/* The value must be passed as a string containing only numerical characters with an optional decimal separator */\r\n\tif (typeof sValue != \"string\" || !sValue.match(/^(-){0,1}[0-9]+(\\.[0-9]+)*$/g)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tsUnit = oData[this.unitProperty] || this.unit;\r\n\tiScale = this.getScale(sUnit);\r\n\r\n\r\n\tsResult = this._parseValue(sValue, iScale, this.delimiter);\r\n\r\n\tif (this.displayUnit) {\r\n\t\tsResult += (sUnit ? \" \" + sUnit : \"\");\r\n\t}\r\n\r\n\treturn sResult;\r\n};\r\n\r\n/**\r\n * Parses a string representation of a numeric value according to the given requirements.\r\n *\r\n * @param {string} sValue String representation of a numeric value\r\n * @param {number|null} [iScale] Defines the scale of the numeric value ( >= 0)\r\n * @param {boolean} [bDelimiter] Defines if thousand delimiters should be visible in the output\r\n * @returns {string} Parsed representation\r\n * @private\r\n */\r\nBigNumber.prototype._parseValue = function(sValue, iScale, bDelimiter) {\r\n\tvar aSplitted, aInteger, i, sDecimal, sInteger, sSign;\r\n\r\n\taSplitted = sValue.split(\".\");\r\n\tsInteger = aSplitted[0];\r\n\tsDecimal = aSplitted.length > 1 ? aSplitted[1] : \"\";\r\n\r\n\t/* Add thousand delimiter to the integer value */\r\n\tif (bDelimiter) {\r\n\r\n\t\t/* Remove sign before inserting the delimiter */\r\n\t\taInteger = sInteger.split(\"\");\r\n\t\tsSign = aInteger[0] === \"-\" ? aInteger.shift() : \"\";\r\n\r\n\t\tsInteger = sSign + aInteger.reduceRight(function(accumulator, currentValue) {\r\n\t\t\treturn currentValue + (accumulator.length % 4 == 3 ? \",\" + accumulator : accumulator);\r\n\t\t}, \"\");\r\n\t}\r\n\r\n\tif (typeof iScale === \"number\") {\r\n\t\tif (iScale < sDecimal.length) {\r\n\t\t\tsDecimal = sDecimal.substring(0, iScale);\r\n\t\t} else {\r\n\t\t\tfor (i = sDecimal.length; i < iScale; i++) {\r\n\t\t\t\tsDecimal += \"0\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn sInteger + (sDecimal ? \".\" + sDecimal : \"\");\r\n};\r\n\r\nmodule.exports = BigNumber;","var Type = require(\"./Type\");\r\n\r\n/**\r\n * The BooleanType class represents a boolean data type. BooleanType\r\n * data can work in two different ways. The first way is the Office\r\n * Open XML Spreadsheet built-in type that always shows TRUE/FALSE in\r\n * the users locale. This value can easily be used within formulas.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this numeric representation\r\n * @param {string} [oConfig.trueValue] Contains the value that gets displayed if the Boolean is true\r\n * @param {string} [oConfig.falseValue] Contains the value that gets displayed if the Boolean is false\r\n * @constructor\r\n */\r\nfunction BooleanType(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.trueValue = oConfig ? oConfig.trueValue : null;\r\n\tthis.falseValue = oConfig ? oConfig.falseValue : null;\r\n}\r\n\r\nBooleanType.prototype = Object.create(Type.prototype);\r\nBooleanType.prototype.constructor = BooleanType;\r\n\r\nBooleanType.DEFAULT = {\r\n\tnumberFormat: 0\r\n};\r\n\r\n/**\r\n * This method indicates if the properties trueValue and falseValue\r\n * are configured correctly and the BooleanType supports a custom\r\n * format.\r\n *\r\n * @returns {boolean} Whether to use a custom formatted BooleanType or the built-in type.\r\n */\r\nBooleanType.prototype.isCustomFormatted = function() {\r\n\treturn !!this.trueValue\r\n\t\t&& typeof this.trueValue === \"string\"\r\n\t\t&& !!this.falseValue\r\n\t\t&& typeof this.falseValue === \"string\";\r\n};\r\n\r\n/**\r\n * Creates the format according to the provided configuration. If the\r\n * format matches any builtin format, it will return a reference to\r\n * its ID instead of the format.\r\n *\r\n * Both cases can serve the Style class that consumes this information.\r\n *\r\n * @returns {Object} Configuration object for NumberFormat initialization\r\n * @protected\r\n */\r\nBooleanType.prototype._createConfiguration = function() {\r\n\tvar config;\r\n\r\n\tconfig = Object.getPrototypeOf(BooleanType.prototype)._createConfiguration.call(this);\r\n\tconfig.numberFormat = this.isCustomFormatted() ?\r\n\t\t{ format: `\"${this.trueValue}\";;\"${this.falseValue}\"` } : BooleanType.DEFAULT.numberFormat;\r\n\r\n\treturn config;\r\n};\r\n\r\nmodule.exports = BooleanType;","var Type = require(\"./Type\");\r\n\r\n/**\r\n * The <code>CalendarBase</code> class represents a date/datetime/time data type.\r\n * It handles the formatting and offers several options such as calendar, custom\r\n * format string, and a subtype.\r\n *\r\n * @param {Object} [oConfig] A configuration object that is used to specify the formatting\r\n * @param {string} [oConfig.format] A custom format string that will be used as template\r\n * @param {string} [oConfig.calendar] Specifies the calendar that will be used (default: gregorian)\r\n * @param {string} [oConfig.inputFormat] Specifies the format of the string-formatted date value (uppercase YYYYMMDD)\r\n * @constructor\r\n */\r\nfunction CalendarBase(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.format = oConfig ? oConfig.format : null;\r\n\tthis.calendar = oConfig && typeof oConfig.calendar === \"string\" ? oConfig.calendar.toLowerCase() : null;\r\n\tthis.inputFormat = oConfig && typeof oConfig.inputFormat == \"string\" ? oConfig.inputFormat.toUpperCase() : null;\r\n}\r\n\r\nCalendarBase.prototype = Object.create(Type.prototype);\r\nCalendarBase.prototype.constructor = CalendarBase;\r\n\r\nCalendarBase.LOCAL_TIMEZONE = new Intl.DateTimeFormat().resolvedOptions().timeZone;\r\n\r\nCalendarBase.DEFAULT = {\r\n\tnumberFormat: 14\r\n};\r\n\r\nCalendarBase.BUILTIN = {\r\n\t14: \"mm-dd-yy\",\r\n\t15: \"d-mmm-yy\",\r\n\t16: \"d-mmm\",\r\n\t17: \"mmm-yy\",\r\n\t18: \"h:mm AM/PM\",\r\n\t19: \"h:mm:ss AM/PM\",\r\n\t20: \"h:mm\",\r\n\t21: \"h:mm:ss\",\r\n\t22: \"m/d/yy h:mm\",\r\n\t45: \"mm:ss\",\r\n\t46: \"[h]:mm:ss\",\r\n\t47: \"mmss.0\"\r\n};\r\n\r\nCalendarBase.oSymbols = {\r\n\t\"Y\": {\r\n\t\tapply: function(sValue, oDate) {\r\n\t\t\toDate.setUTCFullYear(sValue);\r\n\t\t}\r\n\t},\r\n\t\"M\": {\r\n\t\tapply: function(sValue, oDate) {\r\n\t\t\toDate.setUTCMonth(sValue - 1);\r\n\t\t}\r\n\t},\r\n\t\"D\": {\r\n\t\tapply: function(sValue, oDate) {\r\n\t\t\toDate.setUTCDate(sValue);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Creates the <code>Style</code> configuration object according to\r\n * the configuration of this<code>CalendarBase</code> instance.\r\n *\r\n * @param {Object} oData Business object that gets bound to the styling template\r\n * @return {Object} Style descriptor object\r\n * @protected\r\n */\r\nCalendarBase.prototype._createConfiguration = function(oData) {\r\n\tvar oConfig, sKey, sTemplate;\r\n\r\n\toConfig = Object.getPrototypeOf(CalendarBase.prototype)._createConfiguration.call(this, oData);\r\n\r\n\tsTemplate = this.getDefaultFormat(oData);\r\n\r\n\t/* Evaluate calendar */\r\n\tswitch (this.calendar) {\r\n\t\tcase \"islamic\":\r\n\t\t\tsTemplate = \"b2\" + sTemplate;\r\n\t\t\tbreak;\r\n\t\tcase \"japanese\":\r\n\t\t\tsTemplate = \"[$-ja-JP]\" + sTemplate;\r\n\t\t\tbreak;\r\n\t\tdefault: // Gregorian calendar is the default case\r\n\t}\r\n\r\n\toConfig.numberFormat = {\r\n\t\tformat: sTemplate\r\n\t};\r\n\r\n\t/* Find possible builtin match */\r\n\tfor (sKey in CalendarBase.BUILTIN) {\r\n\t\tif (CalendarBase.BUILTIN[sKey] === sTemplate) {\r\n\t\t\toConfig.numberFormat = parseInt(sKey, 10);\r\n\t\t}\r\n\t}\r\n\r\n\treturn oConfig;\r\n};\r\n\r\n/**\r\n * Returns the default NumberFormat for the specific type\r\n * and takes a predefined custom format into account.\r\n *\r\n * @returns {string|null} NumberFormat template of the type or null\r\n * @private\r\n */\r\nCalendarBase.prototype.getDefaultFormat = function() {\r\n\tvar sTemplate;\r\n\r\n\tif (typeof this.format === \"string\" && this.format.match(/^[gdhmsy\\s-,.:/]+(AM\\/PM)?$/)) {\r\n\t\tsTemplate = this.format;\r\n\t} else if (this.calendar === \"islamic\") {\r\n\t\tsTemplate = \"d mmmm yyyy\";\r\n\t} else if (this.calendar === \"japanese\") {\r\n\t\tsTemplate = \"ge.m.d\";\r\n\t}\r\n\r\n\treturn sTemplate;\r\n};\r\n\r\n/**\r\n * Returns the value of the given property that is assigned in the line item.\r\n *\r\n * @param {string} sProperty Name of the property that contains the value\r\n * @param {Object} oData Line item that contains data\r\n * @return {number|null} XLSX-specific date/time format in days since 30.12.1899\r\n */\r\nCalendarBase.prototype.getValue = function(sProperty, oData) {\r\n\tvar iTimestamp, vValue;\r\n\r\n\tvValue = oData[sProperty];\r\n\r\n\tif (vValue === null || typeof vValue === \"undefined\" || vValue === \"\") {\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/* Date, SAPUI5 OData Time representation or String/Number wrapper */\r\n\tif (typeof vValue === \"object\") {\r\n\t\tvValue = typeof vValue.ms === 'number' ? vValue.ms : vValue.valueOf();\r\n\t}\r\n\r\n\t/* 1. Unix timestamp as number */\r\n\tif (typeof vValue === \"number\" && !isNaN(vValue)) {\r\n\t\tiTimestamp = vValue;\r\n\t}\r\n\r\n\t/* 2. String based date/time representation */\r\n\tif (typeof vValue === \"string\") {\r\n\t\tiTimestamp = this._parseStringValue(vValue);\r\n\t}\r\n\r\n\treturn typeof iTimestamp === \"number\"\r\n\t\t? this.dateToExcel(iTimestamp, oData) : null;\r\n};\r\n\r\n/**\r\n * Converts a textual date/time representation to a numeric timestamp.\r\n *\r\n * @param {string} sValue String representation of the date/time\r\n * @return {number|null} Numeric timestamp\r\n * @private\r\n */\r\nCalendarBase.prototype._parseStringValue = function(sValue) {\r\n\r\n\t/* 1. Pattern formatted date string */\r\n\tif (this.inputFormat && typeof this.inputFormat === \"string\") {\r\n\t\treturn CalendarBase._parseStringDate(sValue, this.inputFormat);\r\n\t}\r\n\r\n\t/* 2. OData date string \"/Date(1234567890)/\" */\r\n\tif (CalendarBase.odataDateRegex.test(sValue)) {\r\n\t\treturn CalendarBase._parseOdataDate(sValue);\r\n\t}\r\n\r\n\t/* 3. DateTimeOffset representation 1986-04-13T01:08:00.000+01:00 */\r\n\tif (CalendarBase.odataDateTimeOffsetRegex.test(sValue)) {\r\n\t\treturn Date.parse(sValue);\r\n\t}\r\n\r\n\t/* 4. Unix timestamp as string */\r\n\tif (isFinite(sValue)) {\r\n\t\treturn parseInt(sValue, 10);\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\n/** START Copied and adapted from datajs **/\r\n/**\r\n * Extracts the milliseconds if the value is a date/time instance or formatted string.\r\n *\r\n * @param {any} vValue the value (may be <code>undefined</code> or <code>null</code>)\r\n * @return {any} the number of milliseconds or the value itself\r\n */\r\nCalendarBase._parseODataDuration = function(vValue) {\r\n\tvar parts, days, hours, minutes, seconds, ms;\r\n\t// / <summary>Parses a string in xsd:duration format.</summary>\r\n\t// / <param name=\"duration\" type=\"String\">Duration value.</param>\r\n\t// / <remarks>\r\n\t// / This method will return the input, if the input string has a year or a month component.\r\n\t// / </remarks>\r\n\t// / <returns type=\"Object\">Object representing the time</returns>\r\n\r\n\tparts = CalendarBase.odataDurationRegex.exec(vValue);\r\n\r\n\t// Unsupported duration value for Edm.Time OData spec (if year of month is present)\r\n\t/* EDITED\r\n\tif (parts[2] || parts[3]) {\r\n\t\treturn vValue;\r\n\t}\r\n\t */\r\n\r\n\tdays = parseInt(parts[4] || 0, 10);\r\n\thours = parseInt(parts[5] || 0, 10);\r\n\tminutes = parseInt(parts[6] || 0, 10);\r\n\tseconds = parseFloat(parts[7] || 0);\r\n\r\n\tms = parts[8];\r\n\tif (ms) {\r\n\t\t// Parse ms duration value ignoring any precision/scale as that part is anyway ignored by JS Date conversion!\r\n\t\tms = parseFloat(\"0.\" + ms) * 1000;\r\n\t} else {\r\n\t\tms = 0;\r\n\t}\r\n\r\n\tms += (seconds * 1000) + (minutes * 60000) + (hours * 3600000) + (days * 86400000);\r\n\r\n\tif (parts[1] === \"-\") {\r\n\t\tms = -ms;\r\n\t}\r\n\r\n\treturn ms;\r\n};\r\n\r\nCalendarBase._parseTimeOfDay = function(vValue) {\r\n\tvar parts, hours, minutes, seconds;\r\n\tvar date = new Date(0);\r\n\r\n\tparts = CalendarBase.timeOfDayRegex.exec(vValue);\r\n\thours = parseInt(parts[1] || 0, 10);\r\n\tminutes = parseInt(parts[2] || 0, 10);\r\n\tseconds = parseFloat(parts[4] || 0);\r\n\tdate.setUTCHours(hours, minutes, seconds);\r\n\r\n\treturn date.getTime();\r\n};\r\n\r\n/**\r\n * Parses an OData date string and returns the corresponding timestamp\r\n *\r\n * @param {string} sValue OData date string i.E. \"/Date(1524141637807)/\"\r\n * @return {number} Unix timestamp according to OData date including offset\r\n * @private\r\n */\r\nCalendarBase._parseOdataDate = function(sValue) {\r\n\tvar matchArray, date, offset;\r\n\r\n\t/* The RegExp matches up to 4 groups:\r\n\t\t * 0: Full match\r\n\t\t * 1: Timestamp (mandatory)\r\n\t\t * 2: Timezone offset sign [ + | - ] (optional)\r\n\t\t * 3: Timezone offset minutes [0-9]{2,3} (optional)\r\n\t\t */\r\n\tmatchArray = CalendarBase.odataDateRegex.exec(sValue);\r\n\tdate = new Date(parseInt(matchArray[1], 10));\r\n\r\n\tif (matchArray[2] && matchArray[3]) {\r\n\t\toffset = parseInt(matchArray[2] + matchArray[3], 10);\r\n\t\tdate.setUTCMinutes(date.getUTCMinutes() - offset);\r\n\t}\r\n\r\n\treturn date.getTime();\r\n};\r\n\r\n/* The regular expression corresponds to something like this:\r\n * /Date(123+60)/\r\n *\r\n * This first number is date ticks, the + may be a - and is optional,\r\n * with the second number indicating a timezone offset in minutes.\r\n *\r\n * On the wire, the leading and trailing forward slashes are\r\n * escaped without being required to so the chance of collisions is reduced;\r\n * however, by the time we see the objects, the characters already\r\n * look like regular forward slashes.\r\n*/\r\nCalendarBase.odataDateRegex = /^\\/Date\\((-?\\d+)(\\+|-)?(\\d+)?\\)\\/$/;\r\n\r\n// The captured indices for this expression are:\r\n// 0 - complete input\r\n// 1 - direction\r\n// 2,3,4 - years, months, days\r\n// 5,6,7,8 - hours, minutes, seconds, milliseconds\r\nCalendarBase.odataDurationRegex =\r\n\t/^([+-])?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(?:\\.(\\d+))?S)?)?/;\r\n\r\n/** END Copied and adapted from datajs */\r\n\r\n/* eslint-disable-next-line */\r\nCalendarBase.odataDateTimeOffsetRegex = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\\d|3[0-1])T([0-1]\\d|2[0-3])(:[0-5]\\d)(:[0-5]\\d(\\.\\d{1,12})?)?(Z|[+\\-](0\\d|1[0-2]):[0-5]\\d)/;\r\n\r\nCalendarBase.dateStringRegex = /([Y]{4,}|[M]{2}|[D]{2})/g;\r\n\r\n/* Edm.TimeOfDay can be 00:00-23:59:59.999999999999 which allows to ommit seconds and fractual seconds */\r\nCalendarBase.timeOfDayRegex = /^([0-1]\\d|2[0-3]):([0-5]\\d)(:([0-5]\\d)(.\\d{1,12})?)?$/;\r\n\r\n/**\r\n * Converts a JavaScript Date timestamp to an Office Open XML date\r\n * representation. Office Open XML date epoch starts at 00.01.1900\r\n * which is 31.12.1899 and is represented as a number of days since\r\n * beginning of the epoch.\r\n *\r\n * The Javascript Date epoch starts at 01.01.1970 and is represented\r\n * as a number of milliseconds before or after the beginning of the\r\n * epoch.\r\n *\r\n * The amount of days between 01.01.1900 and 01.01.1970 is exactly\r\n * 25567. According to the wrong offset in Excel (00.01.1900 instead\r\n * of 01.01.1900) and the known leap year bug in Excel, we need to\r\n * add two additional days.\r\n *\r\n * https://support.microsoft.com/en-us/help/214326/excel-incorrectly-assumes-that-the-year-1900-is-a-leap-year\r\n *\r\n * Time specific information is represented as fraction. This means\r\n * that the value 30.5 represents 30.5 days after the 31.12.1899\r\n * where.5 stands for half a day. A day is defined as 24 hours, so\r\n * half a day means 12 hours since the beginning of the day at\r\n * 00:00:00. If the integer part of the value is greater than 0 date\r\n * specific information will be present in the cell.\r\n *\r\n * This also applies for time formatted cells. Although the cell only\r\n * displays the time specific part, the editing bar still shows the\r\n * date specific part. Therefore it is necessary to remove the date\r\n * specific part from the value in the XLSX file.\r\n *\r\n * The input format can contain milliseconds, which cannot be\r\n * displayed, since no literal is provided for this in the number\r\n * formatting of the Office Open XML Spreadsheet Format. This causes\r\n * milliseconds to be rounded to the nearest second, which can result\r\n * in a difference of one second. Therefore, milliseconds are\r\n * intentionally cut off during conversion.\r\n *\r\n * @param {number} nTimestamp JavaScript Date timestamp\r\n * @return {number} Amount of days since 31.12.1899\r\n * @private\r\n */\r\nCalendarBase.prototype.dateToExcel = function(nTimestamp) {\r\n\tvar iOffset, fExcelValue;\r\n\r\n\t/* Increase the offset if date is after February 28th 1900 */\r\n\tiOffset = nTimestamp >= -2203891200000 ? 2 : 1;\r\n\r\n\t/**\r\n\t * Fallback if date is before UTC 31.12.1899 00:00:00\r\n\t * which corresponds to 0 in Excel\r\n\t */\r\n\tfExcelValue = Math.max(((nTimestamp - (nTimestamp % 1000)) / (86400 * 1000)) + (25567 + iOffset), 0);\r\n\r\n\treturn fExcelValue;\r\n};\r\n\r\n/**\r\n * The method parses a given string value according to the provided\r\n * date pattern.\r\n *\r\n * Restrictions:\r\n * Currently only the symbols d, m, y are supported which correspond\r\n * to day, month, year.\r\n *\r\n * @param {string} sValue Date formatted string\r\n * @param {string} sPattern ISO 8601 pattern that gets applied\r\n * @return {number|null} UNIX timestamp that represents the parsed date string\r\n * @private\r\n */\r\nCalendarBase._parseStringDate = function(sValue, sPattern) {\r\n\tvar aMatch, oDate, sSubstring;\r\n\r\n\toDate = new Date(0);\r\n\r\n\tdo {\r\n\t\taMatch = CalendarBase.dateStringRegex.exec(sPattern);\r\n\r\n\t\tif (aMatch !== null) {\r\n\t\t\tsSubstring = sValue.slice(aMatch.index, aMatch.index + aMatch[0].length);\r\n\r\n\t\t\tCalendarBase.oSymbols[aMatch[0].charAt(0)].apply(parseInt(sSubstring, 10), oDate);\r\n\t\t}\r\n\t} while (aMatch !== null);\r\n\r\n\treturn oDate.getTime();\r\n};\r\n\r\nmodule.exports = CalendarBase;","var CalendarBase = require('./CalendarBase');\r\n\r\n/**\r\n * The CalendarDate class represents a date/datetime/time data type.\r\n * It handles the formatting and accepts several options like\r\n * calendar, a custom format string and a subtype.\r\n *\r\n * @param {Object} [oConfig] A configuration object that is used to specify the formatting\r\n * @param {string} [oConfig.utc] Specifies if the CalendarDate is exported in UTC\r\n * @constructor\r\n */\r\nfunction CalendarDate(oConfig) {\r\n\tCalendarBase.call(this, oConfig);\r\n\r\n\tthis.utc = true;\r\n}\r\n\r\nCalendarDate.prototype = Object.create(CalendarBase.prototype);\r\nCalendarDate.prototype.constructor = CalendarDate;\r\n\r\n\r\n/**\r\n * Returns the default NumberFormat for the specific type.\r\n *\r\n * @returns {string} NumberFormat template for type Date\r\n * @private\r\n */\r\nCalendarDate.prototype.getDefaultFormat = function() {\r\n\treturn Object.getPrototypeOf(CalendarDate.prototype).getDefaultFormat.call(this)\r\n\t\t|| CalendarBase.BUILTIN[14];\r\n};\r\n\r\nmodule.exports = CalendarDate;","var CalendarBase = require(\"./CalendarBase\");\r\nvar Customizing = require(\"../Customizing\");\r\n\r\n/**\r\n * The CalendarDateTime class represents a date/datetime/time data type.\r\n * It handles the formatting and accepts several options like\r\n * calendar, a custom format string and a subtype.\r\n *\r\n * @param {Object} [oConfig] A configuration object that is used to specify the formatting\r\n * @param {boolean} [oConfig.displayTimezone=true] Whether the IANA timezone is being displayed\r\n * @param {string} [oConfig.timezone] Specific timezone that will be applied\r\n * @param {string} [oConfig.timezoneProperty] Property name that references the timezone\r\n * @constructor\r\n */\r\nfunction CalendarDateTime(oConfig) {\r\n\tCalendarBase.call(this, oConfig);\r\n\r\n\tthis.timezone = oConfig ? oConfig.timezone : null;\r\n\tthis.timezoneProperty = oConfig ? oConfig.timezoneProperty : null;\r\n\tthis.displayTimezone = oConfig && typeof oConfig.displayTimezone === \"boolean\" ? oConfig.displayTimezone : true;\r\n\r\n\tthis.styleIds = {};\r\n}\r\n\r\nCalendarDateTime.prototype = Object.create(CalendarBase.prototype);\r\nCalendarDateTime.prototype.constructor = CalendarDateTime;\r\n\r\nCalendarDateTime._oCache = new Map();\r\n\r\n/**\r\n * Returns the default NumberFormat for the specific type.\r\n *\r\n * @param {Object} oData Business object that gets bound to the styling template\r\n * @returns {string} NumberFormat template for type DateTime\r\n * @private\r\n */\r\nCalendarDateTime.prototype.getDefaultFormat = function(oData) {\r\n\tvar sTemplate, sTimezone;\r\n\r\n\tsTemplate =\tObject.getPrototypeOf(CalendarDateTime.prototype).getDefaultFormat.call(this)\r\n\t\t|| CalendarBase.BUILTIN[22];\r\n\r\n\tif ((this.calendar === \"islamic\" && sTemplate === \"d mmmm yyyy\")\r\n\t\t|| (this.calendar === \"japanese\" && sTemplate === \"ge.m.d\")) {\r\n\t\tsTemplate += \" hh:mm\";\r\n\t}\r\n\r\n\t/* Apply timezone on the cell format only for line item specific timezone */\r\n\tif (this.timezoneProperty && this.displayTimezone) {\r\n\t\tsTimezone = Customizing.getTimezoneTranslation(this.getTimezone(oData));\r\n\t\tsTemplate = `_-${sTemplate}* \"${sTimezone}\"`;\r\n\t}\r\n\r\n\treturn sTemplate;\r\n};\r\n\r\n/**\r\n * Returns the IANA timezone string that is used either for the whole\r\n * column or depending on the row data. The specific timezone is obtained\r\n * in the following order (properties):\r\n *\r\n * 1. timezoneProperty \t(dynamic)\r\n * 2. timezone\t\t\t(static)\r\n * 3. utc\t\t\t\t(UTC)\r\n *\r\n * @param {Object} oData Business object that represents a row\r\n * @returns {string|null} Specific IANA timezone string or null if no timezone could be evaluated\r\n */\r\nCalendarDateTime.prototype.getTimezone = function(oData) {\r\n\tif (oData && oData[this.timezoneProperty] && typeof oData[this.timezoneProperty] === 'string') {\r\n\t\treturn oData[this.timezoneProperty];\r\n\t}\r\n\r\n\tif (this.timezone) {\r\n\t\treturn this.timezone;\r\n\t}\r\n\r\n\treturn 'UTC';\r\n};\r\n\r\n/**\r\n * Returns the assigned ID of the Type specific Style that is\r\n * registered in the Styles class.\r\n *\r\n * @param {Object} oData Business Object that contains the property for the UoM\r\n * @param {string|number} [vValue] Explicit cell value that might be used for semantic formatting\r\n * @returns {number} ID of the registered Style\r\n */\r\nCalendarDateTime.prototype.getStyleId = function(oData, vValue) {\r\n\tvar iStyleId, sTimezone;\r\n\r\n\t/* Handle simple numeric without unitProperty */\r\n\tif (!this.timezoneProperty) {\r\n\t\treturn Object.getPrototypeOf(CalendarDateTime.prototype).getStyleId.call(this, oData, vValue);\r\n\t}\r\n\r\n\tif (!oData) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tsTimezone = this.getTimezone(oData);\r\n\tiStyleId = this.styleIds[sTimezone];\r\n\r\n\tif (typeof iStyleId === \"undefined\") {\r\n\t\tthis.styleIds[sTimezone] = this.styles.addStyle(this._createConfiguration(oData));\r\n\t}\r\n\r\n\treturn this.styleIds[sTimezone];\r\n};\r\n\r\n/**\r\n * Converts a JavaScript Date timestamp to an Office Open XML date\r\n * representation. Office Open XML date epoch starts at 00.01.1900\r\n * which is 31.12.1899 and is represented as a number of days since\r\n * beginning of the epoch.\r\n *\r\n * The Javascript Date epoch starts at 01.01.1970 and is represented\r\n * as a number of milliseconds before or after the beginning of the\r\n * epoch.\r\n *\r\n * The amount of days between 01.01.1900 and 01.01.1970 is exactly\r\n * 25567. According to the wrong offset in Excel (00.01.1900 instead\r\n * of 01.01.1900) and the known leap year bug in Excel, we need to\r\n * add two additional days.\r\n *\r\n * https://support.microsoft.com/en-us/help/214326/excel-incorrectly-assumes-that-the-year-1900-is-a-leap-year\r\n *\r\n * Time specific information is represented as fraction. This means\r\n * that the value 30.5 represents 30.5 days after the 31.12.1899\r\n * where.5 stands for half a day. A day is defined as 24 hours, so\r\n * half a day means 12 hours since the beginning of the day at\r\n * 00:00:00. If the integer part of the value is greater than 0 date\r\n * specific information will be present in the cell.\r\n *\r\n * This also applies for time formatted cells. Although the cell only\r\n * displays the time specific part, the editing bar still shows the\r\n * date specific part. Therefore it is necessary to remove the date\r\n * specific part from the value in the XLSX file.\r\n *\r\n * The input format can contain milliseconds, which cannot be\r\n * displayed, since no literal is provided for this in the number\r\n * formatting of the Office Open XML Spreadsheet Format. This causes\r\n * milliseconds to be rounded to the nearest second, which can result\r\n * in a difference of one second. Therefore, milliseconds are\r\n * intentionally cut off during conversion.\r\n *\r\n * @param {number} nTimestamp JavaScript Date timestamp\r\n * @param {string} [oData] Defines if the timestamp remains untouched or if a timezone specific offset is considered\r\n * @return {number} Amount of days since 31.12.1899\r\n * @private\r\n */\r\nCalendarDateTime.prototype.dateToExcel = function(nTimestamp, oData) {\r\n\tvar iDateDifference, fExcelValue, iTimezoneOffset, oDate, oFormat, oParts, sTimezone;\r\n\r\n\tsTimezone = this.getTimezone(oData);\r\n\tfExcelValue = Object.getPrototypeOf(CalendarDateTime.prototype).dateToExcel.call(this, nTimestamp);\r\n\r\n\tif (sTimezone && sTimezone !== \"UTC\") {\r\n\t\toFormat = CalendarDateTime.getTimezoneFormat(sTimezone);\r\n\r\n\t\t/* Calculate offset */\r\n\t\toDate = new Date(nTimestamp);\r\n\t\toParts = oFormat.formatToParts(new Date(nTimestamp)).reduce(function(acc, item) {\r\n\t\t\tswitch (item.type) {\r\n\t\t\t\tcase \"day\":\r\n\t\t\t\tcase \"hour\":\r\n\t\t\t\tcase \"minute\":\r\n\t\t\t\t\tacc[item.type] = item.value;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault: /* Do nothing */\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t\tiDateDifference = oDate.getUTCDate() - parseInt(oParts.day, 10);\r\n\r\n\t\t/*\r\n\t\t * Once the date difference is more than 1 day,\r\n\t\t * the day refers to a different month. This\r\n\t\t * translates into the opposite offset.\r\n\t\t */\r\n\t\tif (iDateDifference > 1) {\r\n\t\t\tiDateDifference = -1;\r\n\t\t} else if (iDateDifference < -1) {\r\n\t\t\tiDateDifference = 1;\r\n\t\t}\r\n\r\n\t\tiTimezoneOffset = iDateDifference * 24 * 60;\r\n\t\tiTimezoneOffset += (oDate.getUTCHours() - parseInt(oParts.hour, 10)) * 60;\r\n\t\tiTimezoneOffset += (oDate.getUTCMinutes() - parseInt(oParts.minute, 10));\r\n\r\n\t\t/* Apply offset to Excel date time representation */\r\n\t\tfExcelValue -= (iTimezoneOffset / 1440); // 1440 minutes per day\r\n\t}\r\n\r\n\treturn fExcelValue;\r\n};\r\n\r\n/**\r\n * Returns a Intl.DateTimeFormat for the given timezone.\r\n *\r\n * @param {string} sTimezone Timezone that will be used by the format\r\n * @returns {Intl.DateTimeFormat} Timezone specific format\r\n */\r\nCalendarDateTime.getTimezoneFormat = function(sTimezone) {\r\n\tvar oCachedEntry, oInstance, oOptions;\r\n\r\n\toCachedEntry = CalendarDateTime._oCache.get(sTimezone);\r\n\r\n\tif (oCachedEntry) {\r\n\t\treturn oCachedEntry;\r\n\t}\r\n\r\n\toOptions = {\r\n\t\thourCycle: \"h23\",\r\n\t\thour: \"2-digit\",\r\n\t\tminute: \"2-digit\",\r\n\t\tday: \"2-digit\",\r\n\t\ttimeZone: sTimezone,\r\n\t\tera: \"narrow\"\r\n\t};\r\n\r\n\toInstance = new Intl.DateTimeFormat(\"en-US\", oOptions);\r\n\r\n\tCalendarDateTime._oCache.set(sTimezone, oInstance);\r\n\r\n\treturn oInstance;\r\n};\r\n\r\nmodule.exports = CalendarDateTime;","var CalendarBase = require(\"./CalendarBase\");\r\n\r\n/**\r\n * The CalendarDate class represents a date/datetime/time data type.\r\n * It handles the formatting and accepts several options like\r\n * calendar, a custom format string and a subtype.\r\n *\r\n * @param {Object} [oConfig] A configuration object that is used to specify the formatting\r\n * @constructor\r\n */\r\nfunction CalendarTime(oConfig) {\r\n\tCalendarBase.call(this, oConfig);\r\n\r\n\tthis.utc = true;\r\n}\r\n\r\nCalendarTime.prototype = Object.create(CalendarBase.prototype);\r\nCalendarTime.prototype.constructor = CalendarTime;\r\n\r\n/**\r\n * Returns the value of the given property that is assigned in the line item.\r\n *\r\n * @param {string} sProperty Name of the property that contains the value\r\n * @param {Object} oData Line item that contains data\r\n * @return {number|null} XLSX specific date/time format in days since 30.12.1899\r\n */\r\nCalendarTime.prototype.getValue = function(sProperty, oData) {\r\n\tvar iExcelTimestamp;\r\n\r\n\tiExcelTimestamp = Object.getPrototypeOf(CalendarTime.prototype).getValue.call(this, sProperty, oData);\r\n\r\n\t/* Remove date specific part to only represent time */\r\n\treturn typeof iExcelTimestamp === \"number\" ? iExcelTimestamp % 1 : null;\r\n};\r\n\r\n/**\r\n * Returns the default NumberFormat for the specific type.\r\n *\r\n * @returns {string} NumberFormat template for type DateTime\r\n * @private\r\n */\r\nCalendarTime.prototype.getDefaultFormat = function() {\r\n\treturn Object.getPrototypeOf(CalendarTime.prototype).getDefaultFormat.call(this)\r\n\t\t|| CalendarBase.BUILTIN[21];\r\n};\r\n\r\n/**\r\n * Converts a textual date/time representation to a numeric timestamp.\r\n *\r\n * @param {string} sValue String representation of the date/time\r\n * @return {number|null} Numeric timestamp\r\n * @private\r\n */\r\nCalendarTime.prototype._parseStringValue = function(sValue) {\r\n\tvar fParsedValue;\r\n\r\n\tfParsedValue = Object.getPrototypeOf(CalendarTime.prototype)._parseStringValue.call(this, sValue);\r\n\r\n\tif (typeof fParsedValue === \"number\") {\r\n\t\treturn fParsedValue;\r\n\t}\r\n\r\n\t/* 2. OData Edm.TimeOfDay */\r\n\tif (CalendarBase.timeOfDayRegex.test(sValue)) {\r\n\t\treturn CalendarBase._parseTimeOfDay(sValue);\r\n\t}\r\n\r\n\t/* 3. OData duration string \"PT01H23M45S\" */\r\n\tif (CalendarBase.odataDurationRegex.test(sValue)) {\r\n\t\treturn CalendarBase._parseODataDuration(sValue);\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\n\r\nmodule.exports = CalendarTime;","var Numeric = require(\"./Numeric\"),\r\n\tCustomizing = require(\"../Customizing\");\r\n\r\n/**\r\n * The Currency class represents a currency data type. It handles the\r\n * formatting and accepts several options like second property for\r\n * the unit of measurement or if the unit of measurement should be\r\n * displayed.\r\n *\r\n * It styles currencies with its particular amount of decimals.\r\n *\r\n * @param {Object} oConfig A configuration object that is used to specify the formatting\r\n * @constructor\r\n */\r\nfunction Currency(oConfig) {\r\n\tNumeric.call(this, oConfig);\r\n}\r\n\r\nCurrency.prototype = Object.create(Numeric.prototype);\r\nCurrency.prototype.constructor = Currency;\r\n\r\n/**\r\n * Returns the currency specific scale.\r\n *\r\n * @param {string} sCurrencyCode ISO currency code like USD for $ and EUR for € etc.\r\n * @returns {number} A number between 2 and 3 depending on the scale of the given currency\r\n * @public\r\n */\r\nCurrency.prototype.getScale = function(sCurrencyCode) {\r\n\treturn Customizing.getScaleForCurrency(sCurrencyCode);\r\n};\r\n\r\n/**\r\n * Returns the numberFormat id of the built-in format or a numberFormat object with the formatting template\r\n *\r\n * @param {string} sUnit Unit of measure that is used to resolve the unit specific scale\r\n * @returns {string} Template for the NumberFormat\r\n */\r\nCurrency.prototype.getNumberFormatTemplate = function(sUnit) {\r\n\tlet scale, template = '#,##0';\r\n\r\n\t/* Apply fixed scale, only if no unitProperty is provided */\r\n\tif (!sUnit && typeof this.scale === \"number\") {\r\n\t\tscale = this.scale;\r\n\t} else {\r\n\t\tscale = this.getScale(sUnit);\r\n\t}\r\n\r\n\t/* Apply separator or placeholder */\r\n\ttemplate += (scale > 0) ? \".\" : \"_.\";\r\n\r\n\tfor (let i = 0; i < scale; i++) {\r\n\t\ttemplate += \"0\";\r\n\t}\r\n\r\n\tfor (let j = Customizing.MAX_CURRENCY_SCALE - scale; j > 0; j--) {\r\n\t\ttemplate += \"_0\";\r\n\t}\r\n\r\n\t/* Add unit of measurement if required */\r\n\tif (this.displayUnit) {\r\n\t\tconst unitTemplate = sUnit ? `\"${sUnit}\"` : \"_E_U_R\";\r\n\r\n\t\t// Applies unit of measure or a placeholder if unit is empty\r\n\t\ttemplate += `\\\\ ${unitTemplate}`;\r\n\t}\r\n\r\n\treturn `* ${template};* \\\\-\\\\ ${template}`;\r\n};\r\n\r\n/**\r\n * Creates the Style configuration needed for registering the Type\r\n * specific styling in the Styles class.\r\n *\r\n * @param {Object} oData Business object that gets bound to the styling template\r\n * @returns {Object} Styling configuration object\r\n * @protected\r\n */\r\nCurrency.prototype._createConfiguration = function(oData) {\r\n\tconst unit = this.getUnit(oData);\r\n\tconst template = this.getNumberFormatTemplate(unit);\r\n\r\n\treturn { numberFormat: { format: template } };\r\n};\r\n\r\nmodule.exports = Currency;","var Type = require(\"./Type\");\r\n\r\n/**\r\n * The Enumeration class represents an enumeration data type.\r\n * The Enumeration allows to assign particular values for\r\n * corresponding keys.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this type\r\n * @param {Object} [oData.valueMap] Contains a JS object or Map with key value pairs\r\n * @constructor\r\n */\r\nfunction Enumeration(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis._valueMap = oConfig && oConfig.valueMap ? oConfig.valueMap : {};\r\n}\r\n\r\nEnumeration.prototype = Object.create(Type.prototype);\r\nEnumeration.prototype.constructor = Enumeration;\r\n\r\n/**\r\n * Returns the mapped value for the key that is present in the\r\n * business object.\r\n *\r\n * @param {string} sProperty Name of the property that contains the key\r\n * @param {Object} oData Business object that contains the data\r\n * @returns {string} The value of the given property after type specific processing\r\n * @protected\r\n */\r\nEnumeration.prototype.getValue = function(sProperty, oData) {\r\n\tvar key, result;\r\n\r\n\tkey = oData[sProperty];\r\n\tresult = this._valueMap instanceof Map ? this._valueMap.get(key) : this._valueMap[key];\r\n\r\n\treturn result || \"\";\r\n};\r\n\r\nmodule.exports = Enumeration;","var Type = require(\"./Type\"),\r\n\tCustomizing = require(\"../Customizing\");\r\n\r\n/**\r\n * The Numeric class represents a numeric data type. Numeric data can\r\n * handle several options like thousands delimiter, decimal (scale)\r\n * and different types like \"percent\" and \"exponential\".\r\n *\r\n * @param {Object} [oConfig] Configuration object for this numeric representation\r\n * @param {boolean} [oConfig.autoScale] Applies dynamic scale depending on the specific unit\r\n * @param {boolean} [oConfig.delimiter] Indicates if a thousands delimiter should be used\r\n * @param {boolean} [oConfig.displayUnit] Indicating whether the unit of measurement will be shown (default: true)\r\n * @param {number} [oConfig.scale] A fixed scale that will be applied to all cells within this column,\r\n * regardless of its particular unit of measurement\r\n * @param {string} [oConfig.type] Specific type that is handled by this Numeric class\r\n * @param {string} [oConfig.unit] Specifies a particular unit of measurement\r\n * @param {string} [oConfig.unitProperty] Specifies a property that contains the unit of measure\r\n * @constructor\r\n */\r\nfunction Numeric(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.autoScale = oConfig ? oConfig.autoScale : false;\r\n\tthis.delimiter = oConfig ? oConfig.delimiter : false;\r\n\tthis.displayUnit = oConfig && typeof oConfig.displayUnit === \"boolean\" ? oConfig.displayUnit : true;\r\n\tthis.unit = oConfig ? oConfig.unit : null;\r\n\tthis.unitProperty = oConfig ? oConfig.unitProperty : null;\r\n\tthis.scale = oConfig ? oConfig.scale : null;\r\n\tthis.type = oConfig && typeof oConfig.type === \"string\" ? oConfig.type.toLowerCase() : null;\r\n\r\n\tthis.styleIds = {};\r\n}\r\n\r\nNumeric.prototype = Object.create(Type.prototype);\r\nNumeric.prototype.constructor = Numeric;\r\n\r\nNumeric.DEFAULT = {\r\n\tnumberFormat: 0\r\n};\r\n\r\nNumeric.builtin = {\r\n\t1: \"0\",\r\n\t2: \"0.00\",\r\n\t3: \"#,##0\",\r\n\t4: \"#,##0.00\",\r\n\t9: \"0%\",\r\n\t10: \"0.00%\",\r\n\t11: \"0.00E+00\",\r\n\t12: \"# ?/?\",\r\n\t13: \"# ??/??\",\r\n\t37: \"#,##0;(#,##0)\",\r\n\t38: \"#,##0;[Red](#,##0)\",\r\n\t39: \"#,##0.00;(#,##0.00)\",\r\n\t40: \"#,##0.00;[Red](#,##0.00)\",\r\n\t48: \"##0.0E+0\"\r\n};\r\n\r\nNumeric.scientificRegEx = /^-?\\d?(\\.\\d)?\\d*[eE][+-]?\\d{1,3}$/;\r\n\r\n\r\n/**\r\n * Returns the unit specific scale.\r\n *\r\n * @param {string} sUnit Any unit of measure that has been configured within the customizing\r\n * @returns {number|null|undefined} A positive integer that represents the decimal scale or null/undefined in\r\n * case neither dynamic nor fixed scale is available\r\n * @public\r\n */\r\nNumeric.prototype.getScale = function(sUnit) {\r\n\tvar iScale;\r\n\r\n\tif (this.autoScale) {\r\n\t\tiScale = Customizing.getScaleForUnit(sUnit);\r\n\t}\r\n\r\n\tif (isNaN(iScale)) {\r\n\t\tiScale = this.scale;\r\n\t}\r\n\r\n\treturn iScale;\r\n};\r\n\r\n/**\r\n * Returns the numberFormat id of the built-in format or a numberFormat object with the formatting template\r\n *\r\n * @param {string} sUnit Unit of measure that is used to resolve the unit specific scale\r\n * @returns {string} Template for the NumberFormat\r\n */\r\nNumeric.prototype.getNumberFormatTemplate = function(sUnit) {\r\n\tconst scale = this.getScale(sUnit);\r\n\r\n\t// Use built-in template as base\r\n\tlet template = Numeric.builtin[1];\r\n\r\n\t/* Add decimal */\r\n\tif (typeof scale === \"number\" && scale > 0) {\r\n\t\ttemplate += \".\";\r\n\r\n\t\tfor (let i = 0; i < scale; i++) {\r\n\t\t\ttemplate += \"0\";\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.delimiter) {\r\n\t\ttemplate = \"#,##\" + template;\r\n\t}\r\n\r\n\tif (this.type === \"percentage\") {\r\n\t\ttemplate += '%';\r\n\t} else if (sUnit && this.displayUnit) {\r\n\t\ttemplate += '\\\\ \"' + sUnit + '\"';\r\n\t}\r\n\r\n\treturn template;\r\n};\r\n\r\n/**\r\n * Creates the format according to the provided configuration. If the\r\n * format matches any builtin format, it will return a reference to\r\n * its ID instead of the format.\r\n *\r\n * Both cases can serve the Style class that consumes this information.\r\n *\r\n * @param {Object} oData Business object that contains additional data that is used for the formatting\r\n * @returns {Object} Configuration object for NumberFormat initialization\r\n * @protected\r\n */\r\nNumeric.prototype._createConfiguration = function(oData) {\r\n\tconst config = Object.getPrototypeOf(Numeric.prototype)._createConfiguration.call(this, oData);\r\n\r\n\t/*\r\n\t * Evaluate unit of measurement first, because a plain built-in\r\n\t * format is used as template but we need to be able to return\r\n\t * to the DEFAULT value in case the unit is empty or invalid.\r\n\t */\r\n\tconst unit = this.getUnit(oData);\r\n\tconst scale = this.getScale(unit);\r\n\r\n\tif (!this.delimiter && typeof scale !== \"number\" && !unit) {\r\n\t\tconfig.numberFormat = Numeric.DEFAULT.numberFormat;\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\t// Use built-in template as base\r\n\tconst template = this.getNumberFormatTemplate(unit);\r\n\r\n\tconfig.numberFormat = {\r\n\t\tformat: template\r\n\t};\r\n\r\n\t/* Find possible builtin match */\r\n\tfor (const key in Numeric.builtin) {\r\n\t\tif (Numeric.builtin[key] === template) {\r\n\t\t\tconfig.numberFormat = parseInt(key, 10);\r\n\t\t}\r\n\t}\r\n\r\n\treturn config;\r\n};\r\n\r\n/**\r\n * Returns the assigned ID of the Type specific Style that is\r\n * registered in the Styles class.\r\n *\r\n * @param {Object} oData Business Object that contains the property for the UoM\r\n * @param {string|number} [value] Explicit cell value that might be used for semantic formatting\r\n * @returns {number} ID of the registered Style\r\n */\r\nNumeric.prototype.getStyleId = function(oData, value) {\r\n\tvar styleId, unit;\r\n\r\n\t/* Handle simple numeric without unitProperty */\r\n\tif (!this.unitProperty) {\r\n\t\treturn Object.getPrototypeOf(Numeric.prototype).getStyleId.call(this, oData, value);\r\n\t}\r\n\r\n\tif (!oData) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tunit = oData[this.unitProperty];\r\n\tstyleId = this.styleIds[unit];\r\n\r\n\tif (typeof styleId === \"undefined\") {\r\n\t\tthis.styleIds[unit] = this.styles.addStyle(this._createConfiguration(oData));\r\n\t}\r\n\r\n\treturn this.styleIds[unit];\r\n};\r\n\r\n/**\r\n * Returns the data value of the business object that is bound by\r\n * this type. The value is normalized so that different input\r\n * representations will result in the same format.\r\n *\r\n * @param {string} sProperty Name of the property that shall be accessed\r\n * @param {Object} oData Business object that contains the data\r\n *\r\n * @returns {string|number|boolean|null} The value of the given property after type specific processing.\r\n */\r\nNumeric.prototype.getValue = function(sProperty, oData) {\r\n\tvar aSegments, iScale, iExponent, sValue = oData[sProperty];\r\n\r\n\tif (typeof sValue == \"string\" && Numeric.scientificRegEx.test(sValue)) {\r\n\r\n\t\taSegments = sValue.split(/\\.|[eE]/g);\r\n\t\tiScale = aSegments.length === 3 ? aSegments[1].length : 0;\r\n\t\tiExponent = Number(aSegments[aSegments.length - 1]);\r\n\r\n\t\t/* According to OData V4 Edm.Double is an IEEE 754 binary64 floating-point number (15-17 decimal digits) */\r\n\t\tsValue = Number(sValue).toFixed(Math.max(iScale - iExponent, 0));\r\n\r\n\t\t/* Write back the transformed value to avoid subsequent transformations */\r\n\t\toData[sProperty] = sValue;\r\n\t}\r\n\r\n\treturn sValue;\r\n};\r\n\r\n/**\r\n * Checks if the given value can be displayed in the IEEE 754\r\n * specification format. The function ignores leading and trailing\r\n * zeros and compares if the length of the actual value does not exceed\r\n * 15 digits plus an optional decimal separator.\r\n *\r\n * The number might exceed 15 digits if it contains leading or\r\n * trailing zeros.\r\n *\r\n * @param {string} sValue Numeric value that needs to be checked\r\n * @param {Object} oData Business object that contains additional information like unit and scale\r\n * @returns {boolean} Whether the number needs to be formatted as BigNumber or not\r\n */\r\nNumeric.prototype.isIEEE754Compliant = function(sValue, oData) {\r\n\tvar bCompliant = false;\r\n\tvar sUnit = this.getUnit(oData);\r\n\tvar iScale = this.getScale(sUnit);\r\n\r\n\tif (typeof sValue == \"number\") {\r\n\t\t// eslint-disable-next-line no-param-reassign\r\n\t\tsValue = \"\" + sValue;\r\n\t}\r\n\r\n\tif (typeof sValue == \"string\") {\r\n\t\tbCompliant = sValue\r\n\t\t\t.trim()\r\n\t\t\t.replace(/^-*0*|0+$/g, \"\")\r\n\t\t\t.split(\".\")\r\n\t\t\t.reduce(function(acc, value, index) {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * The array cannot have more than 2 entries, so we take the scale\r\n\t\t\t\t * into account for all indices higher than 0.\r\n\t\t\t\t */\r\n\t\t\t\tvar length = index > 0 && typeof iScale === \"number\" ? Math.min(iScale, value.length) : value.length;\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t* Returns 1 if the value left of the separator is\r\n\t\t\t\t* zero and was cut of by removing leading and trailing zeros\r\n\t\t\t\t*/\r\n\t\t\t\treturn acc + length || 1;\r\n\t\t\t}, 0) <= 15;\r\n\t}\r\n\r\n\treturn bCompliant;\r\n};\r\n\r\n/**\r\n * Resolves the unit of measurement that is required for the specific formatting.\r\n * @param {Object} oData Data object that represents the row.\r\n * @returns {string} Unit of measurement or empty string.\r\n * @protected\r\n */\r\nNumeric.prototype.getUnit = function(oData) {\r\n\tvar unit;\r\n\r\n\t/* Obtain unit of measurement if available */\r\n\tif (this.type === \"percentage\") {\r\n\t\tunit = \"%\";\r\n\t} else if (typeof this.unitProperty === \"string\" && oData) {\r\n\t\tunit = oData[this.unitProperty];\r\n\t} else if (typeof this.unit === \"string\") {\r\n\t\tunit = this.unit;\r\n\t}\r\n\r\n\t/* Ignore invalid units */\r\n\tif (typeof unit !== \"string\" || unit === '\"') {\r\n\t\tunit = \"\";\r\n\t}\r\n\r\n\treturn unit || \"\";\r\n};\r\n\r\nmodule.exports = Numeric;","var Type = require(\"./Type\");\r\nvar Alignment = require(\"../../style/Alignment\");\r\n\r\nvar sCompliantLineBreak = String.fromCharCode(13, 10);\r\n\r\n/**\r\n * The Text class represents textual information without any\r\n * particular formatting. It provides font and sizing details that\r\n * can be used by the Styles class.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this Text type\r\n * @param {Object} [oConfig.font] Font configuration object\r\n * @param {number} [oConfig.font.size] Font size\r\n * @param {string} [oConfig.font.name] Font name i.E. Arial, Verdana, etc.\r\n * @param {Object} [oConfig.fill] Cell fill configuration object\r\n * @param {string} [oConfig.fill.color] Cell fill background color\r\n * @param {string} [oConfig.fill.type] Cell fill type\r\n * @param {string} [oConfig.template] Text template for this Type\r\n * @param {string} [oConfig.hierarchyLevel] Property name that is used for hierarchy level indentation\r\n * @param {boolean} [oConfig.wrap] Indicates the wrapping behavior of the text cell\r\n * @param {string} [oConfig.inputFormat] RegExp that identifies parts of the value to process it with a template\r\n * @constructor\r\n */\r\nfunction Text(oConfig) {\r\n\tType.call(this, oConfig);\r\n\r\n\tthis.font = oConfig ? oConfig.font : null;\r\n\tthis.fill = oConfig ? oConfig.fill : null;\r\n\tthis.template = oConfig ? oConfig.template : null;\r\n\tthis.hierarchyLevel = oConfig ? oConfig.hierarchyLevel : null;\r\n\tthis.wrap = oConfig ? oConfig.wrap : false;\r\n\tthis.inputFormat = oConfig ? oConfig.inputFormat : null;\r\n\r\n\tthis._mStyleIds = {};\r\n}\r\n\r\nText.prototype = Object.create(Type.prototype);\r\nText.prototype.constructor = Text;\r\n\r\nText.DEFAULT = {\r\n\tfont: {\r\n\t\tsize: 11,\r\n\t\tname: \"Arial\"\r\n\t}\r\n};\r\n\r\nconst formulaRegex = /^[\\s]*[=+\\-@]/;\r\nconst stringReplacePatterns = /\\$[\\$&`']/;\r\n\r\n/**\r\n * Ensures that all line breaks use CR + LF.\r\n *\r\n * @param {string} sValue Text that may contain line breaks\r\n * @return {string} Initial text with replaced line breaks\r\n */\r\nText.convertLineBreaks = function(sValue) {\r\n\r\n\tif (typeof sValue !== \"string\") {\r\n\t\treturn sValue;\r\n\t}\r\n\r\n\treturn sValue.replace(/\\r/g, \"\").replace(/\\n/g, sCompliantLineBreak);\r\n};\r\n\r\n/**\r\n * This method creates the XLSX specific style configuration depending on the cell content\r\n *\r\n * @param {Object} oData Line item that will be used to evaluate the cell content\r\n * @returns {Object} Style configuration used by the Styles class\r\n * @protected\r\n */\r\nText.prototype._createConfiguration = function(oData) {\r\n\tvar config;\r\n\r\n\tconfig = Object.getPrototypeOf(Text.prototype)._createConfiguration.call(this);\r\n\tconfig.fill = this.fill;\r\n\tconfig.font = this.font;\r\n\r\n\t/* Overwrites existing alignment for a proper indent */\r\n\tif (this.hierarchyLevel) {\r\n\t\tconfig.align = {\r\n\t\t\thorizontal: Alignment.horizontal.LEFT,\r\n\t\t\tindent: 2 * oData[this.hierarchyLevel]\r\n\t\t};\r\n\t}\r\n\r\n\t/* Wrapping can be applied on hierarchies with indentation */\r\n\tif (this.wrap) {\r\n\t\tconfig.align = config.align || {};\r\n\r\n\t\tconfig.align.wrap = this.wrap;\r\n\t}\r\n\r\n\treturn config;\r\n};\r\n\r\n/**\r\n * Returns the assigned ID of the Type specific Style that is\r\n * registered in the Styles class.\r\n *\r\n * @param {Object} oData Business Object that contains the property for hierarchy levels\r\n * @param {string|number} [sValue] Explicit cell value that might be used for semantic formatting\r\n * @returns {number} ID of the registered Style\r\n */\r\nText.prototype.getStyleId = function(oData, sValue) {\r\n\tvar bRequiresPrefix, sIdentifier, oConfig;\r\n\r\n\tif (!oData) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tbRequiresPrefix = sValue && formulaRegex.test(sValue);\r\n\r\n\t/* Handle simple styling without hierarchy information or prefix */\r\n\tif (!this.hierarchyLevel && !bRequiresPrefix) {\r\n\t\treturn Object.getPrototypeOf(Text.prototype).getStyleId.call(this);\r\n\t}\r\n\r\n\t/* Create local identifier to differentiate between cached styleIds */\r\n\tsIdentifier = \"id_\" + oData[this.hierarchyLevel] + (bRequiresPrefix ? \"_prefix\" : \"\");\r\n\r\n\tif (typeof this._mStyleIds[sIdentifier] === \"undefined\") {\r\n\t\toConfig = this._createConfiguration(oData);\r\n\t\toConfig.quotePrefix = bRequiresPrefix;\r\n\t\tthis._mStyleIds[sIdentifier] = this.styles.addStyle(oConfig);\r\n\t}\r\n\r\n\treturn this._mStyleIds[sIdentifier];\r\n};\r\n\r\n/**\r\n * Returns the data value of the business object that is bound by\r\n * this type. If a template is configured, it will automatically fill\r\n * the template with the values from the business object and returns\r\n * the processed string.\r\n *\r\n * @param {string|Array} properties Name of the property or array of properties that shall be accessed.\r\n * @param {Object} oData Business object that contains the data.\r\n *\r\n * @returns {string|number|boolean} The value of the given property after type specific processing.\r\n */\r\nText.prototype.getValue = function(properties, oData) {\r\n\tvar aMatch, reRegEx, sResult, bSkip, sValue, aValues, aInputMatch;\r\n\r\n\tif (!this.template) {\r\n\t\tsValue = typeof properties === \"string\" ? oData[properties] : oData[properties[0]];\r\n\r\n\t\tsValue = this.wrap ? Text.convertLineBreaks(sValue) : sValue;\r\n\r\n\t\treturn sValue;\r\n\t}\r\n\r\n\tif (typeof this.inputFormat === \"string\") {\r\n\t\taInputMatch = new RegExp(this.inputFormat).exec(oData[properties]);\r\n\r\n\t\t/* Keeps the initial value in case the input does not match the regex pattern */\r\n\t\taValues = Array.isArray(aInputMatch) ? aInputMatch.slice(1) : [oData[properties]];\r\n\t} else {\r\n\t\taValues = properties.reduce(function(acc, property) {\r\n\t\t\tacc.push(oData[property]);\r\n\r\n\t\t\treturn acc;\r\n\t\t}, []);\r\n\t}\r\n\r\n\t// Obtain if the further processing should be skipped due to missing values for the template\r\n\tbSkip = aValues.every(function(value) {\r\n\t\treturn value === null\r\n\t\t\t|| typeof value === \"undefined\"\r\n\t\t\t|| (typeof value === \"string\" && value === \"\");\r\n\t});\r\n\r\n\tif (bSkip) {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tsResult = this.template;\r\n\treRegEx = /{([0-9]+)}/g;\r\n\r\n\taMatch = reRegEx.exec(this.template);\r\n\twhile (aMatch !== null) {\r\n\r\n\t\tsValue = aValues[aMatch[1]];\r\n\r\n\t\t// Overwrite empty or undefined values by an empty string\r\n\t\tif (sValue === null || typeof sValue === \"undefined\") {\r\n\t\t\tsValue = \"\";\r\n\t\t}\r\n\r\n\t\t// Replaces the matched placeholder by the indexed property value\r\n\t\t// Note:\r\n\t\t// If the value contains any of the replacement pattern tokens ($$, $&, $`, $') we must avoid\r\n\t\t// String#replace interpreting them.\r\n\t\t// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_the_replacement\r\n\t\tif (stringReplacePatterns.test(sValue)) {\r\n\t\t\tconst sUnmodifiedValue = sValue;\r\n\r\n\t\t\tsResult = sResult.replace(aMatch[0], () => sUnmodifiedValue);\r\n\t\t} else {\r\n\t\t\tsResult = sResult.replace(aMatch[0], sValue);\r\n\t\t}\r\n\r\n\t\taMatch = reRegEx.exec(this.template);\r\n\t}\r\n\r\n\treturn sResult;\r\n};\r\n\r\nmodule.exports = Text;","var Customizing = require(\"../Customizing\");\r\nvar Type = require(\"./Type\");\r\n\r\n/**\r\n * The Timezone class represents a data type similar to\r\n * Enumeration but refers to the timezone customizing.\r\n *\r\n * @param {Object} [oConfig] Configuration object for this type\r\n * @constructor\r\n */\r\nfunction Timezone(oConfig) {\r\n\tType.call(this, oConfig);\r\n}\r\n\r\nTimezone.prototype = Object.create(Type.prototype);\r\nTimezone.prototype.constructor = Timezone;\r\n\r\n/**\r\n * Returns the mapped value for the key that is present in the\r\n * business object. If no translation is available for the given key,\r\n * the key is returned.\r\n *\r\n * @param {string} sProperty Name of the property that contains the key\r\n * @param {Object} oData Business object that contains the data\r\n * @returns {string} The value of the given property after type specific processing\r\n * @protected\r\n */\r\nTimezone.prototype.getValue = function(sProperty, oData) {\r\n\tconst sKey = oData[sProperty];\r\n\r\n\treturn Customizing.getTimezoneTranslation(sKey);\r\n};\r\n\r\nmodule.exports = Timezone;","/**\r\n * The Type class defines a supported data type, like strings,\r\n * numeric values, decimals, dates, currencies and so on. It is NOT\r\n * part of the XML representation of the generated Excel document.\r\n *\r\n * This class is marked as abstract therefore only its sub-classes\r\n * should be used.\r\n *\r\n * @param {Object} oConfig Type specific configuration\r\n * @constructor\r\n * @abstract\r\n */\r\nfunction Type(oConfig) {\r\n\tthis.styleId = null;\r\n\tthis.alignment = oConfig && oConfig.textAlign ? oConfig.textAlign : null;\r\n}\r\n\r\n/**\r\n * Creates the type specific configuration that is used to register\r\n * its corresponding style in the Styles class.\r\n *\r\n * All subclass implementations have to call the superclass method to\r\n * ensure that alignment information will not be lost.\r\n *\r\n * @param {Object} oData Line item that will be used to evaluate the cell content\r\n * @returns {Object} Configuration object that may contain alignment information\r\n * @protected\r\n */\r\nType.prototype._createConfiguration = function(oData) {\r\n\treturn this.alignment ? { align: {\thorizontal: this.alignment }} : {};\r\n};\r\n\r\n/**\r\n * Returns the assigned ID of the Type specific Style that is\r\n * registered in the Styles class.\r\n *\r\n * @param {Object} [oData] Business object that contains the actual data\r\n * @param {string|number} [vValue] Explicit cell value that might be used for semantic formatting\r\n * @returns {number} ID of the registered Style\r\n */\r\nType.prototype.getStyleId = function(oData, vValue) {\r\n\tif (this.styleId === null) {\r\n\t\tthis.styleId = this.styles.addStyle(this._createConfiguration(oData));\r\n\t}\r\n\r\n\treturn this.styleId;\r\n};\r\n\r\n/**\r\n * Registers the Style configuration of this Type in the given Styles\r\n * class.\r\n *\r\n * @param {Styles} oStyles Styles instance where the Type specific styling will be registered\r\n */\r\nType.prototype.registerAt = function(oStyles) {\r\n\tthis.styles = oStyles;\r\n};\r\n\r\n/**\r\n * Returns the data value of the business object that is bound by\r\n * this type.\r\n *\r\n * @param {string} sProperty Name of the property that shall be accessed.\r\n * @param {Object} oData Business object that contains the data.\r\n *\r\n * @returns {string|number|boolean|null} The value of the given property after type specific processing.\r\n */\r\nType.prototype.getValue = function(sProperty, oData) {\r\n\treturn oData[sProperty];\r\n};\r\n\r\nmodule.exports = Type;","var XMLNode\t\t \t\t= require(\"../xml/XMLNode\"),\r\n\tBigNumber\t\t\t= require(\"../binding/type/BigNumber\"),\r\n\tCalendarDate \t\t= require(\"../binding/type/CalendarDate\"),\r\n\tCalendarDateTime \t= require(\"../binding/type/CalendarDateTime\"),\r\n\tCalendarTime \t\t= require(\"../binding/type/CalendarTime\"),\r\n\tNumeric \t\t\t= require(\"../binding/type/Numeric\"),\r\n\tBooleanType \t\t= require(\"../binding/type/BooleanType\"),\r\n\tCurrency \t\t\t= require(\"../binding/type/Currency\");\r\n\r\n/**\r\n * The Cell class represents a single cell within the spreadsheet\r\n * that has to be assigned to a particular row. A Cell stores\r\n * information supporting several types of data.\r\n *\r\n * @param {Type} oType - The data type of the cell\r\n * @param {SharedStrings} oSharedStrings - SharedStrings instance that will be used by all Cells\r\n * @class\r\n */\r\nfunction Cell(oType, oSharedStrings) {\r\n\tXMLNode.call(this, Cell.metadata);\r\n\r\n\tObject.defineProperty(this, \"type\", { value: Cell.DataType.SharedString, writable: true });\r\n\r\n\tthis._shared = oSharedStrings;\r\n\tthis._oFallbackType = null;\r\n\tthis._applyType(oType);\r\n}\r\n\r\nCell.prototype = Object.create(XMLNode.prototype);\r\nCell.prototype.constructor = Cell;\r\n\r\nCell.DataType = {\r\n\tBoolean: \"b\",\r\n\tDate: \"d\",\r\n\tInlineString: \"inlineStr\", // We do not support inline strings\r\n\tNumber: \"n\",\r\n\tSharedString: \"s\",\r\n\tFormularString: \"str\"\r\n};\r\n\r\nCell._cellTypeProperty = \"cellType\";\r\n\r\nCell.metadata = {\r\n\ttag: \"c\",\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tid: \"reference\",\r\n\t\t\tname: \"r\",\r\n\t\t\tvalue: \"\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"style\",\r\n\t\t\tname: \"s\",\r\n\t\t\tvalue: \"0\" // Default style id\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"text\",\r\n\t\t\ttag: \"v\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Applies the given type to the current Cell and maps to the\r\n * corresponding Office Open XML type definition.\r\n *\r\n * @param {Type} oType - Value of type {@link Type}\r\n * @private\r\n */\r\nCell.prototype._applyType = function(oType) {\r\n\r\n\tthis.bindingType = oType;\r\n\r\n\tswitch (oType.constructor) {\r\n\t\tcase BooleanType:\r\n\t\t\tthis.type = Cell.DataType.Boolean;\r\n\r\n\t\t\tif (!oType.isCustomFormatted()) {\r\n\t\t\t\tthis.addAttribute({\r\n\t\t\t\t\tid: Cell._cellTypeProperty,\r\n\t\t\t\t\tname: \"t\",\r\n\t\t\t\t\tvalue: Cell.DataType.Boolean\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase CalendarDate:\r\n\t\tcase CalendarDateTime:\r\n\t\tcase CalendarTime:\r\n\t\t\tthis.type = Cell.DataType.Date;\r\n\t\t\tbreak;\r\n\r\n\t\tcase Numeric:\r\n\t\tcase Currency:\r\n\t\t\tthis.type = Cell.DataType.Number;\r\n\r\n\t\t\t/*\r\n\t\t\t * As long as _applyType is only called once during\r\n\t\t\t * initialization, the fallbackType can be registered\r\n\t\t\t * without any additional check.\r\n\t\t\t */\r\n\t\t\tthis._oFallbackType = new BigNumber(oType);\r\n\t\t\tthis._oFallbackType.registerAt(oType.styles);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tdefault: // Text is the default case\r\n\t\t\tthis.addAttribute({\r\n\t\t\t\tid: Cell._cellTypeProperty,\r\n\t\t\t\tname: \"t\",\r\n\t\t\t\tvalue: Cell.DataType.SharedString // Default cell type\r\n\t\t\t});\r\n\t\t\tthis.type = Cell.DataType.SharedString;\r\n\t}\r\n};\r\n\r\n/**\r\n * Applies the specified Style to the cell.\r\n *\r\n * @param {number|string} nStyle - Instance of Excel.objects.Style\r\n */\r\nCell.prototype.setStyle = function(nStyle) {\r\n\tthis.style.value = nStyle;\r\n};\r\n\r\n/**\r\n * Applies the specified cell location as reference. The reference\r\n * must match the regular expression of Open Document SpreadsheetML\r\n * sheet format. Starting with at least one uppercase letter for the\r\n * column followed by a number without leading zeros for the row.\r\n * [A-Z]+[1-9]+[0-9]*\r\n *\r\n * @param {string} sReference - Reference of the cells' location\r\n */\r\nCell.prototype.setReference = function(sReference) {\r\n\tif (typeof sReference != \"string\"\r\n\t\t|| !sReference.match(/^[A-Z]+[1-9]+[0-9]*$/g)) {\r\n\t\tthrow new Error(`The given Cell reference \"${sReference}\" does not match the reference pattern.`);\r\n\t}\r\n\r\n\tthis.reference.value = sReference;\r\n};\r\n\r\n/**\r\n * Assigns the value to the current Cell. The method requires a\r\n * property reference and a business object that gets bound depending\r\n * on the property. It is also possible to provide an array of\r\n * properties in case of aggregated columns.\r\n *\r\n * @param {(string|Array)} sProperty - single property or Array of properties\r\n * @param {Object} oBusinessObject - BusinessObject that gets bound to this Cell\r\n */\r\nCell.prototype.setValue = function(sProperty, oBusinessObject) {\r\n\tvar value, bindingType;\r\n\r\n\tbindingType = this.bindingType;\r\n\tvalue = bindingType.getValue(sProperty, oBusinessObject);\r\n\r\n\tif (!this._isValuePresent(value)) {\r\n\r\n\t\t/*\r\n\t\t * We need to clear the value due to the fact\r\n\t\t * that we are re-using the Cell for each row\r\n\t\t */\r\n\t\tthis.text.value = \"\";\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tswitch (this.type) {\r\n\t\tcase Cell.DataType.Boolean:\r\n\r\n\t\t\t/* String representations other than \"true\" will result in the boolean value false */\r\n\t\t\tif (typeof value === \"string\") {\r\n\t\t\t\tvalue = value.toLowerCase() === \"true\";\r\n\t\t\t}\r\n\t\t\tthis.text.value = value ? \"1\" : \"0\";\r\n\r\n\t\t\tbreak;\r\n\t\tcase Cell.DataType.Date:\r\n\t\t\tthis.text.value = value;\r\n\r\n\t\t\tbreak;\r\n\t\tcase Cell.DataType.Number:\r\n\t\t\tif (bindingType.isIEEE754Compliant(value, oBusinessObject)) {\r\n\t\t\t\tthis.text.value = value;\r\n\r\n\t\t\t\tif (this[Cell._cellTypeProperty]) {\r\n\t\t\t\t\tthis.remove(Cell._cellTypeProperty);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t/* Handle fallback case and insert value as SharedString */\r\n\t\t\tbindingType = this._oFallbackType;\r\n\t\t\tvalue = bindingType.getValue(sProperty, oBusinessObject);\r\n\r\n\t\t\tif (!this[Cell._cellTypeProperty]) {\r\n\t\t\t\tthis.addAttribute({\r\n\t\t\t\t\tid: Cell._cellTypeProperty,\r\n\t\t\t\t\tname: \"t\",\r\n\t\t\t\t\tvalue: Cell.DataType.SharedString // Default cell type\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// CAUTION: break is omitted intentionally\r\n\r\n\t\tdefault: // SharedString is the default case\r\n\t\t\tthis.text.value = this._shared.insert(value);\r\n\t}\r\n\r\n\t/*\r\n\t * Forces a style update once the value changed. This allows cell\r\n\t * specific styles for currency types. Due to the fact that the\r\n\t * Style ID gets cached within the Type, there is no performance\r\n\t * impact even on large data sets.\r\n\t */\r\n\tthis.setStyle(bindingType.getStyleId(oBusinessObject, value));\r\n};\r\n\r\n/**\r\n * Checks whether there is a value provided or not. Allowed values\r\n * are Stringsas well as numeric and boolean values. Empty Strings\r\n * will be evaluated as no value, but the numeric value 0 is a value.\r\n *\r\n * @param {(string|number|boolean|Array)} data - The value that gets checked\r\n * @returns {boolean} - true if a value is present, false if not\r\n * @private\r\n */\r\nCell.prototype._isValuePresent = function(data) {\r\n\treturn ((typeof data === \"string\" && !!data)\r\n\t\t|| typeof data === \"number\"\r\n\t\t|| typeof data === \"boolean\"\r\n\t\t|| data instanceof Date);\r\n};\r\n\r\n/**\r\n * Specialized serialization of the Cell which prevents that empty\r\n * cells are getting serialized at all. This can reduce the size of\r\n * the parent Sheet.\r\n *\r\n * @function serialize\r\n * @returns {string} XML formatted string representation of the cell\r\n */\r\nCell.prototype.serialize = function() {\r\n\tif (!this._isValuePresent(this.text.value)) {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\treturn XMLNode.prototype.serialize.call(this);\r\n};\r\n\r\nmodule.exports = Cell;","/**\r\n * Created by Sebastian Bender on 16.03.2017.\r\n */\r\nvar XMLNode = require(\"../xml/XMLNode\");\r\nvar Cell\t= require(\"./Cell\");\r\n\r\n/**\r\n * The Row is representing a single row according to the Office Open\r\n * XML standard. A Row provides information about its index (line\r\n * number) and can contain several Cell objects.\r\n *\r\n * @class\r\n */\r\nfunction Row() {\r\n\tXMLNode.call(this, Row.metadata);\r\n}\r\n\r\nRow.prototype = Object.create(XMLNode.prototype);\r\nRow.prototype.constructor = Row;\r\n\r\nRow.metadata = {\r\n\ttag: \"row\",\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tid: \"reference\",\r\n\t\t\tname: \"r\",\r\n\t\t\tvalue: \"\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"spans\",\r\n\t\t\tname: \"spans\",\r\n\t\t\tvalue: \"1:1\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Calculates the Office Open XML Spreadsheet column reference for a\r\n * numeric value. Referring to the standard, the column is described\r\n * as a alphabetical value consisting of at least one uppercase character.\r\n * This function maps these alphabetical representation to numerical\r\n * zero-based indices.\r\n *\r\n * i.E. the column index 27 (which is the 28th column) results in \"AB\"\r\n *\r\n * @param {number} nIndex - Numerical index for the requested column\r\n * @returns {string} - The alphabetical column reference for the given index.\r\n */\r\nRow.getColumnReferenceByIndex = function(nIndex) {\r\n\treturn nIndex < 26 ?\r\n\t\tString.fromCharCode(65 + nIndex) :\r\n\t\tRow.getColumnReferenceByIndex(Math.floor(nIndex / 26) - 1) + String.fromCharCode(65 + (nIndex % 26));\r\n};\r\n\r\n\r\n/**\r\n * Update the \"spans\" attribute on this particular {@link Row} for\r\n * optimization purposes. This property optimizes the loading and\r\n * rendering in Microsoft Excel.\r\n *\r\n * @private\r\n */\r\nRow.prototype._updateSpans = function() {\r\n\tthis.spans.value = \"1:\" + this.childs.length;\r\n};\r\n\r\n/**\r\n * Adds the specified {@link Cell} to the current {@link Row}. If the\r\n * current row already has a reference or style, it will propagate\r\n * this information to the newly added Cell.\r\n *\r\n * @param {object} oCell - Instance of Excel.objects.Cell\r\n */\r\nRow.prototype.addCell = function(oCell) {\r\n\tvar count;\r\n\r\n\tif (!oCell || !(oCell instanceof Cell)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tcount = this.childs.push(oCell);\r\n\tthis._updateSpans();\r\n\r\n\t/* Applies the cell reference if row reference is already present */\r\n\tif (this.reference.value) {\r\n\t\toCell.setReference(Row.getColumnReferenceByIndex(count - 1) + this.reference.value);\r\n\t}\r\n\r\n\tif (this.style) {\r\n\t\toCell.setStyle(this.style.value);\r\n\t}\r\n};\r\n\r\n\r\n/**\r\n * Updates the reference of the current {@link Row}. The Row reference\r\n * represents the line number within the Sheet. It will\r\n * automatically update all assigned Cell references.\r\n *\r\n * @param {string} sReference - Row number within the sheet\r\n */\r\nRow.prototype.setReference = function(sReference) {\r\n\tvar i, reference;\r\n\r\n\treference = typeof sReference == \"number\" ? String(sReference) : sReference;\r\n\tif (!reference || !reference.match(/^[1-9]+[0-9]*$/g)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/* Only update if necessary */\r\n\tif (this.reference.value != reference) {\r\n\t\tthis.reference.value = reference;\r\n\t\tfor (i = 0; i < this.childs.length; i++) {\r\n\t\t\tthis.childs[i].setReference(Row.getColumnReferenceByIndex(i) + reference);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Applies the given {@link Style} to the current {@link Row}.\r\n *\r\n * @param {(number|string)} nStyle - A number or string representing the Style id\r\n */\r\nRow.prototype.setStyle = function(nStyle) {\r\n\tvar i, style;\r\n\r\n\tif (!this.style) {\r\n\t\tstyle = this.addAttribute({name: \"s\"});\r\n\t\tObject.defineProperty(this, \"style\", {value: style});\r\n\t}\r\n\r\n\tthis.style.value = nStyle;\r\n\tfor (i = 0; i < this.childs.length; i++) {\r\n\t\tthis.childs[i].setStyle(nStyle);\r\n\t}\r\n};\r\n\r\nmodule.exports = Row;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The SharedString class represents each shared String within the\r\n * SharedStrings file.\r\n *\r\n * @param {string} sValue - The String that gets represented by this SharedString object\r\n * @class\r\n */\r\nfunction SharedString(sValue) {\r\n\tXMLNode.call(this, SharedString.metadata);\r\n\r\n\tthis.setValue(sValue);\r\n}\r\n\r\nSharedString.prototype = Object.create(XMLNode.prototype);\r\nSharedString.prototype.constructor = SharedString;\r\n\r\nSharedString.spacePreserveAttributeId = \"spacePreserve\";\r\n\r\n// eslint-disable-next-line no-control-regex, max-len\r\nSharedString.controlCharacterTestRegex = /[\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x0B\\x0C\\x0E\\x0F\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1A\\x1B\\x1C\\x1D\\x1E\\x1F]/m;\r\n// eslint-disable-next-line no-control-regex, max-len\r\nSharedString.controlCharacterReplaceRegex = /[\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x0B\\x0C\\x0E\\x0F\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1A\\x1B\\x1C\\x1D\\x1E\\x1F]/gm;\r\n\r\n// Matches space either at the beginning or the end\r\nSharedString.spacePreserveRegex = /^ | $/;\r\n\r\nSharedString.metadata = {\r\n\ttag: \"si\",\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"text\",\r\n\t\t\ttag: \"t\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Replaces XML incompatible control characters with their corresponding Office Open XML escape sequence.\r\n *\r\n * @param {string} sValue - String that contains ASCII control characters\r\n * @returns {string} - Escaped string\r\n * @private\r\n */\r\nSharedString._escapeControlCharacters = function(sValue) {\r\n\tvar sCharHex;\r\n\r\n\treturn sValue.replace(SharedString.controlCharacterReplaceRegex, function(sMatch) {\r\n\t\tsCharHex = sMatch.codePointAt(0).toString(16).toUpperCase();\r\n\r\n\t\t/* Works only with control characters in ASCII range - do NOT use with Emojis */\r\n\t\treturn \"_x00\" + (sCharHex.length === 1 ? \"0\" : \"\") + sCharHex + \"_\";\r\n\t});\r\n};\r\n\r\n/**\r\n * Assigns the given value to the current SharedString instance.\r\n *\r\n * @function\r\n * @param {string} sValue - The string value that should be added\r\n */\r\nSharedString.prototype.setValue = function(sValue) {\r\n\r\n\tthis.text.remove(SharedString.spacePreserveAttributeId);\r\n\r\n\tif (SharedString.controlCharacterTestRegex.test(sValue)) {\r\n\t\tsValue = SharedString._escapeControlCharacters(sValue);\r\n\t}\r\n\r\n\tif (SharedString.spacePreserveRegex.test(sValue)) {\r\n\t\tthis.text.addAttribute({\r\n\t\t\tid: SharedString.spacePreserveAttributeId,\r\n\t\t\tname: \"space\",\r\n\t\t\tprefix: \"xml\",\r\n\t\t\tvalue: \"preserve\"\r\n\t\t});\r\n\t}\r\n\r\n\tif (sValue && typeof sValue == \"string\") {\r\n\t\tthis.text.value = sValue;\r\n\t} else {\r\n\r\n\t\t/**\r\n\t\t * There are other implementations for creating a string\r\n\t\t * representation out of a number that might be more\r\n\t\t * convenient like new String(number).toString() or\r\n\t\t * number.toString() but \"\" + number is the best performing.\r\n\t\t */\r\n\t\tthis.text.value = \"\" + sValue;\r\n\t}\r\n};\r\n\r\n/**\r\n * Serializes the XMLNode and transforms the concatenated string into a sequential string.\r\n * @return {string} - String representation of the SharedString\r\n *\r\n * @override\r\n */\r\nSharedString.prototype.serialize = function() {\r\n\tvar sSerialized;\r\n\r\n\tsSerialized = Object.getPrototypeOf(SharedString.prototype).serialize.call(this);\r\n\r\n\treturn (\" \" + sSerialized).substr(1);\r\n};\r\n\r\nmodule.exports = SharedString;","var XMLFile\t\t\t= require(\"../xml/XMLFile\"),\r\n\tSharedString\t= require(\"./SharedString\");\r\n\r\n/**\r\n * The SharedStrings class represents the list of shared String\r\n * objects that is used in the Office Open XMl Spreadsheet. The\r\n * SharedStrings object reduces redundancy within the data by\r\n * providing a reference to unique Strings instead of repeating\r\n * them.\r\n *\r\n * Due to the fact that the Strings are shared within the whole\r\n * workbook, each instance of the document export only has one\r\n * single instance of SharedString and therefore it uses the\r\n * Singleton pattern to ensure this.\r\n *\r\n * @class\r\n */\r\nfunction SharedStrings() {\r\n\tXMLFile.call(this, SharedStrings.metadata);\r\n\r\n\tObject.defineProperty(this, \"map\", {value: new Map(), writable: false});\r\n\tObject.defineProperty(this, \"_shared\", {value: new SharedString(\"\"), writable: false});\r\n\r\n\tSharedStrings.instance = this;\r\n}\r\n\r\nSharedStrings.prototype = Object.create(XMLFile.prototype);\r\nSharedStrings.prototype.constructor = SharedStrings;\r\n\r\nSharedStrings.MAX_CELL_LENGTH = 32767;\r\n\r\n/**\r\n * Retrieves the Singleton instance of SharedStrings. If no instance is present, it will create one.\r\n *\r\n * @function\r\n * @returns {object} - Singleton instance\r\n */\r\nSharedStrings.getInstance = function() {\r\n\tif (!SharedStrings.instance) {\r\n\t\tSharedStrings.instance = new SharedStrings();\r\n\t}\r\n\r\n\treturn SharedStrings.instance;\r\n};\r\n\r\nSharedStrings.metadata = {\r\n\tfilename: \"sharedStrings.xml\",\r\n\ttag: \"sst\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"count\",\r\n\t\t\tname: \"count\",\r\n\t\t\tvalue: 0\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"uniqueCount\",\r\n\t\t\tname: \"uniqueCount\",\r\n\t\t\tvalue: 0\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Adds the specified string value to the set of SharedStrings. The\r\n * method creates a SharedString proxy object that contains\r\n * information about the string itself as well as its index. The\r\n * index is zero-based and can be used for referencing within Cell\r\n * objects.\r\n *\r\n * @function insert\r\n * @param {string} sValue - The string that has to be inserted\r\n * @return {object} - The SharedString instance that represents the provided string value\r\n */\r\nSharedStrings.prototype.insert = function(sValue) {\r\n\tvar index;\r\n\r\n\tthis.count.value = this.count.value + 1;\r\n\r\n\tif (sValue.length > SharedStrings.MAX_CELL_LENGTH) {\r\n\t\tsValue = sValue.substring(0, SharedStrings.MAX_CELL_LENGTH + 1);\r\n\t}\r\n\r\n\tif (this.map.has(sValue)) {\r\n\t\treturn this.map.get(sValue);\r\n\t}\r\n\r\n\tthis._shared.setValue(sValue);\r\n\tindex = this.map.size;\r\n\tthis.map.set(sValue, index);\r\n\r\n\t/* The SharedString needs to be added to the child nodes as well for serialization purposes */\r\n\tthis.childs.push(this._shared.serialize());\r\n\tthis.uniqueCount.value = this.childs.length;\r\n\r\n\treturn index;\r\n};\r\n\r\n/**\r\n * Cleanup hook that gets executed when the XMLFile#serialize function\r\n * is called with the finalize flag.\r\n *\r\n * @private\r\n */\r\nSharedStrings.prototype.cleanup = function() {\r\n\tthis.map.clear();\r\n};\r\n\r\nmodule.exports = SharedStrings;","var XMLFile\t\t = require(\"../xml/XMLFile\"),\r\n\tRow\t\t\t = require(\"./Row\");\r\n\r\n/**\r\n * This class represents a Sheet within an Office Open XML Spreadsheet.\r\n * @param {Object} oColumnConfiguration - ColumnConfiguration object that provides information about the columns\r\n * @constructor\r\n */\r\nfunction Sheet(oColumnConfiguration) {\r\n\tXMLFile.call(this, Sheet.metadata);\r\n\r\n\tObject.defineProperty(this, \"_columns\", {value: oColumnConfiguration, writable: false});\r\n\r\n\tthis._hierarchyProperty = oColumnConfiguration._hierarchyProperty;\r\n\tthis._hierarchyLevel = 0;\r\n\tthis._rowCount = 0;\r\n\tthis._createCols();\r\n\tthis._createHeader();\r\n}\r\n\r\nSheet.prototype = Object.create(XMLFile.prototype);\r\nSheet.prototype.constructor = Sheet;\r\n\r\nSheet.metadata = {\r\n\ttag: \"worksheet\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"r\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"mc\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\ttag: \"sheetPr\",\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttag: \"outlinePr\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"summaryBelow\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"dimension\",\r\n\t\t\ttag: \"dimension\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"reference\",\r\n\t\t\t\t\tname: \"ref\",\r\n\t\t\t\t\tvalue: \"A1\" // Default dimension of an empty Sheet\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"views\",\r\n\t\t\ttag: \"sheetViews\",\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"defaultView\",\r\n\t\t\t\t\ttag: \"sheetView\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"workbookViewId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t],\r\n\t\t\t\t\tproperties: [\r\n\r\n\t\t\t\t\t\t/* Freezes the header row */\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tid: \"pane\",\r\n\t\t\t\t\t\t\ttag: \"pane\",\r\n\t\t\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tname: \"ySplit\",\r\n\t\t\t\t\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tname: \"topLeftCell\",\r\n\t\t\t\t\t\t\t\t\tvalue: \"A2\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tname: \"activePane\",\r\n\t\t\t\t\t\t\t\t\tvalue: \"bottomLeft\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tname: \"state\",\r\n\t\t\t\t\t\t\t\t\tvalue: \"frozen\"\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t]\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"format\",\r\n\t\t\ttag: \"sheetFormatPr\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"defaultRowHeight\",\r\n\t\t\t\t\tvalue: \"15\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"columns\",\r\n\t\t\ttag: \"cols\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"data\",\r\n\t\t\ttag: \"sheetData\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"filter\",\r\n\t\t\ttag: \"autoFilter\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"reference\",\r\n\t\t\t\t\tname: \"ref\",\r\n\t\t\t\t\tvalue: \"A1\" // Default dimension of an empty Sheet\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"pageMargins\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"left\",\r\n\t\t\t\t\tvalue: \"0.75\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"right\",\r\n\t\t\t\t\tvalue: \"0.75\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"top\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"bottom\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"header\",\r\n\t\t\t\t\tvalue: \"0.5\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"footer\",\r\n\t\t\t\t\tvalue: \"0.5\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\nSheet.MAX_ROWS = 1048576;\r\n\r\n/**\r\n * Creates the column specific information within the worksheet.\r\n * Column specific information is i.E. the width or the use of the\r\n * bestFit functionality.\r\n *\r\n * @private\r\n */\r\nSheet.prototype._createCols = function() {\r\n\tvar col, i, minWidth, width,\r\n\t\tautoFitButtonOffset = 2.4;\r\n\r\n\t/**\r\n\t * Inner function for calculating the column width. The function\r\n\t * will ceil the width to the next step of 0.25 so that the\r\n\t * result mod step is 0.\r\n\t * @param {number} nWidth - The width that needs to be adjusted\r\n\t * @returns {number} A width rounded to the accuracy of 0.25\r\n\t */\r\n\tfunction roundWidth(nWidth) {\r\n\t\tvar factor, step;\r\n\r\n\t\tstep = 0.25;\r\n\t\tfactor = 1 / step;\r\n\r\n\t\treturn Math.ceil(nWidth * factor) / factor;\r\n\t}\r\n\r\n\tfor (i = 0; i < this._columns.size(); i++) {\r\n\t\tcol = this._columns.columns[i];\r\n\t\tminWidth = this._calculateColumnWidth(col.label.length) + autoFitButtonOffset;\r\n\t\twidth = roundWidth(Math.max(this._calculateColumnWidth(col.width), minWidth));\r\n\r\n\t\tthis.columns.addChild({\r\n\t\t\ttag: \"col\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"min\",\r\n\t\t\t\t\tvalue: (i + 1)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"max\",\r\n\t\t\t\t\tvalue: (i + 1)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"bestFit\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"width\",\r\n\t\t\t\t\tvalue: Math.max(width, minWidth)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"customWidth\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t});\r\n\t}\r\n};\r\n\r\n/**\r\n * This method calculates the optimal column width for the given\r\n * amount of characters. It removes the dependency on font size or\r\n * pixel width. This calculation is based on Office Open SpreadsheetML\r\n * (ISO/IEC 29500-1:2016) section 18.3.1.13\r\n *\r\n * @param {number} nCharacters - Amount of characters that should fit into the column\r\n * @return {number} Excel internal width value corresponding to the used font size\r\n * @private\r\n */\r\nSheet.prototype._calculateColumnWidth = function(nCharacters) {\r\n\tvar defaultPaddingAndBorder = 5,\r\n\t\tdefaultFontWidth = 8;\r\n\r\n\tif (typeof nCharacters !== \"number\") {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\treturn Math.floor(((nCharacters * defaultFontWidth) + defaultPaddingAndBorder) / defaultFontWidth * 256) / 256;\r\n};\r\n\r\n/**\r\n * Sets the maximal hierarchy depth of this Sheet. The value will\r\n * only be changed if the given depth is higher than the previous\r\n * depth.\r\n *\r\n * @param {number} nHierarchyDepth - Numerical hierarchy depth\r\n * @private\r\n */\r\nSheet.prototype._setHierarchyDepth = function(nHierarchyDepth) {\r\n\r\n\t/* The maximum supported hierarchy depth is 7 */\r\n\tif (typeof nHierarchyDepth !== \"number\" || nHierarchyDepth < 1 || nHierarchyDepth > 7) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// eslint-disable-next-line no-param-reassign\r\n\tnHierarchyDepth = nHierarchyDepth || 0;\r\n\r\n\tif (!this.format.hierarchyDepth) {\r\n\t\tthis.format.addAttribute({\r\n\t\t\tid: \"hierarchyDepth\",\r\n\t\t\tname: \"outlineLevelRow\",\r\n\t\t\tvalue: nHierarchyDepth\r\n\t\t});\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis.format.hierarchyDepth.value = Math.max(this.format.hierarchyDepth.value, nHierarchyDepth);\r\n};\r\n\r\n/**\r\n * Requests the header Row from the ColumnConfiguration and adds it to the\r\n * sheet.\r\n *\r\n * @private\r\n */\r\nSheet.prototype._createHeader = function() {\r\n\tvar headerRow = this._columns.getHeader();\r\n\r\n\tif (headerRow === null) {\r\n\t\tthis.remove(\"filter\");\r\n\t\tthis.views.defaultView.remove(\"pane\");\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis._appendRow(headerRow);\r\n};\r\n\r\n/**\r\n * Adds the specified Row to the sheetData element of this Sheet and\r\n * automatically propagates its row index to the row and its cells.\r\n *\r\n * @param {Object} oRow - The Row object that should be appended to the current Sheet\r\n * @private\r\n */\r\nSheet.prototype._appendRow = function(oRow) {\r\n\tvar dimension, sSerializedRow;\r\n\r\n\tthis._rowCount++;\r\n\toRow.setReference(\"\" + (this._rowCount));\r\n\r\n\tsSerializedRow = oRow.serialize();\r\n\r\n\t/* Bundle two rows into one string */\r\n\tif (this._rowCount % 2 === 0) {\r\n\t\tsSerializedRow = this.data.childs.pop() + sSerializedRow;\r\n\t}\r\n\r\n\t/*\r\n\t * Serializing the rows would create concatenated strings that are represented by a binary\r\n\t * tree that references all substrings as leaves. This increases the memory usage massively.\r\n\t *\r\n\t * To avoid this string representation we need to convert the concatenated string to a\r\n\t * sequential string by using String#substr. This reduces memory consumption\r\n\t * and due to less Garbage Collection runs, also the runtime, although there is additional\r\n\t * effort to convert the strings.\r\n\t *\r\n\t * Additional information can be found here:\r\n\t * https://bugs.chromium.org/p/v8/issues/detail?id=2869\r\n\t */\r\n\tthis.data.childs.push((\" \" + sSerializedRow).substr(1));\r\n\r\n\t/* Update sheet dimension */\r\n\tdimension = \"A1:\" + Row.getColumnReferenceByIndex(this._columns.size() - 1) + this._rowCount;\r\n\r\n\tthis.dimension.reference.value = dimension;\r\n\r\n\tif (this.filter) {\r\n\t\tthis.filter.reference.value = dimension;\r\n\t}\r\n\r\n\r\n};\r\n\r\n/**\r\n * Creates a new group inside the sheet with the given hierarchy\r\n * level. All subsequent data rows will be assigned to this group.\r\n *\r\n * @function createGroup\r\n * @param {string} sName - Name of the group that will be displayed in the group header\r\n * @param {number} nLevel - Hierarchy level that will be used for outlining\r\n */\r\nSheet.prototype.createGroup = function(sName, nLevel) {\r\n\tvar groupHeaderRow;\r\n\r\n\tthis._hierarchyLevel = nLevel;\r\n\tgroupHeaderRow = this._columns.getGroupHeader(sName);\r\n\r\n\tthis._appendRow(groupHeaderRow);\r\n};\r\n\r\n/**\r\n * Requests a row from the ColumnConfiguration containing the given data\r\n * and adds it to the sheetData element of this Sheet.\r\n *\r\n * The maximum row limit is 1,048,576 but the user rather runs out of\r\n * memory than reaching this limit.\r\n *\r\n * @function insert\r\n * @param {Object} oData - Data object to be inserted\r\n */\r\nSheet.prototype.insert = function(oData) {\r\n\tvar nHierarchyLevel;\r\n\r\n\tif (this._rowCount >= Sheet.MAX_ROWS) {\r\n\t\tthrow new Error(\"Row limit reached.\");\r\n\t}\r\n\r\n\tnHierarchyLevel =\r\n\t\tthis._columns.hierarchyLevelProperty ? oData[this._columns.hierarchyLevelProperty] : this._hierarchyLevel;\r\n\r\n\t/* Create row and apply binding */\r\n\tthis._appendRow(this._columns.bind(oData, nHierarchyLevel));\r\n\tthis._setHierarchyDepth(nHierarchyLevel);\r\n};\r\n\r\n/**\r\n * Cleanup hook that gets executed when the XMLFile#serialize function\r\n * is called with the finalize flag.\r\n *\r\n * @private\r\n */\r\nSheet.prototype.cleanup = function() {\r\n\tthis.remove(\"data\");\r\n};\r\n\r\n/**\r\n * Returns the current row count of the Worksheet.\r\n *\r\n * @returns {number} - The amount of rows that are contained in this Worksheet\r\n *\r\n * @public\r\n */\r\nSheet.prototype.getRowCount = function() {\r\n\treturn this._rowCount;\r\n};\r\n\r\nmodule.exports = Sheet;","var XMLFile = require(\"../xml/XMLFile\");\r\n\r\n/**\r\n * This class represents the app.xml within the generated Excel. The\r\n * App contains information about the application that created the\r\n * Office Open XML Spreadsheet.\r\n *\r\n * @param {Object} [oContext] Context object containing metadata for this particular Excel\r\n * @param {string} [oContext.application] Application that created this Excel\r\n * @param {string} [oContext.version] Application version that was used to create this Excel\r\n * @constructor\r\n */\r\nfunction App(oContext) {\r\n\tXMLFile.call(this, App.metadata);\r\n\r\n\tif (oContext) {\r\n\r\n\t\tif (oContext.application) {\r\n\t\t\tthis.application.value = oContext.application;\r\n\t\t}\r\n\r\n\t\tif (oContext.version) {\r\n\t\t\tthis.version.value = oContext.version;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nApp.prototype = Object.create(XMLFile.prototype);\r\nApp.prototype.constructor = App;\r\n\r\nApp.metadata = {\r\n\tpath: \"docProps/\",\r\n\tfilename: \"app.xml\",\r\n\ttag: \"Properties\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"vt\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"application\",\r\n\t\t\ttag: \"Application\",\r\n\t\t\tvalue: \"SAP UI5\" // Default value, can be overridden\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"DocSecurity\",\r\n\t\t\tvalue: \"0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Company\",\r\n\t\t\tvalue: \"SAP SE\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"SharedDoc\",\r\n\t\t\tvalue: \"false\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"version\",\r\n\t\t\ttag: \"AppVersion\",\r\n\t\t\tvalue: \"1.118\" // Default value, can be overridden\r\n\t\t}\r\n\t]\r\n};\r\n\r\nmodule.exports = App;","var XMLFile = require(\"../xml/XMLFile\");\r\n\r\n/**\r\n * This class represents the [Content_Types].xml within the generated Excel.\r\n *\r\n * @constructor\r\n */\r\nfunction ContentTypes() {\r\n\tXMLFile.call(this, ContentTypes.metadata);\r\n}\r\n\r\nContentTypes.prototype = Object.create(XMLFile.prototype);\r\nContentTypes.prototype.constructor = ContentTypes;\r\n\r\n\r\nContentTypes.FILENAME = \"\";\r\nContentTypes.metadata = {\r\n\tfilename: \"[Content_Types].xml\",\r\n\ttag: \"Types\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/package/2006/content-types\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\ttag: \"Default\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"Extension\",\r\n\t\t\t\t\tvalue: \"xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Default\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"Extension\",\r\n\t\t\t\t\tvalue: \"rels\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-package.relationships+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/xl/workbook.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/xl/worksheets/sheet1.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/xl/styles.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/xl/sharedStrings.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/docProps/core.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-package.core-properties+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"Override\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"PartName\",\r\n\t\t\t\t\tvalue: \"/docProps/app.xml\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"ContentType\",\r\n\t\t\t\t\tvalue: \"application/vnd.openxmlformats-officedocument.extended-properties+xml\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\nmodule.exports = ContentTypes;","var XMLFile = require(\"../xml/XMLFile\");\r\n\r\n/**\r\n * This class represents the core.xml within the generated Excel. The\r\n * Core contains basic information about the content and the owner of\r\n * the file.\r\n *\r\n * @param {Object} [oContext] - Context object containing metadata for this particular Excel\r\n * @param {string} [oContext.title] - Title of the Excel document\r\n * @param {string} [oContext.modifiedBy] - User context for the exported document\r\n * @constructor\r\n */\r\nfunction Core(oContext) {\r\n\tXMLFile.call(this, Core.metadata);\r\n\r\n\tif (oContext) {\r\n\r\n\t\tif (oContext.title) {\r\n\t\t\tthis.title.value = oContext.title;\r\n\t\t}\r\n\r\n\t\tif (oContext.modifiedBy) {\r\n\t\t\tthis.modifiedBy.value = oContext.modifiedBy;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nCore.prototype = Object.create(XMLFile.prototype);\r\nCore.prototype.constructor = Core;\r\n\r\nCore.metadata = {\r\n\tpath: \"docProps/\",\r\n\tfilename: \"core.xml\",\r\n\ttag: \"cp:coreProperties\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"cp\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"dc\",\r\n\t\t\tvalue: \"http://purl.org/dc/elements/1.1/\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"dcterms\",\r\n\t\t\tvalue: \"http://purl.org/dc/terms/\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"dcmitype\",\r\n\t\t\tvalue: \"http://purl.org/dc/dcmitype/\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"xsi\",\r\n\t\t\tvalue: \"http://www.w3.org/2001/XMLSchema-instance\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"title\",\r\n\t\t\ttag: \"dc:title\",\r\n\t\t\tvalue: \"Table Export\" // Default value, can be overridden\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"dc:creator\",\r\n\t\t\tvalue: \"SAP UI5 Document Export\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"cp:keywords\",\r\n\t\t\tvalue: \"SAP UI5 EXPORT\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"modifiedBy\",\r\n\t\t\ttag: \"cp:lastModifiedBy\",\r\n\t\t\tvalue: \"SAP UI5\" // Default value, can be overridden\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"dcterms:created\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tprefix: \"xsi\",\r\n\t\t\t\t\tname: \"type\",\r\n\t\t\t\t\tvalue: \"dcterms:W3CDTF\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tvalue: new Date().toISOString()\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"modified\",\r\n\t\t\ttag: \"dcterms:modified\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tprefix: \"xsi\",\r\n\t\t\t\t\tname: \"type\",\r\n\t\t\t\t\tvalue: \"dcterms:W3CDTF\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tvalue: new Date().toISOString()\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Updates the state of the Core class and returns the serialized string.\r\n *\r\n * @return {string} - Serialized representation of the Core instance\r\n */\r\nCore.prototype.serialize = function() {\r\n\tthis.modified.value = new Date().toISOString();\r\n\r\n\treturn Object.getPrototypeOf(Core.prototype).serialize.call(this);\r\n};\r\n\r\nmodule.exports = Core;","var XMLFile\t\t\t= require(\"../xml/XMLFile\"),\r\n\tRelationships\t= require(\"./Relationships\");\r\n\r\n/**\r\n * This class represents an Office Open XML Spreadsheet object\r\n * that is related to other objects via Relationships. The object\r\n * manages its Relationships by itself to encapsulate the complexity.\r\n *\r\n * A ReferenceNode also provides information about its path so that\r\n * all relationships that are connected to this ReferenceNode are are\r\n * relative to its path.\r\n *\r\n * @param {Object} oConfig Configuration object that is used by the super class XMLFile\r\n * @constructor\r\n */\r\nfunction ReferenceNode(oConfig) {\r\n\tXMLFile.call(this, oConfig);\r\n\r\n\tthis._relatedFiles = [];\r\n\tthis._relationships = new Relationships(this);\r\n\r\n\tthis.addRelatedFile(this._relationships);\r\n}\r\n\r\nReferenceNode.prototype = Object.create(XMLFile.prototype);\r\nReferenceNode.prototype.constructor = ReferenceNode;\r\n\r\n\r\nReferenceNode.prototype.addRelatedFile = function(oXMLFile) {\r\n\tif (!(oXMLFile instanceof XMLFile)) {\r\n\t\tthrow new Error(\"A related file must be of type XMLFile\");\r\n\t}\r\n\r\n\tthis._relatedFiles.push(oXMLFile);\r\n};\r\n\r\nReferenceNode.prototype.getRelationships = function() {\r\n\treturn this._relationships;\r\n};\r\n\r\n/**\r\n * Returns an Array of {@link XMLFile} objects that are reference by\r\n * this {@link ReferenceNode}. The method provides a flat copy of the\r\n * original data to avoid manipulation.\r\n *\r\n * @returns {Array} Array containing referenced files\r\n */\r\nReferenceNode.prototype.getRelatedFiles = function() {\r\n\treturn this._relatedFiles.slice();\r\n};\r\n\r\nmodule.exports = ReferenceNode;","var\tXMLFile = require(\"../xml/XMLFile\"),\r\n\tXMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * @param {ReferenceNode} oReferenceNode - ReferenceNode object that is the root of this Relationships XMLFile\r\n * @constructor\r\n */\r\nfunction Relationships(oReferenceNode) {\r\n\tXMLFile.call(this, Relationships.metadata);\r\n\r\n\tif (oReferenceNode instanceof XMLFile) {\r\n\t\tthis.setFileName(oReferenceNode.getFileName() + \".rels\");\r\n\t\tthis.setPath(oReferenceNode.getPath() + \"_rels/\");\r\n\t}\r\n}\r\n\r\nRelationships.prototype = Object.create(XMLFile.prototype);\r\nRelationships.prototype.constructor = Relationships;\r\n\r\nRelationships.metadata = {\r\n\tfilename: \".rels\",\r\n\tpath: \"_rels/\",\r\n\ttag: \"Relationships\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/package/2006/relationships\"\r\n\t\t}\r\n\t],\r\n\tproperties: []\r\n};\r\n\r\n/**\r\n * Creates a new Relationship entry for the current collection.\r\n * The Relationship references are defined by the ISO/IEC 29500-1:2016 standard.\r\n *\r\n * @param {string} sTarget - Target file within the generated Excel\r\n * @param {string} sType - XMLNS reference of the targets file type\r\n * @returns {string} The newly created relationship id that can be referenced i.E. \"rId4\"\r\n */\r\nRelationships.prototype.addRelationship = function(sTarget, sType) {\r\n\tvar id = \"rId\" + (this.childs.length + 1);\r\n\r\n\tthis.childs.push(new XMLNode({\r\n\t\ttag: \"Relationship\",\r\n\t\tattributes: [\r\n\t\t\t{\r\n\t\t\t\tname: \"Id\",\r\n\t\t\t\tvalue: id\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \"Type\",\r\n\t\t\t\tvalue: sType\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \"Target\",\r\n\t\t\t\tvalue: sTarget\r\n\t\t\t}\r\n\t\t]\r\n\t}));\r\n\r\n\treturn id;\r\n};\r\n\r\nmodule.exports = Relationships;","var ColumnConfiguration\t= require(\"../binding/ColumnConfiguration\"),\r\n\tReferenceNode\t\t= require(\"./ReferenceNode\"),\r\n\tSharedStrings\t\t= require(\"../data/SharedStrings\"),\r\n\tSheet\t\t\t\t= require(\"../data/Sheet\"),\r\n\tStyles\t\t\t\t= require(\"../style/Styles\");\r\n\r\n/**\r\n * This class represents the workbook.xml file within the generated\r\n * Office Open XML Spreadsheet. The workbook is the central element\r\n * of the Office Open XML Spreadsheet that references all the content.\r\n *\r\n * @constructor\r\n */\r\nfunction Workbook() {\r\n\tvar key;\r\n\r\n\tReferenceNode.call(this, Workbook.metadata);\r\n\r\n\t/* Create and register central Styles instance for this workbook */\r\n\tthis._styles = new Styles();\r\n\tthis._styles.setPath(this.getPath());\r\n\tthis.addRelatedFile(this._styles);\r\n\r\n\t/* Create and register central SharedStrings instance for this workbook */\r\n\tthis._sharedStrings = new SharedStrings();\r\n\tthis._sharedStrings.setPath(this.getPath());\r\n\tthis.addRelatedFile(this._sharedStrings);\r\n\r\n\tfor (key in Workbook.RELATIONS) {\r\n\t\tthis._relationships.addRelationship(Workbook.RELATIONS[key].target, Workbook.RELATIONS[key].type);\r\n\t}\r\n\r\n\tthis._registeredSheets = [];\r\n}\r\n\r\nWorkbook.prototype = Object.create(ReferenceNode.prototype);\r\nWorkbook.prototype.constructor = Workbook;\r\n\r\nWorkbook.RELATIONS = {\r\n\tsharedStrings: {\r\n\t\ttarget: \"sharedStrings.xml\",\r\n\t\ttype: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\"\r\n\t},\r\n\tstyles: {\r\n\t\ttarget: \"styles.xml\",\r\n\t\ttype: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\"\r\n\t}\r\n};\r\n\r\nWorkbook.metadata = {\r\n\tfilename: \"workbook.xml\",\r\n\tpath: \"xl/\",\r\n\ttag: \"workbook\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"r\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"mc\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n\t\t}\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\ttag: \"bookViews\",\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttag: \"workbookView\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"xWindow\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"yWindow\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"windowWidth\",\r\n\t\t\t\t\t\t\tvalue: \"22260\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"windowHeight\",\r\n\t\t\t\t\t\t\tvalue: \"12645\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"sheets\",\r\n\t\t\ttag: \"sheets\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"definedNames\",\r\n\t\t\ttag: \"definedNames\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Adds a new {@link Sheet} to this {@link Workbook}\r\n *\r\n * @param {string} sName - Name of the {@link Sheet} that is used as label in Microsoft Excel\r\n * @param {Object} oConfig - The column configuration of this Sheet\r\n * @param {Array} oConfig.columns - Array containing the configuration for each column\r\n * @param {boolean} [oConfig.bHideHeader] - Hides the header row (optional - default: false)\r\n * @returns {Sheet} - The newly added {@link Sheet}\r\n */\r\nWorkbook.prototype.addSheet = function(sName, oConfig) {\r\n\tvar oColumnConfiguration, nCount, sId, oSheet, sSheetFileName;\r\n\r\n\tnCount = this.sheets.childs.length + 1;\r\n\tsSheetFileName = \"sheet\" + nCount + \".xml\";\r\n\tsId = this._relationships.addRelationship(\"worksheets/\" + sSheetFileName,\r\n\t\t\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\");\r\n\r\n\tthis.sheets.addChild({\r\n\t\ttag: \"sheet\",\r\n\t\tattributes: [\r\n\t\t\t{\r\n\t\t\t\tid: \"name\",\r\n\t\t\t\tname: \"name\",\r\n\t\t\t\tvalue: sName\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \"sheetId\",\r\n\t\t\t\tvalue: \"\" + nCount\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: \"id\",\r\n\t\t\t\tprefix: \"r\",\r\n\t\t\t\tvalue: sId\r\n\t\t\t}\r\n\t\t]\r\n\t});\r\n\r\n\toColumnConfiguration = new ColumnConfiguration(oConfig, this._sharedStrings, this._styles);\r\n\toSheet = new Sheet(oColumnConfiguration);\r\n\toSheet.setFileName(sSheetFileName);\r\n\toSheet.setPath(this.getPath() + \"worksheets/\");\r\n\r\n\tthis.addRelatedFile(oSheet);\r\n\tthis._registeredSheets.push(oSheet);\r\n\r\n\treturn oSheet;\r\n};\r\n\r\n/**\r\n * Set the given sheet as selected. Unselects all other sheets in the workbook.\r\n *\r\n * @param {Sheet} oSheet - The Sheet object that should be selected\r\n */\r\nWorkbook.prototype.selectSheet = function(oSheet) {\r\n\r\n\tif (!(oSheet instanceof Sheet) || this._registeredSheets.indexOf(oSheet) < 0) {\r\n\t\tthrow new Error(\"Could not select sheet. Sheet not found.\");\r\n\t}\r\n\r\n\t/* Remove selection on all sheets */\r\n\tthis._registeredSheets.forEach(function(sheetElement, index, array) {\r\n\t\tsheetElement.views.defaultView.remove(\"selected\");\r\n\t});\r\n\r\n\t/* Select the particular Sheet */\r\n\toSheet.views.defaultView.addAttribute({\r\n\t\tid: \"selected\",\r\n\t\tname: \"tabSelected\",\r\n\t\tvalue: \"1\" // Refers to W3C XML Schema boolean (true)\r\n\t});\r\n};\r\n\r\n/**\r\n * Registers definedNames for sheets that use autoFilter\r\n * functionality before processing the super class serialization.\r\n *\r\n * @returns {string} - The serialized String representation of this workbook\r\n */\r\nWorkbook.prototype.serialize = function() {\r\n\tvar that = this;\r\n\r\n\t/**\r\n\t * Creates the value for the definedName. It automatically\r\n\t * retrieves the dimension of the sheet that is used by the\r\n\t * filter and escapes its representation.\r\n\t *\r\n\t * @param {string} sSheetName - The title of the sheet\r\n\t * @param {Sheet} oSheet - The sheet object containing the filter dimension\r\n\t * @returns {string} - Escaped definedName value\r\n\t * @private\r\n\t */\r\n\tfunction createDefinedName(sSheetName, oSheet) {\r\n\t\tvar sDefinedName, sDimension;\r\n\r\n\t\tsDimension = oSheet.filter.reference.value;\r\n\t\tsDefinedName = /^[a-zA-Z0-9]+$/.test(sSheetName) ? sSheetName : `'${sSheetName}'`;\r\n\t\tsDefinedName += \"!\";\r\n\t\tsDefinedName += sDimension.replace(/([A-Z]+)|(\\d+)/g, function(match) {\r\n\t\t\treturn \"$\" + match;\r\n\t\t});\r\n\r\n\t\treturn sDefinedName;\r\n\t}\r\n\r\n\t/* Create definedNames before serializing the workbook */\r\n\tthis._registeredSheets.forEach(function(oSheet, iIndex, aArray) {\r\n\t\tvar sSheetName = that.sheets.childs[iIndex].name.value;\r\n\r\n\t\tif (oSheet.filter) {\r\n\t\t\tthat.definedNames.addChild({\r\n\t\t\t\ttag: \"definedName\",\r\n\t\t\t\tattributes: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: \"name\",\r\n\t\t\t\t\t\tvalue: \"_xlnm._FilterDatabase\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: \"localSheetId\",\r\n\t\t\t\t\t\tvalue: iIndex\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: \"hidden\",\r\n\t\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t\t}\r\n\t\t\t\t],\r\n\t\t\t\tvalue: createDefinedName(sSheetName, oSheet)\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n\treturn Object.getPrototypeOf(Workbook.prototype).serialize.call(this);\r\n};\r\n\r\nmodule.exports = Workbook;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The Alignment class defines the alignment of content within the\r\n * sheet cells. The Alignment is assigned to a particular Style that\r\n * is registered in the Styles class.\r\n *\r\n * @constructor\r\n */\r\nfunction Alignment() {\r\n\tXMLNode.call(this, Alignment.metadata);\r\n}\r\n\r\nAlignment.prototype = Object.create(XMLNode.prototype);\r\nAlignment.prototype.constructor = Alignment;\r\n\r\nAlignment.metadata = {\r\n\ttag: \"alignment\"\r\n};\r\n\r\nAlignment.horizontal = {\r\n\tLEFT: \"left\",\r\n\tCENTER: \"center\",\r\n\tRIGHT: \"right\",\r\n\tcontains: function(sAlign) {\r\n\r\n\t\treturn _contains(sAlign, Alignment.horizontal);\r\n\t}\r\n};\r\n\r\nAlignment.vertical = {\r\n\tTOP: \"top\",\r\n\tMIDDLE: \"middle\",\r\n\tBOTTOM: \"bottom\",\r\n\tcontains: function(sAlign) {\r\n\r\n\t\treturn _contains(sAlign, Alignment.vertical);\r\n\t}\r\n};\r\n\r\n/**\r\n * Checks whether the requested alignment is contained or not. An\r\n * alignment that is contained can be assigned within styles. Other\r\n * alignments that are not contained are not supported and thus not\r\n * assignable. It differentiates between horizontal and vertical\r\n * alignments, depending on the aggregation that was provided.\r\n *\r\n * @param {string} sAlign - The alignment that should be checked\r\n * @param {Array} oAggregation - The aggregation the alignment might be in\r\n * @returns {boolean} - Returns true if the alignment is supported\r\n * @private\r\n */\r\nfunction _contains(sAlign, oAggregation) {\r\n\tvar key, contained = false;\r\n\r\n\tfor (key in oAggregation) {\r\n\t\tcontained = contained ? contained : oAggregation[key] === sAlign && typeof oAggregation[key] !== \"function\";\r\n\t}\r\n\r\n\treturn contained;\r\n}\r\n\r\nAlignment.prototype.isDefault = function() {\r\n\treturn this.attributes.length == 0;\r\n};\r\n\r\n/**\r\n * Assigns the given indent to this Alignment object.\r\n *\r\n * @param {number} nIndent - Numerical value used as indentation\r\n */\r\nAlignment.prototype.setIndent = function(nIndent) {\r\n\r\n\t/* Remove indent */\r\n\tif (typeof nIndent != \"number\" || nIndent <= 0) {\r\n\t\tthis.remove(\"indent\");\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis._setAlignmentAttribute(\"indent\", nIndent);\r\n\r\n\t/* A correct indent requires an explicit horizontal alignment */\r\n\tif (!this.horizontal) {\r\n\t\tthis.setHorizontalAlignment(Alignment.horizontal.LEFT);\r\n\t}\r\n};\r\n\r\n\r\n/**\r\n * Configures the wrapText attribute of the alignment which is used\r\n * for multiline text support.\r\n *\r\n * @param {boolean} bWrap - Defines if wrapping is enabled or disabled\r\n */\r\nAlignment.prototype.setWrapText = function(bWrap) {\r\n\tvar wrappingAttribute = \"wrapText\";\r\n\r\n\r\n\tif (bWrap) {\r\n\t\tthis._setAlignmentAttribute(wrappingAttribute, \"1\");\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (this[wrappingAttribute]) {\r\n\t\tthis.remove(wrappingAttribute);\r\n\t}\r\n};\r\n\r\n/**\r\n * Applies the given alignment as horizontal alignment.\r\n *\r\n * @param {string} sAlign - Horizontal alignment that gets applied\r\n */\r\nAlignment.prototype.setHorizontalAlignment = function(sAlign) {\r\n\r\n\t/* Ignore invalid values */\r\n\tif (!Alignment.horizontal.contains(sAlign)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis._setAlignmentAttribute(\"horizontal\", sAlign);\r\n};\r\n\r\n/**\r\n * Applies the given alignment as vertical alignment.\r\n *\r\n * @param {string} sAlign - Vertical alignment that gets applied\r\n */\r\nAlignment.prototype.setVerticalAlignment = function(sAlign) {\r\n\r\n\t/* Ignore invalid values */\r\n\tif (!Alignment.vertical.contains(sAlign)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis._setAlignmentAttribute(\"vertical\", sAlign);\r\n};\r\n\r\n/**\r\n * Assigns the given value as a named property on this Alignment object.\r\n *\r\n * @param {string} sId - The named property id\r\n * @param {number|string} value - Textual or numerical value\r\n * @private\r\n */\r\nAlignment.prototype._setAlignmentAttribute = function(sId, value) {\r\n\r\n\t/* Create attribute if not present */\r\n\tif (!this[sId]) {\r\n\t\tthis.addAttribute({\r\n\t\t\tid: sId,\r\n\t\t\tname: sId\r\n\t\t});\r\n\t}\r\n\r\n\tthis[sId].value = value;\r\n};\r\n\r\n/**\r\n * Access the given alignment attribute and return its value. This is a shorthand\r\n * function to access the value without having to check for the existence of the\r\n * attribute itself.\r\n *\r\n * @param {string} sId - Alignment attribute that will be returned\r\n * @return {string|number} - value of the given alignment attribute\r\n * @private\r\n */\r\nAlignment.prototype._getAlignmentAttribute = function(sId) {\r\n\treturn this[sId] && this[sId].value;\r\n};\r\n\r\nAlignment.prototype.equals = function(oAlignment) {\r\n\treturn typeof oAlignment !== \"undefined\" && oAlignment !== null\r\n\t\t&& this._getAlignmentAttribute(\"vertical\") == oAlignment._getAlignmentAttribute(\"vertical\")\r\n\t\t&& this._getAlignmentAttribute(\"horizontal\") == oAlignment._getAlignmentAttribute(\"horizontal\")\r\n\t\t&& this._getAlignmentAttribute(\"indent\") == oAlignment._getAlignmentAttribute(\"indent\")\r\n\t\t&& this._getAlignmentAttribute(\"wrapText\") == oAlignment._getAlignmentAttribute(\"wrapText\");\r\n};\r\n\r\nmodule.exports = Alignment;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * This class represents border configuration for Office Open XML Spreadsheets.\r\n * @constructor\r\n */\r\nfunction Border() {\r\n\tXMLNode.call(this, Border.metadata);\r\n}\r\n\r\nBorder.prototype = Object.create(XMLNode.prototype);\r\nBorder.prototype.constructor = Border;\r\n\r\nBorder.metadata = {\r\n\ttag: \"border\",\r\n\tproperties: [\r\n\t\t{\r\n\t\t\ttag: \"left\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"right\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"top\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"bottom\"\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"diagonal\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Checks if the current Border is equal to the given parameter.\r\n *\r\n * @param {Border} oBorder Border that get\"s compared to the current one\r\n * @return {boolean} Returns true if both Borders have the same configuration\r\n */\r\nBorder.prototype.equals = function(oBorder) {\r\n\r\n\t/**\r\n\t * Once it is a Border object we always return true because we\r\n\t * don't provide more than one border type\r\n\t */\r\n\treturn oBorder instanceof Border;\r\n};\r\n\r\nmodule.exports = Border;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * This Class represents a background fill of cells within the Office\r\n * Open Spreadsheet document. The Fill accepts a configuration object\r\n * which might have either an \"color\" or an \"type\" property.\r\n *\r\n * @param {Object} oData - Configuration object for this Fill\r\n * @param {string} [oData.color] - HEX string defining the colored fill\r\n * @param {string} [oData.type] - Color independent fill type\r\n * @constructor\r\n */\r\nfunction Fill(oData) {\r\n\tXMLNode.call(this, Fill.metadata);\r\n\r\n\tif (oData) {\r\n\t\tif (oData.color) {\r\n\t\t\tthis.setFill(oData.color);\r\n\t\t} else if (oData.type) {\r\n\t\t\tthis.setType(oData.type);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nFill.prototype = Object.create(XMLNode.prototype);\r\nFill.prototype.constructor = Fill;\r\n\r\nFill.DEFAULT_TYPE = \"none\";\r\n\r\nFill.metadata = {\r\n\ttag: \"fill\",\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"fill\",\r\n\t\t\ttag: \"patternFill\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"type\",\r\n\t\t\t\t\tname: \"patternType\",\r\n\t\t\t\t\tvalue: Fill.DEFAULT_TYPE\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Checks if the current Fill is equal to the one that was provided.\r\n *\r\n * @param {Fill} oFill - The Fill that gets compared to the current Fill\r\n * @returns {boolean} - Returns true if the compared objects are of the same type and contain the same color fill\r\n */\r\nFill.prototype.equals = function(oFill) {\r\n\tif (!(oFill instanceof Fill)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn this.getType() === oFill.getType()\r\n\t\t&& this.getFill() === oFill.getFill();\r\n};\r\n\r\n/**\r\n * Returns the color of the current Fill.\r\n *\r\n * @returns {string|null} - String containing the color HEX color of the Fill or null of no color is assigned\r\n */\r\nFill.prototype.getFill = function() {\r\n\r\n\t/* The opacity needs to be removed before returning the HEX color */\r\n\treturn this.fill.childs.length ? this.fill.color.rgb.value.substring(2) : null;\r\n};\r\n\r\nFill.prototype.setFill = function(sColor) {\r\n\tthis.reset();\r\n\r\n\tif (sColor && typeof sColor === \"string\" && /^[A-Fa-f0-9]{6}$/.test(sColor)) {\r\n\t\tthis.fill.type.value = \"solid\";\r\n\r\n\t\t/**\r\n\t\t * Apply the provided color as forground color of the\r\n\t\t * background. We add \"FF\" in front of the HEX-color\r\n\t\t * for opacity.\r\n\t\t */\r\n\t\tthis.fill.addChild({\r\n\t\t\tid: \"color\",\r\n\t\t\ttag: \"fgColor\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"rgb\",\r\n\t\t\t\t\tname: \"rgb\",\r\n\t\t\t\t\tvalue: \"FF\" + sColor\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t});\r\n\r\n\t\t/**\r\n\t\t * Add default background layer which will be used once the\r\n\t\t * foreground color uses transparency\r\n\t\t */\r\n\t\tthis.fill.addChild({\r\n\t\t\ttag: \"bgColor\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"indexed\",\r\n\t\t\t\t\tvalue: \"64\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t});\r\n\t}\r\n};\r\n\r\n/**\r\n * Returns the current Fill type.\r\n *\r\n * @returns {string} - Current Fill type\r\n */\r\nFill.prototype.getType = function() {\r\n\treturn this.fill.type.value;\r\n};\r\n\r\n/**\r\n * Assigns the given type as Fill type. The Fill will be reset to\r\n * default before the type is applied.\r\n *\r\n * @param {string} sType - Type that needs to be assigned\r\n */\r\nFill.prototype.setType = function(sType) {\r\n\tthis.reset();\r\n\r\n\tthis.fill.type.value = sType;\r\n};\r\n\r\n/**\r\n * Resets the current fill to avoid side effects that might occur\r\n * when the fill is modified.\r\n */\r\nFill.prototype.reset = function() {\r\n\tthis.fill.type.value = \"none\";\r\n\tthis.fill.childs.length = 0;\r\n};\r\n\r\nmodule.exports = Fill;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The Font class represents a Font configuration within an Office\r\n * Open XML Spreadsheet.\r\n *\r\n * @param {Object} oData - Configuration object for this Font\r\n * @param {boolean} [oData.bold] - Boolean value indicating if the Font should be bold\r\n * @param {string} [oData.name] - The name of the font that gets used by this Font object i.E. Arial, Verdana, etc.\r\n * @param {number|String} [oData.size] - The font size that is been used\r\n * @param {number} [oData.family] - The font family reference {@see getFamily}\r\n * @constructor\r\n */\r\nfunction Font(oData) {\r\n\tXMLNode.call(this, Font.metadata);\r\n\r\n\tif (oData && oData instanceof Object) {\r\n\t\tthis.setName(oData.name)\r\n\t\t\t.setSize(oData.size)\r\n\t\t\t.setFamily(oData.family)\r\n\t\t\t.setBold(!!oData.bold);\r\n\t}\r\n}\r\n\r\nFont.prototype = Object.create(XMLNode.prototype);\r\nFont.prototype.constructor = Font;\r\n\r\nFont.DEFAULT_SIZE = 11;\r\nFont.DEFAULT_NAME = \"Arial\";\r\n\r\nFont.metadata = {\r\n\ttag: \"font\",\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"size\",\r\n\t\t\ttag: \"sz\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"valueAttribute\",\r\n\t\t\t\t\tname: \"val\",\r\n\t\t\t\t\tvalue: Font.DEFAULT_SIZE\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"color\",\r\n\t\t\ttag: \"color\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"valueAttribute\",\r\n\t\t\t\t\tname: \"theme\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"name\",\r\n\t\t\ttag: \"name\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"valueAttribute\",\r\n\t\t\t\t\tname: \"val\",\r\n\t\t\t\t\tvalue: Font.DEFAULT_NAME\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"family\",\r\n\t\t\ttag: \"family\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"valueAttribute\",\r\n\t\t\t\t\tname: \"val\",\r\n\t\t\t\t\tvalue: 2\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\n/**\r\n * Checks if the current Font is equal to the given parameter.\r\n *\r\n * @param {Font} oFont - The Font to compare with\r\n * @return {boolean} - Returns true if both Font objects contain the same configuration.\r\n */\r\nFont.prototype.equals = function(oFont) {\r\n\tif (!(oFont instanceof Font)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn this.getName() == oFont.getName()\r\n\t\t&& this.getSize() == oFont.getSize()\r\n\t\t&& this.isBold() == oFont.isBold()\r\n\t\t&& this.getColor() == oFont.getColor()\r\n\t\t&& this.getFamily() == oFont.getFamily();\r\n};\r\n\r\n/**\r\n * Returns whether the Font will be displayed bold or not.\r\n *\r\n * @returns {boolean} - Returns true if the Font is bold\r\n */\r\nFont.prototype.isBold = function() {\r\n\treturn !!this.bold;\r\n};\r\n\r\n/**\r\n * Returns the size of this Font.\r\n *\r\n * @returns {number} - The size of the Font\r\n */\r\nFont.prototype.getSize = function() {\r\n\treturn this.size.valueAttribute.value;\r\n};\r\n\r\n/**\r\n * Returns the name of this Font. I.E. Arial, Calibri, etc.\r\n *\r\n * @returns {string} - The name of the Font\r\n */\r\nFont.prototype.getName = function() {\r\n\treturn this.name.valueAttribute.value;\r\n};\r\n\r\n/**\r\n * Returns the color reference of this Font.\r\n *\r\n * @returns {string} - The color as HEX string\r\n */\r\nFont.prototype.getColor = function() {\r\n\treturn this.color.valueAttribute.value;\r\n};\r\n\r\n/**\r\n * Returns the Font family reference of this Font. The reference is\r\n * defined within the Office Open XML specification.\r\n * 1 : Roman (Times New Roman, SAP-icons)\r\n * 2 : Swiss (Arial, Calibri, Segoe UI, Tahoma, Verdana)\r\n * 3 : Modern\r\n * 4 : Script\r\n * 5 : Decorative\r\n * 6-14 : Reserved for future use\r\n *\r\n * @returns {number} - The Font family ID\r\n */\r\nFont.prototype.getFamily = function() {\r\n\treturn this.family.valueAttribute.value;\r\n};\r\n\r\n/**\r\n * This method can be used to set the Font to bold or not.\r\n *\r\n * @param {boolean} bBold - A boolean value that indicates if the Font should be bold or not\r\n * @return {Font} - Returns the current Font object for chaining\r\n */\r\nFont.prototype.setBold = function(bBold) {\r\n\tvar boldProperty = \"bold\";\r\n\r\n\t/* Early return if bold status is already correct */\r\n\tif (bBold === !!this[boldProperty]) {\r\n\t\treturn this;\r\n\t}\r\n\r\n\tif (bBold) {\r\n\t\tthis.addChild({\r\n\t\t\tid: boldProperty,\r\n\t\t\ttag: \"b\"\r\n\t\t});\r\n\t} else {\r\n\t\tthis.remove(boldProperty);\r\n\t}\r\n\r\n\treturn this;\r\n};\r\n\r\n/**\r\n * This method is used to set the Font family reference for the used font.\r\n *\r\n * @see {@link getFamily}\r\n * @param {number} nFamily - Number that references the Font family\r\n * @returns {Font} - Returns the current Font object for chaining\r\n */\r\nFont.prototype.setFamily = function(nFamily) {\r\n\r\n\tif (nFamily > 0 && nFamily < 15) {\r\n\t\tthis.family.valueAttribute.value = nFamily;\r\n\t}\r\n\r\n\treturn this;\r\n};\r\n\r\n/**\r\n * Assigns the given font name to this object.\r\n *\r\n * @param {string} sName - Name of the font i.E. Arial, Calibri, etc.\r\n * @return {Font} - Returns the current Font object for chaining\r\n */\r\nFont.prototype.setName = function(sName) {\r\n\tif (sName && typeof sName === \"string\") {\r\n\t\tthis.name.valueAttribute.value = sName;\r\n\t}\r\n\r\n\t/*\r\n\t * If the font name is Calibri we need to add another child node:\r\n\t *\r\n\t *\t{\r\n\t *\t\ttag: \"scheme\",\r\n\t *\t\tattributes: [\r\n\t *\t\t\t{\r\n\t *\t\t\t\tname: \"val\",\r\n\t *\t\t\t\tvalue: \"minor\"\r\n\t *\t\t\t}\r\n\t *\t\t]\r\n\t *\t}\r\n\t */\r\n\r\n\treturn this;\r\n};\r\n\r\n/**\r\n * Assigns the given font size to this object.\r\n *\r\n * @param {number} nSize - Textual representation of the font size\r\n * @return {Font} - Returns the current Font object for chaining\r\n */\r\nFont.prototype.setSize = function(nSize) {\r\n\r\n\t/* Check preconditions */\r\n\tif (typeof nSize !== \"number\" || isNaN(nSize) || nSize < 1 || nSize > 96) {\r\n\t\tthrow new Error(`The size ${nSize} is not supported.`);\r\n\t}\r\n\r\n\tthis.size.valueAttribute.value = nSize;\r\n\r\n\treturn this;\r\n};\r\n\r\nmodule.exports = Font;","var XMLNode = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The NumberFormat class is used to store custom formatting for\r\n * numeric values. In addition to a variety of built-in formats that\r\n * cannot be used as identifier for a particular format, the user can\r\n * create up to 250 different number formats.\r\n *\r\n * (https://support.office.com/en-us/article/Excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3)\r\n *\r\n * @param {Object} oData Configuration object that is used for initialization\r\n * @param {string} oData.format Custom format that will be applied\r\n * @constructor\r\n */\r\nfunction NumberFormat(oData) {\r\n\tXMLNode.call(this, NumberFormat.metadata);\r\n\r\n\tthis.format.value = oData && oData.format ? oData.format : NumberFormat.DEFAULT;\r\n}\r\n\r\nNumberFormat.prototype = Object.create(XMLNode.prototype);\r\nNumberFormat.prototype.constructor = NumberFormat;\r\n\r\nNumberFormat.metadata = {\r\n\ttag: \"numFmt\",\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tid: \"formatId\",\r\n\t\t\tname: \"numFmtId\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"format\",\r\n\t\t\tname: \"formatCode\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\nNumberFormat.BUILTIN_IDS = [ 0, 1, 2, 3, 4, 9, 10, 11, 12, 13, 14, 15,\r\n\t16, 17, 18, 19, 20, 21, 22, 37, 38, 39, 40, 45, 46, 47, 48, 49 ];\r\nNumberFormat.ID_OFFSET = 164;\r\nNumberFormat.DEFAULT = \"#,##0.00\";\r\n\r\n/**\r\n * This method returns the ID of this NumberFormat. If there was no\r\n * ID assigned yet, it will return undefined.\r\n *\r\n * @returns {number} The ID of this NumberFormat\r\n */\r\nNumberFormat.prototype.getId = function() {\r\n\treturn this.formatId.value;\r\n};\r\n\r\n\r\n/**\r\n * Returns the format of this NumberFormat as a string.\r\n *\r\n * @returns {string} The format template that gets applied\r\n */\r\nNumberFormat.prototype.getFormat = function() {\r\n\treturn this.format.value;\r\n};\r\n\r\n\r\n/**\r\n * Assigns the provided ID to the current NumberFormat.\r\n *\r\n * @param {number|string} sId The ID of this NumberFormat that can be referenced\r\n */\r\nNumberFormat.prototype.setId = function(sId) {\r\n\tvar iId = typeof sId === \"number\" ? sId : parseInt(sId, 10);\r\n\r\n\t/* Checks if NaN, below zero or builtin ID */\r\n\tif (isNaN(iId) || iId < 0 || NumberFormat._isBuiltin(iId)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis.formatId.value = sId;\r\n};\r\n\r\n\r\n/**\r\n * Sets a specific format.\r\n *\r\n * @param {string} sFormat The format that gets applied by this NumberFormat\r\n */\r\nNumberFormat.prototype.setFormat = function(sFormat) {\r\n\tthis.format.value = sFormat;\r\n};\r\n\r\n\r\n/**\r\n * Checks if a given ID is a builtin ID or not. Builtin IDs cannot be used for custom NumberFormats.\r\n *\r\n * @param {number} iId ID that needs to be checked if it is a builtin ID\r\n *\r\n * @returns {boolean} Returns true if the provided ID is a builtin ID that cannot be used\r\n * @private\r\n */\r\nNumberFormat._isBuiltin = function(iId) {\r\n\treturn NumberFormat.BUILTIN_IDS.indexOf(iId) > -1;\r\n};\r\n\r\n\r\n/**\r\n * Compares another NumberFormat to the current one. This method will\r\n * match NumberFormat objects by its format regardless of their ID.\r\n *\r\n * @param {NumberFormat} oNumberFormat The NumberFormat to compare with\r\n * @returns {boolean} Returns true if the format template is equal to the one from the compared object\r\n */\r\nNumberFormat.prototype.equals = function(oNumberFormat) {\r\n\tif (!(oNumberFormat instanceof NumberFormat)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn this.getFormat() === oNumberFormat.getFormat();\r\n};\r\n\r\nmodule.exports = NumberFormat;","var XMLNode = require(\"../xml/XMLNode\");\r\nvar Alignment = require(\"./Alignment\");\r\n\r\n/**\r\n * Represents a particular Style within the Office Open XML Spreadsheet.\r\n * Instances of this type will be created by the Styles Class after\r\n * registering a new Style.\r\n *\r\n * @constructor\r\n */\r\nfunction Style() {\r\n\tXMLNode.call(this, Style.metadata);\r\n}\r\n\r\nStyle.prototype = Object.create(XMLNode.prototype);\r\nStyle.prototype.constructor = Style;\r\n\r\nStyle.metadata = {\r\n\ttag: \"xf\",\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tid: \"numberFormat\",\r\n\t\t\tname: \"numFmtId\",\r\n\t\t\tvalue: \"0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"font\",\r\n\t\t\tname: \"fontId\",\r\n\t\t\tvalue: \"0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"fill\",\r\n\t\t\tname: \"fillId\",\r\n\t\t\tvalue: \"0\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"border\",\r\n\t\t\tname: \"borderId\",\r\n\t\t\tvalue: \"0\"\r\n\t\t}\r\n\t]\r\n};\r\n\r\nStyle.DEFAULT = {\r\n\tfont: {\r\n\t\tname: \"Arial\",\r\n\t\tsize: 11,\r\n\t\tfamily: \"2\",\r\n\t\tcolor: \"1\",\r\n\t\tbold: false\r\n\t},\r\n\tfill: {\r\n\t\ttype: \"none\"\r\n\t}\r\n};\r\n\r\nStyle.prototype.getAlignment = function() {\r\n\treturn this.alignment ? this.alignment : null;\r\n};\r\n\r\nStyle.prototype.getFontId = function() {\r\n\treturn this.font.value;\r\n};\r\n\r\nStyle.prototype.getFillId = function() {\r\n\treturn this.fill.value;\r\n};\r\n\r\nStyle.prototype.getBorderId = function() {\r\n\treturn this.border.value;\r\n};\r\n\r\nStyle.prototype.getNumberFormatId = function() {\r\n\treturn this.numberFormat.value;\r\n};\r\n\r\nStyle.prototype.hasQuotePrefix = function() {\r\n\treturn \"quotePrefix\" in this;\r\n};\r\n\r\n/**\r\n * Applies the alignment to the Style. The alignment must match the\r\n * predefined options of <code>Alignment</code> as far as it is not\r\n * null. Other values will be ignored.\r\n *\r\n * The value <code>null</code> will delete the current alignment.\r\n *\r\n * @param {Object} oAlign Alignment configuration that gets applied or null\r\n * @param {string} [oAlign.horizontal] Horizontal alignment\r\n * @param {string} [oAlign.vertical] Vertical alignment\r\n * @param {number} [oAlign.indent] Cell indentation\r\n */\r\nStyle.prototype.setAlignment = function(oAlign) {\r\n\tvar alignment, alignProperty;\r\n\r\n\talignProperty = \"alignment\";\r\n\r\n\t// Removes the applyAlignment automatically when sAlign is null\r\n\tthis._apply(oAlign, \"Alignment\");\r\n\r\n\tif (typeof oAlign === \"undefined\" || oAlign === null) {\r\n\t\tthis.remove(alignProperty);\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (!(alignProperty in this)) {\r\n\t\talignment = new Alignment();\r\n\r\n\t\tthis.addChild(alignment);\r\n\t\tObject.defineProperty(this, alignProperty, {value: alignment, writable: false, configurable: true});\r\n\t}\r\n\r\n\tthis[alignProperty].setHorizontalAlignment(oAlign.horizontal);\r\n\tthis[alignProperty].setVerticalAlignment(oAlign.vertical);\r\n\tthis[alignProperty].setWrapText(oAlign.wrap);\r\n\tthis[alignProperty].setIndent(oAlign.indent);\r\n};\r\n\r\nStyle.prototype.setFontId = function(nFontId) {\r\n\tthis._apply(nFontId, \"Font\");\r\n\r\n\tthis.font.value = nFontId;\r\n};\r\n\r\nStyle.prototype.setFillId = function(nFillId) {\r\n\tthis._apply(nFillId, \"Fill\");\r\n\r\n\tthis.fill.value = nFillId;\r\n};\r\n\r\nStyle.prototype.setBorderId = function(sBorderId) {\r\n\tthis.border.value = sBorderId;\r\n};\r\n\r\nStyle.prototype.setNumberFormatId = function(nNumFmtId) {\r\n\tthis._apply(nNumFmtId, \"NumberFormat\");\r\n\r\n\tthis.numberFormat.value = nNumFmtId;\r\n};\r\n\r\nStyle.prototype.setQuotePrefix = function(bQuotePrefix) {\r\n\tvar sAttributeName = \"quotePrefix\";\r\n\r\n\tif (bQuotePrefix && !this.hasQuotePrefix()) {\r\n\t\tthis.addAttribute({\r\n\t\t\tid: sAttributeName,\r\n\t\t\tname: sAttributeName,\r\n\t\t\tvalue: \"1\"\r\n\t\t});\r\n\t} else if (!bQuotePrefix && this.hasQuotePrefix()) {\r\n\t\tthis.remove(sAttributeName);\r\n\t}\r\n};\r\n\r\nStyle.prototype._apply = function(nId, sType) {\r\n\tvar applyProperty = \"apply\" + sType;\r\n\r\n\tthis.remove(applyProperty);\r\n\r\n\tif (nId) {\r\n\t\tthis.addAttribute({\r\n\t\t\tid: applyProperty,\r\n\t\t\tname: applyProperty,\r\n\t\t\tvalue: \"1\"\r\n\t\t});\r\n\t}\r\n};\r\n\r\nStyle.prototype.equals = function(oStyle) {\r\n\tif (!(oStyle instanceof Style)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn this.getFontId() === oStyle.getFontId()\r\n\t\t&& this.getFillId() === oStyle.getFillId()\r\n\t\t&& this.getBorderId() === oStyle.getBorderId()\r\n\t\t&& this.getNumberFormatId() === oStyle.getNumberFormatId()\r\n\t\t&& this.hasQuotePrefix() === oStyle.hasQuotePrefix()\r\n\t\t&& ( (!this.alignment && !oStyle.alignment) || (this.alignment && this.alignment.equals(oStyle.alignment)) );\r\n};\r\n\r\nmodule.exports = Style;","var XMLFile\t\t\t= require(\"../xml/XMLFile\"),\r\n\tStyle\t\t\t= require(\"./Style\"),\r\n\tFont\t\t\t= require(\"./Font\"),\r\n\tFill\t\t\t= require(\"./Fill\"),\r\n\tBorder\t\t\t= require(\"./Border\"),\r\n\tNumberFormat\t= require(\"./NumberFormat\");\r\n\r\n/**\r\n *\r\n * @class\r\n * @module style/Styles\r\n */\r\nfunction Styles() {\r\n\tXMLFile.call(this, Styles.metadata);\r\n\r\n\t/* Microsoft Excel fix - specific fill that needs to be present */\r\n\tthis.addFill({ type: \"none\" }); // Add a default fill at index 0\r\n\tthis.addFill({ type: \"gray125\" }); // Needs to have index 1\r\n\tthis.addStyle(Style.DEFAULT); // Apply base style to feed the hard-coded cellStyles and cellStyleXfs\r\n}\r\n\r\nStyles.prototype = Object.create(XMLFile.prototype);\r\nStyles.prototype.constructor = Styles;\r\n\r\nStyles.metadata = {\r\n\tfilename: \"styles.xml\",\r\n\ttag: \"styleSheet\",\r\n\troot: true,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"mc\",\r\n\t\t\tvalue: \"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t,\r\n\t\t{\r\n\t\t\tname: \"mc\",\r\n\t\t\tsuffix: \"Ignorable\",\r\n\t\t\tvalue: \"x14ac x16r2 xr\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"x14ac\",\r\n\t\t\tvalue: \"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"x16r2\",\r\n\t\t\tvalue: \"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main\"\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: \"xmlns\",\r\n\t\t\tsuffix: \"xr\",\r\n\t\t\tvalue: \"http://schemas.microsoft.com/office/spreadsheetml/2014/revision\"\r\n\t\t}\r\n\t\t*/\r\n\t],\r\n\tproperties: [\r\n\t\t{\r\n\t\t\tid: \"numberFormats\",\r\n\t\t\ttag: \"numFmts\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"fonts\",\r\n\t\t\ttag: \"fonts\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"fills\",\r\n\t\t\ttag: \"fills\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"borders\",\r\n\t\t\ttag: \"borders\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"cellStyleXfs\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttag: \"xf\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"numFmtId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"fontId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"fillId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"borderId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: \"cellXfs\",\r\n\t\t\ttag: \"cellXfs\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"count\",\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"cellStyles\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: \"1\"\r\n\t\t\t\t}\r\n\t\t\t],\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\ttag: \"cellStyle\",\r\n\t\t\t\t\tattributes: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"name\",\r\n\t\t\t\t\t\t\tvalue: \"Normal\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"xfId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tname: \"builtinId\",\r\n\t\t\t\t\t\t\tvalue: \"0\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"dxfs\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\ttag: \"tableStyles\",\r\n\t\t\tattributes: [\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"count\",\r\n\t\t\t\t\tvalue: 0\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"defaultTableStyle\",\r\n\t\t\t\t\tvalue: \"TableStyleMedium2\"\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tname: \"defaultPivotStyle\",\r\n\t\t\t\t\tvalue: \"PivotStyleLight16\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n};\r\n\r\n\r\n/**\r\n * Adds the specified Style to the Styles class according to the\r\n * Style configuration. The method will return a Style object that\r\n * references Font, Fill, Border and an optional NumberFormat. If\r\n * some of the referenced Font, Fill, Border or NumberFormat objects\r\n * are not present yet, it will create them automatically, otherwise\r\n * it will re-use existing ones.\r\n *\r\n * The method ensures that particular Style combinations exist only\r\n * once and there are no duplicates.\r\n *\r\n * @param {Object} oData Configuration object that defines the Style information\r\n * @param {Object} [oData.font] Configuration object that defines the Font information\r\n * @param {string} [oData.font.name] Name of the used Font i.E. \"Arial\"\r\n * @param {string} [oData.font.size] Preferred Font size i.E. \"12\"\r\n * @param {boolean} [oData.font.bold] Defines the Font weight\r\n * @param {Object} [oData.fill] Configuration object that defines the Fill information\r\n * @param {string} [oData.fill.color] HEX string defining the color of the cell fill\r\n * @param {string} [oData.fill.type] Defines the type of the fill i.E. \"none\" or \"solid\"\r\n * @param {Object} [oData.border] Configuration object that defines the Border information\r\n * @param {Object|number} [oData.numberFormat] Configuration object that defines the NumberFormat information\r\n * @param {string} [oData.numberFormat.format] Formatting template that will be used\r\n * @param {Object} [oData.align] Defines the text alignment within the cell\r\n * @param {string} [oData.align.horizontal] Horizontal alignment\r\n * @param {string} [oData.align.vertical] Vertical alignment\r\n * @param {number} [oData.align.indent] Cell indentation\r\n * @param {boolean} [oData.quotePrefix] Defines whether the style configuration should add a quotePrefix attribute\r\n * @returns {number} The ID of the unique Style object that needs to be referenced\r\n */\r\nStyles.prototype.addStyle = function(oData) {\r\n\tvar style, fontId, fillId, borderId, numberFormatId;\r\n\r\n\t/* Add Font, Fill, Border and NumberFormat if needed */\r\n\tfontId = this.addFont(oData.font);\r\n\tfillId = this.addFill(oData.fill);\r\n\tborderId = this.addBorder(oData.border);\r\n\r\n\t/* Fallback to avoid custom NumberFormats that won't be used if oData.numberFormat is undefined */\r\n\tif (typeof oData.numberFormat === \"undefined\") {\r\n\t\toData.numberFormat = 0;\r\n\t}\r\n\r\n\tnumberFormatId =\r\n\t\tNumberFormat._isBuiltin(oData.numberFormat) ? oData.numberFormat : this.addNumberFormat(oData.numberFormat);\r\n\r\n\t/* Create temporary Style */\r\n\tstyle = new Style();\r\n\r\n\tstyle.setFontId(fontId);\r\n\tstyle.setFillId(fillId);\r\n\tstyle.getBorderId(borderId);\r\n\tstyle.setNumberFormatId(numberFormatId);\r\n\tstyle.setAlignment(oData.align);\r\n\tstyle.setQuotePrefix(oData.quotePrefix);\r\n\r\n\t/* Add Style if not already present */\r\n\treturn this._addToAggregation(style, this.cellXfs);\r\n};\r\n\r\n\r\n/**\r\n * Adds the specific item to the provided aggregation. This Method\r\n * should only be called by the library itself due to possible\r\n * failures. It automatically updates the count within the XML\r\n * representation of this aggregation.\r\n *\r\n * This method should only be used for Font, Fill, Border or\r\n * NumberFormat objects.\r\n *\r\n * @param {Font|Fill|Border|NumberFormat|Style} oNewItem The item that needs to be appended to the aggregation\r\n * @param {Array} aAggregation An array that represents the aggregation\r\n * @returns {number} The zero-based index of the element after it was inserted\r\n * @private\r\n */\r\nStyles.prototype._addToAggregation = function(oNewItem, aAggregation) {\r\n\tvar count, i;\r\n\r\n\ti = -1;\r\n\r\n\taAggregation.childs.forEach(function(existingItem, index, array) {\r\n\t\tif (existingItem.equals(oNewItem)) {\r\n\t\t\ti = index;\r\n\t\t}\r\n\t});\r\n\r\n\tif (i === -1) {\r\n\t\taAggregation.addChild(oNewItem);\r\n\t\tcount = aAggregation.childs.length;\r\n\r\n\t\taAggregation.count.value = count;\r\n\t\ti = count - 1;\r\n\t}\r\n\r\n\treturn i;\r\n};\r\n\r\n\r\n/**\r\n * This method adds a RGB color to the Styles collection that is\r\n * referenced by several Styles.\r\n *\r\n * If this particular color is already present, it will not add it a\r\n * second time.\r\n *\r\n * @param {string} sHexColor HEX string representing a RGB color\r\n */\r\nStyles.prototype.addColor = function(sHexColor) {\r\n\tvar alreadyPresent;\r\n\r\n\tif (!this.colors) {\r\n\t\tthis.addChild({\r\n\t\t\tid: \"colors\",\r\n\t\t\ttag: \"colors\",\r\n\t\t\tproperties: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: \"mru\",\r\n\t\t\t\t\ttag: \"mruColors\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t});\r\n\t}\r\n\r\n\talreadyPresent = this.colors.mru.childs.some(function(color) {\r\n\t\treturn color.rgb.value === \"FF\" + sHexColor;\r\n\t});\r\n\r\n\tif (alreadyPresent) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tthis.colors.mru.addChild({\r\n\t\ttag: \"color\",\r\n\t\tattributes: [\r\n\t\t\t{\r\n\t\t\t\tid: \"rgb\",\r\n\t\t\t\tname: \"rgb\",\r\n\t\t\t\tvalue: \"FF\" + sHexColor\r\n\t\t\t}\r\n\t\t]\r\n\t});\r\n};\r\n\r\n\r\n/**\r\n * This method adds a Font to the Styles collection that can be\r\n * referenced by several Styles. The Font is instantiated according\r\n * to the provided configuration object.\r\n *\r\n * If this particular Font is already present, it will not add it a\r\n * second time. This ensures that each referenced Font is unique\r\n * according to the criteria of Font#equals.\r\n *\r\n * The method returns the index which deals as an identifier for this\r\n * Font.\r\n *\r\n * @param {Object} oData Configuration object for this Font\r\n * @returns {number} The index of this Font used for reference by Style objects\r\n */\r\nStyles.prototype.addFont = function(oData) {\r\n\tvar oFont = new Font(oData);\r\n\r\n\treturn this._addToAggregation(oFont, this.fonts);\r\n};\r\n\r\n\r\n/**\r\n * This method adds a Fill to the Styles collection that can be\r\n * referenced by several Styles. The Fill is instantiated according\r\n * to the provided configuration object.\r\n *\r\n * If this particular Fill is already present, it will not add it a\r\n * second time. This ensures that each referenced Fill is unique\r\n * according to the criteria of Fill#equals.\r\n *\r\n * The method returns the index which deals as an identifier for this\r\n * Fill.\r\n *\r\n * @param {Object} oData Configuration object for this Fill\r\n * @returns {number} The index of this Fill used for reference by Style objects\r\n */\r\nStyles.prototype.addFill = function(oData) {\r\n\tvar index, oFill;\r\n\r\n\toFill = new Fill(oData);\r\n\r\n\tindex = this._addToAggregation(oFill, this.fills);\r\n\r\n\tif (oFill.getFill() !== null) {\r\n\t\tthis.addColor(oFill.getFill());\r\n\t}\r\n\r\n\treturn index;\r\n};\r\n\r\n\r\n/**\r\n * This method adds a Border to the Styles collection that can be\r\n * referenced by several Styles. The Border is instantiated according\r\n * to the provided configuration object.\r\n *\r\n * If this particular Border is already present, it will not add it a\r\n * second time. This ensures that each referenced Border is unique\r\n * according to the criteria of Border#equals.\r\n *\r\n * The method returns the index which deals as an identifier for this\r\n * Border.\r\n *\r\n * @param {Object} oData Configuration object for this Border\r\n * @returns {number} The index of this Border used for reference by Style objects\r\n */\r\nStyles.prototype.addBorder = function(oData) {\r\n\tvar oBorder = new Border(oData);\r\n\r\n\treturn this._addToAggregation(oBorder, this.borders);\r\n};\r\n\r\n\r\n/**\r\n * This method adds a NumberFormat to the Styles collection that can\r\n * be referenced by several Styles. The NumberFormat is instantiated\r\n * according to the provided configuration object.\r\n *\r\n * If this particular NumberFormat is already present, it will not\r\n * add it a second time. This ensures that each referenced\r\n * NumberFormat is unique according to the criteria of\r\n * NumberFormat#equals.\r\n *\r\n * The method returns the index which deals as an identifier for this\r\n * NumberFormat.\r\n *\r\n * @param {Object} oData Configuration object for this NumberFormat\r\n * @returns {number} The index of this NumberFormat used for reference by Style objects\r\n */\r\nStyles.prototype.addNumberFormat = function(oData) {\r\n\tvar index, numberFormat;\r\n\r\n\tnumberFormat = new NumberFormat(oData);\r\n\tindex = this._addToAggregation(numberFormat, this.numberFormats);\r\n\r\n\tnumberFormat.setId(NumberFormat.ID_OFFSET + index);\r\n\r\n\treturn numberFormat.getId();\r\n};\r\n\r\nmodule.exports = Styles;","var XMLElement = require(\"./XMLElement\");\r\n\r\n/**\r\n * The class XMLAttribute is a wrapper for representing XML-like attributes attributes.\r\n * It is mainly used for defining namespaces and namespace-related attributes.\r\n *\r\n * @param {object} oConfig Object representation of the XMLNode containing at least the tag of the element.\r\n * @param {string} oConfig.name String representation of the XML tag.\r\n * @param {string} [oConfig.prefix] Prefix of the {@link XMLAttribute} that will be used for XML namespace purposes.\r\n * @param {string} [oConfig.suffix] Suffix of the {@link XMLAttribute} that will be used for XML namespace purposes.\r\n * @param {string} [oConfig.value] Textual value of the {@link XMLAttribute}.\r\n * @class\r\n * @module xml/XMLAttribute\r\n */\r\nfunction XMLAttribute(oConfig) {\r\n\tXMLElement.call(this, oConfig);\r\n\r\n\tthis.name = oConfig.name ? oConfig.name : \"\";\r\n\tthis.prefix = oConfig.prefix ? oConfig.prefix : \"\";\r\n\tthis.suffix = oConfig.suffix ? oConfig.suffix : \"\";\r\n}\r\n\r\nXMLAttribute.prototype = Object.create(XMLElement.prototype);\r\nXMLAttribute.prototype.constructor = XMLAttribute;\r\n\r\n/**\r\n * Performes a String serialization of the XMLAttribute. The representation is formatted as follows:\r\n * <prefix>:<name>:<suffix>=\"<value>\"\r\n *\r\n * i.E. xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n * for { name: \"xmlns\", suffix: \"xsi\", value: \"http://www.w3.org/2001/XMLSchema-instance\" }\r\n *\r\n * Note that the serialized String always comes with a leading whitespace to allow easy concatenation.\r\n *\r\n * @function serialize\r\n * @returns {string} String representation of the XMLAttribute\r\n */\r\nXMLAttribute.prototype.serialize = function() {\r\n\t// eslint-disable-next-line max-len\r\n\treturn ` ${this.prefix ? this.prefix + \":\" : \"\"}${this.name}${this.suffix ? \":\" + this.suffix : \"\"}=\"${this.xmlEncode(this.value)}\"`;\r\n};\r\n\r\nmodule.exports = XMLAttribute;","/**\r\n * The XMLElement is an abstract base class that can store a\r\n * particular value and escape XML specific characters.\r\n *\r\n * @param {Object} oConfig - Configuration object that contains the value of this XML Element\r\n * @constructor\r\n * @abstract\r\n */\r\nfunction XMLElement(oConfig) {\r\n\tthis.value = oConfig && (oConfig.value || typeof oConfig.value === \"number\") ? oConfig.value : \"\";\r\n}\r\n\r\n/**\r\n * Escapes the given String value to fulfill the requirements of\r\n * XML encoded characters. If the String does not contain any\r\n * character that needs to be encoded, the original String will\r\n * be returned.\r\n *\r\n * This significantly increases the performance because the\r\n * initial regular expression match is much faster than the\r\n * String replace function. We assume that only a few Strings\r\n * need to be encoded.\r\n *\r\n * The following characters need to be encoded:\r\n * < (lower than)\r\n * > (greater than)\r\n * \" (quotes)\r\n * & (ampersand)\r\n *\r\n * @param {string} sValue - The value that needs to be XML encoded\r\n * @returns {string} - XML encoded String\r\n */\r\nXMLElement.prototype.xmlEncode = function(sValue) {\r\n\treturn typeof sValue === \"string\" && sValue.match(/[><\"&]+/) !== null ? this._replace(sValue) : sValue;\r\n};\r\n\r\n/**\r\n * @see _xmlEncode\r\n * @param {string} sValue - The string that contains characters that needs to be replaced\r\n * @returns {string} - XML encoded String\r\n * @private\r\n */\r\nXMLElement.prototype._replace = function(sValue) {\r\n\r\n\t/**\r\n\t * Perform ampersand replacement first to avoid encoding the\r\n\t * control ampersand of other encoded characters.\r\n\t *\r\n\t * i.E. >& should be encoded as >& instead of &gt;&\r\n\t */\r\n\treturn sValue\r\n\t\t.replace(/&/g, \"&\")\r\n\t\t.replace(/</g, \"<\")\r\n\t\t.replace(/>/g, \">\")\r\n\t\t.replace(/\"/g, \""\");\r\n};\r\n\r\nmodule.exports = XMLElement;","var XMLNode\t\t = require(\"../xml/XMLNode\");\r\n\r\n/**\r\n * The XMLFile class is a subclass of XMLNode that enriches the\r\n * object by path and file name information.\r\n *\r\n * @param {Object} oConfig - The configuration object for this XMLFile\r\n * @param {string} oConfig.path - The relative path of this XMLFile\r\n * @param {string} oConfig.filename - The file name of this XMLFile\r\n * @class\r\n */\r\nfunction XMLFile(oConfig) {\r\n\tXMLNode.call(this, oConfig);\r\n\r\n\tthis._filename = oConfig.filename;\r\n\tthis._path = oConfig.path;\r\n}\r\n\r\nXMLFile.prototype = Object.create(XMLNode.prototype);\r\nXMLFile.prototype.constructor = XMLFile;\r\n\r\n/**\r\n * Returns the name of this particular file including its file extension.\r\n *\r\n * @returns {string} Name of the file\r\n */\r\nXMLFile.prototype.getFileName = function() {\r\n\treturn this._filename;\r\n};\r\n\r\n/**\r\n * Assigns the given string as name of the file. The name must contain a file extension.\r\n *\r\n * @param {string} sFileName - Name of the file\r\n */\r\nXMLFile.prototype.setFileName = function(sFileName) {\r\n\r\n\tif (!sFileName.match(/^\\S+\\.\\S{3,4}$/)) {\r\n\t\tthrow new Error(\"Invalid file name: \" + sFileName);\r\n\t}\r\n\r\n\tthis._filename = sFileName;\r\n};\r\n\r\n/**\r\n * Returns the path of the file without any filename.\r\n *\r\n * @returns {string} - Path of the file\r\n */\r\nXMLFile.prototype.getPath = function() {\r\n\treturn this._path;\r\n};\r\n\r\n/**\r\n * Returns the absolute Path to the file.\r\n *\r\n * @returns {string} - Absolute path including the filename\r\n */\r\nXMLFile.prototype.getAbsolutePath = function() {\r\n\treturn this.getPath() + this.getFileName();\r\n};\r\n\r\n/**\r\n * Assigns the given path to this XMLFile. The path needs to end with\r\n * a slash to match the criteria.\r\n *\r\n * @param {string} sPath - Relative path of this XMLFile\r\n */\r\nXMLFile.prototype.setPath = function(sPath) {\r\n\r\n\t/* IE compatible endsWith */\r\n\tif (!sPath || sPath.lastIndexOf(\"/\") !== (sPath.length - 1)) {\r\n\t\tthrow new Error(\"Invalid file path: \" + sPath);\r\n\t}\r\n\r\n\tthis._path = sPath;\r\n};\r\n\r\n/**\r\n * Performs a serialization of this XMLFile based on the XMLNode#serialize\r\n * implementation. The optional parameter allows to finalize this XMLFile\r\n * so that all aggregations will be cleared and the cleanup hook\r\n * XMLFile#cleanup will be executed. The aggregations will be cleared\r\n * outside of the cleanup function. This will ensure proper cleanup\r\n * even is the subclass is not calling the super class function.\r\n *\r\n * @param {boolean} [bFinalize]\r\n * Forces the XMLFile to destroy its aggregations. It will call the\r\n * cleanup function of the instance. This can be used as a hook for\r\n * subclasses that inherit from XMLFile. This frees additional memory\r\n * but should be used with caution because after serialization all\r\n * content will be lost.\r\n *\r\n * @returns {string} The serialized XMLFile\r\n *\r\n * @Overrides XMLNode#serialize\r\n */\r\nXMLFile.prototype.serialize = function(bFinalize) {\r\n\tconst sSerializedString = Object.getPrototypeOf(XMLFile.prototype).serialize.call(this);\r\n\r\n\tif (bFinalize) {\r\n\t\tthis.childs.length = 0;\r\n\r\n\t\tthis.cleanup();\r\n\t}\r\n\r\n\treturn sSerializedString;\r\n};\r\n\r\n/**\r\n * Abstract function that can be overridden as a cleanup hook.\r\n * @abstract\r\n */\r\nXMLFile.prototype.cleanup = function() {\r\n\r\n\t/* Do nothing */\r\n};\r\n\r\nmodule.exports = XMLFile;","var XMLElement = require(\"./XMLElement\");\r\nvar XMLAttribute = require(\"./XMLAttribute\");\r\n\r\n/**\r\n * JSON representation of XML nodes. Each node has a tag an can have multiple {@link XMLAttribute} entries assigned.\r\n * It can also have multiple child {@link XMLNode} elements assigned. The node can contain a value.\r\n *\r\n * @param {object|string} oConfig - Object representation of the XMLNode containing at least the tag of the element.\r\n * @param {string} oConfig.tag - String representation of the XML tag.\r\n * @param {object[]} [oConfig.attributes] - Aggregation for adding {@link XMLAttributes} to the current node.\r\n * @param {object[]} [oConfig.properties] - Aggregation for adding {@link XMLNode} objects as child objects to this node\r\n * @param {string} [oConfig.value] - String value inside the XML tag.\r\n * @class\r\n * @module xml/XMLNode\r\n */\r\nfunction XMLNode(oConfig) {\r\n\tXMLElement.call(this, oConfig);\r\n\r\n\t/* Shorthand functionality to simply assign the XMLNode tag name instead of a configuration object */\r\n\tconst config = typeof oConfig === \"string\" ? {tag: oConfig} : oConfig;\r\n\r\n\tObject.defineProperty(this, \"root\", {value: !!config.root, writable: false});\r\n\tthis.tag = typeof config.tag == \"string\" ? config.tag : \"\";\r\n\tthis.attributes = [];\r\n\tthis.childs = [];\r\n\r\n\t/* Initialize the XML node by filling the aggregations if present */\r\n\tif (config.attributes) {\r\n\t\tfor (let i = 0; i < config.attributes.length; i++) {\r\n\t\t\tthis.addAttribute(config.attributes[i]);\r\n\t\t}\r\n\t}\r\n\r\n\tif (config.properties) {\r\n\t\tfor (let j = 0; j < config.properties.length; j++) {\r\n\t\t\tthis.addChild(config.properties[j]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nXMLNode.prototype = Object.create(XMLElement.prototype);\r\nXMLNode.prototype.constructor = XMLNode;\r\n\r\nXMLNode.processingInformation = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\r\n\r\n\r\n/**\r\n * Adds the provided XMLAttribute object to the XMLNode.\r\n * If no XMLAttribute is provided it will create one instead.\r\n * The method returns the XMLAttribute for chaining.\r\n *\r\n * @function addAttribute\r\n * @param {Object} oConfig - XMLAttribute or configuration object that represents a XMLAttribute\r\n * @returns {Object} - An instance of XMLAttribute that was added to this node\r\n */\r\nXMLNode.prototype.addAttribute = function(oConfig) {\r\n\tconst attribute = oConfig instanceof XMLAttribute ? oConfig : new XMLAttribute(oConfig);\r\n\r\n\tthis.attributes.push(attribute);\r\n\r\n\tif (oConfig.id) {\r\n\t\tObject.defineProperty(this, oConfig.id, {value: attribute, writable: false, configurable: true});\r\n\t}\r\n\r\n\treturn attribute;\r\n};\r\n\r\n\r\n/**\r\n * Adds the provided XMLNode object as child to the current XMLNode.\r\n * If no XMLNode is provided it will create one instead.\r\n * The method returns the XMLNode for chaining.\r\n *\r\n * @function addChild\r\n * @param {Object} oConfig - XMLNode or configuration object that represents a XMLNode\r\n * @returns {object} - An instance of XMLNode that was added to this node\r\n */\r\nXMLNode.prototype.addChild = function(oConfig) {\r\n\r\n\t/* Additional Attributes of the child node will be added in the Constructor */\r\n\tconst node = oConfig instanceof XMLNode ? oConfig : new XMLNode(oConfig);\r\n\r\n\tthis.childs.push(node);\r\n\r\n\tif (oConfig.id) {\r\n\t\tObject.defineProperty(this, oConfig.id, {value: node, writable: false, configurable: true});\r\n\t}\r\n\r\n\treturn node;\r\n};\r\n\r\n\r\n/**\r\n * Removes the property from this object and also deletes the\r\n * referenced item within the child nodes or attributes\r\n * aggregation.\r\n *\r\n * The method returns the previously referenced object or null if\r\n * the property name is not present on this particular XMLNode or\r\n * if no item is referenced.\r\n *\r\n * Builtin properties of XMLNode cannot be removed with this\r\n * function. These are \"root\", \"tag\", \"attributes\", \"childs\",\r\n * \"value\".\r\n *\r\n * @param {string} sProperty - Name of the property that should be removed\r\n * @returns {XMLNode|XMLAttribute|null} - The referenced object that gets removed as well\r\n */\r\nXMLNode.prototype.remove = function(sProperty) {\r\n\r\n\t/* Only proceed if property is present */\r\n\tif (!(sProperty in this)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet aAggregation;\r\n\tconst referencedElement = this[sProperty];\r\n\r\n\t/* Check if referenced element is a XMLAttribute */\r\n\tif (referencedElement instanceof XMLAttribute) {\r\n\t\taAggregation = this.attributes;\r\n\t} else if (referencedElement instanceof XMLNode && !(sProperty in new XMLNode(\"\"))) {\r\n\t\taAggregation = this.childs;\r\n\t} else {\r\n\r\n\t\t/* Early return if referenced element is neither an XMLAttribute nor XMLNode */\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst index = aAggregation.indexOf(referencedElement);\r\n\r\n\taAggregation.splice(index, 1); // It is ensured that index > -1 otherwise #addChild or #addAttribute fail\r\n\tdelete this[sProperty];\r\n\r\n\treturn referencedElement;\r\n};\r\n\r\n/**\r\n * Allows recursive serialization of the object and its descendants. If the XMLNode is marked as root node,\r\n * it will automatically add the XML processing information in front of the serialized representation.\r\n *\r\n * @function serialize\r\n * @returns {string} - String representation of the XMLNode\r\n */\r\nXMLNode.prototype.serialize = function() {\r\n\tlet sSerialized = (this.root ? XMLNode.processingInformation : \"\") + \"<\" + this.tag;\r\n\r\n\t/* Insert attributes including namespace information */\r\n\tfor (let i = 0; i < this.attributes.length; i++) {\r\n\t\tsSerialized += this.attributes[i].serialize();\r\n\t}\r\n\r\n\tconst sSerializedContent = this.getSerializedContent();\r\n\r\n\tif (sSerializedContent) {\r\n\t\tsSerialized = (\" \" + sSerialized).substr(1);\r\n\t\tsSerialized += `>${sSerializedContent}</${this.tag}>`;\r\n\t} else {\r\n\r\n\t\t/* Shorthand tag support */\r\n\t\tsSerialized += \"/>\";\r\n\t\tsSerialized = (\" \" + sSerialized).substr(1);\r\n\t}\r\n\r\n\treturn sSerialized;\r\n};\r\n\r\n/**\r\n * Returns the serialized content of the XMLNode.\r\n * The conent includes child nodes as well as a value.\r\n *\r\n * @returns {String} Serialized string representation of the content\r\n */\r\nXMLNode.prototype.getSerializedContent = function() {\r\n\tlet sSerialized = \"\";\r\n\r\n\tfor (let i = 0; i < this.childs.length; i++) {\r\n\t\tsSerialized += typeof this.childs[i] === \"string\" ? this.childs[i] : this.childs[i].serialize();\r\n\t}\r\n\r\n\tsSerialized += this.xmlEncode(this.value);\r\n\r\n\treturn sSerialized;\r\n};\r\n\r\nmodule.exports = XMLNode;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(838);\n"],"names":["App","ContentTypes","Core","Relationships","Sheet","Workbook","Customizing","XLSXBuilder","aBinding","oContext","hierarchyLevel","mCustomizing","aMetadataConfig","i","oMetainfoGroup","sSheetName","sMetadataSheetName","Array","length","Error","this","app","objects","core","workbook","update","sheetName","metaSheetName","sheet","addSheet","columns","selectSheet","metainfo","property","label","width","metadata","hideHeader","createGroup","name","_insertIntoSheet","items","slice","prototype","build","files","zip","j","fileConfig","xmlObject","relation","zipConfig","path","type","relationships","target","JSZip3","FileType","addRelationship","file","serialize","getAbsolutePath","getRelationships","getRelatedFiles","forEach","compression","support","nodebuffer","generateAsync","append","aData","oSheet","array","insert","shift","module","exports","BigNumber","BooleanType","CalendarTime","CalendarDate","CalendarDateTime","Cell","Currency","Enumeration","Numeric","Text","Timezone","Column","oData","oSharedStrings","oStyles","oColumnData","isArray","styles","_initType","cell","oType","toLowerCase","timezone","timezoneProperty","getTimezoneTranslation","registerAt","getCell","bind","setValue","oError","message","JSON","stringify","Row","ColumnConfiguration","oConfig","aColumns","oColumn","_row","sharedStrings","Object","defineProperty","value","hierarchyLevelProperty","push","_initBinding","addCell","nHierarchyLevel","normalizedHierarchyLevel","Math","min","outline","addAttribute","id","remove","getHeader","row","font","size","bold","fill","color","setStyle","getStyleId","column","getGroupHeader","sGroupName","data","spans","sKey","iScale","currency","DEFAULT","scale","CURRENCY","MAX_CURRENCY_SCALE","unit","UNIT","assign","TIMEZONE","sCurrencyCode","sUnit","sTimezone","Type","ScaleSettings","Alignment","call","displayUnit","unitProperty","delimiter","alignment","horizontal","RIGHT","LEFT","create","constructor","getScale","getScaleForCurrency","getScaleForUnit","isNaN","getValue","sResult","sValue","toString","match","_parseValue","bDelimiter","aSplitted","aInteger","sDecimal","sInteger","split","reduceRight","accumulator","currentValue","substring","trueValue","falseValue","numberFormat","isCustomFormatted","_createConfiguration","config","getPrototypeOf","format","CalendarBase","calendar","inputFormat","toUpperCase","LOCAL_TIMEZONE","Intl","DateTimeFormat","resolvedOptions","timeZone","BUILTIN","oSymbols","apply","oDate","setUTCFullYear","setUTCMonth","setUTCDate","sTemplate","getDefaultFormat","parseInt","sProperty","iTimestamp","vValue","ms","valueOf","_parseStringValue","dateToExcel","_parseStringDate","odataDateRegex","test","_parseOdataDate","odataDateTimeOffsetRegex","Date","parse","isFinite","_parseODataDuration","parts","days","hours","minutes","seconds","odataDurationRegex","exec","parseFloat","_parseTimeOfDay","date","timeOfDayRegex","setUTCHours","getTime","matchArray","offset","setUTCMinutes","getUTCMinutes","dateStringRegex","nTimestamp","iOffset","max","sPattern","aMatch","sSubstring","index","charAt","utc","displayTimezone","styleIds","_oCache","Map","getTimezone","addStyle","iDateDifference","fExcelValue","iTimezoneOffset","oFormat","oParts","getTimezoneFormat","formatToParts","reduce","acc","item","getUTCDate","day","getUTCHours","hour","minute","oCachedEntry","oInstance","oOptions","get","hourCycle","era","set","iExcelTimestamp","fParsedValue","getNumberFormatTemplate","template","getUnit","_valueMap","valueMap","key","autoScale","builtin","scientificRegEx","aSegments","iExponent","Number","toFixed","isIEEE754Compliant","bCompliant","trim","replace","sCompliantLineBreak","String","fromCharCode","wrap","_mStyleIds","formulaRegex","stringReplacePatterns","convertLineBreaks","align","indent","bRequiresPrefix","sIdentifier","quotePrefix","properties","reRegEx","aValues","aInputMatch","RegExp","every","sUnmodifiedValue","styleId","textAlign","XMLNode","DataType","SharedString","writable","_shared","_oFallbackType","_applyType","Boolean","InlineString","FormularString","_cellTypeProperty","tag","attributes","bindingType","nStyle","style","setReference","sReference","reference","oBusinessObject","_isValuePresent","text","getColumnReferenceByIndex","nIndex","floor","_updateSpans","childs","oCell","count","spacePreserveAttributeId","controlCharacterTestRegex","controlCharacterReplaceRegex","spacePreserveRegex","_escapeControlCharacters","sCharHex","sMatch","codePointAt","prefix","substr","XMLFile","SharedStrings","instance","MAX_CELL_LENGTH","getInstance","filename","root","map","has","uniqueCount","cleanup","clear","oColumnConfiguration","_hierarchyProperty","_hierarchyLevel","_rowCount","_createCols","_createHeader","suffix","MAX_ROWS","col","minWidth","nWidth","_columns","_calculateColumnWidth","ceil","addChild","nCharacters","_setHierarchyDepth","nHierarchyDepth","hierarchyDepth","headerRow","views","defaultView","_appendRow","oRow","dimension","sSerializedRow","pop","filter","sName","nLevel","groupHeaderRow","getRowCount","application","version","FILENAME","title","modifiedBy","toISOString","modified","ReferenceNode","_relatedFiles","_relationships","addRelatedFile","oXMLFile","oReferenceNode","setFileName","getFileName","setPath","getPath","sTarget","sType","Styles","_styles","_sharedStrings","RELATIONS","_registeredSheets","nCount","sId","sSheetFileName","sheets","indexOf","sheetElement","that","createDefinedName","sDefinedName","sDimension","iIndex","aArray","definedNames","_contains","sAlign","oAggregation","contained","CENTER","contains","vertical","TOP","MIDDLE","BOTTOM","isDefault","setIndent","nIndent","_setAlignmentAttribute","setHorizontalAlignment","setWrapText","bWrap","wrappingAttribute","setVerticalAlignment","_getAlignmentAttribute","equals","oAlignment","Border","oBorder","Fill","setFill","setType","DEFAULT_TYPE","oFill","getType","getFill","rgb","sColor","reset","Font","setName","setSize","setFamily","family","setBold","DEFAULT_SIZE","DEFAULT_NAME","oFont","getName","getSize","isBold","getColor","getFamily","valueAttribute","bBold","boldProperty","nFamily","nSize","NumberFormat","BUILTIN_IDS","ID_OFFSET","getId","formatId","getFormat","setId","iId","_isBuiltin","setFormat","sFormat","oNumberFormat","Style","getAlignment","getFontId","getFillId","getBorderId","border","getNumberFormatId","hasQuotePrefix","setAlignment","oAlign","alignProperty","_apply","configurable","setFontId","nFontId","setFillId","nFillId","setBorderId","sBorderId","setNumberFormatId","nNumFmtId","setQuotePrefix","bQuotePrefix","sAttributeName","nId","applyProperty","oStyle","addFill","fontId","fillId","borderId","numberFormatId","addFont","addBorder","addNumberFormat","_addToAggregation","cellXfs","oNewItem","aAggregation","existingItem","addColor","sHexColor","colors","mru","some","fonts","fills","borders","numberFormats","XMLElement","XMLAttribute","xmlEncode","_replace","_filename","_path","sFileName","sPath","lastIndexOf","bFinalize","sSerializedString","processingInformation","attribute","node","referencedElement","splice","sSerialized","sSerializedContent","getSerializedContent","__webpack_module_cache__","__webpack_exports__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
|