@bino-bi/bn-template-engine 1.0.0-next.39 → 1.0.0-next.41

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 (93) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-2dd69cb9.entry.js +1 -0
  3. package/dist/bn-template-engine/{p-9a61f59d.entry.js → p-8b28c9bd.entry.js} +1 -1
  4. package/dist/bn-template-engine/{p-DyupX-Z-.js → p-BjozxTTW.js} +1 -1
  5. package/dist/bn-template-engine/p-EcC0qLtU.js +1 -0
  6. package/dist/bn-template-engine/{p-eea538f1.entry.js → p-a4b76176.entry.js} +1 -1
  7. package/dist/bn-template-engine/{p-93b8387f.entry.js → p-ce764078.entry.js} +1 -1
  8. package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +785 -378
  9. package/dist/cjs/bn-grid.cjs.entry.js +1 -1
  10. package/dist/cjs/bn-image.cjs.entry.js +1 -1
  11. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  12. package/dist/cjs/bn-text.cjs.entry.js +2 -2
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/{withStyled-DfE0aW7D.js → withStyled-BZb6snOx.js} +74 -0
  15. package/dist/cjs/{withTranslation-0gkn9xoC.js → withTranslation-FxXGUB3H.js} +1 -1
  16. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +4 -1
  17. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +3 -1
  18. package/dist/collection/components/bn-chart-time/utils/elements/Label.js +3 -1
  19. package/dist/collection/components/bn-table/bn-table-renderer/bn-table-renderer.css +25 -1
  20. package/dist/collection/components/bn-table/bn-table-renderer/bn-table-renderer.js +156 -11
  21. package/dist/collection/components/bn-table/bn-table.js +134 -5
  22. package/dist/collection/components/bn-table/utils/elements/Cell.js +10 -1
  23. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +25 -10
  24. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +50 -12
  25. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +44 -14
  26. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +63 -2
  27. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +123 -11
  28. package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +57 -9
  29. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +16 -1
  30. package/dist/collection/components/bn-table/utils/model/index.js +6 -0
  31. package/dist/collection/utils/validate.js +4 -0
  32. package/dist/components/bn-chart-bubble-renderer.js +1 -1
  33. package/dist/components/bn-chart-bubble.js +1 -1
  34. package/dist/components/bn-chart-bullet.js +1 -1
  35. package/dist/components/bn-chart-scatter-renderer.js +1 -1
  36. package/dist/components/bn-chart-scatter.js +1 -1
  37. package/dist/components/bn-chart-structure-renderer.js +1 -1
  38. package/dist/components/bn-chart-structure.js +1 -1
  39. package/dist/components/bn-chart-time-renderer.js +1 -1
  40. package/dist/components/bn-chart-time.js +1 -1
  41. package/dist/components/bn-grid.js +1 -1
  42. package/dist/components/bn-image.js +1 -1
  43. package/dist/components/bn-layout-card.js +1 -1
  44. package/dist/components/bn-layout-page.js +1 -1
  45. package/dist/components/bn-page.js +1 -1
  46. package/dist/components/bn-table-renderer.js +1 -1
  47. package/dist/components/bn-table.js +1 -1
  48. package/dist/components/bn-text.js +1 -1
  49. package/dist/components/bn-title.js +1 -1
  50. package/dist/components/bn-tree.js +1 -1
  51. package/dist/components/p-1B_s8oPY.js +1 -0
  52. package/dist/components/{p-BqUB56k1.js → p-B4L069XF.js} +1 -1
  53. package/dist/components/p-BZXiWkDS.js +1 -0
  54. package/dist/components/p-BiSytXUy.js +1 -0
  55. package/dist/components/p-Bn7J1pgl.js +1 -0
  56. package/dist/components/{p-BmOWXYHF.js → p-CEf5X8MZ.js} +1 -1
  57. package/dist/components/p-CGySoYRH.js +1 -0
  58. package/dist/components/{p-Cyf5ZEXs.js → p-CUSAlS2o.js} +1 -1
  59. package/dist/components/p-CvEdUq8i.js +1 -0
  60. package/dist/components/{p-OquycEMA.js → p-D40Am1Ap.js} +1 -1
  61. package/dist/components/{p-B4Cf0cVi.js → p-DM4Up10X.js} +1 -1
  62. package/dist/components/{p-Bo_R7f_T.js → p-DwuXVo2h.js} +1 -1
  63. package/dist/components/{p-DTmqMQpw.js → p-Y9bth2Y_.js} +1 -1
  64. package/dist/components/{p-BU_53KVT.js → p-xIWChKGS.js} +1 -1
  65. package/dist/esm/bn-annotation-layer_30.entry.js +903 -496
  66. package/dist/esm/bn-grid.entry.js +1 -1
  67. package/dist/esm/bn-image.entry.js +1 -1
  68. package/dist/esm/bn-template-engine.js +1 -1
  69. package/dist/esm/bn-text.entry.js +2 -2
  70. package/dist/esm/loader.js +1 -1
  71. package/dist/esm/{withStyled-CIoJ86RM.js → withStyled-CzzXg64f.js} +77 -4
  72. package/dist/esm/{withTranslation-BX9T3dfm.js → withTranslation-Daq2JXkv.js} +1 -1
  73. package/dist/types/components/bn-table/bn-table-renderer/bn-table-renderer.d.ts +20 -1
  74. package/dist/types/components/bn-table/bn-table.d.ts +49 -1
  75. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +3 -0
  76. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +26 -0
  77. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +22 -2
  78. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +13 -0
  79. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +30 -2
  80. package/dist/types/components/bn-table/utils/helper/barColumnGeometry.d.ts +24 -4
  81. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +7 -1
  82. package/dist/types/components/bn-table/utils/model/index.d.ts +5 -0
  83. package/dist/types/components.d.ts +49 -4
  84. package/dist/types/utils/validate.d.ts +1 -0
  85. package/package.json +1 -1
  86. package/dist/bn-template-engine/p-8c84d57e.entry.js +0 -1
  87. package/dist/bn-template-engine/p-BVU4bIsi.js +0 -1
  88. package/dist/components/p-BsJOvfIg.js +0 -1
  89. package/dist/components/p-DCPLGEs_.js +0 -1
  90. package/dist/components/p-DT04Cka0.js +0 -1
  91. package/dist/components/p-Dm6EAaJ9.js +0 -1
  92. package/dist/components/p-dRPJiQB6.js +0 -1
  93. package/dist/components/p-tkB96Ena.js +0 -1
