@cj-tech-master/excelts 9.4.2 → 9.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.
Files changed (618) hide show
  1. package/dist/browser/index.browser.d.ts +8 -5
  2. package/dist/browser/index.browser.js +19 -1
  3. package/dist/browser/index.d.ts +4 -2
  4. package/dist/browser/index.js +9 -1
  5. package/dist/browser/modules/excel/chart/cache-populator.d.ts +49 -0
  6. package/dist/browser/modules/excel/chart/cache-populator.js +1171 -0
  7. package/dist/browser/modules/excel/chart/chart-api.d.ts +92 -0
  8. package/dist/browser/modules/excel/chart/chart-api.js +364 -0
  9. package/dist/browser/modules/excel/chart/chart-builder.d.ts +48 -0
  10. package/dist/browser/modules/excel/chart/chart-builder.js +2432 -0
  11. package/dist/browser/modules/excel/chart/chart-ex-builder.d.ts +36 -0
  12. package/dist/browser/modules/excel/chart/chart-ex-builder.js +903 -0
  13. package/dist/browser/modules/excel/chart/chart-ex-parser.d.ts +8 -0
  14. package/dist/browser/modules/excel/chart/chart-ex-parser.js +1205 -0
  15. package/dist/browser/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
  16. package/dist/browser/modules/excel/chart/chart-ex-renderer.js +5352 -0
  17. package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +531 -0
  18. package/dist/browser/modules/excel/chart/chart-ex-types.js +11 -0
  19. package/dist/browser/modules/excel/chart/chart-images.d.ts +78 -0
  20. package/dist/browser/modules/excel/chart/chart-images.js +363 -0
  21. package/dist/browser/modules/excel/chart/chart-presets.d.ts +392 -0
  22. package/dist/browser/modules/excel/chart/chart-presets.js +179 -0
  23. package/dist/browser/modules/excel/chart/chart-renderer.d.ts +550 -0
  24. package/dist/browser/modules/excel/chart/chart-renderer.js +6440 -0
  25. package/dist/browser/modules/excel/chart/chart-sidecar.d.ts +21 -0
  26. package/dist/browser/modules/excel/chart/chart-sidecar.js +427 -0
  27. package/dist/browser/modules/excel/chart/chart-utils.d.ts +306 -0
  28. package/dist/browser/modules/excel/chart/chart-utils.js +821 -0
  29. package/dist/browser/modules/excel/chart/chart.d.ts +504 -0
  30. package/dist/browser/modules/excel/chart/chart.js +1320 -0
  31. package/dist/browser/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
  32. package/dist/browser/modules/excel/chart/glyph-rasterizer.js +658 -0
  33. package/dist/browser/modules/excel/chart/index.d.ts +54 -0
  34. package/dist/browser/modules/excel/chart/index.js +46 -0
  35. package/dist/browser/modules/excel/chart/install.d.ts +44 -0
  36. package/dist/browser/modules/excel/chart/install.js +91 -0
  37. package/dist/browser/modules/excel/chart/shape-properties.d.ts +156 -0
  38. package/dist/browser/modules/excel/chart/shape-properties.js +1557 -0
  39. package/dist/browser/modules/excel/chart/stroke-font.d.ts +36 -0
  40. package/dist/browser/modules/excel/chart/stroke-font.js +1556 -0
  41. package/dist/browser/modules/excel/chart/topojson.d.ts +98 -0
  42. package/dist/browser/modules/excel/chart/topojson.js +236 -0
  43. package/dist/browser/modules/excel/chart/types.d.ts +2559 -0
  44. package/dist/browser/modules/excel/chart/types.js +8 -0
  45. package/dist/browser/modules/excel/chart-host-registry.d.ts +157 -0
  46. package/dist/browser/modules/excel/chart-host-registry.js +90 -0
  47. package/dist/browser/modules/excel/chartsheet.d.ts +102 -0
  48. package/dist/browser/modules/excel/chartsheet.js +196 -0
  49. package/dist/browser/modules/excel/defined-names.d.ts +35 -0
  50. package/dist/browser/modules/excel/defined-names.js +44 -4
  51. package/dist/browser/modules/excel/errors.d.ts +6 -0
  52. package/dist/browser/modules/excel/errors.js +9 -0
  53. package/dist/browser/modules/excel/form-control.d.ts +6 -0
  54. package/dist/browser/modules/excel/form-control.js +17 -0
  55. package/dist/browser/modules/excel/image.js +12 -2
  56. package/dist/browser/modules/excel/pivot-chart.d.ts +7 -0
  57. package/dist/browser/modules/excel/pivot-chart.js +53 -0
  58. package/dist/browser/modules/excel/pivot-table.d.ts +55 -0
  59. package/dist/browser/modules/excel/pivot-table.js +35 -0
  60. package/dist/browser/modules/excel/range.js +5 -1
  61. package/dist/browser/modules/excel/sparkline/index.d.ts +7 -0
  62. package/dist/browser/modules/excel/sparkline/index.js +7 -0
  63. package/dist/browser/modules/excel/sparkline/sparkline.d.ts +206 -0
  64. package/dist/browser/modules/excel/sparkline/sparkline.js +750 -0
  65. package/dist/browser/modules/excel/stream/worksheet-writer.js +3 -2
  66. package/dist/browser/modules/excel/table.js +42 -6
  67. package/dist/browser/modules/excel/types.d.ts +72 -0
  68. package/dist/browser/modules/excel/utils/address.d.ts +18 -0
  69. package/dist/browser/modules/excel/utils/address.js +28 -0
  70. package/dist/browser/modules/excel/utils/drawing-utils.js +11 -6
  71. package/dist/browser/modules/excel/utils/guid.d.ts +15 -0
  72. package/dist/browser/modules/excel/utils/guid.js +35 -0
  73. package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +74 -0
  74. package/dist/browser/modules/excel/utils/ooxml-paths.js +206 -9
  75. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
  76. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
  77. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
  78. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
  79. package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
  80. package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
  81. package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
  82. package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
  83. package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
  84. package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
  85. package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
  86. package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
  87. package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
  88. package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
  89. package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
  90. package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
  91. package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
  92. package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
  93. package/dist/browser/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
  94. package/dist/browser/modules/excel/utils/ooxml-validator/check-table.js +177 -0
  95. package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
  96. package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
  97. package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
  98. package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
  99. package/dist/browser/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
  100. package/dist/browser/modules/excel/utils/ooxml-validator/context.js +191 -0
  101. package/dist/browser/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
  102. package/dist/browser/modules/excel/utils/ooxml-validator/index.js +102 -0
  103. package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
  104. package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
  105. package/dist/browser/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
  106. package/dist/browser/modules/excel/utils/ooxml-validator/reporter.js +61 -0
  107. package/dist/browser/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
  108. package/dist/browser/modules/excel/utils/ooxml-validator/types.js +12 -0
  109. package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
  110. package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
  111. package/dist/browser/modules/excel/workbook.browser.d.ts +248 -30
  112. package/dist/browser/modules/excel/workbook.browser.js +966 -31
  113. package/dist/browser/modules/excel/workbook.d.ts +43 -0
  114. package/dist/browser/modules/excel/workbook.js +48 -0
  115. package/dist/browser/modules/excel/worksheet.d.ts +157 -3
  116. package/dist/browser/modules/excel/worksheet.js +394 -35
  117. package/dist/browser/modules/excel/xlsx/rel-type.d.ts +40 -0
  118. package/dist/browser/modules/excel/xlsx/rel-type.js +41 -1
  119. package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
  120. package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  121. package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  122. package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  123. package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
  124. package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
  125. package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
  126. package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
  127. package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
  128. package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  129. package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  130. package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
  131. package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  132. package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
  133. package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
  134. package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
  135. package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  136. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
  137. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  138. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
  139. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  140. package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
  141. package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
  142. package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
  143. package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  144. package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
  145. package/dist/browser/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  146. package/dist/browser/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  147. package/dist/browser/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
  148. package/dist/browser/modules/excel/xlsx/xform/xsd-values.js +101 -0
  149. package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
  150. package/dist/browser/modules/excel/xlsx/xlsx.browser.js +4422 -78
  151. package/dist/browser/modules/pdf/builder/document-builder.d.ts +74 -0
  152. package/dist/browser/modules/pdf/builder/document-builder.js +507 -2
  153. package/dist/browser/modules/pdf/builder/pdf-editor.js +48 -3
  154. package/dist/browser/modules/pdf/excel-bridge.d.ts +69 -0
  155. package/dist/browser/modules/pdf/excel-bridge.js +683 -12
  156. package/dist/browser/modules/pdf/font/font-manager.d.ts +25 -0
  157. package/dist/browser/modules/pdf/font/font-manager.js +39 -0
  158. package/dist/browser/modules/pdf/index.d.ts +5 -2
  159. package/dist/browser/modules/pdf/index.js +3 -1
  160. package/dist/browser/modules/pdf/render/chart-surface.d.ts +33 -0
  161. package/dist/browser/modules/pdf/render/chart-surface.js +200 -0
  162. package/dist/browser/modules/pdf/render/layout-engine.d.ts +22 -1
  163. package/dist/browser/modules/pdf/render/layout-engine.js +436 -56
  164. package/dist/browser/modules/pdf/render/page-renderer.js +169 -28
  165. package/dist/browser/modules/pdf/render/pdf-exporter.js +117 -7
  166. package/dist/browser/modules/pdf/types.d.ts +227 -23
  167. package/dist/browser/modules/pdf/types.js +4 -0
  168. package/dist/browser/modules/pdf/word-bridge.d.ts +47 -0
  169. package/dist/browser/modules/pdf/word-bridge.js +304 -0
  170. package/dist/browser/modules/word/constants.d.ts +179 -0
  171. package/dist/browser/modules/word/constants.js +231 -0
  172. package/dist/browser/modules/word/content-types.d.ts +27 -0
  173. package/dist/browser/modules/word/content-types.js +53 -0
  174. package/dist/browser/modules/word/digital-signatures.d.ts +87 -0
  175. package/dist/browser/modules/word/digital-signatures.js +134 -0
  176. package/dist/browser/modules/word/document.d.ts +728 -0
  177. package/dist/browser/modules/word/document.js +1795 -0
  178. package/dist/browser/modules/word/docx-packager.d.ts +14 -0
  179. package/dist/browser/modules/word/docx-packager.js +822 -0
  180. package/dist/browser/modules/word/docx-reader.d.ts +11 -0
  181. package/dist/browser/modules/word/docx-reader.js +4929 -0
  182. package/dist/browser/modules/word/encryption.d.ts +102 -0
  183. package/dist/browser/modules/word/encryption.js +274 -0
  184. package/dist/browser/modules/word/errors.d.ts +49 -0
  185. package/dist/browser/modules/word/errors.js +68 -0
  186. package/dist/browser/modules/word/font-obfuscation.d.ts +31 -0
  187. package/dist/browser/modules/word/font-obfuscation.js +83 -0
  188. package/dist/browser/modules/word/html-renderer.d.ts +38 -0
  189. package/dist/browser/modules/word/html-renderer.js +782 -0
  190. package/dist/browser/modules/word/index.base.d.ts +19 -0
  191. package/dist/browser/modules/word/index.base.js +51 -0
  192. package/dist/browser/modules/word/index.browser.d.ts +4 -0
  193. package/dist/browser/modules/word/index.browser.js +4 -0
  194. package/dist/browser/modules/word/index.d.ts +4 -0
  195. package/dist/browser/modules/word/index.js +4 -0
  196. package/dist/browser/modules/word/internal-utils.d.ts +23 -0
  197. package/dist/browser/modules/word/internal-utils.js +54 -0
  198. package/dist/browser/modules/word/relationships.d.ts +31 -0
  199. package/dist/browser/modules/word/relationships.js +56 -0
  200. package/dist/browser/modules/word/types.d.ts +2325 -0
  201. package/dist/browser/modules/word/types.js +10 -0
  202. package/dist/browser/modules/word/units.d.ts +49 -0
  203. package/dist/browser/modules/word/units.js +111 -0
  204. package/dist/browser/modules/word/writers/chart-writer.d.ts +10 -0
  205. package/dist/browser/modules/word/writers/chart-writer.js +385 -0
  206. package/dist/browser/modules/word/writers/checkbox-writer.d.ts +9 -0
  207. package/dist/browser/modules/word/writers/checkbox-writer.js +42 -0
  208. package/dist/browser/modules/word/writers/comment-writer.d.ts +15 -0
  209. package/dist/browser/modules/word/writers/comment-writer.js +70 -0
  210. package/dist/browser/modules/word/writers/document-writer.d.ts +16 -0
  211. package/dist/browser/modules/word/writers/document-writer.js +461 -0
  212. package/dist/browser/modules/word/writers/footnote-writer.d.ts +11 -0
  213. package/dist/browser/modules/word/writers/footnote-writer.js +72 -0
  214. package/dist/browser/modules/word/writers/header-footer-writer.d.ts +13 -0
  215. package/dist/browser/modules/word/writers/header-footer-writer.js +129 -0
  216. package/dist/browser/modules/word/writers/image-writer.d.ts +10 -0
  217. package/dist/browser/modules/word/writers/image-writer.js +185 -0
  218. package/dist/browser/modules/word/writers/math-writer.d.ts +9 -0
  219. package/dist/browser/modules/word/writers/math-writer.js +428 -0
  220. package/dist/browser/modules/word/writers/numbering-writer.d.ts +10 -0
  221. package/dist/browser/modules/word/writers/numbering-writer.js +125 -0
  222. package/dist/browser/modules/word/writers/paragraph-writer.d.ts +13 -0
  223. package/dist/browser/modules/word/writers/paragraph-writer.js +516 -0
  224. package/dist/browser/modules/word/writers/parts-writer.d.ts +26 -0
  225. package/dist/browser/modules/word/writers/parts-writer.js +660 -0
  226. package/dist/browser/modules/word/writers/run-writer.d.ts +15 -0
  227. package/dist/browser/modules/word/writers/run-writer.js +649 -0
  228. package/dist/browser/modules/word/writers/section-writer.d.ts +10 -0
  229. package/dist/browser/modules/word/writers/section-writer.js +238 -0
  230. package/dist/browser/modules/word/writers/styles-writer.d.ts +10 -0
  231. package/dist/browser/modules/word/writers/styles-writer.js +242 -0
  232. package/dist/browser/modules/word/writers/table-writer.d.ts +10 -0
  233. package/dist/browser/modules/word/writers/table-writer.js +503 -0
  234. package/dist/browser/modules/word/writers/textbox-writer.d.ts +9 -0
  235. package/dist/browser/modules/word/writers/textbox-writer.js +53 -0
  236. package/dist/browser/modules/word/writers/toc-writer.d.ts +9 -0
  237. package/dist/browser/modules/word/writers/toc-writer.js +79 -0
  238. package/dist/browser/modules/xml/encode.d.ts +56 -7
  239. package/dist/browser/modules/xml/encode.js +157 -11
  240. package/dist/cjs/index.js +13 -2
  241. package/dist/cjs/modules/excel/chart/cache-populator.js +1178 -0
  242. package/dist/cjs/modules/excel/chart/chart-api.js +371 -0
  243. package/dist/cjs/modules/excel/chart/chart-builder.js +2440 -0
  244. package/dist/cjs/modules/excel/chart/chart-ex-builder.js +907 -0
  245. package/dist/cjs/modules/excel/chart/chart-ex-parser.js +1208 -0
  246. package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +5364 -0
  247. package/dist/cjs/modules/excel/chart/chart-ex-types.js +12 -0
  248. package/dist/cjs/modules/excel/chart/chart-images.js +366 -0
  249. package/dist/cjs/modules/excel/chart/chart-presets.js +184 -0
  250. package/dist/cjs/modules/excel/chart/chart-renderer.js +6450 -0
  251. package/dist/cjs/modules/excel/chart/chart-sidecar.js +433 -0
  252. package/dist/cjs/modules/excel/chart/chart-utils.js +845 -0
  253. package/dist/cjs/modules/excel/chart/chart.js +1324 -0
  254. package/dist/cjs/modules/excel/chart/glyph-rasterizer.js +664 -0
  255. package/dist/cjs/modules/excel/chart/index.js +101 -0
  256. package/dist/cjs/modules/excel/chart/install.js +95 -0
  257. package/dist/cjs/modules/excel/chart/shape-properties.js +1577 -0
  258. package/dist/cjs/modules/excel/chart/stroke-font.js +1559 -0
  259. package/dist/cjs/modules/excel/chart/topojson.js +239 -0
  260. package/dist/cjs/modules/excel/chart/types.js +9 -0
  261. package/dist/cjs/modules/excel/chart-host-registry.js +96 -0
  262. package/dist/cjs/modules/excel/chartsheet.js +199 -0
  263. package/dist/cjs/modules/excel/defined-names.js +44 -4
  264. package/dist/cjs/modules/excel/errors.js +11 -1
  265. package/dist/cjs/modules/excel/form-control.js +17 -0
  266. package/dist/cjs/modules/excel/image.js +12 -2
  267. package/dist/cjs/modules/excel/pivot-chart.js +56 -0
  268. package/dist/cjs/modules/excel/pivot-table.js +35 -0
  269. package/dist/cjs/modules/excel/range.js +5 -1
  270. package/dist/cjs/modules/excel/sparkline/index.js +23 -0
  271. package/dist/cjs/modules/excel/sparkline/sparkline.js +756 -0
  272. package/dist/cjs/modules/excel/stream/worksheet-writer.js +3 -2
  273. package/dist/cjs/modules/excel/table.js +42 -6
  274. package/dist/cjs/modules/excel/utils/address.js +29 -0
  275. package/dist/cjs/modules/excel/utils/drawing-utils.js +11 -6
  276. package/dist/cjs/modules/excel/utils/guid.js +38 -0
  277. package/dist/cjs/modules/excel/utils/ooxml-paths.js +246 -9
  278. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +103 -0
  279. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart.js +2128 -0
  280. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chartsheet.js +29 -0
  281. package/dist/cjs/modules/excel/utils/ooxml-validator/check-content-types.js +184 -0
  282. package/dist/cjs/modules/excel/utils/ooxml-validator/check-drawing.js +270 -0
  283. package/dist/cjs/modules/excel/utils/ooxml-validator/check-pivot.js +107 -0
  284. package/dist/cjs/modules/excel/utils/ooxml-validator/check-relationships.js +188 -0
  285. package/dist/cjs/modules/excel/utils/ooxml-validator/check-structure.js +60 -0
  286. package/dist/cjs/modules/excel/utils/ooxml-validator/check-styles.js +92 -0
  287. package/dist/cjs/modules/excel/utils/ooxml-validator/check-table.js +180 -0
  288. package/dist/cjs/modules/excel/utils/ooxml-validator/check-workbook.js +166 -0
  289. package/dist/cjs/modules/excel/utils/ooxml-validator/check-worksheet.js +572 -0
  290. package/dist/cjs/modules/excel/utils/ooxml-validator/context.js +196 -0
  291. package/dist/cjs/modules/excel/utils/ooxml-validator/index.js +105 -0
  292. package/dist/cjs/modules/excel/utils/ooxml-validator/path-utils.js +168 -0
  293. package/dist/cjs/modules/excel/utils/ooxml-validator/reporter.js +66 -0
  294. package/dist/cjs/modules/excel/utils/ooxml-validator/types.js +13 -0
  295. package/dist/cjs/modules/excel/utils/ooxml-validator/xml-utils.js +110 -0
  296. package/dist/cjs/modules/excel/workbook.browser.js +973 -38
  297. package/dist/cjs/modules/excel/workbook.js +48 -0
  298. package/dist/cjs/modules/excel/worksheet.js +393 -34
  299. package/dist/cjs/modules/excel/xlsx/rel-type.js +41 -1
  300. package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  301. package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  302. package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  303. package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +6003 -0
  304. package/dist/cjs/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +219 -0
  305. package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +149 -10
  306. package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  307. package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  308. package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  309. package/dist/cjs/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +228 -0
  310. package/dist/cjs/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  311. package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  312. package/dist/cjs/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  313. package/dist/cjs/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +444 -0
  314. package/dist/cjs/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  315. package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +195 -19
  316. package/dist/cjs/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  317. package/dist/cjs/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  318. package/dist/cjs/modules/excel/xlsx/xform/xsd-values.js +106 -0
  319. package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +4420 -76
  320. package/dist/cjs/modules/pdf/builder/document-builder.js +506 -1
  321. package/dist/cjs/modules/pdf/builder/pdf-editor.js +48 -3
  322. package/dist/cjs/modules/pdf/excel-bridge.js +684 -12
  323. package/dist/cjs/modules/pdf/font/font-manager.js +39 -0
  324. package/dist/cjs/modules/pdf/index.js +5 -1
  325. package/dist/cjs/modules/pdf/render/chart-surface.js +203 -0
  326. package/dist/cjs/modules/pdf/render/layout-engine.js +437 -56
  327. package/dist/cjs/modules/pdf/render/page-renderer.js +169 -28
  328. package/dist/cjs/modules/pdf/render/pdf-exporter.js +115 -5
  329. package/dist/cjs/modules/pdf/types.js +5 -0
  330. package/dist/cjs/modules/pdf/word-bridge.js +307 -0
  331. package/dist/cjs/modules/word/constants.js +234 -0
  332. package/dist/cjs/modules/word/content-types.js +57 -0
  333. package/dist/cjs/modules/word/digital-signatures.js +140 -0
  334. package/dist/cjs/modules/word/document.js +1909 -0
  335. package/dist/cjs/modules/word/docx-packager.js +825 -0
  336. package/dist/cjs/modules/word/docx-reader.js +4932 -0
  337. package/dist/cjs/modules/word/encryption.js +282 -0
  338. package/dist/cjs/modules/word/errors.js +88 -0
  339. package/dist/cjs/modules/word/font-obfuscation.js +88 -0
  340. package/dist/cjs/modules/word/html-renderer.js +785 -0
  341. package/dist/cjs/modules/word/index.base.js +199 -0
  342. package/dist/cjs/modules/word/index.browser.js +20 -0
  343. package/dist/cjs/modules/word/index.js +20 -0
  344. package/dist/cjs/modules/word/internal-utils.js +59 -0
  345. package/dist/cjs/modules/word/relationships.js +60 -0
  346. package/dist/cjs/modules/word/types.js +11 -0
  347. package/dist/cjs/modules/word/units.js +135 -0
  348. package/dist/cjs/modules/word/writers/chart-writer.js +388 -0
  349. package/dist/cjs/modules/word/writers/checkbox-writer.js +45 -0
  350. package/dist/cjs/modules/word/writers/comment-writer.js +74 -0
  351. package/dist/cjs/modules/word/writers/document-writer.js +465 -0
  352. package/dist/cjs/modules/word/writers/footnote-writer.js +76 -0
  353. package/dist/cjs/modules/word/writers/header-footer-writer.js +134 -0
  354. package/dist/cjs/modules/word/writers/image-writer.js +188 -0
  355. package/dist/cjs/modules/word/writers/math-writer.js +431 -0
  356. package/dist/cjs/modules/word/writers/numbering-writer.js +128 -0
  357. package/dist/cjs/modules/word/writers/paragraph-writer.js +521 -0
  358. package/dist/cjs/modules/word/writers/parts-writer.js +671 -0
  359. package/dist/cjs/modules/word/writers/run-writer.js +655 -0
  360. package/dist/cjs/modules/word/writers/section-writer.js +241 -0
  361. package/dist/cjs/modules/word/writers/styles-writer.js +245 -0
  362. package/dist/cjs/modules/word/writers/table-writer.js +506 -0
  363. package/dist/cjs/modules/word/writers/textbox-writer.js +56 -0
  364. package/dist/cjs/modules/word/writers/toc-writer.js +82 -0
  365. package/dist/cjs/modules/xml/encode.js +158 -11
  366. package/dist/esm/index.browser.js +20 -2
  367. package/dist/esm/index.js +9 -1
  368. package/dist/esm/modules/excel/chart/cache-populator.js +1171 -0
  369. package/dist/esm/modules/excel/chart/chart-api.js +364 -0
  370. package/dist/esm/modules/excel/chart/chart-builder.js +2432 -0
  371. package/dist/esm/modules/excel/chart/chart-ex-builder.js +903 -0
  372. package/dist/esm/modules/excel/chart/chart-ex-parser.js +1205 -0
  373. package/dist/esm/modules/excel/chart/chart-ex-renderer.js +5352 -0
  374. package/dist/esm/modules/excel/chart/chart-ex-types.js +11 -0
  375. package/dist/esm/modules/excel/chart/chart-images.js +363 -0
  376. package/dist/esm/modules/excel/chart/chart-presets.js +179 -0
  377. package/dist/esm/modules/excel/chart/chart-renderer.js +6440 -0
  378. package/dist/esm/modules/excel/chart/chart-sidecar.js +427 -0
  379. package/dist/esm/modules/excel/chart/chart-utils.js +821 -0
  380. package/dist/esm/modules/excel/chart/chart.js +1320 -0
  381. package/dist/esm/modules/excel/chart/glyph-rasterizer.js +658 -0
  382. package/dist/esm/modules/excel/chart/index.js +46 -0
  383. package/dist/esm/modules/excel/chart/install.js +91 -0
  384. package/dist/esm/modules/excel/chart/shape-properties.js +1557 -0
  385. package/dist/esm/modules/excel/chart/stroke-font.js +1556 -0
  386. package/dist/esm/modules/excel/chart/topojson.js +236 -0
  387. package/dist/esm/modules/excel/chart/types.js +8 -0
  388. package/dist/esm/modules/excel/chart-host-registry.js +90 -0
  389. package/dist/esm/modules/excel/chartsheet.js +196 -0
  390. package/dist/esm/modules/excel/defined-names.js +44 -4
  391. package/dist/esm/modules/excel/errors.js +9 -0
  392. package/dist/esm/modules/excel/form-control.js +17 -0
  393. package/dist/esm/modules/excel/image.js +12 -2
  394. package/dist/esm/modules/excel/pivot-chart.js +53 -0
  395. package/dist/esm/modules/excel/pivot-table.js +35 -0
  396. package/dist/esm/modules/excel/range.js +5 -1
  397. package/dist/esm/modules/excel/sparkline/index.js +7 -0
  398. package/dist/esm/modules/excel/sparkline/sparkline.js +750 -0
  399. package/dist/esm/modules/excel/stream/worksheet-writer.js +3 -2
  400. package/dist/esm/modules/excel/table.js +42 -6
  401. package/dist/esm/modules/excel/utils/address.js +28 -0
  402. package/dist/esm/modules/excel/utils/drawing-utils.js +11 -6
  403. package/dist/esm/modules/excel/utils/guid.js +35 -0
  404. package/dist/esm/modules/excel/utils/ooxml-paths.js +206 -9
  405. package/dist/esm/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
  406. package/dist/esm/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
  407. package/dist/esm/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
  408. package/dist/esm/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
  409. package/dist/esm/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
  410. package/dist/esm/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
  411. package/dist/esm/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
  412. package/dist/esm/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
  413. package/dist/esm/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
  414. package/dist/esm/modules/excel/utils/ooxml-validator/check-table.js +177 -0
  415. package/dist/esm/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
  416. package/dist/esm/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
  417. package/dist/esm/modules/excel/utils/ooxml-validator/context.js +191 -0
  418. package/dist/esm/modules/excel/utils/ooxml-validator/index.js +102 -0
  419. package/dist/esm/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
  420. package/dist/esm/modules/excel/utils/ooxml-validator/reporter.js +61 -0
  421. package/dist/esm/modules/excel/utils/ooxml-validator/types.js +12 -0
  422. package/dist/esm/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
  423. package/dist/esm/modules/excel/workbook.browser.js +969 -34
  424. package/dist/esm/modules/excel/workbook.js +48 -0
  425. package/dist/esm/modules/excel/worksheet.js +394 -35
  426. package/dist/esm/modules/excel/xlsx/rel-type.js +41 -1
  427. package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  428. package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  429. package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  430. package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
  431. package/dist/esm/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
  432. package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
  433. package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  434. package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  435. package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  436. package/dist/esm/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
  437. package/dist/esm/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  438. package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  439. package/dist/esm/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  440. package/dist/esm/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
  441. package/dist/esm/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  442. package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
  443. package/dist/esm/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  444. package/dist/esm/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  445. package/dist/esm/modules/excel/xlsx/xform/xsd-values.js +101 -0
  446. package/dist/esm/modules/excel/xlsx/xlsx.browser.js +4422 -78
  447. package/dist/esm/modules/pdf/builder/document-builder.js +507 -2
  448. package/dist/esm/modules/pdf/builder/pdf-editor.js +48 -3
  449. package/dist/esm/modules/pdf/excel-bridge.js +683 -12
  450. package/dist/esm/modules/pdf/font/font-manager.js +39 -0
  451. package/dist/esm/modules/pdf/index.js +3 -1
  452. package/dist/esm/modules/pdf/render/chart-surface.js +200 -0
  453. package/dist/esm/modules/pdf/render/layout-engine.js +436 -56
  454. package/dist/esm/modules/pdf/render/page-renderer.js +169 -28
  455. package/dist/esm/modules/pdf/render/pdf-exporter.js +117 -7
  456. package/dist/esm/modules/pdf/types.js +4 -0
  457. package/dist/esm/modules/pdf/word-bridge.js +304 -0
  458. package/dist/esm/modules/word/constants.js +231 -0
  459. package/dist/esm/modules/word/content-types.js +53 -0
  460. package/dist/esm/modules/word/digital-signatures.js +134 -0
  461. package/dist/esm/modules/word/document.js +1795 -0
  462. package/dist/esm/modules/word/docx-packager.js +822 -0
  463. package/dist/esm/modules/word/docx-reader.js +4929 -0
  464. package/dist/esm/modules/word/encryption.js +274 -0
  465. package/dist/esm/modules/word/errors.js +68 -0
  466. package/dist/esm/modules/word/font-obfuscation.js +83 -0
  467. package/dist/esm/modules/word/html-renderer.js +782 -0
  468. package/dist/esm/modules/word/index.base.js +51 -0
  469. package/dist/esm/modules/word/index.browser.js +4 -0
  470. package/dist/esm/modules/word/index.js +4 -0
  471. package/dist/esm/modules/word/internal-utils.js +54 -0
  472. package/dist/esm/modules/word/relationships.js +56 -0
  473. package/dist/esm/modules/word/types.js +10 -0
  474. package/dist/esm/modules/word/units.js +111 -0
  475. package/dist/esm/modules/word/writers/chart-writer.js +385 -0
  476. package/dist/esm/modules/word/writers/checkbox-writer.js +42 -0
  477. package/dist/esm/modules/word/writers/comment-writer.js +70 -0
  478. package/dist/esm/modules/word/writers/document-writer.js +461 -0
  479. package/dist/esm/modules/word/writers/footnote-writer.js +72 -0
  480. package/dist/esm/modules/word/writers/header-footer-writer.js +129 -0
  481. package/dist/esm/modules/word/writers/image-writer.js +185 -0
  482. package/dist/esm/modules/word/writers/math-writer.js +428 -0
  483. package/dist/esm/modules/word/writers/numbering-writer.js +125 -0
  484. package/dist/esm/modules/word/writers/paragraph-writer.js +516 -0
  485. package/dist/esm/modules/word/writers/parts-writer.js +660 -0
  486. package/dist/esm/modules/word/writers/run-writer.js +649 -0
  487. package/dist/esm/modules/word/writers/section-writer.js +238 -0
  488. package/dist/esm/modules/word/writers/styles-writer.js +242 -0
  489. package/dist/esm/modules/word/writers/table-writer.js +503 -0
  490. package/dist/esm/modules/word/writers/textbox-writer.js +53 -0
  491. package/dist/esm/modules/word/writers/toc-writer.js +79 -0
  492. package/dist/esm/modules/xml/encode.js +157 -11
  493. package/dist/iife/excelts.iife.js +11789 -687
  494. package/dist/iife/excelts.iife.js.map +1 -1
  495. package/dist/iife/excelts.iife.min.js +52 -44
  496. package/dist/types/index.browser.d.ts +8 -5
  497. package/dist/types/index.d.ts +4 -2
  498. package/dist/types/modules/excel/chart/cache-populator.d.ts +49 -0
  499. package/dist/types/modules/excel/chart/chart-api.d.ts +92 -0
  500. package/dist/types/modules/excel/chart/chart-builder.d.ts +48 -0
  501. package/dist/types/modules/excel/chart/chart-ex-builder.d.ts +36 -0
  502. package/dist/types/modules/excel/chart/chart-ex-parser.d.ts +8 -0
  503. package/dist/types/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
  504. package/dist/types/modules/excel/chart/chart-ex-types.d.ts +531 -0
  505. package/dist/types/modules/excel/chart/chart-images.d.ts +78 -0
  506. package/dist/types/modules/excel/chart/chart-presets.d.ts +392 -0
  507. package/dist/types/modules/excel/chart/chart-renderer.d.ts +550 -0
  508. package/dist/types/modules/excel/chart/chart-sidecar.d.ts +21 -0
  509. package/dist/types/modules/excel/chart/chart-utils.d.ts +306 -0
  510. package/dist/types/modules/excel/chart/chart.d.ts +504 -0
  511. package/dist/types/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
  512. package/dist/types/modules/excel/chart/index.d.ts +54 -0
  513. package/dist/types/modules/excel/chart/install.d.ts +44 -0
  514. package/dist/types/modules/excel/chart/shape-properties.d.ts +156 -0
  515. package/dist/types/modules/excel/chart/stroke-font.d.ts +36 -0
  516. package/dist/types/modules/excel/chart/topojson.d.ts +98 -0
  517. package/dist/types/modules/excel/chart/types.d.ts +2559 -0
  518. package/dist/types/modules/excel/chart-host-registry.d.ts +157 -0
  519. package/dist/types/modules/excel/chartsheet.d.ts +102 -0
  520. package/dist/types/modules/excel/defined-names.d.ts +35 -0
  521. package/dist/types/modules/excel/errors.d.ts +6 -0
  522. package/dist/types/modules/excel/form-control.d.ts +6 -0
  523. package/dist/types/modules/excel/pivot-chart.d.ts +7 -0
  524. package/dist/types/modules/excel/pivot-table.d.ts +55 -0
  525. package/dist/types/modules/excel/sparkline/index.d.ts +7 -0
  526. package/dist/types/modules/excel/sparkline/sparkline.d.ts +206 -0
  527. package/dist/types/modules/excel/types.d.ts +72 -0
  528. package/dist/types/modules/excel/utils/address.d.ts +18 -0
  529. package/dist/types/modules/excel/utils/guid.d.ts +15 -0
  530. package/dist/types/modules/excel/utils/ooxml-paths.d.ts +74 -0
  531. package/dist/types/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
  532. package/dist/types/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
  533. package/dist/types/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
  534. package/dist/types/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
  535. package/dist/types/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
  536. package/dist/types/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
  537. package/dist/types/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
  538. package/dist/types/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
  539. package/dist/types/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
  540. package/dist/types/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
  541. package/dist/types/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
  542. package/dist/types/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
  543. package/dist/types/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
  544. package/dist/types/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
  545. package/dist/types/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
  546. package/dist/types/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
  547. package/dist/types/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
  548. package/dist/types/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
  549. package/dist/types/modules/excel/workbook.browser.d.ts +248 -30
  550. package/dist/types/modules/excel/workbook.d.ts +43 -0
  551. package/dist/types/modules/excel/worksheet.d.ts +157 -3
  552. package/dist/types/modules/excel/xlsx/rel-type.d.ts +40 -0
  553. package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
  554. package/dist/types/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
  555. package/dist/types/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
  556. package/dist/types/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
  557. package/dist/types/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
  558. package/dist/types/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
  559. package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
  560. package/dist/types/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
  561. package/dist/types/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
  562. package/dist/types/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
  563. package/dist/types/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
  564. package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
  565. package/dist/types/modules/pdf/builder/document-builder.d.ts +74 -0
  566. package/dist/types/modules/pdf/excel-bridge.d.ts +69 -0
  567. package/dist/types/modules/pdf/font/font-manager.d.ts +25 -0
  568. package/dist/types/modules/pdf/index.d.ts +5 -2
  569. package/dist/types/modules/pdf/render/chart-surface.d.ts +33 -0
  570. package/dist/types/modules/pdf/render/layout-engine.d.ts +22 -1
  571. package/dist/types/modules/pdf/types.d.ts +227 -23
  572. package/dist/types/modules/pdf/word-bridge.d.ts +47 -0
  573. package/dist/types/modules/word/constants.d.ts +179 -0
  574. package/dist/types/modules/word/content-types.d.ts +27 -0
  575. package/dist/types/modules/word/digital-signatures.d.ts +87 -0
  576. package/dist/types/modules/word/document.d.ts +728 -0
  577. package/dist/types/modules/word/docx-packager.d.ts +14 -0
  578. package/dist/types/modules/word/docx-reader.d.ts +11 -0
  579. package/dist/types/modules/word/encryption.d.ts +102 -0
  580. package/dist/types/modules/word/errors.d.ts +49 -0
  581. package/dist/types/modules/word/font-obfuscation.d.ts +31 -0
  582. package/dist/types/modules/word/html-renderer.d.ts +38 -0
  583. package/dist/types/modules/word/index.base.d.ts +19 -0
  584. package/dist/types/modules/word/index.browser.d.ts +4 -0
  585. package/dist/types/modules/word/index.d.ts +4 -0
  586. package/dist/types/modules/word/internal-utils.d.ts +23 -0
  587. package/dist/types/modules/word/relationships.d.ts +31 -0
  588. package/dist/types/modules/word/types.d.ts +2325 -0
  589. package/dist/types/modules/word/units.d.ts +49 -0
  590. package/dist/types/modules/word/writers/chart-writer.d.ts +10 -0
  591. package/dist/types/modules/word/writers/checkbox-writer.d.ts +9 -0
  592. package/dist/types/modules/word/writers/comment-writer.d.ts +15 -0
  593. package/dist/types/modules/word/writers/document-writer.d.ts +16 -0
  594. package/dist/types/modules/word/writers/footnote-writer.d.ts +11 -0
  595. package/dist/types/modules/word/writers/header-footer-writer.d.ts +13 -0
  596. package/dist/types/modules/word/writers/image-writer.d.ts +10 -0
  597. package/dist/types/modules/word/writers/math-writer.d.ts +9 -0
  598. package/dist/types/modules/word/writers/numbering-writer.d.ts +10 -0
  599. package/dist/types/modules/word/writers/paragraph-writer.d.ts +13 -0
  600. package/dist/types/modules/word/writers/parts-writer.d.ts +26 -0
  601. package/dist/types/modules/word/writers/run-writer.d.ts +15 -0
  602. package/dist/types/modules/word/writers/section-writer.d.ts +10 -0
  603. package/dist/types/modules/word/writers/styles-writer.d.ts +10 -0
  604. package/dist/types/modules/word/writers/table-writer.d.ts +10 -0
  605. package/dist/types/modules/word/writers/textbox-writer.d.ts +9 -0
  606. package/dist/types/modules/word/writers/toc-writer.d.ts +9 -0
  607. package/dist/types/modules/xml/encode.d.ts +56 -7
  608. package/package.json +29 -11
  609. package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +0 -48
  610. package/dist/browser/modules/excel/utils/ooxml-validator.js +0 -493
  611. package/dist/browser/modules/excel/utils/passthrough-manager.d.ts +0 -77
  612. package/dist/browser/modules/excel/utils/passthrough-manager.js +0 -129
  613. package/dist/cjs/modules/excel/utils/ooxml-validator.js +0 -499
  614. package/dist/cjs/modules/excel/utils/passthrough-manager.js +0 -133
  615. package/dist/esm/modules/excel/utils/ooxml-validator.js +0 -493
  616. package/dist/esm/modules/excel/utils/passthrough-manager.js +0 -129
  617. package/dist/types/modules/excel/utils/ooxml-validator.d.ts +0 -48
  618. package/dist/types/modules/excel/utils/passthrough-manager.d.ts +0 -77
