xls-codec 4.3.0 → 4.5.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 +6 -3
- package/dist/biff/record-types.cjs +15 -0
- package/dist/biff/record-types.d.cts +11 -1
- package/dist/biff/record-types.d.ts +11 -1
- package/dist/biff/record-types.js +11 -1
- package/dist/biff/substreams.cjs +8 -0
- package/dist/biff/substreams.js +8 -0
- package/dist/biff/xf-colors.cjs +61 -0
- package/dist/biff/xf-colors.d.cts +2 -2
- package/dist/biff/xf-colors.d.ts +2 -2
- package/dist/biff/xf-colors.js +61 -1
- package/dist/biff/xf-writer.d.cts +1 -1
- package/dist/biff/xf-writer.d.ts +1 -1
- package/dist/conditional-format-12-DdEL5DL0.d.cts +49 -0
- package/dist/conditional-format-12-Dw82ECRh.d.ts +49 -0
- package/dist/conditional-format-BV2313jL.d.ts +28 -0
- package/dist/conditional-format-DUQuOrNW.d.cts +28 -0
- package/dist/content.cjs +87 -1
- package/dist/content.js +88 -2
- package/dist/index.cjs +5 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/workbook/conditional-format-12.cjs +255 -0
- package/dist/workbook/conditional-format-12.d.cts +2 -0
- package/dist/workbook/conditional-format-12.d.ts +2 -0
- package/dist/workbook/conditional-format-12.js +254 -0
- package/dist/workbook/conditional-format.cjs +141 -0
- package/dist/workbook/conditional-format.d.cts +2 -0
- package/dist/workbook/conditional-format.d.ts +2 -0
- package/dist/workbook/conditional-format.js +140 -0
- package/dist/workbook/globals-writer.d.cts +1 -1
- package/dist/workbook/globals-writer.d.ts +1 -1
- package/dist/workbook/globals.d.cts +1 -1
- package/dist/workbook/globals.d.ts +1 -1
- package/dist/workbook/sheet.cjs +21 -1
- package/dist/workbook/sheet.d.cts +4 -0
- package/dist/workbook/sheet.d.ts +4 -0
- package/dist/workbook/sheet.js +21 -1
- package/dist/{xf-colors--5oxSeI1.d.ts → xf-colors-d3OvRw76.d.ts} +7 -1
- package/dist/{xf-colors-BB5MKq6R.d.cts → xf-colors-mqerVt2O.d.cts} +7 -1
- package/package.json +1 -1
package/dist/content.cjs
CHANGED
|
@@ -115,6 +115,8 @@ function readSheet(entry, sheetIndex, substreams, globals) {
|
|
|
115
115
|
columns: [],
|
|
116
116
|
merges: [],
|
|
117
117
|
dataValidations: [],
|
|
118
|
+
conditionalFormats: [],
|
|
119
|
+
conditionalFormats12: [],
|
|
118
120
|
print: {
|
|
119
121
|
marginsPt: {},
|
|
120
122
|
rowBreaks: [],
|
|
@@ -128,6 +130,7 @@ function readSheet(entry, sheetIndex, substreams, globals) {
|
|
|
128
130
|
const cells = mapCells(raw, globals);
|
|
129
131
|
applyCellComments(comments, cells);
|
|
130
132
|
const dataValidations = mapDataValidations(raw.dataValidations);
|
|
133
|
+
const conditionalFormats = [...mapConditionalFormats(raw.conditionalFormats, globals.palette), ...mapConditionalFormats12(raw.conditionalFormats12, globals.palette)];
|
|
131
134
|
return {
|
|
132
135
|
name: entry.name,
|
|
133
136
|
cells,
|
|
@@ -135,7 +138,90 @@ function readSheet(entry, sheetIndex, substreams, globals) {
|
|
|
135
138
|
rows: mapRows(raw),
|
|
136
139
|
images: [],
|
|
137
140
|
printSettings: mapPrintSettings(raw.print, globals.printNames.get(sheetIndex)),
|
|
138
|
-
...dataValidations.length > 0 ? { dataValidations } : {}
|
|
141
|
+
...dataValidations.length > 0 ? { dataValidations } : {},
|
|
142
|
+
...conditionalFormats.length > 0 ? { conditionalFormats } : {}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function mapConditionalFormats(raw, palette) {
|
|
146
|
+
return raw.map((format) => {
|
|
147
|
+
const style = mapConditionalFormatStyle(format.style, palette);
|
|
148
|
+
return {
|
|
149
|
+
type: "cellIs",
|
|
150
|
+
ranges: format.ranges,
|
|
151
|
+
operator: format.operator,
|
|
152
|
+
formula1: format.formula1,
|
|
153
|
+
...format.formula2 !== void 0 ? { formula2: format.formula2 } : {},
|
|
154
|
+
...style !== void 0 ? { style } : {}
|
|
155
|
+
};
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function mapConditionalFormats12(raw, palette) {
|
|
159
|
+
const results = [];
|
|
160
|
+
for (const format of raw) {
|
|
161
|
+
const common = {
|
|
162
|
+
ranges: format.ranges,
|
|
163
|
+
priority: format.priority,
|
|
164
|
+
...format.stopIfTrue ? { stopIfTrue: true } : {}
|
|
165
|
+
};
|
|
166
|
+
if (format.kind === "colorScale") {
|
|
167
|
+
const stops = mapColorScaleStops(format.stops, palette);
|
|
168
|
+
if (stops === void 0) continue;
|
|
169
|
+
results.push({
|
|
170
|
+
type: "colorScale",
|
|
171
|
+
stops,
|
|
172
|
+
...common
|
|
173
|
+
});
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
if (format.kind === "dataBar") {
|
|
177
|
+
const color = mapCfColor(format.color, palette);
|
|
178
|
+
if (color === void 0) continue;
|
|
179
|
+
results.push({
|
|
180
|
+
type: "dataBar",
|
|
181
|
+
min: format.min,
|
|
182
|
+
max: format.max,
|
|
183
|
+
color,
|
|
184
|
+
...format.showValue ? {} : { showValue: false },
|
|
185
|
+
...common
|
|
186
|
+
});
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
results.push({
|
|
190
|
+
type: "iconSet",
|
|
191
|
+
iconSetType: format.iconSetType,
|
|
192
|
+
thresholds: [...format.thresholds],
|
|
193
|
+
...format.reverse ? { reverse: true } : {},
|
|
194
|
+
...format.showValue ? {} : { showValue: false },
|
|
195
|
+
...common
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return results;
|
|
199
|
+
}
|
|
200
|
+
function mapCfColor(raw, palette) {
|
|
201
|
+
const base = raw.kind === "rgb" ? raw.color : require_biff_xf_colors.resolveIcvColor(raw.icv, palette);
|
|
202
|
+
return base === void 0 ? void 0 : require_biff_xf_colors.applyTint(base, raw.tint);
|
|
203
|
+
}
|
|
204
|
+
function mapColorScaleStops(stops, palette) {
|
|
205
|
+
const mapped = [];
|
|
206
|
+
for (const stop of stops) {
|
|
207
|
+
const color = mapCfColor(stop.color, palette);
|
|
208
|
+
if (color === void 0) return;
|
|
209
|
+
mapped.push({
|
|
210
|
+
value: stop.value,
|
|
211
|
+
color
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
return mapped;
|
|
215
|
+
}
|
|
216
|
+
function mapConditionalFormatStyle(raw, palette) {
|
|
217
|
+
if (raw === void 0) return;
|
|
218
|
+
const textColor = raw.fontColorIcv === void 0 ? void 0 : require_biff_xf_colors.resolveIcvColor(raw.fontColorIcv, palette);
|
|
219
|
+
const fill = raw.fill === void 0 ? void 0 : require_biff_xf_colors.resolveFillBackground(raw.fill.fillPattern, raw.fill.fillForegroundIcv, raw.fill.fillBackgroundIcv, palette);
|
|
220
|
+
const background = fill?.kind === "solid" ? fill.color : void 0;
|
|
221
|
+
if (textColor === void 0 && background === void 0) return;
|
|
222
|
+
return {
|
|
223
|
+
...textColor !== void 0 ? { textColor } : {},
|
|
224
|
+
...background !== void 0 ? { background } : {}
|
|
139
225
|
};
|
|
140
226
|
}
|
|
141
227
|
function mapDataValidations(raw) {
|
package/dist/content.js
CHANGED
|
@@ -4,7 +4,7 @@ import { readWorkbookStreams } from "./container.js";
|
|
|
4
4
|
import { inchesToPoints } from "./units.js";
|
|
5
5
|
import { pageSizeFromSetup } from "./biff/print-setup.js";
|
|
6
6
|
import { groupRecords, splitSubstreams } from "./biff/substreams.js";
|
|
7
|
-
import { resolveBorderEdge, resolveFillBackground } from "./biff/xf-colors.js";
|
|
7
|
+
import { applyTint, resolveBorderEdge, resolveFillBackground, resolveIcvColor } from "./biff/xf-colors.js";
|
|
8
8
|
import { readSheetComments } from "./workbook/comments.js";
|
|
9
9
|
import { serialToIsoDate, serialToIsoDateTime, serialToIsoTime } from "./serial.js";
|
|
10
10
|
import { formatCodeOf, readWorkbookGlobals } from "./workbook/globals.js";
|
|
@@ -114,6 +114,8 @@ function readSheet(entry, sheetIndex, substreams, globals) {
|
|
|
114
114
|
columns: [],
|
|
115
115
|
merges: [],
|
|
116
116
|
dataValidations: [],
|
|
117
|
+
conditionalFormats: [],
|
|
118
|
+
conditionalFormats12: [],
|
|
117
119
|
print: {
|
|
118
120
|
marginsPt: {},
|
|
119
121
|
rowBreaks: [],
|
|
@@ -127,6 +129,7 @@ function readSheet(entry, sheetIndex, substreams, globals) {
|
|
|
127
129
|
const cells = mapCells(raw, globals);
|
|
128
130
|
applyCellComments(comments, cells);
|
|
129
131
|
const dataValidations = mapDataValidations(raw.dataValidations);
|
|
132
|
+
const conditionalFormats = [...mapConditionalFormats(raw.conditionalFormats, globals.palette), ...mapConditionalFormats12(raw.conditionalFormats12, globals.palette)];
|
|
130
133
|
return {
|
|
131
134
|
name: entry.name,
|
|
132
135
|
cells,
|
|
@@ -134,7 +137,90 @@ function readSheet(entry, sheetIndex, substreams, globals) {
|
|
|
134
137
|
rows: mapRows(raw),
|
|
135
138
|
images: [],
|
|
136
139
|
printSettings: mapPrintSettings(raw.print, globals.printNames.get(sheetIndex)),
|
|
137
|
-
...dataValidations.length > 0 ? { dataValidations } : {}
|
|
140
|
+
...dataValidations.length > 0 ? { dataValidations } : {},
|
|
141
|
+
...conditionalFormats.length > 0 ? { conditionalFormats } : {}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function mapConditionalFormats(raw, palette) {
|
|
145
|
+
return raw.map((format) => {
|
|
146
|
+
const style = mapConditionalFormatStyle(format.style, palette);
|
|
147
|
+
return {
|
|
148
|
+
type: "cellIs",
|
|
149
|
+
ranges: format.ranges,
|
|
150
|
+
operator: format.operator,
|
|
151
|
+
formula1: format.formula1,
|
|
152
|
+
...format.formula2 !== void 0 ? { formula2: format.formula2 } : {},
|
|
153
|
+
...style !== void 0 ? { style } : {}
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function mapConditionalFormats12(raw, palette) {
|
|
158
|
+
const results = [];
|
|
159
|
+
for (const format of raw) {
|
|
160
|
+
const common = {
|
|
161
|
+
ranges: format.ranges,
|
|
162
|
+
priority: format.priority,
|
|
163
|
+
...format.stopIfTrue ? { stopIfTrue: true } : {}
|
|
164
|
+
};
|
|
165
|
+
if (format.kind === "colorScale") {
|
|
166
|
+
const stops = mapColorScaleStops(format.stops, palette);
|
|
167
|
+
if (stops === void 0) continue;
|
|
168
|
+
results.push({
|
|
169
|
+
type: "colorScale",
|
|
170
|
+
stops,
|
|
171
|
+
...common
|
|
172
|
+
});
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (format.kind === "dataBar") {
|
|
176
|
+
const color = mapCfColor(format.color, palette);
|
|
177
|
+
if (color === void 0) continue;
|
|
178
|
+
results.push({
|
|
179
|
+
type: "dataBar",
|
|
180
|
+
min: format.min,
|
|
181
|
+
max: format.max,
|
|
182
|
+
color,
|
|
183
|
+
...format.showValue ? {} : { showValue: false },
|
|
184
|
+
...common
|
|
185
|
+
});
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
results.push({
|
|
189
|
+
type: "iconSet",
|
|
190
|
+
iconSetType: format.iconSetType,
|
|
191
|
+
thresholds: [...format.thresholds],
|
|
192
|
+
...format.reverse ? { reverse: true } : {},
|
|
193
|
+
...format.showValue ? {} : { showValue: false },
|
|
194
|
+
...common
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return results;
|
|
198
|
+
}
|
|
199
|
+
function mapCfColor(raw, palette) {
|
|
200
|
+
const base = raw.kind === "rgb" ? raw.color : resolveIcvColor(raw.icv, palette);
|
|
201
|
+
return base === void 0 ? void 0 : applyTint(base, raw.tint);
|
|
202
|
+
}
|
|
203
|
+
function mapColorScaleStops(stops, palette) {
|
|
204
|
+
const mapped = [];
|
|
205
|
+
for (const stop of stops) {
|
|
206
|
+
const color = mapCfColor(stop.color, palette);
|
|
207
|
+
if (color === void 0) return;
|
|
208
|
+
mapped.push({
|
|
209
|
+
value: stop.value,
|
|
210
|
+
color
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return mapped;
|
|
214
|
+
}
|
|
215
|
+
function mapConditionalFormatStyle(raw, palette) {
|
|
216
|
+
if (raw === void 0) return;
|
|
217
|
+
const textColor = raw.fontColorIcv === void 0 ? void 0 : resolveIcvColor(raw.fontColorIcv, palette);
|
|
218
|
+
const fill = raw.fill === void 0 ? void 0 : resolveFillBackground(raw.fill.fillPattern, raw.fill.fillForegroundIcv, raw.fill.fillBackgroundIcv, palette);
|
|
219
|
+
const background = fill?.kind === "solid" ? fill.color : void 0;
|
|
220
|
+
if (textColor === void 0 && background === void 0) return;
|
|
221
|
+
return {
|
|
222
|
+
...textColor !== void 0 ? { textColor } : {},
|
|
223
|
+
...background !== void 0 ? { background } : {}
|
|
138
224
|
};
|
|
139
225
|
}
|
|
140
226
|
function mapDataValidations(raw) {
|
package/dist/index.cjs
CHANGED
|
@@ -43,8 +43,13 @@ exports.RECORD_CALCDELTA = require_biff_record_types.RECORD_CALCDELTA;
|
|
|
43
43
|
exports.RECORD_CALCITER = require_biff_record_types.RECORD_CALCITER;
|
|
44
44
|
exports.RECORD_CALCREFMODE = require_biff_record_types.RECORD_CALCREFMODE;
|
|
45
45
|
exports.RECORD_CALCSAVERECALC = require_biff_record_types.RECORD_CALCSAVERECALC;
|
|
46
|
+
exports.RECORD_CF = require_biff_record_types.RECORD_CF;
|
|
47
|
+
exports.RECORD_CF12 = require_biff_record_types.RECORD_CF12;
|
|
46
48
|
exports.RECORD_COLINFO = require_biff_record_types.RECORD_COLINFO;
|
|
49
|
+
exports.RECORD_CONDFMT = require_biff_record_types.RECORD_CONDFMT;
|
|
50
|
+
exports.RECORD_CONDFMT12 = require_biff_record_types.RECORD_CONDFMT12;
|
|
47
51
|
exports.RECORD_CONTINUE = require_biff_record_types.RECORD_CONTINUE;
|
|
52
|
+
exports.RECORD_CONTINUEFRT12 = require_biff_record_types.RECORD_CONTINUEFRT12;
|
|
48
53
|
exports.RECORD_DATE1904 = require_biff_record_types.RECORD_DATE1904;
|
|
49
54
|
exports.RECORD_DEFAULTROWHEIGHT = require_biff_record_types.RECORD_DEFAULTROWHEIGHT;
|
|
50
55
|
exports.RECORD_DEFCOLWIDTH = require_biff_record_types.RECORD_DEFCOLWIDTH;
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { writeBofData } from "./biff/bof-writer.cjs";
|
|
|
2
2
|
import { RecordBuilder } from "./biff/builder.cjs";
|
|
3
3
|
import { t as BlockCursor } from "./cursor-VMtw9uVP.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_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_COLINFO, RECORD_CONTINUE, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, 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_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_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.cjs";
|
|
6
6
|
import { concatRecords, writeRecord } from "./biff/record-writer.cjs";
|
|
7
7
|
import { n as BiffRecord, r as readRecords, t as BiffFormatError } from "./records-DVIqXFKk.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, GENERAL_CELL_XF_INDEX, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_COLINFO, RECORD_CONTINUE, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, 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, GENERAL_CELL_XF_INDEX, MAX_RECORD_DATA_SIZE, 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_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, 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
|
@@ -2,7 +2,7 @@ import { writeBofData } from "./biff/bof-writer.js";
|
|
|
2
2
|
import { RecordBuilder } from "./biff/builder.js";
|
|
3
3
|
import { t as BlockCursor } from "./cursor-VMtw9uVP.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_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_COLINFO, RECORD_CONTINUE, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, 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_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_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
6
6
|
import { concatRecords, writeRecord } from "./biff/record-writer.js";
|
|
7
7
|
import { n as BiffRecord, r as readRecords, t as BiffFormatError } from "./records-DVIqXFKk.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, GENERAL_CELL_XF_INDEX, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_COLINFO, RECORD_CONTINUE, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, 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, GENERAL_CELL_XF_INDEX, MAX_RECORD_DATA_SIZE, 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_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, 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_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_COLINFO, RECORD_CONTINUE, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, 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_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_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF } from "./biff/record-types.js";
|
|
2
2
|
import { BiffFormatError, readRecords } from "./biff/records.js";
|
|
3
3
|
import { SUMMARY_INFORMATION_STREAM, isXlsFile, readWorkbookStreams } from "./container.js";
|
|
4
4
|
import { 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, GENERAL_CELL_XF_INDEX, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_COLINFO, RECORD_CONTINUE, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, 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, GENERAL_CELL_XF_INDEX, MAX_RECORD_DATA_SIZE, 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_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, 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 };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../biff/record-types.cjs");
|
|
3
|
+
const require_biff_records = require("../biff/records.cjs");
|
|
4
|
+
const require_biff_cursor = require("../biff/cursor.cjs");
|
|
5
|
+
const require_biff_ptg = require("../biff/ptg.cjs");
|
|
6
|
+
//#region src/workbook/conditional-format-12.ts
|
|
7
|
+
const CFVO_TYPE_TO_VALUE_TYPE = /* @__PURE__ */ new Map([
|
|
8
|
+
[1, "num"],
|
|
9
|
+
[2, "min"],
|
|
10
|
+
[3, "max"],
|
|
11
|
+
[4, "percent"],
|
|
12
|
+
[5, "percentile"],
|
|
13
|
+
[7, "formula"]
|
|
14
|
+
]);
|
|
15
|
+
function readCfvo(cursor, formulaSheets) {
|
|
16
|
+
const cfvoType = cursor.u8();
|
|
17
|
+
const type = CFVO_TYPE_TO_VALUE_TYPE.get(cfvoType);
|
|
18
|
+
const cce = cursor.u16();
|
|
19
|
+
const rgce = cursor.take(cce);
|
|
20
|
+
const hasFormula = cce > 0;
|
|
21
|
+
const numValue = !hasFormula && type !== "min" && type !== "max" ? cursor.f64() : void 0;
|
|
22
|
+
if (type === void 0) return;
|
|
23
|
+
if (type === "min" || type === "max") return { type };
|
|
24
|
+
const value = hasFormula ? require_biff_ptg.parseFormulaText(rgce, formulaSheets) : numValue?.toString() ?? void 0;
|
|
25
|
+
if (value === void 0) return;
|
|
26
|
+
return {
|
|
27
|
+
type,
|
|
28
|
+
value
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const XCLR_INDEXED = 1;
|
|
32
|
+
const XCLR_RGB = 2;
|
|
33
|
+
function readCfColor(cursor) {
|
|
34
|
+
const xclrType = cursor.u32();
|
|
35
|
+
if (xclrType === XCLR_INDEXED) return {
|
|
36
|
+
kind: "icv",
|
|
37
|
+
icv: cursor.u32(),
|
|
38
|
+
tint: cursor.f64()
|
|
39
|
+
};
|
|
40
|
+
if (xclrType === XCLR_RGB) {
|
|
41
|
+
const red = cursor.u8();
|
|
42
|
+
const green = cursor.u8();
|
|
43
|
+
const blue = cursor.u8();
|
|
44
|
+
cursor.skip(1);
|
|
45
|
+
const tint = cursor.f64();
|
|
46
|
+
return {
|
|
47
|
+
kind: "rgb",
|
|
48
|
+
color: {
|
|
49
|
+
r: red / 255,
|
|
50
|
+
g: green / 255,
|
|
51
|
+
b: blue / 255
|
|
52
|
+
},
|
|
53
|
+
tint
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
cursor.skip(12);
|
|
57
|
+
}
|
|
58
|
+
function readCfGradient(cursor, formulaSheets) {
|
|
59
|
+
cursor.skip(2);
|
|
60
|
+
cursor.skip(1);
|
|
61
|
+
const cInterpCurve = cursor.u8();
|
|
62
|
+
const cGradientCurve = cursor.u8();
|
|
63
|
+
cursor.skip(1);
|
|
64
|
+
if (cInterpCurve !== cGradientCurve || cInterpCurve < 2 || cInterpCurve > 3) return;
|
|
65
|
+
const values = [];
|
|
66
|
+
for (let index = 0; index < cInterpCurve; index += 1) {
|
|
67
|
+
const value = readCfvo(cursor, formulaSheets);
|
|
68
|
+
cursor.f64();
|
|
69
|
+
if (value === void 0) return;
|
|
70
|
+
values.push(value);
|
|
71
|
+
}
|
|
72
|
+
const colors = [];
|
|
73
|
+
for (let index = 0; index < cGradientCurve; index += 1) {
|
|
74
|
+
cursor.f64();
|
|
75
|
+
const color = readCfColor(cursor);
|
|
76
|
+
if (color === void 0) return;
|
|
77
|
+
colors.push(color);
|
|
78
|
+
}
|
|
79
|
+
const stops = [];
|
|
80
|
+
for (let index = 0; index < values.length; index += 1) {
|
|
81
|
+
const value = values[index];
|
|
82
|
+
const color = colors[index];
|
|
83
|
+
if (value === void 0 || color === void 0) return;
|
|
84
|
+
stops.push({
|
|
85
|
+
value,
|
|
86
|
+
color
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return stops;
|
|
90
|
+
}
|
|
91
|
+
function readCfDatabar(cursor, formulaSheets) {
|
|
92
|
+
cursor.skip(2);
|
|
93
|
+
cursor.skip(1);
|
|
94
|
+
const showValue = (cursor.u8() >>> 1 & 1) !== 0;
|
|
95
|
+
cursor.skip(1);
|
|
96
|
+
cursor.skip(1);
|
|
97
|
+
const color = readCfColor(cursor);
|
|
98
|
+
const min = readCfvo(cursor, formulaSheets);
|
|
99
|
+
const max = readCfvo(cursor, formulaSheets);
|
|
100
|
+
if (color === void 0 || min === void 0 || max === void 0) return;
|
|
101
|
+
return {
|
|
102
|
+
min,
|
|
103
|
+
max,
|
|
104
|
+
color,
|
|
105
|
+
showValue
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
const ICON_SET_TYPE_NAMES = [
|
|
109
|
+
"3Arrows",
|
|
110
|
+
"3ArrowsGray",
|
|
111
|
+
"3Flags",
|
|
112
|
+
"3TrafficLights1",
|
|
113
|
+
"3TrafficLights2",
|
|
114
|
+
"3Signs",
|
|
115
|
+
"3Symbols",
|
|
116
|
+
"3Symbols2",
|
|
117
|
+
"4Arrows",
|
|
118
|
+
"4ArrowsGray",
|
|
119
|
+
"4RedToBlack",
|
|
120
|
+
"4Rating",
|
|
121
|
+
"4TrafficLights",
|
|
122
|
+
"5Arrows",
|
|
123
|
+
"5ArrowsGray",
|
|
124
|
+
"5Rating",
|
|
125
|
+
"5Quarters"
|
|
126
|
+
];
|
|
127
|
+
function readCfMultistate(cursor, formulaSheets) {
|
|
128
|
+
cursor.skip(2);
|
|
129
|
+
cursor.skip(1);
|
|
130
|
+
const cStates = cursor.u8();
|
|
131
|
+
const iIconSet = cursor.u8();
|
|
132
|
+
const flags = cursor.u8();
|
|
133
|
+
const showValue = (flags & 1) === 0;
|
|
134
|
+
const reverse = (flags >>> 2 & 1) !== 0;
|
|
135
|
+
const iconSetType = ICON_SET_TYPE_NAMES[iIconSet];
|
|
136
|
+
if (iconSetType === void 0) return;
|
|
137
|
+
const thresholds = [];
|
|
138
|
+
for (let index = 0; index < cStates; index += 1) {
|
|
139
|
+
const value = readCfvo(cursor, formulaSheets);
|
|
140
|
+
cursor.skip(1);
|
|
141
|
+
cursor.skip(4);
|
|
142
|
+
if (value === void 0) return;
|
|
143
|
+
thresholds.push(value);
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
iconSetType,
|
|
147
|
+
thresholds,
|
|
148
|
+
reverse,
|
|
149
|
+
showValue
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function readCf12(record, ranges, formulaSheets) {
|
|
153
|
+
try {
|
|
154
|
+
const cursor = new require_biff_cursor.BlockCursor(record.blocks);
|
|
155
|
+
cursor.skip(12);
|
|
156
|
+
const ct = cursor.u8();
|
|
157
|
+
cursor.skip(1);
|
|
158
|
+
const cce1 = cursor.u16();
|
|
159
|
+
const cce2 = cursor.u16();
|
|
160
|
+
const cbDxf = cursor.u32();
|
|
161
|
+
cursor.skip(cbDxf);
|
|
162
|
+
cursor.skip(cce1);
|
|
163
|
+
cursor.skip(cce2);
|
|
164
|
+
const cceActive = cursor.u16();
|
|
165
|
+
cursor.skip(cceActive);
|
|
166
|
+
const stopIfTrue = (cursor.u8() & 2) !== 0;
|
|
167
|
+
const priority = cursor.u16();
|
|
168
|
+
cursor.skip(2);
|
|
169
|
+
cursor.skip(1);
|
|
170
|
+
cursor.skip(16);
|
|
171
|
+
const common = {
|
|
172
|
+
priority,
|
|
173
|
+
stopIfTrue,
|
|
174
|
+
ranges
|
|
175
|
+
};
|
|
176
|
+
if (ct === 3) {
|
|
177
|
+
const stops = readCfGradient(cursor, formulaSheets);
|
|
178
|
+
return stops === void 0 ? void 0 : {
|
|
179
|
+
kind: "colorScale",
|
|
180
|
+
stops,
|
|
181
|
+
...common
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
if (ct === 4) {
|
|
185
|
+
const databar = readCfDatabar(cursor, formulaSheets);
|
|
186
|
+
return databar === void 0 ? void 0 : {
|
|
187
|
+
kind: "dataBar",
|
|
188
|
+
...databar,
|
|
189
|
+
...common
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
if (ct === 6) {
|
|
193
|
+
const iconSet = readCfMultistate(cursor, formulaSheets);
|
|
194
|
+
return iconSet === void 0 ? void 0 : {
|
|
195
|
+
kind: "iconSet",
|
|
196
|
+
...iconSet,
|
|
197
|
+
...common
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
return;
|
|
201
|
+
} catch (err) {
|
|
202
|
+
if (!(err instanceof require_biff_records.BiffFormatError)) throw err;
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function readCondFmt12Group(records, startIndex, formulaSheets) {
|
|
207
|
+
const condFmt12 = records[startIndex];
|
|
208
|
+
if (condFmt12 === void 0) return {
|
|
209
|
+
formats: [],
|
|
210
|
+
recordsConsumed: 1
|
|
211
|
+
};
|
|
212
|
+
try {
|
|
213
|
+
const cursor = new require_biff_cursor.BlockCursor(condFmt12.blocks);
|
|
214
|
+
cursor.skip(12);
|
|
215
|
+
const ccf = cursor.u16();
|
|
216
|
+
cursor.skip(2);
|
|
217
|
+
cursor.skip(8);
|
|
218
|
+
const crefCount = cursor.u16();
|
|
219
|
+
const ranges = [];
|
|
220
|
+
for (let index = 0; index < crefCount; index += 1) {
|
|
221
|
+
const startRow = cursor.u16();
|
|
222
|
+
const endRow = cursor.u16();
|
|
223
|
+
const startColumn = cursor.u16();
|
|
224
|
+
const endColumn = cursor.u16();
|
|
225
|
+
ranges.push({
|
|
226
|
+
startRow,
|
|
227
|
+
startColumn,
|
|
228
|
+
endRow,
|
|
229
|
+
endColumn
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
const formats = [];
|
|
233
|
+
for (let offset = 1; offset <= ccf; offset += 1) {
|
|
234
|
+
const cf12Record = records[startIndex + offset];
|
|
235
|
+
if (cf12Record?.type !== 2170) return {
|
|
236
|
+
formats: [],
|
|
237
|
+
recordsConsumed: 1
|
|
238
|
+
};
|
|
239
|
+
const format = readCf12(cf12Record, ranges, formulaSheets);
|
|
240
|
+
if (format !== void 0) formats.push(format);
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
formats,
|
|
244
|
+
recordsConsumed: 1 + ccf
|
|
245
|
+
};
|
|
246
|
+
} catch (err) {
|
|
247
|
+
if (!(err instanceof require_biff_records.BiffFormatError)) throw err;
|
|
248
|
+
return {
|
|
249
|
+
formats: [],
|
|
250
|
+
recordsConsumed: 1
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
//#endregion
|
|
255
|
+
exports.readCondFmt12Group = readCondFmt12Group;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as RawDataBarFormat, i as RawConditionalFormat12, n as RawCfColor, o as RawIconSetFormat, r as RawColorScaleFormat, s as readCondFmt12Group, t as CondFmt12GroupResult } from "../conditional-format-12-DdEL5DL0.cjs";
|
|
2
|
+
export { CondFmt12GroupResult, RawCfColor, RawColorScaleFormat, RawConditionalFormat12, RawDataBarFormat, RawIconSetFormat, readCondFmt12Group };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as RawDataBarFormat, i as RawConditionalFormat12, n as RawCfColor, o as RawIconSetFormat, r as RawColorScaleFormat, s as readCondFmt12Group, t as CondFmt12GroupResult } from "../conditional-format-12-Dw82ECRh.js";
|
|
2
|
+
export { CondFmt12GroupResult, RawCfColor, RawColorScaleFormat, RawConditionalFormat12, RawDataBarFormat, RawIconSetFormat, readCondFmt12Group };
|