read-excel-file 9.3.4 → 9.3.5
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/CHANGELOG.md +6 -2
- package/README.md +32 -2
- package/browser/index.cjs +3 -0
- package/browser/index.d.ts +16 -0
- package/browser/index.js +4 -1
- package/bundle/read-excel-file.min.js +1 -1
- package/bundle/read-excel-file.min.js.map +1 -1
- package/commonjs/export/convertInputToNodeStream.js +0 -12
- package/commonjs/export/convertInputToNodeStream.js.map +1 -1
- package/commonjs/export/parseSheet.js +14 -7
- package/commonjs/export/parseSheet.js.map +1 -1
- package/commonjs/export/readSheetBrowser.js +3 -6
- package/commonjs/export/readSheetBrowser.js.map +1 -1
- package/commonjs/export/readSheetNode.js +3 -6
- package/commonjs/export/readSheetNode.js.map +1 -1
- package/commonjs/export/readSheetUniversal.js +2 -2
- package/commonjs/export/readSheetUniversal.js.map +1 -1
- package/commonjs/export/readSheetWebWorker.js +5 -5
- package/commonjs/export/readSheetWebWorker.js.map +1 -1
- package/commonjs/export/readXlsxFileBrowser.js +3 -6
- package/commonjs/export/readXlsxFileBrowser.js.map +1 -1
- package/commonjs/export/readXlsxFileNode.js +3 -6
- package/commonjs/export/readXlsxFileNode.js.map +1 -1
- package/commonjs/export/readXlsxFileUniversal.js +2 -2
- package/commonjs/export/readXlsxFileUniversal.js.map +1 -1
- package/commonjs/export/readXlsxFileWebWorker.js +5 -5
- package/commonjs/export/readXlsxFileWebWorker.js.map +1 -1
- package/commonjs/export/unpackXlsxFileBrowser.js +15 -4
- package/commonjs/export/unpackXlsxFileBrowser.js.map +1 -1
- package/commonjs/export/unpackXlsxFileBrowser.test.js.map +1 -0
- package/commonjs/export/unpackXlsxFileNode.js +32 -5
- package/commonjs/export/unpackXlsxFileNode.js.map +1 -1
- package/commonjs/export/unpackXlsxFileNode.test.js.map +1 -0
- package/commonjs/export/unpackXlsxFileUniversal.js +14 -3
- package/commonjs/export/unpackXlsxFileUniversal.js.map +1 -1
- package/commonjs/export/unpackXlsxFileUniversal.test.js.map +1 -0
- package/commonjs/parseSheetData/parseSheetData.js +9 -6
- package/commonjs/parseSheetData/parseSheetData.js.map +1 -1
- package/commonjs/utility/convertValuesFromUint8ArraysToStrings.js +100 -0
- package/commonjs/utility/convertValuesFromUint8ArraysToStrings.js.map +1 -0
- package/commonjs/xlsx/InvalidSpreadsheetError.js +55 -0
- package/commonjs/xlsx/InvalidSpreadsheetError.js.map +1 -0
- package/commonjs/xlsx/SheetNotFoundError.js +55 -0
- package/commonjs/xlsx/SheetNotFoundError.js.map +1 -0
- package/commonjs/xlsx/file/InputValidationStream.js +101 -0
- package/commonjs/xlsx/file/InputValidationStream.js.map +1 -0
- package/commonjs/xlsx/file/InputValidationStream.test.js.map +1 -0
- package/commonjs/xlsx/file/InvalidInputError.js +105 -0
- package/commonjs/xlsx/file/InvalidInputError.js.map +1 -0
- package/commonjs/xlsx/file/createFileTypeDetector.js +70 -0
- package/commonjs/xlsx/file/createFileTypeDetector.js.map +1 -0
- package/commonjs/xlsx/file/createFileTypeDetector.test.js.map +1 -0
- package/commonjs/xlsx/file/validateLeadingBytes.js +47 -0
- package/commonjs/xlsx/file/validateLeadingBytes.js.map +1 -0
- package/commonjs/xlsx/file/validateLeadingBytes.test.js.map +1 -0
- package/commonjs/xlsx/isDateFormat.js +32 -27
- package/commonjs/xlsx/isDateFormat.js.map +1 -1
- package/commonjs/xlsx/isDateFormatStyle.js +19 -21
- package/commonjs/xlsx/isDateFormatStyle.js.map +1 -1
- package/commonjs/xlsx/parseCell.js +252 -115
- package/commonjs/xlsx/parseCell.js.map +1 -1
- package/commonjs/xlsx/parseCellAddress.js +22 -18
- package/commonjs/xlsx/parseCellAddress.js.map +1 -1
- package/commonjs/xlsx/parseExcelDate.js +4 -124
- package/commonjs/xlsx/parseExcelDate.js.map +1 -1
- package/commonjs/xlsx/parseExcelDate.test.js.map +1 -1
- package/commonjs/xlsx/parseExcelTimestamp.js +139 -0
- package/commonjs/xlsx/parseExcelTimestamp.js.map +1 -0
- package/commonjs/xlsx/parseFilePaths.js +48 -47
- package/commonjs/xlsx/parseFilePaths.js.map +1 -1
- package/commonjs/xlsx/parseSharedStrings.js +91 -36
- package/commonjs/xlsx/parseSharedStrings.js.map +1 -1
- package/commonjs/xlsx/parseSheet.js +527 -69
- package/commonjs/xlsx/parseSheet.js.map +1 -1
- package/commonjs/xlsx/parseSpreadsheetContents.js +154 -83
- package/commonjs/xlsx/parseSpreadsheetContents.js.map +1 -1
- package/commonjs/xlsx/parseSpreadsheetInfo.js +60 -59
- package/commonjs/xlsx/parseSpreadsheetInfo.js.map +1 -1
- package/commonjs/xlsx/parseStyles.js +75 -75
- package/commonjs/xlsx/parseStyles.js.map +1 -1
- package/commonjs/xml/parseXml.js +112 -0
- package/commonjs/xml/parseXml.js.map +1 -0
- package/commonjs/xml/parseXml.test.js.map +1 -0
- package/commonjs/xml/parseXmlStream.js.map +1 -1
- package/commonjs/xml/parseXmlStream.sax.js +69 -28
- package/commonjs/xml/parseXmlStream.sax.js.map +1 -1
- package/commonjs/xml/parseXmlStream.saxen.js +66 -40
- package/commonjs/xml/parseXmlStream.saxen.js.map +1 -1
- package/commonjs/zip/UnzipError.js +55 -0
- package/commonjs/zip/UnzipError.js.map +1 -0
- package/commonjs/zip/unzipFromArrayBuffer.js +21 -1
- package/commonjs/zip/unzipFromArrayBuffer.js.map +1 -1
- package/commonjs/zip/unzipFromArrayBuffer.test.js.map +1 -0
- package/commonjs/zip/unzipFromStream.fflate.js +43 -35
- package/commonjs/zip/unzipFromStream.fflate.js.map +1 -1
- package/commonjs/zip/unzipFromStream.js +188 -6
- package/commonjs/zip/unzipFromStream.js.map +1 -1
- package/commonjs/zip/unzipFromStream.unzipper.js +19 -34
- package/commonjs/zip/unzipFromStream.unzipper.js.map +1 -1
- package/modules/export/convertInputToNodeStream.js +0 -12
- package/modules/export/convertInputToNodeStream.js.map +1 -1
- package/modules/export/parseSheet.js +13 -6
- package/modules/export/parseSheet.js.map +1 -1
- package/modules/export/readSheetBrowser.js +3 -5
- package/modules/export/readSheetBrowser.js.map +1 -1
- package/modules/export/readSheetNode.js +3 -5
- package/modules/export/readSheetNode.js.map +1 -1
- package/modules/export/readSheetUniversal.js +2 -2
- package/modules/export/readSheetUniversal.js.map +1 -1
- package/modules/export/readSheetWebWorker.js +7 -8
- package/modules/export/readSheetWebWorker.js.map +1 -1
- package/modules/export/readXlsxFileBrowser.js +3 -5
- package/modules/export/readXlsxFileBrowser.js.map +1 -1
- package/modules/export/readXlsxFileNode.js +3 -5
- package/modules/export/readXlsxFileNode.js.map +1 -1
- package/modules/export/readXlsxFileUniversal.js +2 -2
- package/modules/export/readXlsxFileUniversal.js.map +1 -1
- package/modules/export/readXlsxFileWebWorker.js +7 -8
- package/modules/export/readXlsxFileWebWorker.js.map +1 -1
- package/modules/export/unpackXlsxFileBrowser.js +15 -4
- package/modules/export/unpackXlsxFileBrowser.js.map +1 -1
- package/modules/export/unpackXlsxFileBrowser.test.js.map +1 -0
- package/modules/export/unpackXlsxFileNode.js +32 -5
- package/modules/export/unpackXlsxFileNode.js.map +1 -1
- package/modules/export/unpackXlsxFileNode.test.js.map +1 -0
- package/modules/export/unpackXlsxFileUniversal.js +14 -3
- package/modules/export/unpackXlsxFileUniversal.js.map +1 -1
- package/modules/export/unpackXlsxFileUniversal.test.js.map +1 -0
- package/modules/parseSheetData/parseSheetData.js +9 -6
- package/modules/parseSheetData/parseSheetData.js.map +1 -1
- package/modules/utility/convertValuesFromUint8ArraysToStrings.js +92 -0
- package/modules/utility/convertValuesFromUint8ArraysToStrings.js.map +1 -0
- package/modules/xlsx/InvalidSpreadsheetError.js +50 -0
- package/modules/xlsx/InvalidSpreadsheetError.js.map +1 -0
- package/modules/xlsx/SheetNotFoundError.js +50 -0
- package/modules/xlsx/SheetNotFoundError.js.map +1 -0
- package/modules/xlsx/file/InputValidationStream.js +96 -0
- package/modules/xlsx/file/InputValidationStream.js.map +1 -0
- package/modules/xlsx/file/InputValidationStream.test.js.map +1 -0
- package/modules/xlsx/file/InvalidInputError.js +100 -0
- package/modules/xlsx/file/InvalidInputError.js.map +1 -0
- package/modules/xlsx/file/createFileTypeDetector.js +63 -0
- package/modules/xlsx/file/createFileTypeDetector.js.map +1 -0
- package/modules/xlsx/file/createFileTypeDetector.test.js.map +1 -0
- package/modules/xlsx/file/validateLeadingBytes.js +37 -0
- package/modules/xlsx/file/validateLeadingBytes.js.map +1 -0
- package/modules/xlsx/file/validateLeadingBytes.test.js.map +1 -0
- package/modules/xlsx/isDateFormat.js +31 -27
- package/modules/xlsx/isDateFormat.js.map +1 -1
- package/modules/xlsx/isDateFormatStyle.js +18 -21
- package/modules/xlsx/isDateFormatStyle.js.map +1 -1
- package/modules/xlsx/parseCell.js +251 -111
- package/modules/xlsx/parseCell.js.map +1 -1
- package/modules/xlsx/parseCellAddress.js +21 -18
- package/modules/xlsx/parseCellAddress.js.map +1 -1
- package/modules/xlsx/parseExcelDate.js +4 -124
- package/modules/xlsx/parseExcelDate.js.map +1 -1
- package/modules/xlsx/parseExcelDate.test.js.map +1 -1
- package/modules/xlsx/parseExcelTimestamp.js +133 -0
- package/modules/xlsx/parseExcelTimestamp.js.map +1 -0
- package/modules/xlsx/parseFilePaths.js +48 -47
- package/modules/xlsx/parseFilePaths.js.map +1 -1
- package/modules/xlsx/parseSharedStrings.js +91 -37
- package/modules/xlsx/parseSharedStrings.js.map +1 -1
- package/modules/xlsx/parseSheet.js +526 -68
- package/modules/xlsx/parseSheet.js.map +1 -1
- package/modules/xlsx/parseSpreadsheetContents.js +153 -81
- package/modules/xlsx/parseSpreadsheetContents.js.map +1 -1
- package/modules/xlsx/parseSpreadsheetInfo.js +60 -59
- package/modules/xlsx/parseSpreadsheetInfo.js.map +1 -1
- package/modules/xlsx/parseStyles.js +75 -75
- package/modules/xlsx/parseStyles.js.map +1 -1
- package/modules/xml/parseXml.js +106 -0
- package/modules/xml/parseXml.js.map +1 -0
- package/modules/xml/parseXml.test.js.map +1 -0
- package/modules/xml/parseXmlStream.js +2 -0
- package/modules/xml/parseXmlStream.js.map +1 -1
- package/modules/xml/parseXmlStream.sax.js +69 -28
- package/modules/xml/parseXmlStream.sax.js.map +1 -1
- package/modules/xml/parseXmlStream.saxen.js +67 -40
- package/modules/xml/parseXmlStream.saxen.js.map +1 -1
- package/modules/zip/UnzipError.js +49 -0
- package/modules/zip/UnzipError.js.map +1 -0
- package/modules/zip/unzipFromArrayBuffer.js +21 -1
- package/modules/zip/unzipFromArrayBuffer.js.map +1 -1
- package/modules/zip/unzipFromArrayBuffer.test.js.map +1 -0
- package/modules/zip/unzipFromStream.fflate.js +41 -35
- package/modules/zip/unzipFromStream.fflate.js.map +1 -1
- package/modules/zip/unzipFromStream.js +124 -1
- package/modules/zip/unzipFromStream.js.map +1 -1
- package/modules/zip/unzipFromStream.unzipper.js +19 -35
- package/modules/zip/unzipFromStream.unzipper.js.map +1 -1
- package/node/index.cjs +3 -0
- package/node/index.d.ts +16 -0
- package/node/index.js +3 -0
- package/package.json +5 -3
- package/types/InvalidInputError.d.ts +16 -0
- package/types/InvalidSpreadsheetError.d.ts +4 -0
- package/types/SheetNotFoundError.d.ts +4 -0
- package/universal/index.cjs +3 -0
- package/universal/index.d.ts +16 -0
- package/universal/index.js +3 -0
- package/web-worker/index.cjs +3 -0
- package/web-worker/index.d.ts +16 -0
- package/web-worker/index.js +3 -0
- package/commonjs/export/convertValuesFromUint8ArraysToStrings.js +0 -23
- package/commonjs/export/convertValuesFromUint8ArraysToStrings.js.map +0 -1
- package/commonjs/xlsx/convertCellsToData2dArray.js +0 -84
- package/commonjs/xlsx/convertCellsToData2dArray.js.map +0 -1
- package/commonjs/xlsx/dropEmptyColumns.js +0 -40
- package/commonjs/xlsx/dropEmptyColumns.js.map +0 -1
- package/commonjs/xlsx/dropEmptyColumns.test.js.map +0 -1
- package/commonjs/xlsx/dropEmptyRows.js +0 -43
- package/commonjs/xlsx/dropEmptyRows.js.map +0 -1
- package/commonjs/xlsx/dropEmptyRows.test.js.map +0 -1
- package/commonjs/xlsx/parseCellValue.js +0 -189
- package/commonjs/xlsx/parseCellValue.js.map +0 -1
- package/commonjs/xlsx/parseNumber.js +0 -20
- package/commonjs/xlsx/parseNumber.js.map +0 -1
- package/commonjs/xlsx/parseSharedString.js +0 -64
- package/commonjs/xlsx/parseSharedString.js.map +0 -1
- package/commonjs/xlsx/parseSheetData.js +0 -68
- package/commonjs/xlsx/parseSheetData.js.map +0 -1
- package/commonjs/xlsx/reconstructSheetDimensionsFromSheetCells.js +0 -29
- package/commonjs/xlsx/reconstructSheetDimensionsFromSheetCells.js.map +0 -1
- package/commonjs/xml/parseXmlStream.saxen.code.js +0 -953
- package/commonjs/xml/parseXmlStream.saxen.code.js.map +0 -1
- package/commonjs/xml/parseXmlStream.test.js.map +0 -1
- package/modules/export/convertValuesFromUint8ArraysToStrings.js +0 -17
- package/modules/export/convertValuesFromUint8ArraysToStrings.js.map +0 -1
- package/modules/xlsx/convertCellsToData2dArray.js +0 -77
- package/modules/xlsx/convertCellsToData2dArray.js.map +0 -1
- package/modules/xlsx/dropEmptyColumns.js +0 -34
- package/modules/xlsx/dropEmptyColumns.js.map +0 -1
- package/modules/xlsx/dropEmptyColumns.test.js.map +0 -1
- package/modules/xlsx/dropEmptyRows.js +0 -37
- package/modules/xlsx/dropEmptyRows.js.map +0 -1
- package/modules/xlsx/dropEmptyRows.test.js.map +0 -1
- package/modules/xlsx/parseCellValue.js +0 -183
- package/modules/xlsx/parseCellValue.js.map +0 -1
- package/modules/xlsx/parseNumber.js +0 -14
- package/modules/xlsx/parseNumber.js.map +0 -1
- package/modules/xlsx/parseSharedString.js +0 -55
- package/modules/xlsx/parseSharedString.js.map +0 -1
- package/modules/xlsx/parseSheetData.js +0 -55
- package/modules/xlsx/parseSheetData.js.map +0 -1
- package/modules/xlsx/reconstructSheetDimensionsFromSheetCells.js +0 -23
- package/modules/xlsx/reconstructSheetDimensionsFromSheetCells.js.map +0 -1
- package/modules/xml/parseXmlStream.saxen.code.js +0 -947
- package/modules/xml/parseXmlStream.saxen.code.js.map +0 -1
- package/modules/xml/parseXmlStream.test.js.map +0 -1
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createInitialStateInSharedString = createInitialStateInSharedString;
|
|
7
|
-
exports.onCloseTagInSharedString = onCloseTagInSharedString;
|
|
8
|
-
exports.onOpenTagInSharedString = onOpenTagInSharedString;
|
|
9
|
-
exports.onTextInSharedString = onTextInSharedString;
|
|
10
|
-
function createInitialStateInSharedString() {
|
|
11
|
-
return {
|
|
12
|
-
t: false,
|
|
13
|
-
r: false,
|
|
14
|
-
rPh: false,
|
|
15
|
-
string: ''
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// In an XLSX `sharedStrings.xml` file, a <si/> (string item) element can have
|
|
20
|
-
// either a single child <t/> element (meaning that "rich formatting" is not used)
|
|
21
|
-
// or multiple child <r/> elements (meaning that "rich formatting" is used).
|
|
22
|
-
function onOpenTagInSharedString(tagName, attributes, state) {
|
|
23
|
-
// The possible children of <si> are:
|
|
24
|
-
// * <t>: Represents a simple text string. For plain text, this is the only child.
|
|
25
|
-
// * <r>: Represents a rich text run. When a cell contains text where only some words are bolded, colored, or styled differently, multiple <r> elements are used to break the text into formatted segments.
|
|
26
|
-
// * <rPh> (Phonetic Run): Used primarily for East Asian languages to provide phonetic reading/pronunciation data (e.g., furigana in Japanese). It associates a phonetic pronunciation run right alongside the base string text tag <t>.
|
|
27
|
-
// * <phoneticPr>: Defines the phonetic properties used for East Asian languages, specifically mapping how strings should be read for sorting and pronunciation.
|
|
28
|
-
if (tagName === 't') {
|
|
29
|
-
state.t = true;
|
|
30
|
-
} else if (tagName === 'r') {
|
|
31
|
-
// The possible children of <r/> are:
|
|
32
|
-
// * <rPr> (Run Properties): The formatting properties for the text (font, size, color, bold, italic, etc.).
|
|
33
|
-
// * <t> (Text): The actual text payload.
|
|
34
|
-
// * <rPh> (Phonetic Run): Phonetic pronunciation guidance (used for East Asian languages like Japanese). It associates a phonetic pronunciation run right alongside the base string text tag <t>.
|
|
35
|
-
state.r = true;
|
|
36
|
-
} else if (tagName === 'rPh') {
|
|
37
|
-
// The possible children of <rPh/> are:
|
|
38
|
-
// * <t> (Text): Contains the actual phonetic text or reading (usually in Katakana for Japanese) that corresponds to the associated character string.
|
|
39
|
-
state.rPh = true;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function onCloseTagInSharedString(tagName, state) {
|
|
43
|
-
if (tagName === 't') {
|
|
44
|
-
state.t = false;
|
|
45
|
-
} else if (tagName === 'r') {
|
|
46
|
-
state.r = false;
|
|
47
|
-
} else if (tagName === 'rPh') {
|
|
48
|
-
state.rPh = false;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function onTextInSharedString(text, state) {
|
|
52
|
-
if (state.rPh) {
|
|
53
|
-
// Ignore anything inside `<rPh/>` tags
|
|
54
|
-
} else if (state.t) {
|
|
55
|
-
if (state.r) {
|
|
56
|
-
// An `<r/>` element could contain multiple `<t/>` elements,
|
|
57
|
-
// the text content from all of which should be concatenated.
|
|
58
|
-
state.string += text;
|
|
59
|
-
} else {
|
|
60
|
-
state.string = text;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=parseSharedString.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseSharedString.js","names":["createInitialStateInSharedString","t","r","rPh","string","onOpenTagInSharedString","tagName","attributes","state","onCloseTagInSharedString","onTextInSharedString","text"],"sources":["../../source/xlsx/parseSharedString.js"],"sourcesContent":["export function createInitialStateInSharedString() {\r\n\treturn {\r\n\t\tt: false,\r\n\t\tr: false,\r\n\t\trPh: false,\r\n\t\tstring: ''\r\n\t}\r\n}\r\n\r\n// In an XLSX `sharedStrings.xml` file, a <si/> (string item) element can have\r\n// either a single child <t/> element (meaning that \"rich formatting\" is not used)\r\n// or multiple child <r/> elements (meaning that \"rich formatting\" is used).\r\nexport function onOpenTagInSharedString(tagName, attributes, state) {\r\n\t// The possible children of <si> are:\r\n\t// * <t>: Represents a simple text string. For plain text, this is the only child.\r\n\t// * <r>: Represents a rich text run. When a cell contains text where only some words are bolded, colored, or styled differently, multiple <r> elements are used to break the text into formatted segments.\r\n\t// * <rPh> (Phonetic Run): Used primarily for East Asian languages to provide phonetic reading/pronunciation data (e.g., furigana in Japanese). It associates a phonetic pronunciation run right alongside the base string text tag <t>.\r\n\t// * <phoneticPr>: Defines the phonetic properties used for East Asian languages, specifically mapping how strings should be read for sorting and pronunciation.\r\n\tif (tagName === 't') {\r\n\t\tstate.t = true\r\n\t} else if (tagName === 'r') {\r\n\t\t// The possible children of <r/> are:\r\n\t\t// * <rPr> (Run Properties): The formatting properties for the text (font, size, color, bold, italic, etc.).\r\n\t\t// * <t> (Text): The actual text payload.\r\n\t\t// * <rPh> (Phonetic Run): Phonetic pronunciation guidance (used for East Asian languages like Japanese). It associates a phonetic pronunciation run right alongside the base string text tag <t>.\r\n\t\tstate.r = true\r\n\t} else if (tagName === 'rPh') {\r\n\t\t// The possible children of <rPh/> are:\r\n\t\t// * <t> (Text): Contains the actual phonetic text or reading (usually in Katakana for Japanese) that corresponds to the associated character string.\r\n\t\tstate.rPh = true\r\n\t}\r\n}\r\n\r\nexport function onCloseTagInSharedString(tagName, state) {\r\n\tif (tagName === 't') {\r\n\t\tstate.t = false\r\n\t} else if (tagName === 'r') {\r\n\t\tstate.r = false\r\n\t} else if (tagName === 'rPh') {\r\n\t\tstate.rPh = false\r\n\t}\r\n}\r\n\r\nexport function onTextInSharedString(text, state) {\r\n\tif (state.rPh) {\r\n\t\t// Ignore anything inside `<rPh/>` tags\r\n\t} else if (state.t) {\r\n\t\tif (state.r) {\r\n\t\t\t// An `<r/>` element could contain multiple `<t/>` elements,\r\n\t\t\t// the text content from all of which should be concatenated.\r\n\t\t\tstate.string += text\r\n\t\t} else {\r\n\t\t\tstate.string = text\r\n\t\t}\r\n\t}\r\n}"],"mappings":";;;;;;;;;AAAO,SAASA,gCAAgCA,CAAA,EAAG;EAClD,OAAO;IACNC,CAAC,EAAE,KAAK;IACRC,CAAC,EAAE,KAAK;IACRC,GAAG,EAAE,KAAK;IACVC,MAAM,EAAE;EACT,CAAC;AACF;;AAEA;AACA;AACA;AACO,SAASC,uBAAuBA,CAACC,OAAO,EAAEC,UAAU,EAAEC,KAAK,EAAE;EACnE;EACA;EACA;EACA;EACA;EACA,IAAIF,OAAO,KAAK,GAAG,EAAE;IACpBE,KAAK,CAACP,CAAC,GAAG,IAAI;EACf,CAAC,MAAM,IAAIK,OAAO,KAAK,GAAG,EAAE;IAC3B;IACA;IACA;IACA;IACAE,KAAK,CAACN,CAAC,GAAG,IAAI;EACf,CAAC,MAAM,IAAII,OAAO,KAAK,KAAK,EAAE;IAC7B;IACA;IACAE,KAAK,CAACL,GAAG,GAAG,IAAI;EACjB;AACD;AAEO,SAASM,wBAAwBA,CAACH,OAAO,EAAEE,KAAK,EAAE;EACxD,IAAIF,OAAO,KAAK,GAAG,EAAE;IACpBE,KAAK,CAACP,CAAC,GAAG,KAAK;EAChB,CAAC,MAAM,IAAIK,OAAO,KAAK,GAAG,EAAE;IAC3BE,KAAK,CAACN,CAAC,GAAG,KAAK;EAChB,CAAC,MAAM,IAAII,OAAO,KAAK,KAAK,EAAE;IAC7BE,KAAK,CAACL,GAAG,GAAG,KAAK;EAClB;AACD;AAEO,SAASO,oBAAoBA,CAACC,IAAI,EAAEH,KAAK,EAAE;EACjD,IAAIA,KAAK,CAACL,GAAG,EAAE;IACd;EAAA,CACA,MAAM,IAAIK,KAAK,CAACP,CAAC,EAAE;IACnB,IAAIO,KAAK,CAACN,CAAC,EAAE;MACZ;MACA;MACAM,KAAK,CAACJ,MAAM,IAAIO,IAAI;IACrB,CAAC,MAAM;MACNH,KAAK,CAACJ,MAAM,GAAGO,IAAI;IACpB;EACD;AACD"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.createInitialStateInSheetData = createInitialStateInSheetData;
|
|
8
|
-
exports["default"] = parseSheetData;
|
|
9
|
-
exports.onCloseTagInSheetData = onCloseTagInSheetData;
|
|
10
|
-
exports.onOpenTagInSheetData = onOpenTagInSheetData;
|
|
11
|
-
exports.onTextInSheetData = onTextInSheetData;
|
|
12
|
-
var _parseCell = _interopRequireWildcard(require("./parseCell.js"));
|
|
13
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
function parseSheetData(state, sharedStrings, styles, epoch1904, options) {
|
|
16
|
-
return state.cells.map(function (_ref) {
|
|
17
|
-
var attributes = _ref.attributes,
|
|
18
|
-
value = _ref.value,
|
|
19
|
-
inlineString = _ref.inlineString;
|
|
20
|
-
return (0, _parseCell["default"])(attributes, value, inlineString, sharedStrings, styles, epoch1904, options);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function createInitialStateInSheetData() {
|
|
24
|
-
return {
|
|
25
|
-
c: undefined,
|
|
26
|
-
cells: []
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function onOpenTagInSheetData(tagName, attributes, state) {
|
|
30
|
-
if (tagName === 'c') {
|
|
31
|
-
state.c = (0, _parseCell.createInitialStateInCell)();
|
|
32
|
-
state.c.attributes = attributes;
|
|
33
|
-
} else if (state.c) {
|
|
34
|
-
(0, _parseCell.onOpenTagInCell)(tagName, attributes, state.c);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function onCloseTagInSheetData(tagName, state) {
|
|
38
|
-
if (tagName === 'c') {
|
|
39
|
-
state.cells.push({
|
|
40
|
-
attributes: state.c.attributes,
|
|
41
|
-
value: state.c.value,
|
|
42
|
-
inlineString: state.c.inlineString
|
|
43
|
-
});
|
|
44
|
-
state.c = undefined;
|
|
45
|
-
} else if (state.c) {
|
|
46
|
-
(0, _parseCell.onCloseTagInCell)(tagName, state.c);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function onTextInSheetData(text, state) {
|
|
50
|
-
if (state.c) {
|
|
51
|
-
(0, _parseCell.onTextInCell)(text, state.c);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Here, it could also parse "merged cells" and then return them in some special way.
|
|
56
|
-
// But then it's not clear what should be the way to return such merged cells.
|
|
57
|
-
// I.e. should it just return it as a duplicate value in each one of the merged cells?
|
|
58
|
-
// Or should it keep the current behavior of only returning the value of the top-most left-most cell
|
|
59
|
-
// and then just return `null` for the rest of the cells in a "merged cells" group?
|
|
60
|
-
// Perhaps the latter (current) approach is the most sensible one, so there's no need
|
|
61
|
-
// to change anything.
|
|
62
|
-
//
|
|
63
|
-
// const mergedCells = getMergedCellCoordinates(sheetDocument)
|
|
64
|
-
// for (const mergedCell of mergedCells) {
|
|
65
|
-
// const [from, to] = mergedCell.split(':').map(parseCellAddress)
|
|
66
|
-
// console.log('Merged Cell.', 'From:', from, 'To:', to)
|
|
67
|
-
// }
|
|
68
|
-
//# sourceMappingURL=parseSheetData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseSheetData.js","names":["_parseCell","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","parseSheetData","state","sharedStrings","styles","epoch1904","options","cells","map","_ref","attributes","value","inlineString","parseCell","createInitialStateInSheetData","c","undefined","onOpenTagInSheetData","tagName","createInitialStateInCell","onOpenTagInCell","onCloseTagInSheetData","push","onCloseTagInCell","onTextInSheetData","text","onTextInCell"],"sources":["../../source/xlsx/parseSheetData.js"],"sourcesContent":["import parseCell, {\r\n createInitialStateInCell,\r\n onOpenTagInCell,\r\n onCloseTagInCell,\r\n onTextInCell\r\n} from './parseCell.js'\r\n\r\nexport default function parseSheetData(state, sharedStrings, styles, epoch1904, options) {\r\n return state.cells.map(({ attributes, value, inlineString }) => {\r\n return parseCell(\r\n attributes,\r\n value,\r\n inlineString,\r\n sharedStrings,\r\n styles,\r\n epoch1904,\r\n options\r\n )\r\n })\r\n}\r\n\r\nexport function createInitialStateInSheetData() {\r\n return {\r\n c: undefined,\r\n cells: []\r\n }\r\n}\r\n\r\nexport function onOpenTagInSheetData(tagName, attributes, state) {\r\n if (tagName === 'c') {\r\n state.c = createInitialStateInCell()\r\n state.c.attributes = attributes\r\n } else if (state.c) {\r\n onOpenTagInCell(tagName, attributes, state.c)\r\n }\r\n}\r\n\r\nexport function onCloseTagInSheetData(tagName, state) {\r\n if (tagName === 'c') {\r\n state.cells.push({\r\n attributes: state.c.attributes,\r\n value: state.c.value,\r\n inlineString: state.c.inlineString\r\n })\r\n state.c = undefined\r\n } else if (state.c) {\r\n onCloseTagInCell(tagName, state.c)\r\n }\r\n}\r\n\r\nexport function onTextInSheetData(text, state) {\r\n if (state.c) {\r\n onTextInCell(text, state.c)\r\n }\r\n}\r\n\r\n// Here, it could also parse \"merged cells\" and then return them in some special way.\r\n// But then it's not clear what should be the way to return such merged cells.\r\n// I.e. should it just return it as a duplicate value in each one of the merged cells?\r\n// Or should it keep the current behavior of only returning the value of the top-most left-most cell\r\n// and then just return `null` for the rest of the cells in a \"merged cells\" group?\r\n// Perhaps the latter (current) approach is the most sensible one, so there's no need\r\n// to change anything.\r\n//\r\n// const mergedCells = getMergedCellCoordinates(sheetDocument)\r\n// for (const mergedCell of mergedCells) {\r\n// const [from, to] = mergedCell.split(':').map(parseCellAddress)\r\n// console.log('Merged Cell.', 'From:', from, 'To:', to)\r\n// }"],"mappings":"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"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = reconstructSheetDimensionsFromSheetCells;
|
|
7
|
-
function reconstructSheetDimensionsFromSheetCells(cells) {
|
|
8
|
-
var comparator = function comparator(a, b) {
|
|
9
|
-
return a - b;
|
|
10
|
-
};
|
|
11
|
-
var allRows = cells.map(function (cell) {
|
|
12
|
-
return cell.row;
|
|
13
|
-
}).sort(comparator);
|
|
14
|
-
var allCols = cells.map(function (cell) {
|
|
15
|
-
return cell.column;
|
|
16
|
-
}).sort(comparator);
|
|
17
|
-
var minRow = allRows[0];
|
|
18
|
-
var maxRow = allRows[allRows.length - 1];
|
|
19
|
-
var minCol = allCols[0];
|
|
20
|
-
var maxCol = allCols[allCols.length - 1];
|
|
21
|
-
return [{
|
|
22
|
-
row: minRow,
|
|
23
|
-
column: minCol
|
|
24
|
-
}, {
|
|
25
|
-
row: maxRow,
|
|
26
|
-
column: maxCol
|
|
27
|
-
}];
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=reconstructSheetDimensionsFromSheetCells.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reconstructSheetDimensionsFromSheetCells.js","names":["reconstructSheetDimensionsFromSheetCells","cells","comparator","a","b","allRows","map","cell","row","sort","allCols","column","minRow","maxRow","length","minCol","maxCol"],"sources":["../../source/xlsx/reconstructSheetDimensionsFromSheetCells.js"],"sourcesContent":["export default function reconstructSheetDimensionsFromSheetCells(cells) {\r\n const comparator = (a, b) => a - b\r\n const allRows = cells.map(cell => cell.row).sort(comparator)\r\n const allCols = cells.map(cell => cell.column).sort(comparator)\r\n const minRow = allRows[0]\r\n const maxRow = allRows[allRows.length - 1]\r\n const minCol = allCols[0]\r\n const maxCol = allCols[allCols.length - 1]\r\n return [\r\n { row: minRow, column: minCol },\r\n { row: maxRow, column: maxCol }\r\n ]\r\n}\r\n"],"mappings":";;;;;;AAAe,SAASA,wCAAwCA,CAACC,KAAK,EAAE;EACtE,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,CAAC,EAAEC,CAAC;IAAA,OAAKD,CAAC,GAAGC,CAAC;EAAA;EAClC,IAAMC,OAAO,GAAGJ,KAAK,CAACK,GAAG,CAAC,UAAAC,IAAI;IAAA,OAAIA,IAAI,CAACC,GAAG;EAAA,EAAC,CAACC,IAAI,CAACP,UAAU,CAAC;EAC5D,IAAMQ,OAAO,GAAGT,KAAK,CAACK,GAAG,CAAC,UAAAC,IAAI;IAAA,OAAIA,IAAI,CAACI,MAAM;EAAA,EAAC,CAACF,IAAI,CAACP,UAAU,CAAC;EAC/D,IAAMU,MAAM,GAAGP,OAAO,CAAC,CAAC,CAAC;EACzB,IAAMQ,MAAM,GAAGR,OAAO,CAACA,OAAO,CAACS,MAAM,GAAG,CAAC,CAAC;EAC1C,IAAMC,MAAM,GAAGL,OAAO,CAAC,CAAC,CAAC;EACzB,IAAMM,MAAM,GAAGN,OAAO,CAACA,OAAO,CAACI,MAAM,GAAG,CAAC,CAAC;EAC1C,OAAO,CACL;IAAEN,GAAG,EAAEI,MAAM;IAAED,MAAM,EAAEI;EAAO,CAAC,EAC/B;IAAEP,GAAG,EAAEK,MAAM;IAAEF,MAAM,EAAEK;EAAO,CAAC,CAChC;AACH"}
|