xls-codec 4.8.0 → 4.9.0
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 +5 -4
- package/dist/biff/cursor.cjs +12 -1
- package/dist/biff/cursor.d.cts +1 -1
- package/dist/biff/cursor.d.ts +1 -1
- package/dist/biff/cursor.js +12 -1
- package/dist/biff/ptg.cjs +16 -2
- package/dist/biff/ptg.d.cts +2 -2
- package/dist/biff/ptg.d.ts +2 -2
- package/dist/biff/ptg.js +16 -3
- package/dist/biff/record-types.cjs +4 -1
- package/dist/biff/record-types.d.cts +4 -2
- package/dist/biff/record-types.d.ts +4 -2
- package/dist/biff/record-types.js +4 -2
- package/dist/biff/strings.d.cts +1 -1
- package/dist/biff/strings.d.ts +1 -1
- package/dist/biff/xf-colors.d.cts +1 -1
- package/dist/biff/xf-colors.d.ts +1 -1
- package/dist/biff/xf-writer.d.cts +1 -1
- package/dist/biff/xf-writer.d.ts +1 -1
- package/dist/{conditional-format-12-Xl52VBCj.d.ts → conditional-format-12-C3nwy1f8.d.ts} +9 -4
- package/dist/{conditional-format-12-CZ43-CR4.d.cts → conditional-format-12-D65-ruTq.d.cts} +9 -4
- package/dist/conditional-format-BRMUTRP1.d.ts +41 -0
- package/dist/conditional-format-Cth_afMy.d.cts +41 -0
- package/dist/content.cjs +10 -0
- package/dist/content.js +10 -0
- package/dist/{cursor-VMtw9uVP.d.cts → cursor-CnEuX5qE.d.cts} +3 -1
- package/dist/{cursor-VMtw9uVP.d.ts → cursor-CnEuX5qE.d.ts} +3 -1
- package/dist/{data-validation-lJWM9-AP.d.cts → data-validation-BgUt8CbE.d.cts} +1 -1
- package/dist/{data-validation-BeYpL3Nb.d.ts → data-validation-Cq6iD8lB.d.ts} +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{ptg-CCBbJLZJ.d.cts → ptg-75v7MhaA.d.cts} +7 -1
- package/dist/{ptg-CCBbJLZJ.d.ts → ptg-75v7MhaA.d.ts} +7 -1
- package/dist/workbook/chart.d.cts +1 -1
- package/dist/workbook/chart.d.ts +1 -1
- package/dist/workbook/conditional-format-12.cjs +32 -1
- package/dist/workbook/conditional-format-12.d.cts +2 -2
- package/dist/workbook/conditional-format-12.d.ts +2 -2
- package/dist/workbook/conditional-format-12.js +33 -3
- package/dist/workbook/conditional-format-ex.cjs +53 -0
- package/dist/workbook/conditional-format-ex.d.cts +13 -0
- package/dist/workbook/conditional-format-ex.d.ts +13 -0
- package/dist/workbook/conditional-format-ex.js +52 -0
- package/dist/workbook/conditional-format.cjs +46 -23
- package/dist/workbook/conditional-format.d.cts +2 -2
- package/dist/workbook/conditional-format.d.ts +2 -2
- package/dist/workbook/conditional-format.js +46 -23
- package/dist/workbook/data-validation.d.cts +1 -1
- package/dist/workbook/data-validation.d.ts +1 -1
- package/dist/workbook/drawing.d.cts +1 -1
- package/dist/workbook/drawing.d.ts +1 -1
- package/dist/workbook/globals-writer.d.cts +1 -1
- package/dist/workbook/globals-writer.d.ts +1 -1
- package/dist/workbook/globals.d.cts +2 -2
- package/dist/workbook/globals.d.ts +2 -2
- package/dist/workbook/sheet.cjs +11 -0
- package/dist/workbook/sheet.d.cts +4 -4
- package/dist/workbook/sheet.d.ts +4 -4
- package/dist/workbook/sheet.js +12 -1
- package/dist/{xf-colors-mqerVt2O.d.cts → xf-colors-aeH9Ax3Q.d.cts} +1 -1
- package/dist/{xf-colors-d3OvRw76.d.ts → xf-colors-kdNsiNYt.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/conditional-format-Bt1vRWgc.d.cts +0 -29
- package/dist/conditional-format-Cqcjnm7O.d.ts +0 -29
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as FormulaSheetContext } from "./ptg-
|
|
1
|
+
import { r as FormulaSheetContext } from "./ptg-75v7MhaA.js";
|
|
2
2
|
import { t as RecordGroup } from "./substreams-CgTHx5kX.js";
|
|
3
3
|
import { ContentSheetRange, SheetRuleOperator } from "document-schema.js";
|
|
4
4
|
//#region src/workbook/data-validation.d.ts
|
package/dist/index.cjs
CHANGED
|
@@ -49,6 +49,7 @@ exports.RECORD_CALCREFMODE = require_biff_record_types.RECORD_CALCREFMODE;
|
|
|
49
49
|
exports.RECORD_CALCSAVERECALC = require_biff_record_types.RECORD_CALCSAVERECALC;
|
|
50
50
|
exports.RECORD_CF = require_biff_record_types.RECORD_CF;
|
|
51
51
|
exports.RECORD_CF12 = require_biff_record_types.RECORD_CF12;
|
|
52
|
+
exports.RECORD_CFEX = require_biff_record_types.RECORD_CFEX;
|
|
52
53
|
exports.RECORD_COLINFO = require_biff_record_types.RECORD_COLINFO;
|
|
53
54
|
exports.RECORD_CONDFMT = require_biff_record_types.RECORD_CONDFMT;
|
|
54
55
|
exports.RECORD_CONDFMT12 = require_biff_record_types.RECORD_CONDFMT12;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writeBofData } from "./biff/bof-writer.cjs";
|
|
2
2
|
import { RecordBuilder } from "./biff/builder.cjs";
|
|
3
|
-
import { t as BlockCursor } from "./cursor-
|
|
3
|
+
import { t as BlockCursor } from "./cursor-CnEuX5qE.cjs";
|
|
4
4
|
import { errorCodeOf, errorTextOf } from "./biff/errors.cjs";
|
|
5
|
-
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.cjs";
|
|
5
|
+
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.cjs";
|
|
6
6
|
import { concatRecords, writeRecord } from "./biff/record-writer.cjs";
|
|
7
7
|
import { i as readRecords, n as BiffRecord, r as HEADER_SIZE, t as BiffFormatError } from "./records-G82UEVq8.cjs";
|
|
8
8
|
import { decodeRkNumber } from "./biff/rk.cjs";
|
|
@@ -22,4 +22,4 @@ import { RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, R
|
|
|
22
22
|
import { SheetWriteContext, buildWorksheetSubstream } from "./workbook/sheet-writer.cjs";
|
|
23
23
|
import { writeXls, writeXlsContent } from "./write.cjs";
|
|
24
24
|
export * from "excel-number-format";
|
|
25
|
-
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffRecord, BiffWriteError, BlockCursor, CellFormat, CellXfPlanEntry, DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, RecordBuilder, RecordGroup, SUMMARY_INFORMATION_STREAM, SheetEntry, SheetWriteContext, Substream, WorkbookGlobals, WorkbookGlobalsBuild, WorkbookGlobalsPlan, WorkbookStreams, XlsContentDocument, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
|
25
|
+
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffRecord, BiffWriteError, BlockCursor, CellFormat, CellXfPlanEntry, DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, RecordBuilder, RecordGroup, SUMMARY_INFORMATION_STREAM, SheetEntry, SheetWriteContext, Substream, WorkbookGlobals, WorkbookGlobalsBuild, WorkbookGlobalsPlan, WorkbookStreams, XlsContentDocument, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writeBofData } from "./biff/bof-writer.js";
|
|
2
2
|
import { RecordBuilder } from "./biff/builder.js";
|
|
3
|
-
import { t as BlockCursor } from "./cursor-
|
|
3
|
+
import { t as BlockCursor } from "./cursor-CnEuX5qE.js";
|
|
4
4
|
import { errorCodeOf, errorTextOf } from "./biff/errors.js";
|
|
5
|
-
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
5
|
+
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
6
6
|
import { concatRecords, writeRecord } from "./biff/record-writer.js";
|
|
7
7
|
import { i as readRecords, n as BiffRecord, r as HEADER_SIZE, t as BiffFormatError } from "./records-G82UEVq8.js";
|
|
8
8
|
import { decodeRkNumber } from "./biff/rk.js";
|
|
@@ -22,4 +22,4 @@ import { RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, R
|
|
|
22
22
|
import { SheetWriteContext, buildWorksheetSubstream } from "./workbook/sheet-writer.js";
|
|
23
23
|
import { writeXls, writeXlsContent } from "./write.js";
|
|
24
24
|
export * from "excel-number-format";
|
|
25
|
-
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffRecord, BiffWriteError, BlockCursor, CellFormat, CellXfPlanEntry, DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, RecordBuilder, RecordGroup, SUMMARY_INFORMATION_STREAM, SheetEntry, SheetWriteContext, Substream, WorkbookGlobals, WorkbookGlobalsBuild, WorkbookGlobalsPlan, WorkbookStreams, XlsContentDocument, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
|
25
|
+
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffRecord, BiffWriteError, BlockCursor, CellFormat, CellXfPlanEntry, DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RawCell, RawCellValue, RawColumn, RawPrintSettings, RawRange, RawRow, RawSheet, RecordBuilder, RecordGroup, SUMMARY_INFORMATION_STREAM, SheetEntry, SheetWriteContext, Substream, WorkbookGlobals, WorkbookGlobalsBuild, WorkbookGlobalsPlan, WorkbookStreams, XlsContentDocument, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
1
|
+
import { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
2
2
|
import { BiffFormatError, HEADER_SIZE, readRecords } from "./biff/records.js";
|
|
3
3
|
import { SUMMARY_INFORMATION_STREAM, isXlsFile, readWorkbookStreams } from "./container.js";
|
|
4
4
|
import { DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, columnWidthToPoints, inchesToPoints, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, twipsToPoints } from "./units.js";
|
|
@@ -22,4 +22,4 @@ import { GENERAL_CELL_XF_INDEX, buildWorkbookGlobals } from "./workbook/globals-
|
|
|
22
22
|
import { buildWorksheetSubstream } from "./workbook/sheet-writer.js";
|
|
23
23
|
import { writeXls, writeXlsContent } from "./write.js";
|
|
24
24
|
export * from "excel-number-format";
|
|
25
|
-
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffWriteError, BlockCursor, DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RecordBuilder, SUMMARY_INFORMATION_STREAM, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
|
25
|
+
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, BiffFormatError, BiffWriteError, BlockCursor, DEFAULT_COLUMN_WIDTH_CHARS, DEFAULT_ROW_HEIGHT_PT, GENERAL_CELL_XF_INDEX, HEADER_SIZE, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF, RecordBuilder, SUMMARY_INFORMATION_STREAM, buildWorkbookGlobals, buildWorksheetSubstream, columnWidthToPoints, concatRecords, decodeRkNumber, errorCodeOf, errorTextOf, formatCodeOf, groupRecords, inchesToPoints, isXlsFile, isoDateTimeToSerial, isoDateToSerial, isoTimeToSerial, layoutMetadataToSummaryInformation, millimetresToPoints, pointsToColumnWidth, pointsToInches, pointsToTwips, readRecords, readRichExtendedString, readSheetRecords, readShortXLUnicodeString, readWorkbookGlobals, readWorkbookStreams, readXLUnicodeString, readXLUnicodeStringNoCch, readXls, readXlsContent, recordByteLength, serialToIsoDate, serialToIsoDateTime, serialToIsoTime, splitSubstreams, twipsToPoints, writeBofData, writeCellXfRecord, writeFontRecord, writeFormatRecord, writePaletteRecord, writeRecord, writeRichExtendedString, writeShortXLUnicodeString, writeStyleRecord, writeStyleXfRecord, writeXLUnicodeString, writeXls, writeXlsContent };
|
|
@@ -37,8 +37,14 @@ interface ParseFormulaOptions {
|
|
|
37
37
|
readonly relativeTo?: FormulaOrigin;
|
|
38
38
|
/** The RgbExtra trailer following `rgce` in the same CellParsedFormula/ArrayParsedFormula ([MS-XLS] 7dd67f0a/242bcf20) -- consulted only when `rgce` contains a PtgArray, one PtgExtraArray pulled off the front for each in the order both arrays share ([MS-XLS] 70f743b2: "The order of the structures MUST be the same as the order of the Ptgs"). Absent (or exhausted before a PtgArray needs it) aborts the parse rather than guessing at the array's values. */
|
|
39
39
|
readonly rgcb?: Uint8Array<ArrayBuffer>;
|
|
40
|
+
/** Invoked with the raw, unquoted text of every PtgStr operand this formula contains, in encounter order -- a side channel for a caller that needs a literal string operand out of a formula whose overall shape it isn't otherwise trying to interpret (conditional-format-12.ts's own readCfTextFilterRule, extracting the search text CFExTextTemplateParams itself has no field for). Does not affect the returned formula text, which still renders the same operand quoted via quoteStringLiteral as it always has. */
|
|
41
|
+
readonly onStringLiteral?: (value: string) => void;
|
|
40
42
|
}
|
|
41
43
|
declare function parseFormulaText(rgce: Uint8Array<ArrayBuffer>, context: FormulaSheetContext, options?: ParseFormulaOptions): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the raw text of the first PtgStr operand `rgce` contains, or undefined if it contains none -- a narrower question than parseFormulaText's own "render the whole formula", answerable even when the formula wraps that operand in functions this reader has no other reason to understand. Exists for conditional-format-12.ts's own readCfTextFilterRule: a CF12/CFExNonCF12 containsText-family rule states which of the four text-comparison sub-types it is via CFExTextTemplateParams.ctp, but carries the literal search text nowhere else but as this operand in its own formula (Excel's real generated shape being e.g. NOT(ISERROR(SEARCH("text",A1))) for containsText -- see conditional-format-ex.ts's own top comment for the full citation). Walks the whole token stream via parseFormulaText's own onStringLiteral hook rather than scanning for the PtgStr opcode directly, since a raw byte scan cannot tell an opcode byte from a length or count belonging to some other token's own payload.
|
|
46
|
+
*/
|
|
47
|
+
declare function extractFirstStringLiteral(rgce: Uint8Array<ArrayBuffer>, context: FormulaSheetContext): string | undefined;
|
|
42
48
|
/**
|
|
43
49
|
* If `rgce` is EXACTLY one PtgExp token -- which is the only shape a Formula record belonging to a shared or array formula group ever has, including the group's own base cell, which points at itself -- returns the (row, column) of the Formula record that carries the real expression (a ShrFmla or Array record immediately follows it). Returns undefined for every other rgce, so a caller can try this first and fall back to parseFormulaText for a formula that merely happens to open with byte 0x01 for some other reason (it cannot: no other single-byte-opcode Ptg in this reader's vocabulary is 0x01, but a malformed or foreign rgce is not assumed well-formed here either) or is simply longer than five bytes.
|
|
44
50
|
*
|
|
@@ -46,4 +52,4 @@ declare function parseFormulaText(rgce: Uint8Array<ArrayBuffer>, context: Formul
|
|
|
46
52
|
*/
|
|
47
53
|
declare function readPtgExpBase(rgce: Uint8Array<ArrayBuffer>): FormulaOrigin | undefined;
|
|
48
54
|
//#endregion
|
|
49
|
-
export { SheetRange as a, ParseFormulaOptions as i, FormulaOrigin as n,
|
|
55
|
+
export { SheetRange as a, readPtgExpBase as c, ParseFormulaOptions as i, FormulaOrigin as n, extractFirstStringLiteral as o, FormulaSheetContext as r, parseFormulaText as s, ExternalSheetLabel as t };
|
|
@@ -37,8 +37,14 @@ interface ParseFormulaOptions {
|
|
|
37
37
|
readonly relativeTo?: FormulaOrigin;
|
|
38
38
|
/** The RgbExtra trailer following `rgce` in the same CellParsedFormula/ArrayParsedFormula ([MS-XLS] 7dd67f0a/242bcf20) -- consulted only when `rgce` contains a PtgArray, one PtgExtraArray pulled off the front for each in the order both arrays share ([MS-XLS] 70f743b2: "The order of the structures MUST be the same as the order of the Ptgs"). Absent (or exhausted before a PtgArray needs it) aborts the parse rather than guessing at the array's values. */
|
|
39
39
|
readonly rgcb?: Uint8Array<ArrayBuffer>;
|
|
40
|
+
/** Invoked with the raw, unquoted text of every PtgStr operand this formula contains, in encounter order -- a side channel for a caller that needs a literal string operand out of a formula whose overall shape it isn't otherwise trying to interpret (conditional-format-12.ts's own readCfTextFilterRule, extracting the search text CFExTextTemplateParams itself has no field for). Does not affect the returned formula text, which still renders the same operand quoted via quoteStringLiteral as it always has. */
|
|
41
|
+
readonly onStringLiteral?: (value: string) => void;
|
|
40
42
|
}
|
|
41
43
|
declare function parseFormulaText(rgce: Uint8Array<ArrayBuffer>, context: FormulaSheetContext, options?: ParseFormulaOptions): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the raw text of the first PtgStr operand `rgce` contains, or undefined if it contains none -- a narrower question than parseFormulaText's own "render the whole formula", answerable even when the formula wraps that operand in functions this reader has no other reason to understand. Exists for conditional-format-12.ts's own readCfTextFilterRule: a CF12/CFExNonCF12 containsText-family rule states which of the four text-comparison sub-types it is via CFExTextTemplateParams.ctp, but carries the literal search text nowhere else but as this operand in its own formula (Excel's real generated shape being e.g. NOT(ISERROR(SEARCH("text",A1))) for containsText -- see conditional-format-ex.ts's own top comment for the full citation). Walks the whole token stream via parseFormulaText's own onStringLiteral hook rather than scanning for the PtgStr opcode directly, since a raw byte scan cannot tell an opcode byte from a length or count belonging to some other token's own payload.
|
|
46
|
+
*/
|
|
47
|
+
declare function extractFirstStringLiteral(rgce: Uint8Array<ArrayBuffer>, context: FormulaSheetContext): string | undefined;
|
|
42
48
|
/**
|
|
43
49
|
* If `rgce` is EXACTLY one PtgExp token -- which is the only shape a Formula record belonging to a shared or array formula group ever has, including the group's own base cell, which points at itself -- returns the (row, column) of the Formula record that carries the real expression (a ShrFmla or Array record immediately follows it). Returns undefined for every other rgce, so a caller can try this first and fall back to parseFormulaText for a formula that merely happens to open with byte 0x01 for some other reason (it cannot: no other single-byte-opcode Ptg in this reader's vocabulary is 0x01, but a malformed or foreign rgce is not assumed well-formed here either) or is simply longer than five bytes.
|
|
44
50
|
*
|
|
@@ -46,4 +52,4 @@ declare function parseFormulaText(rgce: Uint8Array<ArrayBuffer>, context: Formul
|
|
|
46
52
|
*/
|
|
47
53
|
declare function readPtgExpBase(rgce: Uint8Array<ArrayBuffer>): FormulaOrigin | undefined;
|
|
48
54
|
//#endregion
|
|
49
|
-
export { SheetRange as a, ParseFormulaOptions as i, FormulaOrigin as n,
|
|
55
|
+
export { SheetRange as a, readPtgExpBase as c, ParseFormulaOptions as i, FormulaOrigin as n, extractFirstStringLiteral as o, FormulaSheetContext as r, parseFormulaText as s, ExternalSheetLabel as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as FormulaSheetContext } from "../ptg-
|
|
1
|
+
import { r as FormulaSheetContext } from "../ptg-75v7MhaA.cjs";
|
|
2
2
|
import { t as RecordGroup } from "../substreams-XDNgDvRJ.cjs";
|
|
3
3
|
import { ContentSheetCell } from "document-schema.js";
|
|
4
4
|
//#region src/workbook/chart.d.ts
|
package/dist/workbook/chart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as FormulaSheetContext } from "../ptg-
|
|
1
|
+
import { r as FormulaSheetContext } from "../ptg-75v7MhaA.js";
|
|
2
2
|
import { t as RecordGroup } from "../substreams-CgTHx5kX.js";
|
|
3
3
|
import { ContentSheetCell } from "document-schema.js";
|
|
4
4
|
//#region src/workbook/chart.d.ts
|
|
@@ -150,6 +150,25 @@ function readCfMultistate(cursor, formulaSheets) {
|
|
|
150
150
|
showValue
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
+
const ICF_TEMPLATE_CONTAINS_TEXT = 8;
|
|
154
|
+
const CTP_TO_TEXT_KIND = /* @__PURE__ */ new Map([
|
|
155
|
+
[0, "containsText"],
|
|
156
|
+
[1, "notContainsText"],
|
|
157
|
+
[2, "beginsWith"],
|
|
158
|
+
[3, "endsWith"]
|
|
159
|
+
]);
|
|
160
|
+
function readCfTextFilterRule(icfTemplate, templateParams, rgce1, formulaSheets) {
|
|
161
|
+
if (icfTemplate !== ICF_TEMPLATE_CONTAINS_TEXT) return;
|
|
162
|
+
const ctp = new require_biff_cursor.BlockCursor([templateParams]).u16();
|
|
163
|
+
const kind = CTP_TO_TEXT_KIND.get(ctp);
|
|
164
|
+
if (kind === void 0) return;
|
|
165
|
+
const text = require_biff_ptg.extractFirstStringLiteral(rgce1, formulaSheets);
|
|
166
|
+
if (text === void 0) return;
|
|
167
|
+
return {
|
|
168
|
+
kind,
|
|
169
|
+
text
|
|
170
|
+
};
|
|
171
|
+
}
|
|
153
172
|
const ICF_TEMPLATE_TOP10 = 5;
|
|
154
173
|
const ICF_TEMPLATE_UNIQUE_VALUES = 7;
|
|
155
174
|
const ICF_TEMPLATE_CONTAINS_BLANKS = 9;
|
|
@@ -223,7 +242,7 @@ function readCf12(record, ranges, formulaSheets) {
|
|
|
223
242
|
const cce2 = cursor.u16();
|
|
224
243
|
const cbDxf = cursor.u32();
|
|
225
244
|
const dxfBytes = cursor.take(cbDxf);
|
|
226
|
-
cursor.
|
|
245
|
+
const rgce1 = cursor.take(cce1);
|
|
227
246
|
cursor.skip(cce2);
|
|
228
247
|
const cceActive = cursor.u16();
|
|
229
248
|
cursor.skip(cceActive);
|
|
@@ -273,6 +292,17 @@ function readCf12(record, ranges, formulaSheets) {
|
|
|
273
292
|
style
|
|
274
293
|
};
|
|
275
294
|
}
|
|
295
|
+
if (ct === 2) {
|
|
296
|
+
const textRule = readCfTextFilterRule(icfTemplate, templateParams, rgce1, formulaSheets);
|
|
297
|
+
if (textRule !== void 0) {
|
|
298
|
+
const style = require_workbook_conditional_format.parseDxfStyle(dxfBytes);
|
|
299
|
+
return {
|
|
300
|
+
...textRule,
|
|
301
|
+
...common,
|
|
302
|
+
style
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
}
|
|
276
306
|
return;
|
|
277
307
|
} catch (err) {
|
|
278
308
|
if (!(err instanceof require_biff_records.BiffFormatError)) throw err;
|
|
@@ -328,4 +358,5 @@ function readCondFmt12Group(records, startIndex, formulaSheets) {
|
|
|
328
358
|
}
|
|
329
359
|
}
|
|
330
360
|
//#endregion
|
|
361
|
+
exports.readCfTextFilterRule = readCfTextFilterRule;
|
|
331
362
|
exports.readCondFmt12Group = readCondFmt12Group;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RawConditionalFormat12, c as
|
|
2
|
-
export { CondFmt12GroupResult, RawAboveAverageFormat, RawCfColor, RawColorScaleFormat, RawConditionalFormat12, RawDataBarFormat, RawIconSetFormat, RawSimpleFilterFormat, RawTimePeriod, RawTimePeriodFormat, RawTop10Format, readCondFmt12Group };
|
|
1
|
+
import { a as RawConditionalFormat12, c as RawIconSetFormat, d as RawTimePeriod, f as RawTimePeriodFormat, h as readCondFmt12Group, i as RawColorScaleFormat, l as RawSimpleFilterFormat, m as readCfTextFilterRule, n as RawAboveAverageFormat, o as RawConditionalFormat12Common, p as RawTop10Format, r as RawCfColor, s as RawDataBarFormat, t as CondFmt12GroupResult, u as RawTextFilterFormat } from "../conditional-format-12-D65-ruTq.cjs";
|
|
2
|
+
export { CondFmt12GroupResult, RawAboveAverageFormat, RawCfColor, RawColorScaleFormat, RawConditionalFormat12, RawConditionalFormat12Common, RawDataBarFormat, RawIconSetFormat, RawSimpleFilterFormat, RawTextFilterFormat, RawTimePeriod, RawTimePeriodFormat, RawTop10Format, readCfTextFilterRule, readCondFmt12Group };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RawConditionalFormat12, c as
|
|
2
|
-
export { CondFmt12GroupResult, RawAboveAverageFormat, RawCfColor, RawColorScaleFormat, RawConditionalFormat12, RawDataBarFormat, RawIconSetFormat, RawSimpleFilterFormat, RawTimePeriod, RawTimePeriodFormat, RawTop10Format, readCondFmt12Group };
|
|
1
|
+
import { a as RawConditionalFormat12, c as RawIconSetFormat, d as RawTimePeriod, f as RawTimePeriodFormat, h as readCondFmt12Group, i as RawColorScaleFormat, l as RawSimpleFilterFormat, m as readCfTextFilterRule, n as RawAboveAverageFormat, o as RawConditionalFormat12Common, p as RawTop10Format, r as RawCfColor, s as RawDataBarFormat, t as CondFmt12GroupResult, u as RawTextFilterFormat } from "../conditional-format-12-C3nwy1f8.js";
|
|
2
|
+
export { CondFmt12GroupResult, RawAboveAverageFormat, RawCfColor, RawColorScaleFormat, RawConditionalFormat12, RawConditionalFormat12Common, RawDataBarFormat, RawIconSetFormat, RawSimpleFilterFormat, RawTextFilterFormat, RawTimePeriod, RawTimePeriodFormat, RawTop10Format, readCfTextFilterRule, readCondFmt12Group };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../biff/record-types.js";
|
|
2
2
|
import { BiffFormatError } from "../biff/records.js";
|
|
3
3
|
import { BlockCursor } from "../biff/cursor.js";
|
|
4
|
-
import { parseFormulaText } from "../biff/ptg.js";
|
|
4
|
+
import { extractFirstStringLiteral, parseFormulaText } from "../biff/ptg.js";
|
|
5
5
|
import { parseDxfStyle } from "./conditional-format.js";
|
|
6
6
|
//#region src/workbook/conditional-format-12.ts
|
|
7
7
|
const CFVO_TYPE_TO_VALUE_TYPE = /* @__PURE__ */ new Map([
|
|
@@ -149,6 +149,25 @@ function readCfMultistate(cursor, formulaSheets) {
|
|
|
149
149
|
showValue
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
+
const ICF_TEMPLATE_CONTAINS_TEXT = 8;
|
|
153
|
+
const CTP_TO_TEXT_KIND = /* @__PURE__ */ new Map([
|
|
154
|
+
[0, "containsText"],
|
|
155
|
+
[1, "notContainsText"],
|
|
156
|
+
[2, "beginsWith"],
|
|
157
|
+
[3, "endsWith"]
|
|
158
|
+
]);
|
|
159
|
+
function readCfTextFilterRule(icfTemplate, templateParams, rgce1, formulaSheets) {
|
|
160
|
+
if (icfTemplate !== ICF_TEMPLATE_CONTAINS_TEXT) return;
|
|
161
|
+
const ctp = new BlockCursor([templateParams]).u16();
|
|
162
|
+
const kind = CTP_TO_TEXT_KIND.get(ctp);
|
|
163
|
+
if (kind === void 0) return;
|
|
164
|
+
const text = extractFirstStringLiteral(rgce1, formulaSheets);
|
|
165
|
+
if (text === void 0) return;
|
|
166
|
+
return {
|
|
167
|
+
kind,
|
|
168
|
+
text
|
|
169
|
+
};
|
|
170
|
+
}
|
|
152
171
|
const ICF_TEMPLATE_TOP10 = 5;
|
|
153
172
|
const ICF_TEMPLATE_UNIQUE_VALUES = 7;
|
|
154
173
|
const ICF_TEMPLATE_CONTAINS_BLANKS = 9;
|
|
@@ -222,7 +241,7 @@ function readCf12(record, ranges, formulaSheets) {
|
|
|
222
241
|
const cce2 = cursor.u16();
|
|
223
242
|
const cbDxf = cursor.u32();
|
|
224
243
|
const dxfBytes = cursor.take(cbDxf);
|
|
225
|
-
cursor.
|
|
244
|
+
const rgce1 = cursor.take(cce1);
|
|
226
245
|
cursor.skip(cce2);
|
|
227
246
|
const cceActive = cursor.u16();
|
|
228
247
|
cursor.skip(cceActive);
|
|
@@ -272,6 +291,17 @@ function readCf12(record, ranges, formulaSheets) {
|
|
|
272
291
|
style
|
|
273
292
|
};
|
|
274
293
|
}
|
|
294
|
+
if (ct === 2) {
|
|
295
|
+
const textRule = readCfTextFilterRule(icfTemplate, templateParams, rgce1, formulaSheets);
|
|
296
|
+
if (textRule !== void 0) {
|
|
297
|
+
const style = parseDxfStyle(dxfBytes);
|
|
298
|
+
return {
|
|
299
|
+
...textRule,
|
|
300
|
+
...common,
|
|
301
|
+
style
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
275
305
|
return;
|
|
276
306
|
} catch (err) {
|
|
277
307
|
if (!(err instanceof BiffFormatError)) throw err;
|
|
@@ -327,4 +357,4 @@ function readCondFmt12Group(records, startIndex, formulaSheets) {
|
|
|
327
357
|
}
|
|
328
358
|
}
|
|
329
359
|
//#endregion
|
|
330
|
-
export { readCondFmt12Group };
|
|
360
|
+
export { readCfTextFilterRule, readCondFmt12Group };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_biff_records = require("../biff/records.cjs");
|
|
3
|
+
const require_biff_cursor = require("../biff/cursor.cjs");
|
|
4
|
+
const require_workbook_conditional_format = require("./conditional-format.cjs");
|
|
5
|
+
const require_workbook_conditional_format_12 = require("./conditional-format-12.cjs");
|
|
6
|
+
//#region src/workbook/conditional-format-ex.ts
|
|
7
|
+
function readCfEx(record, targetsByNID, formulaSheets) {
|
|
8
|
+
try {
|
|
9
|
+
const cursor = new require_biff_cursor.BlockCursor(record.blocks);
|
|
10
|
+
cursor.skip(12);
|
|
11
|
+
const fIsCF12 = cursor.u32();
|
|
12
|
+
const nID = cursor.u16();
|
|
13
|
+
if (fIsCF12 !== 0) return;
|
|
14
|
+
const target = targetsByNID.get(nID);
|
|
15
|
+
if (target === void 0) return;
|
|
16
|
+
const icf = cursor.u16();
|
|
17
|
+
cursor.skip(1);
|
|
18
|
+
const icfTemplate = cursor.u8();
|
|
19
|
+
const priority = cursor.u16();
|
|
20
|
+
const flags = cursor.u8();
|
|
21
|
+
const active = (flags & 1) !== 0;
|
|
22
|
+
const stopIfTrue = (flags >>> 1 & 1) !== 0;
|
|
23
|
+
const fHasDxf = cursor.u8();
|
|
24
|
+
let dxfBytes = /* @__PURE__ */ new Uint8Array(0);
|
|
25
|
+
if (fHasDxf !== 0) {
|
|
26
|
+
const cbDxf = cursor.u32();
|
|
27
|
+
dxfBytes = cursor.take(cbDxf);
|
|
28
|
+
}
|
|
29
|
+
cursor.skip(1);
|
|
30
|
+
const templateParams = cursor.take(16);
|
|
31
|
+
if (!active) return;
|
|
32
|
+
const cf = target.cfs[icf];
|
|
33
|
+
if (cf === void 0) return;
|
|
34
|
+
const textRule = require_workbook_conditional_format_12.readCfTextFilterRule(icfTemplate, templateParams, cf.rgce1, formulaSheets);
|
|
35
|
+
if (textRule === void 0) return;
|
|
36
|
+
const common = {
|
|
37
|
+
priority,
|
|
38
|
+
stopIfTrue,
|
|
39
|
+
ranges: target.ranges
|
|
40
|
+
};
|
|
41
|
+
const style = require_workbook_conditional_format.parseDxfStyle(dxfBytes);
|
|
42
|
+
return {
|
|
43
|
+
...textRule,
|
|
44
|
+
...common,
|
|
45
|
+
style
|
|
46
|
+
};
|
|
47
|
+
} catch (err) {
|
|
48
|
+
if (!(err instanceof require_biff_records.BiffFormatError)) throw err;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.readCfEx = readCfEx;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { r as FormulaSheetContext } from "../ptg-75v7MhaA.cjs";
|
|
2
|
+
import { t as RecordGroup } from "../substreams-XDNgDvRJ.cjs";
|
|
3
|
+
import { n as RawCfOperand } from "../conditional-format-Cth_afMy.cjs";
|
|
4
|
+
import { a as RawConditionalFormat12 } from "../conditional-format-12-D65-ruTq.cjs";
|
|
5
|
+
import { ContentSheetRange } from "document-schema.js";
|
|
6
|
+
//#region src/workbook/conditional-format-ex.d.ts
|
|
7
|
+
interface CfExTarget {
|
|
8
|
+
readonly ranges: ContentSheetRange[];
|
|
9
|
+
readonly cfs: readonly (RawCfOperand | undefined)[];
|
|
10
|
+
}
|
|
11
|
+
declare function readCfEx(record: RecordGroup, targetsByNID: ReadonlyMap<number, CfExTarget>, formulaSheets: FormulaSheetContext): RawConditionalFormat12 | undefined;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { CfExTarget, readCfEx };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { r as FormulaSheetContext } from "../ptg-75v7MhaA.js";
|
|
2
|
+
import { t as RecordGroup } from "../substreams-CgTHx5kX.js";
|
|
3
|
+
import { n as RawCfOperand } from "../conditional-format-BRMUTRP1.js";
|
|
4
|
+
import { a as RawConditionalFormat12 } from "../conditional-format-12-C3nwy1f8.js";
|
|
5
|
+
import { ContentSheetRange } from "document-schema.js";
|
|
6
|
+
//#region src/workbook/conditional-format-ex.d.ts
|
|
7
|
+
interface CfExTarget {
|
|
8
|
+
readonly ranges: ContentSheetRange[];
|
|
9
|
+
readonly cfs: readonly (RawCfOperand | undefined)[];
|
|
10
|
+
}
|
|
11
|
+
declare function readCfEx(record: RecordGroup, targetsByNID: ReadonlyMap<number, CfExTarget>, formulaSheets: FormulaSheetContext): RawConditionalFormat12 | undefined;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { CfExTarget, readCfEx };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { BiffFormatError } from "../biff/records.js";
|
|
2
|
+
import { BlockCursor } from "../biff/cursor.js";
|
|
3
|
+
import { parseDxfStyle } from "./conditional-format.js";
|
|
4
|
+
import { readCfTextFilterRule } from "./conditional-format-12.js";
|
|
5
|
+
//#region src/workbook/conditional-format-ex.ts
|
|
6
|
+
function readCfEx(record, targetsByNID, formulaSheets) {
|
|
7
|
+
try {
|
|
8
|
+
const cursor = new BlockCursor(record.blocks);
|
|
9
|
+
cursor.skip(12);
|
|
10
|
+
const fIsCF12 = cursor.u32();
|
|
11
|
+
const nID = cursor.u16();
|
|
12
|
+
if (fIsCF12 !== 0) return;
|
|
13
|
+
const target = targetsByNID.get(nID);
|
|
14
|
+
if (target === void 0) return;
|
|
15
|
+
const icf = cursor.u16();
|
|
16
|
+
cursor.skip(1);
|
|
17
|
+
const icfTemplate = cursor.u8();
|
|
18
|
+
const priority = cursor.u16();
|
|
19
|
+
const flags = cursor.u8();
|
|
20
|
+
const active = (flags & 1) !== 0;
|
|
21
|
+
const stopIfTrue = (flags >>> 1 & 1) !== 0;
|
|
22
|
+
const fHasDxf = cursor.u8();
|
|
23
|
+
let dxfBytes = /* @__PURE__ */ new Uint8Array(0);
|
|
24
|
+
if (fHasDxf !== 0) {
|
|
25
|
+
const cbDxf = cursor.u32();
|
|
26
|
+
dxfBytes = cursor.take(cbDxf);
|
|
27
|
+
}
|
|
28
|
+
cursor.skip(1);
|
|
29
|
+
const templateParams = cursor.take(16);
|
|
30
|
+
if (!active) return;
|
|
31
|
+
const cf = target.cfs[icf];
|
|
32
|
+
if (cf === void 0) return;
|
|
33
|
+
const textRule = readCfTextFilterRule(icfTemplate, templateParams, cf.rgce1, formulaSheets);
|
|
34
|
+
if (textRule === void 0) return;
|
|
35
|
+
const common = {
|
|
36
|
+
priority,
|
|
37
|
+
stopIfTrue,
|
|
38
|
+
ranges: target.ranges
|
|
39
|
+
};
|
|
40
|
+
const style = parseDxfStyle(dxfBytes);
|
|
41
|
+
return {
|
|
42
|
+
...textRule,
|
|
43
|
+
...common,
|
|
44
|
+
style
|
|
45
|
+
};
|
|
46
|
+
} catch (err) {
|
|
47
|
+
if (!(err instanceof BiffFormatError)) throw err;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { readCfEx };
|
|
@@ -61,27 +61,42 @@ function parseDxfStyle(dxfBytes) {
|
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
/** The shared byte-layout parse both readCf and conditional-format.ts's own readCondFmtGroup need: ct/cp/cce1/cce2, the dxf trailer's own bytes (its length inferred from the record's total size the same way this file always has, since [MS-XLS] never states it directly), and the two formula operands. Returns undefined for a truncated/malformed record rather than throwing, so a caller can fold this into its own try/catch or call it standalone. */
|
|
65
|
+
function parseCfBytes(record) {
|
|
65
66
|
try {
|
|
66
67
|
const cursor = new require_biff_cursor.BlockCursor(record.blocks);
|
|
67
68
|
const ct = cursor.u8();
|
|
68
69
|
const cp = cursor.u8();
|
|
69
70
|
const cce1 = cursor.u16();
|
|
70
71
|
const cce2 = cursor.u16();
|
|
71
|
-
if (ct === 2) return;
|
|
72
|
-
const operator = CP_TO_OPERATOR.get(cp);
|
|
73
|
-
if (operator === void 0) return;
|
|
74
72
|
const dxfLength = require_biff_substreams.recordByteLength(record) - 6 - cce1 - cce2;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
return {
|
|
74
|
+
ct,
|
|
75
|
+
cp,
|
|
76
|
+
dxfBytes: cursor.take(dxfLength),
|
|
77
|
+
rgce1: cursor.take(cce1),
|
|
78
|
+
rgce2: cursor.take(cce2)
|
|
79
|
+
};
|
|
80
|
+
} catch (err) {
|
|
81
|
+
if (!(err instanceof require_biff_records.BiffFormatError)) throw err;
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function readCf(record, ranges, formulaSheets) {
|
|
86
|
+
const parsed = parseCfBytes(record);
|
|
87
|
+
if (parsed === void 0) return;
|
|
88
|
+
const { ct, cp, dxfBytes, rgce1, rgce2 } = parsed;
|
|
89
|
+
if (ct === 2) return;
|
|
90
|
+
const operator = CP_TO_OPERATOR.get(cp);
|
|
91
|
+
if (operator === void 0) return;
|
|
92
|
+
if (rgce1.length === 0) return;
|
|
93
|
+
try {
|
|
79
94
|
const formula1 = require_biff_ptg.parseFormulaText(rgce1, formulaSheets);
|
|
80
95
|
if (formula1 === void 0) return;
|
|
81
96
|
return {
|
|
82
97
|
operator,
|
|
83
98
|
formula1,
|
|
84
|
-
formula2:
|
|
99
|
+
formula2: rgce2.length > 0 ? require_biff_ptg.parseFormulaText(rgce2, formulaSheets) : void 0,
|
|
85
100
|
style: parseDxfStyle(dxfBytes),
|
|
86
101
|
ranges
|
|
87
102
|
};
|
|
@@ -90,16 +105,20 @@ function readCf(record, ranges, formulaSheets) {
|
|
|
90
105
|
return;
|
|
91
106
|
}
|
|
92
107
|
}
|
|
108
|
+
const DEGRADED_CONDFMT_GROUP = {
|
|
109
|
+
formats: [],
|
|
110
|
+
recordsConsumed: 1,
|
|
111
|
+
nID: 0,
|
|
112
|
+
ranges: [],
|
|
113
|
+
rawCfs: []
|
|
114
|
+
};
|
|
93
115
|
function readCondFmtGroup(records, startIndex, formulaSheets) {
|
|
94
116
|
const condFmt = records[startIndex];
|
|
95
|
-
if (condFmt === void 0) return
|
|
96
|
-
formats: [],
|
|
97
|
-
recordsConsumed: 1
|
|
98
|
-
};
|
|
117
|
+
if (condFmt === void 0) return DEGRADED_CONDFMT_GROUP;
|
|
99
118
|
try {
|
|
100
119
|
const cursor = new require_biff_cursor.BlockCursor(condFmt.blocks);
|
|
101
120
|
const ccf = cursor.u16();
|
|
102
|
-
cursor.
|
|
121
|
+
const nID = cursor.u16() >>> 1 & 32767;
|
|
103
122
|
cursor.skip(8);
|
|
104
123
|
const crefCount = cursor.u16();
|
|
105
124
|
const ranges = [];
|
|
@@ -116,25 +135,29 @@ function readCondFmtGroup(records, startIndex, formulaSheets) {
|
|
|
116
135
|
});
|
|
117
136
|
}
|
|
118
137
|
const formats = [];
|
|
138
|
+
const rawCfs = [];
|
|
119
139
|
for (let offset = 1; offset <= ccf; offset += 1) {
|
|
120
140
|
const cfRecord = records[startIndex + offset];
|
|
121
|
-
if (cfRecord?.type !== 433) return
|
|
122
|
-
formats: [],
|
|
123
|
-
recordsConsumed: 1
|
|
124
|
-
};
|
|
141
|
+
if (cfRecord?.type !== 433) return DEGRADED_CONDFMT_GROUP;
|
|
125
142
|
const format = readCf(cfRecord, ranges, formulaSheets);
|
|
126
143
|
if (format !== void 0) formats.push(format);
|
|
144
|
+
const parsed = parseCfBytes(cfRecord);
|
|
145
|
+
rawCfs.push(parsed === void 0 ? void 0 : {
|
|
146
|
+
ct: parsed.ct,
|
|
147
|
+
cp: parsed.cp,
|
|
148
|
+
rgce1: parsed.rgce1
|
|
149
|
+
});
|
|
127
150
|
}
|
|
128
151
|
return {
|
|
129
152
|
formats,
|
|
130
|
-
recordsConsumed: 1 + ccf
|
|
153
|
+
recordsConsumed: 1 + ccf,
|
|
154
|
+
nID,
|
|
155
|
+
ranges,
|
|
156
|
+
rawCfs
|
|
131
157
|
};
|
|
132
158
|
} catch (err) {
|
|
133
159
|
if (!(err instanceof require_biff_records.BiffFormatError)) throw err;
|
|
134
|
-
return
|
|
135
|
-
formats: [],
|
|
136
|
-
recordsConsumed: 1
|
|
137
|
-
};
|
|
160
|
+
return DEGRADED_CONDFMT_GROUP;
|
|
138
161
|
}
|
|
139
162
|
}
|
|
140
163
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { CondFmtGroupResult, RawConditionalFormat, RawConditionalFormatFill, RawConditionalFormatStyle, parseDxfStyle, readCondFmtGroup };
|
|
1
|
+
import { a as RawConditionalFormatStyle, i as RawConditionalFormatFill, n as RawCfOperand, o as parseDxfStyle, r as RawConditionalFormat, s as readCondFmtGroup, t as CondFmtGroupResult } from "../conditional-format-Cth_afMy.cjs";
|
|
2
|
+
export { CondFmtGroupResult, RawCfOperand, RawConditionalFormat, RawConditionalFormatFill, RawConditionalFormatStyle, parseDxfStyle, readCondFmtGroup };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { CondFmtGroupResult, RawConditionalFormat, RawConditionalFormatFill, RawConditionalFormatStyle, parseDxfStyle, readCondFmtGroup };
|
|
1
|
+
import { a as RawConditionalFormatStyle, i as RawConditionalFormatFill, n as RawCfOperand, o as parseDxfStyle, r as RawConditionalFormat, s as readCondFmtGroup, t as CondFmtGroupResult } from "../conditional-format-BRMUTRP1.js";
|
|
2
|
+
export { CondFmtGroupResult, RawCfOperand, RawConditionalFormat, RawConditionalFormatFill, RawConditionalFormatStyle, parseDxfStyle, readCondFmtGroup };
|