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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-06946f44.entry.js +1 -0
  3. package/dist/bn-template-engine/p-0fabe296.entry.js +1 -0
  4. package/dist/bn-template-engine/p-1164c0b0.entry.js +1 -0
  5. package/dist/bn-template-engine/p-355abdf0.entry.js +1 -0
  6. package/dist/bn-template-engine/p-79KuA4Ox.js +1 -0
  7. package/dist/bn-template-engine/p-859cc06d.entry.js +1 -0
  8. package/dist/bn-template-engine/p-8acec99e.entry.js +1 -0
  9. package/dist/bn-template-engine/p-8f490c45.entry.js +1 -0
  10. package/dist/bn-template-engine/p-98cf512f.entry.js +1 -0
  11. package/dist/bn-template-engine/p-9a564f8f.entry.js +1 -0
  12. package/dist/bn-template-engine/{p-CL1RYuNU.js → p-B0lsgVuN.js} +1 -1
  13. package/dist/bn-template-engine/p-B7p8beYH.js +1 -0
  14. package/dist/bn-template-engine/p-BDh7GfC5.js +1 -0
  15. package/dist/bn-template-engine/p-BoMtoHJB.js +1 -0
  16. package/dist/bn-template-engine/p-Bs8BqBsb.js +1 -0
  17. package/dist/bn-template-engine/p-CYjZRKdI.js +1 -0
  18. package/dist/bn-template-engine/{p-P7pGJBgc.js → p-DG-1MR_T.js} +1 -1
  19. package/dist/bn-template-engine/p-bdd2b243.entry.js +1 -0
  20. package/dist/bn-template-engine/p-e6b24f15.entry.js +1 -0
  21. package/dist/bn-template-engine/p-f27995c9.entry.js +1 -0
  22. package/dist/bn-template-engine/{p-Bnhh02CF.js → p-sRO-lj7X.js} +1 -1
  23. package/dist/bn-template-engine/p-tzFCK9qn.js +1 -0
  24. package/dist/cjs/{Order-iG11HI4R.js → Order-BGx39pS5.js} +448 -0
  25. package/dist/cjs/{alasql.min-C_nHTuEQ.js → SVGVariancesStyleGroup-BqAdPYtL.js} +8228 -3
  26. package/dist/cjs/bn-asset_16.cjs.entry.js +9018 -0
  27. package/dist/cjs/bn-card.cjs.entry.js +3 -4
  28. package/dist/cjs/bn-chart-time.cjs.entry.js +11 -16
  29. package/dist/cjs/bn-grid.cjs.entry.js +5 -8
  30. package/dist/cjs/bn-image.cjs.entry.js +5 -8
  31. package/dist/cjs/bn-internationalization.cjs.entry.js +3 -4
  32. package/dist/cjs/bn-layout-card.cjs.entry.js +125 -6
  33. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  34. package/dist/cjs/bn-template.cjs.entry.js +2 -3
  35. package/dist/cjs/bn-text.cjs.entry.js +7 -11
  36. package/dist/cjs/bn-tree.cjs.entry.js +5 -8
  37. package/dist/cjs/{formatter-DIJL_crx.js → formatter-4XCS0d2B.js} +8 -2
  38. package/dist/cjs/ibcs-chart-time.cjs.entry.js +37 -42
  39. package/dist/cjs/loader.cjs.js +1 -1
  40. package/dist/cjs/{scaling-9Tz595RQ.js → scaling-BidPsO53.js} +115 -12
  41. package/dist/cjs/{withBodyObserver-CKpSD8UT.js → withBodyObserver-C6gLgq_e.js} +3 -3
  42. package/dist/cjs/{withComponentStatus-Bw70BhO0.js → withComponentStatus-_x4LQZ0N.js} +5 -5
  43. package/dist/cjs/{withComponentStyle-aIbTCtfj.js → withComponentStyle-ClSJfCku.js} +4 -4
  44. package/dist/cjs/{utils-CwHIVbbL.js → withHasError-B8gHkfV2.js} +69 -1
  45. package/dist/cjs/{withStyled-CS1Yp4sv.js → withStyled-9tG024gQ.js} +62 -9
  46. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +11 -0
  47. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +5 -2
  48. package/dist/collection/components/bn-layout-card/bn-layout-card.css +1 -0
  49. package/dist/collection/components/bn-layout-card/bn-layout-card.js +162 -27
  50. package/dist/collection/components/bn-layout-page/bn-layout-page.css +1 -0
  51. package/dist/collection/components/bn-layout-page/bn-layout-page.js +151 -33
  52. package/dist/collection/components/bn-table/bn-table.js +12 -10
  53. package/dist/collection/components/bn-table/ibcs-table.js +2 -2
  54. package/dist/collection/utils/parentDimensions.js +38 -6
  55. package/dist/components/bn-layout-card.js +1 -1
  56. package/dist/components/bn-layout-page.js +1 -1
  57. package/dist/components/bn-table.js +1 -1
  58. package/dist/components/ibcs-chart-structure2.js +1 -1
  59. package/dist/components/ibcs-table2.js +1 -1
  60. package/dist/components/scaling.js +1 -1
  61. package/dist/esm/{Order-Bnhh02CF.js → Order-sRO-lj7X.js} +448 -1
  62. package/dist/esm/{alasql.min-CWu4NkIt.js → SVGVariancesStyleGroup-DOIT-zvI.js} +8212 -2
  63. package/dist/esm/bn-asset_16.entry.js +9001 -0
  64. package/dist/esm/bn-card.entry.js +4 -5
  65. package/dist/esm/bn-chart-time.entry.js +8 -13
  66. package/dist/esm/bn-grid.entry.js +6 -9
  67. package/dist/esm/bn-image.entry.js +6 -9
  68. package/dist/esm/bn-internationalization.entry.js +4 -5
  69. package/dist/esm/bn-layout-card.entry.js +126 -7
  70. package/dist/esm/bn-template-engine.js +1 -1
  71. package/dist/esm/bn-template.entry.js +2 -3
  72. package/dist/esm/bn-text.entry.js +7 -11
  73. package/dist/esm/bn-tree.entry.js +6 -9
  74. package/dist/esm/{context-protocol-BHnQsVsr.js → context-protocol-2peaD4y8.js} +1 -1
  75. package/dist/esm/editor-companion.entry.js +1 -1
  76. package/dist/esm/{formatter-DTMEZ6d8.js → formatter-BDh7GfC5.js} +6 -2
  77. package/dist/esm/ibcs-chart-time.entry.js +3 -8
  78. package/dist/esm/loader.js +1 -1
  79. package/dist/esm/{scaling-Cehc74IE.js → scaling-BOcjT8M0.js} +112 -10
  80. package/dist/esm/{withBodyObserver-FQ8NwCIz.js → withBodyObserver-DczL5ia8.js} +1 -1
  81. package/dist/esm/{withComponentStatus-DWjDYtZ7.js → withComponentStatus-DodoSXe-.js} +1 -1
  82. package/dist/esm/{withComponentStyle-9uP_hcDq.js → withComponentStyle-D3VWOsto.js} +2 -2
  83. package/dist/esm/{utils-DvvwfRQG.js → withHasError-B3QX2emi.js} +69 -1
  84. package/dist/esm/{withStyled--qQWquTH.js → withStyled-CE3_3taP.js} +57 -5
  85. package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +2 -0
  86. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +139 -0
  87. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +154 -0
  88. package/dist/types/components/bn-table/bn-table.d.ts +7 -5
  89. package/dist/types/components.d.ts +170 -2
  90. package/dist/types/utils/parentDimensions.d.ts +6 -1
  91. package/package.json +1 -1
  92. package/dist/bn-template-engine/p-1265d8d3.entry.js +0 -1
  93. package/dist/bn-template-engine/p-15516dac.entry.js +0 -1
  94. package/dist/bn-template-engine/p-1c716641.entry.js +0 -1
  95. package/dist/bn-template-engine/p-1jFf17Vj.js +0 -1
  96. package/dist/bn-template-engine/p-27cc8dc0.entry.js +0 -1
  97. package/dist/bn-template-engine/p-4426d484.entry.js +0 -1
  98. package/dist/bn-template-engine/p-51f8dc9e.entry.js +0 -1
  99. package/dist/bn-template-engine/p-53d4e690.entry.js +0 -1
  100. package/dist/bn-template-engine/p-5KQYRQLK.js +0 -1
  101. package/dist/bn-template-engine/p-745f4596.entry.js +0 -1
  102. package/dist/bn-template-engine/p-75e97c87.entry.js +0 -1
  103. package/dist/bn-template-engine/p-7a560278.entry.js +0 -1
  104. package/dist/bn-template-engine/p-7ea7c325.entry.js +0 -1
  105. package/dist/bn-template-engine/p-945cc95d.entry.js +0 -1
  106. package/dist/bn-template-engine/p-BFTU3MAI.js +0 -1
  107. package/dist/bn-template-engine/p-BYBpC0EO.js +0 -1
  108. package/dist/bn-template-engine/p-BYmPQYxx.js +0 -1
  109. package/dist/bn-template-engine/p-BfXY5dsy.js +0 -1
  110. package/dist/bn-template-engine/p-BgnHJQ9Q.js +0 -1
  111. package/dist/bn-template-engine/p-Bhd_WSML.js +0 -1
  112. package/dist/bn-template-engine/p-Bka-Z6jo.js +0 -1
  113. package/dist/bn-template-engine/p-C7dQL8CS.js +0 -1
  114. package/dist/bn-template-engine/p-CYwd_ZNM.js +0 -1
  115. package/dist/bn-template-engine/p-ChlK-T9I.js +0 -1
  116. package/dist/bn-template-engine/p-DHezf8pZ.js +0 -1
  117. package/dist/bn-template-engine/p-DlppAFq9.js +0 -1
  118. package/dist/bn-template-engine/p-DvDDgmcV.js +0 -1
  119. package/dist/bn-template-engine/p-DvvwfRQG.js +0 -1
  120. package/dist/bn-template-engine/p-b34eaf86.entry.js +0 -1
  121. package/dist/bn-template-engine/p-bdb8b44c.entry.js +0 -1
  122. package/dist/bn-template-engine/p-c44fcb8e.entry.js +0 -1
  123. package/dist/bn-template-engine/p-c7e1a49b.entry.js +0 -1
  124. package/dist/bn-template-engine/p-d9003041.entry.js +0 -1
  125. package/dist/bn-template-engine/p-daa7ffa3.entry.js +0 -1
  126. package/dist/bn-template-engine/p-e084f50a.entry.js +0 -1
  127. package/dist/bn-template-engine/p-eaba6658.entry.js +0 -1
  128. package/dist/bn-template-engine/p-u8igQLRZ.js +0 -1
  129. package/dist/cjs/DataFormatDigits-DKcOeLNK.js +0 -142
  130. package/dist/cjs/DateStringFactory-CSKvbS8K.js +0 -452
  131. package/dist/cjs/SVGVariancesStyleGroup-K-Tw6lOD.js +0 -7960
  132. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +0 -10
  133. package/dist/cjs/bn-asset.cjs.entry.js +0 -42
  134. package/dist/cjs/bn-body_4.cjs.entry.js +0 -748
  135. package/dist/cjs/bn-chart-structure_5.cjs.entry.js +0 -3934
  136. package/dist/cjs/bn-component-style.cjs.entry.js +0 -44
  137. package/dist/cjs/bn-dataset.cjs.entry.js +0 -306
  138. package/dist/cjs/bn-layout-page.cjs.entry.js +0 -143
  139. package/dist/cjs/bn-message.cjs.entry.js +0 -52
  140. package/dist/cjs/bn-table.cjs.entry.js +0 -979
  141. package/dist/cjs/contentDecoder-JxOldq1e.js +0 -419
  142. package/dist/cjs/emotion-hash.esm-nbbEQ0Dn.js +0 -57
  143. package/dist/cjs/ibcs-table.cjs.entry.js +0 -2276
  144. package/dist/cjs/ibcsRuleSet-DgUoXOfd.js +0 -136
  145. package/dist/cjs/index-Dm85hG6t.js +0 -65
  146. package/dist/cjs/withHasError-D7ue5vAv.js +0 -72
  147. package/dist/cjs/withTranslation-rwgyITqe.js +0 -77
  148. package/dist/esm/DataFormatDigits-oSZ1hBKE.js +0 -137
  149. package/dist/esm/DateStringFactory-CSGz6TDk.js +0 -450
  150. package/dist/esm/SVGVariancesStyleGroup-CqTjrZYg.js +0 -7950
  151. package/dist/esm/_commonjsHelpers-BFTU3MAI.js +0 -7
  152. package/dist/esm/bn-asset.entry.js +0 -40
  153. package/dist/esm/bn-body_4.entry.js +0 -743
  154. package/dist/esm/bn-chart-structure_5.entry.js +0 -3928
  155. package/dist/esm/bn-component-style.entry.js +0 -42
  156. package/dist/esm/bn-dataset.entry.js +0 -304
  157. package/dist/esm/bn-layout-page.entry.js +0 -141
  158. package/dist/esm/bn-message.entry.js +0 -50
  159. package/dist/esm/bn-table.entry.js +0 -977
  160. package/dist/esm/contentDecoder-oMmxz6nJ.js +0 -416
  161. package/dist/esm/emotion-hash.esm-BYBpC0EO.js +0 -55
  162. package/dist/esm/ibcs-table.entry.js +0 -2274
  163. package/dist/esm/ibcsRuleSet-K4ytuA1f.js +0 -133
  164. package/dist/esm/index-DHezf8pZ.js +0 -65
  165. package/dist/esm/withHasError-FyY5mQ_3.js +0 -70
  166. package/dist/esm/withTranslation-BqD0Kp7b.js +0 -75
