@rowsncolumns/toolkit 24.4.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.
Files changed (456) hide show
  1. package/LICENSE.md +100 -0
  2. package/Readme.md +27 -0
  3. package/dist/cjs/autofilter-condition.d.ts +43 -0
  4. package/dist/cjs/autofilter-condition.d.ts.map +1 -0
  5. package/dist/cjs/autofilter-condition.js +155 -0
  6. package/dist/cjs/csv-export.d.ts +49 -0
  7. package/dist/cjs/csv-export.d.ts.map +1 -0
  8. package/dist/cjs/csv-export.js +142 -0
  9. package/dist/cjs/csv-import-worker.d.ts +16 -0
  10. package/dist/cjs/csv-import-worker.d.ts.map +1 -0
  11. package/dist/cjs/csv-import-worker.js +60 -0
  12. package/dist/cjs/csv-import.d.ts +38 -0
  13. package/dist/cjs/csv-import.d.ts.map +1 -0
  14. package/dist/cjs/csv-import.js +166 -0
  15. package/dist/cjs/csv-parser/helpers.d.ts +14 -0
  16. package/dist/cjs/csv-parser/helpers.d.ts.map +1 -0
  17. package/dist/cjs/csv-parser/helpers.js +145 -0
  18. package/dist/cjs/csv-parser/types.d.ts +66 -0
  19. package/dist/cjs/csv-parser/types.d.ts.map +1 -0
  20. package/dist/cjs/csv-parser/types.js +14 -0
  21. package/dist/cjs/csv-parser/worker.d.ts +2 -0
  22. package/dist/cjs/csv-parser/worker.d.ts.map +1 -0
  23. package/dist/cjs/csv-parser/worker.js +200 -0
  24. package/dist/cjs/excel-export.d.ts +11 -0
  25. package/dist/cjs/excel-export.d.ts.map +1 -0
  26. package/dist/cjs/excel-export.js +22 -0
  27. package/dist/cjs/excel-import-session.d.ts +51 -0
  28. package/dist/cjs/excel-import-session.d.ts.map +1 -0
  29. package/dist/cjs/excel-import-session.js +307 -0
  30. package/dist/cjs/excel-import-worker.d.ts +7 -0
  31. package/dist/cjs/excel-import-worker.d.ts.map +1 -0
  32. package/dist/cjs/excel-import-worker.js +119 -0
  33. package/dist/cjs/excel-parser/builtin-numfmts.d.ts +24 -0
  34. package/dist/cjs/excel-parser/builtin-numfmts.d.ts.map +1 -0
  35. package/dist/cjs/excel-parser/builtin-numfmts.js +63 -0
  36. package/dist/cjs/excel-parser/cfb-decryptor.d.ts +53 -0
  37. package/dist/cjs/excel-parser/cfb-decryptor.d.ts.map +1 -0
  38. package/dist/cjs/excel-parser/cfb-decryptor.js +553 -0
  39. package/dist/cjs/excel-parser/cfb-encryptor.d.ts +23 -0
  40. package/dist/cjs/excel-parser/cfb-encryptor.d.ts.map +1 -0
  41. package/dist/cjs/excel-parser/cfb-encryptor.js +200 -0
  42. package/dist/cjs/excel-parser/dv-cell-stamp.d.ts +29 -0
  43. package/dist/cjs/excel-parser/dv-cell-stamp.d.ts.map +1 -0
  44. package/dist/cjs/excel-parser/dv-cell-stamp.js +239 -0
  45. package/dist/cjs/excel-parser/helpers.d.ts +28 -0
  46. package/dist/cjs/excel-parser/helpers.d.ts.map +1 -0
  47. package/dist/cjs/excel-parser/helpers.js +188 -0
  48. package/dist/cjs/excel-parser/interface.d.ts +179 -0
  49. package/dist/cjs/excel-parser/interface.d.ts.map +1 -0
  50. package/dist/cjs/excel-parser/interface.js +1 -0
  51. package/dist/cjs/excel-parser/plugins/base/index.d.ts +31 -0
  52. package/dist/cjs/excel-parser/plugins/base/index.d.ts.map +1 -0
  53. package/dist/cjs/excel-parser/plugins/base/index.js +101 -0
  54. package/dist/cjs/excel-parser/plugins/ods/conditional-formatting.d.ts +16 -0
  55. package/dist/cjs/excel-parser/plugins/ods/conditional-formatting.d.ts.map +1 -0
  56. package/dist/cjs/excel-parser/plugins/ods/conditional-formatting.js +488 -0
  57. package/dist/cjs/excel-parser/plugins/ods/data-validations.d.ts +15 -0
  58. package/dist/cjs/excel-parser/plugins/ods/data-validations.d.ts.map +1 -0
  59. package/dist/cjs/excel-parser/plugins/ods/data-validations.js +353 -0
  60. package/dist/cjs/excel-parser/plugins/ods/formula.d.ts +8 -0
  61. package/dist/cjs/excel-parser/plugins/ods/formula.d.ts.map +1 -0
  62. package/dist/cjs/excel-parser/plugins/ods/formula.js +82 -0
  63. package/dist/cjs/excel-parser/plugins/ods/index.d.ts +122 -0
  64. package/dist/cjs/excel-parser/plugins/ods/index.d.ts.map +1 -0
  65. package/dist/cjs/excel-parser/plugins/ods/index.js +3642 -0
  66. package/dist/cjs/excel-parser/plugins/ods/sparklines.d.ts +25 -0
  67. package/dist/cjs/excel-parser/plugins/ods/sparklines.d.ts.map +1 -0
  68. package/dist/cjs/excel-parser/plugins/ods/sparklines.js +221 -0
  69. package/dist/cjs/excel-parser/plugins/ods/styles.d.ts +60 -0
  70. package/dist/cjs/excel-parser/plugins/ods/styles.d.ts.map +1 -0
  71. package/dist/cjs/excel-parser/plugins/ods/styles.js +808 -0
  72. package/dist/cjs/excel-parser/plugins/ods/types.d.ts +7 -0
  73. package/dist/cjs/excel-parser/plugins/ods/types.d.ts.map +1 -0
  74. package/dist/cjs/excel-parser/plugins/ods/types.js +1 -0
  75. package/dist/cjs/excel-parser/plugins/xls/index.d.ts +5 -0
  76. package/dist/cjs/excel-parser/plugins/xls/index.d.ts.map +1 -0
  77. package/dist/cjs/excel-parser/plugins/xls/index.js +19 -0
  78. package/dist/cjs/excel-parser/plugins/xlsb/biff-record-reader.d.ts +13 -0
  79. package/dist/cjs/excel-parser/plugins/xlsb/biff-record-reader.d.ts.map +1 -0
  80. package/dist/cjs/excel-parser/plugins/xlsb/biff-record-reader.js +49 -0
  81. package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts +117 -0
  82. package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts.map +1 -0
  83. package/dist/cjs/excel-parser/plugins/xlsb/index.js +2972 -0
  84. package/dist/cjs/excel-parser/plugins/xlsb/rgce-parser.d.ts +18 -0
  85. package/dist/cjs/excel-parser/plugins/xlsb/rgce-parser.d.ts.map +1 -0
  86. package/dist/cjs/excel-parser/plugins/xlsb/rgce-parser.js +527 -0
  87. package/dist/cjs/excel-parser/plugins/xlsm/index.d.ts +5 -0
  88. package/dist/cjs/excel-parser/plugins/xlsm/index.d.ts.map +1 -0
  89. package/dist/cjs/excel-parser/plugins/xlsm/index.js +10 -0
  90. package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts +60 -0
  91. package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts.map +1 -0
  92. package/dist/cjs/excel-parser/plugins/xlsx/charts.js +2178 -0
  93. package/dist/cjs/excel-parser/plugins/xlsx/conditional-formatting.d.ts +18 -0
  94. package/dist/cjs/excel-parser/plugins/xlsx/conditional-formatting.d.ts.map +1 -0
  95. package/dist/cjs/excel-parser/plugins/xlsx/conditional-formatting.js +620 -0
  96. package/dist/cjs/excel-parser/plugins/xlsx/data-validations.d.ts +4 -0
  97. package/dist/cjs/excel-parser/plugins/xlsx/data-validations.d.ts.map +1 -0
  98. package/dist/cjs/excel-parser/plugins/xlsx/data-validations.js +515 -0
  99. package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts +39 -0
  100. package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -0
  101. package/dist/cjs/excel-parser/plugins/xlsx/drawing.js +941 -0
  102. package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts +320 -0
  103. package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts.map +1 -0
  104. package/dist/cjs/excel-parser/plugins/xlsx/index.js +6056 -0
  105. package/dist/cjs/excel-parser/plugins/xlsx/numfmt.d.ts +2 -0
  106. package/dist/cjs/excel-parser/plugins/xlsx/numfmt.d.ts.map +1 -0
  107. package/dist/cjs/excel-parser/plugins/xlsx/numfmt.js +3 -0
  108. package/dist/cjs/excel-parser/plugins/xlsx/pivots.d.ts +40 -0
  109. package/dist/cjs/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -0
  110. package/dist/cjs/excel-parser/plugins/xlsx/pivots.js +342 -0
  111. package/dist/cjs/excel-parser/plugins/xlsx/relationships.d.ts +8 -0
  112. package/dist/cjs/excel-parser/plugins/xlsx/relationships.d.ts.map +1 -0
  113. package/dist/cjs/excel-parser/plugins/xlsx/relationships.js +26 -0
  114. package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.d.ts +26 -0
  115. package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.d.ts.map +1 -0
  116. package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.js +59 -0
  117. package/dist/cjs/excel-parser/plugins/xlsx/styles.d.ts +44 -0
  118. package/dist/cjs/excel-parser/plugins/xlsx/styles.d.ts.map +1 -0
  119. package/dist/cjs/excel-parser/plugins/xlsx/styles.js +1377 -0
  120. package/dist/cjs/excel-parser/plugins/xlsx/theme.d.ts +50 -0
  121. package/dist/cjs/excel-parser/plugins/xlsx/theme.d.ts.map +1 -0
  122. package/dist/cjs/excel-parser/plugins/xlsx/theme.js +150 -0
  123. package/dist/cjs/excel-parser/plugins/xlsx/threaded-comments.d.ts +47 -0
  124. package/dist/cjs/excel-parser/plugins/xlsx/threaded-comments.d.ts.map +1 -0
  125. package/dist/cjs/excel-parser/plugins/xlsx/threaded-comments.js +141 -0
  126. package/dist/cjs/excel-parser/plugins/xlsx/value-type-detection.d.ts +44 -0
  127. package/dist/cjs/excel-parser/plugins/xlsx/value-type-detection.d.ts.map +1 -0
  128. package/dist/cjs/excel-parser/plugins/xlsx/value-type-detection.js +407 -0
  129. package/dist/cjs/excel-parser/registry.d.ts +5 -0
  130. package/dist/cjs/excel-parser/registry.d.ts.map +1 -0
  131. package/dist/cjs/excel-parser/registry.js +21 -0
  132. package/dist/cjs/excel-parser/style-registry.d.ts +51 -0
  133. package/dist/cjs/excel-parser/style-registry.d.ts.map +1 -0
  134. package/dist/cjs/excel-parser/style-registry.js +175 -0
  135. package/dist/cjs/excel-parser/theme-default.d.ts +3 -0
  136. package/dist/cjs/excel-parser/theme-default.d.ts.map +1 -0
  137. package/dist/cjs/excel-parser/theme-default.js +19 -0
  138. package/dist/cjs/excel-parser/types.d.ts +365 -0
  139. package/dist/cjs/excel-parser/types.d.ts.map +1 -0
  140. package/dist/cjs/excel-parser/types.js +59 -0
  141. package/dist/cjs/excel-parser/utils.d.ts +6 -0
  142. package/dist/cjs/excel-parser/utils.d.ts.map +1 -0
  143. package/dist/cjs/excel-parser/utils.js +30 -0
  144. package/dist/cjs/excel-parser/workbook.d.ts +51 -0
  145. package/dist/cjs/excel-parser/workbook.d.ts.map +1 -0
  146. package/dist/cjs/excel-parser/workbook.js +317 -0
  147. package/dist/cjs/excel-parser/worker.d.ts +2 -0
  148. package/dist/cjs/excel-parser/worker.d.ts.map +1 -0
  149. package/dist/cjs/excel-parser/worker.js +1149 -0
  150. package/dist/cjs/excel-parser/zip-parser-streaming.d.ts +13 -0
  151. package/dist/cjs/excel-parser/zip-parser-streaming.d.ts.map +1 -0
  152. package/dist/cjs/excel-parser/zip-parser-streaming.js +200 -0
  153. package/dist/cjs/excel-parser/zip-parser.d.ts +11 -0
  154. package/dist/cjs/excel-parser/zip-parser.d.ts.map +1 -0
  155. package/dist/cjs/excel-parser/zip-parser.js +49 -0
  156. package/dist/cjs/exporter/invalid-data-validation.d.ts +19 -0
  157. package/dist/cjs/exporter/invalid-data-validation.d.ts.map +1 -0
  158. package/dist/cjs/exporter/invalid-data-validation.js +39 -0
  159. package/dist/cjs/exporter/ods/ods-export.d.ts +26 -0
  160. package/dist/cjs/exporter/ods/ods-export.d.ts.map +1 -0
  161. package/dist/cjs/exporter/ods/ods-export.js +3714 -0
  162. package/dist/cjs/exporter/ods/sparkline-builder.d.ts +33 -0
  163. package/dist/cjs/exporter/ods/sparkline-builder.d.ts.map +1 -0
  164. package/dist/cjs/exporter/ods/sparkline-builder.js +221 -0
  165. package/dist/cjs/exporter/xlsx/chart-builder.d.ts +3 -0
  166. package/dist/cjs/exporter/xlsx/chart-builder.d.ts.map +1 -0
  167. package/dist/cjs/exporter/xlsx/chart-builder.js +1901 -0
  168. package/dist/cjs/exporter/xlsx/chart-templates.d.ts +1781 -0
  169. package/dist/cjs/exporter/xlsx/chart-templates.d.ts.map +1 -0
  170. package/dist/cjs/exporter/xlsx/chart-templates.js +1798 -0
  171. package/dist/cjs/exporter/xlsx/future-functions.d.ts +10 -0
  172. package/dist/cjs/exporter/xlsx/future-functions.d.ts.map +1 -0
  173. package/dist/cjs/exporter/xlsx/future-functions.js +264 -0
  174. package/dist/cjs/exporter/xlsx/pivot-builder.d.ts +58 -0
  175. package/dist/cjs/exporter/xlsx/pivot-builder.d.ts.map +1 -0
  176. package/dist/cjs/exporter/xlsx/pivot-builder.js +277 -0
  177. package/dist/cjs/exporter/xlsx/power-query-builder.d.ts +26 -0
  178. package/dist/cjs/exporter/xlsx/power-query-builder.d.ts.map +1 -0
  179. package/dist/cjs/exporter/xlsx/power-query-builder.js +306 -0
  180. package/dist/cjs/exporter/xlsx/slicer-builder.d.ts +11 -0
  181. package/dist/cjs/exporter/xlsx/slicer-builder.d.ts.map +1 -0
  182. package/dist/cjs/exporter/xlsx/slicer-builder.js +87 -0
  183. package/dist/cjs/exporter/xlsx/sparkline-builder.d.ts +61 -0
  184. package/dist/cjs/exporter/xlsx/sparkline-builder.d.ts.map +1 -0
  185. package/dist/cjs/exporter/xlsx/sparkline-builder.js +489 -0
  186. package/dist/cjs/exporter/xlsx/style-builder.d.ts +93 -0
  187. package/dist/cjs/exporter/xlsx/style-builder.d.ts.map +1 -0
  188. package/dist/cjs/exporter/xlsx/style-builder.js +813 -0
  189. package/dist/cjs/exporter/xlsx/threaded-comments-builder.d.ts +58 -0
  190. package/dist/cjs/exporter/xlsx/threaded-comments-builder.d.ts.map +1 -0
  191. package/dist/cjs/exporter/xlsx/threaded-comments-builder.js +189 -0
  192. package/dist/cjs/exporter/xlsx/xlsx-export.d.ts +121 -0
  193. package/dist/cjs/exporter/xlsx/xlsx-export.d.ts.map +1 -0
  194. package/dist/cjs/exporter/xlsx/xlsx-export.js +4596 -0
  195. package/dist/cjs/helpers/theme-xml-generator.d.ts +8 -0
  196. package/dist/cjs/helpers/theme-xml-generator.d.ts.map +1 -0
  197. package/dist/cjs/helpers/theme-xml-generator.js +33 -0
  198. package/dist/cjs/helpers.d.ts +34 -0
  199. package/dist/cjs/helpers.d.ts.map +1 -0
  200. package/dist/cjs/helpers.js +189 -0
  201. package/dist/cjs/index.d.ts +16 -0
  202. package/dist/cjs/index.d.ts.map +1 -0
  203. package/dist/cjs/index.js +15 -0
  204. package/dist/cjs/indexed-colors.d.ts +2 -0
  205. package/dist/cjs/indexed-colors.d.ts.map +1 -0
  206. package/dist/cjs/indexed-colors.js +75 -0
  207. package/dist/cjs/ods-export.d.ts +24 -0
  208. package/dist/cjs/ods-export.d.ts.map +1 -0
  209. package/dist/cjs/ods-export.js +23 -0
  210. package/dist/cjs/parse.d.ts +24 -0
  211. package/dist/cjs/parse.d.ts.map +1 -0
  212. package/dist/cjs/parse.js +68 -0
  213. package/dist/cjs/power-query.d.ts +41 -0
  214. package/dist/cjs/power-query.d.ts.map +1 -0
  215. package/dist/cjs/power-query.js +22 -0
  216. package/dist/cjs/server.d.ts +9 -0
  217. package/dist/cjs/server.d.ts.map +1 -0
  218. package/dist/cjs/server.js +8 -0
  219. package/dist/cjs/theme1.d.ts +3 -0
  220. package/dist/cjs/theme1.d.ts.map +1 -0
  221. package/dist/cjs/theme1.js +2 -0
  222. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -0
  223. package/dist/cjs/types.d.ts +14 -0
  224. package/dist/cjs/types.d.ts.map +1 -0
  225. package/dist/cjs/types.js +14 -0
  226. package/dist/cjs/vitest.config.d.ts +3 -0
  227. package/dist/cjs/vitest.config.d.ts.map +1 -0
  228. package/dist/cjs/vitest.config.js +16 -0
  229. package/dist/esm/autofilter-condition.d.ts +43 -0
  230. package/dist/esm/autofilter-condition.d.ts.map +1 -0
  231. package/dist/esm/autofilter-condition.js +145 -0
  232. package/dist/esm/csv-export.d.ts +49 -0
  233. package/dist/esm/csv-export.d.ts.map +1 -0
  234. package/dist/esm/csv-export.js +126 -0
  235. package/dist/esm/csv-import-worker.d.ts +16 -0
  236. package/dist/esm/csv-import-worker.d.ts.map +1 -0
  237. package/dist/esm/csv-import-worker.js +60 -0
  238. package/dist/esm/csv-import.d.ts +38 -0
  239. package/dist/esm/csv-import.d.ts.map +1 -0
  240. package/dist/esm/csv-import.js +132 -0
  241. package/dist/esm/csv-parser/helpers.d.ts +14 -0
  242. package/dist/esm/csv-parser/helpers.d.ts.map +1 -0
  243. package/dist/esm/csv-parser/helpers.js +0 -0
  244. package/dist/esm/csv-parser/types.d.ts +66 -0
  245. package/dist/esm/csv-parser/types.d.ts.map +1 -0
  246. package/dist/esm/csv-parser/types.js +14 -0
  247. package/dist/esm/csv-parser/worker.d.ts +2 -0
  248. package/dist/esm/csv-parser/worker.d.ts.map +1 -0
  249. package/dist/esm/csv-parser/worker.js +154 -0
  250. package/dist/esm/excel-export.d.ts +11 -0
  251. package/dist/esm/excel-export.d.ts.map +1 -0
  252. package/dist/esm/excel-export.js +13 -0
  253. package/dist/esm/excel-import-session.d.ts +51 -0
  254. package/dist/esm/excel-import-session.d.ts.map +1 -0
  255. package/dist/esm/excel-import-session.js +255 -0
  256. package/dist/esm/excel-import-worker.d.ts +7 -0
  257. package/dist/esm/excel-import-worker.d.ts.map +1 -0
  258. package/dist/esm/excel-import-worker.js +116 -0
  259. package/dist/esm/excel-parser/builtin-numfmts.d.ts +24 -0
  260. package/dist/esm/excel-parser/builtin-numfmts.d.ts.map +1 -0
  261. package/dist/esm/excel-parser/builtin-numfmts.js +59 -0
  262. package/dist/esm/excel-parser/cfb-decryptor.d.ts +53 -0
  263. package/dist/esm/excel-parser/cfb-decryptor.d.ts.map +1 -0
  264. package/dist/esm/excel-parser/cfb-decryptor.js +493 -0
  265. package/dist/esm/excel-parser/cfb-encryptor.d.ts +23 -0
  266. package/dist/esm/excel-parser/cfb-encryptor.d.ts.map +1 -0
  267. package/dist/esm/excel-parser/cfb-encryptor.js +181 -0
  268. package/dist/esm/excel-parser/dv-cell-stamp.d.ts +29 -0
  269. package/dist/esm/excel-parser/dv-cell-stamp.d.ts.map +1 -0
  270. package/dist/esm/excel-parser/dv-cell-stamp.js +155 -0
  271. package/dist/esm/excel-parser/helpers.d.ts +28 -0
  272. package/dist/esm/excel-parser/helpers.d.ts.map +1 -0
  273. package/dist/esm/excel-parser/helpers.js +160 -0
  274. package/dist/esm/excel-parser/interface.d.ts +179 -0
  275. package/dist/esm/excel-parser/interface.d.ts.map +1 -0
  276. package/dist/esm/excel-parser/interface.js +1 -0
  277. package/dist/esm/excel-parser/plugins/base/index.d.ts +31 -0
  278. package/dist/esm/excel-parser/plugins/base/index.d.ts.map +1 -0
  279. package/dist/esm/excel-parser/plugins/base/index.js +64 -0
  280. package/dist/esm/excel-parser/plugins/ods/conditional-formatting.d.ts +16 -0
  281. package/dist/esm/excel-parser/plugins/ods/conditional-formatting.d.ts.map +1 -0
  282. package/dist/esm/excel-parser/plugins/ods/conditional-formatting.js +405 -0
  283. package/dist/esm/excel-parser/plugins/ods/data-validations.d.ts +15 -0
  284. package/dist/esm/excel-parser/plugins/ods/data-validations.d.ts.map +1 -0
  285. package/dist/esm/excel-parser/plugins/ods/data-validations.js +331 -0
  286. package/dist/esm/excel-parser/plugins/ods/formula.d.ts +8 -0
  287. package/dist/esm/excel-parser/plugins/ods/formula.d.ts.map +1 -0
  288. package/dist/esm/excel-parser/plugins/ods/formula.js +82 -0
  289. package/dist/esm/excel-parser/plugins/ods/index.d.ts +122 -0
  290. package/dist/esm/excel-parser/plugins/ods/index.d.ts.map +1 -0
  291. package/dist/esm/excel-parser/plugins/ods/index.js +2896 -0
  292. package/dist/esm/excel-parser/plugins/ods/sparklines.d.ts +25 -0
  293. package/dist/esm/excel-parser/plugins/ods/sparklines.d.ts.map +1 -0
  294. package/dist/esm/excel-parser/plugins/ods/sparklines.js +188 -0
  295. package/dist/esm/excel-parser/plugins/ods/styles.d.ts +60 -0
  296. package/dist/esm/excel-parser/plugins/ods/styles.d.ts.map +1 -0
  297. package/dist/esm/excel-parser/plugins/ods/styles.js +732 -0
  298. package/dist/esm/excel-parser/plugins/ods/types.d.ts +7 -0
  299. package/dist/esm/excel-parser/plugins/ods/types.d.ts.map +1 -0
  300. package/dist/esm/excel-parser/plugins/ods/types.js +1 -0
  301. package/dist/esm/excel-parser/plugins/xls/index.d.ts +5 -0
  302. package/dist/esm/excel-parser/plugins/xls/index.d.ts.map +1 -0
  303. package/dist/esm/excel-parser/plugins/xls/index.js +7 -0
  304. package/dist/esm/excel-parser/plugins/xlsb/biff-record-reader.d.ts +13 -0
  305. package/dist/esm/excel-parser/plugins/xlsb/biff-record-reader.d.ts.map +1 -0
  306. package/dist/esm/excel-parser/plugins/xlsb/biff-record-reader.js +48 -0
  307. package/dist/esm/excel-parser/plugins/xlsb/index.d.ts +117 -0
  308. package/dist/esm/excel-parser/plugins/xlsb/index.d.ts.map +1 -0
  309. package/dist/esm/excel-parser/plugins/xlsb/index.js +2339 -0
  310. package/dist/esm/excel-parser/plugins/xlsb/rgce-parser.d.ts +18 -0
  311. package/dist/esm/excel-parser/plugins/xlsb/rgce-parser.d.ts.map +1 -0
  312. package/dist/esm/excel-parser/plugins/xlsb/rgce-parser.js +522 -0
  313. package/dist/esm/excel-parser/plugins/xlsm/index.d.ts +5 -0
  314. package/dist/esm/excel-parser/plugins/xlsm/index.d.ts.map +1 -0
  315. package/dist/esm/excel-parser/plugins/xlsm/index.js +6 -0
  316. package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts +60 -0
  317. package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts.map +1 -0
  318. package/dist/esm/excel-parser/plugins/xlsx/charts.js +2036 -0
  319. package/dist/esm/excel-parser/plugins/xlsx/conditional-formatting.d.ts +18 -0
  320. package/dist/esm/excel-parser/plugins/xlsx/conditional-formatting.d.ts.map +1 -0
  321. package/dist/esm/excel-parser/plugins/xlsx/conditional-formatting.js +621 -0
  322. package/dist/esm/excel-parser/plugins/xlsx/data-validations.d.ts +4 -0
  323. package/dist/esm/excel-parser/plugins/xlsx/data-validations.d.ts.map +1 -0
  324. package/dist/esm/excel-parser/plugins/xlsx/data-validations.js +493 -0
  325. package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts +39 -0
  326. package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -0
  327. package/dist/esm/excel-parser/plugins/xlsx/drawing.js +905 -0
  328. package/dist/esm/excel-parser/plugins/xlsx/index.d.ts +320 -0
  329. package/dist/esm/excel-parser/plugins/xlsx/index.d.ts.map +1 -0
  330. package/dist/esm/excel-parser/plugins/xlsx/index.js +4654 -0
  331. package/dist/esm/excel-parser/plugins/xlsx/numfmt.d.ts +2 -0
  332. package/dist/esm/excel-parser/plugins/xlsx/numfmt.d.ts.map +1 -0
  333. package/dist/esm/excel-parser/plugins/xlsx/numfmt.js +3 -0
  334. package/dist/esm/excel-parser/plugins/xlsx/pivots.d.ts +40 -0
  335. package/dist/esm/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -0
  336. package/dist/esm/excel-parser/plugins/xlsx/pivots.js +254 -0
  337. package/dist/esm/excel-parser/plugins/xlsx/relationships.d.ts +8 -0
  338. package/dist/esm/excel-parser/plugins/xlsx/relationships.d.ts.map +1 -0
  339. package/dist/esm/excel-parser/plugins/xlsx/relationships.js +13 -0
  340. package/dist/esm/excel-parser/plugins/xlsx/sheet-views.d.ts +26 -0
  341. package/dist/esm/excel-parser/plugins/xlsx/sheet-views.d.ts.map +1 -0
  342. package/dist/esm/excel-parser/plugins/xlsx/sheet-views.js +64 -0
  343. package/dist/esm/excel-parser/plugins/xlsx/styles.d.ts +44 -0
  344. package/dist/esm/excel-parser/plugins/xlsx/styles.d.ts.map +1 -0
  345. package/dist/esm/excel-parser/plugins/xlsx/styles.js +1365 -0
  346. package/dist/esm/excel-parser/plugins/xlsx/theme.d.ts +50 -0
  347. package/dist/esm/excel-parser/plugins/xlsx/theme.d.ts.map +1 -0
  348. package/dist/esm/excel-parser/plugins/xlsx/theme.js +127 -0
  349. package/dist/esm/excel-parser/plugins/xlsx/threaded-comments.d.ts +47 -0
  350. package/dist/esm/excel-parser/plugins/xlsx/threaded-comments.d.ts.map +1 -0
  351. package/dist/esm/excel-parser/plugins/xlsx/threaded-comments.js +103 -0
  352. package/dist/esm/excel-parser/plugins/xlsx/value-type-detection.d.ts +44 -0
  353. package/dist/esm/excel-parser/plugins/xlsx/value-type-detection.d.ts.map +1 -0
  354. package/dist/esm/excel-parser/plugins/xlsx/value-type-detection.js +399 -0
  355. package/dist/esm/excel-parser/registry.d.ts +5 -0
  356. package/dist/esm/excel-parser/registry.d.ts.map +1 -0
  357. package/dist/esm/excel-parser/registry.js +20 -0
  358. package/dist/esm/excel-parser/style-registry.d.ts +51 -0
  359. package/dist/esm/excel-parser/style-registry.d.ts.map +1 -0
  360. package/dist/esm/excel-parser/style-registry.js +163 -0
  361. package/dist/esm/excel-parser/theme-default.d.ts +3 -0
  362. package/dist/esm/excel-parser/theme-default.d.ts.map +1 -0
  363. package/dist/esm/excel-parser/theme-default.js +19 -0
  364. package/dist/esm/excel-parser/types.d.ts +365 -0
  365. package/dist/esm/excel-parser/types.d.ts.map +1 -0
  366. package/dist/esm/excel-parser/types.js +59 -0
  367. package/dist/esm/excel-parser/utils.d.ts +6 -0
  368. package/dist/esm/excel-parser/utils.d.ts.map +1 -0
  369. package/dist/esm/excel-parser/utils.js +25 -0
  370. package/dist/esm/excel-parser/workbook.d.ts +51 -0
  371. package/dist/esm/excel-parser/workbook.d.ts.map +1 -0
  372. package/dist/esm/excel-parser/workbook.js +192 -0
  373. package/dist/esm/excel-parser/worker.d.ts +2 -0
  374. package/dist/esm/excel-parser/worker.d.ts.map +1 -0
  375. package/dist/esm/excel-parser/worker.js +862 -0
  376. package/dist/esm/excel-parser/zip-parser-streaming.d.ts +13 -0
  377. package/dist/esm/excel-parser/zip-parser-streaming.d.ts.map +1 -0
  378. package/dist/esm/excel-parser/zip-parser-streaming.js +119 -0
  379. package/dist/esm/excel-parser/zip-parser.d.ts +11 -0
  380. package/dist/esm/excel-parser/zip-parser.d.ts.map +1 -0
  381. package/dist/esm/excel-parser/zip-parser.js +43 -0
  382. package/dist/esm/exporter/invalid-data-validation.d.ts +19 -0
  383. package/dist/esm/exporter/invalid-data-validation.d.ts.map +1 -0
  384. package/dist/esm/exporter/invalid-data-validation.js +37 -0
  385. package/dist/esm/exporter/ods/ods-export.d.ts +26 -0
  386. package/dist/esm/exporter/ods/ods-export.d.ts.map +1 -0
  387. package/dist/esm/exporter/ods/ods-export.js +3238 -0
  388. package/dist/esm/exporter/ods/sparkline-builder.d.ts +33 -0
  389. package/dist/esm/exporter/ods/sparkline-builder.d.ts.map +1 -0
  390. package/dist/esm/exporter/ods/sparkline-builder.js +165 -0
  391. package/dist/esm/exporter/xlsx/chart-builder.d.ts +3 -0
  392. package/dist/esm/exporter/xlsx/chart-builder.d.ts.map +1 -0
  393. package/dist/esm/exporter/xlsx/chart-builder.js +1805 -0
  394. package/dist/esm/exporter/xlsx/chart-templates.d.ts +1781 -0
  395. package/dist/esm/exporter/xlsx/chart-templates.d.ts.map +1 -0
  396. package/dist/esm/exporter/xlsx/chart-templates.js +1798 -0
  397. package/dist/esm/exporter/xlsx/future-functions.d.ts +10 -0
  398. package/dist/esm/exporter/xlsx/future-functions.d.ts.map +1 -0
  399. package/dist/esm/exporter/xlsx/future-functions.js +264 -0
  400. package/dist/esm/exporter/xlsx/pivot-builder.d.ts +58 -0
  401. package/dist/esm/exporter/xlsx/pivot-builder.d.ts.map +1 -0
  402. package/dist/esm/exporter/xlsx/pivot-builder.js +230 -0
  403. package/dist/esm/exporter/xlsx/power-query-builder.d.ts +26 -0
  404. package/dist/esm/exporter/xlsx/power-query-builder.d.ts.map +1 -0
  405. package/dist/esm/exporter/xlsx/power-query-builder.js +257 -0
  406. package/dist/esm/exporter/xlsx/slicer-builder.d.ts +11 -0
  407. package/dist/esm/exporter/xlsx/slicer-builder.d.ts.map +1 -0
  408. package/dist/esm/exporter/xlsx/slicer-builder.js +84 -0
  409. package/dist/esm/exporter/xlsx/sparkline-builder.d.ts +61 -0
  410. package/dist/esm/exporter/xlsx/sparkline-builder.d.ts.map +1 -0
  411. package/dist/esm/exporter/xlsx/sparkline-builder.js +437 -0
  412. package/dist/esm/exporter/xlsx/style-builder.d.ts +93 -0
  413. package/dist/esm/exporter/xlsx/style-builder.d.ts.map +1 -0
  414. package/dist/esm/exporter/xlsx/style-builder.js +795 -0
  415. package/dist/esm/exporter/xlsx/threaded-comments-builder.d.ts +58 -0
  416. package/dist/esm/exporter/xlsx/threaded-comments-builder.d.ts.map +1 -0
  417. package/dist/esm/exporter/xlsx/threaded-comments-builder.js +175 -0
  418. package/dist/esm/exporter/xlsx/xlsx-export.d.ts +121 -0
  419. package/dist/esm/exporter/xlsx/xlsx-export.d.ts.map +1 -0
  420. package/dist/esm/exporter/xlsx/xlsx-export.js +4062 -0
  421. package/dist/esm/helpers/theme-xml-generator.d.ts +8 -0
  422. package/dist/esm/helpers/theme-xml-generator.d.ts.map +1 -0
  423. package/dist/esm/helpers/theme-xml-generator.js +33 -0
  424. package/dist/esm/helpers.d.ts +34 -0
  425. package/dist/esm/helpers.d.ts.map +1 -0
  426. package/dist/esm/helpers.js +182 -0
  427. package/dist/esm/index.d.ts +16 -0
  428. package/dist/esm/index.d.ts.map +1 -0
  429. package/dist/esm/index.js +15 -0
  430. package/dist/esm/indexed-colors.d.ts +2 -0
  431. package/dist/esm/indexed-colors.d.ts.map +1 -0
  432. package/dist/esm/indexed-colors.js +75 -0
  433. package/dist/esm/ods-export.d.ts +24 -0
  434. package/dist/esm/ods-export.d.ts.map +1 -0
  435. package/dist/esm/ods-export.js +12 -0
  436. package/dist/esm/parse.d.ts +24 -0
  437. package/dist/esm/parse.d.ts.map +1 -0
  438. package/dist/esm/parse.js +55 -0
  439. package/dist/esm/power-query.d.ts +41 -0
  440. package/dist/esm/power-query.d.ts.map +1 -0
  441. package/dist/esm/power-query.js +19 -0
  442. package/dist/esm/server.d.ts +9 -0
  443. package/dist/esm/server.d.ts.map +1 -0
  444. package/dist/esm/server.js +8 -0
  445. package/dist/esm/theme1.d.ts +3 -0
  446. package/dist/esm/theme1.d.ts.map +1 -0
  447. package/dist/esm/theme1.js +2 -0
  448. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
  449. package/dist/esm/types.d.ts +14 -0
  450. package/dist/esm/types.d.ts.map +1 -0
  451. package/dist/esm/types.js +14 -0
  452. package/dist/esm/vitest.config.d.ts +3 -0
  453. package/dist/esm/vitest.config.d.ts.map +1 -0
  454. package/dist/esm/vitest.config.js +16 -0
  455. package/package.json +62 -0
  456. package/xlsx.d.ts +52 -0
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Strip the `_xlfn.` / `_xlws.` / `_xludf.` prefixes and re-add the correct
3
+ * one to every future-function call in `formula`. Quoted spans are copied
4
+ * verbatim so string literals (`"…"`) and quoted sheet names (`'…'`) keep
5
+ * their original text; a doubled quote inside a span is an escaped quote.
6
+ * Because the strip pass runs first, already-qualified input comes out
7
+ * qualified exactly once.
8
+ */
9
+ export declare function qualifyFutureFunctions(formula: string): string;
10
+ //# sourceMappingURL=future-functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"future-functions.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/future-functions.ts"],"names":[],"mappings":"AAkPA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA6B9D"}
@@ -0,0 +1,264 @@
1
+ import { __read, __spreadArray } from "tslib";
2
+ /**
3
+ * Excel "future functions" — functions added after the Excel 2007 (.xlsx)
4
+ * file format was frozen. [MS-XLSX] requires them to be written into sheet
5
+ * XML behind a `_xlfn.` namespace prefix (`_xlfn._xlws.` for the
6
+ * worksheet-scoped dynamic-array functions); the UI never shows the prefix.
7
+ * Written bare, Excel does not resolve the name: it renders the call behind
8
+ * the implicit-intersection operator (`=@DAYS(...)`) and evaluates `#NAME?`.
9
+ *
10
+ * The list follows Microsoft's documentation of `_xlfn.`-prefixed functions
11
+ * ("Issue: An _xlfn. prefix is displayed in front of a function in a
12
+ * formula", support.microsoft.com) plus the dynamic-array / LAMBDA-era and
13
+ * 2024 additions that ship with the same prefix convention.
14
+ */
15
+ var FUTURE_FUNCTION_NAMES = [
16
+ "ACOT",
17
+ "ACOTH",
18
+ "AGGREGATE",
19
+ "ANCHORARRAY",
20
+ "ARABIC",
21
+ "ARRAYTOTEXT",
22
+ "BASE",
23
+ "BETA.DIST",
24
+ "BETA.INV",
25
+ "BINOM.DIST",
26
+ "BINOM.DIST.RANGE",
27
+ "BINOM.INV",
28
+ "BITAND",
29
+ "BITLSHIFT",
30
+ "BITOR",
31
+ "BITRSHIFT",
32
+ "BITXOR",
33
+ "BYCOL",
34
+ "BYROW",
35
+ "CEILING.MATH",
36
+ "CEILING.PRECISE",
37
+ "CHISQ.DIST",
38
+ "CHISQ.DIST.RT",
39
+ "CHISQ.INV",
40
+ "CHISQ.INV.RT",
41
+ "CHISQ.TEST",
42
+ "CHOOSECOLS",
43
+ "CHOOSEROWS",
44
+ "COMBINA",
45
+ "CONCAT",
46
+ "CONFIDENCE.NORM",
47
+ "CONFIDENCE.T",
48
+ "COT",
49
+ "COTH",
50
+ "COVARIANCE.P",
51
+ "COVARIANCE.S",
52
+ "CSC",
53
+ "CSCH",
54
+ "DAYS",
55
+ "DECIMAL",
56
+ "DETECTLANGUAGE",
57
+ "DROP",
58
+ "ENCODEURL",
59
+ "ERF.PRECISE",
60
+ "ERFC.PRECISE",
61
+ "EXPAND",
62
+ "EXPON.DIST",
63
+ "F.DIST",
64
+ "F.DIST.RT",
65
+ "F.INV",
66
+ "F.INV.RT",
67
+ "F.TEST",
68
+ "FIELDVALUE",
69
+ "FILTER",
70
+ "FILTERXML",
71
+ "FLOOR.MATH",
72
+ "FLOOR.PRECISE",
73
+ "FORECAST.ETS",
74
+ "FORECAST.ETS.CONFINT",
75
+ "FORECAST.ETS.SEASONALITY",
76
+ "FORECAST.ETS.STAT",
77
+ "FORECAST.LINEAR",
78
+ "FORMULATEXT",
79
+ "GAMMA",
80
+ "GAMMA.DIST",
81
+ "GAMMA.INV",
82
+ "GAMMALN.PRECISE",
83
+ "GAUSS",
84
+ "GROUPBY",
85
+ "HSTACK",
86
+ "HYPGEOM.DIST",
87
+ "IFNA",
88
+ "IFS",
89
+ "IMAGE",
90
+ "IMCOSH",
91
+ "IMCOT",
92
+ "IMCSC",
93
+ "IMCSCH",
94
+ "IMSEC",
95
+ "IMSECH",
96
+ "IMSINH",
97
+ "IMTAN",
98
+ "ISFORMULA",
99
+ "ISOMITTED",
100
+ "ISOWEEKNUM",
101
+ "LAMBDA",
102
+ "LET",
103
+ "LOGNORM.DIST",
104
+ "LOGNORM.INV",
105
+ "MAKEARRAY",
106
+ "MAP",
107
+ "MAXIFS",
108
+ "MINIFS",
109
+ "MODE.MULT",
110
+ "MODE.SNGL",
111
+ "MUNIT",
112
+ "NEGBINOM.DIST",
113
+ "NETWORKDAYS.INTL",
114
+ "NORM.DIST",
115
+ "NORM.INV",
116
+ "NORM.S.DIST",
117
+ "NORM.S.INV",
118
+ "NUMBERVALUE",
119
+ "PDURATION",
120
+ "PERCENTILE.EXC",
121
+ "PERCENTILE.INC",
122
+ "PERCENTOF",
123
+ "PERCENTRANK.EXC",
124
+ "PERCENTRANK.INC",
125
+ "PERMUTATIONA",
126
+ "PHI",
127
+ "PIVOTBY",
128
+ "POISSON.DIST",
129
+ "QUARTILE.EXC",
130
+ "QUARTILE.INC",
131
+ "QUERYSTRING",
132
+ "RANDARRAY",
133
+ "RANK.AVG",
134
+ "RANK.EQ",
135
+ "REDUCE",
136
+ "REGEXEXTRACT",
137
+ "REGEXREPLACE",
138
+ "REGEXTEST",
139
+ "RRI",
140
+ "SCAN",
141
+ "SEC",
142
+ "SECH",
143
+ "SEQUENCE",
144
+ "SHEET",
145
+ "SHEETS",
146
+ "SINGLE",
147
+ "SKEW.P",
148
+ "SORT",
149
+ "SORTBY",
150
+ "STDEV.P",
151
+ "STDEV.S",
152
+ "STOCKHISTORY",
153
+ "SWITCH",
154
+ "T.DIST",
155
+ "T.DIST.2T",
156
+ "T.DIST.RT",
157
+ "T.INV",
158
+ "T.INV.2T",
159
+ "T.TEST",
160
+ "TAKE",
161
+ "TEXTAFTER",
162
+ "TEXTBEFORE",
163
+ "TEXTJOIN",
164
+ "TEXTSPLIT",
165
+ "TOCOL",
166
+ "TOROW",
167
+ "TRANSLATE",
168
+ "TRIMRANGE",
169
+ "UNICHAR",
170
+ "UNICODE",
171
+ "UNIQUE",
172
+ "VALUETOTEXT",
173
+ "VAR.P",
174
+ "VAR.S",
175
+ "VSTACK",
176
+ "WEBSERVICE",
177
+ "WEIBULL.DIST",
178
+ "WORKDAY.INTL",
179
+ "WRAPCOLS",
180
+ "WRAPROWS",
181
+ "XLOOKUP",
182
+ "XMATCH",
183
+ "XOR",
184
+ "Z.TEST",
185
+ ];
186
+ /**
187
+ * Future functions that Excel writes behind the worksheet-scope prefix
188
+ * (`_xlfn._xlws.`) rather than plain `_xlfn.` — the dynamic-array functions
189
+ * that also exist as worksheet-only names.
190
+ */
191
+ var WORKSHEET_SCOPED_FUTURE_FUNCTIONS = new Set([
192
+ "FILTER",
193
+ "SORT",
194
+ ]);
195
+ var QUALIFIED_BY_NAME = new Map(FUTURE_FUNCTION_NAMES.map(function (name) { return [
196
+ name,
197
+ WORKSHEET_SCOPED_FUTURE_FUNCTIONS.has(name)
198
+ ? "_xlfn._xlws.".concat(name)
199
+ : "_xlfn.".concat(name),
200
+ ]; }));
201
+ // Longest names first so `T.DIST.2T` wins over `T.DIST`. The match must be
202
+ // followed by `(` — a bare name (e.g. the defined name `DAYS`) is not a call.
203
+ var FUTURE_FUNCTION_REGEX = new RegExp("(" +
204
+ __spreadArray([], __read(FUTURE_FUNCTION_NAMES), false).sort(function (a, b) { return b.length - a.length; })
205
+ .map(function (name) { return name.replace(/\./g, "\\."); })
206
+ .join("|") +
207
+ ")(\\s*\\()", "gi");
208
+ // `\b` is not enough of a left boundary: it would match the `DAYS` in
209
+ // `_xlfn.DAYS` and in `MYDAYS`. The preceding character is checked by offset
210
+ // instead of being consumed by the pattern, so nested calls
211
+ // (`SORT(FILTER(...))`) still match after the enclosing one.
212
+ var FUTURE_FUNCTION_LEFT_BOUNDARY = /[A-Za-z0-9_.$]/;
213
+ function qualifySegment(segment) {
214
+ var stripped = segment
215
+ .replace(/_xlfn\./gi, "")
216
+ .replace(/_xlws\./gi, "")
217
+ .replace(/_xludf\./gi, "");
218
+ return stripped.replace(FUTURE_FUNCTION_REGEX, function (match, name, open, offset) {
219
+ if (offset > 0 &&
220
+ FUTURE_FUNCTION_LEFT_BOUNDARY.test(stripped[offset - 1])) {
221
+ return match;
222
+ }
223
+ var qualified = QUALIFIED_BY_NAME.get(name.toUpperCase());
224
+ return qualified ? qualified + open : match;
225
+ });
226
+ }
227
+ /**
228
+ * Strip the `_xlfn.` / `_xlws.` / `_xludf.` prefixes and re-add the correct
229
+ * one to every future-function call in `formula`. Quoted spans are copied
230
+ * verbatim so string literals (`"…"`) and quoted sheet names (`'…'`) keep
231
+ * their original text; a doubled quote inside a span is an escaped quote.
232
+ * Because the strip pass runs first, already-qualified input comes out
233
+ * qualified exactly once.
234
+ */
235
+ export function qualifyFutureFunctions(formula) {
236
+ var result = "";
237
+ var segmentStart = 0;
238
+ var index = 0;
239
+ while (index < formula.length) {
240
+ var char = formula[index];
241
+ if (char !== '"' && char !== "'") {
242
+ index++;
243
+ continue;
244
+ }
245
+ result += qualifySegment(formula.slice(segmentStart, index));
246
+ var end = index + 1;
247
+ while (end < formula.length) {
248
+ if (formula[end] === char) {
249
+ if (formula[end + 1] === char) {
250
+ end += 2;
251
+ continue;
252
+ }
253
+ break;
254
+ }
255
+ end++;
256
+ }
257
+ // An unterminated literal consumes the rest of the formula.
258
+ var literalEnd = end < formula.length ? end + 1 : formula.length;
259
+ result += formula.slice(index, literalEnd);
260
+ index = literalEnd;
261
+ segmentStart = literalEnd;
262
+ }
263
+ return result + qualifySegment(formula.slice(segmentStart));
264
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * XLSX pivot table XML builders — Phase D2.
3
+ *
4
+ * Emits two XML families:
5
+ * 1. xl/pivotTables/pivotTable<N>.xml — layout
6
+ * 2. xl/pivotCache/pivotCacheDefinition<N>.xml — field definitions
7
+ *
8
+ * `xl/pivotCache/pivotCacheRecords<N>.xml` is intentionally omitted.
9
+ * We set `refreshOnLoad="1"` so Excel recomputes the cache from the
10
+ * live source range on open — avoids the "cache stale vs. source"
11
+ * desync that records would cause.
12
+ *
13
+ * INTEGRATION POINTS (need wiring in xlsx-export.ts):
14
+ * - Add `pivotTables: PivotTable[]` to ExportExcelProps
15
+ * - Group pivots by sheetId, similar to charts/slicers
16
+ * - For each pivot:
17
+ * • Generate pivotTable XML + pivotCacheDefinition XML
18
+ * • Add to zip at xl/pivotTables/pivotTable<N>.xml + xl/pivotCache/pivotCacheDefinition<N>.xml
19
+ * • Add pivotTable → pivotCacheDefinition relationship file
20
+ * • Add worksheet → pivotTable relationship
21
+ * • Add workbook → pivotCacheDefinition relationship (in workbook.xml.rels)
22
+ * • Add <pivotCaches> ref in workbook.xml
23
+ * • Add ContentTypes overrides for both pivotTable and pivotCacheDefinition
24
+ *
25
+ * The slicer-builder integration (lines 1-128 of slicer-builder.ts
26
+ * + ~100 lines in xlsx-export.ts) is the closest reference template.
27
+ */
28
+ import type { PivotTable } from "@rowsncolumns/spreadsheet";
29
+ /**
30
+ * Build pivotCacheDefinition XML for a pivot. The cacheSource
31
+ * points at the live worksheet range; `refreshOnLoad="1"` makes
32
+ * Excel rebuild the cache when the user opens the file.
33
+ *
34
+ * @param pivot The PivotTable record
35
+ * @param sheetName Name of the sheet containing the source range
36
+ * @param fieldNames All source column headers (becomes <cacheFields>)
37
+ */
38
+ export declare const buildPivotCacheDefinitionXml: (pivot: PivotTable, sheetName: string, fieldNames: string[]) => string | null;
39
+ /**
40
+ * Build the pivotTable layout XML. Excel determines whether a cell
41
+ * is a "row label", "column label", or "data" by the field axes
42
+ * declared here.
43
+ *
44
+ * @param pivot The PivotTable record
45
+ * @param cacheId Numeric cache ID (matches workbook.xml's <pivotCaches>)
46
+ * @param fieldIndices Maps row/col/value field names → cacheField indices
47
+ */
48
+ export declare const buildPivotTableXml: (pivot: PivotTable, cacheId: number, fieldIndices: Map<string, number>) => string | null;
49
+ /**
50
+ * Build the pivotTable.xml.rels file (links the pivot to its
51
+ * cache definition).
52
+ *
53
+ * @param cacheRid Relationship id (e.g. "rId1")
54
+ * @param cacheTarget Path relative to pivotTable, e.g.
55
+ * "../pivotCache/pivotCacheDefinition1.xml"
56
+ */
57
+ export declare const buildPivotTableRelsXml: (cacheRid: string, cacheTarget: string) => string;
58
+ //# sourceMappingURL=pivot-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pivot-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/pivot-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AA4D5D;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACvC,OAAO,UAAU,EACjB,WAAW,MAAM,EACjB,YAAY,MAAM,EAAE,KACnB,MAAM,GAAG,IAgCX,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,UAAU,EACjB,SAAS,MAAM,EACf,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAChC,MAAM,GAAG,IAkHX,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,MAAM,EAChB,aAAa,MAAM,KAClB,MAcF,CAAC"}
@@ -0,0 +1,277 @@
1
+ import { __read, __spreadArray, __values } from "tslib";
2
+ import { XMLBuilder } from "fast-xml-parser";
3
+ var xmlBuilder = new XMLBuilder({
4
+ ignoreAttributes: false,
5
+ attributeNamePrefix: "@_",
6
+ format: true,
7
+ indentBy: " ",
8
+ });
9
+ /**
10
+ * Convert numeric col/row to A1 notation. 1-indexed.
11
+ * e.g. (1, 1) → "A1", (28, 5) → "AB5".
12
+ */
13
+ var a1 = function (col, row) {
14
+ var s = "";
15
+ var c = col;
16
+ while (c > 0) {
17
+ var rem = (c - 1) % 26;
18
+ s = String.fromCharCode(65 + rem) + s;
19
+ c = Math.floor((c - 1) / 26);
20
+ }
21
+ return "".concat(s).concat(row);
22
+ };
23
+ var rangeRef = function (range) {
24
+ return "".concat(a1(range.startColumnIndex, range.startRowIndex), ":").concat(a1(range.endColumnIndex, range.endRowIndex));
25
+ };
26
+ /**
27
+ * Map our aggFunc → XLSX subtotal attribute.
28
+ */
29
+ var aggToSubtotal = function (agg) {
30
+ var _a;
31
+ var map = {
32
+ sum: "sum",
33
+ count: "countNums",
34
+ counta: "count",
35
+ avg: "average",
36
+ min: "min",
37
+ max: "max",
38
+ product: "product",
39
+ stddev: "stdDev",
40
+ stddevp: "stdDevp",
41
+ var: "var",
42
+ varp: "varp",
43
+ median: "average", // No native MEDIAN; fall back so Excel doesn't error.
44
+ countunique: "count",
45
+ };
46
+ return (_a = map[agg]) !== null && _a !== void 0 ? _a : "sum";
47
+ };
48
+ /**
49
+ * Build pivotCacheDefinition XML for a pivot. The cacheSource
50
+ * points at the live worksheet range; `refreshOnLoad="1"` makes
51
+ * Excel rebuild the cache when the user opens the file.
52
+ *
53
+ * @param pivot The PivotTable record
54
+ * @param sheetName Name of the sheet containing the source range
55
+ * @param fieldNames All source column headers (becomes <cacheFields>)
56
+ */
57
+ export var buildPivotCacheDefinitionXml = function (pivot, sheetName, fieldNames) {
58
+ if (!pivot.source)
59
+ return null;
60
+ var sourceRef = rangeRef(pivot.source);
61
+ var cacheFields = fieldNames.map(function (name) { return ({
62
+ "@_name": name,
63
+ sharedItems: { "@_count": "0" },
64
+ }); });
65
+ var doc = {
66
+ "?xml": { "@_version": "1.0", "@_encoding": "UTF-8", "@_standalone": "yes" },
67
+ pivotCacheDefinition: {
68
+ "@_xmlns": "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
69
+ "@_xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
70
+ "@_invalid": "1",
71
+ "@_refreshOnLoad": "1",
72
+ "@_refreshedBy": "Rows n Columns",
73
+ "@_recordCount": "0",
74
+ cacheSource: {
75
+ "@_type": "worksheet",
76
+ worksheetSource: {
77
+ "@_ref": sourceRef,
78
+ "@_sheet": sheetName,
79
+ },
80
+ },
81
+ cacheFields: {
82
+ "@_count": String(cacheFields.length),
83
+ cacheField: cacheFields,
84
+ },
85
+ },
86
+ };
87
+ return xmlBuilder.build(doc);
88
+ };
89
+ /**
90
+ * Build the pivotTable layout XML. Excel determines whether a cell
91
+ * is a "row label", "column label", or "data" by the field axes
92
+ * declared here.
93
+ *
94
+ * @param pivot The PivotTable record
95
+ * @param cacheId Numeric cache ID (matches workbook.xml's <pivotCaches>)
96
+ * @param fieldIndices Maps row/col/value field names → cacheField indices
97
+ */
98
+ export var buildPivotTableXml = function (pivot, cacheId, fieldIndices) {
99
+ var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
100
+ var _e, _f, _g, _h, _j, _k, _l;
101
+ if (!pivot.pivotRange)
102
+ return null;
103
+ var ref = rangeRef(pivot.pivotRange);
104
+ // pivotFields: one entry per cacheField, with axis attribute
105
+ // (axisRow / axisCol / dataField). Order = cacheField order.
106
+ var pivotFields = [];
107
+ // We don't know the full field universe here without the source
108
+ // schema. Best-effort: declare entries for the union of row/col/
109
+ // value fields and tag with the appropriate axis.
110
+ var fieldAxis = new Map();
111
+ try {
112
+ for (var _m = __values((_e = pivot.rows) !== null && _e !== void 0 ? _e : []), _o = _m.next(); !_o.done; _o = _m.next()) {
113
+ var r = _o.value;
114
+ var idx = fieldIndices.get(r.field);
115
+ if (idx != null)
116
+ fieldAxis.set(idx, "axisRow");
117
+ }
118
+ }
119
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
120
+ finally {
121
+ try {
122
+ if (_o && !_o.done && (_a = _m.return)) _a.call(_m);
123
+ }
124
+ finally { if (e_1) throw e_1.error; }
125
+ }
126
+ try {
127
+ for (var _p = __values((_f = pivot.columns) !== null && _f !== void 0 ? _f : []), _q = _p.next(); !_q.done; _q = _p.next()) {
128
+ var c = _q.value;
129
+ var idx = fieldIndices.get(c.field);
130
+ if (idx != null)
131
+ fieldAxis.set(idx, "axisCol");
132
+ }
133
+ }
134
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
135
+ finally {
136
+ try {
137
+ if (_q && !_q.done && (_b = _p.return)) _b.call(_p);
138
+ }
139
+ finally { if (e_2) throw e_2.error; }
140
+ }
141
+ try {
142
+ for (var _r = __values((_g = pivot.values) !== null && _g !== void 0 ? _g : []), _s = _r.next(); !_s.done; _s = _r.next()) {
143
+ var v = _s.value;
144
+ var idx = fieldIndices.get(v.field);
145
+ if (idx != null)
146
+ fieldAxis.set(idx, "dataField");
147
+ }
148
+ }
149
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
150
+ finally {
151
+ try {
152
+ if (_s && !_s.done && (_c = _r.return)) _c.call(_r);
153
+ }
154
+ finally { if (e_3) throw e_3.error; }
155
+ }
156
+ // Need to emit one <pivotField> per cacheField in order, even
157
+ // for unused fields (Excel requires the array shapes match).
158
+ // Caller passes us the full field set via fieldIndices.
159
+ var sortedFieldIndices = __spreadArray([], __read(fieldIndices.entries()), false).sort(function (a, b) { return a[1] - b[1]; });
160
+ try {
161
+ for (var sortedFieldIndices_1 = __values(sortedFieldIndices), sortedFieldIndices_1_1 = sortedFieldIndices_1.next(); !sortedFieldIndices_1_1.done; sortedFieldIndices_1_1 = sortedFieldIndices_1.next()) {
162
+ var _t = __read(sortedFieldIndices_1_1.value, 2), idx = _t[1];
163
+ var axis = fieldAxis.get(idx);
164
+ if (axis) {
165
+ pivotFields.push({ "@_axis": axis, "@_compact": "0", items: {} });
166
+ }
167
+ else {
168
+ pivotFields.push({ "@_compact": "0" });
169
+ }
170
+ }
171
+ }
172
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
173
+ finally {
174
+ try {
175
+ if (sortedFieldIndices_1_1 && !sortedFieldIndices_1_1.done && (_d = sortedFieldIndices_1.return)) _d.call(sortedFieldIndices_1);
176
+ }
177
+ finally { if (e_4) throw e_4.error; }
178
+ }
179
+ var rowFields = ((_h = pivot.rows) !== null && _h !== void 0 ? _h : [])
180
+ .map(function (r) { return fieldIndices.get(r.field); })
181
+ .filter(function (i) { return i != null; })
182
+ .map(function (i) { return ({ "@_x": String(i) }); });
183
+ var colFields = ((_j = pivot.columns) !== null && _j !== void 0 ? _j : [])
184
+ .map(function (c) { return fieldIndices.get(c.field); })
185
+ .filter(function (i) { return i != null; })
186
+ .map(function (i) { return ({ "@_x": String(i) }); });
187
+ var dataFields = ((_k = pivot.values) !== null && _k !== void 0 ? _k : [])
188
+ .map(function (v) {
189
+ var _a;
190
+ var idx = fieldIndices.get(v.field);
191
+ if (idx == null)
192
+ return null;
193
+ return {
194
+ "@_name": (_a = v.displayName) !== null && _a !== void 0 ? _a : "".concat(v.aggFunc, " of ").concat(v.field),
195
+ "@_fld": String(idx),
196
+ "@_subtotal": aggToSubtotal(v.aggFunc),
197
+ };
198
+ })
199
+ .filter(function (d) { return d !== null; });
200
+ var doc = {
201
+ "?xml": { "@_version": "1.0", "@_encoding": "UTF-8", "@_standalone": "yes" },
202
+ pivotTableDefinition: {
203
+ "@_xmlns": "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
204
+ "@_name": (_l = pivot.name) !== null && _l !== void 0 ? _l : "PivotTable".concat(pivot.pivotId),
205
+ "@_cacheId": String(cacheId),
206
+ "@_dataOnRows": "0",
207
+ "@_applyNumberFormats": "0",
208
+ "@_applyBorderFormats": "0",
209
+ "@_applyFontFormats": "0",
210
+ "@_applyPatternFormats": "0",
211
+ "@_applyAlignmentFormats": "0",
212
+ "@_applyWidthHeightFormats": "1",
213
+ "@_dataCaption": "Values",
214
+ "@_updatedVersion": "8",
215
+ "@_minRefreshableVersion": "3",
216
+ "@_showCalcMbrs": "0",
217
+ "@_useAutoFormatting": "1",
218
+ "@_itemPrintTitles": "1",
219
+ "@_createdVersion": "8",
220
+ "@_indent": "0",
221
+ "@_outline": "1",
222
+ "@_outlineData": "1",
223
+ "@_multipleFieldFilters": "0",
224
+ "@_rowGrandTotals": pivot.showRowGrandTotals === false ? "0" : "1",
225
+ "@_colGrandTotals": pivot.showColumnGrandTotals === false ? "0" : "1",
226
+ location: {
227
+ "@_ref": ref,
228
+ "@_firstHeaderRow": "1",
229
+ "@_firstDataRow": "1",
230
+ "@_firstDataCol": "1",
231
+ },
232
+ pivotFields: pivotFields.length
233
+ ? { "@_count": String(pivotFields.length), pivotField: pivotFields }
234
+ : undefined,
235
+ rowFields: rowFields.length
236
+ ? { "@_count": String(rowFields.length), field: rowFields }
237
+ : undefined,
238
+ colFields: colFields.length
239
+ ? { "@_count": String(colFields.length), field: colFields }
240
+ : undefined,
241
+ dataFields: dataFields.length
242
+ ? { "@_count": String(dataFields.length), dataField: dataFields }
243
+ : undefined,
244
+ pivotTableStyleInfo: {
245
+ "@_name": "PivotStyleLight16",
246
+ "@_showRowHeaders": "1",
247
+ "@_showColHeaders": "1",
248
+ "@_showRowStripes": "0",
249
+ "@_showColStripes": "0",
250
+ "@_showLastColumn": "1",
251
+ },
252
+ },
253
+ };
254
+ return xmlBuilder.build(doc);
255
+ };
256
+ /**
257
+ * Build the pivotTable.xml.rels file (links the pivot to its
258
+ * cache definition).
259
+ *
260
+ * @param cacheRid Relationship id (e.g. "rId1")
261
+ * @param cacheTarget Path relative to pivotTable, e.g.
262
+ * "../pivotCache/pivotCacheDefinition1.xml"
263
+ */
264
+ export var buildPivotTableRelsXml = function (cacheRid, cacheTarget) {
265
+ var doc = {
266
+ "?xml": { "@_version": "1.0", "@_encoding": "UTF-8", "@_standalone": "yes" },
267
+ Relationships: {
268
+ "@_xmlns": "http://schemas.openxmlformats.org/package/2006/relationships",
269
+ Relationship: {
270
+ "@_Id": cacheRid,
271
+ "@_Type": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
272
+ "@_Target": cacheTarget,
273
+ },
274
+ },
275
+ };
276
+ return xmlBuilder.build(doc);
277
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Power Query part re-emission — the export half of the parser's `getPowerQuery()` preservation,
3
+ * and the JS mirror of the Rust engine's `rnc-export` `inject_power_query` pass (same rules, same
4
+ * envelope shape).
5
+ *
6
+ * Runs as a post-pass over the exporter's assembled `files` map (just before zipping):
7
+ *
8
+ * - `customXml/item{N}.xml` (the `<DataMashup>` blob) + `customXml/itemProps{N}.xml` + the item's
9
+ * rels, related from `xl/workbook.xml`.
10
+ * - `xl/connections.xml`, verbatim.
11
+ * - `xl/queryTables/queryTable{N}.xml`, re-attached to the regenerated table part when the exported
12
+ * table still matches the imported one (same `displayName`, same ordered column names): the table
13
+ * part gains `tableType="queryTable"`, its `<tableColumn>`s get their ORIGINAL ids back (the
14
+ * verbatim queryTable part references them) plus their `queryTableFieldId`s, and a
15
+ * table→queryTable rel is written. A table that was renamed or had columns
16
+ * added/removed/reordered degrades to a plain table (its queryTable part is dropped) while the
17
+ * query itself (DataMashup + connection) still round-trips — Excel's own
18
+ * connection-without-load-target state.
19
+ */
20
+ import { type PowerQueryParts } from "../../power-query";
21
+ /**
22
+ * Apply the preserved Power Query parts onto the exporter's `files` map (part name → bytes).
23
+ * No-op when the envelope is empty, keeping every other export byte-for-byte unchanged.
24
+ */
25
+ export declare const applyPowerQueryParts: (files: Record<string, Uint8Array>, powerQuery: PowerQueryParts | null | undefined) => void;
26
+ //# sourceMappingURL=power-query-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"power-query-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/power-query-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,mBAAmB,CAAC;AAuB3B;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACjC,YAAY,eAAe,GAAG,IAAI,GAAG,SAAS,KAC7C,IAqHF,CAAC"}