@bino-bi/bn-template-engine 1.0.0-alpha.2 → 1.0.0-alpha.4
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-1265d8d3.entry.js +1 -0
- package/dist/bn-template-engine/p-15516dac.entry.js +1 -0
- package/dist/bn-template-engine/p-1c716641.entry.js +1 -0
- package/dist/bn-template-engine/p-27cc8dc0.entry.js +1 -0
- package/dist/bn-template-engine/p-4426d484.entry.js +1 -0
- package/dist/bn-template-engine/p-51f8dc9e.entry.js +1 -0
- package/dist/bn-template-engine/p-53d4e690.entry.js +1 -0
- package/dist/bn-template-engine/p-5KQYRQLK.js +1 -0
- package/dist/bn-template-engine/p-745f4596.entry.js +1 -0
- package/dist/bn-template-engine/{p-0f1504f3.entry.js → p-75e97c87.entry.js} +1 -1
- package/dist/bn-template-engine/p-7a560278.entry.js +1 -0
- package/dist/bn-template-engine/p-7ea7c325.entry.js +1 -0
- package/dist/bn-template-engine/p-945cc95d.entry.js +1 -0
- package/dist/bn-template-engine/p-BYBpC0EO.js +1 -0
- package/dist/bn-template-engine/p-BfXY5dsy.js +1 -0
- package/dist/bn-template-engine/p-BgnHJQ9Q.js +1 -0
- package/dist/bn-template-engine/{p-DgfL-ffj.js → p-Bhd_WSML.js} +1 -1
- package/dist/bn-template-engine/p-Bka-Z6jo.js +1 -0
- package/dist/bn-template-engine/p-Bnhh02CF.js +1 -0
- package/dist/bn-template-engine/p-C7dQL8CS.js +1 -0
- package/dist/bn-template-engine/p-CL1RYuNU.js +1 -0
- package/dist/bn-template-engine/p-CYwd_ZNM.js +1 -0
- package/dist/bn-template-engine/p-ChlK-T9I.js +1 -0
- package/dist/bn-template-engine/p-DHezf8pZ.js +1 -0
- package/dist/bn-template-engine/{p-DVMu6dEy.js → p-DlppAFq9.js} +1 -1
- package/dist/bn-template-engine/p-DvDDgmcV.js +1 -0
- package/dist/bn-template-engine/p-DvvwfRQG.js +1 -0
- package/dist/bn-template-engine/{p-DG-1MR_T.js → p-P7pGJBgc.js} +1 -1
- package/dist/bn-template-engine/p-b34eaf86.entry.js +1 -0
- package/dist/bn-template-engine/p-bdb8b44c.entry.js +1 -0
- package/dist/bn-template-engine/p-c44fcb8e.entry.js +1 -0
- package/dist/bn-template-engine/p-c7e1a49b.entry.js +1 -0
- package/dist/bn-template-engine/p-d9003041.entry.js +1 -0
- package/dist/bn-template-engine/p-daa7ffa3.entry.js +1 -0
- package/dist/bn-template-engine/p-e084f50a.entry.js +1 -0
- package/dist/bn-template-engine/p-eaba6658.entry.js +1 -0
- package/dist/bn-template-engine/{p-CvXqez4D.js → p-u8igQLRZ.js} +1 -1
- package/dist/cjs/{DataFormatDigits-CbIVfGEH.js → DataFormatDigits-DKcOeLNK.js} +1 -1
- package/dist/cjs/{DateStringFactory-CfkXYAMN.js → DateStringFactory-CSKvbS8K.js} +1 -1
- package/dist/cjs/{Order-DtpbD8mQ.js → Order-iG11HI4R.js} +36 -5
- package/dist/cjs/{SVGVariancesStyleGroup-D-rTWlDo.js → SVGVariancesStyleGroup-K-Tw6lOD.js} +1 -14
- package/dist/cjs/bn-asset.cjs.entry.js +5 -4
- package/dist/cjs/bn-body_4.cjs.entry.js +15 -13
- package/dist/cjs/bn-card.cjs.entry.js +5 -4
- package/dist/cjs/{ibcs-chart-structure.cjs.entry.js → bn-chart-structure_5.cjs.entry.js} +1058 -28
- package/dist/cjs/bn-chart-time.cjs.entry.js +38 -12
- package/dist/cjs/bn-component-style.cjs.entry.js +5 -4
- package/dist/cjs/bn-dataset.cjs.entry.js +38 -9
- package/dist/cjs/bn-grid.cjs.entry.js +9 -7
- package/dist/cjs/bn-image.cjs.entry.js +9 -7
- package/dist/cjs/bn-internationalization.cjs.entry.js +5 -4
- package/dist/cjs/bn-layout-card.cjs.entry.js +3 -2
- package/dist/cjs/bn-layout-page.cjs.entry.js +2 -1
- package/dist/cjs/bn-message.cjs.entry.js +5 -4
- package/dist/cjs/bn-table.cjs.entry.js +979 -0
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +3 -2
- package/dist/cjs/bn-text.cjs.entry.js +11 -9
- package/dist/cjs/bn-tree.cjs.entry.js +9 -7
- package/dist/cjs/contentDecoder-JxOldq1e.js +419 -0
- package/dist/cjs/{context-protocol-CRPmux5D.js → context-protocol-DRQWrwsA.js} +2 -0
- package/dist/cjs/editor-companion.cjs.entry.js +1 -1
- package/dist/cjs/emotion-hash.esm-nbbEQ0Dn.js +57 -0
- package/dist/cjs/ibcs-chart-time.cjs.entry.js +22 -18
- package/dist/cjs/{bn-context_5.cjs.entry.js → ibcs-table.cjs.entry.js} +159 -1259
- package/dist/cjs/{StringAdapter-ByCHdlDO.js → ibcsRuleSet-DgUoXOfd.js} +10 -10
- package/dist/cjs/index-Dm85hG6t.js +65 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-D8sIIKft.js → scaling-9Tz595RQ.js} +7 -7
- package/dist/cjs/{withHasError-B8gHkfV2.js → utils-CwHIVbbL.js} +1 -69
- package/dist/cjs/{withBodyObserver-C6gLgq_e.js → withBodyObserver-CKpSD8UT.js} +3 -3
- package/dist/cjs/{withComponentStatus-_x4LQZ0N.js → withComponentStatus-Bw70BhO0.js} +5 -5
- package/dist/cjs/{withComponentStyle-DMtic_9Y.js → withComponentStyle-aIbTCtfj.js} +5 -5
- package/dist/cjs/withHasError-D7ue5vAv.js +72 -0
- package/dist/cjs/{withStyled-BBtMesx3.js → withStyled-CS1Yp4sv.js} +12 -61
- package/dist/cjs/{withTranslation-CWPAIRjh.js → withTranslation-rwgyITqe.js} +5 -5
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +226 -99
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +13 -3
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +94 -11
- package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +3 -4
- package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +4 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +28 -4
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -4
- package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +4 -0
- package/dist/collection/components/bn-dataset/bn-dataset.js +49 -2
- package/dist/collection/components/bn-datasource/bn-datasource.js +46 -3
- package/dist/collection/components/bn-table/bn-table.js +60 -12
- package/dist/collection/components/bn-table/ibcs-table.css +7 -5
- package/dist/collection/components/bn-table/ibcs-table.js +22 -1
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +79 -31
- package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -1
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +12 -3
- package/dist/collection/components/bn-table/utils/helper/ColumnStatistics.js +9 -1
- package/dist/collection/stores/componentStyles.js +2 -0
- package/dist/collection/utils/constants.js +35 -5
- package/dist/collection/utils/contentDecoder.js +28 -0
- package/dist/collection/utils/stackColors.js +2 -2
- package/dist/collection/utils/validate.js +5 -2
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGVariancesStyleGroup.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/contentDecoder.js +1 -0
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/emotion-hash.esm.js +1 -0
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/ibcsRuleSet.js +1 -1
- package/dist/components/validate.js +1 -1
- package/dist/components/withStyled.js +1 -1
- package/dist/esm/{DataFormatDigits-DYdbRX-1.js → DataFormatDigits-oSZ1hBKE.js} +1 -1
- package/dist/esm/{DateStringFactory-DRcbojUT.js → DateStringFactory-CSGz6TDk.js} +1 -1
- package/dist/esm/{Order-DdexOqTs.js → Order-Bnhh02CF.js} +36 -6
- package/dist/esm/{SVGVariancesStyleGroup-D0Cwprv1.js → SVGVariancesStyleGroup-CqTjrZYg.js} +2 -13
- package/dist/esm/bn-asset.entry.js +5 -4
- package/dist/esm/bn-body_4.entry.js +11 -9
- package/dist/esm/bn-card.entry.js +5 -4
- package/dist/esm/{ibcs-chart-structure.entry.js → bn-chart-structure_5.entry.js} +1048 -22
- package/dist/esm/bn-chart-time.entry.js +38 -12
- package/dist/esm/bn-component-style.entry.js +5 -4
- package/dist/esm/bn-dataset.entry.js +35 -6
- package/dist/esm/bn-grid.entry.js +9 -7
- package/dist/esm/bn-image.entry.js +9 -7
- package/dist/esm/bn-internationalization.entry.js +5 -4
- package/dist/esm/bn-layout-card.entry.js +3 -2
- package/dist/esm/bn-layout-page.entry.js +2 -1
- package/dist/esm/bn-message.entry.js +5 -4
- package/dist/esm/bn-table.entry.js +977 -0
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +3 -2
- package/dist/esm/bn-text.entry.js +11 -9
- package/dist/esm/bn-tree.entry.js +9 -7
- package/dist/esm/contentDecoder-oMmxz6nJ.js +416 -0
- package/dist/esm/{context-protocol-Bz5klD-F.js → context-protocol-BHnQsVsr.js} +2 -0
- package/dist/esm/editor-companion.entry.js +1 -1
- package/dist/esm/emotion-hash.esm-BYBpC0EO.js +55 -0
- package/dist/esm/ibcs-chart-time.entry.js +15 -11
- package/dist/esm/{bn-context_5.entry.js → ibcs-table.entry.js} +106 -1202
- package/dist/esm/{StringAdapter-CTL-Dvzp.js → ibcsRuleSet-K4ytuA1f.js} +10 -10
- package/dist/esm/index-DHezf8pZ.js +65 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-C6K8FYSF.js → scaling-Cehc74IE.js} +2 -2
- package/dist/esm/{withHasError-B3QX2emi.js → utils-DvvwfRQG.js} +1 -69
- package/dist/esm/{withBodyObserver-DczL5ia8.js → withBodyObserver-FQ8NwCIz.js} +1 -1
- package/dist/esm/{withComponentStatus-DodoSXe-.js → withComponentStatus-DWjDYtZ7.js} +1 -1
- package/dist/esm/{withComponentStyle-BerJY64r.js → withComponentStyle-9uP_hcDq.js} +2 -2
- package/dist/esm/withHasError-FyY5mQ_3.js +70 -0
- package/dist/esm/{withStyled-DCipbf2O.js → withStyled--qQWquTH.js} +9 -59
- package/dist/esm/{withTranslation-mimbJdER.js → withTranslation-BqD0Kp7b.js} +2 -2
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +155 -109
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +7 -0
- package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +1 -0
- package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +1 -0
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +6 -0
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +8 -0
- package/dist/types/components/bn-table/bn-table.d.ts +12 -8
- package/dist/types/components/bn-table/ibcs-table.d.ts +1 -0
- package/dist/types/components/bn-table/utils/elements/Cell.d.ts +1 -0
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +1 -0
- package/dist/types/components.d.ts +118 -34
- package/dist/types/stores/componentStyles.d.ts +2 -0
- package/dist/types/utils/constants.d.ts +23 -5
- package/dist/types/utils/contentDecoder.d.ts +12 -0
- package/dist/types/utils/validate.d.ts +1 -0
- package/package.json +2 -1
- package/dist/bn-template-engine/p--PSoPbDM.js +0 -1
- package/dist/bn-template-engine/p-05a82a77.entry.js +0 -1
- package/dist/bn-template-engine/p-0ca8dc17.entry.js +0 -1
- package/dist/bn-template-engine/p-1d9a3be9.entry.js +0 -1
- package/dist/bn-template-engine/p-35638ad0.entry.js +0 -1
- package/dist/bn-template-engine/p-37881d05.entry.js +0 -1
- package/dist/bn-template-engine/p-3b894997.entry.js +0 -1
- package/dist/bn-template-engine/p-50e49732.entry.js +0 -1
- package/dist/bn-template-engine/p-60a7fc59.entry.js +0 -1
- package/dist/bn-template-engine/p-6c7c0455.entry.js +0 -1
- package/dist/bn-template-engine/p-6da93eae.entry.js +0 -1
- package/dist/bn-template-engine/p-701e1578.entry.js +0 -1
- package/dist/bn-template-engine/p-BSfqOkN_.js +0 -1
- package/dist/bn-template-engine/p-CRLgp9-v.js +0 -1
- package/dist/bn-template-engine/p-CYjZRKdI.js +0 -1
- package/dist/bn-template-engine/p-DRikHQE-.js +0 -1
- package/dist/bn-template-engine/p-DVo6aZUE.js +0 -1
- package/dist/bn-template-engine/p-DdexOqTs.js +0 -1
- package/dist/bn-template-engine/p-DyRaC0MB.js +0 -1
- package/dist/bn-template-engine/p-a95ccc16.entry.js +0 -1
- package/dist/bn-template-engine/p-b7bec050.entry.js +0 -1
- package/dist/bn-template-engine/p-bc59ea5c.entry.js +0 -1
- package/dist/bn-template-engine/p-d279b578.entry.js +0 -1
- package/dist/bn-template-engine/p-dd9dd407.entry.js +0 -1
- package/dist/bn-template-engine/p-e102a490.entry.js +0 -1
- package/dist/bn-template-engine/p-f27995c9.entry.js +0 -1
- package/dist/bn-template-engine/p-f89e55c6.entry.js +0 -1
- package/dist/bn-template-engine/p-tzFCK9qn.js +0 -1
- package/dist/cjs/bn-chart-structure.cjs.entry.js +0 -700
- package/dist/esm/bn-chart-structure.entry.js +0 -698
|
@@ -1,1170 +1,14 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import {
|
|
3
|
-
import { w as withComponentStatus } from './withComponentStatus-DodoSXe-.js';
|
|
4
|
-
import { w as withHasError } from './withHasError-B3QX2emi.js';
|
|
5
|
-
import { w as withBodyObserver } from './withBodyObserver-DczL5ia8.js';
|
|
6
|
-
import { j as isBlankInput, w as withStyled, v as validateScenarioList, a as validateVariancesList, i as isValidNumber, p as isValidDataFormat, f as isValidBoolean, q as isValidTableType, e as isValidInteger, r as validateThereOfJsonStr, s as validatePartOfJsonStr, c as validateOrderList, d as isValidDirection, t as isValidMeasureType, g as isValidMeasureScale, u as isTableCategoryWidth, x as validateColumnThereOfJsonStr } from './withStyled-DCipbf2O.js';
|
|
7
|
-
import { w as withComponentStyle } from './withComponentStyle-BerJY64r.js';
|
|
8
|
-
import { w as withDataset, g as getParentDimensions, p as parseScaling } from './scaling-C6K8FYSF.js';
|
|
9
|
-
import { w as withTranslation } from './withTranslation-mimbJdER.js';
|
|
10
|
-
import { h as DataFormat, O as OrderDirection$1, a as OrderColumn, I as I18nMode, i as TableCategoryWidth, M as MeasureType, e as CompareUtil, d as AdapterUtils, j as OrderAdapter } from './Order-DdexOqTs.js';
|
|
1
|
+
import { h, r as registerInstance, H as Host, g as getElement } from './index-JNHhIe7t.js';
|
|
2
|
+
import { a as TableRowType, T as TableType, O as OrderDirection, F as FactoryState } from './index-DHezf8pZ.js';
|
|
11
3
|
import { F as Formatter, Q as QueryColumnNames, V as VarianceScenario } from './formatter-DTMEZ6d8.js';
|
|
4
|
+
import { I as I18nMode, d as DataFormat, g as CompareUtil, f as AdapterUtils, l as OrderAdapter, T as TableCategoryWidth, M as MeasureType } from './Order-Bnhh02CF.js';
|
|
12
5
|
import { a as alasql } from './alasql.min-CWu4NkIt.js';
|
|
13
|
-
import { I as IBCSRuleSet, S as StringAdapter } from './
|
|
14
|
-
import { D as DataAnalyzer, S as SiPrefix, a as DataFormatDigits, b as DataFormatDigitsAdapter } from './DataFormatDigits-
|
|
15
|
-
import './
|
|
6
|
+
import { I as IBCSRuleSet, S as StringAdapter } from './ibcsRuleSet-K4ytuA1f.js';
|
|
7
|
+
import { D as DataAnalyzer, S as SiPrefix, a as DataFormatDigits, b as DataFormatDigitsAdapter } from './DataFormatDigits-oSZ1hBKE.js';
|
|
8
|
+
import { w as withComponentStyle } from './withComponentStyle-9uP_hcDq.js';
|
|
16
9
|
import './_commonjsHelpers-BFTU3MAI.js';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const Context = class {
|
|
21
|
-
constructor(hostRef) {
|
|
22
|
-
registerInstance(this, hostRef);
|
|
23
|
-
this.currentPageUpdate = undefined;
|
|
24
|
-
withComponentStatus(this);
|
|
25
|
-
this.errors = withHasError(this);
|
|
26
|
-
}
|
|
27
|
-
setLocale(newValue) {
|
|
28
|
-
this.stores.context.state.locale = newValue;
|
|
29
|
-
}
|
|
30
|
-
connectedCallback() {
|
|
31
|
-
// Retrieve (or create) the stores for this context element.
|
|
32
|
-
// A descendant component may have already triggered creation via
|
|
33
|
-
// getStores() if Stencil initialized it before this component.
|
|
34
|
-
this.stores = getOrCreateStores(this.element);
|
|
35
|
-
if (this.locale) {
|
|
36
|
-
this.stores.context.state.locale = this.locale;
|
|
37
|
-
}
|
|
38
|
-
this.currentPageUpdate = setTimeout(() => {
|
|
39
|
-
this.element.querySelectorAll("bn-page, bn-layout-page").forEach((page, index) => {
|
|
40
|
-
if (page.localName === "bn-layout-page") {
|
|
41
|
-
page.setAttribute("page-number", (index + 1).toString());
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
const footer = page.querySelector("bn-footer");
|
|
45
|
-
if (footer) {
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
footer.setAttribute("page-number", (index + 1).toString());
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}, 250);
|
|
52
|
-
}
|
|
53
|
-
disconnectedCallback() {
|
|
54
|
-
if (this.currentPageUpdate) {
|
|
55
|
-
clearTimeout(this.currentPageUpdate);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
componentWillLoad() {
|
|
59
|
-
// stencil needs one componenet implementing all lifecycle steps to get mixing working
|
|
60
|
-
}
|
|
61
|
-
componentDidLoad() { }
|
|
62
|
-
componentShouldUpdate() { }
|
|
63
|
-
componentWillRender() { }
|
|
64
|
-
componentDidRender() { }
|
|
65
|
-
componentWillUpdate() { }
|
|
66
|
-
componentDidUpdate() { }
|
|
67
|
-
render() {
|
|
68
|
-
return (h(Host, { key: 'b92019b909e271225baca2cf740c8301e324164e' }, h("slot", { key: '87bac4bb29bca32d961afe31355dc1bd48fff0f8' })));
|
|
69
|
-
}
|
|
70
|
-
get element() { return getElement(this); }
|
|
71
|
-
static get watchers() { return {
|
|
72
|
-
"locale": [{
|
|
73
|
-
"setLocale": 0
|
|
74
|
-
}]
|
|
75
|
-
}; }
|
|
76
|
-
};
|
|
77
|
-
Context.style = bnContextCss();
|
|
78
|
-
|
|
79
|
-
const bnDatasourceCss = () => `bn-datasource{display:none}`;
|
|
80
|
-
|
|
81
|
-
const Datasource = class {
|
|
82
|
-
constructor(hostRef) {
|
|
83
|
-
registerInstance(this, hostRef);
|
|
84
|
-
withComponentStatus(this);
|
|
85
|
-
this.errors = withHasError(this);
|
|
86
|
-
withBodyObserver(this, (data) => {
|
|
87
|
-
if (!this.stores)
|
|
88
|
-
this.stores = getStores(this.element);
|
|
89
|
-
try {
|
|
90
|
-
const json = JSON.parse(data);
|
|
91
|
-
// @ts-ignore
|
|
92
|
-
this.stores.datasources.set(this.name, json);
|
|
93
|
-
}
|
|
94
|
-
catch (e) {
|
|
95
|
-
console.error("Error parsing datasource", e, data);
|
|
96
|
-
// @ts-ignore
|
|
97
|
-
this.stores.datasources.set(this.name, []);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
render() {
|
|
102
|
-
return h(Host, { key: 'e47e62c941bb7954cabe331cb500a7d2fdd7c487' });
|
|
103
|
-
}
|
|
104
|
-
get element() { return getElement(this); }
|
|
105
|
-
};
|
|
106
|
-
Datasource.style = bnDatasourceCss();
|
|
107
|
-
|
|
108
|
-
const bnPageCss = () => `: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);height:768px;width:1024px;display:flex;flex-direction:column;page-break-after:always;overflow:hidden}:host([format=xga]){height:768px;width:1024px}:host([format=xga][orientation=portrait]){height:1024px;width:768px}:host([format=xga][orientation=landscape]){height:768px;width:1024px}:host([format=hd]){height:720px;width:1280px}:host([format=hd][orientation=portrait]){height:1280px;width:720px}:host([format=hd][orientation=landscape]){height:720px;width:1280px}:host([format=full_hd]){height:1080px;width:1920px}:host([format=full_hd][orientation=portrait]){height:1920px;width:1080px}:host([format=full_hd][orientation=landscape]){height:1080px;width:1920px}:host([format="4k"]){height:2160px;width:3840px}:host([format="4k"][orientation=portrait]){height:3840px;width:2160px}:host([format="4k"][orientation=landscape]){height:2160px;width:3840px}:host([format="4k2k"]){height:2160px;width:4096px}:host([format="4k2k"][orientation=portrait]){height:4096px;width:2160px}:host([format="4k2k"][orientation=landscape]){height:2160px;width:4096px}:host([format=a6]){height:5.83in;width:4.13in}:host([format=a6][orientation=portrait]){height:5.83in;width:4.13in}:host([format=a6][orientation=landscape]){height:4.13in;width:5.83in}:host([format=a5]){height:8.27in;width:5.83in}:host([format=a5][orientation=portrait]){height:8.27in;width:5.83in}:host([format=a5][orientation=landscape]){height:5.83in;width:8.27in}:host([format=a4]){height:11.6in;width:8.17in}:host([format=a4][orientation=portrait]){height:11.6in;width:8.17in}:host([format=a4][orientation=landscape]){height:8.17in;width:11.6in}:host([format=a3]){height:16.54in;width:11.7in}:host([format=a3][orientation=portrait]){height:16.54in;width:11.7in}:host([format=a3][orientation=landscape]){height:11.7in;width:16.54in}:host([format=a2]){height:23.4in;width:16.54in}:host([format=a2][orientation=portrait]){height:23.4in;width:16.54in}:host([format=a2][orientation=landscape]){height:16.54in;width:23.4in}:host([format=a1]){height:33.1in;width:23.4in}:host([format=a1][orientation=portrait]){height:33.1in;width:23.4in}:host([format=a1][orientation=landscape]){height:23.4in;width:33.1in}:host([format=a0]){height:46.8in;width:33.1in}:host([format=a0][orientation=portrait]){height:46.8in;width:33.1in}:host([format=a0][orientation=landscape]){height:33.1in;width:46.8in}:host([format=letter]){height:11in;width:8.5in}:host([format=letter][orientation=portrait]){height:11in;width:8.5in}:host([format=letter][orientation=landscape]){height:8.5in;width:11in}:host([format=legal]){height:14in;width:8.5in}:host([format=legal][orientation=portrait]){height:14in;width:8.5in}:host([format=legal][orientation=landscape]){height:8.5in;width:14in}:host([format=tabloid]){height:17in;width:11in}:host([format=tabloid][orientation=portrait]){height:17in;width:11in}:host([format=tabloid][orientation=landscape]){height:11in;width:17in}:host([format=ledger]){height:11in;width:17in}:host([format=ledger][orientation=portrait]){height:17in;width:11in}:host([format=ledger][orientation=landscape]){height:11in;width:17in}`;
|
|
109
|
-
|
|
110
|
-
const VALID_FORMATS = ["xga", "hd", "full-hd", "4k", "4k2k", "a4", "a3", "a2", "a1", "a0", "letter", "legal"];
|
|
111
|
-
const VALID_ORIENTATIONS = ["landscape", "portrait"];
|
|
112
|
-
const Page = class {
|
|
113
|
-
constructor(hostRef) {
|
|
114
|
-
registerInstance(this, hostRef);
|
|
115
|
-
withComponentStatus(this);
|
|
116
|
-
this.errors = withHasError(this);
|
|
117
|
-
this.componentStyle = withComponentStyle(this);
|
|
118
|
-
}
|
|
119
|
-
validateFormat(newValue) {
|
|
120
|
-
const errId = "ERR_format";
|
|
121
|
-
if (!isBlankInput(newValue) && !VALID_FORMATS.includes(newValue)) {
|
|
122
|
-
this.errors.addOrReplace({
|
|
123
|
-
id: errId,
|
|
124
|
-
type: "warning",
|
|
125
|
-
message: `format: invalid value '${newValue}' is not supported. Valid values: ${VALID_FORMATS.join(", ")}`,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
this.errors.remove(errId);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
validateOrientation(newValue) {
|
|
133
|
-
const errId = "ERR_orientation";
|
|
134
|
-
if (!isBlankInput(newValue) && !VALID_ORIENTATIONS.includes(newValue)) {
|
|
135
|
-
this.errors.addOrReplace({
|
|
136
|
-
id: errId,
|
|
137
|
-
type: "warning",
|
|
138
|
-
message: `orientation: invalid value '${newValue}' is not supported. Valid values: ${VALID_ORIENTATIONS.join(", ")}`,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
this.errors.remove(errId);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
render() {
|
|
146
|
-
return (h(Host, { key: 'b4d682a8f6e83f77c58236265eaf9d1327809c6f', format: this.format, orientation: this.orientation, style: this.prepareStyle() }, h("slot", { key: 'ef49c43c1f8926c4c968b752608627adbe330d6c' })));
|
|
147
|
-
}
|
|
148
|
-
prepareStyle() {
|
|
149
|
-
const pageStyle = {
|
|
150
|
-
"font-family": this.componentStyle(($) => $.global["fontFamily"]),
|
|
151
|
-
"font-size": `${this.componentStyle(($) => $.global["fontSizePx"])}px`,
|
|
152
|
-
"--bn-font-family": this.componentStyle(($) => $.global["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
153
|
-
"--bn-font-size": `${this.componentStyle(($) => $.global["fontSizePx"]) || 13.3333}px`,
|
|
154
|
-
"--bn-font-color": this.componentStyle(($) => $.global["fontColor"]) || "#000000",
|
|
155
|
-
"--bn-font-background": this.componentStyle(($) => $.global["fontBackgroundColor"]) || "#ffffff",
|
|
156
|
-
};
|
|
157
|
-
return pageStyle;
|
|
158
|
-
}
|
|
159
|
-
get element() { return getElement(this); }
|
|
160
|
-
static get watchers() { return {
|
|
161
|
-
"format": [{
|
|
162
|
-
"validateFormat": 0
|
|
163
|
-
}],
|
|
164
|
-
"orientation": [{
|
|
165
|
-
"validateOrientation": 0
|
|
166
|
-
}]
|
|
167
|
-
}; }
|
|
168
|
-
};
|
|
169
|
-
Page.style = bnPageCss();
|
|
170
|
-
|
|
171
|
-
/** Sentinel value indicating all groups should be included. */
|
|
172
|
-
var GroupSelection;
|
|
173
|
-
(function (GroupSelection) {
|
|
174
|
-
GroupSelection[GroupSelection["ALL"] = -1] = "ALL";
|
|
175
|
-
})(GroupSelection || (GroupSelection = {}));
|
|
176
|
-
/**
|
|
177
|
-
* Tracks whether a factory's output is current or needs recalculation.
|
|
178
|
-
* Used to avoid redundant re-rendering when underlying data has not changed.
|
|
179
|
-
*/
|
|
180
|
-
var FactoryState;
|
|
181
|
-
(function (FactoryState) {
|
|
182
|
-
/** Output matches the current input data. */
|
|
183
|
-
FactoryState[FactoryState["UP_TO_DATE"] = 0] = "UP_TO_DATE";
|
|
184
|
-
/** Input data has changed; output needs to be regenerated. */
|
|
185
|
-
FactoryState[FactoryState["DIRTY"] = 1] = "DIRTY";
|
|
186
|
-
})(FactoryState || (FactoryState = {}));
|
|
187
|
-
/**
|
|
188
|
-
* Table aggregation modes controlling how rows are grouped and totalled.
|
|
189
|
-
*
|
|
190
|
-
* - `LIST` -- Flat list with no aggregation.
|
|
191
|
-
* - `SUM` -- Grouped rows with sum totals per group and a grand total.
|
|
192
|
-
* - `SUMNOTOTAL` -- Grouped rows with group sums but no grand total row.
|
|
193
|
-
* - `OPT` -- Operation-aware aggregation (respects the +/- operation field).
|
|
194
|
-
* - `OPTNOTOTAL` -- Operation-aware aggregation without a grand total row.
|
|
195
|
-
*/
|
|
196
|
-
var TableType;
|
|
197
|
-
(function (TableType) {
|
|
198
|
-
TableType["LIST"] = "list";
|
|
199
|
-
TableType["SUM"] = "sum";
|
|
200
|
-
TableType["SUMNOTOTAL"] = "sumnototal";
|
|
201
|
-
TableType["OPT"] = "opt";
|
|
202
|
-
TableType["OPTNOTOTAL"] = "optnototal";
|
|
203
|
-
})(TableType || (TableType = {}));
|
|
204
|
-
var OrderDirection;
|
|
205
|
-
(function (OrderDirection) {
|
|
206
|
-
OrderDirection["ASC"] = "asc";
|
|
207
|
-
OrderDirection["DESC"] = "desc";
|
|
208
|
-
})(OrderDirection || (OrderDirection = {}));
|
|
209
|
-
/**
|
|
210
|
-
* Discriminator for rendered table rows, controlling visual styling and behavior.
|
|
211
|
-
*
|
|
212
|
-
* - `HEADER` -- Column header row.
|
|
213
|
-
* - `GROUPHEAD` -- Group title row (rendered when `grouped` is true).
|
|
214
|
-
* - `SEPERATORLINE` -- Visual divider between groups.
|
|
215
|
-
* - `SUM` -- Grand total row.
|
|
216
|
-
* - `GROUPSUM` -- Sub-total row for a single group.
|
|
217
|
-
* - `DRILLELEMENT` -- "Thereof" drill-down sub-row.
|
|
218
|
-
* - `STANDARD` -- Normal data row.
|
|
219
|
-
* - `PARTELEMENT` -- "Part of" percentage row.
|
|
220
|
-
* - `ENTRY` -- Generic entry row.
|
|
221
|
-
*/
|
|
222
|
-
var TableRowType;
|
|
223
|
-
(function (TableRowType) {
|
|
224
|
-
TableRowType["HEADER"] = "HEADER";
|
|
225
|
-
TableRowType["GROUPHEAD"] = "GROUPHEAD";
|
|
226
|
-
TableRowType["SEPERATORLINE"] = "SEPERATORLINE";
|
|
227
|
-
TableRowType["SUM"] = "SUM";
|
|
228
|
-
TableRowType["GROUPSUM"] = "GROUP_SUM";
|
|
229
|
-
TableRowType["DRILLELEMENT"] = "DRILLELEMENT";
|
|
230
|
-
TableRowType["STANDARD"] = "STANDARD";
|
|
231
|
-
TableRowType["PARTELEMENT"] = "PARTELEMENT";
|
|
232
|
-
TableRowType["ENTRY"] = "ENTRY";
|
|
233
|
-
})(TableRowType || (TableRowType = {}));
|
|
234
|
-
|
|
235
|
-
const bnTableCss = () => `:host{display:inline-block;position:relative;overflow:hidden}`;
|
|
236
|
-
|
|
237
|
-
const Table$1 = class Table {
|
|
238
|
-
validateScaling(newValue) {
|
|
239
|
-
if (newValue == null || newValue === "" || newValue === "none" || newValue === "auto") {
|
|
240
|
-
this.errors.remove("ERR_scale");
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
const num = Number(newValue);
|
|
244
|
-
if (isNaN(num) || num <= 0) {
|
|
245
|
-
this.errors.addOrReplace({
|
|
246
|
-
id: "ERR_scale",
|
|
247
|
-
type: "warning",
|
|
248
|
-
message: `Invalid scale value: "${newValue}". Use "none", "auto", or a positive number.`,
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
this.errors.remove("ERR_scale");
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
constructor(hostRef) {
|
|
256
|
-
registerInstance(this, hostRef);
|
|
257
|
-
this.data = [];
|
|
258
|
-
this.datasetMeta = null;
|
|
259
|
-
this.appliedScaleFactor = 1;
|
|
260
|
-
/**
|
|
261
|
-
* A not mundane tile which should describes the shown data.
|
|
262
|
-
*/
|
|
263
|
-
this.tableTitle = "";
|
|
264
|
-
/**
|
|
265
|
-
* AlaSQL WHERE clause fragment injected into the data query to filter
|
|
266
|
-
* rows before rendering (e.g. `"category = 'Sales'"`).
|
|
267
|
-
*/
|
|
268
|
-
this.filter = "";
|
|
269
|
-
/**
|
|
270
|
-
* measureUnit displayed in table.
|
|
271
|
-
*/
|
|
272
|
-
this.measureUnit = "";
|
|
273
|
-
/**
|
|
274
|
-
* Scaling for absolute variance bar charts (ΔPY).
|
|
275
|
-
* <br /><br />
|
|
276
|
-
* Name of the 'scaling-group' which the table uses.
|
|
277
|
-
* Scaling groups are maintained globally.
|
|
278
|
-
* <br /><br />
|
|
279
|
-
* Alternatively a number which represents pixels per unit of measure.
|
|
280
|
-
* <br /><br />
|
|
281
|
-
* Example: 0.01 means 1000 units = 10 pixels width.
|
|
282
|
-
* <br /><br />
|
|
283
|
-
* Default: 0.01
|
|
284
|
-
*/
|
|
285
|
-
this.unitScaling = 0.01;
|
|
286
|
-
/**
|
|
287
|
-
* Scaling for relative variance pin charts (ΔPY%).
|
|
288
|
-
* <br /><br />
|
|
289
|
-
* Name of the 'scaling-group' which the table uses.
|
|
290
|
-
* Scaling groups are maintained globally.
|
|
291
|
-
* <br /><br />
|
|
292
|
-
* Alternatively a number which represents pixels per percentage point.
|
|
293
|
-
* <br /><br />
|
|
294
|
-
* Example: 0.5 means 100% = 50 pixels width.
|
|
295
|
-
* <br /><br />
|
|
296
|
-
* Default: 0.5
|
|
297
|
-
*/
|
|
298
|
-
this.percentageScaling = 0.5;
|
|
299
|
-
// Global scaling groups map - can be populated externally for shared scaling across components
|
|
300
|
-
this.pixelPerUnitGroupMap = new Map();
|
|
301
|
-
/**
|
|
302
|
-
* Defines the data unit type of the tables data.
|
|
303
|
-
* <br /><br />
|
|
304
|
-
* If percent is chosen all data values are converted into percent
|
|
305
|
-
* (0.02 -> 2%)
|
|
306
|
-
* <br /><br />
|
|
307
|
-
* values: <br />
|
|
308
|
-
* ```percent // decimal```
|
|
309
|
-
*/
|
|
310
|
-
this.dataFormat = "decimal";
|
|
311
|
-
/**
|
|
312
|
-
* Toggles of data should be grouped by
|
|
313
|
-
* 'rowgroup'.
|
|
314
|
-
* <br /><br />
|
|
315
|
-
* values: <br />
|
|
316
|
-
* ```true // false```
|
|
317
|
-
*/
|
|
318
|
-
this.grouped = "false";
|
|
319
|
-
/**
|
|
320
|
-
* Toggles display of measure units in table header
|
|
321
|
-
* <br /><br />
|
|
322
|
-
* values: <br />
|
|
323
|
-
* ```true // false```
|
|
324
|
-
*/
|
|
325
|
-
this.showMeasureScale = "false";
|
|
326
|
-
/**
|
|
327
|
-
* Toggles a title header for each (row-)group
|
|
328
|
-
* the title header value is found set by 'rowgroup'
|
|
329
|
-
* <br /><br />
|
|
330
|
-
* values: <br />
|
|
331
|
-
* ```true // false```
|
|
332
|
-
*
|
|
333
|
-
*/
|
|
334
|
-
this.showGroupTitle = "true";
|
|
335
|
-
/**
|
|
336
|
-
* Set the table type
|
|
337
|
-
* <br /><br />
|
|
338
|
-
* values: <br />
|
|
339
|
-
* ```list // sum // opt // sumnototal // optnototal```
|
|
340
|
-
*
|
|
341
|
-
*/
|
|
342
|
-
this.type = "list";
|
|
343
|
-
/**
|
|
344
|
-
* Set the maximum number of rows for each
|
|
345
|
-
* group. The value 0 means *no limit*
|
|
346
|
-
* <br /><br />
|
|
347
|
-
* rows wich where cut by the limit are cumulated as REST
|
|
348
|
-
*
|
|
349
|
-
*/
|
|
350
|
-
this.limit = 0;
|
|
351
|
-
/**
|
|
352
|
-
* Stringified Array of drilldown Objects {
|
|
353
|
-
"rowGroup": string,<br />
|
|
354
|
-
"category": string,<br />
|
|
355
|
-
"subCategory": string,<br />
|
|
356
|
-
},<br /><br />
|
|
357
|
-
* rowgroup, categroy defines the location of the drill
|
|
358
|
-
* subcategory is the displayed label of the data row
|
|
359
|
-
*<br /><br />
|
|
360
|
-
* example:<br />
|
|
361
|
-
* ```[{
|
|
362
|
-
"rowGroup":"Umsatz",
|
|
363
|
-
"category": "Applications",
|
|
364
|
-
"subCategory": "Applications-A",
|
|
365
|
-
},]```
|
|
366
|
-
*/
|
|
367
|
-
this.thereof = "[]";
|
|
368
|
-
/**
|
|
369
|
-
* Stringified Array of Partof Objects <br />{<br />
|
|
370
|
-
"rowGroup": string,<br />
|
|
371
|
-
"category": string<br />
|
|
372
|
-
},<br /><br />
|
|
373
|
-
* rowgroup, categroy defines the location of the drill
|
|
374
|
-
* percentage of category in rowgorup
|
|
375
|
-
*<br /><br />
|
|
376
|
-
* example:<br />
|
|
377
|
-
* ```[{
|
|
378
|
-
"rowGroups":"Umsatz",
|
|
379
|
-
"category": "Applications",
|
|
380
|
-
},]```
|
|
381
|
-
*/
|
|
382
|
-
this.partof = "[]";
|
|
383
|
-
/** List of the primary scenarios on which the order direction are applied valid scenarios are
|
|
384
|
-
* If order is set to a scenario it has also exists in scenariolist
|
|
385
|
-
* <br /><br />
|
|
386
|
-
* values: <br />
|
|
387
|
-
* ```category // categoryindex // rowgroup // rowgroup // rowgroupindex // ac[1-4] // fc[1-4] // pp[1-4] // pl[1-4] // auto```
|
|
388
|
-
* <br /><br />
|
|
389
|
-
* When set to ```auto```, order is detected from the dataset silently.
|
|
390
|
-
*/
|
|
391
|
-
this.order = "category";
|
|
392
|
-
/** Set sorting order direction
|
|
393
|
-
* <br /><br />
|
|
394
|
-
* values: <br />
|
|
395
|
-
* ```asc // desc```
|
|
396
|
-
*/
|
|
397
|
-
this.orderDirection = "asc";
|
|
398
|
-
/** Sets the Measure Type of the Table
|
|
399
|
-
* volume is different displayed and interpreted as currency
|
|
400
|
-
* names of siprefix are adapted.
|
|
401
|
-
* <br /><br />
|
|
402
|
-
* values: <br />
|
|
403
|
-
* ```volume // currency```
|
|
404
|
-
|
|
405
|
-
*/
|
|
406
|
-
this.measureType = "volume";
|
|
407
|
-
/**
|
|
408
|
-
* Sets the SiPrefix of the Mesaurements and converts the
|
|
409
|
-
* original value.
|
|
410
|
-
* <br /><br />
|
|
411
|
-
* values: <br />
|
|
412
|
-
* ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p // P // f // a // z // y // GREATEST // LEAST```
|
|
413
|
-
* <br /><br />
|
|
414
|
-
* SiPrefix overview:
|
|
415
|
-
* ``` "Y": 1E+24,```<br />
|
|
416
|
-
* ``` "Z": 1E+21,```<br />
|
|
417
|
-
* ``` "E": 1E+18,```<br />
|
|
418
|
-
* ``` "P": 1E+15,```<br />
|
|
419
|
-
* ``` "T": 1E+12,```<br />
|
|
420
|
-
* ``` "G": 1000000000,```<br />
|
|
421
|
-
* ``` "M": 1000000,```<br />
|
|
422
|
-
* ``` "k": 1000,```<br />
|
|
423
|
-
* <br />
|
|
424
|
-
* ``` "m": 0.001,```<br />
|
|
425
|
-
* ``` "μ": 0.000001,```<br />
|
|
426
|
-
* ``` "n": 0.000000001,```<br />
|
|
427
|
-
* ``` "p": 0.000000000001,```<br />
|
|
428
|
-
* ``` "f": 0.000000000000001,```<br />
|
|
429
|
-
* ``` "a": 0.000000000000000001,```<br />
|
|
430
|
-
* ``` "z": 0.000000000000000000001,```<br />
|
|
431
|
-
* ``` "y": 0.000000000000000000000001,```<br />
|
|
432
|
-
* <br /><br />
|
|
433
|
-
* Special modes:
|
|
434
|
-
* ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
435
|
-
* ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
436
|
-
*<br /><br />
|
|
437
|
-
* ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
*/
|
|
441
|
-
this.measureScale = "greatest";
|
|
442
|
-
/**
|
|
443
|
-
* Number of decimal digits in a table cell
|
|
444
|
-
*/
|
|
445
|
-
this.dataFormatDigitsDecimal = 1;
|
|
446
|
-
/**
|
|
447
|
-
* Number of percent digits in a table cell
|
|
448
|
-
*/
|
|
449
|
-
this.dataFormatDigitsPercent = 2;
|
|
450
|
-
/**
|
|
451
|
-
* Set width of category column. <br />
|
|
452
|
-
* If INF is selected the columns scaling to the min space they need
|
|
453
|
-
* seperatly.
|
|
454
|
-
* <br /><br />
|
|
455
|
-
* values:<br />
|
|
456
|
-
* ``` w5 // w10 // w15 // w20 // w25 // w50 // inf ```
|
|
457
|
-
*/
|
|
458
|
-
this.categoryWidth = "w15";
|
|
459
|
-
/**
|
|
460
|
-
* Defines which drill-column is displayed. <br />
|
|
461
|
-
* <br /><br />
|
|
462
|
-
* ```scenario``` the scenaro to drill <br/>
|
|
463
|
-
* ```group``` is a list of child columns of the parent <br/><br/>
|
|
464
|
-
* ```subGroups``` is a list of child columns of the parent <br/><br/>
|
|
465
|
-
* example:<br />
|
|
466
|
-
* ```[{"scenario": "ac1", "name": "DE", "subGroups": ["Berlin"]},
|
|
467
|
-
* {"scenario": "ac2", "name": "UK", "subGroups": []}],
|
|
468
|
-
* ```
|
|
469
|
-
*/
|
|
470
|
-
this.columnthereof = null;
|
|
471
|
-
this._autoScaleGuard = false;
|
|
472
|
-
withStyled(this);
|
|
473
|
-
withComponentStatus(this);
|
|
474
|
-
this.errors = withHasError(this);
|
|
475
|
-
this.componentStyle = withComponentStyle(this);
|
|
476
|
-
withDataset(this, (_name, data) => {
|
|
477
|
-
this.data = (data || []);
|
|
478
|
-
}, (_name, meta) => {
|
|
479
|
-
this.datasetMeta = meta;
|
|
480
|
-
});
|
|
481
|
-
this.t = withTranslation(this).t;
|
|
482
|
-
}
|
|
483
|
-
validateScenario(newValue) {
|
|
484
|
-
const errId = "ERR_scenarios";
|
|
485
|
-
const invalidScenarios = validateScenarioList(newValue);
|
|
486
|
-
if (invalidScenarios.length > 0) {
|
|
487
|
-
this.errors.addOrReplace({
|
|
488
|
-
id: errId,
|
|
489
|
-
type: "warning",
|
|
490
|
-
message: "scenarios: invalid value(s) '" + (invalidScenarios === null || invalidScenarios === void 0 ? void 0 : invalidScenarios.toString()) + "' are not supported.",
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
this.errors.remove(errId);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
validateVariances(newValue) {
|
|
498
|
-
const errId = "ERR_variances";
|
|
499
|
-
const invalidVariances = validateVariancesList(newValue);
|
|
500
|
-
if (invalidVariances.length > 0) {
|
|
501
|
-
this.errors.addOrReplace({
|
|
502
|
-
id: errId,
|
|
503
|
-
type: "warning",
|
|
504
|
-
message: "variances: invalid value(s) '" + JSON.stringify(invalidVariances) + "' are not supported.",
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
else {
|
|
508
|
-
this.errors.remove(errId);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
validateBarColumns(newValue) {
|
|
512
|
-
const errId = "ERR_barColumns";
|
|
513
|
-
if (isBlankInput(newValue)) {
|
|
514
|
-
this.errors.remove(errId);
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
const invalidColumns = validateVariancesList(newValue);
|
|
518
|
-
if (invalidColumns.length > 0) {
|
|
519
|
-
this.errors.addOrReplace({
|
|
520
|
-
id: errId,
|
|
521
|
-
type: "warning",
|
|
522
|
-
message: "barColumns: invalid value(s) '" + JSON.stringify(invalidColumns) + "' are not supported.",
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
else {
|
|
526
|
-
this.errors.remove(errId);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
validateUnitScaling(newValue) {
|
|
530
|
-
const errId = "ERR_unitScaling";
|
|
531
|
-
if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
532
|
-
this.errors.addOrReplace({
|
|
533
|
-
id: errId,
|
|
534
|
-
type: "warning",
|
|
535
|
-
message: "unitScaling: invalid value '" + newValue + "' is not supported.",
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
else {
|
|
539
|
-
this.errors.remove(errId);
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
validatePercentageScaling(newValue) {
|
|
543
|
-
const errId = "ERR_percentageScaling";
|
|
544
|
-
if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
545
|
-
this.errors.addOrReplace({
|
|
546
|
-
id: errId,
|
|
547
|
-
type: "warning",
|
|
548
|
-
message: "percentageScaling: invalid value '" + newValue + "' is not supported.",
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
else {
|
|
552
|
-
this.errors.remove(errId);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
validateDataFormat(newValue) {
|
|
556
|
-
const errId = "ERR_dataFormat";
|
|
557
|
-
if (!isValidDataFormat(newValue)) {
|
|
558
|
-
this.errors.addOrReplace({
|
|
559
|
-
id: errId,
|
|
560
|
-
type: "warning",
|
|
561
|
-
message: "dataFormat: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
else {
|
|
565
|
-
this.errors.remove(errId);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
validateGrouped(newValue) {
|
|
569
|
-
const errId = "ERR_grouped";
|
|
570
|
-
if (!isValidBoolean(newValue)) {
|
|
571
|
-
this.errors.addOrReplace({
|
|
572
|
-
id: errId,
|
|
573
|
-
type: "warning",
|
|
574
|
-
message: "grouped: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
else {
|
|
578
|
-
this.errors.remove(errId);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
validateShowMeasureScale(newValue) {
|
|
582
|
-
const errId = "ERR_grouped";
|
|
583
|
-
if (!isValidBoolean(newValue)) {
|
|
584
|
-
this.errors.addOrReplace({
|
|
585
|
-
id: errId,
|
|
586
|
-
type: "warning",
|
|
587
|
-
message: "showMeasureScale: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
588
|
-
});
|
|
589
|
-
}
|
|
590
|
-
else {
|
|
591
|
-
this.errors.remove(errId);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
validateShowGroupTitle(newValue) {
|
|
595
|
-
const errId = "ERR_showGroupTitle";
|
|
596
|
-
if (!isValidBoolean(newValue)) {
|
|
597
|
-
this.errors.addOrReplace({
|
|
598
|
-
id: errId,
|
|
599
|
-
type: "warning",
|
|
600
|
-
message: "showGroupTitle: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
601
|
-
});
|
|
602
|
-
}
|
|
603
|
-
else {
|
|
604
|
-
this.errors.remove(errId);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
validateType(newValue) {
|
|
608
|
-
const errId = "ERR_type";
|
|
609
|
-
if (!isValidTableType(newValue)) {
|
|
610
|
-
this.errors.addOrReplace({
|
|
611
|
-
id: errId,
|
|
612
|
-
type: "warning",
|
|
613
|
-
message: "type: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
else {
|
|
617
|
-
this.errors.remove(errId);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
validateLimit(newValue) {
|
|
621
|
-
const errId = "ERR_limit";
|
|
622
|
-
if (!isValidInteger(newValue)) {
|
|
623
|
-
this.errors.addOrReplace({
|
|
624
|
-
id: errId,
|
|
625
|
-
type: "warning",
|
|
626
|
-
message: "order: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
else {
|
|
630
|
-
this.errors.remove(errId);
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
validateThereOf(newValue) {
|
|
634
|
-
const errId = "ERR_thereof";
|
|
635
|
-
const invalidElements = validateThereOfJsonStr(newValue);
|
|
636
|
-
if (invalidElements.length > 0) {
|
|
637
|
-
this.errors.addOrReplace({
|
|
638
|
-
id: errId,
|
|
639
|
-
type: "warning",
|
|
640
|
-
message: "ThereOf: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
else {
|
|
644
|
-
this.errors.remove(errId);
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
validatePartOf(newValue) {
|
|
648
|
-
const errId = "ERR_partof";
|
|
649
|
-
const invalidElements = validatePartOfJsonStr(newValue);
|
|
650
|
-
if (invalidElements.length > 0) {
|
|
651
|
-
this.errors.addOrReplace({
|
|
652
|
-
id: errId,
|
|
653
|
-
type: "warning",
|
|
654
|
-
message: "partof: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
else {
|
|
658
|
-
this.errors.remove(errId);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
validateOrderList(newValue) {
|
|
662
|
-
const errId = "ERR_order";
|
|
663
|
-
const invalidElements = validateOrderList(newValue);
|
|
664
|
-
if (invalidElements.length > 0) {
|
|
665
|
-
this.errors.addOrReplace({
|
|
666
|
-
id: errId,
|
|
667
|
-
type: "warning",
|
|
668
|
-
message: "order: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
else {
|
|
672
|
-
this.errors.remove(errId);
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
validateOrderDirection(newValue) {
|
|
676
|
-
const errId = "ERR_orderDirection";
|
|
677
|
-
if (!isValidDirection(newValue)) {
|
|
678
|
-
this.errors.addOrReplace({
|
|
679
|
-
id: errId,
|
|
680
|
-
type: "warning",
|
|
681
|
-
message: "orderDirection: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
else {
|
|
685
|
-
this.errors.remove(errId);
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
validateMeasureType(newValue) {
|
|
689
|
-
const errId = "ERR_measureType";
|
|
690
|
-
if (!isValidMeasureType(newValue)) {
|
|
691
|
-
this.errors.addOrReplace({
|
|
692
|
-
id: errId,
|
|
693
|
-
type: "warning",
|
|
694
|
-
message: "measureType: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
else {
|
|
698
|
-
this.errors.remove(errId);
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
validateMeasureScale(newValue) {
|
|
702
|
-
const errId = "ERR_measureScale";
|
|
703
|
-
if (!isValidMeasureScale(newValue)) {
|
|
704
|
-
this.errors.addOrReplace({
|
|
705
|
-
id: errId,
|
|
706
|
-
type: "warning",
|
|
707
|
-
message: "measureScale: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
708
|
-
});
|
|
709
|
-
}
|
|
710
|
-
else {
|
|
711
|
-
this.errors.remove(errId);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
validateDataFormatDigitsDecimal(newValue) {
|
|
715
|
-
const errId = "ERR_dataFormatDigitsDecimal";
|
|
716
|
-
if (!isValidInteger(newValue)) {
|
|
717
|
-
this.errors.addOrReplace({
|
|
718
|
-
id: errId,
|
|
719
|
-
type: "warning",
|
|
720
|
-
message: "dataFormatDigitsDecimal: invalid value(s) '" + newValue + "' are not supported.",
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
else {
|
|
724
|
-
this.errors.remove(errId);
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
validateDateFormatDigitsPercent(newValue) {
|
|
728
|
-
const errId = "ERR_dataFormatDigitsPercent";
|
|
729
|
-
if (!isValidInteger(newValue)) {
|
|
730
|
-
this.errors.addOrReplace({
|
|
731
|
-
id: errId,
|
|
732
|
-
type: "warning",
|
|
733
|
-
message: "dataFormatDigitsPercent: invalid value(s) '" + newValue + "' are not supported.",
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
else {
|
|
737
|
-
this.errors.remove(errId);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
validateCategoryWidth(newValue) {
|
|
741
|
-
const errId = "ERR_categoryWidth";
|
|
742
|
-
if (!isTableCategoryWidth(newValue)) {
|
|
743
|
-
this.errors.addOrReplace({
|
|
744
|
-
id: errId,
|
|
745
|
-
type: "warning",
|
|
746
|
-
message: "categoryWidth: invalid value(s) '" + newValue + "' are not supported.",
|
|
747
|
-
});
|
|
748
|
-
}
|
|
749
|
-
else {
|
|
750
|
-
this.errors.remove(errId);
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
validateColumnThereOf(newValue) {
|
|
754
|
-
const invalidElements = validateColumnThereOfJsonStr(newValue);
|
|
755
|
-
const errId = "ERR_categorythereof";
|
|
756
|
-
if (invalidElements.length > 0) {
|
|
757
|
-
this.errors.addOrReplace({
|
|
758
|
-
id: errId,
|
|
759
|
-
type: "warning",
|
|
760
|
-
message: "columnthereof: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
else {
|
|
764
|
-
this.errors.remove(errId);
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
componentWillLoad() {
|
|
768
|
-
//this.datasouce = get("test");
|
|
769
|
-
// this.unsubscribe = onChange("test", (value) => this.datasouce = value);
|
|
770
|
-
this.validateScenario(this.scenarios);
|
|
771
|
-
this.validateVariances(this.variances);
|
|
772
|
-
this.validateDataFormat(this.dataFormat);
|
|
773
|
-
this.validateGrouped(this.grouped);
|
|
774
|
-
this.validateShowGroupTitle(this.showGroupTitle);
|
|
775
|
-
this.validateType(this.type);
|
|
776
|
-
this.validateLimit(this.limit);
|
|
777
|
-
this.validateThereOf(this.thereof);
|
|
778
|
-
this.validatePartOf(this.partof);
|
|
779
|
-
this.validateOrderDirection(this.orderDirection);
|
|
780
|
-
this.validateOrderList(this.order);
|
|
781
|
-
this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal);
|
|
782
|
-
this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent);
|
|
783
|
-
this.validateCategoryWidth(this.categoryWidth);
|
|
784
|
-
this.validateMeasureType(this.measureType);
|
|
785
|
-
this.validateMeasureScale(this.measureScale);
|
|
786
|
-
this.validateColumnThereOf(this.columnthereof);
|
|
787
|
-
this.validateShowMeasureScale(this.showMeasureScale);
|
|
788
|
-
this.validateBarColumns(this.barColumns);
|
|
789
|
-
this.validateUnitScaling(this.unitScaling);
|
|
790
|
-
this.validatePercentageScaling(this.percentageScaling);
|
|
791
|
-
this.validateScaling(this.scale);
|
|
792
|
-
}
|
|
793
|
-
disconnectedCallback() {
|
|
794
|
-
this.unsubscribe();
|
|
795
|
-
}
|
|
796
|
-
componentDidRender() {
|
|
797
|
-
var _a, _b;
|
|
798
|
-
const { mode } = parseScaling(this.scale);
|
|
799
|
-
// Only auto-scale for 'auto' and 'empty' (blank) modes
|
|
800
|
-
if (mode !== "auto" && mode !== "empty") {
|
|
801
|
-
this._autoScaleGuard = false;
|
|
802
|
-
return;
|
|
803
|
-
}
|
|
804
|
-
// Skip re-measurement after the state-triggered re-render
|
|
805
|
-
if (this._autoScaleGuard) {
|
|
806
|
-
this._autoScaleGuard = false;
|
|
807
|
-
return;
|
|
808
|
-
}
|
|
809
|
-
const host = this.element;
|
|
810
|
-
const { width: parentWidth } = getParentDimensions(host);
|
|
811
|
-
if (parentWidth <= 0)
|
|
812
|
-
return;
|
|
813
|
-
// Measure at base (unscaled) font size to get true content width.
|
|
814
|
-
// This avoids the oscillation where scaled-down content fits → reset
|
|
815
|
-
// to 1 → overflows → scale down → fits → …
|
|
816
|
-
const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
817
|
-
host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
|
|
818
|
-
// Reading scrollWidth forces a synchronous reflow at base size
|
|
819
|
-
const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("div");
|
|
820
|
-
const unscaledWidth = (_b = div === null || div === void 0 ? void 0 : div.scrollWidth) !== null && _b !== void 0 ? _b : host.scrollWidth;
|
|
821
|
-
if (unscaledWidth <= parentWidth + 1) {
|
|
822
|
-
// Content fits at base size — no scaling needed
|
|
823
|
-
this.errors.remove("AUTO_scale");
|
|
824
|
-
if (this.appliedScaleFactor !== 1) {
|
|
825
|
-
this._autoScaleGuard = true;
|
|
826
|
-
this.appliedScaleFactor = 1;
|
|
827
|
-
}
|
|
828
|
-
return;
|
|
829
|
-
}
|
|
830
|
-
// Subtract 1px to account for sub-pixel rounding after scaling,
|
|
831
|
-
// preventing the right edge from being clipped by overflow:hidden.
|
|
832
|
-
const computedFactor = (parentWidth - 1) / unscaledWidth;
|
|
833
|
-
// Apply immediately via CSS var for smooth visual (before state re-render)
|
|
834
|
-
host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
|
|
835
|
-
if (mode === "empty") {
|
|
836
|
-
this.errors.addOrReplace({
|
|
837
|
-
id: "AUTO_scale",
|
|
838
|
-
type: "warning",
|
|
839
|
-
message: `Auto-scaled table by factor ${computedFactor.toFixed(3)}`,
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
|
-
else {
|
|
843
|
-
this.errors.remove("AUTO_scale");
|
|
844
|
-
}
|
|
845
|
-
// Update state so bar charts re-render at the new scale
|
|
846
|
-
if (Math.abs(computedFactor - this.appliedScaleFactor) > 0.001) {
|
|
847
|
-
this._autoScaleGuard = true;
|
|
848
|
-
this.appliedScaleFactor = computedFactor;
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
prepareDataFormat() {
|
|
852
|
-
var _a;
|
|
853
|
-
return DataFormat[(_a = this.dataFormat) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
854
|
-
}
|
|
855
|
-
prepareGrouped() {
|
|
856
|
-
return this.grouped === "true";
|
|
857
|
-
}
|
|
858
|
-
prepareShowGroupTitle() {
|
|
859
|
-
return this.showGroupTitle === "true";
|
|
860
|
-
}
|
|
861
|
-
prepareTableType() {
|
|
862
|
-
var _a;
|
|
863
|
-
return TableType[(_a = this.type) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
864
|
-
}
|
|
865
|
-
prepareLimit() {
|
|
866
|
-
return Math.floor(Number(this.limit) || 0);
|
|
867
|
-
}
|
|
868
|
-
prepareThereOf() {
|
|
869
|
-
if (this.thereof == null || this.thereof.trim() === "") {
|
|
870
|
-
return [];
|
|
871
|
-
}
|
|
872
|
-
return JSON.parse(this.thereof);
|
|
873
|
-
}
|
|
874
|
-
preparePartOf() {
|
|
875
|
-
if (this.partof == null || this.partof.trim() === "") {
|
|
876
|
-
return [];
|
|
877
|
-
}
|
|
878
|
-
return JSON.parse(this.partof);
|
|
879
|
-
}
|
|
880
|
-
prepareOrder() {
|
|
881
|
-
var _a, _b, _c;
|
|
882
|
-
const isAuto = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
883
|
-
let orderStr = this.order;
|
|
884
|
-
if (isAuto && ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedOrder)) {
|
|
885
|
-
orderStr = this.datasetMeta.suggestedOrder;
|
|
886
|
-
}
|
|
887
|
-
const tableOrder = {
|
|
888
|
-
hierarchy: orderStr.split(",").map((entry) => OrderColumn[entry === null || entry === void 0 ? void 0 : entry.toUpperCase()]),
|
|
889
|
-
direction: OrderDirection$1[(_c = this.orderDirection) === null || _c === void 0 ? void 0 : _c.toUpperCase()],
|
|
890
|
-
};
|
|
891
|
-
return tableOrder;
|
|
892
|
-
}
|
|
893
|
-
prepareI18nMode() {
|
|
894
|
-
return I18nMode.META;
|
|
895
|
-
}
|
|
896
|
-
prepareI18n() {
|
|
897
|
-
const i18nMetaLabelsLocal = ["in", "category", "operation", "there_of", "part_of", "SUM_TOTAL"];
|
|
898
|
-
const i18nMetaLabelsGlobal = globalLabelKeys;
|
|
899
|
-
// system
|
|
900
|
-
const i18nMapLocal = new Map(i18nMetaLabelsLocal.map((key) => [key, this.t(".".concat(key))]));
|
|
901
|
-
const i18nMapGlobal = new Map(i18nMetaLabelsGlobal.map((key) => [key, this.t("global.".concat(key))]));
|
|
902
|
-
return new Map([...i18nMapGlobal.entries(), ...i18nMapLocal.entries()]);
|
|
903
|
-
}
|
|
904
|
-
prepareDataFormatDigits() {
|
|
905
|
-
const formatDigits = {
|
|
906
|
-
percent: this.dataFormatDigitsPercent,
|
|
907
|
-
decimal: this.dataFormatDigitsDecimal,
|
|
908
|
-
};
|
|
909
|
-
return formatDigits;
|
|
910
|
-
}
|
|
911
|
-
prepareScenarios() {
|
|
912
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
913
|
-
const isAuto = ((_a = this.scenarios) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
914
|
-
if ((isBlankInput(this.scenarios) || isAuto) && isBlankInput(this.variances)) {
|
|
915
|
-
if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
916
|
-
if (!isAuto) {
|
|
917
|
-
this.errors.addOrReplace({
|
|
918
|
-
id: "AUTO_scenarios",
|
|
919
|
-
type: "warning",
|
|
920
|
-
message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
|
|
921
|
-
});
|
|
922
|
-
}
|
|
923
|
-
else {
|
|
924
|
-
this.errors.remove("AUTO_scenarios");
|
|
925
|
-
}
|
|
926
|
-
return this.datasetMeta.availableScenarios;
|
|
927
|
-
}
|
|
928
|
-
return [];
|
|
929
|
-
}
|
|
930
|
-
let scenarios = [];
|
|
931
|
-
if (isAuto || isBlankInput(this.scenarios)) {
|
|
932
|
-
if (((_e = (_d = this.datasetMeta) === null || _d === void 0 ? void 0 : _d.availableScenarios) === null || _e === void 0 ? void 0 : _e.length) > 0) {
|
|
933
|
-
if (!isAuto) {
|
|
934
|
-
this.errors.addOrReplace({
|
|
935
|
-
id: "AUTO_scenarios",
|
|
936
|
-
type: "warning",
|
|
937
|
-
message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
|
|
938
|
-
});
|
|
939
|
-
}
|
|
940
|
-
else {
|
|
941
|
-
this.errors.remove("AUTO_scenarios");
|
|
942
|
-
}
|
|
943
|
-
scenarios = scenarios.concat(this.datasetMeta.availableScenarios);
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
else {
|
|
947
|
-
this.errors.remove("AUTO_scenarios");
|
|
948
|
-
scenarios = scenarios.concat((_f = this.scenarios) === null || _f === void 0 ? void 0 : _f.split(","));
|
|
949
|
-
}
|
|
950
|
-
if (((_g = this.variances) === null || _g === void 0 ? void 0 : _g.trim().length) > 0) {
|
|
951
|
-
scenarios = scenarios.concat((_h = this.variances) === null || _h === void 0 ? void 0 : _h.split(","));
|
|
952
|
-
}
|
|
953
|
-
return scenarios.map((entry) => entry.trim());
|
|
954
|
-
}
|
|
955
|
-
prepareCategoryWidth() {
|
|
956
|
-
var _a;
|
|
957
|
-
if (isBlankInput(this.categoryWidth)) {
|
|
958
|
-
return TableCategoryWidth.INF;
|
|
959
|
-
}
|
|
960
|
-
return TableCategoryWidth[(_a = this.categoryWidth) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
961
|
-
}
|
|
962
|
-
prepareMeasureScale() {
|
|
963
|
-
if (isBlankInput(this.measureScale)) {
|
|
964
|
-
return "GREATEST";
|
|
965
|
-
}
|
|
966
|
-
if (["_", "k", "M", "G", "T", "P", "E", "Z", "Y", "m", "μ", "n", "p", "P", "f", "a", "z", "y"].includes(this.measureScale.trim())) {
|
|
967
|
-
return this.measureScale.trim();
|
|
968
|
-
}
|
|
969
|
-
if (this.measureScale.trim().toUpperCase() === "LEAST") {
|
|
970
|
-
return this.measureScale.trim();
|
|
971
|
-
}
|
|
972
|
-
return "GREATEST";
|
|
973
|
-
}
|
|
974
|
-
prepareMeasureType() {
|
|
975
|
-
var _a;
|
|
976
|
-
if (isBlankInput(this.measureType)) {
|
|
977
|
-
return MeasureType.VOLUME;
|
|
978
|
-
}
|
|
979
|
-
return MeasureType[(_a = this.measureType) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
980
|
-
}
|
|
981
|
-
prepareColumnThereOf() {
|
|
982
|
-
if (this.columnthereof == null || this.columnthereof.trim() === "") {
|
|
983
|
-
return new Map();
|
|
984
|
-
}
|
|
985
|
-
const parsedString = JSON.parse(this.columnthereof);
|
|
986
|
-
const map = new Map();
|
|
987
|
-
for (const [_key, value] of Object.entries(parsedString)) {
|
|
988
|
-
if (map.has(value["scenario"]) === false) {
|
|
989
|
-
map.set(value["scenario"], []);
|
|
990
|
-
}
|
|
991
|
-
map.get(value["scenario"]).push(value);
|
|
992
|
-
}
|
|
993
|
-
return map;
|
|
994
|
-
}
|
|
995
|
-
prepareTableTitle() {
|
|
996
|
-
if (this.tableTitle === "" || this.tableTitle == null) {
|
|
997
|
-
return "SUM_TOTAL";
|
|
998
|
-
}
|
|
999
|
-
return this.tableTitle;
|
|
1000
|
-
}
|
|
1001
|
-
prepareShowMeasureScale() {
|
|
1002
|
-
return this.showMeasureScale === "true";
|
|
1003
|
-
}
|
|
1004
|
-
prepareMeasureUnit() {
|
|
1005
|
-
if (this.measureUnit === "" || this.measureUnit == null) {
|
|
1006
|
-
return "";
|
|
1007
|
-
}
|
|
1008
|
-
return this.measureUnit;
|
|
1009
|
-
}
|
|
1010
|
-
prepareFilter() {
|
|
1011
|
-
if (this.filter.length === 0) {
|
|
1012
|
-
return "";
|
|
1013
|
-
}
|
|
1014
|
-
return this.filter;
|
|
1015
|
-
}
|
|
1016
|
-
prepareBarColumns() {
|
|
1017
|
-
if (isBlankInput(this.barColumns)) {
|
|
1018
|
-
return [];
|
|
1019
|
-
}
|
|
1020
|
-
return this.barColumns.split(",").map((col) => col.trim());
|
|
1021
|
-
}
|
|
1022
|
-
prepareUnitScaling() {
|
|
1023
|
-
if (this.pixelPerUnitGroupMap.has(this.unitScaling)) {
|
|
1024
|
-
return this.pixelPerUnitGroupMap.get(this.unitScaling);
|
|
1025
|
-
}
|
|
1026
|
-
return Number(this.unitScaling);
|
|
1027
|
-
}
|
|
1028
|
-
preparePercentageScaling() {
|
|
1029
|
-
if (this.pixelPerUnitGroupMap.has(this.percentageScaling)) {
|
|
1030
|
-
return this.pixelPerUnitGroupMap.get(this.percentageScaling);
|
|
1031
|
-
}
|
|
1032
|
-
return Number(this.percentageScaling);
|
|
1033
|
-
}
|
|
1034
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1035
|
-
getDataStructure() {
|
|
1036
|
-
const dataSetStructure = {
|
|
1037
|
-
ITableDataRow: {
|
|
1038
|
-
setName: { type: "string", isOptional: false, description: "" },
|
|
1039
|
-
date: { type: "string", isOptional: false, description: "" },
|
|
1040
|
-
operation: { type: "string", isOptional: false, description: "" },
|
|
1041
|
-
rowGroup: { type: "string", isOptional: false, description: "" },
|
|
1042
|
-
rowGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
1043
|
-
category: { type: "string", isOptional: false, description: "" },
|
|
1044
|
-
categoryIndex: { type: "number", isOptional: false, description: "" },
|
|
1045
|
-
subCategory: { type: "string", isOptional: false, description: "" },
|
|
1046
|
-
subCategoryIndex: { type: "number", isOptional: false, description: "" },
|
|
1047
|
-
columnGroup: { type: "string", isOptional: false, description: "" },
|
|
1048
|
-
columnGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
1049
|
-
columnSubGroup: { type: "string", isOptional: false, description: "" },
|
|
1050
|
-
columnSubGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
1051
|
-
ac1: { type: "number", isOptional: false, description: "" },
|
|
1052
|
-
ac2: { type: "number", isOptional: false, description: "" },
|
|
1053
|
-
ac3: { type: "number", isOptional: false, description: "" },
|
|
1054
|
-
ac4: { type: "number", isOptional: false, description: "" },
|
|
1055
|
-
pp1: { type: "number", isOptional: false, description: "" },
|
|
1056
|
-
pp2: { type: "number", isOptional: false, description: "" },
|
|
1057
|
-
pp3: { type: "number", isOptional: false, description: "" },
|
|
1058
|
-
pp4: { type: "number", isOptional: false, description: "" },
|
|
1059
|
-
fc1: { type: "number", isOptional: false, description: "" },
|
|
1060
|
-
fc2: { type: "number", isOptional: false, description: "" },
|
|
1061
|
-
fc3: { type: "number", isOptional: false, description: "" },
|
|
1062
|
-
fc4: { type: "number", isOptional: false, description: "" },
|
|
1063
|
-
pl1: { type: "number", isOptional: false, description: "" },
|
|
1064
|
-
pl2: { type: "number", isOptional: false, description: "" },
|
|
1065
|
-
pl3: { type: "number", isOptional: false, description: "" },
|
|
1066
|
-
pl4: { type: "number", isOptional: false, description: "" },
|
|
1067
|
-
},
|
|
1068
|
-
};
|
|
1069
|
-
return dataSetStructure;
|
|
1070
|
-
}
|
|
1071
|
-
getEffectiveScaleFactor() {
|
|
1072
|
-
const { mode, factor } = parseScaling(this.scale);
|
|
1073
|
-
if (mode === "factor")
|
|
1074
|
-
return factor;
|
|
1075
|
-
if (mode === "auto" || mode === "empty")
|
|
1076
|
-
return this.appliedScaleFactor;
|
|
1077
|
-
return 1;
|
|
1078
|
-
}
|
|
1079
|
-
getFontStyles() {
|
|
1080
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
1081
|
-
return this.componentStyle(($) => {
|
|
1082
|
-
var _a, _b, _c, _d;
|
|
1083
|
-
const baseFontSize = ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333;
|
|
1084
|
-
return {
|
|
1085
|
-
"--bn-font-family": ((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
1086
|
-
"--bn-font-size": `${baseFontSize * effectiveFactor}px`,
|
|
1087
|
-
"--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
|
|
1088
|
-
"--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
|
|
1089
|
-
};
|
|
1090
|
-
});
|
|
1091
|
-
}
|
|
1092
|
-
render() {
|
|
1093
|
-
const fontStyles = this.getFontStyles();
|
|
1094
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
1095
|
-
return (h(Host, { key: '5434656c0626dc8aceea109e4f6ab795443a7c7b', style: fontStyles }, h("div", { key: 'a3d90ae3bce33b025bac95cc486aba1778907762' }, h("ibcs-table", { key: 'fbff577c7d0bf23f63f6d06edafd75e32a183b49', 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(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), scaleFactor: effectiveFactor }))));
|
|
1096
|
-
}
|
|
1097
|
-
get element() { return getElement(this); }
|
|
1098
|
-
static get watchers() { return {
|
|
1099
|
-
"scale": [{
|
|
1100
|
-
"validateScaling": 0
|
|
1101
|
-
}],
|
|
1102
|
-
"scenarios": [{
|
|
1103
|
-
"validateScenario": 0
|
|
1104
|
-
}],
|
|
1105
|
-
"variances": [{
|
|
1106
|
-
"validateVariances": 0
|
|
1107
|
-
}],
|
|
1108
|
-
"barColumns": [{
|
|
1109
|
-
"validateBarColumns": 0
|
|
1110
|
-
}],
|
|
1111
|
-
"unitScaling": [{
|
|
1112
|
-
"validateUnitScaling": 0
|
|
1113
|
-
}],
|
|
1114
|
-
"percentageScaling": [{
|
|
1115
|
-
"validatePercentageScaling": 0
|
|
1116
|
-
}],
|
|
1117
|
-
"dataFormat": [{
|
|
1118
|
-
"validateDataFormat": 0
|
|
1119
|
-
}],
|
|
1120
|
-
"grouped": [{
|
|
1121
|
-
"validateGrouped": 0
|
|
1122
|
-
}],
|
|
1123
|
-
"showMeasureScale": [{
|
|
1124
|
-
"validateShowMeasureScale": 0
|
|
1125
|
-
}],
|
|
1126
|
-
"showGroupTitle": [{
|
|
1127
|
-
"validateShowGroupTitle": 0
|
|
1128
|
-
}],
|
|
1129
|
-
"type": [{
|
|
1130
|
-
"validateType": 0
|
|
1131
|
-
}],
|
|
1132
|
-
"limit": [{
|
|
1133
|
-
"validateLimit": 0
|
|
1134
|
-
}],
|
|
1135
|
-
"thereof": [{
|
|
1136
|
-
"validateThereOf": 0
|
|
1137
|
-
}],
|
|
1138
|
-
"partof": [{
|
|
1139
|
-
"validatePartOf": 0
|
|
1140
|
-
}],
|
|
1141
|
-
"order": [{
|
|
1142
|
-
"validateOrderList": 0
|
|
1143
|
-
}],
|
|
1144
|
-
"orderDirection": [{
|
|
1145
|
-
"validateOrderDirection": 0
|
|
1146
|
-
}],
|
|
1147
|
-
"measureType": [{
|
|
1148
|
-
"validateMeasureType": 0
|
|
1149
|
-
}],
|
|
1150
|
-
"measureScale": [{
|
|
1151
|
-
"validateMeasureScale": 0
|
|
1152
|
-
}],
|
|
1153
|
-
"dataFormatDigitsDecimal": [{
|
|
1154
|
-
"validateDataFormatDigitsDecimal": 0
|
|
1155
|
-
}],
|
|
1156
|
-
"dataFormatDigitsPercent": [{
|
|
1157
|
-
"validateDateFormatDigitsPercent": 0
|
|
1158
|
-
}],
|
|
1159
|
-
"categoryWidth": [{
|
|
1160
|
-
"validateCategoryWidth": 0
|
|
1161
|
-
}],
|
|
1162
|
-
"columnthereof": [{
|
|
1163
|
-
"validateColumnThereOf": 0
|
|
1164
|
-
}]
|
|
1165
|
-
}; }
|
|
1166
|
-
};
|
|
1167
|
-
Table$1.style = bnTableCss();
|
|
10
|
+
import './context-protocol-BHnQsVsr.js';
|
|
11
|
+
import './utils-DvvwfRQG.js';
|
|
1168
12
|
|
|
1169
13
|
// import {Formatter} from "../../../../utils/formatter";
|
|
1170
14
|
// import {DataFormatDigits} from "../../../../utils/model/DataFormatDigits";
|
|
@@ -1311,7 +155,9 @@ class TableRow {
|
|
|
1311
155
|
if (isSecondaryElement) {
|
|
1312
156
|
prefixStyle = "prefix-second";
|
|
1313
157
|
}
|
|
1314
|
-
|
|
158
|
+
if (columnType) {
|
|
159
|
+
cssStyle = `${cssStyle} ${columnType}`;
|
|
160
|
+
}
|
|
1315
161
|
const cell = new Cell(scenario, this.elements.length, value, cssStyle, cellType, prefix, prefixStyle, 1, measureScale);
|
|
1316
162
|
cell.isBarChart = isBarChart;
|
|
1317
163
|
cell.columnStats = columnStats;
|
|
@@ -1470,34 +316,74 @@ function getBarStroke(varianceStyle) {
|
|
|
1470
316
|
// Solid and hatched bars don't need visible stroke
|
|
1471
317
|
return { stroke: "none", strokeWidth: 0 };
|
|
1472
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* Renders a zigzag break indicator at a given x position, matching the structure chart style.
|
|
321
|
+
* Two mirrored zigzag lines with a white background covering the break gap.
|
|
322
|
+
*/
|
|
323
|
+
function renderZigzagBreak(breakX, breakGap, yTop, barHeight, s) {
|
|
324
|
+
const midX = breakX + breakGap / 2;
|
|
325
|
+
const halfGap = breakGap * 0.35;
|
|
326
|
+
const zigCount = 3;
|
|
327
|
+
const segHeight = barHeight / zigCount;
|
|
328
|
+
const amplitude = breakGap * 0.3;
|
|
329
|
+
let leftPath = `M ${midX - halfGap} ${yTop}`;
|
|
330
|
+
for (let i = 0; i < zigCount; i++) {
|
|
331
|
+
const y1 = yTop + segHeight * (i + 0.5);
|
|
332
|
+
const y2 = yTop + segHeight * (i + 1);
|
|
333
|
+
leftPath += ` L ${midX - halfGap - amplitude} ${y1} L ${midX - halfGap} ${y2}`;
|
|
334
|
+
}
|
|
335
|
+
let rightPath = `M ${midX + halfGap} ${yTop}`;
|
|
336
|
+
for (let i = 0; i < zigCount; i++) {
|
|
337
|
+
const y1 = yTop + segHeight * (i + 0.5);
|
|
338
|
+
const y2 = yTop + segHeight * (i + 1);
|
|
339
|
+
rightPath += ` L ${midX + halfGap + amplitude} ${y1} L ${midX + halfGap} ${y2}`;
|
|
340
|
+
}
|
|
341
|
+
return [
|
|
342
|
+
h("rect", { x: breakX, y: yTop - 1, width: breakGap, height: barHeight + 2, fill: "#ffffff" }),
|
|
343
|
+
h("path", { d: leftPath, fill: "none", stroke: "#000000", "stroke-width": 1 * s }),
|
|
344
|
+
h("path", { d: rightPath, fill: "none", stroke: "#000000", "stroke-width": 1 * s }),
|
|
345
|
+
];
|
|
346
|
+
}
|
|
1473
347
|
/**
|
|
1474
348
|
* Renders an absolute variance bar chart (d_ prefix).
|
|
1475
349
|
* Horizontal bar with centered axis, green for positive, red for negative.
|
|
1476
|
-
*
|
|
350
|
+
* When a bar exceeds maxBarWidth it is drawn as an overdrive bar:
|
|
351
|
+
* base segment + zigzag break + proportional overdrive stub (like structure chart).
|
|
1477
352
|
*
|
|
1478
353
|
* Layout: [left label area][bar area with axis][right label area]
|
|
1479
|
-
* Uses unitScaling to determine bar width (pixels per unit of measure).
|
|
1480
354
|
*/
|
|
1481
355
|
const AbsoluteVarianceBar = (props) => {
|
|
1482
|
-
const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
|
|
356
|
+
const { value, scenario, columnStats, height, isPositiveGood, formattedValue, measureScale, maxBarWidth: maxBarWidthEm = 10, styles = DEFAULT_STYLES, } = props;
|
|
1483
357
|
const s = styles.scaleFactor;
|
|
1484
|
-
const
|
|
1485
|
-
const
|
|
1486
|
-
const
|
|
1487
|
-
|
|
358
|
+
const fs = styles.fontSize;
|
|
359
|
+
const labelAreaWidth = 38 * s;
|
|
360
|
+
const maxBarWidth = maxBarWidthEm * fs;
|
|
361
|
+
// Overdrive layout constants
|
|
362
|
+
const breakGap = 4 * s;
|
|
363
|
+
const overdriveZoneWidth = maxBarWidth * 0.15;
|
|
364
|
+
const cutWidth = maxBarWidth - breakGap - overdriveZoneWidth;
|
|
365
|
+
// Direct unit scaling via fontSize
|
|
366
|
+
const scaledWidth = Math.abs(value) * styles.unitScaling * fs;
|
|
367
|
+
const isExtreme = scaledWidth > cutWidth;
|
|
368
|
+
// Compute proportional overdrive width across the column
|
|
369
|
+
const maxScaledWidth = columnStats.absMax * styles.unitScaling * fs;
|
|
370
|
+
const maxOverflow = Math.max(0, maxScaledWidth - cutWidth);
|
|
371
|
+
const overflowAmount = Math.max(0, scaledWidth - cutWidth);
|
|
372
|
+
const overdriveWidth = maxOverflow > 0 ? (overflowAmount / maxOverflow) * overdriveZoneWidth : 0;
|
|
373
|
+
// Adaptive axis placement based on data range
|
|
374
|
+
const hasNeg = columnStats.min < 0;
|
|
375
|
+
const hasPos = columnStats.max > 0;
|
|
376
|
+
const negBarWidth = hasNeg ? maxBarWidth : 0;
|
|
377
|
+
const posBarWidth = hasPos ? maxBarWidth : 0;
|
|
378
|
+
const barAreaWidth = negBarWidth + posBarWidth;
|
|
379
|
+
const totalWidth = (hasNeg ? labelAreaWidth : 0) + barAreaWidth + (hasPos ? labelAreaWidth : 0);
|
|
1488
380
|
const padding = 2 * s;
|
|
1489
381
|
const barHeight = height - padding * 2;
|
|
1490
|
-
const axisX =
|
|
1491
|
-
// Calculate bar width using unitScaling (pixels per unit)
|
|
1492
|
-
// Clamp to maxBarWidth to prevent overflow
|
|
1493
|
-
const scaledWidth = Math.abs(value) * styles.unitScaling * s;
|
|
1494
|
-
const barWidth = Math.min(scaledWidth, maxBarWidth);
|
|
1495
|
-
const isPositive = value >= 0;
|
|
1496
|
-
const barX = isPositive ? axisX : axisX - barWidth;
|
|
382
|
+
const axisX = (hasNeg ? labelAreaWidth : 0) + negBarWidth;
|
|
1497
383
|
const barY = padding;
|
|
384
|
+
const isPositive = value >= 0;
|
|
1498
385
|
// Get style based on column type (scenario vs variance)
|
|
1499
386
|
const barStyle = getBarStyle(scenario, value, isPositiveGood, styles);
|
|
1500
|
-
// Pattern prefix for scenarios uses scenario type, for variances uses pos/neg
|
|
1501
387
|
const patternPrefix = isScenarioColumn(scenario)
|
|
1502
388
|
? getScenarioType(scenario)
|
|
1503
389
|
: isPositiveGood
|
|
@@ -1510,12 +396,14 @@ const AbsoluteVarianceBar = (props) => {
|
|
|
1510
396
|
const fillValue = getBarFill(barStyle, patternPrefix);
|
|
1511
397
|
const { stroke: barStroke, strokeWidth: barStrokeWidth } = getBarStroke(barStyle);
|
|
1512
398
|
const displayValue = formattedValue || formatValue(value, false, measureScale);
|
|
1513
|
-
//
|
|
1514
|
-
|
|
1515
|
-
//
|
|
1516
|
-
const
|
|
399
|
+
// Normal bar width (clamped to cutWidth when extreme)
|
|
400
|
+
const baseBarWidth = isExtreme ? cutWidth : scaledWidth;
|
|
401
|
+
// Label position accounts for overdrive
|
|
402
|
+
const totalVisualWidth = isExtreme ? cutWidth + breakGap + overdriveWidth : scaledWidth;
|
|
403
|
+
const labelX = isPositive ? axisX + totalVisualWidth + 4 * s : axisX - totalVisualWidth - 4 * s;
|
|
1517
404
|
const labelAnchor = isPositive ? "start" : "end";
|
|
1518
|
-
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart absolute-variance", style: { overflow: "visible" } }, h(PatternDefs, { styles: styles }), h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }),
|
|
405
|
+
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart absolute-variance", style: { overflow: "visible" } }, h(PatternDefs, { styles: styles }), h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), baseBarWidth > 0 && (h("rect", { x: isPositive ? axisX : axisX - baseBarWidth, y: barY, width: baseBarWidth, height: barHeight, fill: fillValue, stroke: barStroke, "stroke-width": barStrokeWidth * s })), isExtreme && overdriveWidth > 0 && (h("rect", { x: isPositive ? axisX + cutWidth + breakGap : axisX - cutWidth - breakGap - overdriveWidth, y: barY, width: overdriveWidth, height: barHeight, fill: fillValue, stroke: barStroke, "stroke-width": barStrokeWidth * s })), isExtreme &&
|
|
406
|
+
renderZigzagBreak(isPositive ? axisX + cutWidth : axisX - cutWidth - breakGap, breakGap, barY, barHeight, s), h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": labelAnchor, fill: styles.fontColor, "font-size": fs, "font-family": styles.fontFamily }, displayValue)));
|
|
1519
407
|
};
|
|
1520
408
|
/**
|
|
1521
409
|
* Renders a relative variance pin chart (dr_ prefix).
|
|
@@ -1525,30 +413,36 @@ const AbsoluteVarianceBar = (props) => {
|
|
|
1525
413
|
* Uses percentageScaling to determine pin length (pixels per percentage point).
|
|
1526
414
|
*/
|
|
1527
415
|
const RelativeVariancePin = (props) => {
|
|
1528
|
-
const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
|
|
416
|
+
const { value, scenario, columnStats, height, isPositiveGood, formattedValue, measureScale, maxBarWidth: maxBarWidthEm = 10, styles = DEFAULT_STYLES, } = props;
|
|
1529
417
|
const s = styles.scaleFactor;
|
|
1530
|
-
const
|
|
1531
|
-
|
|
1532
|
-
const
|
|
418
|
+
const fs = styles.fontSize;
|
|
419
|
+
// Pin length is ~2/3 of bar width for visual balance
|
|
420
|
+
const maxPinLength = Math.round(maxBarWidthEm * 0.67 * fs);
|
|
421
|
+
const pinPadding = 5 * s;
|
|
422
|
+
// Adaptive axis placement based on data range
|
|
423
|
+
const hasNeg = columnStats.min < 0;
|
|
424
|
+
const hasPos = columnStats.max > 0;
|
|
425
|
+
const negPinWidth = hasNeg ? maxPinLength + pinPadding : 0;
|
|
426
|
+
const posPinWidth = hasPos ? maxPinLength + pinPadding : 0;
|
|
427
|
+
const pinAreaWidth = negPinWidth + posPinWidth;
|
|
428
|
+
const labelAreaWidth = 45 * s;
|
|
1533
429
|
const totalWidth = pinAreaWidth + labelAreaWidth;
|
|
1534
|
-
const axisX =
|
|
430
|
+
const axisX = negPinWidth;
|
|
1535
431
|
const centerY = height / 2;
|
|
1536
|
-
//
|
|
1537
|
-
// Value is in decimal form (e.g., 0.5 = 50%), multiply by 100 to get percentage
|
|
432
|
+
// Direct unit scaling via fontSize
|
|
1538
433
|
const percentValue = Math.abs(value) * 100;
|
|
1539
|
-
const scaledLength = percentValue * styles.percentageScaling *
|
|
434
|
+
const scaledLength = percentValue * styles.percentageScaling * fs;
|
|
435
|
+
const isExtreme = scaledLength > maxPinLength;
|
|
1540
436
|
const pinLength = Math.min(scaledLength, maxPinLength);
|
|
1541
437
|
const isPositive = value >= 0;
|
|
1542
438
|
const pinEndX = isPositive ? axisX + pinLength : axisX - pinLength;
|
|
1543
439
|
// Get style based on column type (scenario vs variance)
|
|
1544
440
|
const barStyle = getBarStyle(scenario, value, isPositiveGood, styles);
|
|
1545
441
|
const dotRadius = 3 * s;
|
|
1546
|
-
// Show arrow for extreme values (when pin would exceed max length)
|
|
1547
|
-
const isExtreme = scaledLength > maxPinLength;
|
|
1548
442
|
const displayValue = formattedValue || formatValue(value, true, measureScale);
|
|
1549
443
|
// Label always on the right side after the pin area
|
|
1550
444
|
const labelX = pinAreaWidth + 4 * s;
|
|
1551
|
-
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart relative-variance", style: { overflow: "visible" } }, h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), !isExtreme && h("circle", { cx: pinEndX, cy: centerY, r: dotRadius, fill: styles.fontColor }), h("line", { x1: axisX, y1: centerY, x2: pinEndX, y2: centerY, stroke: barStyle.fill, "stroke-width": 2 * s }), isExtreme && isPositive && (h("polygon", { points: `${
|
|
445
|
+
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart relative-variance", style: { overflow: "visible" } }, h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), !isExtreme && h("circle", { cx: pinEndX, cy: centerY, r: dotRadius, fill: styles.fontColor }), h("line", { x1: axisX, y1: centerY, x2: pinEndX, y2: centerY, stroke: barStyle.fill, "stroke-width": 2 * s }), isExtreme && isPositive && (h("polygon", { points: `${axisX + maxPinLength},${centerY} ${axisX + maxPinLength - 6 * s},${centerY - 3 * s} ${axisX + maxPinLength - 6 * s},${centerY + 3 * s}`, fill: barStyle.fill })), isExtreme && !isPositive && (h("polygon", { points: `${axisX - maxPinLength},${centerY} ${axisX - maxPinLength + 6 * s},${centerY - 3 * s} ${axisX - maxPinLength + 6 * s},${centerY + 3 * s}`, fill: barStyle.fill })), h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": "start", fill: styles.fontColor, "font-size": fs, "font-style": "italic", "font-family": styles.fontFamily }, displayValue)));
|
|
1552
446
|
};
|
|
1553
447
|
/**
|
|
1554
448
|
* CellBarChart - Renders IBCS-compliant variance bar charts.
|
|
@@ -2462,9 +1356,11 @@ class TableDataSetFactory {
|
|
|
2462
1356
|
if (!barColumns || barColumns.length === 0) {
|
|
2463
1357
|
return statsMap;
|
|
2464
1358
|
}
|
|
2465
|
-
//
|
|
1359
|
+
// Collect all values per column for median calculation
|
|
1360
|
+
const valuesMap = new Map();
|
|
2466
1361
|
for (const column of barColumns) {
|
|
2467
|
-
statsMap.set(column, { min: Infinity, max: -Infinity, absMax: 0 });
|
|
1362
|
+
statsMap.set(column, { min: Infinity, max: -Infinity, absMax: 0, median: 0 });
|
|
1363
|
+
valuesMap.set(column, []);
|
|
2468
1364
|
}
|
|
2469
1365
|
// Iterate through all groups and rows
|
|
2470
1366
|
for (const groupData of queryData) {
|
|
@@ -2475,17 +1371,24 @@ class TableDataSetFactory {
|
|
|
2475
1371
|
const stats = statsMap.get(column);
|
|
2476
1372
|
stats.min = Math.min(stats.min, value);
|
|
2477
1373
|
stats.max = Math.max(stats.max, value);
|
|
1374
|
+
valuesMap.get(column).push(Math.abs(value));
|
|
2478
1375
|
}
|
|
2479
1376
|
}
|
|
2480
1377
|
}
|
|
2481
1378
|
}
|
|
2482
|
-
// Finalize absMax values
|
|
1379
|
+
// Finalize absMax and median values
|
|
2483
1380
|
for (const [column, stats] of statsMap) {
|
|
2484
1381
|
if (stats.min === Infinity || stats.max === -Infinity) {
|
|
2485
1382
|
stats.min = 0;
|
|
2486
1383
|
stats.max = 0;
|
|
2487
1384
|
}
|
|
2488
1385
|
stats.absMax = Math.max(Math.abs(stats.min), Math.abs(stats.max));
|
|
1386
|
+
const absValues = valuesMap.get(column);
|
|
1387
|
+
if (absValues.length > 0) {
|
|
1388
|
+
absValues.sort((a, b) => a - b);
|
|
1389
|
+
const mid = Math.floor(absValues.length / 2);
|
|
1390
|
+
stats.median = absValues.length % 2 === 0 ? (absValues[mid - 1] + absValues[mid]) / 2 : absValues[mid];
|
|
1391
|
+
}
|
|
2489
1392
|
statsMap.set(column, stats);
|
|
2490
1393
|
}
|
|
2491
1394
|
return statsMap;
|
|
@@ -3210,7 +2113,7 @@ class TableDataRowAdapter {
|
|
|
3210
2113
|
}
|
|
3211
2114
|
}
|
|
3212
2115
|
|
|
3213
|
-
const ibcsTableCss = () => `:host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral{text-align:right}.category-
|
|
2116
|
+
const ibcsTableCss = () => `:host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral{text-align:right}.category-w100{min-width:100em;max-width:100em}.category-w50{min-width:50em;max-width:50em}.category-w25{min-width:25em;max-width:25em}.category-w20{min-width:20em;max-width:20em}.category-w15{min-width:15em;max-width:15em}.category-w10{min-width:10em;max-width:10em}.category-w5{min-width:5em;max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}td:has(.cell-bar-chart).pos_pos:before,td:has(.cell-bar-chart).pos_neg:before,td:has(.cell-bar-chart).pos_neu:before{content:none}td:has(.cell-bar-chart).variance:after{content:none}`;
|
|
3214
2117
|
|
|
3215
2118
|
const IbcsTable = class {
|
|
3216
2119
|
constructor(hostRef) {
|
|
@@ -3240,6 +2143,7 @@ const IbcsTable = class {
|
|
|
3240
2143
|
this.measureType = MeasureType.VOLUME;
|
|
3241
2144
|
this.filter = "";
|
|
3242
2145
|
this.barColumns = [];
|
|
2146
|
+
this.barColumnMaxWidth = 30;
|
|
3243
2147
|
this.unitScaling = 0.01;
|
|
3244
2148
|
this.percentageScaling = 0.5;
|
|
3245
2149
|
this.scaleFactor = 1;
|
|
@@ -3255,7 +2159,7 @@ const IbcsTable = class {
|
|
|
3255
2159
|
const errorMsg = this.i18n.get("NO_DATA") || "==No Data==";
|
|
3256
2160
|
return h("p", { class: "warning" }, errorMsg);
|
|
3257
2161
|
}
|
|
3258
|
-
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.
|
|
2162
|
+
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)))))))))));
|
|
3259
2163
|
};
|
|
3260
2164
|
return h(Host, null, helper());
|
|
3261
2165
|
}
|
|
@@ -3367,4 +2271,4 @@ const IbcsTable = class {
|
|
|
3367
2271
|
};
|
|
3368
2272
|
IbcsTable.style = ibcsTableCss();
|
|
3369
2273
|
|
|
3370
|
-
export {
|
|
2274
|
+
export { IbcsTable as ibcs_table };
|