@@ -3,6 +3,7 @@
3
3
  color: var(--bn-font-color, black);
4
4
  font-family: var(--bn-font-family, "Noto Sans", sans-serif);
5
5
  font-size: var(--bn-font-size, 13.3333px);
6
+ display: block;
6
7
  flex-direction: column;
7
8
  overflow: hidden;
8
9
  float: left;
@@ -2,18 +2,109 @@ import { h, Fragment } from "@stencil/core";
2
2
  import withHasError from "../../utils/withHasError";
3
3
  export class LayoutPage {
4
4
  constructor() {
5
+ /**
6
+ * Message text displayed in the message row above the title.
7
+ * If empty, the message row is omitted.
8
+ */
5
9
  this.messageText = "";
10
+ /**
11
+ * URL or asset name of the image displayed in the message row.
12
+ * If the value is not an HTTP URL it is looked up in the asset store.
13
+ * If empty, the image is omitted.
14
+ *
15
+ * @example
16
+ * <bn-layout-page message-image="debug/concordia.png"></bn-layout-page>
17
+ */
6
18
  this.messageImage = "";
19
+ /**
20
+ * Name of the business unit displayed in the title header row.
21
+ * If empty, the business unit row is omitted.
22
+ *
23
+ * @example
24
+ * <bn-layout-page title-business-unit="Group Controlling"></bn-layout-page>
25
+ */
7
26
  this.titleBusinessUnit = "";
27
+ /**
28
+ * Primary column on which the order direction is applied.
29
+ * <br /><br />
30
+ * values:<br />
31
+ * ```category // categoryindex // rowgroup // rowgroupindex // ac // fc // py // pl```
32
+ */
8
33
  this.titleOrder = "category";
34
+ /**
35
+ * Sorting order direction for the column specified by `titleOrder`.
36
+ * <br /><br />
37
+ * values:<br />
38
+ * ```asc // desc```
39
+ */
9
40
  this.titleOrderDirection = "asc";
41
+ /**
42
+ * Date display format used in the title row.
43
+ * <br /><br />
44
+ * values:<br />
45
+ * ```year // quarter // month // week // day // time // auto // none```
46
+ * <br /><br />
47
+ * `year`: YYYY, `quarter`: Q[Q] YYYY, `month`: MMM YYYY,
48
+ * `week`: [KW]WW YYYY, `day`: DD.MM.YYYY, `time`: DD.MM.YYYY HH:mm:ss,
49
+ * `auto`: automatic detection, `none`: DD.MM.YYYY.
50
+ */
10
51
  this.titleDateFormat = "none";
52
+ /**
53
+ * Format in which the start and end dates are linked in the title.
54
+ * If set to `none` a plain date is shown.
55
+ * <br /><br />
56
+ * values:<br />
57
+ * ```avg // interval // cum // start // end // ytd // ytg // mat // none```
58
+ * <br /><br />
59
+ * `avg`: Ø[DATE], `interval`: [DATE]..[DATE2], `start`: .[DATE],
60
+ * `end`: [DATE]., `ytd`: _[DATE], `ytg`: [DATE]_, `cum`: [DATE]_[DATE2],
61
+ * `mat`: ~[DATE], `none`: [DATE].
62
+ */
11
63
  this.titleDateLink = "none";
64
+ /**
65
+ * Namespace used for title translations via the internationalization store.
66
+ */
12
67
  this.titleNamespace = "_system";
68
+ /**
69
+ * Whether to display the page number in the footer.
70
+ */
13
71
  this.footerDisplayPageNumber = true;
72
+ /**
73
+ * Layout mode that controls how child components are arranged in the
74
+ * page body using CSS Grid.
75
+ * <br /><br />
76
+ * values:<br />
77
+ * ```full // split-vertical // split-horizontal // 2x2 // 3x3 // 4x4 // 1-over-2 // 1-over-3 // 2-over-1 // 3-over-1 // custom-template```
78
+ * <br /><br />
79
+ * `full`: single slot. `split-vertical`: two side-by-side slots.
80
+ * `split-horizontal`: two stacked slots. `NxN`: equal grid.
81
+ * `1-over-2`: one full-width slot on top, two below. `custom-template`:
82
+ * uses the `pageCustomTemplate` CSS grid-template-areas string.
83
+ *
84
+ * @example
85
+ * <bn-layout-page page-layout="2x2"></bn-layout-page>
86
+ */
14
87
  this.pageLayout = "full";
88
+ /**
89
+ * CSS `grid-template-areas` string used when `pageLayout` is set to
90
+ * `custom-template`. Each quoted row defines a grid row; letters map to
91
+ * slot indices in order of first appearance.
92
+ *
93
+ * @example
94
+ * <bn-layout-page page-layout="custom-template"
95
+ * page-custom-template='"a a" "b c"'></bn-layout-page>
96
+ */
15
97
  this.pageCustomTemplate = '"a b" "c d"';
98
+ /**
99
+ * Gap between grid cells in pixels.
100
+ */
16
101
  this.pageGridGap = "0";
102
+ /**
103
+ * When `true`, the page body height shrinks to fit its content
104
+ * (`fit-content`). When `false`, the body stretches to fill the
105
+ * full page height (`100%`). Width is always `100%` regardless
106
+ * of this setting.
107
+ */
17
108
  this.pageFitToContent = true;
18
109
  this.templateMap = new Map([
19
110
  ["split-vertical", '"a b"'],
@@ -33,20 +124,32 @@ export class LayoutPage {
33
124
  }
34
125
  getCommonStyles() {
35
126
  let height = "100%";
36
- let width = "100%";
37
127
  if (this.pageFitToContent === true) {
38
- width = "fit-content";
39
128
  height = "fit-content";
40
129
  }
130
+ // Width is always 100% — page width is fixed by page format (XGA, A4, etc.).
131
+ // Using fit-content for width makes the grid indefinite, causing CSS Grid to
132
+ // treat percentage column tracks as "auto" (content-sized), which breaks
133
+ // equal column splits and auto-scaling in child components.
41
134
  return {
42
135
  display: "grid",
43
136
  height: height,
44
- width: width,
137
+ width: "100%",
45
138
  gap: this.pageGridGap + "px",
46
139
  };
47
140
  }
141
+ getGridTemplateRows(name) {
142
+ const template = this.getTemplateAreas(name);
143
+ const pattern = /"[\w\d\s.]+"/g;
144
+ const matches = template.match(pattern);
145
+ const rowCount = matches ? matches.length : 1;
146
+ if (this.pageFitToContent) {
147
+ return Array(rowCount).fill("auto").join(" ");
148
+ }
149
+ return Array(rowCount).fill("1fr").join(" ");
150
+ }
48
151
  getLayoutStyle() {
49
- return Object.assign(Object.assign({}, this.getCommonStyles()), { "grid-template-areas": this.getTemplateAreas(this.pageLayout), "grid-template-columns": this.getGridTemplateColumns(this.pageLayout) });
152
+ return Object.assign(Object.assign({}, this.getCommonStyles()), { "grid-template-areas": this.getTemplateAreas(this.pageLayout), "grid-template-columns": this.getGridTemplateColumns(this.pageLayout), "grid-template-rows": this.getGridTemplateRows(this.pageLayout) });
50
153
  }
51
154
  createDivAreaStyles(elements) {
52
155
  return elements.map((x) => ({
@@ -127,7 +230,7 @@ export class LayoutPage {
127
230
  const arrOfSlots = this.extractSlotNames(style["grid-template-areas"]);
128
231
  return (
129
232
  // @ts-ignore
130
- h("bn-page", { key: '2f67c9b949ab18de247ea492c95b1e53e450fcca', styles: this.styles, format: this.pageFormat, orientation: this.pageOrientation }, h("bn-message", { key: '6fb865fe6cf9785c6a3932967d9969d5e0a4eda5', text: this.messageText, image: this.messageImage }), h("bn-title", { key: '3ba10325d834b364d0a68012f589ba5508877652', namespace: this.titleNamespace, "business-unit": this.titleBusinessUnit, scenarios: this.titleScenarios, variances: this.titleVariances, order: this.titleOrder, "order-direction": this.titleOrderDirection, measures: this.titleMeasures, "date-start": this.titleDateStart, "date-end": this.titleDateEnd, "date-format": this.titleDateFormat, "date-link": this.titleDateLink }), h("bn-body", { key: '16bcb1e231d65b2f0e90c82d8e3ec1a84cc79c59' }, h("div", { key: '1408692a37d04686e5d9ad00bca7f1d24787b595', style: style }, this.getSlots(arrOfSlots))), h("bn-footer", { key: '83e924e38db44fb678490a8a4d12b264699fc3e2', text: this.footerText, "page-number": this.pageNumber, "display-page-number": this.footerDisplayPageNumber })));
233
+ h("bn-page", { key: '1c262428d9e69966f3089f5018b5a71e348c31b7', styles: this.styles, format: this.pageFormat, orientation: this.pageOrientation }, h("bn-message", { key: 'c687e6d660a7301202663644f2bce0e20d148420', text: this.messageText, image: this.messageImage }), h("bn-title", { key: '6e30d548765d8b32f7ab85c6203c1af2142d55c5', namespace: this.titleNamespace, "business-unit": this.titleBusinessUnit, scenarios: this.titleScenarios, variances: this.titleVariances, order: this.titleOrder, "order-direction": this.titleOrderDirection, measures: this.titleMeasures, "date-start": this.titleDateStart, "date-end": this.titleDateEnd, "date-format": this.titleDateFormat, "date-link": this.titleDateLink }), h("bn-body", { key: 'a691c212bcf2ed7c95792de989be4a5c5d30aa5f' }, h("div", { key: '150f9e5941e723f527166ef9071b721b194101fe', style: style }, this.getSlots(arrOfSlots))), h("bn-footer", { key: '9868b2deab6302fc029b6d9f9780d84269245979', text: this.footerText, "page-number": this.pageNumber, "display-page-number": this.footerDisplayPageNumber })));
131
234
  }
132
235
  static get is() { return "bn-layout-page"; }
133
236
  static get encapsulation() { return "shadow"; }
@@ -155,7 +258,7 @@ export class LayoutPage {
155
258
  "optional": true,
156
259
  "docs": {
157
260
  "tags": [],
158
- "text": ""
261
+ "text": "JSON string of component-style overrides passed through to the inner\n`<bn-page>` element. Typically set via a `ComponentStyle` manifest\nrather than directly on the component."
159
262
  },
160
263
  "getter": false,
161
264
  "setter": false,
@@ -174,7 +277,7 @@ export class LayoutPage {
174
277
  "optional": false,
175
278
  "docs": {
176
279
  "tags": [],
177
- "text": ""
280
+ "text": "Message text displayed in the message row above the title.\nIf empty, the message row is omitted."
178
281
  },
179
282
  "getter": false,
180
283
  "setter": false,
@@ -193,8 +296,11 @@ export class LayoutPage {
193
296
  "required": false,
194
297
  "optional": false,
195
298
  "docs": {
196
- "tags": [],
197
- "text": ""
299
+ "tags": [{
300
+ "name": "example",
301
+ "text": "<bn-layout-page message-image=\"debug/concordia.png\"></bn-layout-page>"
302
+ }],
303
+ "text": "URL or asset name of the image displayed in the message row.\nIf the value is not an HTTP URL it is looked up in the asset store.\nIf empty, the image is omitted."
198
304
  },
199
305
  "getter": false,
200
306
  "setter": false,
@@ -213,8 +319,11 @@ export class LayoutPage {
213
319
  "required": false,
214
320
  "optional": false,
215
321
  "docs": {
216
- "tags": [],
217
- "text": ""
322
+ "tags": [{
323
+ "name": "example",
324
+ "text": "<bn-layout-page title-business-unit=\"Group Controlling\"></bn-layout-page>"
325
+ }],
326
+ "text": "Name of the business unit displayed in the title header row.\nIf empty, the business unit row is omitted."
218
327
  },
219
328
  "getter": false,
220
329
  "setter": false,
@@ -234,7 +343,7 @@ export class LayoutPage {
234
343
  "optional": true,
235
344
  "docs": {
236
345
  "tags": [],
237
- "text": ""
346
+ "text": "List of scenarios displayed in the title header.\n<br /><br />\nComma-separated string or omitted. If empty, the scenarios row is omitted.\n<br /><br />\nvalues:<br />\n```ac // fc // py // pl```"
238
347
  },
239
348
  "getter": false,
240
349
  "setter": false,
@@ -253,7 +362,7 @@ export class LayoutPage {
253
362
  "optional": true,
254
363
  "docs": {
255
364
  "tags": [],
256
- "text": ""
365
+ "text": "List of variances calculated from the given scenarios.\nThe scenarios used in the variances must also be defined in\nthe `titleScenarios` property. The variance is defined as\n(ScenarioA \u2212 ScenarioB). The pos/neg/neu postfix defines\nwhich direction is considered \"good\".\n<br /><br />\nIf empty, variance indicators are hidden.\n<br /><br />\npattern:<br />\n```d<scenarioB>_<scenarioA>_[pos/neg/neu]```"
257
366
  },
258
367
  "getter": false,
259
368
  "setter": false,
@@ -272,7 +381,7 @@ export class LayoutPage {
272
381
  "optional": false,
273
382
  "docs": {
274
383
  "tags": [],
275
- "text": ""
384
+ "text": "Primary column on which the order direction is applied.\n<br /><br />\nvalues:<br />\n```category // categoryindex // rowgroup // rowgroupindex // ac // fc // py // pl```"
276
385
  },
277
386
  "getter": false,
278
387
  "setter": false,
@@ -292,7 +401,7 @@ export class LayoutPage {
292
401
  "optional": false,
293
402
  "docs": {
294
403
  "tags": [],
295
- "text": ""
404
+ "text": "Sorting order direction for the column specified by `titleOrder`.\n<br /><br />\nvalues:<br />\n```asc // desc```"
296
405
  },
297
406
  "getter": false,
298
407
  "setter": false,
@@ -311,8 +420,11 @@ export class LayoutPage {
311
420
  "required": false,
312
421
  "optional": true,
313
422
  "docs": {
314
- "tags": [],
315
- "text": ""
423
+ "tags": [{
424
+ "name": "example",
425
+ "text": "<bn-layout-page title-measures='[{\"name\":\"Revenue\",\"unit\":\"mEUR\"}]'></bn-layout-page>"
426
+ }],
427
+ "text": "Array of measure objects with `name` and `unit` displayed in the title.\nPassed as a JSON string. If all units are the same, redundant units are\nreduced and names concatenated. If empty, the measure row is omitted."
316
428
  },
317
429
  "getter": false,
318
430
  "setter": false,
@@ -331,7 +443,7 @@ export class LayoutPage {
331
443
  "optional": true,
332
444
  "docs": {
333
445
  "tags": [],
334
- "text": ""
446
+ "text": "Start date displayed in the title date row.\nAccepts `yyyy-MM-dd` (e.g. `2024-01-01`) or ISO 8601 datetime\n(e.g. `2024-01-01T14:30:00Z`)."
335
447
  },
336
448
  "getter": false,
337
449
  "setter": false,
@@ -350,7 +462,7 @@ export class LayoutPage {
350
462
  "optional": true,
351
463
  "docs": {
352
464
  "tags": [],
353
- "text": ""
465
+ "text": "End date displayed in the title date row.\nAccepts `yyyy-MM-dd` (e.g. `2024-12-31`) or ISO 8601 datetime\n(e.g. `2024-12-31T23:59:59Z`)."
354
466
  },
355
467
  "getter": false,
356
468
  "setter": false,
@@ -369,7 +481,7 @@ export class LayoutPage {
369
481
  "optional": false,
370
482
  "docs": {
371
483
  "tags": [],
372
- "text": ""
484
+ "text": "Date display format used in the title row.\n<br /><br />\nvalues:<br />\n```year // quarter // month // week // day // time // auto // none```\n<br /><br />\n`year`: YYYY, `quarter`: Q[Q] YYYY, `month`: MMM YYYY,\n`week`: [KW]WW YYYY, `day`: DD.MM.YYYY, `time`: DD.MM.YYYY HH:mm:ss,\n`auto`: automatic detection, `none`: DD.MM.YYYY."
373
485
  },
374
486
  "getter": false,
375
487
  "setter": false,
@@ -389,7 +501,7 @@ export class LayoutPage {
389
501
  "optional": false,
390
502
  "docs": {
391
503
  "tags": [],
392
- "text": ""
504
+ "text": "Format in which the start and end dates are linked in the title.\nIf set to `none` a plain date is shown.\n<br /><br />\nvalues:<br />\n```avg // interval // cum // start // end // ytd // ytg // mat // none```\n<br /><br />\n`avg`: \u00D8[DATE], `interval`: [DATE]..[DATE2], `start`: .[DATE],\n`end`: [DATE]., `ytd`: _[DATE], `ytg`: [DATE]_, `cum`: [DATE]_[DATE2],\n`mat`: ~[DATE], `none`: [DATE]."
393
505
  },
394
506
  "getter": false,
395
507
  "setter": false,
@@ -409,7 +521,7 @@ export class LayoutPage {
409
521
  "optional": false,
410
522
  "docs": {
411
523
  "tags": [],
412
- "text": ""
524
+ "text": "Namespace used for title translations via the internationalization store."
413
525
  },
414
526
  "getter": false,
415
527
  "setter": false,
@@ -429,7 +541,7 @@ export class LayoutPage {
429
541
  "optional": true,
430
542
  "docs": {
431
543
  "tags": [],
432
- "text": ""
544
+ "text": "Page size format. Determines the pixel dimensions of the rendered page.\n<br /><br />\nvalues:<br />\n```xga // hd // full-hd // 4k // 4k2k // a4 // a3 // a2 // a1 // a0 // letter // legal```"
433
545
  },
434
546
  "getter": false,
435
547
  "setter": false,
@@ -448,7 +560,7 @@ export class LayoutPage {
448
560
  "optional": true,
449
561
  "docs": {
450
562
  "tags": [],
451
- "text": ""
563
+ "text": "Page orientation. Default depends on the chosen format.\n<br /><br />\nvalues:<br />\n```landscape // portrait```"
452
564
  },
453
565
  "getter": false,
454
566
  "setter": false,
@@ -467,7 +579,7 @@ export class LayoutPage {
467
579
  "optional": true,
468
580
  "docs": {
469
581
  "tags": [],
470
- "text": ""
582
+ "text": "Page number displayed in the footer. If empty, no page number is shown\n(unless `footerDisplayPageNumber` is also set)."
471
583
  },
472
584
  "getter": false,
473
585
  "setter": false,
@@ -486,7 +598,7 @@ export class LayoutPage {
486
598
  "optional": true,
487
599
  "docs": {
488
600
  "tags": [],
489
- "text": ""
601
+ "text": "Text displayed in the page footer. If empty, the footer text is omitted."
490
602
  },
491
603
  "getter": false,
492
604
  "setter": false,
@@ -505,7 +617,7 @@ export class LayoutPage {
505
617
  "optional": true,
506
618
  "docs": {
507
619
  "tags": [],
508
- "text": ""
620
+ "text": "Whether to display the page number in the footer."
509
621
  },
510
622
  "getter": false,
511
623
  "setter": false,
@@ -524,8 +636,11 @@ export class LayoutPage {
524
636
  "required": false,
525
637
  "optional": false,
526
638
  "docs": {
527
- "tags": [],
528
- "text": ""
639
+ "tags": [{
640
+ "name": "example",
641
+ "text": "<bn-layout-page page-layout=\"2x2\"></bn-layout-page>"
642
+ }],
643
+ "text": "Layout mode that controls how child components are arranged in the\npage body using CSS Grid.\n<br /><br />\nvalues:<br />\n```full // split-vertical // split-horizontal // 2x2 // 3x3 // 4x4 // 1-over-2 // 1-over-3 // 2-over-1 // 3-over-1 // custom-template```\n<br /><br />\n`full`: single slot. `split-vertical`: two side-by-side slots.\n`split-horizontal`: two stacked slots. `NxN`: equal grid.\n`1-over-2`: one full-width slot on top, two below. `custom-template`:\nuses the `pageCustomTemplate` CSS grid-template-areas string."
529
644
  },
530
645
  "getter": false,
531
646
  "setter": false,
@@ -544,8 +659,11 @@ export class LayoutPage {
544
659
  "required": false,
545
660
  "optional": false,
546
661
  "docs": {
547
- "tags": [],
548
- "text": ""
662
+ "tags": [{
663
+ "name": "example",
664
+ "text": "<bn-layout-page page-layout=\"custom-template\"\n page-custom-template='\"a a\" \"b c\"'></bn-layout-page>"
665
+ }],
666
+ "text": "CSS `grid-template-areas` string used when `pageLayout` is set to\n`custom-template`. Each quoted row defines a grid row; letters map to\nslot indices in order of first appearance."
549
667
  },
550
668
  "getter": false,
551
669
  "setter": false,
@@ -565,7 +683,7 @@ export class LayoutPage {
565
683
  "optional": false,
566
684
  "docs": {
567
685
  "tags": [],
568
- "text": ""
686
+ "text": "Gap between grid cells in pixels."
569
687
  },
570
688
  "getter": false,
571
689
  "setter": false,
@@ -585,7 +703,7 @@ export class LayoutPage {
585
703
  "optional": false,
586
704
  "docs": {
587
705
  "tags": [],
588
- "text": ""
706
+ "text": "When `true`, the page body height shrinks to fit its content\n(`fit-content`). When `false`, the body stretches to fill the\nfull page height (`100%`). Width is always `100%` regardless\nof this setting."
589
707
  },
590
708
  "getter": false,
591
709
  "setter": false,
@@ -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,13 +1,18 @@
1
1
  /**
2
2
  * Returns the available dimensions for a component.
3
3
  *
4
- * Width: parent content-box width (excluding padding).
4
+ * Width: visual parent's content-box width (excluding padding).
5
5
  * Height: walks up the DOM to find the nearest ancestor with a constrained
6
6
  * height (overflow !== 'visible' or explicit max-height). Falls back to
7
7
  * the viewport height when every ancestor auto-grows with its content.
8
+ *
9
+ * When the component is slotted into a shadow DOM (e.g. inside
10
+ * bn-layout-page or bn-layout-card), the light DOM parentElement is NOT the
11
+ * visual container. We cross the light→shadow boundary via assignedSlot to
12
+ * find the actual slot wrapper that determines layout.
8
13
  */
9
14
  export function getParentDimensions(element) {
10
- const parent = element.parentElement;
15
+ const parent = findLayoutParent(element);
11
16
  if (!parent) {
12
17
  return { width: 0, height: 0 };
13
18
  }
@@ -16,13 +21,40 @@ export function getParentDimensions(element) {
16
21
  const height = findConstrainedHeight(element);
17
22
  return { width: Math.max(0, width), height: Math.max(0, height) };
18
23
  }
24
+ /**
25
+ * Returns the visual layout parent of an element, crossing the
26
+ * light→shadow DOM boundary when the element's parent is slotted.
27
+ *
28
+ * For a slotted element, the light DOM parentElement is NOT where
29
+ * the element renders visually. The actual container is the shadow
30
+ * DOM element that wraps the <slot>. We reach it via assignedSlot.
31
+ */
32
+ function findLayoutParent(element) {
33
+ var _a;
34
+ const lightParent = element.parentElement;
35
+ if ((_a = lightParent === null || lightParent === void 0 ? void 0 : lightParent.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement) {
36
+ return lightParent.assignedSlot.parentElement;
37
+ }
38
+ return lightParent;
39
+ }
40
+ /**
41
+ * Returns the visual parent, crossing shadow DOM boundaries via assignedSlot.
42
+ */
43
+ function getVisualParent(element) {
44
+ var _a;
45
+ if ((_a = element.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement) {
46
+ return element.assignedSlot.parentElement;
47
+ }
48
+ return element.parentElement;
49
+ }
19
50
  /**
20
51
  * Walks up the ancestor chain to find a height that is actually constrained
21
- * (not just "whatever my content needs"). Returns viewport height as a
22
- * last resort.
52
+ * (not just "whatever my content needs"). Crosses shadow DOM boundaries
53
+ * via assignedSlot when encountering slotted elements. Returns viewport
54
+ * height as a last resort.
23
55
  */
24
56
  function findConstrainedHeight(element) {
25
- let current = element.parentElement;
57
+ let current = findLayoutParent(element);
26
58
  while (current) {
27
59
  const style = getComputedStyle(current);
28
60
  const overflow = style.overflowY;
@@ -37,7 +69,7 @@ function findConstrainedHeight(element) {
37
69
  return Math.min(mh, current.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom));
38
70
  }
39
71
  }
40
- current = current.parentElement;
72
+ current = getVisualParent(current);
41
73
  }
42
74
  // No constrained ancestor found — use viewport
43
75
  return typeof window !== "undefined" ? window.innerHeight : 0;
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as a,Fragment as s,transformTag as i}from"@stencil/core/internal/client";import{g as r}from"./context-protocol.js";import{a as o}from"./withHasError.js";import{d as n}from"./bn-body2.js";import{d as c}from"./bn-card2.js";import{d as l}from"./bn-footer2.js";import{d}from"./bn-title2.js";import{d as b}from"./ibcs-title2.js";const m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.titleImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.titleNamespace="_system",this.footerText="",this.cardLayout="full",this.cardCustomTemplate='"a b" "c d"',this.cardGridGap="0",this.cardFitToContent=!0,this.cardShowBorder=!0,this.templateMap=new Map([["split-vertical",'"a b"'],["split-horizontal",'"a" "b"'],["2x2",'"a b" "c d"'],["3x3",'"a b c" "d e f" "g h i"'],["4x4",'"a b c d" "e f g h" "i j k l" "m n o p"'],["1-over-2",'"a a" "b c"'],["2-over-1",'"a b" "c c"'],["1-over-3",'"a a a " "b c d"'],["3-over-1",'"a b c" "d d d"'],["custom-template",'"a b" "c c c"'],["gold3",'"a c" "b c"'],["gold4",'"a b c c" "d d c c"']]),this.errors=o(this)}connectedCallback(){this.stores=r(this.element)}getCommonStyles(){let t="100%",e="100%";return!0===this.cardFitToContent&&(e="fit-content",t="fit-content"),{display:"grid",height:t,width:e,gap:this.cardGridGap+"px"}}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplatePattern(this.cardLayout)})}createDivAreaStyles(t){return t.map((t=>({overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return a(s,null,e.map(((t,e)=>a("div",{style:t},a("slot",{name:"card-slot-"+e})))))}extractSlotNames(t){if(null==t)return[];const e=t.match(/\b\w+\b/g);return e?Array.from(new Set(e)):[]}getTemplatePattern(t){return console.warn("getTemplatePattern",{name:t}),!1===this.templateMap.has(t)&&"custom-template"!==t?'"a"':"custom-template"===t?this.cardCustomTemplate:this.templateMap.get(t)}async getNumberOfSlot(t){const e=this.getTemplatePattern(t);return this.extractSlotNames(e).length}componentDidUpdate(){}setCardClass(){return!0===this.cardShowBorder?"card_box border":"card_box"}prepareTitleImage(t){if(null==t||""===t)return"";const e=this.stores.assets.state;return t.startsWith("asset:")?e[t.substring(6)]:e[t]||t}render(){const t=this.getLayoutStyle(),e=this.extractSlotNames(t["grid-template-areas"]);return a("bn-card",{key:"cdc04f3414fa80148fc8be40cbaf0cac1035fca1",styles:this.styles,class:this.setCardClass()},a("div",{key:"3374b14ec8a8a73de58f866b0c6a691ee0b8d2ae",class:"cardtitle"},a("bn-title",{key:"23a6f991ad6b1a8b74066943b108f3666ae0c863",namespace:this.titleNamespace,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),null!=this.titleImage&&""!==this.titleImage?a("img",{class:"image",src:this.prepareTitleImage(this.titleImage)}):""),a("bn-body",{key:"06d86283489ea2db12d448b1d4b72b540ad352f8"},a("div",{key:"659cfb06f4d756ffd4e1d08910c66a0751d71f9d",style:t},this.getSlots(e))),a("bn-footer",{key:"8aa67fdf3bcbb465c7861f83f6371bc7f73ae75e",text:this.footerText,"page-number":0,"display-page-number":"false"}))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);flex-direction:column;overflow:hidden;float:left;clear:left}.cardtitle{display:inline-flex}.image{margin-right:0.5em;margin-top:0.5em;z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:inline}'}},[257,"bn-layout-card",{styles:[1],titleImage:[1,"title-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],footerText:[1,"footer-text"],cardLayout:[1,"card-layout"],cardCustomTemplate:[1,"card-custom-template"],cardGridGap:[1,"card-grid-gap"],cardFitToContent:[4,"card-fit-to-content"],cardShowBorder:[4,"card-show-border"],getNumberOfSlot:[64]}]),h=m,f=function(){"undefined"!=typeof customElements&&["bn-layout-card","bn-body","bn-card","bn-footer","bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-layout-card":customElements.get(i(t))||customElements.define(i(t),m);break;case"bn-body":customElements.get(i(t))||n();break;case"bn-card":customElements.get(i(t))||c();break;case"bn-footer":customElements.get(i(t))||l();break;case"bn-title":customElements.get(i(t))||d();break;case"ibcs-title":customElements.get(i(t))||b()}}))};export{h as BnLayoutCard,f as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as s,Fragment as a,transformTag as r}from"@stencil/core/internal/client";import{g as i}from"./context-protocol.js";import{a as o}from"./withHasError.js";import{d as n}from"./bn-body2.js";import{d as c}from"./bn-card2.js";import{d as l}from"./bn-footer2.js";import{d}from"./bn-title2.js";import{d as b}from"./ibcs-title2.js";const h=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.titleImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.titleNamespace="_system",this.footerText="",this.cardLayout="full",this.cardCustomTemplate='"a b" "c d"',this.cardGridGap="0",this.cardFitToContent=!0,this.cardShowBorder=!0,this.templateMap=new Map([["split-vertical",'"a b"'],["split-horizontal",'"a" "b"'],["2x2",'"a b" "c d"'],["3x3",'"a b c" "d e f" "g h i"'],["4x4",'"a b c d" "e f g h" "i j k l" "m n o p"'],["1-over-2",'"a a" "b c"'],["2-over-1",'"a b" "c c"'],["1-over-3",'"a a a " "b c d"'],["3-over-1",'"a b c" "d d d"'],["custom-template",'"a b" "c c c"'],["gold3",'"a c" "b c"'],["gold4",'"a b c c" "d d c c"']]),this.errors=o(this)}connectedCallback(){this.stores=i(this.element)}getCommonStyles(){let t="100%",e="100%";return!0===this.cardFitToContent&&(e="fit-content",t="fit-content"),{display:"grid",height:t,width:e,gap:this.cardGridGap+"px"}}calculatePercentages(t){const e=t.trim().split(/\s+/).length;if(0===e)return"100%";const s=(100/e).toFixed(0)+"%";return Array(e).fill(s).join(" ")}getGridTemplateColumns(t){const e=this.getTemplatePattern(t).match(/"[\w\d\s.]+"/g);return e&&0!==e.length?this.calculatePercentages(e[0]):"100%"}getGridTemplateRows(t){const e=this.getTemplatePattern(t).match(/"[\w\d\s.]+"/g),s=e?e.length:1;return this.cardFitToContent?Array(s).fill("auto").join(" "):Array(s).fill("1fr").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplatePattern(this.cardLayout),"grid-template-columns":this.getGridTemplateColumns(this.cardLayout),"grid-template-rows":this.getGridTemplateRows(this.cardLayout)})}createDivAreaStyles(t){return t.map((t=>({width:"100%",overflow:"hidden","grid-area":t,height:"100%"})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(a,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"card-slot-"+e})))))}extractSlotNames(t){if(null==t)return[];const e=t.match(/\b\w+\b/g);return e?Array.from(new Set(e)):[]}getTemplatePattern(t){return!1===this.templateMap.has(t)&&"custom-template"!==t?'"a"':"custom-template"===t?this.cardCustomTemplate:this.templateMap.get(t)}async getNumberOfSlot(t){const e=this.getTemplatePattern(t);return this.extractSlotNames(e).length}componentDidUpdate(){}setCardClass(){return!0===this.cardShowBorder?"card_box border":"card_box"}prepareTitleImage(t){if(null==t||""===t)return"";const e=this.stores.assets.state;return t.startsWith("asset:")?e[t.substring(6)]:e[t]||t}render(){const t=this.getLayoutStyle(),e=this.extractSlotNames(t["grid-template-areas"]);return s("bn-card",{key:"e920b128510046289f0960c19abb1eadb2751204",styles:this.styles,class:this.setCardClass()},s("div",{key:"de7b2ed78aade1a7c2d0a8a69cd1f7b47eef2414",class:"cardtitle"},s("bn-title",{key:"72fd36fe7e0bc2d628825b69114b81e04669143d",namespace:this.titleNamespace,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),null!=this.titleImage&&""!==this.titleImage?s("img",{class:"image",src:this.prepareTitleImage(this.titleImage)}):""),s("bn-body",{key:"1d3a6da80bcaab5ab2d9442edd548bc408f10563"},s("div",{key:"e24cfa54735c0b401e34825a8da7327555c120c5",style:t},this.getSlots(e))),s("bn-footer",{key:"c2307c5dcb8058d49465fbafa7d5aaa6e5dc4488",text:this.footerText,"page-number":0,"display-page-number":"false"}))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:block;flex-direction:column;overflow:hidden;float:left;clear:left}.cardtitle{display:inline-flex}.image{margin-right:0.5em;margin-top:0.5em;z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:inline}'}},[257,"bn-layout-card",{styles:[1],titleImage:[1,"title-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],footerText:[1,"footer-text"],cardLayout:[1,"card-layout"],cardCustomTemplate:[1,"card-custom-template"],cardGridGap:[1,"card-grid-gap"],cardFitToContent:[4,"card-fit-to-content"],cardShowBorder:[4,"card-show-border"],getNumberOfSlot:[64]}]),m=h,u=function(){"undefined"!=typeof customElements&&["bn-layout-card","bn-body","bn-card","bn-footer","bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-layout-card":customElements.get(r(t))||customElements.define(r(t),h);break;case"bn-body":customElements.get(r(t))||n();break;case"bn-card":customElements.get(r(t))||c();break;case"bn-footer":customElements.get(r(t))||l();break;case"bn-title":customElements.get(r(t))||d();break;case"ibcs-title":customElements.get(r(t))||b()}}))};export{m as BnLayoutCard,u as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as s,Fragment as a,transformTag as i}from"@stencil/core/internal/client";import{a as r}from"./withHasError.js";import{d as n}from"./bn-body2.js";import{d as o}from"./bn-footer2.js";import{d as c}from"./bn-message2.js";import{d as l}from"./bn-page2.js";import{d as m}from"./bn-title2.js";import{d as b}from"./ibcs-title2.js";const d=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.messageText="",this.messageImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.titleNamespace="_system",this.footerDisplayPageNumber=!0,this.pageLayout="full",this.pageCustomTemplate='"a b" "c d"',this.pageGridGap="0",this.pageFitToContent=!0,this.templateMap=new Map([["split-vertical",'"a b"'],["split-horizontal",'"a" "b"'],["2x2",'"a b" "c d"'],["3x3",'"a b c" "d e f" "g h i"'],["4x4",'"a b c d" "e f g h" "i j k l" "m n o p"'],["1-over-2",'"a a" "b c"'],["2-over-1",'"a b" "c c"'],["1-over-3",'"a a a " "b c d"'],["3-over-1",'"a b c" "d d d"'],["custom-template",'"a b" "c c c"'],["gold3",'"a c" "b c"'],["gold4",'"a b c c" "d d c c"']]),this.errors=r(this)}getCommonStyles(){let t="100%",e="100%";return!0===this.pageFitToContent&&(e="fit-content",t="fit-content"),{display:"grid",height:t,width:e,gap:this.pageGridGap+"px"}}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplateAreas(this.pageLayout),"grid-template-columns":this.getGridTemplateColumns(this.pageLayout)})}createDivAreaStyles(t){return t.map((t=>({width:"100%",overflow:"hidden","grid-area":t,height:"100%"})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(a,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"slot-"+e})))))}extractSlotNames(t){if(null==t)return[];const e=t.match(/\b\w+\b/g);return e?Array.from(new Set(e)):[]}getTemplateAreas(t){return!1===this.templateMap.has(t)&&"custom-template"!==t?'"a"':"custom-template"===t?this.pageCustomTemplate:this.templateMap.get(t)}calculatePercentages(t){const e=t.trim().split(/\s+/).length;if(0===e)return"100%";const s=(100/e).toFixed(0)+"%";return Array(e).fill(s).join(" ")}getGridTemplateColumns(t){if(!1===this.templateMap.has(t)&&"custom-template"!==t)return"100%";let e;e="custom-template"===t?this.pageCustomTemplate:this.templateMap.get(t);const s=e.match(/"[\w\d\s.]+"/g);return this.calculatePercentages(s[0])}async getNumberOfSlot(t){const e=this.getTemplateAreas(t);return this.extractSlotNames(e).length}componentDidUpdate(){const t=this.element.closest("bn-context").getAttribute("render-orientation");if(t&&t!==this.pageOrientation){const t=this.element.shadowRoot.querySelector("bn-page"),e=this.element.closest("bn-layout-page");e&&t&&(t.style.transform="rotate(-90deg) translate(-100%)",t.style.transformOrigin="top left",e.style.width=t.clientHeight+"px",e.style.height=t.clientWidth+"px")}}render(){const t=this.getLayoutStyle(),e=this.extractSlotNames(t["grid-template-areas"]);return s("bn-page",{key:"2f67c9b949ab18de247ea492c95b1e53e450fcca",styles:this.styles,format:this.pageFormat,orientation:this.pageOrientation},s("bn-message",{key:"6fb865fe6cf9785c6a3932967d9969d5e0a4eda5",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"3ba10325d834b364d0a68012f589ba5508877652",namespace:this.titleNamespace,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),s("bn-body",{key:"16bcb1e231d65b2f0e90c82d8e3ec1a84cc79c59"},s("div",{key:"1408692a37d04686e5d9ad00bca7f1d24787b595",style:t},this.getSlots(e))),s("bn-footer",{key:"83e924e38db44fb678490a8a4d12b264699fc3e2",text:this.footerText,"page-number":this.pageNumber,"display-page-number":this.footerDisplayPageNumber}))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);flex-direction:column;overflow:hidden;float:left;clear:left}'}},[257,"bn-layout-page",{styles:[1],messageText:[1,"message-text"],messageImage:[1,"message-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],pageFormat:[1,"page-format"],pageOrientation:[1,"page-orientation"],pageNumber:[1,"page-number"],footerText:[1,"footer-text"],footerDisplayPageNumber:[4,"footer-display-page-number"],pageLayout:[1,"page-layout"],pageCustomTemplate:[1,"page-custom-template"],pageGridGap:[1,"page-grid-gap"],pageFitToContent:[4,"page-fit-to-content"],getNumberOfSlot:[64]}]),h=d,p=function(){"undefined"!=typeof customElements&&["bn-layout-page","bn-body","bn-footer","bn-message","bn-page","bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-layout-page":customElements.get(i(t))||customElements.define(i(t),d);break;case"bn-body":customElements.get(i(t))||n();break;case"bn-footer":customElements.get(i(t))||o();break;case"bn-message":customElements.get(i(t))||c();break;case"bn-page":customElements.get(i(t))||l();break;case"bn-title":customElements.get(i(t))||m();break;case"ibcs-title":customElements.get(i(t))||b()}}))};export{h as BnLayoutPage,p as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as s,Fragment as a,transformTag as i}from"@stencil/core/internal/client";import{a as r}from"./withHasError.js";import{d as o}from"./bn-body2.js";import{d as n}from"./bn-footer2.js";import{d as l}from"./bn-message2.js";import{d as c}from"./bn-page2.js";import{d as m}from"./bn-title2.js";import{d}from"./ibcs-title2.js";const b=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.messageText="",this.messageImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.titleNamespace="_system",this.footerDisplayPageNumber=!0,this.pageLayout="full",this.pageCustomTemplate='"a b" "c d"',this.pageGridGap="0",this.pageFitToContent=!0,this.templateMap=new Map([["split-vertical",'"a b"'],["split-horizontal",'"a" "b"'],["2x2",'"a b" "c d"'],["3x3",'"a b c" "d e f" "g h i"'],["4x4",'"a b c d" "e f g h" "i j k l" "m n o p"'],["1-over-2",'"a a" "b c"'],["2-over-1",'"a b" "c c"'],["1-over-3",'"a a a " "b c d"'],["3-over-1",'"a b c" "d d d"'],["custom-template",'"a b" "c c c"'],["gold3",'"a c" "b c"'],["gold4",'"a b c c" "d d c c"']]),this.errors=r(this)}getCommonStyles(){let t="100%";return!0===this.pageFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.pageGridGap+"px"}}getGridTemplateRows(t){const e=this.getTemplateAreas(t).match(/"[\w\d\s.]+"/g),s=e?e.length:1;return this.pageFitToContent?Array(s).fill("auto").join(" "):Array(s).fill("1fr").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplateAreas(this.pageLayout),"grid-template-columns":this.getGridTemplateColumns(this.pageLayout),"grid-template-rows":this.getGridTemplateRows(this.pageLayout)})}createDivAreaStyles(t){return t.map((t=>({width:"100%",overflow:"hidden","grid-area":t,height:"100%"})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(a,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"slot-"+e})))))}extractSlotNames(t){if(null==t)return[];const e=t.match(/\b\w+\b/g);return e?Array.from(new Set(e)):[]}getTemplateAreas(t){return!1===this.templateMap.has(t)&&"custom-template"!==t?'"a"':"custom-template"===t?this.pageCustomTemplate:this.templateMap.get(t)}calculatePercentages(t){const e=t.trim().split(/\s+/).length;if(0===e)return"100%";const s=(100/e).toFixed(0)+"%";return Array(e).fill(s).join(" ")}getGridTemplateColumns(t){if(!1===this.templateMap.has(t)&&"custom-template"!==t)return"100%";let e;e="custom-template"===t?this.pageCustomTemplate:this.templateMap.get(t);const s=e.match(/"[\w\d\s.]+"/g);return this.calculatePercentages(s[0])}async getNumberOfSlot(t){const e=this.getTemplateAreas(t);return this.extractSlotNames(e).length}componentDidUpdate(){const t=this.element.closest("bn-context").getAttribute("render-orientation");if(t&&t!==this.pageOrientation){const t=this.element.shadowRoot.querySelector("bn-page"),e=this.element.closest("bn-layout-page");e&&t&&(t.style.transform="rotate(-90deg) translate(-100%)",t.style.transformOrigin="top left",e.style.width=t.clientHeight+"px",e.style.height=t.clientWidth+"px")}}render(){const t=this.getLayoutStyle(),e=this.extractSlotNames(t["grid-template-areas"]);return s("bn-page",{key:"1c262428d9e69966f3089f5018b5a71e348c31b7",styles:this.styles,format:this.pageFormat,orientation:this.pageOrientation},s("bn-message",{key:"c687e6d660a7301202663644f2bce0e20d148420",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"6e30d548765d8b32f7ab85c6203c1af2142d55c5",namespace:this.titleNamespace,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),s("bn-body",{key:"a691c212bcf2ed7c95792de989be4a5c5d30aa5f"},s("div",{key:"150f9e5941e723f527166ef9071b721b194101fe",style:t},this.getSlots(e))),s("bn-footer",{key:"9868b2deab6302fc029b6d9f9780d84269245979",text:this.footerText,"page-number":this.pageNumber,"display-page-number":this.footerDisplayPageNumber}))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:block;flex-direction:column;overflow:hidden;float:left;clear:left}'}},[257,"bn-layout-page",{styles:[1],messageText:[1,"message-text"],messageImage:[1,"message-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],pageFormat:[1,"page-format"],pageOrientation:[1,"page-orientation"],pageNumber:[1,"page-number"],footerText:[1,"footer-text"],footerDisplayPageNumber:[4,"footer-display-page-number"],pageLayout:[1,"page-layout"],pageCustomTemplate:[1,"page-custom-template"],pageGridGap:[1,"page-grid-gap"],pageFitToContent:[4,"page-fit-to-content"],getNumberOfSlot:[64]}]),h=b,p=function(){"undefined"!=typeof customElements&&["bn-layout-page","bn-body","bn-footer","bn-message","bn-page","bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-layout-page":customElements.get(i(t))||customElements.define(i(t),b);break;case"bn-body":customElements.get(i(t))||o();break;case"bn-footer":customElements.get(i(t))||n();break;case"bn-message":customElements.get(i(t))||l();break;case"bn-page":customElements.get(i(t))||c();break;case"bn-title":customElements.get(i(t))||m();break;case"ibcs-title":customElements.get(i(t))||d()}}))};export{h as BnLayoutPage,p as defineCustomElement}