@bino-bi/bn-template-engine 1.0.0-next.24 → 1.0.0-next.26

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 (36) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/{p-0b2e1661.entry.js → p-461fdffa.entry.js} +1 -1
  3. package/dist/bn-template-engine/p-829212c3.entry.js +1 -0
  4. package/dist/bn-template-engine/{p-2fbc2d50.entry.js → p-bfa87b07.entry.js} +1 -1
  5. package/dist/bn-template-engine/{p-36f1c5f9.entry.js → p-ceb80db3.entry.js} +1 -1
  6. package/dist/cjs/bn-asset_21.cjs.entry.js +50 -7
  7. package/dist/cjs/bn-chart-bubble.cjs.entry.js +1 -1
  8. package/dist/cjs/bn-chart-bullet.cjs.entry.js +1 -1
  9. package/dist/cjs/bn-chart-scatter.cjs.entry.js +1 -1
  10. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +3 -0
  11. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +3 -0
  12. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +3 -0
  13. package/dist/collection/components/bn-chart-structure/bn-chart-structure.css +3 -0
  14. package/dist/collection/components/bn-chart-time/bn-chart-time.css +3 -0
  15. package/dist/collection/components/bn-chart-time/ibcs-chart-time.css +0 -4
  16. package/dist/collection/components/bn-table/bn-table.css +3 -0
  17. package/dist/collection/components/bn-table/bn-table.js +46 -3
  18. package/dist/collection/utils/testing/hostFont.js +20 -0
  19. package/dist/components/bn-chart-bubble.js +1 -1
  20. package/dist/components/bn-chart-bullet.js +1 -1
  21. package/dist/components/bn-chart-scatter.js +1 -1
  22. package/dist/components/bn-chart-structure.js +1 -1
  23. package/dist/components/bn-chart-time.js +1 -1
  24. package/dist/components/bn-table.js +1 -1
  25. package/dist/components/ibcs-chart-structure2.js +1 -1
  26. package/dist/components/ibcs-chart-time2.js +1 -1
  27. package/dist/esm/bn-asset_21.entry.js +50 -7
  28. package/dist/esm/bn-chart-bubble.entry.js +1 -1
  29. package/dist/esm/bn-chart-bullet.entry.js +1 -1
  30. package/dist/esm/bn-chart-scatter.entry.js +1 -1
  31. package/dist/types/components/bn-table/bn-table.d.ts +19 -0
  32. package/dist/types/components.d.ts +2 -2
  33. package/dist/types/utils/testing/hostFont.d.ts +16 -0
  34. package/package.json +1 -1
  35. package/readme.md +1 -0
  36. package/dist/bn-template-engine/p-a8eb9ca0.entry.js +0 -1
@@ -65,6 +65,16 @@ export declare class Table {
65
65
  * `"none"` or `"auto"`) fall back to the default behaviour (auto + warning)
66
66
  * and emit an `ERR_scale` warning.
67
67
  *
68
+ * **Only the width is fitted.** A table that renders taller than its
69
+ * constrained parent is clipped by the layout cell — bottom rows and the
70
+ * grand total simply disappear — so every render reports the measured
71
+ * overflow as a `WARN_overflow` item in `has-error`: an `error` when the
72
+ * size is pinned by `scale` (`"none"` or a factor), a `warning` in auto
73
+ * mode. The same item reports a width overflow, which only a fixed `scale`
74
+ * can produce. Setting `scale="auto"` does not fix a height overflow: give
75
+ * the component more space, reduce rows (`limit`), or set a smaller fixed
76
+ * `scale`.
77
+ *
68
78
  * @example
69
79
  * // Auto-scale to parent (silent)
70
80
  * <bn-table scale="auto" ...></bn-table>
@@ -425,6 +435,15 @@ export declare class Table {
425
435
  disconnectedCallback(): void;
426
436
  private _autoScaleGuard;
427
437
  componentDidRender(): void;
438
+ /**
439
+ * Reports a WARN_overflow item when the rendered table exceeds its
440
+ * container. The table only auto-fits its WIDTH, so nothing prevents it
441
+ * from growing taller than the layout cell, which clips the bottom rows
442
+ * (grand total included) without a trace — this item is the only signal.
443
+ * Overflow under a fixed `scale` is an error: the author pinned the size.
444
+ * In auto mode it is a warning.
445
+ */
446
+ private checkOverflow;
428
447
  private prepareDataFormat;
429
448
  private prepareGrouped;
430
449
  private prepareShowGroupTitle;
@@ -1173,7 +1173,7 @@ export namespace Components {
1173
1173
  */
1174
1174
  "ruleset"?: string;
1175
1175
  /**
1176
- * 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 `ibcs-table` 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 `ERR_scale` warning.
1176
+ * 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 `ibcs-table` 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 `ERR_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 as a `WARN_overflow` item in `has-error`: an `error` when the size is pinned by `scale` (`"none"` or a factor), a `warning` 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`.
1177
1177
  * @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>
1178
1178
  */
1179
1179
  "scale"?: string;
@@ -3448,7 +3448,7 @@ declare namespace LocalJSX {
3448
3448
  */
3449
3449
  "ruleset"?: string;
3450
3450
  /**
3451
- * 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 `ibcs-table` 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 `ERR_scale` warning.
3451
+ * 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 `ibcs-table` 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 `ERR_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 as a `WARN_overflow` item in `has-error`: an `error` when the size is pinned by `scale` (`"none"` or a factor), a `warning` 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`.
3452
3452
  * @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>
3453
3453
  */
3454
3454
  "scale"?: string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Font declarations of a component stylesheet's first `:host` block, resolved
3
+ * against a host element the way the browser would: each `var(--x, fallback)`
4
+ * takes `--x` from the host's inline style when it is set, otherwise the
5
+ * fallback.
6
+ *
7
+ * Spec-only. mock-doc has no CSS cascade, so `getComputedStyle(host)` is empty
8
+ * in specs; this is the closest a spec can get to asserting the host's
9
+ * computed font.
10
+ */
11
+ export interface HostFont {
12
+ fontFamily?: string;
13
+ fontSize?: string;
14
+ color?: string;
15
+ }
16
+ export declare const resolveHostFont: (stylesheetPath: string, host: HTMLElement) => HostFont;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bino-bi/bn-template-engine",
3
- "version": "1.0.0-next.24",
3
+ "version": "1.0.0-next.26",
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",
package/readme.md CHANGED
@@ -154,6 +154,7 @@ All components must be wrapped in a **`<bn-context>`** element, which provides s
154
154
  - [Scaling](doc/scaling.md) — Units-per-em bar scaling, scaling groups, `scale`, `measure-scale`
155
155
  - [Theming](doc/theming.md) — Colors, fonts, chart styles, style layers
156
156
  - [Internationalization](doc/internationalization.md) — Locale setup, translations, scenario labels
157
+ - [Layout State](doc/layout-state.md) — `getLayoutState()`: machine-readable geometry, metadata and diagnostics of a rendered report
157
158
  - [Installation](doc/installation.md) — npm, CDN, framework integration
158
159
 
159
160
  ## Browser Support