@rowsncolumns/toolkit 24.4.1 → 24.4.3

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 (131) hide show
  1. package/dist/cjs/excel-parser/cfb-decryptor.d.ts +6 -0
  2. package/dist/cjs/excel-parser/cfb-decryptor.d.ts.map +1 -1
  3. package/dist/cjs/excel-parser/cfb-decryptor.js +6 -0
  4. package/dist/cjs/excel-parser/helpers.d.ts +9 -1
  5. package/dist/cjs/excel-parser/helpers.d.ts.map +1 -1
  6. package/dist/cjs/excel-parser/helpers.js +37 -0
  7. package/dist/cjs/excel-parser/interface.d.ts +10 -1
  8. package/dist/cjs/excel-parser/interface.d.ts.map +1 -1
  9. package/dist/cjs/excel-parser/plugins/ods/index.d.ts +19 -0
  10. package/dist/cjs/excel-parser/plugins/ods/index.d.ts.map +1 -1
  11. package/dist/cjs/excel-parser/plugins/ods/index.js +676 -304
  12. package/dist/cjs/excel-parser/plugins/ods/styles.d.ts +43 -1
  13. package/dist/cjs/excel-parser/plugins/ods/styles.d.ts.map +1 -1
  14. package/dist/cjs/excel-parser/plugins/ods/styles.js +343 -45
  15. package/dist/cjs/excel-parser/plugins/xls/index.d.ts +11 -3
  16. package/dist/cjs/excel-parser/plugins/xls/index.d.ts.map +1 -1
  17. package/dist/cjs/excel-parser/plugins/xls/index.js +55 -6
  18. package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts +4 -0
  19. package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts.map +1 -1
  20. package/dist/cjs/excel-parser/plugins/xlsb/index.js +21 -9
  21. package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts +10 -0
  22. package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts.map +1 -1
  23. package/dist/cjs/excel-parser/plugins/xlsx/charts.js +68 -9
  24. package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts +28 -1
  25. package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -1
  26. package/dist/cjs/excel-parser/plugins/xlsx/drawing.js +155 -20
  27. package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts +26 -1
  28. package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts.map +1 -1
  29. package/dist/cjs/excel-parser/plugins/xlsx/index.js +567 -234
  30. package/dist/cjs/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -1
  31. package/dist/cjs/excel-parser/plugins/xlsx/pivots.js +125 -37
  32. package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.d.ts +3 -0
  33. package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.d.ts.map +1 -1
  34. package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.js +4 -1
  35. package/dist/cjs/excel-parser/plugins/xlsx/styles.d.ts.map +1 -1
  36. package/dist/cjs/excel-parser/plugins/xlsx/styles.js +12 -2
  37. package/dist/cjs/excel-parser/registry.d.ts.map +1 -1
  38. package/dist/cjs/excel-parser/registry.js +2 -0
  39. package/dist/cjs/excel-parser/types.d.ts +7 -1
  40. package/dist/cjs/excel-parser/types.d.ts.map +1 -1
  41. package/dist/cjs/excel-parser/workbook.d.ts +1 -0
  42. package/dist/cjs/excel-parser/workbook.d.ts.map +1 -1
  43. package/dist/cjs/excel-parser/workbook.js +4 -0
  44. package/dist/cjs/excel-parser/worker.js +3 -1
  45. package/dist/cjs/exporter/ods/ods-export.d.ts.map +1 -1
  46. package/dist/cjs/exporter/ods/ods-export.js +432 -175
  47. package/dist/cjs/exporter/xlsx/chart-builder.d.ts.map +1 -1
  48. package/dist/cjs/exporter/xlsx/chart-builder.js +210 -6
  49. package/dist/cjs/exporter/xlsx/pivot-builder.d.ts +8 -0
  50. package/dist/cjs/exporter/xlsx/pivot-builder.d.ts.map +1 -1
  51. package/dist/cjs/exporter/xlsx/pivot-builder.js +141 -42
  52. package/dist/cjs/exporter/xlsx/style-builder.js +9 -3
  53. package/dist/cjs/exporter/xlsx/threaded-comments-builder.d.ts +7 -1
  54. package/dist/cjs/exporter/xlsx/threaded-comments-builder.d.ts.map +1 -1
  55. package/dist/cjs/exporter/xlsx/threaded-comments-builder.js +15 -3
  56. package/dist/cjs/exporter/xlsx/xlsx-export.d.ts +11 -2
  57. package/dist/cjs/exporter/xlsx/xlsx-export.d.ts.map +1 -1
  58. package/dist/cjs/exporter/xlsx/xlsx-export.js +678 -222
  59. package/dist/cjs/helpers/implicit-intersection.d.ts +16 -0
  60. package/dist/cjs/helpers/implicit-intersection.d.ts.map +1 -0
  61. package/dist/cjs/helpers/implicit-intersection.js +197 -0
  62. package/dist/cjs/print-settings.d.ts +105 -0
  63. package/dist/cjs/print-settings.d.ts.map +1 -0
  64. package/dist/cjs/print-settings.js +494 -0
  65. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  66. package/dist/esm/excel-parser/cfb-decryptor.d.ts +6 -0
  67. package/dist/esm/excel-parser/cfb-decryptor.d.ts.map +1 -1
  68. package/dist/esm/excel-parser/cfb-decryptor.js +6 -0
  69. package/dist/esm/excel-parser/helpers.d.ts +9 -1
  70. package/dist/esm/excel-parser/helpers.d.ts.map +1 -1
  71. package/dist/esm/excel-parser/helpers.js +34 -0
  72. package/dist/esm/excel-parser/interface.d.ts +10 -1
  73. package/dist/esm/excel-parser/interface.d.ts.map +1 -1
  74. package/dist/esm/excel-parser/plugins/ods/index.d.ts +19 -0
  75. package/dist/esm/excel-parser/plugins/ods/index.d.ts.map +1 -1
  76. package/dist/esm/excel-parser/plugins/ods/index.js +347 -33
  77. package/dist/esm/excel-parser/plugins/ods/styles.d.ts +43 -1
  78. package/dist/esm/excel-parser/plugins/ods/styles.d.ts.map +1 -1
  79. package/dist/esm/excel-parser/plugins/ods/styles.js +276 -2
  80. package/dist/esm/excel-parser/plugins/xls/index.d.ts +11 -3
  81. package/dist/esm/excel-parser/plugins/xls/index.d.ts.map +1 -1
  82. package/dist/esm/excel-parser/plugins/xls/index.js +37 -5
  83. package/dist/esm/excel-parser/plugins/xlsb/index.d.ts +4 -0
  84. package/dist/esm/excel-parser/plugins/xlsb/index.d.ts.map +1 -1
  85. package/dist/esm/excel-parser/plugins/xlsb/index.js +20 -6
  86. package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts +10 -0
  87. package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts.map +1 -1
  88. package/dist/esm/excel-parser/plugins/xlsx/charts.js +69 -6
  89. package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts +28 -1
  90. package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -1
  91. package/dist/esm/excel-parser/plugins/xlsx/drawing.js +99 -0
  92. package/dist/esm/excel-parser/plugins/xlsx/index.d.ts +26 -1
  93. package/dist/esm/excel-parser/plugins/xlsx/index.d.ts.map +1 -1
  94. package/dist/esm/excel-parser/plugins/xlsx/index.js +362 -26
  95. package/dist/esm/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -1
  96. package/dist/esm/excel-parser/plugins/xlsx/pivots.js +86 -6
  97. package/dist/esm/excel-parser/plugins/xlsx/sheet-views.d.ts +3 -0
  98. package/dist/esm/excel-parser/plugins/xlsx/sheet-views.d.ts.map +1 -1
  99. package/dist/esm/excel-parser/plugins/xlsx/sheet-views.js +2 -0
  100. package/dist/esm/excel-parser/plugins/xlsx/styles.d.ts.map +1 -1
  101. package/dist/esm/excel-parser/plugins/xlsx/styles.js +12 -2
  102. package/dist/esm/excel-parser/registry.d.ts.map +1 -1
  103. package/dist/esm/excel-parser/registry.js +2 -0
  104. package/dist/esm/excel-parser/types.d.ts +7 -1
  105. package/dist/esm/excel-parser/types.d.ts.map +1 -1
  106. package/dist/esm/excel-parser/workbook.d.ts +1 -0
  107. package/dist/esm/excel-parser/workbook.d.ts.map +1 -1
  108. package/dist/esm/excel-parser/workbook.js +3 -0
  109. package/dist/esm/excel-parser/worker.js +2 -0
  110. package/dist/esm/exporter/ods/ods-export.d.ts.map +1 -1
  111. package/dist/esm/exporter/ods/ods-export.js +306 -35
  112. package/dist/esm/exporter/xlsx/chart-builder.d.ts.map +1 -1
  113. package/dist/esm/exporter/xlsx/chart-builder.js +161 -0
  114. package/dist/esm/exporter/xlsx/pivot-builder.d.ts +8 -0
  115. package/dist/esm/exporter/xlsx/pivot-builder.d.ts.map +1 -1
  116. package/dist/esm/exporter/xlsx/pivot-builder.js +104 -19
  117. package/dist/esm/exporter/xlsx/style-builder.js +9 -3
  118. package/dist/esm/exporter/xlsx/threaded-comments-builder.d.ts +7 -1
  119. package/dist/esm/exporter/xlsx/threaded-comments-builder.d.ts.map +1 -1
  120. package/dist/esm/exporter/xlsx/threaded-comments-builder.js +15 -3
  121. package/dist/esm/exporter/xlsx/xlsx-export.d.ts +11 -2
  122. package/dist/esm/exporter/xlsx/xlsx-export.d.ts.map +1 -1
  123. package/dist/esm/exporter/xlsx/xlsx-export.js +449 -47
  124. package/dist/esm/helpers/implicit-intersection.d.ts +16 -0
  125. package/dist/esm/helpers/implicit-intersection.d.ts.map +1 -0
  126. package/dist/esm/helpers/implicit-intersection.js +184 -0
  127. package/dist/esm/print-settings.d.ts +105 -0
  128. package/dist/esm/print-settings.d.ts.map +1 -0
  129. package/dist/esm/print-settings.js +422 -0
  130. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  131. package/package.json +3 -3