@@ -1,9 +1,22 @@
1
1
  import { FunctionalComponent } from "../../../../stencil-public-runtime";
2
2
  import { CellBarChartProps } from "./CellBarChart";
3
- import { WaterfallBarData } from "../helper/WaterfallCalculator";
3
+ import { WaterfallBarData, WaterfallRowKind } from "../helper/WaterfallCalculator";
4
+ import { WaterfallGeometry } from "../helper/barColumnGeometry";
4
5
  export interface WaterfallBarProps extends CellBarChartProps {
5
6
  waterfall: WaterfallBarData;
7
+ /** Column geometry from the measured labels of all rows; without it the fixed gutters count. */
8
+ geometry?: WaterfallGeometry;
9
+ /** How far the connectors and the variance axis run out of the svg to meet the row above and below, in px. */
10
+ connectorReach?: {
11
+ top: number;
12
+ bottom: number;
13
+ };
6
14
  }
15
+ /**
16
+ * Label text of a waterfall bar. Scenario values carry no variance sentiment: unsigned per
17
+ * IBCS. A variance keeps its sign (`signed`).
18
+ */
19
+ export declare function waterfallLabelText(value: number, kind: WaterfallRowKind, measureScale: number | undefined, locale: string | undefined, decimalDigits: number | undefined, signed?: boolean): string;
7
20
  /**
8
21
  * Renders one row of an IBCS waterfall for a scenario bar column.
9
22
  *
@@ -16,6 +29,13 @@ export interface WaterfallBarProps extends CellBarChartProps {
16
29
  * Layout: [left label area][bar area][right label area]
17
30
  * The value label sits at the bar's free end (right of rightward bars,
18
31
  * left of leftward bars). thereof/partof rows additionally get dashed
19
- * guides marking their parent bar's extent.
32
+ * guides marking their parent bar's extent. A guide or axis line that would
33
+ * run through the label is left out in that row.
34
+ *
35
+ * An absolute variance column is drawn as a variance waterfall: the bar in the color of
36
+ * the sentiment and the pattern of the minuend, the axis in the look of the reference
37
+ * scenario in every row, a signed label, and thin connectors to the rows above and below
38
+ * in place of the dashed guides. The axis and the connectors join the rows, so where one
39
+ * meets the label it is only interrupted over the height of the text.
20
40
  */
21
41
  export declare const WaterfallBar: FunctionalComponent<WaterfallBarProps>;
