devextreme-exceljs-fork 4.4.7 → 4.4.8
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/dist/dx-exceljs-fork.bare.js +445 -541
- package/dist/dx-exceljs-fork.bare.js.map +18 -18
- package/dist/dx-exceljs-fork.bare.min.js +7 -7
- package/dist/dx-exceljs-fork.bare.min.js.map +1 -1
- package/dist/dx-exceljs-fork.js +445 -541
- package/dist/dx-exceljs-fork.js.map +18 -18
- package/dist/dx-exceljs-fork.min.js +6 -6
- package/dist/dx-exceljs-fork.min.js.map +1 -1
- package/dist/es5/csv/csv.js +1 -1
- package/dist/es5/csv/csv.js.map +1 -1
- package/dist/es5/doc/cell.js +5 -5
- package/dist/es5/doc/cell.js.map +1 -1
- package/dist/es5/doc/pivot-table.js +1 -1
- package/dist/es5/doc/pivot-table.js.map +1 -1
- package/dist/es5/doc/range.js +7 -7
- package/dist/es5/doc/range.js.map +1 -1
- package/dist/es5/doc/row.js +1 -1
- package/dist/es5/doc/row.js.map +1 -1
- package/dist/es5/doc/table.js +10 -10
- package/dist/es5/doc/table.js.map +1 -1
- package/dist/es5/doc/worksheet.js +7 -6
- package/dist/es5/doc/worksheet.js.map +1 -1
- package/dist/es5/stream/xlsx/hyperlink-reader.js +26 -49
- package/dist/es5/stream/xlsx/hyperlink-reader.js.map +1 -1
- package/dist/es5/stream/xlsx/sheet-comments-writer.js +6 -6
- package/dist/es5/stream/xlsx/sheet-comments-writer.js.map +1 -1
- package/dist/es5/stream/xlsx/sheet-rels-writer.js +6 -5
- package/dist/es5/stream/xlsx/sheet-rels-writer.js.map +1 -1
- package/dist/es5/stream/xlsx/workbook-reader.js +215 -320
- package/dist/es5/stream/xlsx/workbook-reader.js.map +1 -1
- package/dist/es5/stream/xlsx/workbook-writer.js +8 -8
- package/dist/es5/stream/xlsx/workbook-writer.js.map +1 -1
- package/dist/es5/stream/xlsx/worksheet-reader.js +265 -341
- package/dist/es5/stream/xlsx/worksheet-reader.js.map +1 -1
- package/dist/es5/stream/xlsx/worksheet-writer.js +9 -13
- package/dist/es5/stream/xlsx/worksheet-writer.js.map +1 -1
- package/dist/es5/utils/col-cache.js +14 -18
- package/dist/es5/utils/col-cache.js.map +1 -1
- package/dist/es5/utils/copy-style.js +12 -10
- package/dist/es5/utils/copy-style.js.map +1 -1
- package/dist/es5/utils/encryptor.js +1 -1
- package/dist/es5/utils/encryptor.js.map +1 -1
- package/dist/es5/utils/iterate-stream.js +26 -37
- package/dist/es5/utils/iterate-stream.js.map +1 -1
- package/dist/es5/utils/parse-sax.js +34 -67
- package/dist/es5/utils/parse-sax.js.map +1 -1
- package/dist/es5/utils/utils.js +1 -1
- package/dist/es5/utils/utils.js.map +1 -1
- package/dist/es5/utils/xml-stream.js +1 -1
- package/dist/es5/utils/xml-stream.js.map +1 -1
- package/dist/es5/xlsx/xform/base-xform.js +12 -35
- package/dist/es5/xlsx/xform/base-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/book/defined-name-xform.js +2 -2
- package/dist/es5/xlsx/xform/book/defined-name-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/book/workbook-xform.js +5 -5
- package/dist/es5/xlsx/xform/book/workbook-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/comment/comment-xform.js +4 -8
- package/dist/es5/xlsx/xform/comment/comment-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/comment/vml-shape-xform.js +1 -1
- package/dist/es5/xlsx/xform/comment/vml-shape-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/comment/vml-textbox-xform.js +1 -1
- package/dist/es5/xlsx/xform/comment/vml-textbox-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/core/content-types-xform.js +5 -5
- package/dist/es5/xlsx/xform/core/content-types-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/core/core-xform.js +2 -2
- package/dist/es5/xlsx/xform/core/core-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/core/relationships-xform.js +2 -2
- package/dist/es5/xlsx/xform/core/relationships-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/drawing/c-nv-pr-xform.js +1 -1
- package/dist/es5/xlsx/xform/drawing/c-nv-pr-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/list-xform.js +1 -1
- package/dist/es5/xlsx/xform/list-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/pivot-table/cache-field.js +8 -2
- package/dist/es5/xlsx/xform/pivot-table/cache-field.js.map +1 -1
- package/dist/es5/xlsx/xform/pivot-table/pivot-cache-definition-xform.js +3 -7
- package/dist/es5/xlsx/xform/pivot-table/pivot-cache-definition-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/pivot-table/pivot-cache-records-xform.js +7 -11
- package/dist/es5/xlsx/xform/pivot-table/pivot-cache-records-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/pivot-table/pivot-table-xform.js +70 -10
- package/dist/es5/xlsx/xform/pivot-table/pivot-table-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/sheet/auto-filter-xform.js +1 -1
- package/dist/es5/xlsx/xform/sheet/auto-filter-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/sheet/cell-xform.js +4 -8
- package/dist/es5/xlsx/xform/sheet/cell-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/sheet/cf/cf-rule-xform.js +18 -22
- package/dist/es5/xlsx/xform/sheet/cf/cf-rule-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/sheet/cf-ext/cf-rule-ext-xform.js +2 -2
- package/dist/es5/xlsx/xform/sheet/cf-ext/cf-rule-ext-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/sheet/data-validations-xform.js +11 -13
- package/dist/es5/xlsx/xform/sheet/data-validations-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/sheet/merges.js +1 -1
- package/dist/es5/xlsx/xform/sheet/merges.js.map +1 -1
- package/dist/es5/xlsx/xform/sheet/row-xform.js +2 -2
- package/dist/es5/xlsx/xform/sheet/row-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/sheet/worksheet-xform.js +10 -10
- package/dist/es5/xlsx/xform/sheet/worksheet-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/strings/shared-strings-xform.js +2 -2
- package/dist/es5/xlsx/xform/strings/shared-strings-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/style/border-xform.js +3 -7
- package/dist/es5/xlsx/xform/style/border-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/table/auto-filter-xform.js +2 -2
- package/dist/es5/xlsx/xform/table/auto-filter-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/table/filter-column-xform.js +1 -1
- package/dist/es5/xlsx/xform/table/filter-column-xform.js.map +1 -1
- package/dist/es5/xlsx/xform/table/table-xform.js +3 -7
- package/dist/es5/xlsx/xform/table/table-xform.js.map +1 -1
- package/dist/es5/xlsx/xlsx.js +22 -45
- package/dist/es5/xlsx/xlsx.js.map +1 -1
- package/package.json +13 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-xform.js","names":["BaseXform","require","ListXform","constructor","options","tag","always","count","empty","$count","$","childXform","maxItems","prepare","model","forEach","childModel","index","render","xmlStream","length","openNode","addAttribute","closeNode","leafNode","parseOpen","node","parser","name","parseText","text","parseClose","push","undefined","Error","
|
|
1
|
+
{"version":3,"file":"list-xform.js","names":["BaseXform","require","ListXform","constructor","options","tag","always","count","empty","$count","$","childXform","maxItems","prepare","model","forEach","childModel","index","render","xmlStream","length","openNode","addAttribute","closeNode","leafNode","parseOpen","node","parser","name","parseText","text","parseClose","push","undefined","Error","reconcile","module","exports"],"sources":["../../../../lib/xlsx/xform/list-xform.js"],"sourcesContent":["const BaseXform = require('./base-xform');\n\nclass ListXform extends BaseXform {\n constructor(options) {\n super();\n\n this.tag = options.tag;\n this.always = !!options.always;\n this.count = options.count;\n this.empty = options.empty;\n this.$count = options.$count || 'count';\n this.$ = options.$;\n this.childXform = options.childXform;\n this.maxItems = options.maxItems;\n }\n\n prepare(model, options) {\n const {childXform} = this;\n if (model) {\n model.forEach((childModel, index) => {\n options.index = index;\n childXform.prepare(childModel, options);\n });\n }\n }\n\n render(xmlStream, model) {\n if (this.always || (model && model.length)) {\n xmlStream.openNode(this.tag, this.$);\n if (this.count) {\n xmlStream.addAttribute(this.$count, (model && model.length) || 0);\n }\n\n const {childXform} = this;\n (model || []).forEach((childModel, index) => {\n childXform.render(xmlStream, childModel, index);\n });\n\n xmlStream.closeNode();\n } else if (this.empty) {\n xmlStream.leafNode(this.tag);\n }\n }\n\n parseOpen(node) {\n if (this.parser) {\n this.parser.parseOpen(node);\n return true;\n }\n switch (node.name) {\n case this.tag:\n this.model = [];\n return true;\n default:\n if (this.childXform.parseOpen(node)) {\n this.parser = this.childXform;\n return true;\n }\n return false;\n }\n }\n\n parseText(text) {\n if (this.parser) {\n this.parser.parseText(text);\n }\n }\n\n parseClose(name) {\n if (this.parser) {\n if (!this.parser.parseClose(name)) {\n this.model.push(this.parser.model);\n this.parser = undefined;\n\n if (this.maxItems && this.model.length > this.maxItems) {\n throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);\n }\n }\n return true;\n }\n\n return false;\n }\n\n reconcile(model, options) {\n if (model) {\n const {childXform} = this;\n model.forEach(childModel => {\n childXform.reconcile(childModel, options);\n });\n }\n }\n}\n\nmodule.exports = ListXform;\n"],"mappings":";;AAAA,MAAMA,SAAS,GAAGC,OAAO,CAAC,cAAc,CAAC;AAEzC,MAAMC,SAAS,SAASF,SAAS,CAAC;EAChCG,WAAWA,CAACC,OAAO,EAAE;IACnB,KAAK,CAAC,CAAC;IAEP,IAAI,CAACC,GAAG,GAAGD,OAAO,CAACC,GAAG;IACtB,IAAI,CAACC,MAAM,GAAG,CAAC,CAACF,OAAO,CAACE,MAAM;IAC9B,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;IAC1B,IAAI,CAACC,KAAK,GAAGJ,OAAO,CAACI,KAAK;IAC1B,IAAI,CAACC,MAAM,GAAGL,OAA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CAACnB,UAAU,EAAEZ,OAAO,CAAC;MAC3C,CAAC,CAAC;IACJ;EACF;AACF;AAEAgC,MAAM,CAACC,OAAO,GAAGnC,SAAS","ignoreList":[]}
|
|
@@ -31,11 +31,17 @@ class CacheField {
|
|
|
31
31
|
// integer types
|
|
32
32
|
if (this.sharedItems === null) {
|
|
33
33
|
// TK(2023-07-18): left out attributes... minValue="5" maxValue="45"
|
|
34
|
-
return
|
|
34
|
+
return `<cacheField name="${this.name}" numFmtId="0">
|
|
35
|
+
<sharedItems containsSemiMixedTypes="0" containsString="0" containsNumber="1" containsInteger="1" />
|
|
36
|
+
</cacheField>`;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
// string types
|
|
38
|
-
return
|
|
40
|
+
return `<cacheField name="${this.name}" numFmtId="0">
|
|
41
|
+
<sharedItems count="${this.sharedItems.length}">
|
|
42
|
+
${this.sharedItems.map(item => `<s v="${item}" />`).join('')}
|
|
43
|
+
</sharedItems>
|
|
44
|
+
</cacheField>`;
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
47
|
module.exports = CacheField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-field.js","names":["CacheField","constructor","_ref","name","sharedItems","render","
|
|
1
|
+
{"version":3,"file":"cache-field.js","names":["CacheField","constructor","_ref","name","sharedItems","render","length","map","item","join","module","exports"],"sources":["../../../../../lib/xlsx/xform/pivot-table/cache-field.js"],"sourcesContent":["class CacheField {\n constructor({name, sharedItems}) {\n // string type\n //\n // {\n // 'name': 'A',\n // 'sharedItems': ['a1', 'a2', 'a3']\n // }\n //\n // or\n //\n // integer type\n //\n // {\n // 'name': 'D',\n // 'sharedItems': null\n // }\n this.name = name;\n this.sharedItems = sharedItems;\n }\n\n render() {\n // PivotCache Field: http://www.datypic.com/sc/ooxml/e-ssml_cacheField-1.html\n // Shared Items: http://www.datypic.com/sc/ooxml/e-ssml_sharedItems-1.html\n\n // integer types\n if (this.sharedItems === null) {\n // TK(2023-07-18): left out attributes... minValue=\"5\" maxValue=\"45\"\n return `<cacheField name=\"${this.name}\" numFmtId=\"0\">\n <sharedItems containsSemiMixedTypes=\"0\" containsString=\"0\" containsNumber=\"1\" containsInteger=\"1\" />\n </cacheField>`;\n }\n\n // string types\n return `<cacheField name=\"${this.name}\" numFmtId=\"0\">\n <sharedItems count=\"${this.sharedItems.length}\">\n ${this.sharedItems.map(item => `<s v=\"${item}\" />`).join('')}\n </sharedItems>\n </cacheField>`;\n }\n}\n\nmodule.exports = CacheField;\n"],"mappings":";;AAAA,MAAMA,UAAU,CAAC;EACfC,WAAWA,CAAAC,IAAA,EAAsB;IAAA,IAArB;MAACC,IAAI;MAAEC;IAAW,CAAC,GAAAF,IAAA;IAC7B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,WAAW,GAAGA,WAAW;EAChC;EAEAC,MAAMA,CAAA,EAAG;IACP;IACA;;IAEA;IACA,IAAI,IAAI,CAACD,WAAW,KAAK,IAAI,EAAE;MAC7B;MACA,OAAO,qBAAqB,IAAI,CAACD,IAAI;AAC3C;AACA,kBAAkB;IACd;;IAEA;IACA,OAAO,qBAAqB,IAAI,CAACA,IAAI;AACzC,4BAA4B,IAAI,CAACC,WAAW,CAACE,MAAM;AACnD,UAAU,IAAI,CAACF,WAAW,CAACG,GAAG,CAACC,IAAI,IAAI,SAASA,IAAI,MAAM,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC;AACpE;AACA,kBAAkB;EAChB;AACF;AAEAC,MAAM,CAACC,OAAO,GAAGX,UAAU","ignoreList":[]}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
3
|
const BaseXform = require('../base-xform');
|
|
9
4
|
const CacheField = require('./cache-field');
|
|
10
5
|
const XmlStream = require('../../../utils/xml-stream');
|
|
@@ -26,7 +21,8 @@ class PivotCacheDefinitionXform extends BaseXform {
|
|
|
26
21
|
cacheFields
|
|
27
22
|
} = model;
|
|
28
23
|
xmlStream.openXml(XmlStream.StdDocAttributes);
|
|
29
|
-
xmlStream.openNode(this.tag,
|
|
24
|
+
xmlStream.openNode(this.tag, {
|
|
25
|
+
...PivotCacheDefinitionXform.PIVOT_CACHE_DEFINITION_ATTRIBUTES,
|
|
30
26
|
'r:id': 'rId1',
|
|
31
27
|
refreshOnLoad: '1',
|
|
32
28
|
// important for our implementation to work
|
|
@@ -36,7 +32,7 @@ class PivotCacheDefinitionXform extends BaseXform {
|
|
|
36
32
|
refreshedVersion: '8',
|
|
37
33
|
minRefreshableVersion: '3',
|
|
38
34
|
recordCount: cacheFields.length + 1
|
|
39
|
-
})
|
|
35
|
+
});
|
|
40
36
|
xmlStream.openNode('cacheSource', {
|
|
41
37
|
type: 'worksheet'
|
|
42
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pivot-cache-definition-xform.js","names":["BaseXform","require","CacheField","XmlStream","PivotCacheDefinitionXform","constructor","map","prepare","model","tag","render","xmlStream","sourceSheet","cacheFields","openXml","StdDocAttributes","openNode","
|
|
1
|
+
{"version":3,"file":"pivot-cache-definition-xform.js","names":["BaseXform","require","CacheField","XmlStream","PivotCacheDefinitionXform","constructor","map","prepare","model","tag","render","xmlStream","sourceSheet","cacheFields","openXml","StdDocAttributes","openNode","PIVOT_CACHE_DEFINITION_ATTRIBUTES","refreshOnLoad","refreshedBy","refreshedDate","createdVersion","refreshedVersion","minRefreshableVersion","recordCount","length","type","leafNode","ref","dimensions","shortRange","sheet","name","closeNode","count","writeXml","cacheField","join","parseOpen","node","parseText","text","parseClose","reconcile","options","xmlns","module","exports"],"sources":["../../../../../lib/xlsx/xform/pivot-table/pivot-cache-definition-xform.js"],"sourcesContent":["const BaseXform = require('../base-xform');\nconst CacheField = require('./cache-field');\nconst XmlStream = require('../../../utils/xml-stream');\n\nclass PivotCacheDefinitionXform extends BaseXform {\n constructor() {\n super();\n\n this.map = {};\n }\n\n prepare(model) {\n // TK\n }\n\n get tag() {\n // http://www.datypic.com/sc/ooxml/e-ssml_pivotCacheDefinition.html\n return 'pivotCacheDefinition';\n }\n\n render(xmlStream, model) {\n const {sourceSheet, cacheFields} = model;\n\n xmlStream.openXml(XmlStream.StdDocAttributes);\n xmlStream.openNode(this.tag, {\n ...PivotCacheDefinitionXform.PIVOT_CACHE_DEFINITION_ATTRIBUTES,\n 'r:id': 'rId1',\n refreshOnLoad: '1', // important for our implementation to work\n refreshedBy: 'Author',\n refreshedDate: '45125.026046874998',\n createdVersion: '8',\n refreshedVersion: '8',\n minRefreshableVersion: '3',\n recordCount: cacheFields.length + 1,\n });\n\n xmlStream.openNode('cacheSource', {type: 'worksheet'});\n xmlStream.leafNode('worksheetSource', {\n ref: sourceSheet.dimensions.shortRange,\n sheet: sourceSheet.name,\n });\n xmlStream.closeNode();\n\n xmlStream.openNode('cacheFields', {count: cacheFields.length});\n // Note: keeping this pretty-printed for now to ease debugging.\n xmlStream.writeXml(cacheFields.map(cacheField => new CacheField(cacheField).render()).join('\\n '));\n xmlStream.closeNode();\n\n xmlStream.closeNode();\n }\n\n parseOpen(node) {\n // TK\n }\n\n parseText(text) {\n // TK\n }\n\n parseClose(name) {\n // TK\n }\n\n reconcile(model, options) {\n // TK\n }\n}\n\nPivotCacheDefinitionXform.PIVOT_CACHE_DEFINITION_ATTRIBUTES = {\n xmlns: 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',\n 'xmlns:r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n 'xmlns:mc': 'http://schemas.openxmlformats.org/markup-compatibility/2006',\n 'mc:Ignorable': 'xr',\n 'xmlns:xr': 'http://schemas.microsoft.com/office/spreadsheetml/2014/revision',\n};\n\nmodule.exports = PivotCacheDefinitionXform;\n"],"mappings":";;AAAA,MAAMA,SAAS,GAAGC,OAAO,CAAC,eAAe,CAAC;AAC1C,MAAMC,UAAU,GAAGD,OAAO,CAAC,eAAe,CAAC;AAC3C,MAAME,SAAS,GAAGF,OAAO,CAAC,2BAA2B,CAAC;AAEtD,MAAMG,yBAAyB,SAASJ,SAAS,CAAC;EAChDK,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAEP,IAAI,CAACC,GAAG,GAAG,CAAC,CAAC;EACf;EAEAC,OAAOA,CAACC,KAAK,EAAE;IACb;EAAA;EAGF,IAAIC,GAAGA,CAAA,EAAG;IACR;IACA,OAAO,sBAAsB;EAC/B;EAEAC,MAAMA,CAACC,SAAS,EAAEH,KAAK,EAAE;IACvB,MAAM;MAACI,WAAW;MAAEC;IAAW,CAAC,GAAGL,KAAK;IAExC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EJ;AAEAxC,yBAAyB,CAACa,iCAAiC,GAAG;EAC5D4B,KAAK,EAAE,2DAA2D;EAClE,SAAS,EAAE,qEAAqE;EAChF,UAAU,EAAE,6DAA6D;EACzE,cAAc,EAAE,IAAI;EACpB,UAAU,EAAE;AACd,CAAC;AAEDC,MAAM,CAACC,OAAO,GAAG3C,yBAAyB","ignoreList":[]}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
3
|
const XmlStream = require('../../../utils/xml-stream');
|
|
9
4
|
const BaseXform = require('../base-xform');
|
|
10
5
|
class PivotCacheRecordsXform extends BaseXform {
|
|
@@ -26,9 +21,10 @@ class PivotCacheRecordsXform extends BaseXform {
|
|
|
26
21
|
} = model;
|
|
27
22
|
const sourceBodyRows = sourceSheet.getSheetValues().slice(2);
|
|
28
23
|
xmlStream.openXml(XmlStream.StdDocAttributes);
|
|
29
|
-
xmlStream.openNode(this.tag,
|
|
24
|
+
xmlStream.openNode(this.tag, {
|
|
25
|
+
...PivotCacheRecordsXform.PIVOT_CACHE_RECORDS_ATTRIBUTES,
|
|
30
26
|
count: sourceBodyRows.length
|
|
31
|
-
})
|
|
27
|
+
});
|
|
32
28
|
xmlStream.writeXml(renderTable());
|
|
33
29
|
xmlStream.closeNode();
|
|
34
30
|
|
|
@@ -57,20 +53,20 @@ class PivotCacheRecordsXform extends BaseXform {
|
|
|
57
53
|
if (sharedItems === null) {
|
|
58
54
|
if (Number.isFinite(value)) {
|
|
59
55
|
// Numeric value: http://www.datypic.com/sc/ooxml/e-ssml_n-2.html
|
|
60
|
-
return
|
|
56
|
+
return `<n v="${value}" />`;
|
|
61
57
|
}
|
|
62
58
|
// Character Value: http://www.datypic.com/sc/ooxml/e-ssml_s-2.html
|
|
63
|
-
return
|
|
59
|
+
return `<s v="${value}" />`;
|
|
64
60
|
}
|
|
65
61
|
|
|
66
62
|
// shared items
|
|
67
63
|
// --------------------------------------------------
|
|
68
64
|
const sharedItemsIndex = sharedItems.indexOf(value);
|
|
69
65
|
if (sharedItemsIndex < 0) {
|
|
70
|
-
throw new Error(
|
|
66
|
+
throw new Error(`${JSON.stringify(value)} not in sharedItems ${JSON.stringify(sharedItems)}`);
|
|
71
67
|
}
|
|
72
68
|
// Shared Items Index: http://www.datypic.com/sc/ooxml/e-ssml_x-9.html
|
|
73
|
-
return
|
|
69
|
+
return `<x v="${sharedItemsIndex}" />`;
|
|
74
70
|
}
|
|
75
71
|
}
|
|
76
72
|
parseOpen(node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pivot-cache-records-xform.js","names":["XmlStream","require","BaseXform","PivotCacheRecordsXform","constructor","map","prepare","model","tag","render","xmlStream","sourceSheet","cacheFields","sourceBodyRows","getSheetValues","slice","openXml","StdDocAttributes","openNode","
|
|
1
|
+
{"version":3,"file":"pivot-cache-records-xform.js","names":["XmlStream","require","BaseXform","PivotCacheRecordsXform","constructor","map","prepare","model","tag","render","xmlStream","sourceSheet","cacheFields","sourceBodyRows","getSheetValues","slice","openXml","StdDocAttributes","openNode","PIVOT_CACHE_RECORDS_ATTRIBUTES","count","length","writeXml","renderTable","closeNode","rowsInXML","row","realRow","renderRowLines","join","index","cellValue","entries","renderCell","sharedItems","value","Number","isFinite","sharedItemsIndex","indexOf","Error","JSON","stringify","parseOpen","node","parseText","text","parseClose","name","reconcile","options","xmlns","module","exports"],"sources":["../../../../../lib/xlsx/xform/pivot-table/pivot-cache-records-xform.js"],"sourcesContent":["const XmlStream = require('../../../utils/xml-stream');\n\nconst BaseXform = require('../base-xform');\n\nclass PivotCacheRecordsXform extends BaseXform {\n constructor() {\n super();\n\n this.map = {};\n }\n\n prepare(model) {\n // TK\n }\n\n get tag() {\n // http://www.datypic.com/sc/ooxml/e-ssml_pivotCacheRecords.html\n return 'pivotCacheRecords';\n }\n\n render(xmlStream, model) {\n const {sourceSheet, cacheFields} = model;\n const sourceBodyRows = sourceSheet.getSheetValues().slice(2);\n\n xmlStream.openXml(XmlStream.StdDocAttributes);\n xmlStream.openNode(this.tag, {\n ...PivotCacheRecordsXform.PIVOT_CACHE_RECORDS_ATTRIBUTES,\n count: sourceBodyRows.length,\n });\n xmlStream.writeXml(renderTable());\n xmlStream.closeNode();\n\n // Helpers\n\n function renderTable() {\n const rowsInXML = sourceBodyRows.map(row => {\n const realRow = row.slice(1);\n return [...renderRowLines(realRow)].join('');\n });\n return rowsInXML.join('');\n }\n\n function* renderRowLines(row) {\n // PivotCache Record: http://www.datypic.com/sc/ooxml/e-ssml_r-1.html\n // Note: pretty-printing this for now to ease debugging.\n yield '\\n <r>';\n for (const [index, cellValue] of row.entries()) {\n yield '\\n ';\n yield renderCell(cellValue, cacheFields[index].sharedItems);\n }\n yield '\\n </r>';\n }\n\n function renderCell(value, sharedItems) {\n // no shared items\n // --------------------------------------------------\n if (sharedItems === null) {\n if (Number.isFinite(value)) {\n // Numeric value: http://www.datypic.com/sc/ooxml/e-ssml_n-2.html\n return `<n v=\"${value}\" />`;\n }\n // Character Value: http://www.datypic.com/sc/ooxml/e-ssml_s-2.html\n return `<s v=\"${value}\" />`;\n \n }\n\n // shared items\n // --------------------------------------------------\n const sharedItemsIndex = sharedItems.indexOf(value);\n if (sharedItemsIndex < 0) {\n throw new Error(`${JSON.stringify(value)} not in sharedItems ${JSON.stringify(sharedItems)}`);\n }\n // Shared Items Index: http://www.datypic.com/sc/ooxml/e-ssml_x-9.html\n return `<x v=\"${sharedItemsIndex}\" />`;\n }\n }\n\n parseOpen(node) {\n // TK\n }\n\n parseText(text) {\n // TK\n }\n\n parseClose(name) {\n // TK\n }\n\n reconcile(model, options) {\n // TK\n }\n}\n\nPivotCacheRecordsXform.PIVOT_CACHE_RECORDS_ATTRIBUTES = {\n xmlns: 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',\n 'xmlns:r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n 'xmlns:mc': 'http://schemas.openxmlformats.org/markup-compatibility/2006',\n 'mc:Ignorable': 'xr',\n 'xmlns:xr': 'http://schemas.microsoft.com/office/spreadsheetml/2014/revision',\n};\n\nmodule.exports = PivotCacheRecordsXform;\n"],"mappings":";;AAAA,MAAMA,SAAS,GAAGC,OAAO,CAAC,2BAA2B,CAAC;AAEtD,MAAMC,SAAS,GAAGD,OAAO,CAAC,eAAe,CAAC;AAE1C,MAAME,sBAAsB,SAASD,SAAS,CAAC;EAC7CE,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAEP,IAAI,CAACC,GAAG,GAAG,CAAC,CAAC;EACf;EAEAC,OAAOA,CAACC,KAAK,EAAE;IACb;EAAA;EAGF,IAAIC,GAAGA,CAAA,EAAG;IACR;IACA,OAA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,IAAIE,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,EAAE;UAC1B;UACA,OAAO,SAASA,KAAK,MAAM;QAC7B;QACE;QACA,OAAO,SAASA,KAAK,MAAM;MAE/B;;MAEA;MACA;MACA,MAAMG,gBAAgB,GAAGJ,WAAW,CAACK,OAAO,CAACJ,KAAK,CAAC;MACnD,IAAIG,gBAAgB,GAAG,CAAC,EAAE;QACxB,MAAM,IAAIE,KAAK,CAAC,GAAGC,IAAI,CAACC,SAAS,CAACP,KAAK,CAAC,uBAAuBM,IAAI,CAACC,SAAS,CAACR,WAAW,CAAC,EAAE,CAAC;MAC/F;MACA;MACA,OAAO,SAASI,gBAAgB,MAAM;IACxC;EACF;EAEAK,SAASA,CAACC,IAAI,EAAE;IACd;EAAA;EAGFC,SAASA,CAACC,IAAI,EAAE;IACd;EAAA;EAGFC,UAAUA,CAACC,IAAI,EAAE;IACf;EAAA;EAGFC,SAASA,CAAC1C,KAAK,EAAE2C,OAAO,EAAE;IACxB;EAAA;AAEJ;AAEA/C,sBAAsB,CAACgB,8BAA8B,GAAG;EACtDgC,KAAK,EAAE,2DAA2D;EAClE,SAAS,EAAE,qEAAqE;EAChF,UAAU,EAAE,6DAA6D;EACzE,cAAc,EAAE,IAAI;EACpB,UAAU,EAAE;AACd,CAAC;AAEDC,MAAM,CAACC,OAAO,GAAGlD,sBAAsB","ignoreList":[]}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
3
|
const XmlStream = require('../../../utils/xml-stream');
|
|
9
4
|
const BaseXform = require('../base-xform');
|
|
10
5
|
class PivotTableXform extends BaseXform {
|
|
@@ -40,7 +35,8 @@ class PivotTableXform extends BaseXform {
|
|
|
40
35
|
// the numbers are indices into `cacheFields`.
|
|
41
36
|
|
|
42
37
|
xmlStream.openXml(XmlStream.StdDocAttributes);
|
|
43
|
-
xmlStream.openNode(this.tag,
|
|
38
|
+
xmlStream.openNode(this.tag, {
|
|
39
|
+
...PivotTableXform.PIVOT_TABLE_ATTRIBUTES,
|
|
44
40
|
'xr:uid': '{267EE50F-B116-784D-8DC2-BA77DE3F4F4A}',
|
|
45
41
|
name: 'PivotTable2',
|
|
46
42
|
cacheId,
|
|
@@ -60,7 +56,7 @@ class PivotTableXform extends BaseXform {
|
|
|
60
56
|
compact: '0',
|
|
61
57
|
compactData: '0',
|
|
62
58
|
multipleFieldFilters: '0'
|
|
63
|
-
})
|
|
59
|
+
});
|
|
64
60
|
|
|
65
61
|
// Note: keeping this pretty-printed and verbose for now to ease debugging.
|
|
66
62
|
//
|
|
@@ -70,7 +66,60 @@ class PivotTableXform extends BaseXform {
|
|
|
70
66
|
// colFields and colItems
|
|
71
67
|
// dataFields
|
|
72
68
|
// pivotTableStyleInfo
|
|
73
|
-
xmlStream.writeXml(
|
|
69
|
+
xmlStream.writeXml(`
|
|
70
|
+
<location ref="A3:E15" firstHeaderRow="1" firstDataRow="2" firstDataCol="1" />
|
|
71
|
+
<pivotFields count="${cacheFields.length}">
|
|
72
|
+
${renderPivotFields(model)}
|
|
73
|
+
</pivotFields>
|
|
74
|
+
<rowFields count="${rows.length}">
|
|
75
|
+
${rows.map(rowIndex => `<field x="${rowIndex}" />`).join('\n ')}
|
|
76
|
+
</rowFields>
|
|
77
|
+
<rowItems count="1">
|
|
78
|
+
<i t="grand"><x /></i>
|
|
79
|
+
</rowItems>
|
|
80
|
+
<colFields count="${columns.length}">
|
|
81
|
+
${columns.map(columnIndex => `<field x="${columnIndex}" />`).join('\n ')}
|
|
82
|
+
</colFields>
|
|
83
|
+
<colItems count="1">
|
|
84
|
+
<i t="grand"><x /></i>
|
|
85
|
+
</colItems>
|
|
86
|
+
<dataFields count="${values.length}">
|
|
87
|
+
<dataField
|
|
88
|
+
name="Sum of ${cacheFields[values[0]].name}"
|
|
89
|
+
fld="${values[0]}"
|
|
90
|
+
baseField="0"
|
|
91
|
+
baseItem="0"
|
|
92
|
+
/>
|
|
93
|
+
</dataFields>
|
|
94
|
+
<pivotTableStyleInfo
|
|
95
|
+
name="PivotStyleLight16"
|
|
96
|
+
showRowHeaders="1"
|
|
97
|
+
showColHeaders="1"
|
|
98
|
+
showRowStripes="0"
|
|
99
|
+
showColStripes="0"
|
|
100
|
+
showLastColumn="1"
|
|
101
|
+
/>
|
|
102
|
+
<extLst>
|
|
103
|
+
<ext
|
|
104
|
+
uri="{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}"
|
|
105
|
+
xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
|
|
106
|
+
>
|
|
107
|
+
<x14:pivotTableDefinition
|
|
108
|
+
hideValuesRow="1"
|
|
109
|
+
xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"
|
|
110
|
+
/>
|
|
111
|
+
</ext>
|
|
112
|
+
<ext
|
|
113
|
+
uri="{747A6164-185A-40DC-8AA5-F01512510D54}"
|
|
114
|
+
xmlns:xpdl="http://schemas.microsoft.com/office/spreadsheetml/2016/pivotdefaultlayout"
|
|
115
|
+
>
|
|
116
|
+
<xpdl:pivotTableDefinition16
|
|
117
|
+
EnabledSubtotalsDefault="0"
|
|
118
|
+
SubtotalsOnTopDefault="0"
|
|
119
|
+
/>
|
|
120
|
+
</ext>
|
|
121
|
+
</extLst>
|
|
122
|
+
`);
|
|
74
123
|
xmlStream.closeNode();
|
|
75
124
|
}
|
|
76
125
|
parseOpen(node) {
|
|
@@ -102,9 +151,20 @@ function renderPivotField(fieldType, sharedItems) {
|
|
|
102
151
|
const defaultAttributes = 'compact="0" outline="0" showAll="0" defaultSubtotal="0"';
|
|
103
152
|
if (fieldType === 'row' || fieldType === 'column') {
|
|
104
153
|
const axis = fieldType === 'row' ? 'axisRow' : 'axisCol';
|
|
105
|
-
return
|
|
154
|
+
return `
|
|
155
|
+
<pivotField axis="${axis}" ${defaultAttributes}>
|
|
156
|
+
<items count="${sharedItems.length + 1}">
|
|
157
|
+
${sharedItems.map((item, index) => `<item x="${index}" />`).join('\n ')}
|
|
158
|
+
</items>
|
|
159
|
+
</pivotField>
|
|
160
|
+
`;
|
|
106
161
|
}
|
|
107
|
-
return
|
|
162
|
+
return `
|
|
163
|
+
<pivotField
|
|
164
|
+
${fieldType === 'value' ? 'dataField="1"' : ''}
|
|
165
|
+
${defaultAttributes}
|
|
166
|
+
/>
|
|
167
|
+
`;
|
|
108
168
|
}
|
|
109
169
|
PivotTableXform.PIVOT_TABLE_ATTRIBUTES = {
|
|
110
170
|
xmlns: 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pivot-table-xform.js","names":["XmlStream","require","BaseXform","PivotTableXform","constructor","map","prepare","model","tag","render","xmlStream","rows","columns","values","metric","cacheFields","cacheId","openXml","StdDocAttributes","openNode","
|
|
1
|
+
{"version":3,"file":"pivot-table-xform.js","names":["XmlStream","require","BaseXform","PivotTableXform","constructor","map","prepare","model","tag","render","xmlStream","rows","columns","values","metric","cacheFields","cacheId","openXml","StdDocAttributes","openNode","PIVOT_TABLE_ATTRIBUTES","name","applyNumberFormats","applyBorderFormats","applyFontFormats","applyPatternFormats","applyAlignmentFormats","applyWidthHeightFormats","dataCaption","updatedVersion","minRefreshableVersion","useAutoFormatting","itemPrintTitles","createdVersion","indent","compact","compactData","multipleFieldFilters","writeXml","length","renderPivotFields","rowIndex","join","columnIndex","closeNode","parseOpen","node","parseText","text","parseClose","reconcile","options","pivotTable","cacheField","fieldIndex","fieldType","indexOf","renderPivotField","sharedItems","defaultAttributes","axis","item","index","xmlns","module","exports"],"sources":["../../../../../lib/xlsx/xform/pivot-table/pivot-table-xform.js"],"sourcesContent":["const XmlStream = require('../../../utils/xml-stream');\nconst BaseXform = require('../base-xform');\n\nclass PivotTableXform extends BaseXform {\n constructor() {\n super();\n\n this.map = {};\n }\n\n prepare(model) {\n // TK\n }\n\n get tag() {\n // http://www.datypic.com/sc/ooxml/e-ssml_pivotTableDefinition.html\n return 'pivotTableDefinition';\n }\n\n render(xmlStream, model) {\n // eslint-disable-next-line no-unused-vars\n const {rows, columns, values, metric, cacheFields, cacheId} = model;\n\n // Examples\n // --------\n // rows: [0, 1], // only 2 items possible for now\n // columns: [2], // only 1 item possible for now\n // values: [4], // only 1 item possible for now\n // metric: 'sum', // only 'sum' possible for now\n //\n // the numbers are indices into `cacheFields`.\n\n xmlStream.openXml(XmlStream.StdDocAttributes);\n xmlStream.openNode(this.tag, {\n ...PivotTableXform.PIVOT_TABLE_ATTRIBUTES,\n 'xr:uid': '{267EE50F-B116-784D-8DC2-BA77DE3F4F4A}',\n name: 'PivotTable2',\n cacheId,\n applyNumberFormats: '0',\n applyBorderFormats: '0',\n applyFontFormats: '0',\n applyPatternFormats: '0',\n applyAlignmentFormats: '0',\n applyWidthHeightFormats: '1',\n dataCaption: 'Values',\n updatedVersion: '8',\n minRefreshableVersion: '3',\n useAutoFormatting: '1',\n itemPrintTitles: '1',\n createdVersion: '8',\n indent: '0',\n compact: '0',\n compactData: '0',\n multipleFieldFilters: '0',\n });\n\n // Note: keeping this pretty-printed and verbose for now to ease debugging.\n //\n // location: ref=\"A3:E15\"\n // pivotFields\n // rowFields and rowItems\n // colFields and colItems\n // dataFields\n // pivotTableStyleInfo\n xmlStream.writeXml(`\n <location ref=\"A3:E15\" firstHeaderRow=\"1\" firstDataRow=\"2\" firstDataCol=\"1\" />\n <pivotFields count=\"${cacheFields.length}\">\n ${renderPivotFields(model)}\n </pivotFields>\n <rowFields count=\"${rows.length}\">\n ${rows.map(rowIndex => `<field x=\"${rowIndex}\" />`).join('\\n ')}\n </rowFields>\n <rowItems count=\"1\">\n <i t=\"grand\"><x /></i>\n </rowItems>\n <colFields count=\"${columns.length}\">\n ${columns.map(columnIndex => `<field x=\"${columnIndex}\" />`).join('\\n ')}\n </colFields>\n <colItems count=\"1\">\n <i t=\"grand\"><x /></i>\n </colItems>\n <dataFields count=\"${values.length}\">\n <dataField\n name=\"Sum of ${cacheFields[values[0]].name}\"\n fld=\"${values[0]}\"\n baseField=\"0\"\n baseItem=\"0\"\n />\n </dataFields>\n <pivotTableStyleInfo\n name=\"PivotStyleLight16\"\n showRowHeaders=\"1\"\n showColHeaders=\"1\"\n showRowStripes=\"0\"\n showColStripes=\"0\"\n showLastColumn=\"1\"\n />\n <extLst>\n <ext\n uri=\"{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}\"\n xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"\n >\n <x14:pivotTableDefinition\n hideValuesRow=\"1\"\n xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"\n />\n </ext>\n <ext\n uri=\"{747A6164-185A-40DC-8AA5-F01512510D54}\"\n xmlns:xpdl=\"http://schemas.microsoft.com/office/spreadsheetml/2016/pivotdefaultlayout\"\n >\n <xpdl:pivotTableDefinition16\n EnabledSubtotalsDefault=\"0\"\n SubtotalsOnTopDefault=\"0\"\n />\n </ext>\n </extLst>\n `);\n\n xmlStream.closeNode();\n }\n\n parseOpen(node) {\n // TK\n }\n\n parseText(text) {\n // TK\n }\n\n parseClose(name) {\n // TK\n }\n\n reconcile(model, options) {\n // TK\n }\n}\n\n// Helpers\n\nfunction renderPivotFields(pivotTable) {\n /* eslint-disable no-nested-ternary */\n return pivotTable.cacheFields\n .map((cacheField, fieldIndex) => {\n const fieldType =\n pivotTable.rows.indexOf(fieldIndex) >= 0\n ? 'row'\n : pivotTable.columns.indexOf(fieldIndex) >= 0\n ? 'column'\n : pivotTable.values.indexOf(fieldIndex) >= 0\n ? 'value'\n : null;\n return renderPivotField(fieldType, cacheField.sharedItems);\n })\n .join('');\n}\n\nfunction renderPivotField(fieldType, sharedItems) {\n // fieldType: 'row', 'column', 'value', null\n\n const defaultAttributes = 'compact=\"0\" outline=\"0\" showAll=\"0\" defaultSubtotal=\"0\"';\n\n if (fieldType === 'row' || fieldType === 'column') {\n const axis = fieldType === 'row' ? 'axisRow' : 'axisCol';\n return `\n <pivotField axis=\"${axis}\" ${defaultAttributes}>\n <items count=\"${sharedItems.length + 1}\">\n ${sharedItems.map((item, index) => `<item x=\"${index}\" />`).join('\\n ')}\n </items>\n </pivotField>\n `;\n }\n return `\n <pivotField\n ${fieldType === 'value' ? 'dataField=\"1\"' : ''}\n ${defaultAttributes}\n />\n `;\n}\n\nPivotTableXform.PIVOT_TABLE_ATTRIBUTES = {\n xmlns: 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',\n 'xmlns:mc': 'http://schemas.openxmlformats.org/markup-compatibility/2006',\n 'mc:Ignorable': 'xr',\n 'xmlns:xr': 'http://schemas.microsoft.com/office/spreadsheetml/2014/revision',\n};\n\nmodule.exports = PivotTableXform;\n"],"mappings":";;AAAA,MAA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AACF,UAAU,CAAC,IAAI,CAAC,GACpC,KAAK,GACLF,UAAU,CAACxC,OAAO,CAAC4C,OAAO,CAACF,UAAU,CAAC,IAAI,CAAC,GAC3C,QAAQ,GACRF,UAAU,CAACvC,MAAM,CAAC2C,OAAO,CAACF,UAAU,CAAC,IAAI,CAAC,GAC1C,OAAO,GACP,IAAI;IACV,OAAOG,gBAAgB,CAACF,SAAS,EAAEF,UAAU,CAACK,WAAW,CAAC;EAC5D,CAAC,CAAC,CACDhB,IAAI,CAAC,EAAE,CAAC;AACb;AAEA,SAASe,gBAAgBA,CAACF,SAAS,EAAEG,WAAW,EAAE;EAChD;;EAEA,MAAMC,iBAAiB,GAAG,yDAAyD;EAEnF,IAAIJ,SAAS,KAAK,KAAK,IAAIA,SAAS,KAAK,QAAQ,EAAE;IACjD,MAAMK,IAAI,GAAGL,SAAS,KAAK,KAAK,GAAG,SAAS,GAAG,SAAS;IACxD,OAAO;AACX,0BAA0BK,IAAI,KAAKD,iBAAiB;AACpD,wBAAwBD,WAAW,CAACnB,MAAM,GAAG,CAAC;AAC9C,YAAYmB,WAAW,CAACrD,GAAG,CAAC,CAACwD,IAAI,EAAEC,KAAK,KAAK,YAAYA,KAAK,MAAM,CAAC,CAACpB,IAAI,CAAC,kBAAkB,CAAC;AAC9F;AACA;AACA,KAAK;EACH;EACA,OAAO;AACT;AACA,QAAQa,SAAS,KAAK,OAAO,GAAG,eAAe,GAAG,EAAE;AACpD,QAAQI,iBAAiB;AACzB;AACA,GAAG;AACH;AAEAxD,eAAe,CAACiB,sBAAsB,GAAG;EACvC2C,KAAK,EAAE,2DAA2D;EAClE,UAAU,EAAE,6DAA6D;EACzE,cAAc,EAAE,IAAI;EACpB,UAAU,EAAE;AACd,CAAC;AAEDC,MAAM,CAACC,OAAO,GAAG9D,eAAe","ignoreList":[]}
|
|
@@ -24,7 +24,7 @@ class AutoFilterXform extends BaseXform {
|
|
|
24
24
|
const secondAddress = getAddress(model.to);
|
|
25
25
|
if (firstAddress && secondAddress) {
|
|
26
26
|
xmlStream.leafNode('autoFilter', {
|
|
27
|
-
ref:
|
|
27
|
+
ref: `${firstAddress}:${secondAddress}`
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-filter-xform.js","names":["colCache","require","BaseXform","AutoFilterXform","tag","render","xmlStream","model","leafNode","ref","getAddress","addr","row","column","address","firstAddress","from","secondAddress","to","
|
|
1
|
+
{"version":3,"file":"auto-filter-xform.js","names":["colCache","require","BaseXform","AutoFilterXform","tag","render","xmlStream","model","leafNode","ref","getAddress","addr","row","column","address","firstAddress","from","secondAddress","to","parseOpen","node","name","attributes","module","exports"],"sources":["../../../../../lib/xlsx/xform/sheet/auto-filter-xform.js"],"sourcesContent":["const colCache = require('../../../utils/col-cache');\nconst BaseXform = require('../base-xform');\n\nclass AutoFilterXform extends BaseXform {\n get tag() {\n return 'autoFilter';\n }\n\n render(xmlStream, model) {\n if (model) {\n if (typeof model === 'string') {\n // assume range\n xmlStream.leafNode('autoFilter', {ref: model});\n } else {\n const getAddress = function(addr) {\n if (typeof addr === 'string') {\n return addr;\n }\n return colCache.getAddress(addr.row, addr.column).address;\n };\n\n const firstAddress = getAddress(model.from);\n const secondAddress = getAddress(model.to);\n if (firstAddress && secondAddress) {\n xmlStream.leafNode('autoFilter', {ref: `${firstAddress}:${secondAddress}`});\n }\n }\n }\n }\n\n parseOpen(node) {\n if (node.name === 'autoFilter') {\n this.model = node.attributes.ref;\n }\n }\n}\n\nmodule.exports = AutoFilterXform;\n"],"mappings":";;AAAA,MAAMA,QAAQ,GAAGC,OAAO,CAAC,0BAA0B,CAAC;AACpD,MAAMC,SAAS,GAAGD,OAAO,CAAC,eAAe,CAAC;AAE1C,MAAME,eAAe,SAASD,SAAS,CAAC;EACtC,IAAIE,GAAGA,CAAA,EAAG;IACR,OAAO,YAAY;EACrB;EAEAC,MAAMA,CAACC,SAAS,EAAEC,KAAK,EAAE;IACvB,IAAIA,KAAK,EAAE;MACT,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;QAC7B;QACAD,SAAS,CAACE,QAAQ,CAAC,YAAY,EAAE;UAACC,GAAG,EAAEF;QAAK,CAAC,CAAC;MAChD,CAAC,MAAM;QACL,MAAMG,UAAU,GAAG,SAAAA,CAASC,IAAI,EAAE;UAChC,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;YAC5B,OAAOA,IAAI;UACb;UACA,OAAOX,QAAQ,CAACU,UAAU,CAACC,IAAI,CAACC,GAAG,EAAED,IAAI,CAACE,MAAM,CAAC,CAACC,OAAO;QAC3D,CAAC;QAED,MAAMC,YAAY,GAAGL,UAAU,CAACH,KAAK,CAACS,IAAI,CAAC;QAC3C,MAAMC,aAAa,GAAGP,UAAU,CAACH,KAAK,CAACW,EAAE,CAAC;QAC1C,IAAIH,YAAY,IAAIE,aAAa,EAAE;UACjCX,SAAS,CAACE,QAAQ,CAAC,YAAY,EAAE;YAACC,GAAG,EAAE,GAAGM,YAAY,IAAIE,aAAa;UAAE,CAAC,CAAC;QAC7E;MACF;IACF;EACF;EAEAE,SAASA,CAACC,IAAI,EAAE;IACd,IAAIA,IAAI,CAACC,IAAI,KAAK,YAAY,EAAE;MAC9B,IAAI,CAACd,KAAK,GAAGa,IAAI,CAACE,UAAU,CAACb,GAAG;IAClC;EACF;AACF;AAEAc,MAAM,CAACC,OAAO,GAAGrB,eAAe","ignoreList":[]}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
3
|
const utils = require('../../../utils/utils');
|
|
9
4
|
const BaseXform = require('../base-xform');
|
|
10
5
|
const Range = require('../../../doc/range');
|
|
@@ -59,9 +54,10 @@ class CellXform extends BaseXform {
|
|
|
59
54
|
model.styleId = styleId;
|
|
60
55
|
}
|
|
61
56
|
if (model.comment) {
|
|
62
|
-
options.comments.push(
|
|
57
|
+
options.comments.push({
|
|
58
|
+
...model.comment,
|
|
63
59
|
ref: model.address
|
|
64
|
-
})
|
|
60
|
+
});
|
|
65
61
|
}
|
|
66
62
|
switch (model.type) {
|
|
67
63
|
case Enums.ValueType.String:
|
|
@@ -101,7 +97,7 @@ class CellXform extends BaseXform {
|
|
|
101
97
|
} else if (model.sharedFormula) {
|
|
102
98
|
const master = options.formulae[model.sharedFormula];
|
|
103
99
|
if (!master) {
|
|
104
|
-
throw new Error(
|
|
100
|
+
throw new Error(`Shared Formula master must exist above and or left of clone for cell ${model.address}`);
|
|
105
101
|
}
|
|
106
102
|
if (master.si === undefined) {
|
|
107
103
|
master.shareType = 'shared';
|