@@ -1492,6 +1492,12 @@ export const buildChartXml = (chart, sheetNameById) => {
1492
1492
  // chartType-agnostic and intentionally run last so per-type branches
1493
1493
  // don't have to know about them.
1494
1494
  applyChartFormatting(chartSpace, chart.spec, sheetNameById);
1495
+ // 3-D / surface variants (sourceChartType BAR_3D, LINE_3D, PIE_3D,
1496
+ // AREA_3D, SURFACE, SURFACE_3D) — swap the 2-D chart group for its
1497
+ // OOXML 3-D element and add `<c:view3D>`. Runs after the formatting
1498
+ // pass so data labels / overlays land in the container first and are
1499
+ // carried across by the rename.
1500
+ applyThreeDChartType(chartSpace["c:chartSpace"]["c:chart"], chart.spec.sourceChartType);
1495
1501
  // `<c:roundedCorners val="1"/>` lives at the chartSpace root (sibling
1496
1502
  // of `<c:chart>`). Default per OOXML §21.2.2.183 is `false`; only
1497
1503
  // emit when the spec opted in so files imported without the element
@@ -1502,6 +1508,161 @@ export const buildChartXml = (chart, sheetNameById) => {
1502
1508
  const xml = chartBuilder.build(chartSpace);
1503
1509
  return `${XML_DECLARATION}${xml}`;
1504
1510
  };
1511
+ // -------------------------- 3-D / surface --------------------------
1512
+ /** Series-axis id for the 3-D chart groups that take a third axis. */
1513
+ const SER_AX_ID = "1789284465";
1514
+ /**
1515
+ * How each 3-D class maps onto its 2-D chart group: which container it
1516
+ * replaces, the element it becomes, and how many `<c:axId>` refs the
1517
+ * schema wants (0 = no axes, 3 = adds a series axis).
1518
+ */
1519
+ const THREE_D_CHART_GROUPS = {
1520
+ BAR_3D: { from: "c:barChart", to: "c:bar3DChart", axes: 2 },
1521
+ LINE_3D: { from: "c:lineChart", to: "c:line3DChart", axes: 3 },
1522
+ PIE_3D: { from: "c:pieChart", to: "c:pie3DChart", axes: 0 },
1523
+ AREA_3D: { from: "c:areaChart", to: "c:area3DChart", axes: 2 },
1524
+ SURFACE: { from: "c:areaChart", to: "c:surfaceChart", axes: 2 },
1525
+ SURFACE_3D: { from: "c:areaChart", to: "c:surface3DChart", axes: 3 },
1526
+ };
1527
+ const normalizeThreeDToken = (value) => {
1528
+ if (typeof value !== "string")
1529
+ return undefined;
1530
+ const token = value.trim().toUpperCase();
1531
+ return token in THREE_D_CHART_GROUPS ? token : undefined;
1532
+ };
1533
+ /** Copy `keys` (in order) from `source` into `target`, skipping absent ones. */
1534
+ const pickKeys = (target, source, keys) => {
1535
+ for (const key of keys) {
1536
+ if (source[key] !== undefined)
1537
+ target[key] = source[key];
1538
+ }
1539
+ };
1540
+ /**
1541
+ * Rebuild the 2-D chart group as its 3-D element with the CT_*3DChart
1542
+ * child sequence. Element order matters to Excel, so each shape is
1543
+ * written out explicitly rather than renaming the key in place:
1544
+ * bar3DChart: barDir, grouping, varyColors, ser, dLbls, gapWidth, shape, axId
1545
+ * line3DChart: grouping, varyColors, ser, dLbls, axId×3
1546
+ * pie3DChart: varyColors, ser, dLbls
1547
+ * area3DChart: grouping, varyColors, ser, dLbls, axId
1548
+ * surfaceChart: wireframe, ser, axId (surface3DChart: axId×3)
1549
+ */
1550
+ const buildThreeDChartGroup = (token, group, axIds) => {
1551
+ const node = {};
1552
+ switch (token) {
1553
+ case "BAR_3D":
1554
+ pickKeys(node, group, ["c:barDir", "c:grouping", "c:varyColors"]);
1555
+ pickKeys(node, group, ["c:ser", "c:dLbls", "c:gapWidth"]);
1556
+ node["c:shape"] = { a$: { val: "box" } };
1557
+ node["c:axId"] = axIds;
1558
+ return node;
1559
+ case "LINE_3D":
1560
+ case "AREA_3D":
1561
+ pickKeys(node, group, ["c:grouping", "c:varyColors", "c:ser", "c:dLbls"]);
1562
+ node["c:axId"] = axIds;
1563
+ return node;
1564
+ case "PIE_3D":
1565
+ pickKeys(node, group, ["c:varyColors", "c:ser", "c:dLbls"]);
1566
+ return node;
1567
+ case "SURFACE":
1568
+ case "SURFACE_3D":
1569
+ node["c:wireframe"] = { a$: { val: "0" } };
1570
+ pickKeys(node, group, ["c:ser"]);
1571
+ node["c:axId"] = axIds;
1572
+ return node;
1573
+ }
1574
+ };
1575
+ /** `<c:serAx>` for the 3-D groups whose schema takes a third (depth) axis. */
1576
+ const buildSerAxNode = (valAxId) => ({
1577
+ "c:axId": { a$: { val: SER_AX_ID } },
1578
+ "c:scaling": { "c:orientation": { a$: { val: "minMax" } } },
1579
+ "c:delete": { a$: { val: "0" } },
1580
+ "c:axPos": { a$: { val: "b" } },
1581
+ "c:majorTickMark": { a$: { val: "out" } },
1582
+ "c:minorTickMark": { a$: { val: "none" } },
1583
+ "c:tickLblPos": { a$: { val: "nextTo" } },
1584
+ "c:crossAx": { a$: { val: valAxId } },
1585
+ "c:crosses": { a$: { val: "autoZero" } },
1586
+ });
1587
+ /** `<c:view3D>` — Excel's default camera for each class (CT_View3D order). */
1588
+ const buildView3DNode = (token) => {
1589
+ if (token === "PIE_3D") {
1590
+ return {
1591
+ "c:rotX": { a$: { val: "30" } },
1592
+ "c:rotY": { a$: { val: "0" } },
1593
+ "c:rAngAx": { a$: { val: "0" } },
1594
+ };
1595
+ }
1596
+ if (token === "SURFACE" || token === "SURFACE_3D") {
1597
+ // Right-angle axes are not allowed on surfaces; use a perspective view.
1598
+ return {
1599
+ "c:rotX": { a$: { val: "15" } },
1600
+ "c:rotY": { a$: { val: "20" } },
1601
+ "c:rAngAx": { a$: { val: "0" } },
1602
+ "c:perspective": { a$: { val: "30" } },
1603
+ };
1604
+ }
1605
+ return {
1606
+ "c:rotX": { a$: { val: "15" } },
1607
+ "c:rotY": { a$: { val: "20" } },
1608
+ "c:rAngAx": { a$: { val: "1" } },
1609
+ };
1610
+ };
1611
+ /**
1612
+ * Turn an assembled 2-D `<c:chart>` into its 3-D variant when the spec
1613
+ * carries a 3-D `sourceChartType`: the chart group is swapped for the
1614
+ * matching `c:*3DChart` / `c:surfaceChart` element, a `<c:serAx>` is
1615
+ * added where the schema takes three axes, and `<c:view3D>` is inserted
1616
+ * before `<c:plotArea>`. No-op for 2-D specs or when the token doesn't
1617
+ * match the emitted chart group (the 2-D chart is left untouched).
1618
+ */
1619
+ const applyThreeDChartType = (chartNode, sourceChartType) => {
1620
+ const token = normalizeThreeDToken(sourceChartType);
1621
+ if (!token || !chartNode)
1622
+ return;
1623
+ const plotArea = chartNode["c:plotArea"];
1624
+ if (!plotArea)
1625
+ return;
1626
+ const { from, to, axes } = THREE_D_CHART_GROUPS[token];
1627
+ const group = plotArea[from];
1628
+ if (!group || Array.isArray(group))
1629
+ return;
1630
+ const existingAxIds = Array.isArray(group["c:axId"])
1631
+ ? group["c:axId"]
1632
+ : group["c:axId"]
1633
+ ? [group["c:axId"]]
1634
+ : [];
1635
+ const valAxId = existingAxIds[1]?.a$?.val ?? existingAxIds[0]?.a$?.val ?? "0";
1636
+ const axIds = axes === 3
1637
+ ? [...existingAxIds.slice(0, 2), { a$: { val: SER_AX_ID } }]
1638
+ : existingAxIds.slice(0, 2);
1639
+ // Rebuild plotArea preserving element order, swapping the chart group
1640
+ // and appending the series axis after the value axis when needed.
1641
+ const rebuiltPlotArea = {};
1642
+ for (const [key, value] of Object.entries(plotArea)) {
1643
+ if (key === from) {
1644
+ rebuiltPlotArea[to] = buildThreeDChartGroup(token, group, axIds);
1645
+ continue;
1646
+ }
1647
+ rebuiltPlotArea[key] = value;
1648
+ if (key === "c:valAx" && axes === 3) {
1649
+ rebuiltPlotArea["c:serAx"] = buildSerAxNode(valAxId);
1650
+ }
1651
+ }
1652
+ // Rebuild the chart node so `<c:view3D>` lands before `<c:plotArea>`.
1653
+ const rebuiltChart = {};
1654
+ for (const [key, value] of Object.entries(chartNode)) {
1655
+ if (key === "c:plotArea") {
1656
+ rebuiltChart["c:view3D"] = buildView3DNode(token);
1657
+ rebuiltChart[key] = rebuiltPlotArea;
1658
+ continue;
1659
+ }
1660
+ rebuiltChart[key] = value;
1661
+ }
1662
+ for (const key of Object.keys(chartNode))
1663
+ delete chartNode[key];
1664
+ Object.assign(chartNode, rebuiltChart);
1665
+ };
1505
1666
  // -------------------------- Phase 5 helpers --------------------------
1506
1667
  const LEGEND_POS = {
1507
1668
  top: "t",
@@ -26,6 +26,14 @@
26
26
  * + ~100 lines in xlsx-export.ts) is the closest reference template.
27
27
  */
28
28
  import type { PivotTable } from "@rowsncolumns/spreadsheet";
29
+ /**
30
+ * Distinct source fields a calculated-field formula references —
31
+ * single-quoted names (`'Unit Price'`, `''` escapes a quote) or bare
32
+ * identifiers; numeric literals (incl. `1e5`) and operators are skipped.
33
+ * Mirrors `@rowsncolumns/pivot`'s tokenizer without pulling in the
34
+ * DuckDB-backed pivot package.
35
+ */
36
+ export declare const calculatedFieldReferences: (formula: string) => string[];
29
37
  /**
30
38
  * Build pivotCacheDefinition XML for a pivot. The cacheSource
31
39
  * points at the live worksheet range; `refreshOnLoad="1"` makes
@@ -1 +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"}
1
+ {"version":3,"file":"pivot-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/pivot-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,2BAA2B,CAAC;AAqBxE;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,MAAM,KAAG,MAAM,EAYjE,CAAC;AA2DF;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACvC,OAAO,UAAU,EACjB,WAAW,MAAM,EACjB,YAAY,MAAM,EAAE,KACnB,MAAM,GAAG,IAuCX,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,UAAU,EACjB,SAAS,MAAM,EACf,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAChC,MAAM,GAAG,IA2JX,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,MAAM,EAChB,aAAa,MAAM,KAClB,MAcF,CAAC"}
@@ -1,4 +1,43 @@
1
1
  import { XMLBuilder } from "fast-xml-parser";
2
+ /**
3
+ * `PivotValue.showAs` → `dataField@showDataAs` (ECMA-376) or, for the
4
+ * rank modes Excel only knows through its 2010 extension,
5
+ * `x14:dataField@pivotShowAs`.
6
+ */
7
+ const SHOW_DATA_AS = {
8
+ pct_of_total: "percentOfTotal",
9
+ pct_of_row: "percentOfRow",
10
+ pct_of_column: "percentOfCol",
11
+ running_total: "runTotal",
12
+ };
13
+ const X14_PIVOT_SHOW_AS = {
14
+ rank_asc: "rankAscending",
15
+ rank_desc: "rankDescending",
16
+ };
17
+ const X14_DATA_FIELD_EXT_URI = "{E15A36E0-9728-4e99-A89B-3F7291B0FE68}";
18
+ const X14_NS = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main";
19
+ /**
20
+ * Distinct source fields a calculated-field formula references —
21
+ * single-quoted names (`'Unit Price'`, `''` escapes a quote) or bare
22
+ * identifiers; numeric literals (incl. `1e5`) and operators are skipped.
23
+ * Mirrors `@rowsncolumns/pivot`'s tokenizer without pulling in the
24
+ * DuckDB-backed pivot package.
25
+ */
26
+ export const calculatedFieldReferences = (formula) => {
27
+ const out = [];
28
+ const push = (name) => {
29
+ if (name && !out.includes(name))
30
+ out.push(name);
31
+ };
32
+ const re = /'((?:[^']|'')*)'|(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?|([A-Za-z_\u00C0-\uFFFF][A-Za-z0-9_.\u00C0-\uFFFF]*)/g;
33
+ for (const m of formula.replace(/^\s*=/, "").matchAll(re)) {
34
+ if (m[1] !== undefined)
35
+ push(m[1].replace(/''/g, "'"));
36
+ else if (m[2] !== undefined)
37
+ push(m[2]);
38
+ }
39
+ return out;
40
+ };
2
41
  const xmlBuilder = new XMLBuilder({
3
42
  ignoreAttributes: false,
4
43
  attributeNamePrefix: "@_",
@@ -54,10 +93,15 @@ export const buildPivotCacheDefinitionXml = (pivot, sheetName, fieldNames) => {
54
93
  if (!pivot.source)
55
94
  return null;
56
95
  const sourceRef = rangeRef(pivot.source);
57
- const cacheFields = fieldNames.map((name) => ({
58
- "@_name": name,
59
- sharedItems: { "@_count": "0" },
60
- }));
96
+ // Calculated fields are cache fields too (`databaseField="0"` +
97
+ // `formula`), listed after the source columns like Excel does.
98
+ const calculatedByName = new Map((pivot.calculatedFields ?? []).map((c) => [c.name, c.formula]));
99
+ const cacheFields = fieldNames.map((name) => {
100
+ const formula = calculatedByName.get(name);
101
+ return formula !== undefined
102
+ ? { "@_name": name, "@_formula": formula, "@_databaseField": "0" }
103
+ : { "@_name": name, sharedItems: { "@_count": "0" } };
104
+ });
61
105
  const doc = {
62
106
  "?xml": { "@_version": "1.0", "@_encoding": "UTF-8", "@_standalone": "yes" },
63
107
  pivotCacheDefinition: {
@@ -95,8 +139,10 @@ export const buildPivotTableXml = (pivot, cacheId, fieldIndices) => {
95
139
  if (!pivot.pivotRange)
96
140
  return null;
97
141
  const ref = rangeRef(pivot.pivotRange);
98
- // pivotFields: one entry per cacheField, with axis attribute
99
- // (axisRow / axisCol / dataField). Order = cacheField order.
142
+ // pivotFields: one entry per cacheField, with the axis attribute
143
+ // (axisRow / axisCol) and/or `dataField="1"` for value fields
144
+ // (`ST_Axis` has no "dataField" value — a field can sit on an axis
145
+ // AND be a data field). Order = cacheField order.
100
146
  const pivotFields = [];
101
147
  // We don't know the full field universe here without the source
102
148
  // schema. Best-effort: declare entries for the union of row/col/
@@ -112,23 +158,38 @@ export const buildPivotTableXml = (pivot, cacheId, fieldIndices) => {
112
158
  if (idx != null)
113
159
  fieldAxis.set(idx, "axisCol");
114
160
  }
161
+ const dataFieldIndices = new Set();
115
162
  for (const v of pivot.values ?? []) {
116
163
  const idx = fieldIndices.get(v.field);
117
164
  if (idx != null)
118
- fieldAxis.set(idx, "dataField");
165
+ dataFieldIndices.add(idx);
119
166
  }
167
+ const calculatedNames = new Set((pivot.calculatedFields ?? []).map((c) => c.name));
120
168
  // Need to emit one <pivotField> per cacheField in order, even
121
169
  // for unused fields (Excel requires the array shapes match).
122
170
  // Caller passes us the full field set via fieldIndices.
123
171
  const sortedFieldIndices = [...fieldIndices.entries()].sort((a, b) => a[1] - b[1]);
124
- for (const [, idx] of sortedFieldIndices) {
172
+ for (const [name, idx] of sortedFieldIndices) {
125
173
  const axis = fieldAxis.get(idx);
126
- if (axis) {
127
- pivotFields.push({ "@_axis": axis, "@_compact": "0", items: {} });
174
+ const entry = {};
175
+ if (axis)
176
+ entry["@_axis"] = axis;
177
+ if (dataFieldIndices.has(idx))
178
+ entry["@_dataField"] = "1";
179
+ if (calculatedNames.has(name)) {
180
+ // Excel pins calculated fields to the values area.
181
+ entry["@_dragToRow"] = "0";
182
+ entry["@_dragToCol"] = "0";
183
+ entry["@_dragToPage"] = "0";
184
+ entry["@_showAll"] = "0";
185
+ entry["@_defaultSubtotal"] = "0";
128
186
  }
129
187
  else {
130
- pivotFields.push({ "@_compact": "0" });
188
+ entry["@_compact"] = "0";
189
+ if (axis)
190
+ entry.items = {};
131
191
  }
192
+ pivotFields.push(entry);
132
193
  }
133
194
  const rowFields = (pivot.rows ?? [])
134
195
  .map((r) => fieldIndices.get(r.field))
@@ -138,18 +199,42 @@ export const buildPivotTableXml = (pivot, cacheId, fieldIndices) => {
138
199
  .map((c) => fieldIndices.get(c.field))
139
200
  .filter((i) => i != null)
140
201
  .map((i) => ({ "@_x": String(i) }));
202
+ // Running totals need a base field: Excel defaults to the first row
203
+ // field (falls back to the first column field / field 0).
204
+ const runTotalBase = rowFields[0]?.["@_x"] ?? colFields[0]?.["@_x"] ?? "0";
141
205
  const dataFields = (pivot.values ?? [])
142
206
  .map((v) => {
143
207
  const idx = fieldIndices.get(v.field);
144
208
  if (idx == null)
145
209
  return null;
146
- return {
210
+ const entry = {
147
211
  "@_name": v.displayName ?? `${v.aggFunc} of ${v.field}`,
148
212
  "@_fld": String(idx),
149
- "@_subtotal": aggToSubtotal(v.aggFunc),
213
+ "@_subtotal": calculatedNames.has(v.field)
214
+ ? "sum"
215
+ : aggToSubtotal(v.aggFunc),
150
216
  };
217
+ const showDataAs = v.showAs ? SHOW_DATA_AS[v.showAs] : undefined;
218
+ if (showDataAs) {
219
+ entry["@_showDataAs"] = showDataAs;
220
+ if (showDataAs === "runTotal")
221
+ entry["@_baseField"] = runTotalBase;
222
+ }
223
+ const pivotShowAs = v.showAs ? X14_PIVOT_SHOW_AS[v.showAs] : undefined;
224
+ if (pivotShowAs) {
225
+ entry.extLst = {
226
+ ext: {
227
+ "@_uri": X14_DATA_FIELD_EXT_URI,
228
+ "@_xmlns:x14": X14_NS,
229
+ "x14:dataField": { "@_pivotShowAs": pivotShowAs },
230
+ },
231
+ };
232
+ }
233
+ return entry;
151
234
  })
152
235
  .filter((d) => d !== null);
236
+ const styleInfo = pivot.styleInfo ?? {};
237
+ const styleFlag = (value, fallback) => value === undefined ? fallback : value ? "1" : "0";
153
238
  const doc = {
154
239
  "?xml": { "@_version": "1.0", "@_encoding": "UTF-8", "@_standalone": "yes" },
155
240
  pivotTableDefinition: {
@@ -195,12 +280,12 @@ export const buildPivotTableXml = (pivot, cacheId, fieldIndices) => {
195
280
  ? { "@_count": String(dataFields.length), dataField: dataFields }
196
281
  : undefined,
197
282
  pivotTableStyleInfo: {
198
- "@_name": "PivotStyleLight16",
199
- "@_showRowHeaders": "1",
200
- "@_showColHeaders": "1",
201
- "@_showRowStripes": "0",
202
- "@_showColStripes": "0",
203
- "@_showLastColumn": "1",
283
+ "@_name": styleInfo.name || "PivotStyleLight16",
284
+ "@_showRowHeaders": styleFlag(styleInfo.showRowHeaders, "1"),
285
+ "@_showColHeaders": styleFlag(styleInfo.showColHeaders, "1"),
286
+ "@_showRowStripes": styleFlag(styleInfo.showRowStripes, "0"),
287
+ "@_showColStripes": styleFlag(styleInfo.showColStripes, "0"),
288
+ "@_showLastColumn": styleFlag(styleInfo.showLastColumn, "1"),
204
289
  },
205
290
  },
206
291
  };
@@ -702,10 +702,16 @@ const serializeAlignment = (record) => {
702
702
  attrs.push(`relativeIndent="${record.relativeIndent}"`);
703
703
  }
704
704
  if (record.textRotation !== undefined && record.textRotation !== null) {
705
- // Excel encodes "vertical (stacked)" text as the magic value 255.
706
- const rotation = record.textRotation === "vertical" ? 255 : record.textRotation;
705
+ // Excel encodes "vertical (stacked)" text as the magic value 255 and
706
+ // clockwise rotation as 90 + degrees (91–180); the engine keeps signed
707
+ // counter-clockwise degrees.
708
+ const rotation = record.textRotation === "vertical"
709
+ ? 255
710
+ : record.textRotation < 0
711
+ ? 90 - record.textRotation
712
+ : record.textRotation;
707
713
  if (Number.isFinite(rotation) && rotation !== 0) {
708
- attrs.push(`textRotation="${rotation}"`);
714
+ attrs.push(`textRotation="${Math.round(rotation)}"`);
709
715
  }
710
716
  }
711
717
  if (record.shrinkToFit) {
@@ -10,6 +10,7 @@ export declare const PERSON_CONTENT_TYPE = "application/vnd.ms-excel.person+xml"
10
10
  * scoping author/comment ids within a single workbook.
11
11
  */
12
12
  export declare const deterministicGuid: (seed: string) => string;
13
+ export declare const isBracedGuid: (id: string) => boolean;
13
14
  /**
14
15
  * Workbook-scoped author registry. Shared across every sheet's collector so
15
16
  * an author who comments on multiple sheets maps to a single `person` entry
@@ -35,7 +36,12 @@ export declare class ThreadedCommentsCollector {
35
36
  /** Anchor a thread to a cell. No-op if the id is unknown or empty. */
36
37
  addCell(address: string, threadId: string | number | null | undefined): void;
37
38
  isEmpty(): boolean;
38
- /** Braced root GUID for a thread — used as both the root `id` and `tc=`. */
39
+ /**
40
+ * Braced root GUID for a thread — used as both the root `id` and `tc=`.
41
+ * An id that already is a braced GUID (what Excel and both importers
42
+ * produce) passes through, so a re-exported thread keeps the identity
43
+ * Excel assigned it; anything else is hashed deterministically.
44
+ */
39
45
  private rootGuid;
40
46
  /**
41
47
  * Legacy `xl/comments{N}.xml` mirror entries. Feed these into the existing
@@ -1 +1 @@
1
- {"version":3,"file":"threaded-comments-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/threaded-comments-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAyBhE,eAAO,MAAM,yBAAyB,8EACuC,CAAC;AAC9E,eAAO,MAAM,eAAe,qEACwC,CAAC;AACrE,eAAO,MAAM,8BAA8B,kDACM,CAAC;AAClD,eAAO,MAAM,mBAAmB,wCAAwC,CAAC;AAsBzE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,MAiBhD,CAAC;AAEF;;;;GAIG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAGlB;IAEJ,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS;IAWtE,OAAO;IAIP,KAAK;CAYN;AAQD;;;;GAIG;AACH,qBAAa,yBAAyB;IAMlC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL1B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAG3C,OAAO,EAAE,aAAa,EAAE,GAAG,SAAS,EACnB,OAAO,EAAE,cAAc;IAO1C,sEAAsE;IACtE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;IAQrE,OAAO;IAIP,4EAA4E;IAC5E,OAAO,CAAC,QAAQ;IAIhB;;;;;OAKG;IACH,aAAa,IAAI;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE;IAcpE;;;;OAIG;IACH,KAAK,IAAI,MAAM,GAAG,SAAS;CA+B5B"}
1
+ {"version":3,"file":"threaded-comments-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/threaded-comments-builder.ts"],"names":[],"mappings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 32);
61
61
  return `{${p1}-${p2}-${p3}-${p4}-${p5}}`;
62
62
  };
63
+ /** `{8-4-4-4-12}` hex, the braced RFC-4122 form Excel writes for comment and person ids. */
64
+ const BRACED_GUID = /^\{[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\}$/;
65
+ export const isBracedGuid = (id) => BRACED_GUID.test(id);
63
66
  /**
64
67
  * Workbook-scoped author registry. Shared across every sheet's collector so
65
68
  * an author who comments on multiple sheets maps to a single `person` entry
@@ -118,9 +121,16 @@ export class ThreadedCommentsCollector {
118
121
  isEmpty() {
119
122
  return this.placed.length === 0;
120
123
  }
121
- /** Braced root GUID for a thread — used as both the root `id` and `tc=`. */
124
+ /**
125
+ * Braced root GUID for a thread — used as both the root `id` and `tc=`.
126
+ * An id that already is a braced GUID (what Excel and both importers
127
+ * produce) passes through, so a re-exported thread keeps the identity
128
+ * Excel assigned it; anything else is hashed deterministically.
129
+ */
122
130
  rootGuid(thread) {
123
- return deterministicGuid(`tc:${thread.id}`);
131
+ return isBracedGuid(thread.id)
132
+ ? thread.id.toUpperCase()
133
+ : deterministicGuid(`tc:${thread.id}`);
124
134
  }
125
135
  /**
126
136
  * Legacy `xl/comments{N}.xml` mirror entries. Feed these into the existing
@@ -157,7 +167,9 @@ export class ThreadedCommentsCollector {
157
167
  const personId = this.persons.register(msg.authorId, msg.authorName);
158
168
  const id = index === 0
159
169
  ? root
160
- : deterministicGuid(`c:${thread.id}:${msg.id}`);
170
+ : isBracedGuid(msg.id)
171
+ ? msg.id.toUpperCase()
172
+ : deterministicGuid(`c:${thread.id}:${msg.id}`);
161
173
  const parent = index === 0 ? "" : ` parentId="${root}"`;
162
174
  // Resolved state rides on the root as `done="1"` (MS-XLSX);
163
175
  // replies never carry it.
@@ -1,5 +1,5 @@
1
1
  import type { CellData, Citation, CommentThread, DataValidationRuleRecord, IterativeCalculationOptions, SheetData, TextFormat } from "@rowsncolumns/common-types";
2
- import type { Color, ConditionalFormatRule, EmbeddedChart, EmbeddedObject, NamedRange, PivotTable, Sheet, Slicer, SpreadsheetTheme, TableView } from "@rowsncolumns/spreadsheet";
2
+ import type { Color, ConditionalFormatRule, EmbeddedChart, EmbeddedObject, NamedRange, PivotTable, ProtectedRange, Sheet, Slicer, SpreadsheetTheme, TableView } from "@rowsncolumns/spreadsheet";
3
3
  import type { CellXfs, SharedStrings as SharedStringsType } from "@rowsncolumns/spreadsheet-state";
4
4
  import type { PowerQueryParts } from "../../power-query";
5
5
  import type { ExternalLink, WorkbookProperties } from "../../excel-parser/types";
@@ -32,6 +32,15 @@ export type ExportExcelProps<S extends Sheet, T extends CellData, C extends Cita
32
32
  pivotTables?: PivotTable[];
33
33
  externalLinks?: ExternalLink[];
34
34
  namedRanges?: NamedRange[];
35
+ /**
36
+ * Allow-edit ranges (`useSpreadsheetState`'s `protectedRanges`), written as
37
+ * `<protectedRanges>/<protectedRange sqref name>` on the sheet each range's
38
+ * `range.sheetId` names. Sheet-level protection is read from
39
+ * `Sheet.sheetProtection` and written as `<sheetProtection …>`; both sit
40
+ * right after `<sheetData>` per `CT_Worksheet`, the position the parser and
41
+ * `rnc-import` read them back from.
42
+ */
43
+ protectedRanges?: ProtectedRange[];
35
44
  /**
36
45
  * Workbook-wide named cell styles to round-trip into the
37
46
  * `<cellStyles>` block of styles.xml. Parsed by the importer as
@@ -109,7 +118,7 @@ export type ExportExcelProps<S extends Sheet, T extends CellData, C extends Cita
109
118
  */
110
119
  properties?: WorkbookProperties;
111
120
  };
112
- export declare const createExcelFile: <S extends Sheet, T extends CellData, C extends Citation>({ conditionalFormats: _conditionalFormats, dataValidations: _dataValidations, sheets, sheetData, sharedStrings: sourceSharedStrings, tables: _tables, cellXfs, theme, defaultFont, embeds, charts, slicers, pivotTables, externalLinks, namedRanges, namedCellStyles, customTableStyles, iterativeCalculationOptions, ignoreFormulaPatterns, citations, comments, password, locale, use1904, properties, powerQuery, }: ExportExcelProps<S, T, C>) => Promise<Uint8Array<ArrayBufferLike>>;
121
+ export declare const createExcelFile: <S extends Sheet, T extends CellData, C extends Citation>({ conditionalFormats: _conditionalFormats, dataValidations: _dataValidations, sheets, sheetData, sharedStrings: sourceSharedStrings, tables: _tables, cellXfs, theme, defaultFont, embeds, charts, slicers, pivotTables, externalLinks, namedRanges, protectedRanges, namedCellStyles, customTableStyles, iterativeCalculationOptions, ignoreFormulaPatterns, citations, comments, password, locale, use1904, properties, powerQuery, }: ExportExcelProps<S, T, C>) => Promise<Uint8Array<ArrayBufferLike>>;
113
122
  /**
114
123
  * Normalize a dataValidation sqref list: collapse degenerate ranges
115
124
  * (`C7:C7` → `C7`), drop exact duplicates, and drop members fully contained
@@ -1 +1 @@
1
- {"version":3,"file":"xlsx-export.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/xlsx-export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,aAAa,EAEb,wBAAwB,EAGxB,2BAA2B,EAI3B,SAAS,EACT,UAAU,EAEX,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAEV,KAAK,EACL,qBAAqB,EAErB,aAAa,EACb,cAAc,EAGd,UAAU,EACV,UAAU,EAMV,KAAK,EACL,MAAM,EACN,gBAAgB,EAChB,SAAS,EACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,OAAO,EACP,aAAa,IAAI,iBAAiB,EACnC,MAAM,iCAAiC,CAAC;AAyBzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAUzD,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AA6BlC,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,KAAK,EACf,CAAC,SAAS,QAAQ,EAClB,CAAC,SAAS,QAAQ,IAChB;IACF,MAAM,EAAE,CAAC,EAAE,CAAC;IACZ,SAAS,EAAE,SAAS,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