react-semaphor 0.1.514 → 0.1.516

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 (228) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +226 -225
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +8 -8
  7. package/dist/chunks/{calculated-field-identity-BiTGmnST.cjs → calculated-field-identity-5bg9oHTw.cjs} +1 -1
  8. package/dist/chunks/{calculated-field-identity-DnRd4YIY.js → calculated-field-identity-DzJBs2J8.js} +4 -4
  9. package/dist/chunks/{card-config-utils-B2cDWQqB.js → card-config-utils-Cxnq2R6z.js} +14 -14
  10. package/dist/chunks/{card-config-utils-CMO4_zVs.cjs → card-config-utils-z86y6tSq.cjs} +1 -1
  11. package/dist/chunks/column-bands-CU0byntA.cjs +1 -0
  12. package/dist/chunks/column-bands-RdM-kjDe.js +47 -0
  13. package/dist/chunks/{dashboard-briefing-launcher-e3s3MuSs.js → dashboard-briefing-launcher-BCEHJ_eD.js} +15 -12
  14. package/dist/chunks/{dashboard-briefing-launcher-BzPD50QD.cjs → dashboard-briefing-launcher-CjZ4aE34.cjs} +2 -2
  15. package/dist/chunks/{dashboard-controls-DAOABnks.js → dashboard-controls-DFfit5KH.js} +12 -12
  16. package/dist/chunks/{dashboard-controls-DQBfOqmC.cjs → dashboard-controls-f9aJ70Zu.cjs} +1 -1
  17. package/dist/chunks/{dashboard-date-comparison-definition-D7Bl-YAl.js → dashboard-date-comparison-definition-BqNhECUr.js} +6 -6
  18. package/dist/chunks/{dashboard-date-comparison-definition-C_w-GO_5.cjs → dashboard-date-comparison-definition-Y6JZwpcr.cjs} +1 -1
  19. package/dist/chunks/{dashboard-json-S5Eq2GAg.js → dashboard-json-DVtcA02f.js} +7 -7
  20. package/dist/chunks/{dashboard-json-1jZycd5h.cjs → dashboard-json-deqQC-UR.cjs} +1 -1
  21. package/dist/chunks/edit-dashboard-visual-DK6lSC_p.cjs +172 -0
  22. package/dist/chunks/{edit-dashboard-visual-Bkm0ciHG.js → edit-dashboard-visual-lJ6rDH3w.js} +4553 -4542
  23. package/dist/chunks/{editor-action-buttons-Bvv16QA-.js → editor-action-buttons-Bnxxa439.js} +7 -7
  24. package/dist/chunks/{editor-action-buttons-B2NCSsDw.cjs → editor-action-buttons-CmDaQbPN.cjs} +1 -1
  25. package/dist/chunks/{field-aggregations-CzuQKtqx.js → field-aggregations-Dl2A3rbV.js} +461 -358
  26. package/dist/chunks/field-aggregations-pH_3kymD.cjs +1 -0
  27. package/dist/chunks/{field-dependencies-DIab72rQ.cjs → field-dependencies-EB485TdB.cjs} +1 -1
  28. package/dist/chunks/{field-dependencies-DXW4jtvJ.js → field-dependencies-v-lJNzC7.js} +1 -1
  29. package/dist/chunks/{index-nhUr9xBz.js → index-BVVl2JDK.js} +57955 -54696
  30. package/dist/chunks/{index-CACdoqu3.js → index-C8w91oj4.js} +61 -51
  31. package/dist/chunks/index-Cw2ypaFl.cjs +1 -0
  32. package/dist/chunks/index-DfqMtR9S.cjs +4 -0
  33. package/dist/chunks/index-UNKSfi7s.cjs +1434 -0
  34. package/dist/chunks/{index-CnGVjyF8.js → index-ylOpKRDu.js} +877 -849
  35. package/dist/chunks/{matrix-analytical-definition-Ct5Tu8np.cjs → matrix-analytical-definition-BWd159lN.cjs} +1 -1
  36. package/dist/chunks/{matrix-analytical-definition-BDAK2aEi.js → matrix-analytical-definition-BimC4XIV.js} +1 -1
  37. package/dist/chunks/{matrix-card-U4c72doZ.cjs → matrix-card-C2RjEYZ8.cjs} +1 -1
  38. package/dist/chunks/{matrix-card-DOIeTmjh.js → matrix-card-CIlz0Dnp.js} +2 -2
  39. package/dist/chunks/{matrix-control-sources-FjxGIbqk.cjs → matrix-control-sources-BvEJF7d3.cjs} +1 -1
  40. package/dist/chunks/{matrix-control-sources-BxKH2yu2.js → matrix-control-sources-KbZe1gj_.js} +51 -51
  41. package/dist/chunks/{matrix-definition-CBJW_4ii.cjs → matrix-definition-DanUT11P.cjs} +1 -1
  42. package/dist/chunks/{matrix-definition-I9rHB9zN.js → matrix-definition-E5gXXSTZ.js} +1 -1
  43. package/dist/chunks/matrix-formatter-BJTO8ky9.cjs +1 -0
  44. package/dist/chunks/matrix-formatter-CCXNRt3s.js +341 -0
  45. package/dist/chunks/{matrix-member-presentation-DO1VSqfh.js → matrix-member-presentation-Bw7-JCrr.js} +64 -64
  46. package/dist/chunks/matrix-member-presentation-DvXDEo0U.cjs +1 -0
  47. package/dist/chunks/{matrix-operation-contract-DoiWTUbT.cjs → matrix-operation-contract-0RxoU_M3.cjs} +1 -1
  48. package/dist/chunks/{matrix-operation-contract-D0HfzwZg.js → matrix-operation-contract-D32U2CSw.js} +19 -19
  49. package/dist/chunks/{metric-comparison-Dqc7_tnW.js → metric-comparison-BphoJ9bq.js} +1 -1
  50. package/dist/chunks/{metric-comparison-DBQ3EJTz.cjs → metric-comparison-CUmltzpz.cjs} +1 -1
  51. package/dist/chunks/pivot-header-presentation-BSZhB1g-.js +661 -0
  52. package/dist/chunks/pivot-header-presentation-EoUS5ze5.cjs +5 -0
  53. package/dist/chunks/{pivot-result-identity-8M-bZrw9.js → pivot-result-identity-BzUQiCEV.js} +4 -4
  54. package/dist/chunks/{pivot-result-identity-uTiylUNr.cjs → pivot-result-identity-gquWljbd.cjs} +1 -1
  55. package/dist/chunks/pivot-result-lifecycle-gl9cBfB-.cjs +1 -0
  56. package/dist/chunks/{pivot-result-lifecycle-BeOpjAhg.js → pivot-result-lifecycle-kRhiJkzg.js} +208 -149
  57. package/dist/chunks/{raw-temporal-DrmCX9Wq.js → raw-temporal-BqOfk-xN.js} +471 -361
  58. package/dist/chunks/{raw-temporal-contract-CFLGwTiI.js → raw-temporal-contract-BQZIJ1fn.js} +1 -1
  59. package/dist/chunks/{raw-temporal-contract-DECbTuzA.cjs → raw-temporal-contract-CklMVG_1.cjs} +1 -1
  60. package/dist/chunks/raw-temporal-eJXecCyJ.cjs +1 -0
  61. package/dist/chunks/{report-preferences-dialog-B2fzQH1T.js → report-preferences-dialog-CHXPEl7v.js} +6 -6
  62. package/dist/chunks/{report-preferences-dialog-DcLkVqni.cjs → report-preferences-dialog-Cto0vDwI.cjs} +1 -1
  63. package/dist/chunks/{report-runtime-context-Cs65Mrxj.js → report-runtime-context-CxIoGyNM.js} +1 -1
  64. package/dist/chunks/{report-runtime-context-DzvHBPxl.cjs → report-runtime-context-CzSrCBsu.cjs} +1 -1
  65. package/dist/chunks/{selection-reducer-BIiQXbGM.js → selection-reducer-CvCBQbl2.js} +1 -1
  66. package/dist/chunks/{selection-reducer-CGKKsaPa.cjs → selection-reducer-Kl22OzIk.cjs} +1 -1
  67. package/dist/chunks/{semantic-format-BZxJLKvw.js → semantic-format-DwqGYx4V.js} +25 -31
  68. package/dist/chunks/semantic-format-mVI32OJH.cjs +1 -0
  69. package/dist/chunks/{source-entity-resolution-D7vnmDwm.js → source-entity-resolution-Bzefiive.js} +7 -7
  70. package/dist/chunks/{source-entity-resolution-CjbgnwyX.cjs → source-entity-resolution-R46X34SE.cjs} +1 -1
  71. package/dist/chunks/switch-DNbWXEOP.cjs +134 -0
  72. package/dist/chunks/{switch-QfKb0Iwe.js → switch-DNv-hVmt.js} +8260 -7659
  73. package/dist/chunks/{temporal-bucket-B9hMwemw.js → temporal-bucket-DlFuhCnT.js} +6 -6
  74. package/dist/chunks/{temporal-bucket-contract-IWDgyTMw.js → temporal-bucket-contract-DTLDRzgV.js} +1 -1
  75. package/dist/chunks/{temporal-bucket-contract-ZctiyXYk.cjs → temporal-bucket-contract-nTv6gvX5.cjs} +1 -1
  76. package/dist/chunks/{token-types-Dl0hcKBX.js → token-types-BC6RcUY8.js} +1 -1
  77. package/dist/chunks/{token-types-Ahh5u4iT.cjs → token-types-aWrzwonf.cjs} +1 -1
  78. package/dist/chunks/{update-policy-COjFudhl.cjs → update-policy-DRDLWe7Y.cjs} +1 -1
  79. package/dist/chunks/{update-policy-BeQqjupC.js → update-policy-DhAUtiC8.js} +2 -2
  80. package/dist/chunks/{validators-CkHsAvwB.js → validators-CsdOtZI6.js} +411 -397
  81. package/dist/chunks/validators-DFeDcdpA.cjs +1 -0
  82. package/dist/dashboard/index.cjs +1 -1
  83. package/dist/dashboard/index.js +1 -1
  84. package/dist/dashboard-authoring/index.cjs +3 -3
  85. package/dist/dashboard-authoring/index.js +233 -227
  86. package/dist/data-app-builder/index.cjs +1 -1
  87. package/dist/data-app-builder/index.js +3 -3
  88. package/dist/data-app-codegen/index.cjs +1 -1
  89. package/dist/data-app-codegen/index.js +2 -2
  90. package/dist/data-app-codegen-node/index.cjs +1 -1
  91. package/dist/data-app-codegen-node/index.js +3 -3
  92. package/dist/data-app-sdk/index.cjs +1 -1
  93. package/dist/data-app-sdk/index.js +5 -5
  94. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  95. package/dist/data-app-sdk-adapters/index.js +2 -2
  96. package/dist/data-app-sdk-validation/index.cjs +1 -1
  97. package/dist/data-app-sdk-validation/index.js +5 -5
  98. package/dist/format-utils/index.cjs +3 -3
  99. package/dist/format-utils/index.js +291 -397
  100. package/dist/index.cjs +1 -1
  101. package/dist/index.js +15 -15
  102. package/dist/pdf-table-layout/index.cjs +1 -0
  103. package/dist/pdf-table-layout/index.js +993 -0
  104. package/dist/report-runtime-context/index.cjs +1 -1
  105. package/dist/report-runtime-context/index.js +2 -2
  106. package/dist/style.css +1 -1
  107. package/dist/surfboard/index.cjs +1 -1
  108. package/dist/surfboard/index.js +2 -2
  109. package/dist/types/briefings/index.d.ts +1 -1
  110. package/dist/types/components/document-sheet/document-input-bar.d.ts +1 -3
  111. package/dist/types/components/document-sheet/document-insert-picker.d.ts +37 -0
  112. package/dist/types/components/document-sheet/document-kpi-section.d.ts +17 -0
  113. package/dist/types/components/document-sheet/document-matrix-layout-context.d.ts +10 -0
  114. package/dist/types/components/document-sheet/document-matrix-section.d.ts +27 -0
  115. package/dist/types/components/document-sheet/document-measure-layer.d.ts +45 -0
  116. package/dist/types/components/document-sheet/document-outline.d.ts +7 -1
  117. package/dist/types/components/document-sheet/document-page-navigation.d.ts +22 -0
  118. package/dist/types/components/document-sheet/document-page.d.ts +9 -5
  119. package/dist/types/components/document-sheet/document-panel/document-side-panel.d.ts +36 -0
  120. package/dist/types/components/document-sheet/document-panel/inputs-panel.d.ts +9 -0
  121. package/dist/types/components/document-sheet/document-panel/page-panel.d.ts +5 -0
  122. package/dist/types/components/document-sheet/document-panel/panel-controls.d.ts +14 -0
  123. package/dist/types/components/document-sheet/document-panel/region-panels.d.ts +11 -0
  124. package/dist/types/components/document-sheet/document-panel/section-panel.d.ts +25 -0
  125. package/dist/types/components/document-sheet/document-section-print-boundary.d.ts +9 -0
  126. package/dist/types/components/document-sheet/document-table-chrome.d.ts +22 -0
  127. package/dist/types/components/document-sheet/document-table-section.d.ts +3 -7
  128. package/dist/types/components/document-sheet/document-text-preview-context.d.ts +8 -0
  129. package/dist/types/components/document-sheet/use-first-fitting-variant.d.ts +18 -0
  130. package/dist/types/components/editor/editor-main/dashboard-variable-node.d.ts +12 -2
  131. package/dist/types/components/explorer/chart-configuration/matrix-authoring-controls.d.ts +7 -2
  132. package/dist/types/components/text-variables/variable-chip-plugin.d.ts +23 -0
  133. package/dist/types/components/text-variables/variable-chip.d.ts +18 -0
  134. package/dist/types/components/text-variables/variable-picker.d.ts +27 -0
  135. package/dist/types/components/visual/aggregated-table/utils/metric-format-resolver.d.ts +3 -3
  136. package/dist/types/components/visual/data-table/types/data-table.d.ts +4 -1
  137. package/dist/types/components/visual/pivot-table/utils/pivot-metric-formatting.d.ts +2 -2
  138. package/dist/types/components/visual/settings/table-presentation-settings.d.ts +27 -1
  139. package/dist/types/index.cjs +1 -1
  140. package/dist/types/index.js +5 -5
  141. package/dist/types/lib/dashboard-inputs/text-variable-options.d.ts +15 -0
  142. package/dist/types/lib/document/document-canvas-actions.d.ts +22 -0
  143. package/dist/types/lib/document/document-edits.d.ts +119 -0
  144. package/dist/types/lib/document/document-kpi-figure.d.ts +27 -0
  145. package/dist/types/lib/document/document-kpi-layout.d.ts +29 -0
  146. package/dist/types/lib/document/document-kpi-section-edits.d.ts +15 -0
  147. package/dist/types/lib/document/document-matrix-bands.d.ts +66 -0
  148. package/dist/types/lib/document/document-matrix-print.d.ts +11 -0
  149. package/dist/types/lib/document/document-pagination.d.ts +56 -3
  150. package/dist/types/lib/document/document-panel-target.d.ts +19 -0
  151. package/dist/types/lib/document/document-section-editor.d.ts +8 -7
  152. package/dist/types/lib/document/document-section-kinds.d.ts +49 -0
  153. package/dist/types/lib/document/document-section-query-options.d.ts +25 -0
  154. package/dist/types/lib/document/document-section-render-state.d.ts +26 -0
  155. package/dist/types/lib/document/document-section-utils.d.ts +11 -4
  156. package/dist/types/lib/document/document-table-dom.d.ts +4 -6
  157. package/dist/types/lib/document/document-table-pagination-model.d.ts +0 -5
  158. package/dist/types/lib/document/document-table-print-model.d.ts +4 -3
  159. package/dist/types/lib/document/document-table-style.d.ts +15 -4
  160. package/dist/types/lib/document/document-table-surface.d.ts +15 -0
  161. package/dist/types/lib/document/document-variables.d.ts +40 -6
  162. package/dist/types/lib/document/use-document-section-data.d.ts +39 -0
  163. package/dist/types/lib/document/use-measured-document-table-layout.d.ts +50 -0
  164. package/dist/types/lib/formatters/kpi-result-values.d.ts +20 -0
  165. package/dist/types/lib/formatters/metric-formatting.d.ts +3 -3
  166. package/dist/types/lib/hooks/query-context/use-dashboard-card-execution-snapshot.d.ts +8 -2
  167. package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +6 -0
  168. package/dist/types/lib/hooks/use-dashboard-kpi-actions.d.ts +1 -1
  169. package/dist/types/lib/hooks/use-document-section-editor.d.ts +2 -2
  170. package/dist/types/lib/hooks/use-document-section-session.d.ts +36 -0
  171. package/dist/types/lib/hooks/use-editor-preview.d.ts +17 -0
  172. package/dist/types/lib/hooks/use-is-editing-card.d.ts +7 -0
  173. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +2 -0
  174. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +2 -0
  175. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
  176. package/dist/types/lib/matrix-table/matrix-layout-read.d.ts +68 -0
  177. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +8 -1
  178. package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +4 -2
  179. package/dist/types/lib/query-context/card-execution.d.ts +30 -0
  180. package/dist/types/lib/query-context/document-section-card-query.d.ts +37 -0
  181. package/dist/types/lib/stores/dashboard-store.d.ts +12 -8
  182. package/dist/types/lib/stores/editor-store.d.ts +2 -0
  183. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +1 -0
  184. package/dist/types/lib/text-variables/text-variable-types.d.ts +39 -0
  185. package/dist/types/lib/types/common-types.d.ts +34 -1
  186. package/dist/types/lib/utils/card-definition.d.ts +2 -0
  187. package/dist/types/lib/utils/card-utils.d.ts +13 -6
  188. package/dist/types/lib/utils/date-timezone-utils.d.ts +26 -4
  189. package/dist/types/pdf-table-layout.d.ts +2 -0
  190. package/dist/types/shared/analytics-protocol/index.d.ts +1 -1
  191. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +45 -0
  192. package/dist/types/shared/analytics-protocol/matrix-member-presentation.d.ts +4 -0
  193. package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +56 -0
  194. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  195. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +36 -1
  196. package/dist/types/shared/format-utils/formatters/duration-formatter.d.ts +4 -1
  197. package/dist/types/shared/format-utils/formatters/index.d.ts +2 -2
  198. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -0
  199. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +8 -2
  200. package/dist/types/shared/format-utils/index.d.ts +1 -0
  201. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +690 -1
  202. package/dist/types/shared/format-utils/matrix-print.d.ts +38 -0
  203. package/dist/types/shared/format-utils/pdf-table-layout/column-bands.d.ts +55 -0
  204. package/dist/types/shared/format-utils/pdf-table-layout/index.d.ts +6 -0
  205. package/dist/types/shared/format-utils/pdf-table-layout/page-size.d.ts +7 -0
  206. package/dist/types/shared/format-utils/pdf-table-layout/table-column-semantics.d.ts +106 -0
  207. package/dist/types/shared/format-utils/pdf-table-layout/table-column-widths.d.ts +13 -0
  208. package/dist/types/shared/format-utils/pdf-table-layout/table-page-geometry.d.ts +19 -0
  209. package/dist/types/shared/format-utils/pdf-table-layout/wide-table-layout.d.ts +46 -0
  210. package/dist/types/shared/format-utils/presentation-execution.d.ts +17 -2
  211. package/dist/types/shared/format-utils/table-structure.d.ts +9 -0
  212. package/dist/types/shared/format-utils/types/format-types.d.ts +16 -1
  213. package/package.json +6 -1
  214. package/dist/chunks/edit-dashboard-visual-BwJ2Eljw.cjs +0 -172
  215. package/dist/chunks/field-aggregations-jSi77h9Z.cjs +0 -1
  216. package/dist/chunks/index-DhlVxvyI.cjs +0 -4
  217. package/dist/chunks/index-DrOFJOCq.cjs +0 -1424
  218. package/dist/chunks/index-F25jnH0p.cjs +0 -1
  219. package/dist/chunks/matrix-formatter-BLunke3R.js +0 -424
  220. package/dist/chunks/matrix-formatter-CveLJo6S.cjs +0 -1
  221. package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +0 -1
  222. package/dist/chunks/pivot-header-presentation-Cxz8-06f.cjs +0 -5
  223. package/dist/chunks/pivot-header-presentation-Dm9dUQsl.js +0 -415
  224. package/dist/chunks/pivot-result-lifecycle-BiERyXnS.cjs +0 -1
  225. package/dist/chunks/raw-temporal-BUeTpG76.cjs +0 -1
  226. package/dist/chunks/semantic-format-BzH69TRq.cjs +0 -1
  227. package/dist/chunks/switch--Re1K566.cjs +0 -134
  228. package/dist/chunks/validators-DVYAnnX0.cjs +0 -1
