@bino-bi/bn-template-engine 1.0.0-next.25 → 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.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/{p-0b2e1661.entry.js → p-461fdffa.entry.js} +1 -1
- package/dist/bn-template-engine/p-829212c3.entry.js +1 -0
- package/dist/bn-template-engine/{p-2fbc2d50.entry.js → p-bfa87b07.entry.js} +1 -1
- package/dist/bn-template-engine/{p-36f1c5f9.entry.js → p-ceb80db3.entry.js} +1 -1
- package/dist/cjs/bn-asset_21.cjs.entry.js +49 -6
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +1 -1
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +1 -1
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +1 -1
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +3 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +3 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +3 -0
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.css +3 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.css +3 -0
- package/dist/collection/components/bn-table/bn-table.css +3 -0
- package/dist/collection/components/bn-table/bn-table.js +46 -3
- package/dist/collection/utils/testing/hostFont.js +20 -0
- package/dist/components/bn-chart-bubble.js +1 -1
- package/dist/components/bn-chart-bullet.js +1 -1
- package/dist/components/bn-chart-scatter.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/esm/bn-asset_21.entry.js +49 -6
- package/dist/esm/bn-chart-bubble.entry.js +1 -1
- package/dist/esm/bn-chart-bullet.entry.js +1 -1
- package/dist/esm/bn-chart-scatter.entry.js +1 -1
- package/dist/types/components/bn-table/bn-table.d.ts +19 -0
- package/dist/types/components.d.ts +2 -2
- package/dist/types/utils/testing/hostFont.d.ts +16 -0
- package/package.json +1 -1
- package/dist/bn-template-engine/p-e30c7251.entry.js +0 -1
|
@@ -134,7 +134,7 @@ function buildGenericState(el, origins) {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
const bnChartStructureCss$1 = () => `:host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.warning{font-size:0.8em;font-style:italic}svg#drawCanvas{display:block}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}`;
|
|
137
|
+
const bnChartStructureCss$1 = () => `:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.warning{font-size:0.8em;font-style:italic}svg#drawCanvas{display:block}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}`;
|
|
138
138
|
|
|
139
139
|
const Chart$1 = class Chart {
|
|
140
140
|
validateScenario(newValue) {
|
|
@@ -1165,7 +1165,7 @@ const Chart$1 = class Chart {
|
|
|
1165
1165
|
};
|
|
1166
1166
|
Chart$1.style = bnChartStructureCss$1();
|
|
1167
1167
|
|
|
1168
|
-
const bnChartTimeCss = () => `:host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column-reverse}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}`;
|
|
1168
|
+
const bnChartTimeCss = () => `:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.container{display:flex;flex-direction:column-reverse}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}`;
|
|
1169
1169
|
|
|
1170
1170
|
var AggregationLevel;
|
|
1171
1171
|
(function (AggregationLevel) {
|
|
@@ -4755,7 +4755,7 @@ function toDateTime(value) {
|
|
|
4755
4755
|
return undefined;
|
|
4756
4756
|
}
|
|
4757
4757
|
|
|
4758
|
-
const bnTableCss = () => `:host{display:inline-block;position:relative;overflow:hidden}`;
|
|
4758
|
+
const bnTableCss = () => `:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}`;
|
|
4759
4759
|
|
|
4760
4760
|
const Table$1 = class Table {
|
|
4761
4761
|
validateScaling(newValue) {
|
|
@@ -5507,17 +5507,21 @@ const Table$1 = class Table {
|
|
|
5507
5507
|
// Only auto-scale for 'auto' and 'empty' (blank) modes
|
|
5508
5508
|
if (mode !== "auto" && mode !== "empty") {
|
|
5509
5509
|
this._autoScaleGuard = false;
|
|
5510
|
+
this.checkOverflow();
|
|
5510
5511
|
return;
|
|
5511
5512
|
}
|
|
5512
5513
|
// Skip re-measurement after the state-triggered re-render
|
|
5513
5514
|
if (this._autoScaleGuard) {
|
|
5514
5515
|
this._autoScaleGuard = false;
|
|
5516
|
+
this.checkOverflow();
|
|
5515
5517
|
return;
|
|
5516
5518
|
}
|
|
5517
5519
|
const host = this.element;
|
|
5518
5520
|
const { width: parentWidth } = getParentDimensions(host);
|
|
5519
|
-
if (parentWidth <= 0)
|
|
5521
|
+
if (parentWidth <= 0) {
|
|
5522
|
+
this.checkOverflow();
|
|
5520
5523
|
return;
|
|
5524
|
+
}
|
|
5521
5525
|
this._lastScaledParentWidth = parentWidth;
|
|
5522
5526
|
const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
5523
5527
|
const currentWidth = host.scrollWidth;
|
|
@@ -5527,6 +5531,7 @@ const Table$1 = class Table {
|
|
|
5527
5531
|
// rounding and causes oscillation (reset → overflow → scale → reset).
|
|
5528
5532
|
if (currentWidth <= parentWidth + 1) {
|
|
5529
5533
|
this.errors.remove("AUTO_scale");
|
|
5534
|
+
this.checkOverflow();
|
|
5530
5535
|
return;
|
|
5531
5536
|
}
|
|
5532
5537
|
// Content overflows. Compute a new factor based on the ratio of
|
|
@@ -5535,6 +5540,7 @@ const Table$1 = class Table {
|
|
|
5535
5540
|
const computedFactor = Math.max(0.3, (currentFactor * (parentWidth - 1)) / currentWidth);
|
|
5536
5541
|
// Only apply if the change is significant (> 0.1% of current factor).
|
|
5537
5542
|
if (Math.abs(computedFactor - currentFactor) < 0.001) {
|
|
5543
|
+
this.checkOverflow();
|
|
5538
5544
|
return;
|
|
5539
5545
|
}
|
|
5540
5546
|
// Apply immediately via CSS var for smooth visual (before state re-render)
|
|
@@ -5556,6 +5562,43 @@ const Table$1 = class Table {
|
|
|
5556
5562
|
writeTask(() => {
|
|
5557
5563
|
this.appliedScaleFactor = computedFactor;
|
|
5558
5564
|
});
|
|
5565
|
+
// Check with the current (pre-factor) content so overflow is reported
|
|
5566
|
+
// even if the scheduled re-render stalls; the follow-up render re-checks
|
|
5567
|
+
// in the guard branch and clears any transiently reported overflow.
|
|
5568
|
+
this.checkOverflow();
|
|
5569
|
+
}
|
|
5570
|
+
/**
|
|
5571
|
+
* Reports a WARN_overflow item when the rendered table exceeds its
|
|
5572
|
+
* container. The table only auto-fits its WIDTH, so nothing prevents it
|
|
5573
|
+
* from growing taller than the layout cell, which clips the bottom rows
|
|
5574
|
+
* (grand total included) without a trace — this item is the only signal.
|
|
5575
|
+
* Overflow under a fixed `scale` is an error: the author pinned the size.
|
|
5576
|
+
* In auto mode it is a warning.
|
|
5577
|
+
*/
|
|
5578
|
+
checkOverflow() {
|
|
5579
|
+
const errId = "WARN_overflow";
|
|
5580
|
+
const parent = getParentDimensions(this.element);
|
|
5581
|
+
const contentWidth = this.element.scrollWidth;
|
|
5582
|
+
const contentHeight = this.element.scrollHeight;
|
|
5583
|
+
const widthOver = parent.width > 0 && contentWidth > parent.width + 1;
|
|
5584
|
+
const heightOver = parent.height > 0 && contentHeight > parent.height + 1;
|
|
5585
|
+
if (!widthOver && !heightOver) {
|
|
5586
|
+
this.errors.remove(errId);
|
|
5587
|
+
return;
|
|
5588
|
+
}
|
|
5589
|
+
const { mode } = parseScaling(this.scale);
|
|
5590
|
+
const fixedScale = mode !== "auto" && mode !== "empty";
|
|
5591
|
+
const dims = [];
|
|
5592
|
+
if (widthOver)
|
|
5593
|
+
dims.push(`width (${Math.round(contentWidth)}px > ${Math.round(parent.width)}px)`);
|
|
5594
|
+
if (heightOver)
|
|
5595
|
+
dims.push(`height (${Math.round(contentHeight)}px > ${Math.round(parent.height)}px)`);
|
|
5596
|
+
this.errors.addOrReplace({
|
|
5597
|
+
id: errId,
|
|
5598
|
+
type: fixedScale ? "error" : "warning",
|
|
5599
|
+
message: `Table exceeds available ${dims.join(" and ")}. ` +
|
|
5600
|
+
"Give the component more space, reduce rows (e.g. limit), or set a smaller scale.",
|
|
5601
|
+
});
|
|
5559
5602
|
}
|
|
5560
5603
|
prepareDataFormat() {
|
|
5561
5604
|
var _a;
|
|
@@ -6021,7 +6064,7 @@ const Table$1 = class Table {
|
|
|
6021
6064
|
render() {
|
|
6022
6065
|
const fontStyles = this.getFontStyles();
|
|
6023
6066
|
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
6024
|
-
return (h(Host, { key: '
|
|
6067
|
+
return (h(Host, { key: '10a4b95a0115864ad324efcdffcd10b05b583820', style: fontStyles }, h("div", { key: '28456489f9d8200ddc89cdd35ca217df347bc2a5' }, h("ibcs-table", { key: 'c2a19bd85883171a3e1baf3110eeefc1072b4a58', tableName: this.datasetName, dataVersion: this.dataVersion, sumTitle: this.prepareSumTitle(), scenarios: this.prepareScenarios(), scenariosDataFormat: this.prepareDataFormat(), grouped: this.prepareGrouped(), limit: this.prepareLimit(), showGroupTitle: this.prepareShowGroupTitle(), thereof: this.prepareThereOf(), partof: this.preparePartOf(), order: this.prepareOrder(), categorythereof: this.prepareColumnThereOf(), attributeColumns: this.prepareAttributes(), type: this.prepareTableType(), categoryWidth: this.prepareCategoryWidth(), dataFormatDigits: this.prepareDataFormatDigits(), i18n: this.prepareI18n(), i18nMode: this.prepareI18nMode(), measureScale: this.prepareMeasureScale(), measureType: this.prepareMeasureType(), measureUnit: this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(), filter: this.prepareFilter(), barColumns: this.prepareBarColumns(), interval: this.prepareInterval(), barColumnMaxWidth: this.prepareBarColumnWidth(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), reportAutoScaling: this.handleAutoScalingReport, scaleFactor: effectiveFactor, ruleSetConfig: this.ruleSetConfig(), selectedStyle: this.selectedStyle }))));
|
|
6025
6068
|
}
|
|
6026
6069
|
get element() { return getElement(this); }
|
|
6027
6070
|
static get watchers() { return {
|
|
@@ -9613,7 +9656,7 @@ class DataFormatDigitsAdapter {
|
|
|
9613
9656
|
}
|
|
9614
9657
|
}
|
|
9615
9658
|
|
|
9616
|
-
const bnChartStructureCss = () => `:host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.warning{font-size:0.8em;font-style:italic}svg#drawCanvas{display:block}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}`;
|
|
9659
|
+
const bnChartStructureCss = () => `:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.warning{font-size:0.8em;font-style:italic}svg#drawCanvas{display:block}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}`;
|
|
9617
9660
|
|
|
9618
9661
|
const IbcsChartStructure = class {
|
|
9619
9662
|
constructor(hostRef) {
|
|
@@ -11,7 +11,7 @@ import { t as toAxisConfig, a as toSizeConfig, b as toShareConfig, c as toFacetC
|
|
|
11
11
|
import './index.js';
|
|
12
12
|
import './Order-DZVWjEL_.js';
|
|
13
13
|
|
|
14
|
-
const bnChartBubbleCss = () => `:host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}`;
|
|
14
|
+
const bnChartBubbleCss = () => `:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.container{display:flex;flex-direction:column}`;
|
|
15
15
|
|
|
16
16
|
const HIERARCHY_DEPTH = { rowGroup: 0, category: 1, subCategory: 2 };
|
|
17
17
|
const COMPARE_FAMILIES = ["ac", "pp", "fc", "pl"];
|
|
@@ -99,7 +99,7 @@ function readString(data, key, invalid) {
|
|
|
99
99
|
return undefined;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
const bnChartBulletCss = () => `:host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}`;
|
|
102
|
+
const bnChartBulletCss = () => `:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.container{display:flex;flex-direction:column}`;
|
|
103
103
|
|
|
104
104
|
/** Auto-detection preference for the target scenario. */
|
|
105
105
|
const TARGET_SLOT_PREFERENCE = ["pl1", "pp1", "fc1"];
|
|
@@ -10,7 +10,7 @@ import { f as toIsoConfig, c as toFacetConfig, d as toLabelConfig, e as toLegend
|
|
|
10
10
|
import './index.js';
|
|
11
11
|
import './Order-DZVWjEL_.js';
|
|
12
12
|
|
|
13
|
-
const bnChartScatterCss = () => `:host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}`;
|
|
13
|
+
const bnChartScatterCss = () => `:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.container{display:flex;flex-direction:column}`;
|
|
14
14
|
|
|
15
15
|
const HIERARCHY_DEPTH = { rowGroup: 0, category: 1, subCategory: 2 };
|
|
16
16
|
const ChartScatter = class {
|
|
@@ -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