@xlsxflow/core 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +5 -4
- package/dist/index.cjs +1081 -740
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -7
- package/dist/index.d.ts +30 -7
- package/dist/index.mjs +1081 -740
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.4
|
|
4
|
+
|
|
5
|
+
Fixes from the third round of end-user tests (700 cases).
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `XlsxFlow.readFile` reads `.ods` files, and `getComments()` / `getImages()` work after reading an `.xlsx` with it.
|
|
10
|
+
- Control characters and U+FFFE/U+FFFF never reach the XML: cell text keeps them as `_xHHHH_` escapes, other text (document properties, notes' authors, validations, headers and footers, table columns, alt text, formulas) drops them, and sheet names with them are refused.
|
|
11
|
+
- `SheetWriter` stores formula text that starts with `#` as text, not as an error cell Excel repairs.
|
|
12
|
+
- `SheetWriter` waits while nobody reads its output, instead of pulling rows from the source without limit, and cancelling the output ends the row source (its `finally` runs).
|
|
13
|
+
- Cached formula results: formulas over other formula cells, scientific literals (`1E3`), reversed ranges, case-insensitive text comparison, values typed into `SUM`, 15-digit number text, `TRUE`/`FALSE` text, errors (`#DIV/0!`, `#VALUE!`) and circular references follow Excel. Streamed rows get no made-up cached values (in `OdsWriter` too).
|
|
14
|
+
- `SheetWriter` refuses overlapping or malformed merges, overlapping tables, table names that look like cell references, defined names over 255 characters, row options outside rows 1 to 1,048,576, list validations over 255 characters, truncated images, and picture sizes that are not positive numbers. Validation formulas lose a leading `=`, and every range of a multi-range print area names its sheet.
|
|
15
|
+
- `SheetEditor.appendSheet` writes dates, formulas, styles and NaN as `setCells` does, keeps both batches when called twice, writes rows in the sheet's namespace, and refuses rows past 1,048,576.
|
|
16
|
+
- `SheetEditor`: `setCells` edits the right row on sheets whose rows have no `r` attribute; a date and a style on one cell keep both; repeating a restyle reuses the formats it added; `insertRows` keeps ranges ending at the last row (`SUM(B1:B1048576)`), leaves references to other workbooks (`[1]S!A5`) alone, moves every cell of a shared formula on another sheet, and moves pivot tables on the sheet.
|
|
17
|
+
- `SheetReader`: entries whose data does not match their CRC-32, and worksheets cut off mid-row, are errors instead of silently different data. A zip comment holding the end-record signature, part names in another case, UTF-16 parts, rows with an unusable `r`, `t="d"` cells (now UTC ISO strings, formatted with their date format), sheet names with `&`, and a chart sheet as the first tab are read correctly.
|
|
18
|
+
- `sheetToJson` keeps values right of the header row (`Column3`); `streamToCsv` keeps blank rows between rows.
|
|
19
|
+
- `parseCsv` keeps numbers that overflow a double (`1e400`) as text.
|
|
20
|
+
- `OdsWriter` keeps the milliseconds of dates and converts whole-column references (`SUM(C:C)`); the `.ods` reader reads the created date as UTC.
|
|
21
|
+
- ZIP: UTF-8 entry names set the UTF-8 flag, 65,535 entries are refused (readers take 0xFFFF as ZIP64), and an encrypted or `.xls` file given where a ZIP is expected says so.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- The `errors` parse option: `row.errors` marks cells holding error values.
|
|
26
|
+
|
|
3
27
|
## 1.1.3
|
|
4
28
|
|
|
5
29
|
### Fixed
|
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ Dates come back as ISO-8601 strings. Opt in to more detail, each indexed like `r
|
|
|
73
73
|
- `{ formulas: true }` gives `row.formulas`, with shared formulas expanded per cell.
|
|
74
74
|
- `{ styles: true }` gives `row.styles`, as `CellStyle` objects (the same shape the writer takes). Theme and palette colours are resolved to ARGB.
|
|
75
75
|
- `{ richText: true }` gives `row.richText`, the formatted runs of cells that have them. `row.cells` still holds the plain text.
|
|
76
|
+
- `{ errors: true }` gives `row.errors`, `true` for the cells that hold an error value such as `#N/A`. `row.cells` gives errors as text, so this tells them from text that reads `#N/A` (`.xlsx` only).
|
|
76
77
|
- `{ formatted: true }` gives `row.formatted`, each cell's text as Excel (en-US) shows it: `1,234.50`, `25.6%`, `(42)`, `08-Oct-2026 2:05 PM`. It covers sections, conditions, dates and elapsed times, fractions, scientific notation, currency and text formats. Repeat fills (`*`) and colours are left out, and other locales are shown as en-US.
|
|
77
78
|
|
|
78
79
|
`await reader.readWorkbook(createBlobReader(blob))` lists the sheets with their visibility, the defined names and the document properties, without reading any sheet.
|
|
@@ -180,7 +181,7 @@ editor.setCells('Sheet1', {
|
|
|
180
181
|
A1: { style: { font: { bold: true }, fill: { type: 'solid', fgColor: 'FFFFFF00' } } }, // restyle, keep content
|
|
181
182
|
B3: { value: 7, style: { numFmt: '0.00' } },
|
|
182
183
|
});
|
|
183
|
-
editor.appendSheet('Sheet1', [['new', 'row']]); //
|
|
184
|
+
editor.appendSheet('Sheet1', [['new', 'row']]); // after the last existing row (values, formulas, styles)
|
|
184
185
|
editor.insertRows('Sheet1', 5, 3); // 3 empty rows before row 5
|
|
185
186
|
editor.deleteRows('Sheet1', 20, 2); // rows 20-21
|
|
186
187
|
editor.insertColumns('Sheet1', 'C'); // or deleteColumns('Sheet1', 'C', 2)
|
|
@@ -193,10 +194,10 @@ Edited cells keep their style. A style change is merged into the cell's current
|
|
|
193
194
|
|
|
194
195
|
Macro-enabled workbooks (`.xlsm`) keep their VBA project and content type through every edit.
|
|
195
196
|
|
|
196
|
-
`addSheet`
|
|
197
|
+
`addSheet` and `appendSheet` take arrays of rows with values, formulas and styles; for hyperlinks, notes and sheet options, write the workbook with `SheetWriter`. Calling `appendSheet` again for a sheet adds the rows after the earlier ones. `deleteSheet` removes names scoped to the sheet and turns other defined names that point at it into `#REF!`; formulas in other sheets that point at it are not rewritten. `insertRows`, `deleteRows`, `insertColumns` and `deleteColumns` move everything that points at the cells, as Excel does:
|
|
197
198
|
- formulas on every sheet and the workbook's defined names (print areas, named ranges);
|
|
198
199
|
- merged cells, conditional formats, validations, hyperlinks, the filter and its column filters, page breaks and column widths;
|
|
199
|
-
- tables, pictures, notes, sparklines, What-If data tables, chart series and pivot
|
|
200
|
+
- tables, pictures, notes, sparklines, What-If data tables, chart series, and pivot tables and their sources.
|
|
200
201
|
|
|
201
202
|
Ranges that span inserted rows or columns grow, and ranges over deleted ones shrink. References to deleted cells become `#REF!`. Columns inserted inside a table become table columns named Column1, Column2 and so on. Deleting a table's header row, all its data rows or all its columns is refused. Operations run in the order given, and `setCells` addresses count after the cells have moved. Inserted rows and columns are empty: they don't copy the formatting of their neighbours. Every sheet streams through the editor, because any of its formulas might point at the moved cells.
|
|
202
203
|
|
|
@@ -250,7 +251,7 @@ writer.addSheet('Report', rows, {
|
|
|
250
251
|
// Formatted notes: comment: { text: [{ text: 'Ana:', font: { bold: true } }, { text: ' restated' }] }
|
|
251
252
|
```
|
|
252
253
|
|
|
253
|
-
Formulas are stored for Excel to calculate when it opens the file. For array rows, the writer also stores a cached result for simple formulas (`SUM`, `AVERAGE`, `COUNT`, `MIN`, `MAX`, `IF`, `CONCATENATE
|
|
254
|
+
Formulas are stored for Excel to calculate when it opens the file. For array rows, the writer also stores a cached result for simple formulas (`SUM`, `AVERAGE`, `COUNT`, `MIN`, `MAX`, `IF`, `CONCATENATE`, `&`, comparisons and arithmetic, including over other formula cells), so other readers see a value. Errors are stored as error values (`#DIV/0!`). Rows from an AsyncIterable get no cached results, since the writer cannot look back at them.
|
|
254
255
|
|
|
255
256
|
Strings are written inline, which keeps memory flat. `new SheetWriter({ sharedStrings: true })` stores each distinct string once instead. Files are smaller when values repeat, but the distinct strings stay in memory until the file is finished.
|
|
256
257
|
|