@@ -0,0 +1,38 @@
1
+ import { MatrixExportLayout, MatrixExportRow, MatrixPresentation } from '../analytics-protocol/index.js';
2
+ /** How a printed Matrix organizes its rows (Plan 2, 2d, C1). */
3
+ export type MatrixPrintOrganization = {
4
+ /** `tabular`: one column per row level. `outline`: one indented column. */
5
+ rowLabels: 'tabular' | 'outline';
6
+ /** Where each group's subtotal prints. */
7
+ subtotals: 'after' | 'before';
8
+ };
9
+ /** A report's organization: what a card PDF prints and a Document defaults to. */
10
+ export declare const MATRIX_PRINT_ORGANIZATION_DEFAULTS: MatrixPrintOrganization;
11
+ /**
12
+ * The presentation a Matrix prints with: its row labels and subtotal
13
+ * position. A tabular Matrix keeps its own label repetition; any other prints
14
+ * each label once. Grand totals, visibility, labels and formats are
15
+ * unchanged, so the rows and totals are the Matrix's own (E5).
16
+ */
17
+ export declare function applyMatrixPrintOrganization(presentation: MatrixPresentation, organization: MatrixPrintOrganization): MatrixPresentation;
18
+ /** Decimals a print default uses when a column has fractional values. */
19
+ export declare const MATRIX_PRINT_DEFAULT_DECIMALS = 2;
20
+ /**
21
+ * A numeric measure with no format of its own (no authored override and no
22
+ * semantic format) prints with grouping and fixed decimals: none when every
23
+ * value in the result is whole, else two. Authored and semantic formats are
24
+ * never replaced.
25
+ */
26
+ export declare function applyMatrixPrintNumberDefaults(layout: MatrixExportLayout, rows: readonly MatrixExportRow[], presentation: MatrixPresentation): MatrixPresentation;
27
+ /**
28
+ * Where a printed Matrix may break pages (Plan 2, P6): for each row, whether
29
+ * it must stay on the page of the row before it.
30
+ * - A total (subtotal or grand total) never starts a page.
31
+ * - A row that heads a group (an outline header row, or a subtotal printed
32
+ * before its group) never ends a page.
33
+ * - A group's first row is never the only row of that group at the bottom of
34
+ * a page when the group has more rows.
35
+ * A subtotal printed after its group therefore stays with the group's last
36
+ * row. The paginator decides what gives way when no allowed break fits.
37
+ */
38
+ export declare function planMatrixKeepWithPrevious(rows: readonly MatrixExportRow[]): boolean[];
@@ -0,0 +1,55 @@
1
+ /**
2
+ * A column to place: its width, and the column group it belongs to, as an
3
+ * index into the table's groups in column order. `null` marks a row-label
4
+ * column, which repeats on every band.
5
+ */
6
+ export type ColumnBandColumn = {
7
+ widthPx: number;
8
+ group: number | null;
9
+ };
10
+ /** One band: the columns it prints, in order, and the groups it covers. */
11
+ export type ColumnBand = {
12
+ /** Row-label columns first, then the band's group columns. */
13
+ columns: number[];
14
+ firstGroup: number;
15
+ lastGroup: number;
16
+ };
17
+ export type ColumnBandPlan = {
18
+ kind: 'fits';
19
+ } | {
20
+ kind: 'bands';
21
+ bands: ColumnBand[];
22
+ }
23
+ /** One group is wider than the page next to the row labels. */
24
+ | {
25
+ kind: 'too_wide';
26
+ reason: 'group';
27
+ }
28
+ /** It needs more bands than allowed. */
29
+ | {
30
+ kind: 'too_wide';
31
+ reason: 'bands';
32
+ bandCount: number;
33
+ };
34
+ /**
35
+ * Packs whole column groups, after the row-label columns, into bands no
36
+ * wider than `printableWidthPx`. A group is never split: a column member's
37
+ * measures stay together. Groups keep their order, and each band takes as
38
+ * many as fit.
39
+ */
40
+ export declare function planColumnBands({ columns, printableWidthPx, maxBands, }: {
41
+ columns: readonly ColumnBandColumn[];
42
+ printableWidthPx: number;
43
+ maxBands: number;
44
+ }): ColumnBandPlan;
45
+ /**
46
+ * A band's caption: the column level, the members it covers, and their
47
+ * positions ("Yard: Tacoma to Newark (4 to 6 of 6)"). Documents and card PDFs
48
+ * caption bands alike.
49
+ */
50
+ export declare function columnBandCaption({ groupLevelLabel, groupLabels, firstGroup, lastGroup, }: {
51
+ groupLevelLabel: string;
52
+ groupLabels: readonly string[];
53
+ firstGroup: number;
54
+ lastGroup: number;
55
+ }): string;
@@ -0,0 +1,6 @@
1
+ export * from './page-size.js';
2
+ export * from './table-page-geometry.js';
3
+ export * from './table-column-widths.js';
4
+ export * from './table-column-semantics.js';
5
+ export * from './wide-table-layout.js';
6
+ export * from './column-bands.js';
@@ -0,0 +1,7 @@
1
+ /** Page sizes Puppeteer's `page.pdf()` accepts, with its capitalization. */
2
+ export type PdfPageSize = 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6';
3
+ /**
4
+ * Normalizes a page size in any case to Puppeteer's name. An unknown size
5
+ * warns and falls back to Letter.
6
+ */
7
+ export declare function normalizePageSize(size?: string | null): PdfPageSize;
@@ -0,0 +1,106 @@
1
+ /**
2
+ * A table cell as the PDF renderer receives it: from the structured Fast PDF
3
+ * path or extracted from the rendered DOM. Every field is optional.
4
+ */
5
+ export type PdfTableCellInput = {
6
+ text?: unknown;
7
+ colspan?: number | string;
8
+ rowspan?: number | string;
9
+ className?: string;
10
+ columnId?: string | null;
11
+ isHeader?: boolean;
12
+ isNumeric?: boolean;
13
+ pdfIsNumeric?: boolean;
14
+ measuredWidthPx?: number | string | null;
15
+ [key: string]: unknown;
16
+ };
17
+ export type PdfTableRowInput = {
18
+ type?: string;
19
+ cells?: PdfTableCellInput[];
20
+ [key: string]: unknown;
21
+ };
22
+ /** A header row: its cells, or an object that carries them. */
23
+ export type PdfTableHeaderRowInput = PdfTableCellInput[] | {
24
+ cells?: PdfTableCellInput[];
25
+ [key: string]: unknown;
26
+ };
27
+ export type PdfTableColumnMeta = {
28
+ columnId?: string;
29
+ label?: unknown;
30
+ isNumeric?: boolean;
31
+ measuredWidthPx?: number;
32
+ [key: string]: unknown;
33
+ };
34
+ export type PdfTableMetadata = {
35
+ tableType?: string;
36
+ totalColumns?: number;
37
+ columns?: PdfTableColumnMeta[];
38
+ pivotLevels?: unknown;
39
+ rowLevels?: unknown;
40
+ [key: string]: unknown;
41
+ };
42
+ export type PdfTableData = {
43
+ headers?: PdfTableHeaderRowInput[];
44
+ rows?: PdfTableRowInput[];
45
+ grandTotal?: PdfTableRowInput | null;
46
+ metadata?: PdfTableMetadata;
47
+ [key: string]: unknown;
48
+ };
49
+ export type PdfTableModelOptions = {
50
+ suppressEmptyColumns?: boolean;
51
+ [key: string]: unknown;
52
+ };
53
+ /** A normalized cell. */
54
+ export type PdfTableCell = {
55
+ text: string;
56
+ colspan: number;
57
+ rowspan: number;
58
+ className: string;
59
+ columnId: string | null;
60
+ isHeader: boolean;
61
+ isNumeric?: boolean;
62
+ pdfIsNumeric?: boolean;
63
+ measuredWidthPx?: number | null;
64
+ [key: string]: unknown;
65
+ };
66
+ export type PdfTableRow = {
67
+ cells: PdfTableCell[];
68
+ [key: string]: unknown;
69
+ };
70
+ /** One column of the table model, with its resolved meaning and widths. */
71
+ export type PdfTableColumn = {
72
+ index: number;
73
+ sourceIndex: number;
74
+ columnId: string;
75
+ label: string;
76
+ type: string;
77
+ minWidthPx: number;
78
+ widthPx: number;
79
+ isNumeric: boolean;
80
+ declaredNumeric: boolean;
81
+ };
82
+ export type PdfTableProjection = {
83
+ headers: PdfTableRow[];
84
+ rows: PdfTableRow[];
85
+ grandTotal: PdfTableRow | null;
86
+ columns: PdfTableColumn[];
87
+ };
88
+ export type PdfTableModel = {
89
+ columns: PdfTableColumn[];
90
+ hiddenEmptyColumns: {
91
+ columnId: string;
92
+ label: string;
93
+ }[];
94
+ isPivotTable: boolean;
95
+ pivotAnchorCount: number;
96
+ project: (selectedModelIndices?: number[], options?: {
97
+ preserveHeaderHierarchy?: boolean;
98
+ preserveBodySpans?: boolean;
99
+ }) => PdfTableProjection;
100
+ };
101
+ /**
102
+ * Build the authoritative PDF table model once. Both structured Fast PDF and
103
+ * DOM-extracted inputs cross this same seam before fit or banded projection.
104
+ * The returned projector is the only supported way to derive render sections.
105
+ */
106
+ export declare function buildPdfTableModel(tableData?: PdfTableData, options?: PdfTableModelOptions): PdfTableModel;
@@ -0,0 +1,13 @@
1
+ export type PdfColumnType = 'boolean' | 'numeric' | 'datetime' | 'id' | 'text';
2
+ export declare function getColumnWidthBounds(type?: string): Readonly<{
3
+ min: number;
4
+ max: number;
5
+ }>;
6
+ export declare function estimateColumnWidthPx({ type, label, sampleValues, grandTotalValue, measuredWidthPx, declaredNumeric, }?: {
7
+ type?: string;
8
+ label?: unknown;
9
+ sampleValues?: unknown[];
10
+ grandTotalValue?: unknown;
11
+ measuredWidthPx?: number | string | null;
12
+ declaredNumeric?: boolean;
13
+ }): number;
@@ -0,0 +1,19 @@
1
+ /** Page margins and body padding for table PDFs. */
2
+ export declare const TABLE_PAGE_GEOMETRY: Readonly<{
3
+ marginsMm: Readonly<{
4
+ top: 8;
5
+ right: 10;
6
+ bottom: 12;
7
+ left: 10;
8
+ }>;
9
+ printBodyPaddingMm: 0;
10
+ }>;
11
+ export declare function getTablePdfMargins(): {
12
+ top: string;
13
+ right: string;
14
+ bottom: string;
15
+ left: string;
16
+ };
17
+ export declare function getTablePrintBodyPaddingCss(): string;
18
+ /** The left and right margins plus body padding, in CSS pixels. */
19
+ export declare function getTableHorizontalInsetPx(): number;
@@ -0,0 +1,46 @@
1
+ import { PdfPageSize } from './page-size.js';
2
+ import { PdfTableData, PdfTableModelOptions, PdfTableRow } from './table-column-semantics.js';
3
+ export type WideTableStrategy = 'auto' | 'fit' | 'horizontal_paginate';
4
+ export type PdfPageOrientation = 'portrait' | 'landscape';
5
+ export type WideTableLayoutOptions = PdfTableModelOptions & {
6
+ pageSize?: string;
7
+ orientation?: string;
8
+ wideTableStrategy?: string;
9
+ };
10
+ export type WideTableSectionColumn = {
11
+ columnId: string;
12
+ label: string;
13
+ widthPx: number;
14
+ isNumeric: boolean;
15
+ };
16
+ /** One printed table: the whole table, or one band of a wide one. */
17
+ export type WideTableSection = {
18
+ headers: PdfTableRow[];
19
+ rows: PdfTableRow[];
20
+ grandTotal: PdfTableRow | null;
21
+ bandLabel: string | null;
22
+ columns: WideTableSectionColumn[];
23
+ };
24
+ export type WideTableLayout = {
25
+ sections: WideTableSection[];
26
+ layoutApplied: {
27
+ requestedPageSize: PdfPageSize;
28
+ requestedOrientation: PdfPageOrientation;
29
+ effectivePageSize: PdfPageSize;
30
+ effectiveOrientation: PdfPageOrientation;
31
+ usedBanding: boolean;
32
+ bandCount: number;
33
+ totalColumns: number;
34
+ anchorColumns: string[];
35
+ autoAdjustedLayout: boolean;
36
+ strategyApplied: 'fit' | 'horizontal_paginate';
37
+ hiddenEmptyColumnCount: number;
38
+ hiddenEmptyColumns: string[];
39
+ };
40
+ };
41
+ /**
42
+ * Lays a table out on paper: it fits on the requested page, or on a wider or
43
+ * landscape page, or it prints in column bands that repeat the anchor
44
+ * (row label) columns.
45
+ */
46
+ export declare function buildWideTableLayout(tableData: PdfTableData, options?: WideTableLayoutOptions): WideTableLayout;
@@ -2,7 +2,7 @@ import { ResolvedRawTemporalFormat } from './raw-temporal.js';
2
2
  import { ReportRuntimeContext } from '../report-runtime-context/index.js';