@@ -0,0 +1,907 @@
1
+ "use strict";
2
+ /**
3
+ * ChartEx builder — constructs a ChartExModel from simplified AddChartExOptions.
4
+ *
5
+ * Each layoutId corresponds to a distinct chart type. The builder produces a
6
+ * structured model that the renderer serialises to `cx:chart` XML.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.combineHierarchyFormulas = combineHierarchyFormulas;
10
+ exports.buildChartExModel = buildChartExModel;
11
+ const errors_1 = require("../errors.js");
12
+ const chart_builder_1 = require("./chart-builder");
13
+ function parseColumnRef(formula) {
14
+ // Match: optional sheet (quoted or bare) + !$COL$ROW:$COL$ROW
15
+ const match = /^\s*(?:'([^'\r\n]+)'|([A-Za-z_][A-Za-z0-9_. ]*))!\$([A-Z]{1,3})\$(\d+):\$([A-Z]{1,3})\$(\d+)\s*$/.exec(formula);
16
+ if (!match) {
17
+ return null;
18
+ }
19
+ // Groups: 1=quoted sheet, 2=bare sheet, 3=colStart, 4=rowStart,
20
+ // 5=colEnd, 6=rowEnd. The row/col pair alternates — the `:`
21
+ // delimiter is between the start address (cols + rows, i.e.
22
+ // `$COL$ROW`) and the end address.
23
+ return {
24
+ sheet: match[1] ?? match[2],
25
+ quotedSheet: !!match[1],
26
+ colStart: match[3],
27
+ colEnd: match[5],
28
+ rowStart: parseInt(match[4], 10),
29
+ rowEnd: parseInt(match[6], 10)
30
+ };
31
+ }
32
+ function colLettersToIndex(letters) {
33
+ let n = 0;
34
+ for (let i = 0; i < letters.length; i++) {
35
+ n = n * 26 + (letters.charCodeAt(i) - 64);
36
+ }
37
+ return n;
38
+ }
39
+ function colIndexToLetters(index) {
40
+ let n = index;
41
+ let out = "";
42
+ while (n > 0) {
43
+ const rem = (n - 1) % 26;
44
+ out = String.fromCharCode(65 + rem) + out;
45
+ n = Math.floor((n - 1) / 26);
46
+ }
47
+ return out;
48
+ }
49
+ /**
50
+ * Combine multiple single-column range formulas (first item is the
51
+ * OUTERMOST hierarchy level, last item is the leaf level / primary
52
+ * category) into a single multi-column range that Excel's hierarchical
53
+ * chartEx loader accepts.
54
+ *
55
+ * Microsoft Excel's treemap / sunburst writer emits ONE `<cx:strDim>`
56
+ * whose `<cx:f>` points at a contiguous multi-column range spanning
57
+ * every hierarchy level (e.g. `Sheet1!$A$2:$C$8` for a Region / Country
58
+ * / City breakdown). The chart reader derives the hierarchy from the
59
+ * column ORDER within that range — the first column is the root and
60
+ * the last is the leaf. Emitting per-level `<cx:strDim>` siblings (one
61
+ * per formula) is schema-legal but makes Excel draw an empty plot
62
+ * area: verified against `reference-hierarchy.xlsx` (Excel-authored
63
+ * sample) where the same hierarchy renders correctly only when the
64
+ * columns live under a single `<cx:f>`.
65
+ *
66
+ * Returns the combined formula when every input formula lives on the
67
+ * same sheet with identical row spans and contiguous ascending columns
68
+ * (the common case when authors lay their hierarchy out in adjacent
69
+ * worksheet columns). Returns `null` otherwise — the caller should
70
+ * fall back to per-level caching because Excel has no way to express
71
+ * a non-contiguous hierarchy as a single range.
72
+ */
73
+ function combineHierarchyFormulas(formulas) {
74
+ if (formulas.length === 0) {
75
+ return null;
76
+ }
77
+ if (formulas.length === 1) {
78
+ return formulas[0];
79
+ }
80
+ const parsed = [];
81
+ for (const f of formulas) {
82
+ const p = parseColumnRef(f);
83
+ if (!p) {
84
+ return null;
85
+ }
86
+ // Only single-column ranges are combinable. Multi-column inputs
87
+ // can't be meaningfully merged with another column without
88
+ // overlap / ambiguity.
89
+ if (p.colStart !== p.colEnd) {
90
+ return null;
91
+ }
92
+ parsed.push(p);
93
+ }
94
+ const first = parsed[0];
95
+ let prevCol = colLettersToIndex(first.colStart);
96
+ for (let i = 1; i < parsed.length; i++) {
97
+ const p = parsed[i];
98
+ if (p.sheet !== first.sheet) {
99
+ return null;
100
+ }
101
+ if (p.rowStart !== first.rowStart || p.rowEnd !== first.rowEnd) {
102
+ return null;
103
+ }
104
+ const curCol = colLettersToIndex(p.colStart);
105
+ if (curCol !== prevCol + 1) {
106
+ return null;
107
+ }
108
+ prevCol = curCol;
109
+ }
110
+ const startCol = first.colStart;
111
+ const endCol = colIndexToLetters(prevCol);
112
+ const sheetRef = first.quotedSheet ? `'${first.sheet}'` : first.sheet;
113
+ return `${sheetRef}!$${startCol}$${first.rowStart}:$${endCol}$${first.rowEnd}`;
114
+ }
115
+ /**
116
+ * Build a structured ChartExModel from high-level options.
117
+ */
118
+ function buildChartExModel(opts) {
119
+ validateChartExOptions(opts);
120
+ const layoutId = mapChartTypeToLayoutId(opts.type);
121
+ // Build data entries — one cx:data per reference the series need.
122
+ const data = [];
123
+ const dataIdCounter = { value: 0 };
124
+ // Categories share a single data entry for all series (like classic charts).
125
+ let catDataId;
126
+ if (opts.categories) {
127
+ catDataId = dataIdCounter.value++;
128
+ data.push({
129
+ id: catDataId,
130
+ strDim: {
131
+ type: "cat",
132
+ formula: opts.categories,
133
+ levels: [{ ptCount: 0, points: [] }]
134
+ }
135
+ });
136
+ }
137
+ else {
138
+ // No chart-level `categories` formula — check whether the series
139
+ // bundle carries a `literalCategories` array we can hoist up and
140
+ // share. Classic charts and Excel-authored ChartEx both store
141
+ // categories as a single axis-wide entry; the previous code
142
+ // allocated a fresh cat `cx:data` entry inside each series' branch
143
+ // below, producing `N` parallel category dimensions for `N` series
144
+ // and breaking the "shared category axis" invariant Excel readers
145
+ // expect. Find the first series that carries a non-empty
146
+ // `literalCategories` and use it as the shared entry. Subsequent
147
+ // series that redefine `literalCategories` to a different shape
148
+ // throw — mixing-and-matching per-series category axes is not
149
+ // supported by Chart2014.
150
+ const firstLiteral = opts.series.find(so => so.literalCategories?.length)?.literalCategories;
151
+ if (firstLiteral && firstLiteral.length > 0) {
152
+ // Validate that every other series with `literalCategories`
153
+ // carries the same array (by deep equality). Divergence is a
154
+ // caller bug — the schema has no way to express per-series
155
+ // category axes in a ChartEx plot area region.
156
+ for (const so of opts.series) {
157
+ if (!so.literalCategories) {
158
+ continue;
159
+ }
160
+ if (!arraysEqual(so.literalCategories, firstLiteral)) {
161
+ throw new errors_1.ChartOptionsError("AddChartExOptions.series[*].literalCategories must be the same across all series; " +
162
+ "ChartEx stores categories on a shared category axis (see `opts.categories` for the " +
163
+ "formula-based alternative).");
164
+ }
165
+ }
166
+ catDataId = dataIdCounter.value++;
167
+ data.push({
168
+ id: catDataId,
169
+ strDim: {
170
+ type: "cat",
171
+ levels: [
172
+ {
173
+ ptCount: firstLiteral.length,
174
+ points: firstLiteral.map((value, index) => ({ index, value }))
175
+ }
176
+ ]
177
+ }
178
+ });
179
+ }
180
+ }
181
+ // Build series — each gets its own cx:data entries for values (and any
182
+ // extras like hierarchy levels).
183
+ const series = [];
184
+ for (let i = 0; i < opts.series.length; i++) {
185
+ const so = opts.series[i];
186
+ const built = buildSeriesAndData(so, i, layoutId, catDataId, data, dataIdCounter, opts);
187
+ series.push(built);
188
+ }
189
+ // Build axes — needed for histogram, pareto, waterfall, funnel, boxWhisker.
190
+ const axes = [];
191
+ if (needsAxes(opts.type)) {
192
+ // Match Microsoft Excel's convention: chartEx axes are numbered
193
+ // 0 and 1 (cat / val), not `100000000+` like classic charts.
194
+ // Excel writes axes this way for every chartEx it authors —
195
+ // using small sequential ids keeps our output byte-compatible
196
+ // with Excel 2016+ for a fresh chartEx. Classic charts still
197
+ // use the `100000000` seed to avoid collisions with loaded
198
+ // files that happened to allocate small ids; chartEx is a
199
+ // separate part and cannot collide with classic chart axes.
200
+ const catAxisId = 0;
201
+ const valAxisId = 1;
202
+ // Match Excel's default cat-axis `gapWidth` + `<cx:tickLabels/>`
203
+ // and val-axis `<cx:majorGridlines/>` + `<cx:tickLabels/>` so
204
+ // freshly-built chartEx charts look identical to what Excel
205
+ // itself emits for the same chart type. Excel uses
206
+ // `gapWidth="0"` for histogram + pareto (bars touching —
207
+ // histograms traditionally render with zero gap between bins)
208
+ // and `gapWidth="0.5"` for waterfall / boxWhisker / funnel
209
+ // (narrower categorical bars). Users who set `layout.gapWidth`
210
+ // override the default.
211
+ const defaultGapWidth = opts.type === "histogram" || opts.type === "pareto" ? 0 : 0.5;
212
+ axes.push({
213
+ axisId: catAxisId,
214
+ type: "cat",
215
+ catScaling: { gapWidth: defaultGapWidth },
216
+ tickLabels: {}
217
+ });
218
+ axes.push({
219
+ axisId: valAxisId,
220
+ type: "val",
221
+ majorGridlines: {},
222
+ tickLabels: {}
223
+ });
224
+ // Excel does NOT emit `<cx:axisId>` children on `<cx:series>` —
225
+ // it expects the axis binding to come from the axes in
226
+ // `cx:plotArea/cx:axis` directly. Leaving `s.axisId` unset
227
+ // matches Excel's output exactly. (The renderer still emits
228
+ // any `axisId` array populated by the parser for round-tripped
229
+ // files, so existing files that DO carry these references
230
+ // survive load → save without drift.)
231
+ }
232
+ const model = {
233
+ chartSpace: {
234
+ chartData: { data },
235
+ // Chart-frame styling lives on `CT_ChartSpace/spPr` per
236
+ // ECMA-376 / Chart2014 — `CT_Chart` itself has no `spPr` child.
237
+ // Route `opts.spPr` here so the writer's schema-compliant path
238
+ // receives it. (Users can still pass either the structured
239
+ // `ShapeProperties` form or the ergonomic hex-colour shorthand;
240
+ // `toShapeProperties` normalises both.)
241
+ spPr: (0, chart_builder_1.toShapeProperties)(opts.spPr),
242
+ chart: {
243
+ title: buildChartExTitle(opts.title),
244
+ // Leave `autoTitleDeleted` undefined when the caller did not
245
+ // supply a title. Setting it to `true` whenever `opts.title`
246
+ // is absent tells Excel "the author explicitly deleted the
247
+ // auto-title", suppressing the automatic chart title Excel
248
+ // normally shows for single-series charts. Pass
249
+ // `title: null` (or an empty rich-text wrapper) to request
250
+ // explicit suppression; omitting the option preserves Excel's
251
+ // default auto-title behaviour.
252
+ autoTitleDeleted: opts.title === null ? true : undefined,
253
+ plotArea: {
254
+ plotAreaRegion: {
255
+ series
256
+ },
257
+ axis: axes.length > 0 ? axes : undefined
258
+ },
259
+ // Legend: Excel omits the `<cx:legend>` element entirely for
260
+ // histogram charts (a histogram has a single unnamed series,
261
+ // nothing to legend — emitting an empty legend placeholder
262
+ // causes Excel 2016+ to render the chart as a blank frame).
263
+ // Respect `opts.showLegend === false` for other types.
264
+ // Match Excel's legend attribute defaults otherwise:
265
+ // `pos="t" align="ctr" overlay="0"` — Excel's own output
266
+ // for a newly-inserted waterfall / funnel / boxWhisker uses
267
+ // top-centre placement. Users who pass `opts.legendPosition`
268
+ // still override `pos`.
269
+ legend: opts.showLegend === false || opts.type === "histogram"
270
+ ? undefined
271
+ : {
272
+ legendPos: opts.legendPosition ?? "t",
273
+ align: "ctr",
274
+ overlay: false
275
+ }
276
+ }
277
+ },
278
+ // ChartEx ALWAYS ships with a `chartStyle` + `chartColorStyle`
279
+ // sidecar, linked from `chartEx1.xml.rels`. Without them Excel
280
+ // 2016+ discards the chartEx part on load ("Removed Part:
281
+ // /xl/drawings/drawingN.xml (Drawing shape)"). When the caller
282
+ // hasn't supplied structured style / colors, we emit the
283
+ // id-only minimal form — `<cs:chartStyle id="395"/>` and
284
+ // `<cs:colorStyle meth="cycle" id="10"/>` — which Excel's
285
+ // default style table resolves to a sensible built-in palette.
286
+ // Style id 395 + colors id 10 are the defaults Excel itself
287
+ // uses for a freshly-inserted waterfall (verified against a
288
+ // reference xlsx authored by Excel 2021).
289
+ //
290
+ // Callers who want custom styling pass `opts.chartStyle` /
291
+ // `opts.chartColors`; those paths short-circuit this default.
292
+ style: opts.chartStyle ?? { id: 395 },
293
+ colors: opts.chartColors ?? { id: 10, method: "cycle" }
294
+ };
295
+ return model;
296
+ }
297
+ /**
298
+ * Normalise a ChartEx title option into the structured `ChartTitle` shape.
299
+ * Accepts the same three forms as the classic chart builder: a plain string,
300
+ * a rich-text description, or a `{ formula: "Sheet1!$A$1" }` reference. This
301
+ * keeps the classic / ChartEx APIs symmetric — previously ChartEx only
302
+ * supported strings and silently ignored formula / rich-text input.
303
+ */
304
+ function buildChartExTitle(input) {
305
+ // `null` signals "explicitly suppress auto-title" — the caller has
306
+ // already promoted this to `autoTitleDeleted: true` at the call site,
307
+ // so we emit no title element.
308
+ if (input === undefined || input === null) {
309
+ return undefined;
310
+ }
311
+ if (typeof input === "string") {
312
+ return {
313
+ text: { paragraphs: [{ runs: [{ text: input }] }] },
314
+ overlay: false
315
+ };
316
+ }
317
+ if ("formula" in input && typeof input.formula === "string") {
318
+ return {
319
+ // `ChartTitle.strRef` is the classic `StringReference` shape
320
+ // (`{ formula, cache: { points: [] } }`) because ChartEx titles
321
+ // reuse the classic `ChartTitle` type. Distinct from the ChartEx
322
+ // series `tx.strRef` which uses `{ formula, cached? }`.
323
+ strRef: { formula: input.formula, cache: { points: [] } },
324
+ overlay: false
325
+ };
326
+ }
327
+ if ("paragraphs" in input) {
328
+ return {
329
+ text: input,
330
+ overlay: false
331
+ };
332
+ }
333
+ throw new errors_1.ChartOptionsError("chartEx.title must be a string, a { formula: string } reference, or a ChartRichText object.");
334
+ }
335
+ function buildSeriesAndData(so, idx, layoutId, catDataId, data, counter, opts) {
336
+ // `idx` is the caller-facing 0-based series index within the chart.
337
+ // The OOXML Chart2014 schema routes series ordering through
338
+ // `<cx:dataId>` / `<cx:axisId>` references rather than a dedicated
339
+ // series-index attribute, so there is no field to populate on the
340
+ // model — the parser never reads it and both the renderer and the
341
+ // writer key everything off `layoutId` / `dataRefs`. Keeping `idx`
342
+ // as a documented parameter so the caller's intent is preserved in
343
+ // tracing output if a future schema extension ever needs it.
344
+ void idx;
345
+ const series = {
346
+ layoutId,
347
+ dataRefs: []
348
+ };
349
+ if (so.name !== undefined) {
350
+ // Dispatch on the `name` shape. Plain strings become literal
351
+ // captions; `{ formula }` routes through `tx.strRef` so the writer
352
+ // emits `<cx:f>` (worksheet reference); rich-text structures pass
353
+ // through unchanged. Matches `AddChartSeriesOptions.name` handling
354
+ // on the classic side — previously the chartEx builder only
355
+ // accepted plain strings and silently dropped the other forms.
356
+ if (typeof so.name === "string") {
357
+ series.tx = { value: so.name };
358
+ }
359
+ else if ("formula" in so.name) {
360
+ // Use the canonical object form `{ formula, cached? }` rather
361
+ // than the legacy bare-string variant. The writer at
362
+ // `chart-ex-renderer.ts:renderSeries` handles both, but
363
+ // storing the object uniformly keeps the typed model
364
+ // consistent across builder-produced and parser-produced
365
+ // series — downstream consumers can treat `tx.strRef` as
366
+ // always object-shaped after this round of builder work.
367
+ series.tx = { strRef: { formula: so.name.formula } };
368
+ }
369
+ else {
370
+ series.tx = { rich: so.name };
371
+ }
372
+ }
373
+ // ------------------------------------------------------------------
374
+ // Data ref order for sunburst / treemap
375
+ //
376
+ // Excel-authored sunburst and treemap charts group ALL string
377
+ // dimensions (categories + hierarchy levels) before the numeric
378
+ // value dimension. The previous builder order was
379
+ // [category, value, hierarchy...]
380
+ // which opens in Excel but doesn't match the canonical layout —
381
+ // some readers (Excel's own chartEx parser that wraps the charts API)
382
+ // expect contiguous strDim refs before numDim.
383
+ //
384
+ // For non-hierarchical types (funnel, waterfall, histogram, pareto,
385
+ // boxWhisker, regionMap, clusteredColumn) the order category, value
386
+ // is already canonical, so the hierarchy branch below is a no-op.
387
+ // ------------------------------------------------------------------
388
+ const isHierarchical = layoutId === "sunburst" || layoutId === "treemap";
389
+ // Categories binding. `buildChartExModel` hoists any shared
390
+ // `literalCategories` into a single `catDataId` before calling us, so
391
+ // by the time we're here the only cases are:
392
+ // 1. `catDataId !== undefined` → the chart has a shared cat axis
393
+ // (either from `opts.categories` or hoisted literals); reuse it.
394
+ // 2. `catDataId === undefined` → no category axis; omit the ref.
395
+ // The previous fallback that allocated a fresh per-series `cx:data`
396
+ // entry from `so.literalCategories` has been removed — it produced
397
+ // N duplicated cat axes for N series, breaking the shared-axis
398
+ // invariant. Any literal-category hoisting / validation is done in
399
+ // `buildChartExModel`.
400
+ if (catDataId !== undefined) {
401
+ series.dataRefs.push({ dataId: catDataId });
402
+ }
403
+ // For sunburst / treemap, Excel expects a SINGLE `<cx:strDim>`
404
+ // whose `<cx:f>` points to a contiguous MULTI-COLUMN range that
405
+ // spans every hierarchy level (outer → inner, root column first,
406
+ // leaf column last). See `combineHierarchyFormulas` for the
407
+ // rationale + the reference fixture (`reference-hierarchy.xlsx`)
408
+ // where the same layout rendered blank under the previous
409
+ // "one data entry per level" approach. When the caller's
410
+ // `categories` + `hierarchy` live in adjacent worksheet columns
411
+ // with matching row ranges we rewrite `catDataId`'s strDim with
412
+ // the combined range and skip per-level data entries. When the
413
+ // ranges can't be combined (different sheets, non-contiguous
414
+ // columns, …) we leave the entries as-is and accept that Excel
415
+ // may draw the chart blank — manual reshaping by the author is
416
+ // the only way to recover.
417
+ let hierarchyCombined = false;
418
+ if (isHierarchical) {
419
+ const hierarchyFormulas = so.hierarchy;
420
+ if (hierarchyFormulas && catDataId !== undefined && opts.categories) {
421
+ // Root → leaf: `[...hierarchy, categories]` matches Excel's
422
+ // left-to-right column reading order.
423
+ const combined = combineHierarchyFormulas([...hierarchyFormulas, opts.categories]);
424
+ if (combined) {
425
+ hierarchyCombined = true;
426
+ const catEntry = data.find(d => d.id === catDataId);
427
+ if (catEntry?.strDim) {
428
+ catEntry.strDim.formula = combined;
429
+ // Clear any seeded empty-level placeholder: Excel's writer
430
+ // emits no `<cx:lvl>` cache for hierarchical charts and
431
+ // reads fresh from the referenced cells on open.
432
+ catEntry.strDim.levels = undefined;
433
+ // Suppress cache population for this dimension. A flat
434
+ // `<cx:lvl>` of width × height points across the multi-column
435
+ // range would confuse Excel's hierarchical renderer (the
436
+ // chart draws empty). See `hasChartExStringPoints`.
437
+ catEntry.strDim._skipCache = true;
438
+ }
439
+ }
440
+ else {
441
+ // Ranges aren't combinable — fall back to per-level data
442
+ // entries in OUTER→INNER order so at least the schema is
443
+ // valid. (Excel renders blank in this fallback; emit with a
444
+ // console warning in non-production so the author can
445
+ // diagnose why their hierarchical chart is empty.)
446
+ if (typeof process !== "undefined" && process.env?.NODE_ENV !== "production") {
447
+ console.warn("[excelts] Treemap/sunburst hierarchy + categories could not be combined into a " +
448
+ "contiguous multi-column range. Excel will render the chart as an empty plot area. " +
449
+ "Lay your leaf + hierarchy columns contiguously on the same sheet with matching rows.");
450
+ }
451
+ for (let i = hierarchyFormulas.length - 1; i >= 0; i--) {
452
+ const h = hierarchyFormulas[i];
453
+ const hId = counter.value++;
454
+ data.push({
455
+ id: hId,
456
+ strDim: {
457
+ type: "cat",
458
+ formula: h,
459
+ levels: [{ ptCount: 0, points: [] }]
460
+ }
461
+ });
462
+ series.dataRefs.push({ dataId: hId });
463
+ }
464
+ }
465
+ }
466
+ if (so.literalHierarchy) {
467
+ // Literal hierarchy (no worksheet cells to reference) — cache
468
+ // every level's values inside a single strDim's `levels` array
469
+ // so `consolidateDataForRender` can flatten them into one
470
+ // `<cx:strDim>` with multiple `<cx:lvl>` children at render
471
+ // time. This does not match Excel's own "single multi-column
472
+ // <cx:f>" output verbatim but is what the schema allows when
473
+ // there are no real cells to point at.
474
+ for (let i = so.literalHierarchy.length - 1; i >= 0; i--) {
475
+ const level = so.literalHierarchy[i];
476
+ const hId = counter.value++;
477
+ data.push({
478
+ id: hId,
479
+ strDim: {
480
+ type: "cat",
481
+ levels: [
482
+ {
483
+ ptCount: level.length,
484
+ points: level.map((value, index) => ({ index, value }))
485
+ }
486
+ ]
487
+ }
488
+ });
489
+ series.dataRefs.push({ dataId: hId });
490
+ }
491
+ }
492
+ }
493
+ // Values — always create a fresh numDim entry.
494
+ const valId = counter.value++;
495
+ // Microsoft Excel uses `type="val"` for MOST chartEx numeric
496
+ // dimensions (histogram + pareto binning inputs, funnel values,
497
+ // box-whisker samples, waterfall deltas, regionMap values), but
498
+ // **sunburst and treemap use `type="size"`** — the hierarchy rings
499
+ // / tiles are sized by the numeric column, and Excel's loader
500
+ // keys the hierarchical layout engine off this attribute. Reference
501
+ // fixture `tmp/reference-hierarchy.xlsx` (Excel-authored) writes
502
+ // `<cx:numDim type="size">` on both its treemap and sunburst
503
+ // charts; the previous `type="val"` caused Excel to open the
504
+ // chart with an empty plot area (schema-valid but semantically
505
+ // wrong for the hierarchical renderer).
506
+ //
507
+ // Other layouts still use `"val"` — the alternative `"x"` is in
508
+ // `ST_NumDimType` but Excel 2016+ renders the chart as a blank
509
+ // frame when the dimension is labelled `"x"` (verified against
510
+ // an Excel 2021-authored histogram reference, `tmp/aaaaa.xlsx`).
511
+ const numDimType = isHierarchical ? "size" : "val";
512
+ data.push({
513
+ id: valId,
514
+ numDim: {
515
+ type: numDimType,
516
+ formula: so.values,
517
+ levels: so.literalValues?.length
518
+ ? [
519
+ {
520
+ ptCount: so.literalValues.length,
521
+ points: so.literalValues.map((value, index) => ({ index, value }))
522
+ }
523
+ ]
524
+ : [{ ptCount: 0, points: [] }],
525
+ // Hierarchical charts that successfully combined their leaf +
526
+ // hierarchy formulas into a single multi-column `<cx:f>` ship
527
+ // the numeric dimension without a `<cx:lvl>` cache — same
528
+ // rationale as the `_skipCache` marker on the category strDim
529
+ // above. A simple sunburst with no hierarchy, or a combine
530
+ // that failed (non-contiguous columns), still caches normally
531
+ // so the chart at least has something to paint from.
532
+ ...(hierarchyCombined ? { _skipCache: true } : {})
533
+ }
534
+ });
535
+ series.dataRefs.push({ dataId: valId });
536
+ if (hierarchyCombined) {
537
+ // Skipping the cache populator means the placeholder level we seed
538
+ // above never gets replaced with real values. Clear it so the
539
+ // renderer emits just the `<cx:f>` reference, matching Excel's
540
+ // writer output for treemap + sunburst.
541
+ const valEntry = data.find(d => d.id === valId);
542
+ if (valEntry?.numDim && !so.literalValues?.length) {
543
+ valEntry.numDim.levels = undefined;
544
+ }
545
+ }
546
+ // Waterfall subtotals. `subtotalPoints` is an alternative spelling
547
+ // accepted by the public API; we normalise both into the
548
+ // `layoutPr.subtotals` array expected by the renderer. Any additional
549
+ // fields present on `subtotalPoints[]` (beyond `idx`) are currently not
550
+ // preserved because the structured model only carries the index — we
551
+ // surface this limitation clearly rather than letting extra metadata
552
+ // disappear silently.
553
+ //
554
+ // When both `subtotals` and `subtotalPoints` are provided, merge
555
+ // them (deduped by `idx`) rather than silently dropping one.
556
+ // Previously `subtotalPoints` was ignored entirely when `subtotals`
557
+ // was set — users mixing the two forms lost state with no
558
+ // diagnostic.
559
+ const subtotalPoints = so.subtotalPoints;
560
+ const mergedSubtotals = (() => {
561
+ if (so.subtotals && subtotalPoints) {
562
+ const indexSet = new Set([...so.subtotals, ...subtotalPoints.map(p => p.idx)]);
563
+ return Array.from(indexSet).sort((a, b) => a - b);
564
+ }
565
+ return so.subtotals ?? subtotalPoints?.map(p => p.idx);
566
+ })();
567
+ if (layoutId === "waterfall") {
568
+ // Excel emits `<cx:layoutPr><cx:subtotals/></cx:layoutPr>` on
569
+ // EVERY waterfall series, even when the user has not marked any
570
+ // subtotal points. The empty `subtotals` element is treated as
571
+ // a "no subtotals but waterfall-aware" marker; without it Excel
572
+ // falls back to generic series rendering and, at load time,
573
+ // may reject the chartEx as malformed. Seed `layoutPr.subtotals`
574
+ // with an empty array here so the writer always emits the
575
+ // element — then merge in any explicit user-provided subtotal
576
+ // indices on top.
577
+ series.layoutPr = {
578
+ subtotals: mergedSubtotals ? mergedSubtotals.map(i => ({ idx: i })) : []
579
+ };
580
+ }
581
+ if (layoutId === "treemap" || layoutId === "sunburst") {
582
+ // Excel 2016+ will NOT render a sunburst / treemap that lacks a
583
+ // `<cx:layoutPr>` child — the frame is drawn but the plot area
584
+ // shows a completely blank canvas (the hierarchy arcs / tiles
585
+ // are computed but never painted). Verified against
586
+ // `tmp/ttttt.xlsx` (Excel-authored sunburst reference) — every
587
+ // Excel-authored hierarchical chartEx carries at least an empty
588
+ // `<cx:layoutPr/>`, and treemap charts additionally carry a
589
+ // `<cx:parentLabelLayout val="overlapping"/>` (the default) so
590
+ // the engine has something to reach for when deciding how to
591
+ // stack parent labels. Seed a minimal default here so freshly
592
+ // authored sunburst/treemap charts render on open; the caller's
593
+ // `layout.parentLabelLayout` (applied below via `opts.layout`
594
+ // merge) overrides the default when set.
595
+ series.layoutPr = {
596
+ ...(series.layoutPr ?? {}),
597
+ ...(layoutId === "treemap" ? { parentLabelLayout: "overlapping" } : {})
598
+ };
599
+ }
600
+ // Apply chart-level layout options to this series when appropriate.
601
+ // Note: `{ ...a, ...b }` does **not** skip `undefined` values on `b`,
602
+ // which means a user passing `opts.layout = { subtotals: undefined }`
603
+ // would wipe out an earlier `series.layoutPr.subtotals` set from
604
+ // `so.subtotals`. Use `mergeDefined` so only keys with defined values
605
+ // overwrite the base.
606
+ if (opts.layout) {
607
+ series.layoutPr = mergeDefined(series.layoutPr ?? {}, opts.layout);
608
+ }
609
+ if (opts.binning) {
610
+ // Merge user-supplied binning on top of anything the `opts.layout`
611
+ // branch above carried through (e.g. `layout.binning.intervalClosed`).
612
+ // The previous spread-replace (`{ ...existing, binning: opts.binning }`)
613
+ // discarded every field the user didn't re-specify, so
614
+ // `{ layout: { binning: { intervalClosed: "r" } }, binning: { binType: "manual" } }`
615
+ // silently dropped `intervalClosed`.
616
+ series.layoutPr = {
617
+ ...(series.layoutPr ?? {}),
618
+ binning: mergeDefined(series.layoutPr?.binning ?? {}, opts.binning)
619
+ };
620
+ }
621
+ if ((opts.type === "histogram" || opts.type === "pareto") && !series.layoutPr?.binning) {
622
+ // Excel's default `<cx:binning>` for a freshly-inserted
623
+ // histogram carries `intervalClosed="r"` — meaning "right-
624
+ // closed bin boundaries" (bins are `[a, b]`, not `[a, b)`).
625
+ // Emitting the element without the attribute is spec-legal
626
+ // (ST_IntervalClosedSide has a schema default of `"r"`) but
627
+ // Excel 2016+ treats the absence as "auto-compute binning"
628
+ // AND sometimes renders the chart as a blank frame when the
629
+ // binning has no explicit side. Verified against
630
+ // `tmp/aaaaa.xlsx` (Excel-authored histogram reference).
631
+ series.layoutPr = {
632
+ ...(series.layoutPr ?? {}),
633
+ binning: { binType: "auto", intervalClosed: "r" }
634
+ };
635
+ }
636
+ if (opts.type === "pareto") {
637
+ // Only default `paretoLine` to `true` when the caller hasn't
638
+ // explicitly set it. A user passing `layout: { paretoLine: false }`
639
+ // (valid per the validator) was previously overridden here,
640
+ // re-enabling the cumulative-percent line against explicit intent.
641
+ if (series.layoutPr?.paretoLine === undefined) {
642
+ series.layoutPr = {
643
+ ...(series.layoutPr ?? {}),
644
+ paretoLine: true
645
+ };
646
+ }
647
+ }
648
+ // Shape properties. `spPr` takes precedence over the `fill` / `border`
649
+ // hex shortcuts. Both inputs accept either a structured `ShapeProperties`
650
+ // or an `AddShapeFillOptions` bundle (normalised by `toShapeProperties`).
651
+ const normalisedSpPr = (0, chart_builder_1.toShapeProperties)(so.spPr);
652
+ if (normalisedSpPr) {
653
+ series.spPr = normalisedSpPr;
654
+ }
655
+ else if (so.fill || so.border) {
656
+ series.spPr = {};
657
+ if (so.fill) {
658
+ series.spPr.fill = { solid: (0, chart_builder_1.hexToColor)(so.fill) };
659
+ }
660
+ if (so.border) {
661
+ // Default to 9525 EMU (0.75pt) — Excel's default line width
662
+ // for chart series borders. Without an explicit `w`, DrawingML
663
+ // readers treat `<a:ln>` as hairline (effectively invisible
664
+ // on screen, sometimes 1px on print). Users setting `border:
665
+ // "#FF0000"` expect a visible red border, not a transparent
666
+ // colour on an invisible line.
667
+ series.spPr.line = {
668
+ color: (0, chart_builder_1.hexToColor)(so.border),
669
+ width: 9525
670
+ };
671
+ }
672
+ }
673
+ // Data labels
674
+ if (so.dataLabels) {
675
+ const dl = so.dataLabels;
676
+ series.dataLabels = {
677
+ visibility: {
678
+ value: dl.showValue,
679
+ categoryName: dl.showCategory,
680
+ seriesName: dl.showSeriesName,
681
+ // Map the public `showNumFmt` flag onto the internal
682
+ // visibility slot so readers can distinguish "render the
683
+ // number with its format" from "no numeric display at all".
684
+ // Previously the field had no way to be set from the public
685
+ // builder — the internal model exposed it, but the public
686
+ // options dropped it silently.
687
+ numFmt: dl.showNumFmt
688
+ },
689
+ position: dl.position,
690
+ separator: dl.separator,
691
+ numFmt: dl.numFmt,
692
+ // `spPr` / `txPr` route through to the rendered `<cx:spPr>` /
693
+ // `<cx:txPr>` children. Accept both the structured
694
+ // `ShapeProperties` and the ergonomic `AddShapeFillOptions`
695
+ // bundle via `toShapeProperties`, matching the classic
696
+ // `buildDataLabelsFromOpts` helper.
697
+ spPr: (0, chart_builder_1.toShapeProperties)(dl.spPr),
698
+ txPr: dl.txPr
699
+ };
700
+ }
701
+ // Default dataLabels for chartEx types where Excel always emits
702
+ // them. Match Excel's exact defaults so our output is byte-close
703
+ // to what a freshly-inserted chart looks like:
704
+ //
705
+ // <cx:dataLabels pos="outEnd">
706
+ // <cx:visibility seriesName="0" categoryName="0" value="1"/>
707
+ // </cx:dataLabels>
708
+ //
709
+ // Only applied when the caller did NOT supply `so.dataLabels` —
710
+ // user-driven customisation is preserved. The branches cover
711
+ // every 2014+ layout for which Excel emits a default block;
712
+ // sunburst / treemap typically show only the category name, so
713
+ // their defaults differ. (Pareto is handled on the pareto line
714
+ // series via a separate pass.)
715
+ if (!series.dataLabels) {
716
+ if (layoutId === "waterfall" || layoutId === "funnel") {
717
+ series.dataLabels = {
718
+ position: "outEnd",
719
+ visibility: { seriesName: false, categoryName: false, value: true }
720
+ };
721
+ }
722
+ else if (layoutId === "sunburst" || layoutId === "treemap") {
723
+ series.dataLabels = {
724
+ visibility: { seriesName: false, categoryName: true, value: false }
725
+ };
726
+ }
727
+ }
728
+ return series;
729
+ }
730
+ /**
731
+ * Merge `patch` onto `base`, ignoring keys on `patch` whose value is
732
+ * `undefined`. JavaScript's native object spread (`{ ...a, ...b }`) does
733
+ * NOT skip `undefined` values on `b`, so `{ x: 1, ...{ x: undefined } }`
734
+ * produces `{ x: undefined }` — unintuitive and a frequent source of
735
+ * layering bugs. Use this helper whenever merging option objects where
736
+ * "undefined means don't change" is the expected semantics.
737
+ */
738
+ function mergeDefined(base, patch) {
739
+ const result = { ...base };
740
+ for (const [key, value] of Object.entries(patch)) {
741
+ if (value !== undefined) {
742
+ result[key] = value;
743
+ }
744
+ }
745
+ return result;
746
+ }
747
+ /**
748
+ * Shallow element-wise string array equality. Used to verify that
749
+ * `literalCategories` arrays declared on multiple series in the same
750
+ * ChartEx bundle are identical, so the builder can safely hoist them
751
+ * into a single shared category `cx:data` entry.
752
+ */
753
+ function arraysEqual(a, b) {
754
+ if (a === b) {
755
+ return true;
756
+ }
757
+ if (a.length !== b.length) {
758
+ return false;
759
+ }
760
+ for (let i = 0; i < a.length; i++) {
761
+ if (a[i] !== b[i]) {
762
+ return false;
763
+ }
764
+ }
765
+ return true;
766
+ }
767
+ function validateChartExOptions(opts) {
768
+ if (!opts || typeof opts !== "object") {
769
+ throw new errors_1.ChartOptionsError("chartEx options are required.");
770
+ }
771
+ if (!opts.type) {
772
+ throw new errors_1.ChartOptionsError("chartEx.type is required.");
773
+ }
774
+ if (!Array.isArray(opts.series) || opts.series.length === 0) {
775
+ throw new errors_1.ChartOptionsError("chartEx.series must contain at least one series.");
776
+ }
777
+ if (opts.binning && opts.type !== "histogram" && opts.type !== "pareto") {
778
+ throw new errors_1.ChartOptionsError(`chartEx.binning is only valid for histogram and pareto charts, not ${opts.type}.`);
779
+ }
780
+ validateLayoutOptions(opts);
781
+ const binning = opts.binning ?? opts.layout?.binning;
782
+ if (binning) {
783
+ validateBinning(binning);
784
+ }
785
+ opts.series.forEach((series, i) => {
786
+ if (!series.values) {
787
+ throw new errors_1.ChartOptionsError(`chartEx.series[${i}].values is required.`);
788
+ }
789
+ if (series.literalValues?.some(value => !Number.isFinite(value))) {
790
+ throw new errors_1.ChartOptionsError(`chartEx.series[${i}].literalValues must contain only finite numbers.`);
791
+ }
792
+ if (series.literalCategories &&
793
+ series.literalValues &&
794
+ series.literalCategories.length !== series.literalValues.length) {
795
+ throw new errors_1.ChartOptionsError(`chartEx.series[${i}].literalCategories length must match literalValues length.`);
796
+ }
797
+ if (series.hierarchy && opts.type !== "sunburst" && opts.type !== "treemap") {
798
+ throw new errors_1.ChartOptionsError(`chartEx.series[${i}].hierarchy is only valid for sunburst and treemap charts.`);
799
+ }
800
+ if (series.literalHierarchy && opts.type !== "sunburst" && opts.type !== "treemap") {
801
+ throw new errors_1.ChartOptionsError(`chartEx.series[${i}].literalHierarchy is only valid for sunburst and treemap charts.`);
802
+ }
803
+ if (series.literalHierarchy && series.literalValues) {
804
+ for (let level = 0; level < series.literalHierarchy.length; level++) {
805
+ if (series.literalHierarchy[level].length !== series.literalValues.length) {
806
+ throw new errors_1.ChartOptionsError(`chartEx.series[${i}].literalHierarchy[${level}] length must match literalValues length.`);
807
+ }
808
+ }
809
+ }
810
+ if ((series.subtotals || series.subtotalPoints) && opts.type !== "waterfall") {
811
+ throw new errors_1.ChartOptionsError(`chartEx.series[${i}].subtotals is only valid for waterfall charts.`);
812
+ }
813
+ if (series.subtotals?.some(idx => !Number.isInteger(idx) || idx < 0)) {
814
+ throw new errors_1.ChartOptionsError(`chartEx.series[${i}].subtotals must contain non-negative integer indices.`);
815
+ }
816
+ if (series.subtotalPoints?.some(point => !Number.isInteger(point.idx) || point.idx < 0)) {
817
+ throw new errors_1.ChartOptionsError(`chartEx.series[${i}].subtotalPoints must contain non-negative integer indices.`);
818
+ }
819
+ });
820
+ }
821
+ function validateLayoutOptions(opts) {
822
+ const layout = opts.layout;
823
+ if (!layout) {
824
+ return;
825
+ }
826
+ if (layout.binning && opts.type !== "histogram" && opts.type !== "pareto") {
827
+ throw new errors_1.ChartOptionsError(`chartEx.layout.binning is only valid for histogram and pareto charts.`);
828
+ }
829
+ if (layout.subtotals && opts.type !== "waterfall") {
830
+ throw new errors_1.ChartOptionsError(`chartEx.layout.subtotals is only valid for waterfall charts.`);
831
+ }
832
+ const waterfallFields = [
833
+ layout.connectorLines,
834
+ layout.increaseSpPr,
835
+ layout.decreaseSpPr,
836
+ layout.totalSpPr
837
+ ];
838
+ if (waterfallFields.some(value => value !== undefined) && opts.type !== "waterfall") {
839
+ throw new errors_1.ChartOptionsError(`chartEx.layout waterfall fields are only valid for waterfall charts.`);
840
+ }
841
+ const hierarchyLayout = layout.parentLabelLayout !== undefined;
842
+ if (hierarchyLayout && opts.type !== "sunburst" && opts.type !== "treemap") {
843
+ throw new errors_1.ChartOptionsError(`chartEx.layout.parentLabelLayout is only valid for sunburst and treemap charts.`);
844
+ }
845
+ const boxWhiskerFields = [
846
+ layout.quartileMethod,
847
+ layout.showMeanLine,
848
+ layout.showMeanMarker,
849
+ layout.showInnerPoints,
850
+ layout.showOutlierPoints
851
+ ];
852
+ if (boxWhiskerFields.some(value => value !== undefined) && opts.type !== "boxWhisker") {
853
+ throw new errors_1.ChartOptionsError(`chartEx.layout box-whisker fields are only valid for boxWhisker charts.`);
854
+ }
855
+ const regionMapFields = [layout.projection, layout.regionLabels, layout.geoMappingLevel];
856
+ if (regionMapFields.some(value => value !== undefined) && opts.type !== "regionMap") {
857
+ throw new errors_1.ChartOptionsError(`chartEx.layout region-map fields are only valid for regionMap charts.`);
858
+ }
859
+ if (layout.paretoLine !== undefined && opts.type !== "pareto") {
860
+ throw new errors_1.ChartOptionsError(`chartEx.layout.paretoLine is only valid for pareto charts.`);
861
+ }
862
+ }
863
+ function validateBinning(binning) {
864
+ if (binning.binSize !== undefined && binning.binSize <= 0) {
865
+ throw new errors_1.ChartOptionsError("chartEx.binning.binSize must be greater than 0.");
866
+ }
867
+ if (binning.binCount !== undefined &&
868
+ (!Number.isInteger(binning.binCount) || binning.binCount <= 0)) {
869
+ throw new errors_1.ChartOptionsError("chartEx.binning.binCount must be a positive integer.");
870
+ }
871
+ if (binning.underflow !== undefined &&
872
+ binning.overflow !== undefined &&
873
+ binning.underflow >= binning.overflow) {
874
+ throw new errors_1.ChartOptionsError("chartEx.binning.underflow must be less than overflow.");
875
+ }
876
+ }
877
+ function mapChartTypeToLayoutId(type) {
878
+ switch (type) {
879
+ case "sunburst":
880
+ return "sunburst";
881
+ case "treemap":
882
+ return "treemap";
883
+ case "waterfall":
884
+ return "waterfall";
885
+ case "funnel":
886
+ return "funnel";
887
+ case "histogram":
888
+ case "pareto":
889
+ // Histogram and pareto both project onto the same `clusteredColumn`
890
+ // layout — pareto additionally renders a line overlay (flagged via
891
+ // `layoutPr.paretoLine`), histogram supplies the binning metadata.
892
+ return "clusteredColumn";
893
+ case "boxWhisker":
894
+ return "boxWhisker";
895
+ case "regionMap":
896
+ return "regionMap";
897
+ default: {
898
+ const _never = type;
899
+ throw new errors_1.ChartOptionsError(`Unsupported chartEx type: ${String(_never)}.`);
900
+ }
901
+ }
902
+ }
903
+ function needsAxes(type) {
904
+ // Sunburst, treemap, funnel, regionMap don't use traditional axes;
905
+ // histogram/pareto/waterfall/boxWhisker do.
906
+ return type === "histogram" || type === "pareto" || type === "waterfall" || type === "boxWhisker";
907
+ }