@@ -67,6 +67,19 @@ export declare class DataQuery {
67
67
  /** Generates a GROUPHEAD row used as a visual header when row grouping is active. */
68
68
  private createGroupHeaderRow;
69
69
  private hasGroupSum;
70
+ /**
71
+ * True when the group sum rows are running results: only a grouped table with group sum
72
+ * rows has them. Column drill values of the group sum rows are not accumulated, so
73
+ * `runningSum` is off with columnthereof.
74
+ */
75
+ hasRunningSum(): boolean;
76
+ /**
77
+ * Turns the GROUP_SUM rows into running results: each one gets the raw aliases of all
78
+ * group sums before it added (scenarios, `_cnt`, variances and `dr_*` denominators).
79
+ * Runs before the NaN step and the relative variance division, where all of them are sums.
80
+ * A missing value stays missing until a group brings a real one.
81
+ */
82
+ private accumulateGroupSums;
70
83
  /** Generates a GROUP_SUM row that aggregates all entries within a single row group. */
71
84
  private createGroupSumRow;
72
85
  /** Generates a total SUM row across all groups (only for SUM / OPT table types). */
@@ -8,6 +8,14 @@ import { DataQueryResultRow } from "../../../../utils/model/DataQueryResultRow";
8
8
  * - `partof`: drill row decomposing its parent bar (fractional shares)
9
9
  */
10
10
  export type WaterfallRowKind = "cascade" | "anchor" | "thereof" | "partof";
11
+ /**
12
+ * Connector line of a variance waterfall at a value coordinate: from the row top to the
13
+ * bar, from the bar to the row bottom, or through the whole row.
14
+ */
15
+ export interface WaterfallConnector {
16
+ at: number;
17
+ part: "top" | "bottom" | "through";
18
+ }
11
19
  /** Waterfall bar geometry for a single cell, all coordinates in value units. */
12
20
  export interface WaterfallBarData {
13
21
  /** Coordinate where the bar begins. */
@@ -23,6 +31,8 @@ export interface WaterfallBarData {
23
31
  parentStart?: number;
24
32
  /** Parent bar end, only set for thereof/partof rows (dashed extent guides). */
25
33
  parentEnd?: number;
34
+ /** Lines that join this bar to the bars of the rows printed above and below; variance columns only. */
35
+ connectors?: WaterfallConnector[];
26
36
  }
27
37
  /**
28
38
  * Waterfall geometry per raw result row and column, keyed by row identity
@@ -30,16 +40,25 @@ export interface WaterfallBarData {
30
40
  */
31
41
  export declare class WaterfallResult {
32
42
  private readonly geometry;
43
+ private readonly columns;
33
44
  set(row: DataQueryResultRow, column: string, data: WaterfallBarData): void;
34
45
  get(row: DataQueryResultRow, column: string): WaterfallBarData | undefined;
46
+ /** True when the column has waterfall bars, also for a row of it that got none. */
47
+ has(column: string): boolean;
35
48
  }
36
49
  /** True when the result contains grouping structure (sum, subtotal, or drill rows). */
37
50
  export declare function hasGroupingStructure(queryData: DataQueryResultRow[][]): boolean;
51
+ /**
52
+ * Alias of the signed sum of a bar column on the generated REST row of an OPT table. The
53
+ * row prints the unsigned sum of the rows it folds, the walk needs the signed one.
54
+ */
55
+ export declare function restSignedAlias(column: string): string;
38
56
  /**
39
57
  * Computes waterfall bar geometry for the given scenario columns by walking the
40
58
  * segmented query result once per column in display order.
41
59
  *
42
60
  * - ENTRY rows (incl. REST) cascade from the running total by their signed value.
61
+ * The REST row of an OPT table takes the sign of `restOperation`, or its signed sum.
43
62
  * - SUM / GROUP_SUM rows anchor at zero. A SUM row resets the running total to its
44
63
  * value, a GROUP_SUM row resets it to zero.
45
64
  * - DRILLELEMENT (thereof) rows form a sub-cascade from their parent bar's start in
@@ -49,10 +68,19 @@ export declare function hasGroupingStructure(queryData: DataQueryResultRow[][]):
49
68
  * `createPartOfDrillRows`, not literally the parent row's value.
50
69
  * - GROUPHEAD rows get no bar and restart the running total at zero: every row group
51
70
  * is its own cascade that ends at its GROUP_SUM.
71
+ * - With `runningSum` a GROUP_SUM row holds the result of all groups so far, so the
72
+ * cascade goes on from its value and no GROUPHEAD restarts it.
52
73
  * - NaN rows get no bar; a NaN parent orphans its drill children.
53
74
  *
75
+ * An absolute variance column walks the same way with three differences: a thereof row
76
+ * steps by its signed value times the operation sign of its parent, so its siblings can
77
+ * go both ways and leave the parent bar; a partof row gets no bar; and the bars carry
78
+ * connectors to the rows printed above and below.
79
+ *
54
80
  * @param queryData - Segmented result rows from DataQuery.execute().
55
- * @param columns - Plain scenario column keys (ac1..pl4); no `##` composite keys.
81
+ * @param columns - Plain scenario (ac1..pl4) or absolute variance column keys; no `##` composite keys.
56
82
  * @param tableType - Table aggregation mode, needed for OPT sign handling.
83
+ * @param runningSum - True when the GROUP_SUM rows are running results.
84
+ * @param thereofAbove - True when thereof rows are printed above their parent; only the connectors depend on it.
57
85
  */
58
- export declare function computeWaterfall(queryData: DataQueryResultRow[][], columns: string[], tableType: TableType): WaterfallResult;
86
+ export declare function computeWaterfall(queryData: DataQueryResultRow[][], columns: string[], tableType: TableType, runningSum?: boolean, thereofAbove?: boolean): WaterfallResult;
@@ -24,7 +24,7 @@ export declare function estimateLabelWidth(text: string, fontSize: number): numb
24
24
  * Rendered width of a value label in px, measured with the font the SVG text uses. Falls
25
25
  * back to estimateLabelWidth where no canvas can measure.
26
26
  */
27
- export declare function labelWidth(text: string, fontSize: number, fontFamily: string, italic: boolean): number;
27
+ export declare function labelWidth(text: string, fontSize: number, fontFamily: string, italic: boolean, bold?: boolean): number;
28
28
  /** Widest value label in px per side of the axis; a side without drawn values is undefined. */
29
29
  export interface SideLabels {
30
30
  neg?: number;
@@ -75,9 +75,29 @@ export interface RelativePinGeometry {
75
75
  export declare function relativePinGeometry(widthEm: number, emPx: number, labels: SideLabels, headSize: number, reach?: SideLabels): RelativePinGeometry;
76
76
  export interface WaterfallGeometry {
77
77
  totalWidth: number;
78
- /** One gutter on each side; a waterfall always spans its full range. */
79
- labelAreaWidth: number;
78
+ /** Label room left of the bar area. */
79
+ labelAreaLeft: number;
80
+ /** Label room right of the bar area. */
81
+ labelAreaRight: number;
80
82
  barAreaWidth: number;
81
83
  labelGap: number;
82
84
  }
83
- export declare function waterfallGeometry(widthEm: number, emPx: number): WaterfallGeometry;
85
+ /** One drawn waterfall label: the bar end it sits at (value units), its side and its width in px. */
86
+ export interface WaterfallLabel {
87
+ end: number;
88
+ pointsLeft: boolean;
89
+ width: number;
90
+ }
91
+ /** The labels of a waterfall column and the value extent all its rows share. */
92
+ export interface WaterfallColumnLabels {
93
+ min: number;
94
+ max: number;
95
+ labels: WaterfallLabel[];
96
+ }
97
+ /**
98
+ * Without `column` both sides get the fixed gutter. With it each side gets the room its
99
+ * labels need beyond the bar area at the scale of the bars. The bar area keeps at least
100
+ * half the width: only gutters that need more shrink, and a side that fits the fixed
101
+ * gutter keeps its room then.
102
+ */
103
+ export declare function waterfallGeometry(widthEm: number, emPx: number, column?: WaterfallColumnLabels): WaterfallGeometry;
@@ -4,7 +4,7 @@ import { IAdapter } from "../../../../utils/helper/IAdapter";
4
4
  import { StringAdapter } from "../../../../utils/helper/StringAdapter";
5
5
  import { OrderAdapter } from "../../../../utils/model/Order";
6
6
  import { SiPrefix } from "../../../../utils/model/SiPrefix";
7
- import { TableType } from "./index";
7
+ import { TableType, ThereofPosition } from "./index";
8
8
  import { TableAttribute } from "./TableAttribute";
9
9
  import { TableDrillGroup, TableDrillGroupAdapter } from "./TableDrillGroup";
10
10
  import { AlaSQLDatabase } from "../../../../context/scopedDb";
@@ -31,8 +31,14 @@ export declare class TableComponentConfig {
31
31
  /** When true, rows are visually grouped by rowGroup. */
32
32
  grouped: boolean;
33
33
  showGroupTitle: boolean;
34
+ /** When true, each group sum row holds the running result of all groups up to its own (see bn-table `runningSum` prop). */
35
+ runningSum: boolean;
36
+ /** When true, absolute variance bar columns are drawn as a waterfall (see bn-table `varianceWaterfall` prop). */
37
+ varianceWaterfall: boolean;
34
38
  /** Drill-down sub-row definitions -- "thereof" breakdowns within a category. */
35
39
  thereOf: TableDrillGroup[];
40
+ /** Thereof rows below or above their parent row (see bn-table `thereofPosition` prop). */
41
+ thereOfPosition: ThereofPosition;
36
42
  /** Column-level drill-down using `##` separator in category names. */
37
43
  categoryThereOf: Map<string, Record<string, unknown>[]>;
38
44
  /** Percentage-of-total sub-row definitions. */
@@ -52,6 +52,11 @@ export declare enum TableType {
52
52
  OPT = "opt",
53
53
  OPTNOTOTAL = "optnototal"
54
54
  }
55
+ /** Where thereof rows stand: below their parent row, or above it like the components of a subtotal. */
56
+ export declare enum ThereofPosition {
57
+ BELOW = "below",
58
+ ABOVE = "above"
59
+ }
55
60
  export declare enum OrderDirection {
56
61
  ASC = "asc",
57
62
  DESC = "desc"
@@ -25,8 +25,8 @@ import { DateDistance } from "./utils/DateStringFactory";
25
25
  import { StackConfigParsed as StackConfigParsed1 } from "./components/bn-chart-time/utils/model/TimeChartComponentConfig";
26
26
  import { TableLayoutDetail } from "./components/bn-table/bn-table-renderer/bn-table-renderer";
27
27
  import { TableDrillGroup } from "./components/bn-table/utils/model/TableDrillGroup";
28
+ import { TableType, ThereofPosition } from "./components/bn-table/utils/model";
28
29
  import { TableAttribute } from "./components/bn-table/utils/model/TableAttribute";
29
- import { TableType } from "./components/bn-table/utils/model";
30
30
  import { TableLayoutDetail as TableLayoutDetail1 } from "./components/bn-table/bn-table-renderer/bn-table-renderer";
31
31
  import { TableRow } from "./components/bn-table/utils/elements";
32
32
  import { Element } from "./stencil-public-runtime";
@@ -54,8 +54,8 @@ export { DateDistance } from "./utils/DateStringFactory";
54
54
  export { StackConfigParsed as StackConfigParsed1 } from "./components/bn-chart-time/utils/model/TimeChartComponentConfig";
55
55
  export { TableLayoutDetail } from "./components/bn-table/bn-table-renderer/bn-table-renderer";
56
56
  export { TableDrillGroup } from "./components/bn-table/utils/model/TableDrillGroup";
57
+ export { TableType, ThereofPosition } from "./components/bn-table/utils/model";
57
58
  export { TableAttribute } from "./components/bn-table/utils/model/TableAttribute";
58
- export { TableType } from "./components/bn-table/utils/model";
59
59
  export { TableLayoutDetail as TableLayoutDetail1 } from "./components/bn-table/bn-table-renderer/bn-table-renderer";
60
60
  export { TableRow } from "./components/bn-table/utils/elements";
61
61
  export { Element } from "./stencil-public-runtime";
@@ -1789,6 +1789,11 @@ export namespace Components {
1789
1789
  * Name of a registered IBCS rule set (see `bn-ruleset`) used for scenario ordering, look and names. Supports `"inherited-closest"` / `"inherited-page"` to take over the value from an ancestor `bn-layout-card` / `bn-layout-page`.
1790
1790
  */
1791
1791
  "ruleset"?: string;
1792
+ /**
1793
+ * Turns the sum row of each (row-)group into a running result: the sum of all rows from the first group down to its own group, with the matching absolute and relative variances. Use it for a calculation scheme such as an income statement, where each `rowGroup` ends in a result. <br /><br /> Needs `grouped` and a type with group sums (```sum // opt // sumnototal // optnototal```). The total row of ```sum``` and ```opt``` stays and repeats the last running result, so ```sumnototal``` or ```optnototal``` is the usual choice. `partof` shares still refer to the sum of their own group. Not supported together with `columnthereof`: there it has no effect. <br /><br /> values: <br /> ```true // false```
1794
+ * @default false
1795
+ */
1796
+ "runningSum": boolean;
1792
1797
  /**
1793
1798
  * Controls proportional scaling of the entire table relative to the available parent width. All visual dimensions scale together: font size, em-based spacing/padding, SVG bar-chart widths, pin lengths, dot radii, pattern fills, axis strokes, and label offsets. Scaling is driven by a single factor applied to the base font size (`global.fontSizePx` from the component-style store, default 13.3333 px). Because the table's SCSS uses `em` units for padding, borders, and column widths, changing the font size cascades to all layout dimensions. SVG elements (bars, pins, patterns) receive the factor via the `scaleFactor` prop on `bn-table-renderer` and multiply every pixel constant by it, so they stay proportional to the surrounding text. | Value | Behavior | |---------------------|----------------------------------------------------------------------------------| | not set / `""` | Auto-scale to fit parent width; emit `AUTO_scale` warning with the applied factor | | `"none"` | No scaling (render at base font size regardless of available space) | | `"auto"` | Auto-scale to fit parent width silently (no warning) | | `"0.5"`, `"1.2"`, … | Fixed factor - apply `baseFontSize × factor` | **Auto-scale algorithm** (modes `""` and `"auto"`): 1. After each render, the current `scrollWidth` of the host element is divided by the current `appliedScaleFactor` to derive the unscaled content width. This avoids resetting `--bn-font-size` to base (which would only affect em-based widths but not SVG pixel attributes). 2. This unscaled width is compared against the parent's content-box width (via `getParentDimensions`). 3. If the table overflows, `factor = parentWidth / unscaledWidth` is computed and applied to both the CSS variable and the `appliedScaleFactor` state (which re-renders the SVG charts). 4. A guard flag (`_autoScaleGuard`) prevents the subsequent state-triggered re-render from re-measuring, avoiding an infinite measure → scale → fits → reset → overflow loop. Invalid values (negative numbers, non-numeric strings that are not `"none"` or `"auto"`) fall back to the default behaviour (auto + warning) and emit an `WARN_scale` warning. **Only the width is fitted.** A table that renders taller than its constrained parent is clipped by the layout cell - bottom rows and the grand total simply disappear - so every render reports the measured overflow in `has-error`: as the error `ERR_overflow` when the size is pinned by `scale` (`"none"` or a factor), as the warning `WARN_overflow` in auto mode. The same item reports a width overflow, which only a fixed `scale` can produce. Setting `scale="auto"` does not fix a height overflow: give the component more space, reduce rows (`limit`), or set a smaller fixed `scale`.
1794
1799
  * @example // Auto-scale to parent (silent) <bn-table scale="auto" ...></bn-table> // Fixed 50 % reduction <bn-table scale="0.5" ...></bn-table> // Double size <bn-table scale="2" ...></bn-table> // No scaling - always render at base font size <bn-table scale="none" ...></bn-table>
@@ -1827,18 +1832,28 @@ export namespace Components {
1827
1832
  * @default "[]"
1828
1833
  */
1829
1834
  "thereof": string;
1835
+ /**
1836
+ * Position of the `thereof` rows relative to their parent row. <br /><br /> ```below``` (default) prints them below the parent, small and italic, with the thereof label. ```above``` prints them before the parent in normal size with an indented label, and the parent row looks like a subtotal (bold, with a line above it). The parent keeps its operation sign and its value, so a parent of `-` rows reads like "- Operating expenses". With ```above``` list all subcategories of the parent (`"subCategory": ""`): with only some of them the parent looks like a subtotal that does not add up. <br /><br /> values: <br /> ```below // above```
1837
+ * @default "below"
1838
+ */
1839
+ "thereofPosition": string;
1830
1840
  /**
1831
1841
  * Set the table type <br /><br /> values: <br /> ```list // sum // opt // sumnototal // optnototal```
1832
1842
  * @default "list"
1833
1843
  */
1834
1844
  "type": string;
1835
1845
  /**
1836
- * Data units displayed per 1 em of bar length for absolute variance bar charts (ΔPY) - map-scale semantics: a larger value means smaller bars. Bars exceeding barColumnWidth are shown with an arrow indicator. | Value | Behavior | |------------------|----------------------------------------------------------------| | `"auto"` | Auto-fit the largest bar to the bar column width | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | | invalid / unknown | Auto-fit + `AUTO_unitScaling` warning | Default: `"100"` (1 em of bar represents 100 units)
1846
+ * Data units displayed per 1 em of bar length for absolute variance bar charts (ΔPY) - map-scale semantics: a larger value means smaller bars. Bars exceeding barColumnWidth are cut with a zigzag break. | Value | Behavior | |------------------|----------------------------------------------------------------| | `"auto"` | Auto-fit the largest bar to the bar column width | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | | invalid / unknown | Auto-fit + `AUTO_unitScaling` warning | Default: `"100"` (1 em of bar represents 100 units)
1837
1847
  * @example unit-scaling="1M"
1838
1848
  * @example unit-scaling="revenue-scale"
1839
1849
  * @default "100"
1840
1850
  */
1841
1851
  "unitScaling": string | number;
1852
+ /**
1853
+ * Draws every absolute variance column (d_*) listed in ```barColumns``` as a variance waterfall down the rows instead of single bars from the axis. A row starts where the row above ended; on ```opt``` and ```optnototal``` tables a "-" row with a positive variance moves to the left. Sum rows are bars from the axis. Thin lines join the bars. Each row group starts at the axis again, with ```runningSum``` the walk goes on from the sum row. The column scales to fit the whole walk (unit-scaling does not apply). Relative variance columns (dr_*) stay pins. Has no effect together with ```interval``` or ```columnthereof```. <br /><br /> values: <br /> ```true // false```
1854
+ * @default false
1855
+ */
1856
+ "varianceWaterfall": boolean;
1842
1857
  /**
1843
1858
  * <br /> <br /> List of Variances The additonal variances which are calculated form the given scenarios. the scenarios used in the variances have also be defined in the *scenarios* property. <br /> <br /> the variance is defiend as (Scenario A - ScenarioB) neu. neg and pos post fix defines which value is *good* a negative or a positive value. op follows the row operation: in an opt/optnototal table a "-" row acts like neg, "+" and sum rows act like pos (a rising cost is red). opinv is the inverse of op. In other table types op acts like pos. <br /> <br /> if empty variance charts are hidden <br /> <br /> each variance creates a chart <br /> <br /> pattern:<br /> ```d<scenarioB>_<scenarioA>_[pos/neg/neu/op/opinv]```
1844
1859
  */
@@ -1948,6 +1963,10 @@ export namespace Components {
1948
1963
  */
1949
1964
  "reportAutoScaling"?: (report: AutoScalingReport) => void;
1950
1965
  "ruleSetConfig"?: RuleSetConfig;
1966
+ /**
1967
+ * @default false
1968
+ */
1969
+ "runningSum": boolean;
1951
1970
  /**
1952
1971
  * @default 1
1953
1972
  */
@@ -1986,6 +2005,10 @@ export namespace Components {
1986
2005
  * @default []
1987
2006
  */
1988
2007
  "thereof": TableDrillGroup[];
2008
+ /**
2009
+ * @default ThereofPosition.BELOW
2010
+ */
2011
+ "thereofPosition": ThereofPosition;
1989
2012
  /**
1990
2013
  * @default TableType.LIST
1991
2014
  */
@@ -1994,6 +2017,10 @@ export namespace Components {
1994
2017
  * @default 0.01
1995
2018
  */
1996
2019
  "unitScaling": number;
2020
+ /**
2021
+ * @default false
2022
+ */
2023
+ "varianceWaterfall": boolean;
1997
2024
  }
1998
2025
  /**
1999
2026
  * Renders a text block from a template with dataset and translation
@@ -3857,6 +3884,11 @@ declare namespace LocalJSX {
3857
3884
  * Name of a registered IBCS rule set (see `bn-ruleset`) used for scenario ordering, look and names. Supports `"inherited-closest"` / `"inherited-page"` to take over the value from an ancestor `bn-layout-card` / `bn-layout-page`.
3858
3885
  */
3859
3886
  "ruleset"?: string;
3887
+ /**
3888
+ * Turns the sum row of each (row-)group into a running result: the sum of all rows from the first group down to its own group, with the matching absolute and relative variances. Use it for a calculation scheme such as an income statement, where each `rowGroup` ends in a result. <br /><br /> Needs `grouped` and a type with group sums (```sum // opt // sumnototal // optnototal```). The total row of ```sum``` and ```opt``` stays and repeats the last running result, so ```sumnototal``` or ```optnototal``` is the usual choice. `partof` shares still refer to the sum of their own group. Not supported together with `columnthereof`: there it has no effect. <br /><br /> values: <br /> ```true // false```
3889
+ * @default false
3890
+ */
3891
+ "runningSum"?: boolean;
3860
3892
  /**
3861
3893
  * Controls proportional scaling of the entire table relative to the available parent width. All visual dimensions scale together: font size, em-based spacing/padding, SVG bar-chart widths, pin lengths, dot radii, pattern fills, axis strokes, and label offsets. Scaling is driven by a single factor applied to the base font size (`global.fontSizePx` from the component-style store, default 13.3333 px). Because the table's SCSS uses `em` units for padding, borders, and column widths, changing the font size cascades to all layout dimensions. SVG elements (bars, pins, patterns) receive the factor via the `scaleFactor` prop on `bn-table-renderer` and multiply every pixel constant by it, so they stay proportional to the surrounding text. | Value | Behavior | |---------------------|----------------------------------------------------------------------------------| | not set / `""` | Auto-scale to fit parent width; emit `AUTO_scale` warning with the applied factor | | `"none"` | No scaling (render at base font size regardless of available space) | | `"auto"` | Auto-scale to fit parent width silently (no warning) | | `"0.5"`, `"1.2"`, … | Fixed factor - apply `baseFontSize × factor` | **Auto-scale algorithm** (modes `""` and `"auto"`): 1. After each render, the current `scrollWidth` of the host element is divided by the current `appliedScaleFactor` to derive the unscaled content width. This avoids resetting `--bn-font-size` to base (which would only affect em-based widths but not SVG pixel attributes). 2. This unscaled width is compared against the parent's content-box width (via `getParentDimensions`). 3. If the table overflows, `factor = parentWidth / unscaledWidth` is computed and applied to both the CSS variable and the `appliedScaleFactor` state (which re-renders the SVG charts). 4. A guard flag (`_autoScaleGuard`) prevents the subsequent state-triggered re-render from re-measuring, avoiding an infinite measure → scale → fits → reset → overflow loop. Invalid values (negative numbers, non-numeric strings that are not `"none"` or `"auto"`) fall back to the default behaviour (auto + warning) and emit an `WARN_scale` warning. **Only the width is fitted.** A table that renders taller than its constrained parent is clipped by the layout cell - bottom rows and the grand total simply disappear - so every render reports the measured overflow in `has-error`: as the error `ERR_overflow` when the size is pinned by `scale` (`"none"` or a factor), as the warning `WARN_overflow` in auto mode. The same item reports a width overflow, which only a fixed `scale` can produce. Setting `scale="auto"` does not fix a height overflow: give the component more space, reduce rows (`limit`), or set a smaller fixed `scale`.
3862
3894
  * @example // Auto-scale to parent (silent) <bn-table scale="auto" ...></bn-table> // Fixed 50 % reduction <bn-table scale="0.5" ...></bn-table> // Double size <bn-table scale="2" ...></bn-table> // No scaling - always render at base font size <bn-table scale="none" ...></bn-table>
@@ -3895,18 +3927,28 @@ declare namespace LocalJSX {
3895
3927
  * @default "[]"
3896
3928
  */
3897
3929
  "thereof"?: string;
3930
+ /**
3931
+ * Position of the `thereof` rows relative to their parent row. <br /><br /> ```below``` (default) prints them below the parent, small and italic, with the thereof label. ```above``` prints them before the parent in normal size with an indented label, and the parent row looks like a subtotal (bold, with a line above it). The parent keeps its operation sign and its value, so a parent of `-` rows reads like "- Operating expenses". With ```above``` list all subcategories of the parent (`"subCategory": ""`): with only some of them the parent looks like a subtotal that does not add up. <br /><br /> values: <br /> ```below // above```
3932
+ * @default "below"
3933
+ */
3934
+ "thereofPosition"?: string;
3898
3935
  /**
3899
3936
  * Set the table type <br /><br /> values: <br /> ```list // sum // opt // sumnototal // optnototal```
3900
3937
  * @default "list"
3901
3938
  */
3902
3939
  "type"?: string;
3903
3940
  /**
3904
- * Data units displayed per 1 em of bar length for absolute variance bar charts (ΔPY) - map-scale semantics: a larger value means smaller bars. Bars exceeding barColumnWidth are shown with an arrow indicator. | Value | Behavior | |------------------|----------------------------------------------------------------| | `"auto"` | Auto-fit the largest bar to the bar column width | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | | invalid / unknown | Auto-fit + `AUTO_unitScaling` warning | Default: `"100"` (1 em of bar represents 100 units)
3941
+ * Data units displayed per 1 em of bar length for absolute variance bar charts (ΔPY) - map-scale semantics: a larger value means smaller bars. Bars exceeding barColumnWidth are cut with a zigzag break. | Value | Behavior | |------------------|----------------------------------------------------------------| | `"auto"` | Auto-fit the largest bar to the bar column width | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | | invalid / unknown | Auto-fit + `AUTO_unitScaling` warning | Default: `"100"` (1 em of bar represents 100 units)
3905
3942
  * @example unit-scaling="1M"
3906
3943
  * @example unit-scaling="revenue-scale"
3907
3944
  * @default "100"
3908
3945
  */
3909
3946
  "unitScaling"?: string | number;
3947
+ /**
3948
+ * Draws every absolute variance column (d_*) listed in ```barColumns``` as a variance waterfall down the rows instead of single bars from the axis. A row starts where the row above ended; on ```opt``` and ```optnototal``` tables a "-" row with a positive variance moves to the left. Sum rows are bars from the axis. Thin lines join the bars. Each row group starts at the axis again, with ```runningSum``` the walk goes on from the sum row. The column scales to fit the whole walk (unit-scaling does not apply). Relative variance columns (dr_*) stay pins. Has no effect together with ```interval``` or ```columnthereof```. <br /><br /> values: <br /> ```true // false```
3949
+ * @default false
3950
+ */
3951
+ "varianceWaterfall"?: boolean;
3910
3952
  /**
3911
3953
  * <br /> <br /> List of Variances The additonal variances which are calculated form the given scenarios. the scenarios used in the variances have also be defined in the *scenarios* property. <br /> <br /> the variance is defiend as (Scenario A - ScenarioB) neu. neg and pos post fix defines which value is *good* a negative or a positive value. op follows the row operation: in an opt/optnototal table a "-" row acts like neg, "+" and sum rows act like pos (a rising cost is red). opinv is the inverse of op. In other table types op acts like pos. <br /> <br /> if empty variance charts are hidden <br /> <br /> each variance creates a chart <br /> <br /> pattern:<br /> ```d<scenarioB>_<scenarioA>_[pos/neg/neu/op/opinv]```
3912
3954
  */
@@ -4367,9 +4409,12 @@ declare namespace LocalJSX {
4367
4409
  "grouped": boolean;
4368
4410
  "showMeasureScale": boolean;
4369
4411
  "showGroupTitle": boolean;
4412
+ "runningSum": boolean;
4413
+ "varianceWaterfall": boolean;
4370
4414
  "type": string;
4371
4415
  "limit": number;
4372
4416
  "thereof": string;
4417
+ "thereofPosition": string;
4373
4418
  "partof": string;
4374
4419
  "order": string;
4375
4420
  "orderDirection": string;
@@ -40,6 +40,7 @@ export declare function isValidDateFormat(value: string): boolean;
40
40
  export declare function isValidAxisLabelsMode(value: string): boolean;
41
41
  export declare function isValidDataFormat(value: string): boolean;
42
42
  export declare function isValidTableType(value: string): boolean;
43
+ export declare function isValidThereofPosition(value: string): boolean;
43
44
  export declare function validateThereOfJsonStr(value: string): string[];
44
45
  /**
45
46
  * Validates the bn-table `attributes` prop: a JSON object mapping column labels
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bino-bi/bn-template-engine",
3
- "version": "1.0.0-next.39",
3
+ "version": "1.0.0-next.41",
4
4
  "description": "IBCS-compliant web components for business intelligence tables and charts",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",