3
3
  import { NumericPresentationTarget } from './numeric-presentation.js';
4
4
  import { ResolvedTemporalBucketFormat } from './temporal-bucket.js';
5
- import { NumericCanonicalFormat } from './types/index.js';
5
+ import { DurationCanonicalFormat, MeasureCanonicalFormat, NumericCanonicalFormat } from './types/index.js';
6
6
  export type PresentationScope = {
7
7
  dashboardId: string;
8
8
  cardId?: string;
@@ -25,6 +25,11 @@ export type ResolvedNumericPresentationEntry = {
25
25
  target: NumericPresentationTarget;
26
26
  format: NumericCanonicalFormat;
27
27
  };
28
+ export type ResolvedDurationPresentationEntry = {
29
+ scope: PresentationScope;
30
+ target: NumericPresentationTarget;
31
+ format: DurationCanonicalFormat;
32
+ };
28
33
  export type ResolvedTemporalBucketPresentationEntry = {
29
34
  scope: PresentationScope;
30
35
  target: TemporalBucketPresentationTarget;
@@ -39,7 +44,7 @@ export type ResolvedRawTemporalPresentationEntry = {
39
44
  target: RawTemporalPresentationTarget;
40
45
  format: ResolvedRawTemporalFormat;
41
46
  };
42
- export type ResolvedPresentationEntry = ResolvedNumericPresentationEntry | ResolvedTemporalBucketPresentationEntry | ResolvedRawTemporalPresentationEntry;
47
+ export type ResolvedPresentationEntry = ResolvedNumericPresentationEntry | ResolvedDurationPresentationEntry | ResolvedTemporalBucketPresentationEntry | ResolvedRawTemporalPresentationEntry;
43
48
  export type PresentationExecutionSnapshot = {
44
49
  version: 1;
45
50
  reportContext: ReportRuntimeContext;
@@ -67,6 +72,16 @@ export declare function findResolvedNumericFormat(input: {
67
72
  scope: PresentationScope;
68
73
  target: NumericPresentationTarget;
69
74
  }): NumericCanonicalFormat | undefined;
75
+ /**
76
+ * Finds the resolved numeric or duration format for a measure target. Value
77
+ * formatters use this; `findResolvedNumericFormat` is for numeric-only
78
+ * consumers such as precision and currency lookups.
79
+ */
80
+ export declare function findResolvedMeasureFormat(input: {
81
+ snapshot: PresentationExecutionSnapshot;
82
+ scope: PresentationScope;
83
+ target: NumericPresentationTarget;
84
+ }): MeasureCanonicalFormat | undefined;
70
85
  export declare function findResolvedRawTemporalFormat(input: {
71
86
  snapshot: PresentationExecutionSnapshot;
72
87
  scope: PresentationScope;
@@ -27,6 +27,8 @@ export type FastPathDataRow = {
27
27
  type?: string;
28
28
  subtotalLevel?: string | null;
29
29
  index?: number;
30
+ /** A printed Matrix row that must stay on the page of the row before (P6). */
31
+ keepWithPrevious?: boolean;
30
32
  cells: FastPathTableCell[];
31
33
  };
32
34
  export type FastPathGrandTotal = {
@@ -39,5 +41,12 @@ export type FastPathTableStructure = {
39
41
  metadata?: Record<string, unknown> & {
40
42
  columnOrder?: string[];
41
43
  columns?: FastPathColumnHint[];
44
+ /**
45
+ * A printed Matrix's column groups, which bands never split: per column,
46
+ * its group index, or `null` for a row-label column.
47
+ */
48
+ columnGroups?: readonly (number | null)[];
49
+ groupLabels?: readonly string[];
50
+ groupLevelLabel?: string;
42
51
  };
43
52
  };
@@ -51,6 +51,12 @@ export type DurationCanonicalFormat = {
51
51
  suffix?: string;
52
52
  negativeStyle?: 'minus' | 'parentheses';
53
53
  };
54
+ /**
55
+ * Formats a table measure value can resolve to: a numeric style, or a
56
+ * duration rendered from a numeric amount of `inputUnit`. Every surface that
57
+ * renders a measure value (table cells, totals, exports) must accept both.
58
+ */
59
+ export type MeasureCanonicalFormat = NumericCanonicalFormat | DurationCanonicalFormat;
54
60
  export type StringCanonicalFormat = {
55
61
  type: 'string';
56
62
  prefix?: string;
@@ -58,6 +64,7 @@ export type StringCanonicalFormat = {
58
64
  };
59
65
  export type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | RawTemporalFormat | DurationCanonicalFormat | StringCanonicalFormat | TemporalBucketFormat;
60
66
  export declare function isNumericCanonicalFormat(format: unknown): format is NumericCanonicalFormat;
67
+ export declare function isMeasureCanonicalFormat(format: unknown): format is MeasureCanonicalFormat;
61
68
  export interface NumberFormatOptions {
62
69
  style: 'decimal' | 'currency' | 'percent' | 'scientific';
63
70
  locale?: string;
@@ -113,18 +120,26 @@ export interface DateFormatOptions {
113
120
  /** Locale for date formatting */
114
121
  locale?: string;
115
122
  }
123
+ export type ColumnNumberStyle = 'decimal' | 'currency' | 'percent' | 'scientific' | 'duration';
124
+ /** Duration options on a table column (`numberFormat.style: 'duration'`). */
125
+ export type ColumnDurationFormat = Pick<DurationCanonicalFormat, 'inputUnit' | 'outputStyle' | 'largestUnit' | 'smallestUnit' | 'maxUnits'>;
116
126
  export interface ColumnSettings {
117
127
  type: 'none' | 'text' | 'number' | 'date' | 'badge' | 'link' | 'progress';
118
128
  textAlign?: 'left' | 'center' | 'right';
119
129
  width?: number;
120
130
  numberFormat?: {
121
- style: 'decimal' | 'currency' | 'percent' | 'scientific';
131
+ style: ColumnNumberStyle;
122
132
  currency?: string;
123
133
  locale?: string;
124
134
  minimumFractionDigits?: number;
125
135
  maximumFractionDigits?: number;
126
136
  useGrouping?: boolean;
127
137
  percentValueMode?: 'fraction' | 'whole';
138
+ prefix?: string;
139
+ suffix?: string;
140
+ negativeStyle?: 'minus' | 'parentheses';
141
+ /** Duration options; read only when `style` is `duration`. */
142
+ duration?: ColumnDurationFormat;
128
143
  showDataBar?: boolean;
129
144
  dataBarColor?: string;
130
145
  dataBarMinValue?: number;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.514",
8
+ "version": "0.1.516",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -132,6 +132,11 @@
132
132
  "import": "./dist/pdf-export-policy/index.js",
133
133
  "require": "./dist/pdf-export-policy/index.cjs"
134
134
  },
135
+ "./format-utils/pdf-table-layout": {
136
+ "types": "./dist/types/pdf-table-layout.d.ts",
137
+ "import": "./dist/pdf-table-layout/index.js",
138
+ "require": "./dist/pdf-table-layout/index.cjs"
139
+ },
135
140
  "./value-format-preferences": {
136
141
  "types": "./dist/types/value-format-preferences.d.ts",
137
142
  "import": "./dist/value-format-preferences/index.js",