added about the cellStyles:true in the documentation #2511

Closed
azeez1776 wants to merge 1 commits from samatar into master

View File

@ -2,79 +2,83 @@
In addition to the base sheet keys, worksheets also add:
- `ws['!cols']`: array of column properties objects. Column widths are actually
- `ws['!cols']`: array of column properties objects. Column widths are actually
stored in files in a normalized manner, measured in terms of the "Maximum
Digit Width" (the largest width of the rendered digits 0-9, in pixels). When
Digit Width" (the largest width of the rendered digits 0-9, in pixels). When
parsed, the column objects store the pixel width in the `wpx` field, character
width in the `wch` field, and the maximum digit width in the `MDW` field.
- `ws['!rows']`: array of row properties objects as explained later in the docs.
Each row object encodes properties including row height and visibility.
If there exists a row which should be hidden pass the `cellStyles:true` option
to the read function`XLSX.read(data, {cellStyles:true})` where you attempt
to parse `data`, the `cellStyles:true` will set the `hidden` property of each
row to `true`, if the row is hidden.
- `ws['!merges']`: array of range objects corresponding to the merged cells in
the worksheet. Plain text formats do not support merge cells. CSV export
the worksheet. Plain text formats do not support merge cells. CSV export
will write all cells in the merge range if they exist, so be sure that only
the first cell (upper-left) in the range is set.
- `ws['!outline']`: configure how outlines should behave. Options default to
- `ws['!outline']`: configure how outlines should behave. Options default to
the default settings in Excel 2019:
| key | Excel feature | default |
|:----------|:----------------------------------------------|:--------|
| `above` | Uncheck "Summary rows below detail" | `false` |
| `left` | Uncheck "Summary rows to the right of detail" | `false` |
| key | Excel feature | default |
| :------ | :-------------------------------------------- | :------ |
| `above` | Uncheck "Summary rows below detail" | `false` |
| `left` | Uncheck "Summary rows to the right of detail" | `false` |
- `ws['!protect']`: object of write sheet protection properties. The `password`
- `ws['!protect']`: object of write sheet protection properties. The `password`
key specifies the password for formats that support password-protected sheets
(XLSX/XLSB/XLS). The writer uses the XOR obfuscation method. The following
(XLSX/XLSB/XLS). The writer uses the XOR obfuscation method. The following
keys control the sheet protection -- set to `false` to enable a feature when
sheet is locked or set to `true` to disable a feature:
<details>
<summary><b>Worksheet Protection Details</b> (click to show)</summary>
| key | feature (true=disabled / false=enabled) | default |
|:----------------------|:----------------------------------------|:-----------|
| `selectLockedCells` | Select locked cells | enabled |
| `selectUnlockedCells` | Select unlocked cells | enabled |
| `formatCells` | Format cells | disabled |
| `formatColumns` | Format columns | disabled |
| `formatRows` | Format rows | disabled |
| `insertColumns` | Insert columns | disabled |
| `insertRows` | Insert rows | disabled |
| `insertHyperlinks` | Insert hyperlinks | disabled |
| `deleteColumns` | Delete columns | disabled |
| `deleteRows` | Delete rows | disabled |
| `sort` | Sort | disabled |
| `autoFilter` | Filter | disabled |
| `pivotTables` | Use PivotTable reports | disabled |
| `objects` | Edit objects | enabled |
| `scenarios` | Edit scenarios | enabled |
| key | feature (true=disabled / false=enabled) | default |
| :-------------------- | :-------------------------------------- | :------- |
| `selectLockedCells` | Select locked cells | enabled |
| `selectUnlockedCells` | Select unlocked cells | enabled |
| `formatCells` | Format cells | disabled |
| `formatColumns` | Format columns | disabled |
| `formatRows` | Format rows | disabled |
| `insertColumns` | Insert columns | disabled |
| `insertRows` | Insert rows | disabled |
| `insertHyperlinks` | Insert hyperlinks | disabled |
| `deleteColumns` | Delete columns | disabled |
| `deleteRows` | Delete rows | disabled |
| `sort` | Sort | disabled |
| `autoFilter` | Filter | disabled |
| `pivotTables` | Use PivotTable reports | disabled |
| `objects` | Edit objects | enabled |
| `scenarios` | Edit scenarios | enabled |
</details>
- `ws['!autofilter']`: AutoFilter object following the schema:
```typescript
type AutoFilter = {
ref:string; // A-1 based range representing the AutoFilter table range
}
ref: string; // A-1 based range representing the AutoFilter table range
};
```
#### Chartsheet Object
Chartsheets are represented as standard sheets. They are distinguished with the
Chartsheets are represented as standard sheets. They are distinguished with the
`!type` property set to `"chart"`.
The underlying data and `!ref` refer to the cached data in the chartsheet. The
The underlying data and `!ref` refer to the cached data in the chartsheet. The
first row of the chartsheet is the underlying header.
#### Macrosheet Object
Macrosheets are represented as standard sheets. They are distinguished with the
Macrosheets are represented as standard sheets. They are distinguished with the
`!type` property set to `"macro"`.
#### Dialogsheet Object
Dialogsheets are represented as standard sheets. They are distinguished with the
`!type` property set to `"dialog"`.