@bino-bi/bn-template-engine 1.0.0-alpha.4 → 1.0.0-alpha.5

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.
@@ -1823,6 +1823,7 @@ class Label {
1823
1823
  constructor(parent, xPosition, yPosition, groupPrefix, value, styles, verticalHookLocation, horizontalHookLocation) {
1824
1824
  this.group = null;
1825
1825
  this.segmentFillColor = null;
1826
+ this.maxWidth = null;
1826
1827
  this.ID_SCENARIOLABEL = "Label";
1827
1828
  this.CSS_CATEGORIES = "categories";
1828
1829
  this.x = xPosition;
@@ -1850,6 +1851,10 @@ class Label {
1850
1851
  this.segmentFillColor = color;
1851
1852
  return this;
1852
1853
  }
1854
+ setMaxWidth(width) {
1855
+ this.maxWidth = width;
1856
+ return this;
1857
+ }
1853
1858
  updateGroup(newGroup) {
1854
1859
  this.group = newGroup;
1855
1860
  return this;
@@ -1858,6 +1863,7 @@ class Label {
1858
1863
  return prefix + "_" + groupPrefix + "_" + this.ID_SCENARIOLABEL;
1859
1864
  }
1860
1865
  draw(dataFormatDigits = { percent: 2, decimal: 1 }, measureScale = new DataFormatDigits.SiPrefix()) {
1866
+ var _a;
1861
1867
  if (this.isEmpty()) {
1862
1868
  return this;
1863
1869
  }
@@ -1895,6 +1901,11 @@ class Label {
1895
1901
  text.move(this.x, this.y);
1896
1902
  const boxWidth = text.bbox().w;
1897
1903
  const boxHeight = text.bbox().h;
1904
+ if (this.maxWidth != null && boxWidth > this.maxWidth) {
1905
+ (_a = this.group) === null || _a === void 0 ? void 0 : _a.remove();
1906
+ this.group = null;
1907
+ return this;
1908
+ }
1898
1909
  if (this.horizontalHookLocation === HookLocation.Right) {
1899
1910
  labelAnchor = "end";
1900
1911
  text.move(text.x() - text.length(), text.y());
@@ -2577,20 +2588,23 @@ class StackedBar {
2577
2588
  const strokeStyle = { color: fillColor, width: 0.5 };
2578
2589
  this.barGroup.rect(Math.max(segmentLength, 0.5), barWidth).fill(fillStyle).stroke(strokeStyle).cy(yPos).x(xPos);
2579
2590
  // Draw segment value label centered on bar if wide enough
2580
- const MIN_SEGMENT_WIDTH_FOR_LABEL = 30;
2581
- if (segmentLength >= MIN_SEGMENT_WIDTH_FOR_LABEL) {
2591
+ const LABEL_PADDING = 6;
2592
+ const availableWidth = segmentLength - LABEL_PADDING;
2593
+ if (availableWidth > 0) {
2582
2594
  const labelX = xPos + segmentLength / 2;
2583
2595
  if (this.stackMode === Order.StackMode.RELATIVE || this.stackMode === Order.StackMode.ABSOLUTE_RELATIVE) {
2584
2596
  const pct = this.totalValue !== 0 ? (value / this.totalValue) * 100 : 0;
2585
2597
  const labelValue = pct.toFixed(dataFormatDigits.percent) + "%";
2586
2598
  new Label(this.group, labelX, yPos, "STACK_SEG", labelValue, this.styles, HookLocation.Center, HookLocation.Center)
2587
2599
  .setSegmentFill(fillColor)
2600
+ .setMaxWidth(availableWidth)
2588
2601
  .draw();
2589
2602
  }
2590
2603
  else {
2591
2604
  // Pass raw numeric value — Label.draw() formats with measureScale
2592
2605
  new Label(this.group, labelX, yPos, "STACK_SEG", value, this.styles, HookLocation.Center, HookLocation.Center)
2593
2606
  .setSegmentFill(fillColor)
2607
+ .setMaxWidth(availableWidth)
2594
2608
  .draw(dataFormatDigits, measureScale);
2595
2609
  }
2596
2610
  }
@@ -592,7 +592,6 @@ const Table = class {
592
592
  this.unsubscribe();
593
593
  }
594
594
  componentDidRender() {
595
- var _a, _b;
596
595
  const { mode } = scaling.parseScaling(this.scale);
597
596
  // Only auto-scale for 'auto' and 'empty' (blank) modes
598
597
  if (mode !== "auto" && mode !== "empty") {
@@ -608,18 +607,21 @@ const Table = class {
608
607
  const { width: parentWidth } = scaling.getParentDimensions(host);
609
608
  if (parentWidth <= 0)
610
609
  return;
611
- // Measure at base (unscaled) font size to get true content width.
612
- // This avoids the oscillation where scaled-down content fits → reset
613
- // to 1 → overflows → scale down → fits → …
614
610
  const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
615
- host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
616
- // Reading scrollWidth forces a synchronous reflow at base size
617
- const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("div");
618
- const unscaledWidth = (_b = div === null || div === void 0 ? void 0 : div.scrollWidth) !== null && _b !== void 0 ? _b : host.scrollWidth;
611
+ // Measure current content width. host has overflow:hidden, so scrollWidth
612
+ // reliably includes full content including shadow DOM overflow.
613
+ const currentWidth = host.scrollWidth;
614
+ const currentFactor = this.appliedScaleFactor;
615
+ // Both em-based and SVG-based dimensions scale proportionally with the
616
+ // factor, so dividing by the current factor recovers the base-size width.
617
+ // This avoids resetting --bn-font-size to base which only changes em
618
+ // widths but not SVG pixel attributes, causing measurement mismatch.
619
+ const unscaledWidth = currentFactor > 0 ? currentWidth / currentFactor : currentWidth;
619
620
  if (unscaledWidth <= parentWidth + 1) {
620
621
  // Content fits at base size — no scaling needed
621
622
  this.errors.remove("AUTO_scale");
622
623
  if (this.appliedScaleFactor !== 1) {
624
+ host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
623
625
  this._autoScaleGuard = true;
624
626
  this.appliedScaleFactor = 1;
625
627
  }
@@ -899,7 +901,7 @@ const Table = class {
899
901
  render() {
900
902
  const fontStyles = this.getFontStyles();
901
903
  const effectiveFactor = this.getEffectiveScaleFactor();
902
- return (index.h(index.Host, { key: '788f67af1bbc37c0ffe1467503e0708ec52a7f53', style: fontStyles }, index.h("div", { key: '3f9bcc8cddc8bbdf88681ca3d0ee35e67aa1a04f' }, index.h("ibcs-table", { key: '74657d8bca08c78313db7f497c0d7267eee97d00', data: this.data, "table-title": this.prepareTableTitle(), scenarios: this.prepareScenarios(), "scenarios-data-format": this.prepareDataFormat(), grouped: this.prepareGrouped(), limit: this.prepareLimit(), showGroupTitle: this.prepareShowGroupTitle(), thereof: this.prepareThereOf(), partof: this.preparePartOf(), order: this.prepareOrder(), categorythereof: this.prepareColumnThereOf(), type: this.prepareTableType(), "category-width": this.prepareCategoryWidth(), dataFormatDigits: this.prepareDataFormatDigits(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode(), "measure-scale": this.prepareMeasureScale(), "measure-type": this.prepareMeasureType(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(), filter: this.prepareFilter(), barColumns: this.prepareBarColumns(), barColumnMaxWidth: this.prepareBarColumnWidth(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), scaleFactor: effectiveFactor }))));
904
+ return (index.h(index.Host, { key: '3690ce4fee5e38012a2f956035110cc3e2500b39', style: fontStyles }, index.h("div", { key: 'e6481956a6873beefb15ea7369a7352d2662c1a2' }, index.h("ibcs-table", { key: '3260517d31fa04294c8df293a6fefd88b129f7b6', data: this.data, "table-title": this.prepareTableTitle(), scenarios: this.prepareScenarios(), "scenarios-data-format": this.prepareDataFormat(), grouped: this.prepareGrouped(), limit: this.prepareLimit(), showGroupTitle: this.prepareShowGroupTitle(), thereof: this.prepareThereOf(), partof: this.preparePartOf(), order: this.prepareOrder(), categorythereof: this.prepareColumnThereOf(), type: this.prepareTableType(), "category-width": this.prepareCategoryWidth(), dataFormatDigits: this.prepareDataFormatDigits(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode(), "measure-scale": this.prepareMeasureScale(), "measure-type": this.prepareMeasureType(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(), filter: this.prepareFilter(), barColumns: this.prepareBarColumns(), barColumnMaxWidth: this.prepareBarColumnWidth(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), scaleFactor: effectiveFactor }))));
903
905
  }
904
906
  get element() { return index.getElement(this); }
905
907
  static get watchers() { return {
@@ -2161,7 +2161,7 @@ const IbcsTable = class {
2161
2161
  const errorMsg = this.i18n.get("NO_DATA") || "==No Data==";
2162
2162
  return index$1.h("p", { class: "warning" }, errorMsg);
2163
2163
  }
2164
- return (index$1.h("table", null, index$1.h("thead", null, this.table.getHeader().map((row) => (index$1.h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (index$1.h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (index$1.h("span", null, i === arr.length - 1 ? (index$1.h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (index$1.h("span", null, line, cell.drawPrefix(), index$1.h("br", null))))))))))))), index$1.h("tbody", null, this.table.getBody().map((row) => (index$1.h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (index$1.h("td", { colSpan: cell.colSpan, class: cell.type ? `${cell.cssStyle} ${cell.type}` : cell.cssStyle }, cell.prefix != null ? (index$1.h("span", { class: cell.cssStyle + " " + cell.prefixStyle }, cell.drawPrefix())) : (""), cell.isBarChart && cell.columnStats ? (index$1.h(CellBarChart, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: cell.key.startsWith("dr"), isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, maxBarWidth: this.barColumnMaxWidth, styles: this.barChartStyles })) : (cell.draw(this.componentDataFormatDigits)))))))))));
2164
+ return (index$1.h("table", null, index$1.h("thead", null, this.table.getHeader().map((row) => (index$1.h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (index$1.h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (index$1.h("span", null, i === arr.length - 1 ? (index$1.h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (index$1.h("span", null, line, cell.drawPrefix(), index$1.h("br", null))))))))))))), index$1.h("tbody", null, this.table.getBody().map((row) => (index$1.h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (index$1.h("td", { colSpan: cell.colSpan, class: cell.type ? `${cell.cssStyle} ${cell.type}` : cell.cssStyle }, cell.prefix != null ? (index$1.h("span", { class: cell.cssStyle + " " + cell.prefixStyle }, cell.drawPrefix())) : (""), cell.isBarChart && cell.columnStats && row.type !== index.TableRowType.SUM ? (index$1.h(CellBarChart, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: cell.key.startsWith("dr"), isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, maxBarWidth: this.barColumnMaxWidth, styles: this.barChartStyles })) : (cell.draw(this.componentDataFormatDigits)))))))))));
2165
2165
  };
2166
2166
  return index$1.h(index$1.Host, null, helper());
2167
2167
  }
@@ -30,6 +30,7 @@ export class Label {
30
30
  constructor(parent, xPosition, yPosition, groupPrefix, value, styles, verticalHookLocation, horizontalHookLocation) {
31
31
  this.group = null;
32
32
  this.segmentFillColor = null;
33
+ this.maxWidth = null;
33
34
  this.ID_SCENARIOLABEL = "Label";
34
35
  this.CSS_CATEGORIES = "categories";
35
36
  this.x = xPosition;
@@ -57,6 +58,10 @@ export class Label {
57
58
  this.segmentFillColor = color;
58
59
  return this;
59
60
  }
61
+ setMaxWidth(width) {
62
+ this.maxWidth = width;
63
+ return this;
64
+ }
60
65
  updateGroup(newGroup) {
61
66
  this.group = newGroup;
62
67
  return this;
@@ -65,6 +70,7 @@ export class Label {
65
70
  return prefix + "_" + groupPrefix + "_" + this.ID_SCENARIOLABEL;
66
71
  }
67
72
  draw(dataFormatDigits = { percent: 2, decimal: 1 }, measureScale = new SiPrefix()) {
73
+ var _a;
68
74
  if (this.isEmpty()) {
69
75
  return this;
70
76
  }
@@ -102,6 +108,11 @@ export class Label {
102
108
  text.move(this.x, this.y);
103
109
  const boxWidth = text.bbox().w;
104
110
  const boxHeight = text.bbox().h;
111
+ if (this.maxWidth != null && boxWidth > this.maxWidth) {
112
+ (_a = this.group) === null || _a === void 0 ? void 0 : _a.remove();
113
+ this.group = null;
114
+ return this;
115
+ }
105
116
  if (this.horizontalHookLocation === HookLocation.Right) {
106
117
  labelAnchor = "end";
107
118
  text.move(text.x() - text.length(), text.y());
@@ -50,20 +50,23 @@ export class StackedBar {
50
50
  const strokeStyle = { color: fillColor, width: 0.5 };
51
51
  this.barGroup.rect(Math.max(segmentLength, 0.5), barWidth).fill(fillStyle).stroke(strokeStyle).cy(yPos).x(xPos);
52
52
  // Draw segment value label centered on bar if wide enough
53
- const MIN_SEGMENT_WIDTH_FOR_LABEL = 30;
54
- if (segmentLength >= MIN_SEGMENT_WIDTH_FOR_LABEL) {
53
+ const LABEL_PADDING = 6;
54
+ const availableWidth = segmentLength - LABEL_PADDING;
55
+ if (availableWidth > 0) {
55
56
  const labelX = xPos + segmentLength / 2;
56
57
  if (this.stackMode === StackMode.RELATIVE || this.stackMode === StackMode.ABSOLUTE_RELATIVE) {
57
58
  const pct = this.totalValue !== 0 ? (value / this.totalValue) * 100 : 0;
58
59
  const labelValue = pct.toFixed(dataFormatDigits.percent) + "%";
59
60
  new Label(this.group, labelX, yPos, "STACK_SEG", labelValue, this.styles, HookLocation.Center, HookLocation.Center)
60
61
  .setSegmentFill(fillColor)
62
+ .setMaxWidth(availableWidth)
61
63
  .draw();
62
64
  }
63
65
  else {
64
66
  // Pass raw numeric value — Label.draw() formats with measureScale
65
67
  new Label(this.group, labelX, yPos, "STACK_SEG", value, this.styles, HookLocation.Center, HookLocation.Center)
66
68
  .setSegmentFill(fillColor)
69
+ .setMaxWidth(availableWidth)
67
70
  .draw(dataFormatDigits, measureScale);
68
71
  }
69
72
  }
@@ -596,7 +596,6 @@ export class Table {
596
596
  this.unsubscribe();
597
597
  }
598
598
  componentDidRender() {
599
- var _a, _b;
600
599
  const { mode } = parseScaling(this.scale);
601
600
  // Only auto-scale for 'auto' and 'empty' (blank) modes
602
601
  if (mode !== "auto" && mode !== "empty") {
@@ -612,18 +611,21 @@ export class Table {
612
611
  const { width: parentWidth } = getParentDimensions(host);
613
612
  if (parentWidth <= 0)
614
613
  return;
615
- // Measure at base (unscaled) font size to get true content width.
616
- // This avoids the oscillation where scaled-down content fits → reset
617
- // to 1 → overflows → scale down → fits → …
618
614
  const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
619
- host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
620
- // Reading scrollWidth forces a synchronous reflow at base size
621
- const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("div");
622
- const unscaledWidth = (_b = div === null || div === void 0 ? void 0 : div.scrollWidth) !== null && _b !== void 0 ? _b : host.scrollWidth;
615
+ // Measure current content width. host has overflow:hidden, so scrollWidth
616
+ // reliably includes full content including shadow DOM overflow.
617
+ const currentWidth = host.scrollWidth;
618
+ const currentFactor = this.appliedScaleFactor;
619
+ // Both em-based and SVG-based dimensions scale proportionally with the
620
+ // factor, so dividing by the current factor recovers the base-size width.
621
+ // This avoids resetting --bn-font-size to base which only changes em
622
+ // widths but not SVG pixel attributes, causing measurement mismatch.
623
+ const unscaledWidth = currentFactor > 0 ? currentWidth / currentFactor : currentWidth;
623
624
  if (unscaledWidth <= parentWidth + 1) {
624
625
  // Content fits at base size — no scaling needed
625
626
  this.errors.remove("AUTO_scale");
626
627
  if (this.appliedScaleFactor !== 1) {
628
+ host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
627
629
  this._autoScaleGuard = true;
628
630
  this.appliedScaleFactor = 1;
629
631
  }
@@ -903,7 +905,7 @@ export class Table {
903
905
  render() {
904
906
  const fontStyles = this.getFontStyles();
905
907
  const effectiveFactor = this.getEffectiveScaleFactor();
906
- return (h(Host, { key: '788f67af1bbc37c0ffe1467503e0708ec52a7f53', style: fontStyles }, h("div", { key: '3f9bcc8cddc8bbdf88681ca3d0ee35e67aa1a04f' }, h("ibcs-table", { key: '74657d8bca08c78313db7f497c0d7267eee97d00', data: this.data, "table-title": this.prepareTableTitle(), scenarios: this.prepareScenarios(), "scenarios-data-format": this.prepareDataFormat(), grouped: this.prepareGrouped(), limit: this.prepareLimit(), showGroupTitle: this.prepareShowGroupTitle(), thereof: this.prepareThereOf(), partof: this.preparePartOf(), order: this.prepareOrder(), categorythereof: this.prepareColumnThereOf(), type: this.prepareTableType(), "category-width": this.prepareCategoryWidth(), dataFormatDigits: this.prepareDataFormatDigits(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode(), "measure-scale": this.prepareMeasureScale(), "measure-type": this.prepareMeasureType(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(), filter: this.prepareFilter(), barColumns: this.prepareBarColumns(), barColumnMaxWidth: this.prepareBarColumnWidth(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), scaleFactor: effectiveFactor }))));
908
+ return (h(Host, { key: '3690ce4fee5e38012a2f956035110cc3e2500b39', style: fontStyles }, h("div", { key: 'e6481956a6873beefb15ea7369a7352d2662c1a2' }, h("ibcs-table", { key: '3260517d31fa04294c8df293a6fefd88b129f7b6', data: this.data, "table-title": this.prepareTableTitle(), scenarios: this.prepareScenarios(), "scenarios-data-format": this.prepareDataFormat(), grouped: this.prepareGrouped(), limit: this.prepareLimit(), showGroupTitle: this.prepareShowGroupTitle(), thereof: this.prepareThereOf(), partof: this.preparePartOf(), order: this.prepareOrder(), categorythereof: this.prepareColumnThereOf(), type: this.prepareTableType(), "category-width": this.prepareCategoryWidth(), dataFormatDigits: this.prepareDataFormatDigits(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode(), "measure-scale": this.prepareMeasureScale(), "measure-type": this.prepareMeasureType(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(), filter: this.prepareFilter(), barColumns: this.prepareBarColumns(), barColumnMaxWidth: this.prepareBarColumnWidth(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), scaleFactor: effectiveFactor }))));
907
909
  }
908
910
  static get is() { return "bn-table"; }
909
911
  static get encapsulation() { return "shadow"; }
@@ -934,7 +936,7 @@ export class Table {
934
936
  "name": "example",
935
937
  "text": "// Auto-scale to parent (silent)\n<bn-table scale=\"auto\" ...></bn-table>\n\n// Fixed 50 % reduction\n<bn-table scale=\"0.5\" ...></bn-table>\n\n// Double size\n<bn-table scale=\"2\" ...></bn-table>\n\n// No scaling \u2014 always render at base font size\n<bn-table scale=\"none\" ...></bn-table>"
936
938
  }],
937
- "text": "Controls proportional scaling of the entire table relative to the\navailable parent width. All visual dimensions scale together: font size,\nem-based spacing/padding, SVG bar-chart widths, pin lengths, dot radii,\npattern fills, axis strokes, and label offsets.\n\nScaling is driven by a single factor applied to the base font size\n(`global.fontSizePx` from the component-style store, default 13.3333 px).\nBecause the table's SCSS uses `em` units for padding, borders, and\ncolumn widths, changing the font size cascades to all layout dimensions.\nSVG elements (bars, pins, patterns) receive the factor via the\n`scaleFactor` prop on `ibcs-table` and multiply every pixel constant\nby it, so they stay proportional to the surrounding text.\n\n| Value | Behavior |\n|---------------------|----------------------------------------------------------------------------------|\n| not set / `\"\"` | Auto-scale to fit parent width; emit `AUTO_scale` warning with the applied factor |\n| `\"none\"` | No scaling (render at base font size regardless of available space) |\n| `\"auto\"` | Auto-scale to fit parent width silently (no warning) |\n| `\"0.5\"`, `\"1.2\"`, \u2026 | Fixed factor \u2014 apply `baseFontSize \u00D7 factor` |\n\n**Auto-scale algorithm** (modes `\"\"` and `\"auto\"`):\n1. After each render, the CSS variable `--bn-font-size` is temporarily\n reset to the unscaled base size and a synchronous reflow is forced.\n2. The unscaled `scrollWidth` of the table container is compared against\n the parent's content-box width (via `getParentDimensions`).\n3. If the table overflows, `factor = parentWidth / unscaledScrollWidth`\n is computed and applied to both the CSS variable and the\n `appliedScaleFactor` state (which re-renders the SVG charts).\n4. A guard flag (`_autoScaleGuard`) prevents the subsequent\n state-triggered re-render from re-measuring, avoiding an infinite\n measure \u2192 scale \u2192 fits \u2192 reset \u2192 overflow loop.\n\nInvalid values (negative numbers, non-numeric strings that are not\n`\"none\"` or `\"auto\"`) fall back to the default behaviour (auto + warning)\nand emit an `ERR_scale` warning."
939
+ "text": "Controls proportional scaling of the entire table relative to the\navailable parent width. All visual dimensions scale together: font size,\nem-based spacing/padding, SVG bar-chart widths, pin lengths, dot radii,\npattern fills, axis strokes, and label offsets.\n\nScaling is driven by a single factor applied to the base font size\n(`global.fontSizePx` from the component-style store, default 13.3333 px).\nBecause the table's SCSS uses `em` units for padding, borders, and\ncolumn widths, changing the font size cascades to all layout dimensions.\nSVG elements (bars, pins, patterns) receive the factor via the\n`scaleFactor` prop on `ibcs-table` and multiply every pixel constant\nby it, so they stay proportional to the surrounding text.\n\n| Value | Behavior |\n|---------------------|----------------------------------------------------------------------------------|\n| not set / `\"\"` | Auto-scale to fit parent width; emit `AUTO_scale` warning with the applied factor |\n| `\"none\"` | No scaling (render at base font size regardless of available space) |\n| `\"auto\"` | Auto-scale to fit parent width silently (no warning) |\n| `\"0.5\"`, `\"1.2\"`, \u2026 | Fixed factor \u2014 apply `baseFontSize \u00D7 factor` |\n\n**Auto-scale algorithm** (modes `\"\"` and `\"auto\"`):\n1. After each render, the current `scrollWidth` of the host element is\n divided by the current `appliedScaleFactor` to derive the unscaled\n content width. This avoids resetting `--bn-font-size` to base (which\n would only affect em-based widths but not SVG pixel attributes).\n2. This unscaled width is compared against the parent's content-box\n width (via `getParentDimensions`).\n3. If the table overflows, `factor = parentWidth / unscaledWidth`\n is computed and applied to both the CSS variable and the\n `appliedScaleFactor` state (which re-renders the SVG charts).\n4. A guard flag (`_autoScaleGuard`) prevents the subsequent\n state-triggered re-render from re-measuring, avoiding an infinite\n measure \u2192 scale \u2192 fits \u2192 reset \u2192 overflow loop.\n\nInvalid values (negative numbers, non-numeric strings that are not\n`\"none\"` or `\"auto\"`) fall back to the default behaviour (auto + warning)\nand emit an `ERR_scale` warning."
938
940
  },
939
941
  "getter": false,
940
942
  "setter": false,
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from "@stencil/core";
2
- import { OrderDirection, TableType } from "./utils/model";
2
+ import { OrderDirection, TableRowType, TableType } from "./utils/model";
3
3
  import { Table } from "./utils/Table";
4
4
  import { TableComponentConfigAdapter } from "./utils/model/TableComponentConfig";
5
5
  import { TableDrillGroupAdapter } from "./utils/model/TableDrillGroup";
@@ -64,7 +64,7 @@ export class IbcsTable {
64
64
  const errorMsg = this.i18n.get("NO_DATA") || "==No Data==";
65
65
  return h("p", { class: "warning" }, errorMsg);
66
66
  }
67
- return (h("table", null, h("thead", null, this.table.getHeader().map((row) => (h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (h("span", null, i === arr.length - 1 ? (h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (h("span", null, line, cell.drawPrefix(), h("br", null))))))))))))), h("tbody", null, this.table.getBody().map((row) => (h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (h("td", { colSpan: cell.colSpan, class: cell.type ? `${cell.cssStyle} ${cell.type}` : cell.cssStyle }, cell.prefix != null ? (h("span", { class: cell.cssStyle + " " + cell.prefixStyle }, cell.drawPrefix())) : (""), cell.isBarChart && cell.columnStats ? (h(CellBarChart, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: cell.key.startsWith("dr"), isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, maxBarWidth: this.barColumnMaxWidth, styles: this.barChartStyles })) : (cell.draw(this.componentDataFormatDigits)))))))))));
67
+ return (h("table", null, h("thead", null, this.table.getHeader().map((row) => (h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (h("span", null, i === arr.length - 1 ? (h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (h("span", null, line, cell.drawPrefix(), h("br", null))))))))))))), h("tbody", null, this.table.getBody().map((row) => (h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (h("td", { colSpan: cell.colSpan, class: cell.type ? `${cell.cssStyle} ${cell.type}` : cell.cssStyle }, cell.prefix != null ? (h("span", { class: cell.cssStyle + " " + cell.prefixStyle }, cell.drawPrefix())) : (""), cell.isBarChart && cell.columnStats && row.type !== TableRowType.SUM ? (h(CellBarChart, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: cell.key.startsWith("dr"), isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, maxBarWidth: this.barColumnMaxWidth, styles: this.barChartStyles })) : (cell.draw(this.componentDataFormatDigits)))))))))));
68
68
  };
69
69
  return h(Host, null, helper());
70
70
  }
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as i,h as e,Host as a,transformTag as s}from"@stencil/core/internal/client";import{v as r,a as n,i as o,p as l,h as d,q as h,l as p,r as u,k as c,s as v,t as m,b as g,c as y,u as f,m as b,w as S,x as w}from"./validate.js";import{w as O,g as T,p as R}from"./scaling.js";import{w as D,a as _}from"./withHasError.js";import{a as E}from"./context-protocol.js";import{w as M}from"./withTranslation.js";import{w as C}from"./withStyled.js";import{w as F}from"./withComponentStyle.js";import{D as G,b as W,O as P,I as N,e as U,M as A,B as x,T as L}from"./Order.js";import{T as j,d as I}from"./ibcs-table2.js";const k=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.tableTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling=.01,this.percentageScaling=.5,this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped="false",this.showMeasureScale="false",this.showGroupTitle="true",this.type="list",this.limit=0,this.thereof="[]",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this._autoScaleGuard=!1,C(this),D(this),this.errors=_(this),this.componentStyle=F(this),O(this,((t,i)=>{this.data=i||[]}),((t,i)=>{this.datasetMeta=i})),this.t=M(this).t}validateScenario(t){const i="ERR_scenarios",e=r(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="ERR_variances",e=n(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="ERR_barColumns";if(o(t))return void this.errors.remove(i);const e=n(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="ERR_barColumnWidth";l(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="ERR_unitScaling";d(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."})}validatePercentageScaling(t){const i="ERR_percentageScaling";d(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."})}validateDataFormat(t){const i="ERR_dataFormat";h(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateGrouped(t){const i="ERR_grouped";p(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"grouped: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowMeasureScale(t){const i="ERR_grouped";p(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowGroupTitle(t){const i="ERR_showGroupTitle";p(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showGroupTitle: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="ERR_type";u(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="ERR_limit";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="ERR_thereof",e=v(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validatePartOf(t){const i="ERR_partof",e=m(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="ERR_order",e=g(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="ERR_orderDirection";y(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="ERR_measureType";f(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="ERR_measureScale";b(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="ERR_dataFormatDigitsDecimal";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="ERR_dataFormatDigitsPercent";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="ERR_categoryWidth";S(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=w(t),e="ERR_categorythereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateGrouped(this.grouped),this.validateShowGroupTitle(this.showGroupTitle),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateShowMeasureScale(this.showMeasureScale),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}disconnectedCallback(){this.unsubscribe()}componentDidRender(){var t,i;const{mode:e}=R(this.scale);if("auto"!==e&&"empty"!==e)return void(this._autoScaleGuard=!1);if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const a=this.element,{width:s}=T(a);if(s<=0)return;const r=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}));a.style.setProperty("--bn-font-size",r+"px");const n=null===(t=a.shadowRoot)||void 0===t?void 0:t.querySelector("div"),o=null!==(i=null==n?void 0:n.scrollWidth)&&void 0!==i?i:a.scrollWidth;if(o<=s+1)return this.errors.remove("AUTO_scale"),void(1!==this.appliedScaleFactor&&(this._autoScaleGuard=!0,this.appliedScaleFactor=1));const l=(s-1)/o;a.style.setProperty("--bn-font-size",r*l+"px"),"empty"===e?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+l.toFixed(3)}):this.errors.remove("AUTO_scale"),Math.abs(l-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=l)}prepareDataFormat(){var t;return G[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return"true"===this.grouped}prepareShowGroupTitle(){return"true"===this.showGroupTitle}prepareTableType(){var t;return j[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){return null==this.thereof||""===this.thereof.trim()?[]:JSON.parse(this.thereof)}preparePartOf(){return null==this.partof||""===this.partof.trim()?[]:JSON.parse(this.partof)}prepareOrder(){var t,i,e;const a="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());let s=this.order;return a&&(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>P[null==t?void 0:t.toUpperCase()])),direction:W[null===(e=this.orderDirection)||void 0===e?void 0:e.toUpperCase()]}}prepareI18nMode(){return N.META}prepareI18n(){const t=E,i=new Map(["in","category","operation","there_of","part_of","SUM_TOTAL"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries()])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,l;const d="auto"===(null===(t=this.scenarios)||void 0===t?void 0:t.trim().toLowerCase());if((o(this.scenarios)||d)&&o(this.variances))return(null===(e=null===(i=this.datasetMeta)||void 0===i?void 0:i.availableScenarios)||void 0===e?void 0:e.length)>0?(d?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),this.datasetMeta.availableScenarios):[];let h=[];return d||o(this.scenarios)?(null===(s=null===(a=this.datasetMeta)||void 0===a?void 0:a.availableScenarios)||void 0===s?void 0:s.length)>0&&(d?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),h=h.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),h=h.concat(null===(r=this.scenarios)||void 0===r?void 0:r.split(","))),(null===(n=this.variances)||void 0===n?void 0:n.trim().length)>0&&(h=h.concat(null===(l=this.variances)||void 0===l?void 0:l.split(","))),h.map((t=>t.trim()))}prepareCategoryWidth(){var t;return o(this.categoryWidth)?U.INF:U[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return o(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareMeasureType(){var t;return o(this.measureType)?A.VOLUME:A[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=JSON.parse(this.columnthereof),i=new Map;for(const[e,a]of Object.entries(t))!1===i.has(a.scenario)&&i.set(a.scenario,[]),i.get(a.scenario).push(a);return i}prepareTableTitle(){return""===this.tableTitle||null==this.tableTitle?"SUM_TOTAL":this.tableTitle}prepareShowMeasureScale(){return"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=L[i];return e?x[e]:x[L.W10]}prepareBarColumns(){return o(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){return this.pixelPerUnitGroupMap.has(this.unitScaling)?this.pixelPerUnitGroupMap.get(this.unitScaling):Number(this.unitScaling)}preparePercentageScaling(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):Number(this.percentageScaling)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},date:{type:"string",isOptional:!1,description:""},operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}getEffectiveScaleFactor(){const{mode:t,factor:i}=R(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return e(a,{key:"788f67af1bbc37c0ffe1467503e0708ec52a7f53",style:t},e("div",{key:"3f9bcc8cddc8bbdf88681ca3d0ee35e67aa1a04f"},e("ibcs-table",{key:"74657d8bca08c78313db7f497c0d7267eee97d00",data:this.data,"table-title":this.prepareTableTitle(),scenarios:this.prepareScenarios(),"scenarios-data-format":this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),thereof:this.prepareThereOf(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),type:this.prepareTableType(),"category-width":this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),"measure-scale":this.prepareMeasureScale(),"measure-type":this.prepareMeasureType(),"measure-unit":this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),scaleFactor:i})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}]}}static get style(){return":host{display:inline-block;position:relative;overflow:hidden}"}},[1,"bn-table",{scale:[1],tableTitle:[1,"table-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[1],showMeasureScale:[1,"show-measure-scale"],showGroupTitle:[1,"show-group-title"],type:[1],limit:[2],thereof:[1],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],data:[32],datasetMeta:[32],appliedScaleFactor:[32]},void 0,{scale:[{validateScaling:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}]}]),B=k,J=function(){"undefined"!=typeof customElements&&["bn-table","ibcs-table"].forEach((t=>{switch(t){case"bn-table":customElements.get(s(t))||customElements.define(s(t),k);break;case"ibcs-table":customElements.get(s(t))||I()}}))};export{B as BnTable,J as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as i,h as e,Host as a,transformTag as s}from"@stencil/core/internal/client";import{v as r,a as n,i as o,p as l,h as d,q as h,l as p,r as u,k as c,s as m,t as v,b as g,c as y,u as f,m as b,w as S,x as w}from"./validate.js";import{w as O,g as T,p as R}from"./scaling.js";import{w as D,a as _}from"./withHasError.js";import{a as E}from"./context-protocol.js";import{w as M}from"./withTranslation.js";import{w as C}from"./withStyled.js";import{w as F}from"./withComponentStyle.js";import{D as G,b as W,O as P,I as N,e as U,M as A,B as x,T as L}from"./Order.js";import{T as j,d as I}from"./ibcs-table2.js";const k=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.tableTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling=.01,this.percentageScaling=.5,this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped="false",this.showMeasureScale="false",this.showGroupTitle="true",this.type="list",this.limit=0,this.thereof="[]",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this._autoScaleGuard=!1,C(this),D(this),this.errors=_(this),this.componentStyle=F(this),O(this,((t,i)=>{this.data=i||[]}),((t,i)=>{this.datasetMeta=i})),this.t=M(this).t}validateScenario(t){const i="ERR_scenarios",e=r(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="ERR_variances",e=n(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="ERR_barColumns";if(o(t))return void this.errors.remove(i);const e=n(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="ERR_barColumnWidth";l(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="ERR_unitScaling";d(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."})}validatePercentageScaling(t){const i="ERR_percentageScaling";d(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."})}validateDataFormat(t){const i="ERR_dataFormat";h(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateGrouped(t){const i="ERR_grouped";p(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"grouped: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowMeasureScale(t){const i="ERR_grouped";p(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowGroupTitle(t){const i="ERR_showGroupTitle";p(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showGroupTitle: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="ERR_type";u(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="ERR_limit";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="ERR_thereof",e=m(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validatePartOf(t){const i="ERR_partof",e=v(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="ERR_order",e=g(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="ERR_orderDirection";y(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="ERR_measureType";f(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="ERR_measureScale";b(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="ERR_dataFormatDigitsDecimal";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="ERR_dataFormatDigitsPercent";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="ERR_categoryWidth";S(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=w(t),e="ERR_categorythereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateGrouped(this.grouped),this.validateShowGroupTitle(this.showGroupTitle),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateShowMeasureScale(this.showMeasureScale),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}disconnectedCallback(){this.unsubscribe()}componentDidRender(){const{mode:t}=R(this.scale);if("auto"!==t&&"empty"!==t)return void(this._autoScaleGuard=!1);if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const i=this.element,{width:e}=T(i);if(e<=0)return;const a=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),s=i.scrollWidth,r=this.appliedScaleFactor,n=r>0?s/r:s;if(n<=e+1)return this.errors.remove("AUTO_scale"),void(1!==this.appliedScaleFactor&&(i.style.setProperty("--bn-font-size",a+"px"),this._autoScaleGuard=!0,this.appliedScaleFactor=1));const o=(e-1)/n;i.style.setProperty("--bn-font-size",a*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),Math.abs(o-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=o)}prepareDataFormat(){var t;return G[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return"true"===this.grouped}prepareShowGroupTitle(){return"true"===this.showGroupTitle}prepareTableType(){var t;return j[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){return null==this.thereof||""===this.thereof.trim()?[]:JSON.parse(this.thereof)}preparePartOf(){return null==this.partof||""===this.partof.trim()?[]:JSON.parse(this.partof)}prepareOrder(){var t,i,e;const a="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());let s=this.order;return a&&(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>P[null==t?void 0:t.toUpperCase()])),direction:W[null===(e=this.orderDirection)||void 0===e?void 0:e.toUpperCase()]}}prepareI18nMode(){return N.META}prepareI18n(){const t=E,i=new Map(["in","category","operation","there_of","part_of","SUM_TOTAL"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries()])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,l;const d="auto"===(null===(t=this.scenarios)||void 0===t?void 0:t.trim().toLowerCase());if((o(this.scenarios)||d)&&o(this.variances))return(null===(e=null===(i=this.datasetMeta)||void 0===i?void 0:i.availableScenarios)||void 0===e?void 0:e.length)>0?(d?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),this.datasetMeta.availableScenarios):[];let h=[];return d||o(this.scenarios)?(null===(s=null===(a=this.datasetMeta)||void 0===a?void 0:a.availableScenarios)||void 0===s?void 0:s.length)>0&&(d?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),h=h.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),h=h.concat(null===(r=this.scenarios)||void 0===r?void 0:r.split(","))),(null===(n=this.variances)||void 0===n?void 0:n.trim().length)>0&&(h=h.concat(null===(l=this.variances)||void 0===l?void 0:l.split(","))),h.map((t=>t.trim()))}prepareCategoryWidth(){var t;return o(this.categoryWidth)?U.INF:U[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return o(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareMeasureType(){var t;return o(this.measureType)?A.VOLUME:A[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=JSON.parse(this.columnthereof),i=new Map;for(const[e,a]of Object.entries(t))!1===i.has(a.scenario)&&i.set(a.scenario,[]),i.get(a.scenario).push(a);return i}prepareTableTitle(){return""===this.tableTitle||null==this.tableTitle?"SUM_TOTAL":this.tableTitle}prepareShowMeasureScale(){return"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=L[i];return e?x[e]:x[L.W10]}prepareBarColumns(){return o(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){return this.pixelPerUnitGroupMap.has(this.unitScaling)?this.pixelPerUnitGroupMap.get(this.unitScaling):Number(this.unitScaling)}preparePercentageScaling(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):Number(this.percentageScaling)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},date:{type:"string",isOptional:!1,description:""},operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}getEffectiveScaleFactor(){const{mode:t,factor:i}=R(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return e(a,{key:"3690ce4fee5e38012a2f956035110cc3e2500b39",style:t},e("div",{key:"e6481956a6873beefb15ea7369a7352d2662c1a2"},e("ibcs-table",{key:"3260517d31fa04294c8df293a6fefd88b129f7b6",data:this.data,"table-title":this.prepareTableTitle(),scenarios:this.prepareScenarios(),"scenarios-data-format":this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),thereof:this.prepareThereOf(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),type:this.prepareTableType(),"category-width":this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),"measure-scale":this.prepareMeasureScale(),"measure-type":this.prepareMeasureType(),"measure-unit":this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),scaleFactor:i})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}]}}static get style(){return":host{display:inline-block;position:relative;overflow:hidden}"}},[1,"bn-table",{scale:[1],tableTitle:[1,"table-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[1],showMeasureScale:[1,"show-measure-scale"],showGroupTitle:[1,"show-group-title"],type:[1],limit:[2],thereof:[1],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],data:[32],datasetMeta:[32],appliedScaleFactor:[32]},void 0,{scale:[{validateScaling:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}]}]),B=k,J=function(){"undefined"!=typeof customElements&&["bn-table","ibcs-table"].forEach((t=>{switch(t){case"bn-table":customElements.get(s(t))||customElements.define(s(t),k);break;case"ibcs-table":customElements.get(s(t))||I()}}))};export{B as BnTable,J as defineCustomElement}