@bino-bi/bn-template-engine 1.0.0-alpha.5 → 1.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-0fabe296.entry.js +1 -0
- package/dist/bn-template-engine/p-1164c0b0.entry.js +1 -0
- package/dist/bn-template-engine/p-355abdf0.entry.js +1 -0
- package/dist/bn-template-engine/p-79KuA4Ox.js +1 -0
- package/dist/bn-template-engine/p-859cc06d.entry.js +1 -0
- package/dist/bn-template-engine/p-8acec99e.entry.js +1 -0
- package/dist/bn-template-engine/p-8f490c45.entry.js +1 -0
- package/dist/bn-template-engine/p-9721a5bb.entry.js +1 -0
- package/dist/bn-template-engine/p-9a564f8f.entry.js +1 -0
- package/dist/bn-template-engine/p-9cee22fa.entry.js +1 -0
- package/dist/bn-template-engine/{p-CL1RYuNU.js → p-B0lsgVuN.js} +1 -1
- package/dist/bn-template-engine/p-B7p8beYH.js +1 -0
- package/dist/bn-template-engine/p-BDh7GfC5.js +1 -0
- package/dist/bn-template-engine/p-BoMtoHJB.js +1 -0
- package/dist/bn-template-engine/p-Bs8BqBsb.js +1 -0
- package/dist/bn-template-engine/p-CYjZRKdI.js +1 -0
- package/dist/bn-template-engine/{p-P7pGJBgc.js → p-DG-1MR_T.js} +1 -1
- package/dist/bn-template-engine/p-Dnkv5rt8.js +1 -0
- package/dist/bn-template-engine/p-bdd2b243.entry.js +1 -0
- package/dist/bn-template-engine/p-f27995c9.entry.js +1 -0
- package/dist/bn-template-engine/p-f6ecb265.entry.js +1 -0
- package/dist/bn-template-engine/{p-Bnhh02CF.js → p-sRO-lj7X.js} +1 -1
- package/dist/bn-template-engine/p-tzFCK9qn.js +1 -0
- package/dist/cjs/{Order-iG11HI4R.js → Order-BGx39pS5.js} +448 -0
- package/dist/cjs/{alasql.min-C_nHTuEQ.js → SVGVariancesStyleGroup-BqAdPYtL.js} +8228 -3
- package/dist/cjs/bn-asset_16.cjs.entry.js +9099 -0
- package/dist/cjs/bn-card.cjs.entry.js +3 -4
- package/dist/cjs/bn-chart-time.cjs.entry.js +55 -24
- package/dist/cjs/bn-grid.cjs.entry.js +5 -8
- package/dist/cjs/bn-image.cjs.entry.js +5 -8
- package/dist/cjs/bn-internationalization.cjs.entry.js +3 -4
- package/dist/cjs/bn-layout-card.cjs.entry.js +156 -6
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +2 -3
- package/dist/cjs/bn-text.cjs.entry.js +7 -11
- package/dist/cjs/bn-tree.cjs.entry.js +5 -8
- package/dist/cjs/{formatter-DIJL_crx.js → formatter-4XCS0d2B.js} +8 -2
- package/dist/cjs/ibcs-chart-time.cjs.entry.js +37 -42
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-9Tz595RQ.js → scaling-BidPsO53.js} +115 -12
- package/dist/cjs/{withBodyObserver-CKpSD8UT.js → withBodyObserver-C6gLgq_e.js} +3 -3
- package/dist/cjs/{withComponentStatus-Bw70BhO0.js → withComponentStatus-_x4LQZ0N.js} +5 -5
- package/dist/cjs/{withComponentStyle-aIbTCtfj.js → withComponentStyle-ClSJfCku.js} +4 -4
- package/dist/cjs/{utils-CwHIVbbL.js → withHasError-B8gHkfV2.js} +69 -1
- package/dist/cjs/withInheritedProps-BH2KNER3.js +157 -0
- package/dist/cjs/{withStyled-CS1Yp4sv.js → withStyled-9tG024gQ.js} +62 -9
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +46 -10
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +44 -8
- package/dist/collection/components/bn-layout-card/bn-layout-card.css +1 -0
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +193 -27
- package/dist/collection/components/bn-layout-page/bn-layout-page.css +1 -0
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +151 -33
- package/dist/collection/components/bn-table/bn-table.js +59 -13
- package/dist/collection/utils/parentDimensions.js +38 -6
- package/dist/collection/utils/withInheritedProps.js +152 -0
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/scaling.js +1 -1
- package/dist/components/withInheritedProps.js +1 -0
- package/dist/esm/{Order-Bnhh02CF.js → Order-sRO-lj7X.js} +448 -1
- package/dist/esm/{alasql.min-CWu4NkIt.js → SVGVariancesStyleGroup-DOIT-zvI.js} +8212 -2
- package/dist/esm/bn-asset_16.entry.js +9082 -0
- package/dist/esm/bn-card.entry.js +4 -5
- package/dist/esm/bn-chart-time.entry.js +52 -21
- package/dist/esm/bn-grid.entry.js +6 -9
- package/dist/esm/bn-image.entry.js +6 -9
- package/dist/esm/bn-internationalization.entry.js +4 -5
- package/dist/esm/bn-layout-card.entry.js +157 -7
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +2 -3
- package/dist/esm/bn-text.entry.js +7 -11
- package/dist/esm/bn-tree.entry.js +6 -9
- package/dist/esm/{context-protocol-BHnQsVsr.js → context-protocol-2peaD4y8.js} +1 -1
- package/dist/esm/editor-companion.entry.js +1 -1
- package/dist/esm/{formatter-DTMEZ6d8.js → formatter-BDh7GfC5.js} +6 -2
- package/dist/esm/ibcs-chart-time.entry.js +3 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-Cehc74IE.js → scaling-BOcjT8M0.js} +112 -10
- package/dist/esm/{withBodyObserver-FQ8NwCIz.js → withBodyObserver-DczL5ia8.js} +1 -1
- package/dist/esm/{withComponentStatus-DWjDYtZ7.js → withComponentStatus-DodoSXe-.js} +1 -1
- package/dist/esm/{withComponentStyle-9uP_hcDq.js → withComponentStyle-D3VWOsto.js} +2 -2
- package/dist/esm/{utils-DvvwfRQG.js → withHasError-B3QX2emi.js} +69 -1
- package/dist/esm/withInheritedProps-BlXDxhHK.js +154 -0
- package/dist/esm/{withStyled--qQWquTH.js → withStyled-CE3_3taP.js} +57 -5
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +1 -0
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +1 -0
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +147 -0
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +154 -0
- package/dist/types/components/bn-table/bn-table.d.ts +1 -0
- package/dist/types/components.d.ts +168 -0
- package/dist/types/utils/parentDimensions.d.ts +6 -1
- package/dist/types/utils/withInheritedProps.d.ts +38 -0
- package/package.json +1 -1
- package/dist/bn-template-engine/p-1265d8d3.entry.js +0 -1
- package/dist/bn-template-engine/p-15516dac.entry.js +0 -1
- package/dist/bn-template-engine/p-1c716641.entry.js +0 -1
- package/dist/bn-template-engine/p-1jFf17Vj.js +0 -1
- package/dist/bn-template-engine/p-27cc8dc0.entry.js +0 -1
- package/dist/bn-template-engine/p-3b4c7425.entry.js +0 -1
- package/dist/bn-template-engine/p-4426d484.entry.js +0 -1
- package/dist/bn-template-engine/p-51f8dc9e.entry.js +0 -1
- package/dist/bn-template-engine/p-53d4e690.entry.js +0 -1
- package/dist/bn-template-engine/p-5KQYRQLK.js +0 -1
- package/dist/bn-template-engine/p-7337e03d.entry.js +0 -1
- package/dist/bn-template-engine/p-75e97c87.entry.js +0 -1
- package/dist/bn-template-engine/p-7a560278.entry.js +0 -1
- package/dist/bn-template-engine/p-BFTU3MAI.js +0 -1
- package/dist/bn-template-engine/p-BYBpC0EO.js +0 -1
- package/dist/bn-template-engine/p-BYmPQYxx.js +0 -1
- package/dist/bn-template-engine/p-BfXY5dsy.js +0 -1
- package/dist/bn-template-engine/p-BgnHJQ9Q.js +0 -1
- package/dist/bn-template-engine/p-Bhd_WSML.js +0 -1
- package/dist/bn-template-engine/p-Bka-Z6jo.js +0 -1
- package/dist/bn-template-engine/p-C7dQL8CS.js +0 -1
- package/dist/bn-template-engine/p-CYwd_ZNM.js +0 -1
- package/dist/bn-template-engine/p-ChlK-T9I.js +0 -1
- package/dist/bn-template-engine/p-DHezf8pZ.js +0 -1
- package/dist/bn-template-engine/p-DlppAFq9.js +0 -1
- package/dist/bn-template-engine/p-DvDDgmcV.js +0 -1
- package/dist/bn-template-engine/p-DvvwfRQG.js +0 -1
- package/dist/bn-template-engine/p-abc0067c.entry.js +0 -1
- package/dist/bn-template-engine/p-b34eaf86.entry.js +0 -1
- package/dist/bn-template-engine/p-bdb8b44c.entry.js +0 -1
- package/dist/bn-template-engine/p-c44fcb8e.entry.js +0 -1
- package/dist/bn-template-engine/p-c7e1a49b.entry.js +0 -1
- package/dist/bn-template-engine/p-d9003041.entry.js +0 -1
- package/dist/bn-template-engine/p-daa7ffa3.entry.js +0 -1
- package/dist/bn-template-engine/p-e084f50a.entry.js +0 -1
- package/dist/bn-template-engine/p-eaba6658.entry.js +0 -1
- package/dist/bn-template-engine/p-u8igQLRZ.js +0 -1
- package/dist/cjs/DataFormatDigits-DKcOeLNK.js +0 -142
- package/dist/cjs/DateStringFactory-CSKvbS8K.js +0 -452
- package/dist/cjs/SVGVariancesStyleGroup-K-Tw6lOD.js +0 -7960
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +0 -10
- package/dist/cjs/bn-asset.cjs.entry.js +0 -42
- package/dist/cjs/bn-body_4.cjs.entry.js +0 -748
- package/dist/cjs/bn-chart-structure_5.cjs.entry.js +0 -3948
- package/dist/cjs/bn-component-style.cjs.entry.js +0 -44
- package/dist/cjs/bn-dataset.cjs.entry.js +0 -306
- package/dist/cjs/bn-layout-page.cjs.entry.js +0 -143
- package/dist/cjs/bn-message.cjs.entry.js +0 -52
- package/dist/cjs/bn-table.cjs.entry.js +0 -981
- package/dist/cjs/contentDecoder-JxOldq1e.js +0 -419
- package/dist/cjs/emotion-hash.esm-nbbEQ0Dn.js +0 -57
- package/dist/cjs/ibcs-table.cjs.entry.js +0 -2276
- package/dist/cjs/ibcsRuleSet-DgUoXOfd.js +0 -136
- package/dist/cjs/index-Dm85hG6t.js +0 -65
- package/dist/cjs/withHasError-D7ue5vAv.js +0 -72
- package/dist/cjs/withTranslation-rwgyITqe.js +0 -77
- package/dist/esm/DataFormatDigits-oSZ1hBKE.js +0 -137
- package/dist/esm/DateStringFactory-CSGz6TDk.js +0 -450
- package/dist/esm/SVGVariancesStyleGroup-CqTjrZYg.js +0 -7950
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js +0 -7
- package/dist/esm/bn-asset.entry.js +0 -40
- package/dist/esm/bn-body_4.entry.js +0 -743
- package/dist/esm/bn-chart-structure_5.entry.js +0 -3942
- package/dist/esm/bn-component-style.entry.js +0 -42
- package/dist/esm/bn-dataset.entry.js +0 -304
- package/dist/esm/bn-layout-page.entry.js +0 -141
- package/dist/esm/bn-message.entry.js +0 -50
- package/dist/esm/bn-table.entry.js +0 -979
- package/dist/esm/contentDecoder-oMmxz6nJ.js +0 -416
- package/dist/esm/emotion-hash.esm-BYBpC0EO.js +0 -55
- package/dist/esm/ibcs-table.entry.js +0 -2274
- package/dist/esm/ibcsRuleSet-K4ytuA1f.js +0 -133
- package/dist/esm/index-DHezf8pZ.js +0 -65
- package/dist/esm/withHasError-FyY5mQ_3.js +0 -70
- package/dist/esm/withTranslation-BqD0Kp7b.js +0 -75
|
@@ -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:
|
|
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: '
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
@@ -7,6 +7,7 @@ import withTranslation from "../../utils/withTranslation";
|
|
|
7
7
|
import { withStyled } from "../../utils/styled/withStyled";
|
|
8
8
|
import withComponentStyle from "../../utils/withComponentStyle";
|
|
9
9
|
import withHasError from "../../utils/withHasError";
|
|
10
|
+
import withInheritedProps, { isInheritedValue } from "../../utils/withInheritedProps";
|
|
10
11
|
import { getParentDimensions } from "../../utils/parentDimensions";
|
|
11
12
|
import { parseScaling } from "../../utils/scaling";
|
|
12
13
|
import { BAR_COLUMN_WIDTH_EM, DataFormat, I18nMode, MeasureType, TableBarColumnWidth, TableCategoryWidth, } from "../../utils/constants";
|
|
@@ -267,9 +268,19 @@ export class Table {
|
|
|
267
268
|
this.datasetMeta = meta;
|
|
268
269
|
});
|
|
269
270
|
this.t = withTranslation(this).t;
|
|
271
|
+
this.resolveInherited = withInheritedProps(this, [
|
|
272
|
+
{ propName: "scenarios", ancestorAttr: "title-scenarios" },
|
|
273
|
+
{ propName: "variances", ancestorAttr: "title-variances" },
|
|
274
|
+
{ propName: "order", ancestorAttr: "title-order" },
|
|
275
|
+
{ propName: "orderDirection", ancestorAttr: "title-order-direction" },
|
|
276
|
+
]);
|
|
270
277
|
}
|
|
271
278
|
validateScenario(newValue) {
|
|
272
279
|
const errId = "ERR_scenarios";
|
|
280
|
+
if (isInheritedValue(newValue)) {
|
|
281
|
+
this.errors.remove(errId);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
273
284
|
const invalidScenarios = validateScenarioList(newValue);
|
|
274
285
|
if (invalidScenarios.length > 0) {
|
|
275
286
|
this.errors.addOrReplace({
|
|
@@ -284,6 +295,10 @@ export class Table {
|
|
|
284
295
|
}
|
|
285
296
|
validateVariances(newValue) {
|
|
286
297
|
const errId = "ERR_variances";
|
|
298
|
+
if (isInheritedValue(newValue)) {
|
|
299
|
+
this.errors.remove(errId);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
287
302
|
const invalidVariances = validateVariancesList(newValue);
|
|
288
303
|
if (invalidVariances.length > 0) {
|
|
289
304
|
this.errors.addOrReplace({
|
|
@@ -461,6 +476,10 @@ export class Table {
|
|
|
461
476
|
}
|
|
462
477
|
validateOrderList(newValue) {
|
|
463
478
|
const errId = "ERR_order";
|
|
479
|
+
if (isInheritedValue(newValue)) {
|
|
480
|
+
this.errors.remove(errId);
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
464
483
|
const invalidElements = validateOrderList(newValue);
|
|
465
484
|
if (invalidElements.length > 0) {
|
|
466
485
|
this.errors.addOrReplace({
|
|
@@ -475,6 +494,10 @@ export class Table {
|
|
|
475
494
|
}
|
|
476
495
|
validateOrderDirection(newValue) {
|
|
477
496
|
const errId = "ERR_orderDirection";
|
|
497
|
+
if (isInheritedValue(newValue)) {
|
|
498
|
+
this.errors.remove(errId);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
478
501
|
if (!isValidDirection(newValue)) {
|
|
479
502
|
this.errors.addOrReplace({
|
|
480
503
|
id: errId,
|
|
@@ -682,15 +705,19 @@ export class Table {
|
|
|
682
705
|
return JSON.parse(this.partof);
|
|
683
706
|
}
|
|
684
707
|
prepareOrder() {
|
|
685
|
-
var _a
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
|
|
708
|
+
var _a;
|
|
709
|
+
const inheritedOrder = this.resolveInherited("order", this.order);
|
|
710
|
+
const inheritedDirection = this.resolveInherited("orderDirection", this.orderDirection);
|
|
711
|
+
const effectiveOrder = inheritedOrder !== null && inheritedOrder !== void 0 ? inheritedOrder : this.order;
|
|
712
|
+
const effectiveDirection = inheritedDirection !== null && inheritedDirection !== void 0 ? inheritedDirection : this.orderDirection;
|
|
713
|
+
const isAuto = (effectiveOrder === null || effectiveOrder === void 0 ? void 0 : effectiveOrder.trim().toLowerCase()) === "auto";
|
|
714
|
+
let orderStr = effectiveOrder;
|
|
715
|
+
if (isAuto && ((_a = this.datasetMeta) === null || _a === void 0 ? void 0 : _a.suggestedOrder)) {
|
|
689
716
|
orderStr = this.datasetMeta.suggestedOrder;
|
|
690
717
|
}
|
|
691
718
|
const tableOrder = {
|
|
692
719
|
hierarchy: orderStr.split(",").map((entry) => OrderColumn[entry === null || entry === void 0 ? void 0 : entry.toUpperCase()]),
|
|
693
|
-
direction: OrderDirection[
|
|
720
|
+
direction: OrderDirection[effectiveDirection === null || effectiveDirection === void 0 ? void 0 : effectiveDirection.toUpperCase()],
|
|
694
721
|
};
|
|
695
722
|
return tableOrder;
|
|
696
723
|
}
|
|
@@ -713,10 +740,29 @@ export class Table {
|
|
|
713
740
|
return formatDigits;
|
|
714
741
|
}
|
|
715
742
|
prepareScenarios() {
|
|
716
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
717
|
-
const
|
|
743
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
744
|
+
const inheritedScenarios = this.resolveInherited("scenarios", this.scenarios);
|
|
745
|
+
const inheritedVariances = this.resolveInherited("variances", this.variances);
|
|
746
|
+
if (inheritedScenarios !== undefined || inheritedVariances !== undefined) {
|
|
747
|
+
this.errors.remove("AUTO_scenarios");
|
|
748
|
+
let scenarios = [];
|
|
749
|
+
if (inheritedScenarios !== undefined) {
|
|
750
|
+
scenarios = scenarios.concat(inheritedScenarios.split(","));
|
|
751
|
+
}
|
|
752
|
+
else if (!isBlankInput(this.scenarios)) {
|
|
753
|
+
scenarios = scenarios.concat(this.scenarios.split(","));
|
|
754
|
+
}
|
|
755
|
+
if (inheritedVariances !== undefined) {
|
|
756
|
+
scenarios = scenarios.concat(inheritedVariances.split(","));
|
|
757
|
+
}
|
|
758
|
+
else if (((_a = this.variances) === null || _a === void 0 ? void 0 : _a.trim().length) > 0) {
|
|
759
|
+
scenarios = scenarios.concat(this.variances.split(","));
|
|
760
|
+
}
|
|
761
|
+
return scenarios.map((entry) => entry.trim());
|
|
762
|
+
}
|
|
763
|
+
const isAuto = ((_b = this.scenarios) === null || _b === void 0 ? void 0 : _b.trim().toLowerCase()) === "auto";
|
|
718
764
|
if ((isBlankInput(this.scenarios) || isAuto) && isBlankInput(this.variances)) {
|
|
719
|
-
if (((
|
|
765
|
+
if (((_d = (_c = this.datasetMeta) === null || _c === void 0 ? void 0 : _c.availableScenarios) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
720
766
|
if (!isAuto) {
|
|
721
767
|
this.errors.addOrReplace({
|
|
722
768
|
id: "AUTO_scenarios",
|
|
@@ -733,7 +779,7 @@ export class Table {
|
|
|
733
779
|
}
|
|
734
780
|
let scenarios = [];
|
|
735
781
|
if (isAuto || isBlankInput(this.scenarios)) {
|
|
736
|
-
if (((
|
|
782
|
+
if (((_f = (_e = this.datasetMeta) === null || _e === void 0 ? void 0 : _e.availableScenarios) === null || _f === void 0 ? void 0 : _f.length) > 0) {
|
|
737
783
|
if (!isAuto) {
|
|
738
784
|
this.errors.addOrReplace({
|
|
739
785
|
id: "AUTO_scenarios",
|
|
@@ -749,10 +795,10 @@ export class Table {
|
|
|
749
795
|
}
|
|
750
796
|
else {
|
|
751
797
|
this.errors.remove("AUTO_scenarios");
|
|
752
|
-
scenarios = scenarios.concat((
|
|
798
|
+
scenarios = scenarios.concat((_g = this.scenarios) === null || _g === void 0 ? void 0 : _g.split(","));
|
|
753
799
|
}
|
|
754
|
-
if (((
|
|
755
|
-
scenarios = scenarios.concat((
|
|
800
|
+
if (((_h = this.variances) === null || _h === void 0 ? void 0 : _h.trim().length) > 0) {
|
|
801
|
+
scenarios = scenarios.concat((_j = this.variances) === null || _j === void 0 ? void 0 : _j.split(","));
|
|
756
802
|
}
|
|
757
803
|
return scenarios.map((entry) => entry.trim());
|
|
758
804
|
}
|
|
@@ -905,7 +951,7 @@ export class Table {
|
|
|
905
951
|
render() {
|
|
906
952
|
const fontStyles = this.getFontStyles();
|
|
907
953
|
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
908
|
-
return (h(Host, { key: '
|
|
954
|
+
return (h(Host, { key: '90572dbaa427d46b526c5a04fd04b94882fcb519', style: fontStyles }, h("div", { key: '947d9a31764fd0def10d902901f300c2a526dc55' }, h("ibcs-table", { key: 'ef57aa654318568eb5a8356a5257a0b75bf55e3a', 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 }))));
|
|
909
955
|
}
|
|
910
956
|
static get is() { return "bn-table"; }
|
|
911
957
|
static get encapsulation() { return "shadow"; }
|
|
@@ -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
|
|
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").
|
|
22
|
-
*
|
|
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
|
|
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
|
|
72
|
+
current = getVisualParent(current);
|
|
41
73
|
}
|
|
42
74
|
// No constrained ancestor found — use viewport
|
|
43
75
|
return typeof window !== "undefined" ? window.innerHeight : 0;
|