styled-exceljs 0.21.0 → 0.21.1

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 CHANGED
@@ -9,6 +9,23 @@ changes may not be included if they are not expected to break existing code.
9
9
  * Proper handling of XLSX encoded entities (h/t @inreoh)
10
10
  * Proper handling of invalid DIF sheets that match heuristics (h/t @lowkeyfish)
11
11
 
12
+ ## v0.21.1
13
+
14
+ * Added browser-aware text measurement and `XLSX.utils.auto_fit_columns` for
15
+ best-fit column widths with wrap, overflow, shrink-to-fit, and merge support
16
+ * `sheet_to_html` visual mode now supports `autoFit`, `overflow`, fixed-layout
17
+ `<colgroup>` output, and Canvas-backed shrink-to-fit sizing
18
+ * Updated TypeScript definitions, English documentation, Chinese documentation,
19
+ and unit tests for the auto-fit rendering path
20
+
21
+ 中文摘要:
22
+
23
+ * 新增浏览器文字测量和 `XLSX.utils.auto_fit_columns`,可结合换行、溢出、
24
+ 收缩适应和合并跨度计算最优列宽
25
+ * `sheet_to_html` 视觉模式支持 `autoFit`、`overflow`、固定布局 `<colgroup>`
26
+ 和基于 Canvas 测量的收缩适应字号
27
+ * 更新 TypeScript 类型、英文文档、中文文档和自动列宽单元测试
28
+
12
29
  ## v0.21.0
13
30
 
14
31
  * XLSX style parsing resolves fonts, fills, borders, alignment, protection,
package/README.md CHANGED
@@ -45,6 +45,7 @@ const ws = wb.Sheets[wb.SheetNames[0]];
45
45
  const html = XLSX.utils.sheet_to_html(ws, {
46
46
  cellStyles: true,
47
47
  browserPixels: true,
48
+ autoFit: true,
48
49
  charts: true,
49
50
  drawings: true
50
51
  });
@@ -60,6 +61,8 @@ The following public worksheet fields are populated when requested:
60
61
  - `ws["!drawings"]`: parsed images, shapes, anchors, raw fallback records.
61
62
  - `ws["!charts"]` and chartsheet `ws["!chart"]`: normalized chart models used
62
63
  by HTML SVG rendering.
64
+ - `XLSX.utils.auto_fit_columns(ws, opts)`: browser-measured best-fit column
65
+ widths with wrap, overflow, shrink-to-fit, and merge-span handling.
63
66
 
64
67
  `XLSX.utils.validate_merges(ws, opts)` validates merge ranges and reports
65
68
  duplicate, overlapping, invalid, or out-of-bounds ranges. Passing
@@ -78,8 +81,9 @@ npm install styled-exceljs
78
81
 
79
82
  这个版本面向浏览器预览和报表渲染扩展了 XLSX / XLS 的视觉读取能力。
80
83
  默认读取路径仍然保持轻量和兼容;只有显式开启 `cellStyles`、
81
- `browserPixels`、`charts`、`drawings` 和 `validateMerges` 等选项时,才会
82
- 解析完整样式、浏览器像素尺寸、图片、绘图、图表和合并单元格校验结果。
84
+ `browserPixels`、`autoFit`、`charts`、`drawings` 和 `validateMerges` 等选项时,
85
+ 才会解析完整样式、浏览器像素尺寸、自动列宽、图片、绘图、图表和合并单元格
86
+ 校验结果。
83
87
 
84
88
  常用入口如下:
85
89
 
@@ -88,6 +92,8 @@ npm install styled-exceljs
88
92
  - `ws["!drawings"]`:图片、形状、锚点和复杂绘图的 raw fallback。
89
93
  - `ws["!charts"]` / `ws["!chart"]`:工作表嵌入图表和图表工作表模型,可用于 SVG 渲染。
90
94
  - `XLSX.utils.validate_merges(ws, opts)`:检查非法、重复、重叠和越界的合并单元格。
95
+ - `XLSX.utils.auto_fit_columns(ws, opts)`:结合浏览器文字测量、换行、溢出、
96
+ 收缩适应和合并跨度计算最优列宽。
91
97
 
92
98
  完整中文数据结构、选项说明和渲染行为请参考
93
99
  [docs/visual-fidelity.zh-CN.md](docs/visual-fidelity.zh-CN.md)。
package/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-xlsx",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "homepage": "https://github.com/SheetJS/js-xlsx",
5
5
  "main": ["xlsx.js"],
6
6
  "ignore": [