@office-kit/xlsx 0.15.0 → 0.17.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 +29 -8
- package/dist/cell/cell.d.ts +12 -19
- package/dist/{cell-Df3cKRIl.mjs → cell-B5OUUdfI.mjs} +13 -7
- package/dist/cell-B5OUUdfI.mjs.map +1 -0
- package/dist/{cell-style-CNsET6WU.mjs → cell-style-DjKKPWDL.mjs} +2 -2
- package/dist/{cell-style-CNsET6WU.mjs.map → cell-style-DjKKPWDL.mjs.map} +1 -1
- package/dist/cell.mjs +1 -1
- package/dist/{coordinate-Bt5Gni2I.mjs → coordinate-CxC88uBk.mjs} +31 -2
- package/dist/coordinate-CxC88uBk.mjs.map +1 -0
- package/dist/{defined-names-Ctu3F6ls.mjs → defined-names-Cmp8rbvI.mjs} +2 -2
- package/dist/{defined-names-Ctu3F6ls.mjs.map → defined-names-Cmp8rbvI.mjs.map} +1 -1
- package/dist/{differential-BPKa7wXi.mjs → differential-7KGzbliB.mjs} +2 -2
- package/dist/{differential-BPKa7wXi.mjs.map → differential-7KGzbliB.mjs.map} +1 -1
- package/dist/{drawing-ZJ3h4VHD.mjs → drawing-Cv6UtInY.mjs} +2 -2
- package/dist/{drawing-ZJ3h4VHD.mjs.map → drawing-Cv6UtInY.mjs.map} +1 -1
- package/dist/drawing.mjs +1 -1
- package/dist/{escape-rnWSPpWY.mjs → escape-rA5UpibT.mjs} +26 -3
- package/dist/escape-rA5UpibT.mjs.map +1 -0
- package/dist/io/load.d.ts +28 -0
- package/dist/io.mjs +2 -2
- package/dist/{load-CspGc399.mjs → load-DIdQ_zum.mjs} +66 -39
- package/dist/{load-CspGc399.mjs.map → load-DIdQ_zum.mjs.map} +1 -1
- package/dist/{manifest-pLmx7KYh.mjs → manifest-BHUYpjUG.mjs} +3 -3
- package/dist/{manifest-pLmx7KYh.mjs.map → manifest-BHUYpjUG.mjs.map} +1 -1
- package/dist/node.mjs +1 -1
- package/dist/packaging.mjs +1 -1
- package/dist/{reader-DHMxLBQV.mjs → reader-pC7bxYAs.mjs} +30 -7
- package/dist/reader-pC7bxYAs.mjs.map +1 -0
- package/dist/{save-DgPf1DyF.mjs → save-ax11Gsw0.mjs} +7 -7
- package/dist/{save-DgPf1DyF.mjs.map → save-ax11Gsw0.mjs.map} +1 -1
- package/dist/schema.mjs +1 -1
- package/dist/{serialize-BC2Wu3bR.mjs → serialize-Dmb6Vtt9.mjs} +23 -6
- package/dist/serialize-Dmb6Vtt9.mjs.map +1 -0
- package/dist/{serializer-C6nm0mRJ.mjs → serializer-dhv07Z6F.mjs} +2 -2
- package/dist/{serializer-C6nm0mRJ.mjs.map → serializer-dhv07Z6F.mjs.map} +1 -1
- package/dist/streaming/string-table.d.ts +7 -0
- package/dist/streaming.mjs +189 -83
- package/dist/streaming.mjs.map +1 -1
- package/dist/styles.mjs +3 -3
- package/dist/{stylesheet-writer-TxsinwbO.mjs → stylesheet-writer-BBYjNSMA.mjs} +201 -118
- package/dist/stylesheet-writer-BBYjNSMA.mjs.map +1 -0
- package/dist/{table-BrP0RwUd.mjs → table-BFi2WmgG.mjs} +2 -2
- package/dist/{table-BrP0RwUd.mjs.map → table-BFi2WmgG.mjs.map} +1 -1
- package/dist/utils/cell-number.d.ts +10 -0
- package/dist/utils/coordinate.d.ts +11 -0
- package/dist/utils/escape.d.ts +17 -0
- package/dist/utils/xsd-boolean.d.ts +9 -0
- package/dist/utils.mjs +2 -2
- package/dist/workbook/shared-strings.d.ts +2 -0
- package/dist/{workbook-DQCslHzY.mjs → workbook-CMel6UcI.mjs} +13 -12
- package/dist/workbook-CMel6UcI.mjs.map +1 -0
- package/dist/workbook.mjs +2 -2
- package/dist/worksheet/writer.d.ts +9 -5
- package/dist/{worksheet-B2NOQ6dM.mjs → worksheet-Cxn2c-jz.mjs} +3 -3
- package/dist/{worksheet-B2NOQ6dM.mjs.map → worksheet-Cxn2c-jz.mjs.map} +1 -1
- package/dist/worksheet.mjs +2 -2
- package/dist/xml.mjs +2 -2
- package/dist/zip.mjs +1 -1
- package/package.json +1 -1
- package/dist/cell-Df3cKRIl.mjs.map +0 -1
- package/dist/coordinate-Bt5Gni2I.mjs.map +0 -1
- package/dist/escape-rnWSPpWY.mjs.map +0 -1
- package/dist/reader-DHMxLBQV.mjs.map +0 -1
- package/dist/serialize-BC2Wu3bR.mjs.map +0 -1
- package/dist/stylesheet-writer-TxsinwbO.mjs.map +0 -1
- package/dist/workbook-DQCslHzY.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ paywall.
|
|
|
36
36
|
|------------------------|----------------------------------------------------------------------------------|-----------------------------------------------------------------------|
|
|
37
37
|
| TypeScript types | hand-written `.d.ts` retrofitted (SheetJS) or community typings (xlsx-populate, excel4node) | first-party, written in TS under `exactOptionalPropertyTypes` + `noUncheckedIndexedAccess` |
|
|
38
38
|
| Bundle size | ExcelJS unpacks to 21.8 MB; xlsx ~7.5 MB | full lib ≤120 KB min+brotli (currently ~85 KB); streaming entry ~49 KB |
|
|
39
|
-
| Streaming | SheetJS docs explicitly note the zip central-directory layout prevents true streaming; ExcelJS supports both directions but the lib is heavy | both read iter and write append, with
|
|
39
|
+
| Streaming | SheetJS docs explicitly note the zip central-directory layout prevents true streaming; ExcelJS supports both directions but the lib is heavy | both read iter and write append, with bounded row buffering and string retention |
|
|
40
40
|
| Charts (write) | none in ExcelJS, xlsx-js-style, SheetJS CE; gated behind SheetJS Pro | 16 legacy `c:` + 8 modern `cx:` chart kinds (Sunburst, Treemap, Waterfall, Histogram, Pareto, Funnel, BoxWhisker, RegionMap) |
|
|
41
41
|
| Pivots / VBA / OLE | ExcelJS drops pivot tables on read ([#261][exceljs-pivot]); others vary | byte-identical passthrough so Excel 365 still renders parts we don't model |
|
|
42
42
|
| Maintenance | ExcelJS stalled since 2023; excel4node archived 2022; xlsx-js-style frozen 2022; SheetJS npm artifact frozen 2022 (still distributed via private CDN) | active |
|
|
@@ -227,7 +227,7 @@ replacing a comment keeps its position. Hyperlink entries must supply `target`
|
|
|
227
227
|
or `location`; the entire batch is validated before the sheet is changed.
|
|
228
228
|
Both APIs preserve the public arrays and allow direct edits between calls.
|
|
229
229
|
|
|
230
|
-
### Streaming write —
|
|
230
|
+
### Streaming write — bounded row buffering and string retention
|
|
231
231
|
|
|
232
232
|
```ts
|
|
233
233
|
import { createWriteOnlyWorkbook } from '@office-kit/xlsx/streaming';
|
|
@@ -237,7 +237,7 @@ const sink = toFile('big.xlsx');
|
|
|
237
237
|
const wb = await createWriteOnlyWorkbook(sink);
|
|
238
238
|
const ws = await wb.addWorksheet('Data');
|
|
239
239
|
ws.setColumnWidth(1, 24); // must precede the first appendRow
|
|
240
|
-
for (let r = 0; r <
|
|
240
|
+
for (let r = 0; r < 1_000_000; r++) {
|
|
241
241
|
await ws.appendRow([r, `row-${r}`, r * Math.PI]);
|
|
242
242
|
}
|
|
243
243
|
await ws.close();
|
|
@@ -246,10 +246,20 @@ await wb.finalize();
|
|
|
246
246
|
|
|
247
247
|
The streaming writer pushes each row through deflate as it arrives, and
|
|
248
248
|
`toFile` forwards each deflated chunk to disk (honouring write-stream
|
|
249
|
-
backpressure)
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
249
|
+
backpressure). Row buffering stays at approximately 64 KiB plus the current
|
|
250
|
+
row and deflate scratch. Plain and rich-text strings share a workbook-wide
|
|
251
|
+
table capped at 100,000 entries and an 8 MiB accounting budget for retained
|
|
252
|
+
keys and serialized XML (two bytes per UTF-16 code unit). This is a payload
|
|
253
|
+
budget, not a total JavaScript heap limit. Once a new value cannot fit, all
|
|
254
|
+
subsequent new values are written as inline strings; previously registered
|
|
255
|
+
values still reuse their shared-string IDs, including on later sheets.
|
|
256
|
+
|
|
257
|
+
Styles and sheet metadata remain resident, so keep their counts bounded when
|
|
258
|
+
exporting large datasets. `toWritable` also streams output; buffered sinks
|
|
259
|
+
(`toBuffer` / `toBlob` / `toArrayBuffer`) keep the full archive resident for
|
|
260
|
+
`result()`. Excel allows at most 1,048,576 rows per sheet; split larger datasets
|
|
261
|
+
across sheets. See [write-only string storage](docs/write-only-strings.md) for
|
|
262
|
+
the storage policy and compatibility details.
|
|
253
263
|
|
|
254
264
|
### Streaming read — iterate row-by-row without materialising the sheet
|
|
255
265
|
|
|
@@ -273,7 +283,18 @@ front**. A 200 MB compressed xlsx therefore needs ~200 MB resident, plus the
|
|
|
273
283
|
inflate window + SAX state per active iterator — not the multi-GB inflated
|
|
274
284
|
worksheet payload. Band queries (`minRow > 1`) build a row-offset index once
|
|
275
285
|
per sheet, which does materialise that sheet's inflated bytes; subsequent
|
|
276
|
-
band queries reuse the cached index.
|
|
286
|
+
band queries reuse the cached index. A sheet whose `<row>` elements omit their
|
|
287
|
+
optional `r` attribute cannot be indexed by row number, so its band queries
|
|
288
|
+
keep streaming the sheet and retain nothing.
|
|
289
|
+
|
|
290
|
+
The two readers differ on damaged input, deliberately. Handed a cell it cannot
|
|
291
|
+
interpret (`<c t="b"><v>yes</v></c>`, an unknown error code, a shared-string
|
|
292
|
+
index past the end of the table) `loadWorkbook` throws an `OpenXmlSchemaError`,
|
|
293
|
+
on the grounds that a wrong value is worse than a failed load.
|
|
294
|
+
`loadWorkbookStream` reads that cell as empty and keeps going, because an
|
|
295
|
+
iterator that throws on row 900,000 leaves you no way to finish the pass.
|
|
296
|
+
Structural problems (a missing part, no `officeDocument` relationship, an
|
|
297
|
+
unknown sheet name) throw in both.
|
|
277
298
|
|
|
278
299
|
### Migrating from openpyxl
|
|
279
300
|
|
package/dist/cell/cell.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export interface FormulaValue {
|
|
|
9
9
|
readonly t: FormulaKind;
|
|
10
10
|
/** Cached value Excel last computed for the cell, used when `data_only` reads it back. */
|
|
11
11
|
readonly cachedValue?: number | string | boolean;
|
|
12
|
+
/** Mark an Excel error token as an error result. Without this, strings stay text, including "#N/A". */
|
|
13
|
+
readonly cachedValueType?: 'error';
|
|
12
14
|
/** Range string (`"A1:A10"`) for array / shared / dataTable formulas. */
|
|
13
15
|
readonly ref?: string;
|
|
14
16
|
/** Shared-formula index. */
|
|
@@ -82,43 +84,33 @@ export declare function bindValue(c: Cell, value: number | string | boolean | Da
|
|
|
82
84
|
* A cached value is optional. Without one, Excel, LibreOffice and Google
|
|
83
85
|
* Sheets compute the result on open, but viewers that never calculate (Quick
|
|
84
86
|
* Look, Outlook and SharePoint previews, most thumbnailers) render the cell
|
|
85
|
-
* empty. Supply one whenever the producer can compute it.
|
|
87
|
+
* empty. Supply one whenever the producer can compute it. For an Excel error,
|
|
88
|
+
* supply `{ cachedValue: '#N/A', cachedValueType: 'error' }`; without the type,
|
|
89
|
+
* the same token is a string result.
|
|
86
90
|
*/
|
|
87
|
-
export declare function makeFormula(formula: string, opts?:
|
|
88
|
-
cachedValue?: FormulaValue['cachedValue'];
|
|
89
|
-
}): FormulaValue;
|
|
91
|
+
export declare function makeFormula(formula: string, opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>): FormulaValue;
|
|
90
92
|
/**
|
|
91
93
|
* Build an array (CSE) formula value spanning `ref`. Belongs on the top-left
|
|
92
94
|
* cell of the range, since Excel reads `ref` to know how far the result
|
|
93
95
|
* spreads.
|
|
94
96
|
*/
|
|
95
|
-
export declare function makeArrayFormula(ref: string, formula: string, opts?:
|
|
96
|
-
cachedValue?: FormulaValue['cachedValue'];
|
|
97
|
-
}): FormulaValue;
|
|
97
|
+
export declare function makeArrayFormula(ref: string, formula: string, opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>): FormulaValue;
|
|
98
98
|
/**
|
|
99
99
|
* Build a shared-formula value. The first cell in the group carries the
|
|
100
100
|
* formula text + `ref`; subsequent cells with the same `si` carry only the
|
|
101
101
|
* index, and Excel reconstructs their text by shifting the references, so
|
|
102
102
|
* their `formula` is legitimately empty.
|
|
103
103
|
*/
|
|
104
|
-
export declare function makeSharedFormula(si: number, formula?: string, ref?: string, opts?:
|
|
105
|
-
cachedValue?: FormulaValue['cachedValue'];
|
|
106
|
-
}): FormulaValue;
|
|
104
|
+
export declare function makeSharedFormula(si: number, formula?: string, ref?: string, opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>): FormulaValue;
|
|
107
105
|
/**
|
|
108
106
|
* Plain `A1+B1` style formula, applied in place. Same value as
|
|
109
107
|
* {@link makeFormula}, for a cell you already hold.
|
|
110
108
|
*/
|
|
111
|
-
export declare function setFormula(c: Cell, formula: string, opts?:
|
|
112
|
-
cachedValue?: FormulaValue['cachedValue'];
|
|
113
|
-
}): void;
|
|
109
|
+
export declare function setFormula(c: Cell, formula: string, opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>): void;
|
|
114
110
|
/** Array (CSE) formula spanning a `ref` range, applied in place. */
|
|
115
|
-
export declare function setArrayFormula(c: Cell, ref: string, formula: string, opts?:
|
|
116
|
-
cachedValue?: FormulaValue['cachedValue'];
|
|
117
|
-
}): void;
|
|
111
|
+
export declare function setArrayFormula(c: Cell, ref: string, formula: string, opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>): void;
|
|
118
112
|
/** Shared formula, applied in place. See {@link makeSharedFormula}. */
|
|
119
|
-
export declare function setSharedFormula(c: Cell, si: number, formula?: string, ref?: string, opts?:
|
|
120
|
-
cachedValue?: FormulaValue['cachedValue'];
|
|
121
|
-
}): void;
|
|
113
|
+
export declare function setSharedFormula(c: Cell, si: number, formula?: string, ref?: string, opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>): void;
|
|
122
114
|
/**
|
|
123
115
|
* Excel data-table formula (`<f t="dataTable">`). These appear as the "What-if
|
|
124
116
|
* Analysis → Data Table" feature output: a 1- or 2-variable sensitivity grid
|
|
@@ -145,6 +137,7 @@ export interface DataTableFormulaOpts {
|
|
|
145
137
|
aca?: boolean;
|
|
146
138
|
ca?: boolean;
|
|
147
139
|
cachedValue?: FormulaValue['cachedValue'];
|
|
140
|
+
cachedValueType?: FormulaValue['cachedValueType'];
|
|
148
141
|
}
|
|
149
142
|
/**
|
|
150
143
|
* Build a data-table formula value. Preserves all the dt-specific attributes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as OpenXmlSchemaError } from "./exceptions-D-CFwxgm.mjs";
|
|
2
|
-
import { a as columnLetterFromIndex, n as MAX_ROW, t as MAX_COL } from "./coordinate-
|
|
2
|
+
import { a as columnLetterFromIndex, n as MAX_ROW, t as MAX_COL } from "./coordinate-CxC88uBk.mjs";
|
|
3
3
|
import { i as startsWithEquals, r as normalizeFormulaText, t as ERROR_CODES } from "./inference-BMvv9cUY.mjs";
|
|
4
4
|
//#region src/cell/rich-text.ts
|
|
5
5
|
function makeTextRun(text, font) {
|
|
@@ -93,14 +93,17 @@ const requireFormulaText = (fn, formula) => {
|
|
|
93
93
|
* A cached value is optional. Without one, Excel, LibreOffice and Google
|
|
94
94
|
* Sheets compute the result on open, but viewers that never calculate (Quick
|
|
95
95
|
* Look, Outlook and SharePoint previews, most thumbnailers) render the cell
|
|
96
|
-
* empty. Supply one whenever the producer can compute it.
|
|
96
|
+
* empty. Supply one whenever the producer can compute it. For an Excel error,
|
|
97
|
+
* supply `{ cachedValue: '#N/A', cachedValueType: 'error' }`; without the type,
|
|
98
|
+
* the same token is a string result.
|
|
97
99
|
*/
|
|
98
100
|
function makeFormula(formula, opts) {
|
|
99
101
|
return Object.freeze({
|
|
100
102
|
kind: "formula",
|
|
101
103
|
t: "normal",
|
|
102
104
|
formula: requireFormulaText("makeFormula", formula),
|
|
103
|
-
...opts?.cachedValue !== void 0 ? { cachedValue: opts.cachedValue } : {}
|
|
105
|
+
...opts?.cachedValue !== void 0 ? { cachedValue: opts.cachedValue } : {},
|
|
106
|
+
...opts?.cachedValueType !== void 0 ? { cachedValueType: opts.cachedValueType } : {}
|
|
104
107
|
});
|
|
105
108
|
}
|
|
106
109
|
/**
|
|
@@ -114,7 +117,8 @@ function makeArrayFormula(ref, formula, opts) {
|
|
|
114
117
|
t: "array",
|
|
115
118
|
formula: requireFormulaText("makeArrayFormula", formula),
|
|
116
119
|
ref,
|
|
117
|
-
...opts?.cachedValue !== void 0 ? { cachedValue: opts.cachedValue } : {}
|
|
120
|
+
...opts?.cachedValue !== void 0 ? { cachedValue: opts.cachedValue } : {},
|
|
121
|
+
...opts?.cachedValueType !== void 0 ? { cachedValueType: opts.cachedValueType } : {}
|
|
118
122
|
});
|
|
119
123
|
}
|
|
120
124
|
/**
|
|
@@ -131,7 +135,8 @@ function makeSharedFormula(si, formula, ref, opts) {
|
|
|
131
135
|
formula: formula === void 0 ? "" : normalizeFormulaText(formula),
|
|
132
136
|
si,
|
|
133
137
|
...ref !== void 0 ? { ref } : {},
|
|
134
|
-
...opts?.cachedValue !== void 0 ? { cachedValue: opts.cachedValue } : {}
|
|
138
|
+
...opts?.cachedValue !== void 0 ? { cachedValue: opts.cachedValue } : {},
|
|
139
|
+
...opts?.cachedValueType !== void 0 ? { cachedValueType: opts.cachedValueType } : {}
|
|
135
140
|
});
|
|
136
141
|
}
|
|
137
142
|
/**
|
|
@@ -169,7 +174,8 @@ function makeDataTableFormula(formula, opts) {
|
|
|
169
174
|
...opts.del2 !== void 0 ? { del2: opts.del2 } : {},
|
|
170
175
|
...opts.aca !== void 0 ? { aca: opts.aca } : {},
|
|
171
176
|
...opts.ca !== void 0 ? { ca: opts.ca } : {},
|
|
172
|
-
...opts.cachedValue !== void 0 ? { cachedValue: opts.cachedValue } : {}
|
|
177
|
+
...opts.cachedValue !== void 0 ? { cachedValue: opts.cachedValue } : {},
|
|
178
|
+
...opts.cachedValueType !== void 0 ? { cachedValueType: opts.cachedValueType } : {}
|
|
173
179
|
});
|
|
174
180
|
}
|
|
175
181
|
/** Data-table formula, applied in place. See {@link makeDataTableFormula}. */
|
|
@@ -359,4 +365,4 @@ function cellValueAsPrimitive(v) {
|
|
|
359
365
|
//#endregion
|
|
360
366
|
export { setSharedFormula as A, makeErrorValue as C, setCellValue as D, setArrayFormula as E, makeTextRun as M, richTextToString as N, setDataTableFormula as O, makeDurationValue as S, makeSharedFormula as T, isRichTextCell as _, cellValueAsPrimitive as a, makeCell as b, getCoordinate as c, isEmptyCell as d, isErrorCell as f, isMergedCell as g, isFormulaValue as h, cellValueAsNumber as i, makeRichText as j, setFormula as k, getFormulaText as l, isFormulaCell as m, cellValueAsBoolean as n, cellValueAsString as o, isErrorValue as p, cellValueAsDate as r, getCachedFormulaValue as s, bindValue as t, isDurationValue as u, isRichTextValue as v, makeFormula as w, makeDataTableFormula as x, makeArrayFormula as y };
|
|
361
367
|
|
|
362
|
-
//# sourceMappingURL=cell-
|
|
368
|
+
//# sourceMappingURL=cell-B5OUUdfI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-B5OUUdfI.mjs","names":[],"sources":["../src/cell/rich-text.ts","../src/cell/cell.ts"],"sourcesContent":["// Inline rich-text runs.\n//\n// A rich-text cell value is `{ kind: 'rich-text', runs }`. Each run is\n// a string segment with an optional InlineFont describing the in-line\n// formatting (font name, size, bold / italic / underline, colour, …).\n// Run-level fields use OOXML's short attribute names (`sz`, `b`, `i`,\n// `u`) so the writer can splice them into `<rPr>` directly without\n// renaming.\n\nimport type { Color } from '../styles/colors.js';\nimport { OpenXmlSchemaError } from '../utils/exceptions.js';\n\n/** Underline styles per openpyxl's cell-level NestedNoneSet. */\nexport type InlineUnderline = 'single' | 'double' | 'singleAccounting' | 'doubleAccounting';\n\nexport type InlineVertAlign = 'baseline' | 'superscript' | 'subscript';\n\nexport interface InlineFont {\n readonly name?: string;\n readonly sz?: number;\n readonly b?: boolean;\n readonly i?: boolean;\n readonly u?: InlineUnderline;\n readonly strike?: boolean;\n readonly outline?: boolean;\n readonly shadow?: boolean;\n readonly condense?: boolean;\n readonly extend?: boolean;\n readonly vertAlign?: InlineVertAlign;\n readonly color?: Color;\n readonly family?: number;\n readonly charset?: number;\n readonly scheme?: 'major' | 'minor';\n}\n\nexport interface TextRun {\n readonly text: string;\n readonly font?: InlineFont;\n}\n\n/** A frozen array of TextRuns. The shared cell value shape under `kind: 'rich-text'`. */\nexport type RichText = ReadonlyArray<TextRun>;\n\nexport function makeTextRun(text: string, font?: InlineFont): TextRun {\n if (typeof text !== 'string') {\n throw new OpenXmlSchemaError('makeTextRun: text must be a string');\n }\n return Object.freeze(font !== undefined ? { text, font } : { text });\n}\n\nexport function makeRichText(runs: ReadonlyArray<TextRun | { text: string; font?: InlineFont }>): RichText {\n const out = runs.map((r) => (Object.isFrozen(r) ? (r as TextRun) : makeTextRun(r.text, r.font)));\n return Object.freeze(out);\n}\n\n/**\n * Concatenate the plain-text content of a rich-text value (rich-text\n * read paths often want the raw text without formatting).\n */\nexport function richTextToString(rt: RichText): string {\n let out = '';\n for (const r of rt) out += r.text;\n return out;\n}\n","// Cell value model. Mirrors openpyxl/openpyxl/cell/cell.py.\n//\n// A Cell is a plain mutable object: the worksheet stores millions of these, so\n// per-cell freezes / spreads aren't viable on the hot path. The public surface\n// stays small — makeCell + getCoordinate + targeted setters — and uses\n// discriminated unions for the special CellValue shapes (formula, rich text,\n// duration, error).\n\nimport { columnLetterFromIndex, MAX_COL, MAX_ROW } from '../utils/coordinate.js';\nimport { OpenXmlSchemaError } from '../utils/exceptions.js';\nimport { normalizeFormulaText, startsWithEquals } from '../utils/formula-text.js';\nimport { ERROR_CODES } from '../utils/inference.js';\nimport { type RichText, richTextToString } from './rich-text.js';\n\n/** Excel error tokens. */\nexport type ExcelErrorCode = '#NULL!' | '#DIV/0!' | '#VALUE!' | '#REF!' | '#NAME?' | '#NUM!' | '#N/A' | '#GETTING_DATA';\n\n/** Formula sub-kind — drives the OOXML `<f t=\"…\">` attribute. */\nexport type FormulaKind = 'normal' | 'array' | 'shared' | 'dataTable';\n\nexport interface FormulaValue {\n readonly kind: 'formula';\n readonly formula: string;\n readonly t: FormulaKind;\n /** Cached value Excel last computed for the cell, used when `data_only` reads it back. */\n readonly cachedValue?: number | string | boolean;\n /** Mark an Excel error token as an error result. Without this, strings stay text, including \"#N/A\". */\n readonly cachedValueType?: 'error';\n /** Range string (`\"A1:A10\"`) for array / shared / dataTable formulas. */\n readonly ref?: string;\n /** Shared-formula index. */\n readonly si?: number;\n /** Data-table specific fields (mirrors openpyxl DataTableFormula). */\n readonly r1?: string;\n readonly r2?: string;\n readonly dt2D?: boolean;\n readonly dtr?: boolean;\n readonly del1?: boolean;\n readonly del2?: boolean;\n readonly aca?: boolean;\n readonly ca?: boolean;\n}\n\nexport type CellValue =\n | number\n | string\n | boolean\n | Date\n | { kind: 'duration'; ms: number }\n | { kind: 'error'; code: ExcelErrorCode }\n | { kind: 'rich-text'; runs: RichText }\n | FormulaValue\n | null;\n\nexport interface Cell {\n /** 1-based row index. */\n row: number;\n /** 1-based column index. */\n col: number;\n /** Effective cell value. `null` represents an empty cell. */\n value: CellValue;\n /** Index into Workbook.styles.cellXfs. 0 = default. */\n styleId: number;\n /** Optional reference to a Hyperlink registered on the worksheet. */\n hyperlinkId?: number;\n /** Optional reference to a Comment registered on the worksheet. */\n commentId?: number;\n}\n\n/** Marker subtype for the placeholder cells inside a merged range (top-left holds the value). */\nexport interface MergedCell extends Cell {\n merged: true;\n}\n\nconst validateCoord = (row: number, col: number): void => {\n if (!Number.isInteger(row) || row < 1 || row > MAX_ROW) {\n throw new OpenXmlSchemaError(`Cell row ${row} out of range [1, ${MAX_ROW}]`);\n }\n if (!Number.isInteger(col) || col < 1 || col > MAX_COL) {\n throw new OpenXmlSchemaError(`Cell col ${col} out of range [1, ${MAX_COL}]`);\n }\n};\n\n/** Build a fresh Cell. Validates coordinates against the OOXML grid bounds. */\nexport function makeCell(row: number, col: number, value: CellValue = null, styleId = 0): Cell {\n validateCoord(row, col);\n return { row, col, value, styleId };\n}\n\n/** Format a Cell's coordinate as the canonical \"A1\" string. */\nexport function getCoordinate(c: Cell): string {\n return `${columnLetterFromIndex(c.col)}${c.row}`;\n}\n\n/**\n * Direct value setter. No type inference, no validation beyond the union — the\n * caller is in charge. Use {@link bindValue} for the \"do what I mean\" path.\n */\nexport function setCellValue(c: Cell, value: CellValue): void {\n c.value = value;\n}\n\n/**\n * \"Smart\" setter: infers the cell value from a JS runtime value.\n * - `string` starting with `=` → formula\n * - `string` matching an Excel error token → error variant\n * - other primitives / Date / null pass through verbatim\n *\n * Intentionally not the default — explicit is clearer for typed code, and\n * inferring on every write costs measurable time on the worksheet write hot\n * path.\n */\nexport function bindValue(c: Cell, value: number | string | boolean | Date | null): void {\n if (typeof value === 'string') {\n if (startsWithEquals(value)) {\n setFormula(c, value);\n return;\n }\n if (ERROR_CODES.has(value)) {\n c.value = { kind: 'error', code: value as ExcelErrorCode };\n return;\n }\n c.value = value;\n return;\n }\n c.value = value;\n}\n\n// ---- formula values --------------------------------------------------------\n\n// A `<f>` with no text is the shape Excel reports as damaged, and `'='` on its\n// own normalises to exactly that, so the kinds whose text is required reject it\n// here rather than at save time.\nconst requireFormulaText = (fn: string, formula: string): string => {\n const text = normalizeFormulaText(formula);\n if (text.length === 0) {\n throw new OpenXmlSchemaError(`${fn}: formula text must not be empty (got ${JSON.stringify(formula)})`);\n }\n return text;\n};\n\n/**\n * Build a formula cell value. Hand it to `setCell` when the write already\n * carries a style id, so placing a formatted formula stays a single call;\n * {@link setFormula} is the same thing applied to a cell you already hold.\n *\n * A leading `=` is stripped, so `'=SUM(A1:A3)'` and `'SUM(A1:A3)'` are\n * interchangeable.\n *\n * A cached value is optional. Without one, Excel, LibreOffice and Google\n * Sheets compute the result on open, but viewers that never calculate (Quick\n * Look, Outlook and SharePoint previews, most thumbnailers) render the cell\n * empty. Supply one whenever the producer can compute it. For an Excel error,\n * supply `{ cachedValue: '#N/A', cachedValueType: 'error' }`; without the type,\n * the same token is a string result.\n */\nexport function makeFormula(\n formula: string,\n opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>,\n): FormulaValue {\n return Object.freeze({\n kind: 'formula',\n t: 'normal',\n formula: requireFormulaText('makeFormula', formula),\n ...(opts?.cachedValue !== undefined ? { cachedValue: opts.cachedValue } : {}),\n ...(opts?.cachedValueType !== undefined ? { cachedValueType: opts.cachedValueType } : {}),\n });\n}\n\n/**\n * Build an array (CSE) formula value spanning `ref`. Belongs on the top-left\n * cell of the range, since Excel reads `ref` to know how far the result\n * spreads.\n */\nexport function makeArrayFormula(\n ref: string,\n formula: string,\n opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>,\n): FormulaValue {\n return Object.freeze({\n kind: 'formula',\n t: 'array',\n formula: requireFormulaText('makeArrayFormula', formula),\n ref,\n ...(opts?.cachedValue !== undefined ? { cachedValue: opts.cachedValue } : {}),\n ...(opts?.cachedValueType !== undefined ? { cachedValueType: opts.cachedValueType } : {}),\n });\n}\n\n/**\n * Build a shared-formula value. The first cell in the group carries the\n * formula text + `ref`; subsequent cells with the same `si` carry only the\n * index, and Excel reconstructs their text by shifting the references, so\n * their `formula` is legitimately empty.\n */\nexport function makeSharedFormula(\n si: number,\n formula?: string,\n ref?: string,\n opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>,\n): FormulaValue {\n if (!Number.isInteger(si) || si < 0) {\n throw new OpenXmlSchemaError(`makeSharedFormula: si must be a non-negative integer; got ${si}`);\n }\n return Object.freeze({\n kind: 'formula',\n t: 'shared',\n formula: formula === undefined ? '' : normalizeFormulaText(formula),\n si,\n ...(ref !== undefined ? { ref } : {}),\n ...(opts?.cachedValue !== undefined ? { cachedValue: opts.cachedValue } : {}),\n ...(opts?.cachedValueType !== undefined ? { cachedValueType: opts.cachedValueType } : {}),\n });\n}\n\n/**\n * Plain `A1+B1` style formula, applied in place. Same value as\n * {@link makeFormula}, for a cell you already hold.\n */\nexport function setFormula(c: Cell, formula: string, opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>): void {\n c.value = makeFormula(formula, opts);\n}\n\n/** Array (CSE) formula spanning a `ref` range, applied in place. */\nexport function setArrayFormula(\n c: Cell,\n ref: string,\n formula: string,\n opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>,\n): void {\n c.value = makeArrayFormula(ref, formula, opts);\n}\n\n/** Shared formula, applied in place. See {@link makeSharedFormula}. */\nexport function setSharedFormula(\n c: Cell,\n si: number,\n formula?: string,\n ref?: string,\n opts?: Pick<FormulaValue, 'cachedValue' | 'cachedValueType'>,\n): void {\n c.value = makeSharedFormula(si, formula, ref, opts);\n}\n\n/**\n * Excel data-table formula (`<f t=\"dataTable\">`). These appear as the \"What-if\n * Analysis → Data Table\" feature output: a 1- or 2-variable sensitivity grid\n * where the formula references one or two input cells. The wire format mirrors\n * openpyxl's `DataTableFormula`:\n *\n * - `ref` — inclusive cell range the formula spans.\n * - `r1`, `r2`— input cell coordinates (\"$A$1\" etc.).\n * - `dt2D` — true for two-variable tables (uses both r1 and r2).\n * - `dtr` — row-direction flag (true) vs column-direction (false).\n * - `del1`/`del2` — Excel marks one of these true when the\n * corresponding input cell has been deleted; the formula keeps round-tripping\n * so Excel can show the warning state.\n * - `aca`/`ca` — alwaysCalculate / calculate flags.\n */\nexport interface DataTableFormulaOpts {\n ref: string;\n r1?: string;\n r2?: string;\n dt2D?: boolean;\n dtr?: boolean;\n del1?: boolean;\n del2?: boolean;\n aca?: boolean;\n ca?: boolean;\n cachedValue?: FormulaValue['cachedValue'];\n cachedValueType?: FormulaValue['cachedValueType'];\n}\n\n/**\n * Build a data-table formula value. Preserves all the dt-specific attributes\n * so the writer can re-emit `<f t=\"dataTable\" r1=\"...\" />` verbatim and Excel\n * keeps treating the cell as a Data Table cell. Excel writes these with no\n * formula text at all, so `formula` may be empty.\n */\nexport function makeDataTableFormula(formula: string, opts: DataTableFormulaOpts): FormulaValue {\n return Object.freeze({\n kind: 'formula',\n t: 'dataTable',\n formula: normalizeFormulaText(formula),\n ref: opts.ref,\n ...(opts.r1 !== undefined ? { r1: opts.r1 } : {}),\n ...(opts.r2 !== undefined ? { r2: opts.r2 } : {}),\n ...(opts.dt2D !== undefined ? { dt2D: opts.dt2D } : {}),\n ...(opts.dtr !== undefined ? { dtr: opts.dtr } : {}),\n ...(opts.del1 !== undefined ? { del1: opts.del1 } : {}),\n ...(opts.del2 !== undefined ? { del2: opts.del2 } : {}),\n ...(opts.aca !== undefined ? { aca: opts.aca } : {}),\n ...(opts.ca !== undefined ? { ca: opts.ca } : {}),\n ...(opts.cachedValue !== undefined ? { cachedValue: opts.cachedValue } : {}),\n ...(opts.cachedValueType !== undefined ? { cachedValueType: opts.cachedValueType } : {}),\n });\n}\n\n/** Data-table formula, applied in place. See {@link makeDataTableFormula}. */\nexport function setDataTableFormula(c: Cell, formula: string, opts: DataTableFormulaOpts): void {\n c.value = makeDataTableFormula(formula, opts);\n}\n\n// ---- value-shape helpers ---------------------------------------------------\n\n/** Build a `{ kind: 'error', code }` cell value. */\nexport function makeErrorValue(code: ExcelErrorCode): { kind: 'error'; code: ExcelErrorCode } {\n if (!ERROR_CODES.has(code)) {\n throw new OpenXmlSchemaError(`makeErrorValue: unknown error code \"${code}\"`);\n }\n return Object.freeze({ kind: 'error', code });\n}\n\n/** Build a `{ kind: 'duration', ms }` cell value. */\nexport function makeDurationValue(ms: number): { kind: 'duration'; ms: number } {\n if (!Number.isFinite(ms)) {\n throw new OpenXmlSchemaError(`makeDurationValue: ms \"${ms}\" is not finite`);\n }\n return Object.freeze({ kind: 'duration', ms });\n}\n\n/** True iff `c.value` is the formula variant. */\nexport function isFormulaCell(c: Cell): boolean {\n return isFormulaValue(c.value);\n}\n\n/** True iff `c.value` is the rich-text variant. */\nexport function isRichTextCell(c: Cell): boolean {\n return isRichTextValue(c.value);\n}\n\n/** Returns true iff the cell has no content. */\nexport function isEmptyCell(c: Cell): boolean {\n return c.value === null;\n}\n\n/**\n * Type guard for `MergedCell` — true iff the cell is a placeholder for a\n * merged-range covered cell (the top-left of a merged range holds the value;\n * the rest are `MergedCell`). Use this to filter merge-placeholders out of\n * value-walking loops.\n */\nexport function isMergedCell(c: Cell): c is MergedCell {\n return (c as MergedCell).merged === true;\n}\n\n/** Returns true iff the cell holds an Excel error value (`#REF!`, `#NAME?`, …). */\nexport function isErrorCell(c: Cell): boolean {\n return isErrorValue(c.value);\n}\n\n/**\n * Get the formula text from a formula-bearing cell, or `undefined` for\n * non-formula cells. Equivalent to: isFormulaValue(c.value) ? c.value.formula :\n * undefined but spares callers the type-narrow + member access.\n */\nexport function getFormulaText(c: Cell): string | undefined {\n return isFormulaValue(c.value) ? c.value.formula : undefined;\n}\n\n/**\n * Get the cached value Excel last computed for a formula cell, or `undefined`\n * for non-formula / uncached cells. Useful for `data_only` read paths that want\n * the displayed result without re-evaluating.\n */\nexport function getCachedFormulaValue(c: Cell): number | string | boolean | undefined {\n return isFormulaValue(c.value) ? c.value.cachedValue : undefined;\n}\n\n// ---- value-level type guards + coercion ----------------------------------\n\n/** True iff `v` is the formula variant. */\nexport function isFormulaValue(v: CellValue): v is FormulaValue {\n return typeof v === 'object' && v !== null && (v as { kind?: string }).kind === 'formula';\n}\n\n/** True iff `v` is the rich-text variant. */\nexport function isRichTextValue(v: CellValue): v is { kind: 'rich-text'; runs: RichText } {\n return typeof v === 'object' && v !== null && (v as { kind?: string }).kind === 'rich-text';\n}\n\n/** True iff `v` is the error variant. */\nexport function isErrorValue(v: CellValue): v is { kind: 'error'; code: ExcelErrorCode } {\n return typeof v === 'object' && v !== null && (v as { kind?: string }).kind === 'error';\n}\n\n/** True iff `v` is the duration variant. */\nexport function isDurationValue(v: CellValue): v is { kind: 'duration'; ms: number } {\n return typeof v === 'object' && v !== null && (v as { kind?: string }).kind === 'duration';\n}\n\nexport interface CellValueAsStringOptions {\n /** Renderer for `Date` cells. Defaults to `d => d.toISOString()`. */\n dateFormat?: (value: Date) => string;\n /** Replacement for the `null` cell value. Defaults to `''`. */\n emptyText?: string;\n}\n\n/**\n * Coerce a CellValue to its plain-string display form. Numbers / booleans\n * convert via `String`; rich text concatenates run text; formulas yield the\n * cached value (or empty string when uncached); errors yield their Excel token;\n * durations yield `\"<ms> ms\"` with no formatting; Dates yield\n * `Date.toISOString()`; `null` yields `\"\"`.\n *\n * Pass `opts.dateFormat` to override the Date renderer (e.g. a locale-specific\n * format) and `opts.emptyText` to substitute a different placeholder for\n * `null` cells.\n */\nexport function cellValueAsString(v: CellValue, opts?: CellValueAsStringOptions): string {\n const emptyText = opts?.emptyText ?? '';\n if (v === null) return emptyText;\n if (typeof v === 'string') return v;\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n if (v instanceof Date) return opts?.dateFormat ? opts.dateFormat(v) : v.toISOString();\n if (isRichTextValue(v)) return richTextToString(v.runs);\n if (isFormulaValue(v)) {\n if (v.cachedValue === undefined) return '';\n return typeof v.cachedValue === 'string' ? v.cachedValue : String(v.cachedValue);\n }\n if (isErrorValue(v)) return v.code;\n if (isDurationValue(v)) return `${v.ms} ms`;\n return '';\n}\n\n/**\n * Coerce a CellValue to `boolean | undefined`. Booleans pass through; `'TRUE'`\n * / `'true'` and `'FALSE'` / `'false'` (case-insensitive) parse to true /\n * false; numbers yield `false` for 0 and `true` for any other finite value\n * (matching Excel's truthy-number coercion); formula cells return their cached\n * boolean if any. Everything else (null, Date, error, duration, rich-text,\n * non-bool strings) yields `undefined`.\n */\nexport function cellValueAsBoolean(v: CellValue): boolean | undefined {\n if (typeof v === 'boolean') return v;\n if (typeof v === 'number') {\n if (!Number.isFinite(v)) return undefined;\n return v !== 0;\n }\n if (typeof v === 'string') {\n const lc = v.toLowerCase();\n if (lc === 'true') return true;\n if (lc === 'false') return false;\n return undefined;\n }\n if (isFormulaValue(v) && typeof v.cachedValue === 'boolean') return v.cachedValue;\n return undefined;\n}\n\n/**\n * Coerce a CellValue to a `Date` when one is meaningful. Pass-through for\n * `Date`-typed values; ISO-8601 strings (anything `new Date(s)` parses to a\n * finite time) round-trip; durations are interpreted as `new Date(ms)`.\n * Numbers, booleans, formulas, errors, rich text, and null all return\n * `undefined` — this helper does **not** apply the Excel-serial-to-Date\n * conversion (use `excelToDate` for that).\n */\nexport function cellValueAsDate(v: CellValue): Date | undefined {\n if (v instanceof Date) return v;\n if (typeof v === 'string') {\n if (v === '') return undefined;\n const t = Date.parse(v);\n if (!Number.isFinite(t)) return undefined;\n return new Date(t);\n }\n if (isDurationValue(v)) return new Date(v.ms);\n return undefined;\n}\n\n/**\n * Coerce a CellValue to a number when one is meaningful. Booleans yield 0/1;\n * numeric strings parse via `Number(s)`; rich-text concats then parses;\n * formulas with a numeric cached value pass through. Returns `undefined` when\n * there's no sensible numeric reading (text strings, errors, dates, durations,\n * null, empty).\n */\nexport function cellValueAsNumber(v: CellValue): number | undefined {\n if (v === null) return undefined;\n if (typeof v === 'number') return Number.isFinite(v) ? v : undefined;\n if (typeof v === 'boolean') return v ? 1 : 0;\n if (typeof v === 'string') {\n if (v === '') return undefined;\n const n = Number(v);\n return Number.isFinite(n) ? n : undefined;\n }\n if (isFormulaValue(v) && typeof v.cachedValue === 'number') return v.cachedValue;\n return undefined;\n}\n\n/**\n * Map a CellValue to the most natural JS primitive for display / export.\n * Unlike `cellValueAsString`/`cellValueAsNumber`/etc., which each force a\n * single target type and return `undefined` when the value can't be coerced,\n * this returns whatever primitive best represents the union variant:\n *\n * - `null` → `null`\n * - `string` / `number` / `boolean` / `Date` → passthrough\n * - rich text → joined run text (`string`)\n * - formula → recursive on `cachedValue` (`null` when uncached)\n * - error → error code (`string`)\n * - duration → `ms` (`number`)\n */\nexport function cellValueAsPrimitive(v: CellValue): string | number | boolean | Date | null {\n if (v === null) return null;\n if (typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean') return v;\n if (v instanceof Date) return v;\n if (isRichTextValue(v)) return richTextToString(v.runs);\n if (isFormulaValue(v)) {\n return v.cachedValue === undefined ? null : v.cachedValue;\n }\n if (isErrorValue(v)) return v.code;\n if (isDurationValue(v)) return v.ms;\n return null;\n}\n"],"mappings":";;;;AA2CA,SAAgB,YAAY,MAAc,MAA4B;CACpE,IAAI,OAAO,SAAS,UAClB,MAAM,IAAI,mBAAmB,oCAAoC;CAEnE,OAAO,OAAO,OAAO,SAAS,KAAA,IAAY;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A;EAChC,OAAO,IAAI,KAAK,CAAC;CACnB;CACA,IAAI,gBAAgB,CAAC,GAAG,OAAO,IAAI,KAAK,EAAE,EAAE;AAE9C;;;;;;;;AASA,SAAgB,kBAAkB,GAAkC;CAClE,IAAI,MAAM,MAAM,OAAO,KAAA;CACvB,IAAI,OAAO,MAAM,UAAU,OAAO,OAAO,SAAS,CAAC,IAAI,IAAI,KAAA;CAC3D,IAAI,OAAO,MAAM,WAAW,OAAO,IAAI,IAAI;CAC3C,IAAI,OAAO,MAAM,UAAU;EACzB,IAAI,MAAM,IAAI,OAAO,KAAA;EACrB,MAAM,IAAI,OAAO,CAAC;EAClB,OAAO,OAAO,SAAS,CAAC,IAAI,IAAI,KAAA;CAClC;CACA,IAAI,eAAe,CAAC,KAAK,OAAO,EAAE,gBAAgB,UAAU,OAAO,EAAE;AAEvE;;;;;;;;;;;;;;AAeA,SAAgB,qBAAqB,GAAuD;CAC1F,IAAI,MAAM,MAAM,OAAO;CACvB,IAAI,OAAO,MAAM,YAAY,OAAO,MAAM,YAAY,OAAO,MAAM,WAAW,OAAO;CACrF,IAAI,aAAa,MAAM,OAAO;CAC9B,IAAI,gBAAgB,CAAC,GAAG,OAAO,iBAAiB,EAAE,IAAI;CACtD,IAAI,eAAe,CAAC,GAClB,OAAO,EAAE,gBAAgB,KAAA,IAAY,OAAO,EAAE;CAEhD,IAAI,aAAa,CAAC,GAAG,OAAO,EAAE;CAC9B,IAAI,gBAAgB,CAAC,GAAG,OAAO,EAAE;CACjC,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as OpenXmlSchemaError } from "./exceptions-D-CFwxgm.mjs";
|
|
2
|
-
import { Dn as makeColor, bn as colorToHex, un as parseRange, y as ensureCell } from "./worksheet-
|
|
2
|
+
import { Dn as makeColor, bn as colorToHex, un as parseRange, y as ensureCell } from "./worksheet-Cxn2c-jz.mjs";
|
|
3
3
|
//#region src/utils/stable-stringify.ts
|
|
4
4
|
const sortKeysReplacer = (_key, value) => {
|
|
5
5
|
if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
|
|
@@ -1615,4 +1615,4 @@ function setRangeBorderBox(wb, ws, range, opts = { style: "thin" }) {
|
|
|
1615
1615
|
//#endregion
|
|
1616
1616
|
export { BUILTIN_NAMED_STYLES as $, makeAlignment as $t, setCellBorder as A, isBuiltinFormat as At, setItalic as B, PATTERN_TYPES as Bt, setBold as C, FORMAT_NUMBER_00 as Ct, setCellAsNumber as D, builtinFormatCode as Dt, setCellAsDate as E, FORMAT_TEXT as Et, setCellProtection as F, FONT_SCHEMES as Ft, setRangeNumberFormat as G, makePatternFill as Gt, setRangeBackgroundColor as H, makeFill as Ht, setCellStyle as I, UNDERLINE_STYLES as It, setRangeWrapText as J, makeBorder as Jt, setRangeProtection as K, SIDE_STYLES as Kt, setFontColor as L, VERT_ALIGNS as Lt, setCellFill as M, isTimedeltaFormat as Mt, setCellFont as N, makeNumberFormat as Nt, setCellAsPercent as O, builtinFormatId as Ot, setCellNumberFormat as P, DEFAULT_FONT as Pt, makeProtection as Q, alignmentToCss as Qt, setFontName as R, fontToCss as Rt, rotateCellText as S, FORMAT_NUMBER as St, setCellAsCurrency as T, FORMAT_PERCENTAGE_00 as Tt, setRangeBorderBox as U, makeGradientFill as Ut, setRangeAlignment as V, fillToCss as Vt, setRangeFont as W, makeGradientStop as Wt, setUnderline as X, HORIZONTAL_ALIGNMENTS as Xt, setStrikethrough as Y, makeSide as Yt, wrapCellText as Z, VERTICAL_ALIGNMENTS as Zt, getCellNumberFormat as _, BUILTIN_FORMATS_MAX_SIZE as _t, cellStyleToCss as a, addFill as at, patchCellFont as b, FORMAT_DATE_YYYYMMDD2 as bt, clearCellStyle as c, buildXfPatch as ct, copyCellStyle as d, listCellStyleXfs as dt, stableStringify as en, addNamedStyle as et, formatAsHeader as f, listCellXfs as ft, getCellFont as g, BUILTIN_FORMATS as gt, getCellFill as h, makeStylesheet as ht, applyNamedStyle as i, addCellXf as it, setCellBorderAll as j, isDateFormat as jt, setCellBackgroundColor as k, classifyDateFormat as kt, clearRangeStyle as l, defaultCellXf as lt, getCellBorder as m, listFonts as mt, alignCellVertical as n, addBorder as nt, centerCell as o, addFont as ot, getCellAlignment as p, listFills as pt, setRangeStyle as q, borderToCss as qt, applyBuiltinStyle as r, addCellStyleXf as rt, clearCellBackground as s, addNumFmt as st, alignCellHorizontal as t, ensureBuiltinStyle as tt, cloneCellStyle as u, listBorders as ut, getCellProtection as v, FORMAT_DATE_DATETIME as vt, setCellAlignment as w, FORMAT_PERCENTAGE as wt, registerCellStyle as x, FORMAT_GENERAL as xt, indentCell as y, FORMAT_DATE_TIMEDELTA as yt, setFontSize as z, makeFont as zt };
|
|
1617
1617
|
|
|
1618
|
-
//# sourceMappingURL=cell-style-
|
|
1618
|
+
//# sourceMappingURL=cell-style-DjKKPWDL.mjs.map
|