@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,1172 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-Cjw0q6gP.js');
|
|
4
|
-
var
|
|
5
|
-
var withComponentStatus = require('./withComponentStatus-_x4LQZ0N.js');
|
|
6
|
-
var withHasError = require('./withHasError-B8gHkfV2.js');
|
|
7
|
-
var withBodyObserver = require('./withBodyObserver-C6gLgq_e.js');
|
|
8
|
-
var withStyled = require('./withStyled-BBtMesx3.js');
|
|
9
|
-
var withComponentStyle = require('./withComponentStyle-DMtic_9Y.js');
|
|
10
|
-
var scaling = require('./scaling-D8sIIKft.js');
|
|
11
|
-
var withTranslation = require('./withTranslation-CWPAIRjh.js');
|
|
12
|
-
var Order = require('./Order-DtpbD8mQ.js');
|
|
3
|
+
var index$1 = require('./index-Cjw0q6gP.js');
|
|
4
|
+
var index = require('./index-Dm85hG6t.js');
|
|
13
5
|
var formatter = require('./formatter-DIJL_crx.js');
|
|
6
|
+
var Order = require('./Order-iG11HI4R.js');
|
|
14
7
|
var alasql_min = require('./alasql.min-C_nHTuEQ.js');
|
|
15
|
-
var
|
|
16
|
-
var DataFormatDigits = require('./DataFormatDigits-
|
|
17
|
-
require('./
|
|
8
|
+
var ibcsRuleSet = require('./ibcsRuleSet-DgUoXOfd.js');
|
|
9
|
+
var DataFormatDigits = require('./DataFormatDigits-DKcOeLNK.js');
|
|
10
|
+
var withComponentStyle = require('./withComponentStyle-aIbTCtfj.js');
|
|
18
11
|
require('./_commonjsHelpers-BJu3ubxk.js');
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const Context = class {
|
|
23
|
-
constructor(hostRef) {
|
|
24
|
-
index.registerInstance(this, hostRef);
|
|
25
|
-
this.currentPageUpdate = undefined;
|
|
26
|
-
withComponentStatus.withComponentStatus(this);
|
|
27
|
-
this.errors = withHasError.withHasError(this);
|
|
28
|
-
}
|
|
29
|
-
setLocale(newValue) {
|
|
30
|
-
this.stores.context.state.locale = newValue;
|
|
31
|
-
}
|
|
32
|
-
connectedCallback() {
|
|
33
|
-
// Retrieve (or create) the stores for this context element.
|
|
34
|
-
// A descendant component may have already triggered creation via
|
|
35
|
-
// getStores() if Stencil initialized it before this component.
|
|
36
|
-
this.stores = contextProtocol.getOrCreateStores(this.element);
|
|
37
|
-
if (this.locale) {
|
|
38
|
-
this.stores.context.state.locale = this.locale;
|
|
39
|
-
}
|
|
40
|
-
this.currentPageUpdate = setTimeout(() => {
|
|
41
|
-
this.element.querySelectorAll("bn-page, bn-layout-page").forEach((page, index) => {
|
|
42
|
-
if (page.localName === "bn-layout-page") {
|
|
43
|
-
page.setAttribute("page-number", (index + 1).toString());
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
const footer = page.querySelector("bn-footer");
|
|
47
|
-
if (footer) {
|
|
48
|
-
// @ts-ignore
|
|
49
|
-
footer.setAttribute("page-number", (index + 1).toString());
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}, 250);
|
|
54
|
-
}
|
|
55
|
-
disconnectedCallback() {
|
|
56
|
-
if (this.currentPageUpdate) {
|
|
57
|
-
clearTimeout(this.currentPageUpdate);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
componentWillLoad() {
|
|
61
|
-
// stencil needs one componenet implementing all lifecycle steps to get mixing working
|
|
62
|
-
}
|
|
63
|
-
componentDidLoad() { }
|
|
64
|
-
componentShouldUpdate() { }
|
|
65
|
-
componentWillRender() { }
|
|
66
|
-
componentDidRender() { }
|
|
67
|
-
componentWillUpdate() { }
|
|
68
|
-
componentDidUpdate() { }
|
|
69
|
-
render() {
|
|
70
|
-
return (index.h(index.Host, { key: 'b92019b909e271225baca2cf740c8301e324164e' }, index.h("slot", { key: '87bac4bb29bca32d961afe31355dc1bd48fff0f8' })));
|
|
71
|
-
}
|
|
72
|
-
get element() { return index.getElement(this); }
|
|
73
|
-
static get watchers() { return {
|
|
74
|
-
"locale": [{
|
|
75
|
-
"setLocale": 0
|
|
76
|
-
}]
|
|
77
|
-
}; }
|
|
78
|
-
};
|
|
79
|
-
Context.style = bnContextCss();
|
|
80
|
-
|
|
81
|
-
const bnDatasourceCss = () => `bn-datasource{display:none}`;
|
|
82
|
-
|
|
83
|
-
const Datasource = class {
|
|
84
|
-
constructor(hostRef) {
|
|
85
|
-
index.registerInstance(this, hostRef);
|
|
86
|
-
withComponentStatus.withComponentStatus(this);
|
|
87
|
-
this.errors = withHasError.withHasError(this);
|
|
88
|
-
withBodyObserver.withBodyObserver(this, (data) => {
|
|
89
|
-
if (!this.stores)
|
|
90
|
-
this.stores = contextProtocol.getStores(this.element);
|
|
91
|
-
try {
|
|
92
|
-
const json = JSON.parse(data);
|
|
93
|
-
// @ts-ignore
|
|
94
|
-
this.stores.datasources.set(this.name, json);
|
|
95
|
-
}
|
|
96
|
-
catch (e) {
|
|
97
|
-
console.error("Error parsing datasource", e, data);
|
|
98
|
-
// @ts-ignore
|
|
99
|
-
this.stores.datasources.set(this.name, []);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
render() {
|
|
104
|
-
return index.h(index.Host, { key: 'e47e62c941bb7954cabe331cb500a7d2fdd7c487' });
|
|
105
|
-
}
|
|
106
|
-
get element() { return index.getElement(this); }
|
|
107
|
-
};
|
|
108
|
-
Datasource.style = bnDatasourceCss();
|
|
109
|
-
|
|
110
|
-
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}`;
|
|
111
|
-
|
|
112
|
-
const VALID_FORMATS = ["xga", "hd", "full-hd", "4k", "4k2k", "a4", "a3", "a2", "a1", "a0", "letter", "legal"];
|
|
113
|
-
const VALID_ORIENTATIONS = ["landscape", "portrait"];
|
|
114
|
-
const Page = class {
|
|
115
|
-
constructor(hostRef) {
|
|
116
|
-
index.registerInstance(this, hostRef);
|
|
117
|
-
withComponentStatus.withComponentStatus(this);
|
|
118
|
-
this.errors = withHasError.withHasError(this);
|
|
119
|
-
this.componentStyle = withComponentStyle.withComponentStyle(this);
|
|
120
|
-
}
|
|
121
|
-
validateFormat(newValue) {
|
|
122
|
-
const errId = "ERR_format";
|
|
123
|
-
if (!withStyled.isBlankInput(newValue) && !VALID_FORMATS.includes(newValue)) {
|
|
124
|
-
this.errors.addOrReplace({
|
|
125
|
-
id: errId,
|
|
126
|
-
type: "warning",
|
|
127
|
-
message: `format: invalid value '${newValue}' is not supported. Valid values: ${VALID_FORMATS.join(", ")}`,
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
this.errors.remove(errId);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
validateOrientation(newValue) {
|
|
135
|
-
const errId = "ERR_orientation";
|
|
136
|
-
if (!withStyled.isBlankInput(newValue) && !VALID_ORIENTATIONS.includes(newValue)) {
|
|
137
|
-
this.errors.addOrReplace({
|
|
138
|
-
id: errId,
|
|
139
|
-
type: "warning",
|
|
140
|
-
message: `orientation: invalid value '${newValue}' is not supported. Valid values: ${VALID_ORIENTATIONS.join(", ")}`,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
this.errors.remove(errId);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
render() {
|
|
148
|
-
return (index.h(index.Host, { key: 'b4d682a8f6e83f77c58236265eaf9d1327809c6f', format: this.format, orientation: this.orientation, style: this.prepareStyle() }, index.h("slot", { key: 'ef49c43c1f8926c4c968b752608627adbe330d6c' })));
|
|
149
|
-
}
|
|
150
|
-
prepareStyle() {
|
|
151
|
-
const pageStyle = {
|
|
152
|
-
"font-family": this.componentStyle(($) => $.global["fontFamily"]),
|
|
153
|
-
"font-size": `${this.componentStyle(($) => $.global["fontSizePx"])}px`,
|
|
154
|
-
"--bn-font-family": this.componentStyle(($) => $.global["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
155
|
-
"--bn-font-size": `${this.componentStyle(($) => $.global["fontSizePx"]) || 13.3333}px`,
|
|
156
|
-
"--bn-font-color": this.componentStyle(($) => $.global["fontColor"]) || "#000000",
|
|
157
|
-
"--bn-font-background": this.componentStyle(($) => $.global["fontBackgroundColor"]) || "#ffffff",
|
|
158
|
-
};
|
|
159
|
-
return pageStyle;
|
|
160
|
-
}
|
|
161
|
-
get element() { return index.getElement(this); }
|
|
162
|
-
static get watchers() { return {
|
|
163
|
-
"format": [{
|
|
164
|
-
"validateFormat": 0
|
|
165
|
-
}],
|
|
166
|
-
"orientation": [{
|
|
167
|
-
"validateOrientation": 0
|
|
168
|
-
}]
|
|
169
|
-
}; }
|
|
170
|
-
};
|
|
171
|
-
Page.style = bnPageCss();
|
|
172
|
-
|
|
173
|
-
/** Sentinel value indicating all groups should be included. */
|
|
174
|
-
var GroupSelection;
|
|
175
|
-
(function (GroupSelection) {
|
|
176
|
-
GroupSelection[GroupSelection["ALL"] = -1] = "ALL";
|
|
177
|
-
})(GroupSelection || (GroupSelection = {}));
|
|
178
|
-
/**
|
|
179
|
-
* Tracks whether a factory's output is current or needs recalculation.
|
|
180
|
-
* Used to avoid redundant re-rendering when underlying data has not changed.
|
|
181
|
-
*/
|
|
182
|
-
var FactoryState;
|
|
183
|
-
(function (FactoryState) {
|
|
184
|
-
/** Output matches the current input data. */
|
|
185
|
-
FactoryState[FactoryState["UP_TO_DATE"] = 0] = "UP_TO_DATE";
|
|
186
|
-
/** Input data has changed; output needs to be regenerated. */
|
|
187
|
-
FactoryState[FactoryState["DIRTY"] = 1] = "DIRTY";
|
|
188
|
-
})(FactoryState || (FactoryState = {}));
|
|
189
|
-
/**
|
|
190
|
-
* Table aggregation modes controlling how rows are grouped and totalled.
|
|
191
|
-
*
|
|
192
|
-
* - `LIST` -- Flat list with no aggregation.
|
|
193
|
-
* - `SUM` -- Grouped rows with sum totals per group and a grand total.
|
|
194
|
-
* - `SUMNOTOTAL` -- Grouped rows with group sums but no grand total row.
|
|
195
|
-
* - `OPT` -- Operation-aware aggregation (respects the +/- operation field).
|
|
196
|
-
* - `OPTNOTOTAL` -- Operation-aware aggregation without a grand total row.
|
|
197
|
-
*/
|
|
198
|
-
var TableType;
|
|
199
|
-
(function (TableType) {
|
|
200
|
-
TableType["LIST"] = "list";
|
|
201
|
-
TableType["SUM"] = "sum";
|
|
202
|
-
TableType["SUMNOTOTAL"] = "sumnototal";
|
|
203
|
-
TableType["OPT"] = "opt";
|
|
204
|
-
TableType["OPTNOTOTAL"] = "optnototal";
|
|
205
|
-
})(TableType || (TableType = {}));
|
|
206
|
-
var OrderDirection;
|
|
207
|
-
(function (OrderDirection) {
|
|
208
|
-
OrderDirection["ASC"] = "asc";
|
|
209
|
-
OrderDirection["DESC"] = "desc";
|
|
210
|
-
})(OrderDirection || (OrderDirection = {}));
|
|
211
|
-
/**
|
|
212
|
-
* Discriminator for rendered table rows, controlling visual styling and behavior.
|
|
213
|
-
*
|
|
214
|
-
* - `HEADER` -- Column header row.
|
|
215
|
-
* - `GROUPHEAD` -- Group title row (rendered when `grouped` is true).
|
|
216
|
-
* - `SEPERATORLINE` -- Visual divider between groups.
|
|
217
|
-
* - `SUM` -- Grand total row.
|
|
218
|
-
* - `GROUPSUM` -- Sub-total row for a single group.
|
|
219
|
-
* - `DRILLELEMENT` -- "Thereof" drill-down sub-row.
|
|
220
|
-
* - `STANDARD` -- Normal data row.
|
|
221
|
-
* - `PARTELEMENT` -- "Part of" percentage row.
|
|
222
|
-
* - `ENTRY` -- Generic entry row.
|
|
223
|
-
*/
|
|
224
|
-
var TableRowType;
|
|
225
|
-
(function (TableRowType) {
|
|
226
|
-
TableRowType["HEADER"] = "HEADER";
|
|
227
|
-
TableRowType["GROUPHEAD"] = "GROUPHEAD";
|
|
228
|
-
TableRowType["SEPERATORLINE"] = "SEPERATORLINE";
|
|
229
|
-
TableRowType["SUM"] = "SUM";
|
|
230
|
-
TableRowType["GROUPSUM"] = "GROUP_SUM";
|
|
231
|
-
TableRowType["DRILLELEMENT"] = "DRILLELEMENT";
|
|
232
|
-
TableRowType["STANDARD"] = "STANDARD";
|
|
233
|
-
TableRowType["PARTELEMENT"] = "PARTELEMENT";
|
|
234
|
-
TableRowType["ENTRY"] = "ENTRY";
|
|
235
|
-
})(TableRowType || (TableRowType = {}));
|
|
236
|
-
|
|
237
|
-
const bnTableCss = () => `:host{display:inline-block;position:relative;overflow:hidden}`;
|
|
238
|
-
|
|
239
|
-
const Table$1 = class Table {
|
|
240
|
-
validateScaling(newValue) {
|
|
241
|
-
if (newValue == null || newValue === "" || newValue === "none" || newValue === "auto") {
|
|
242
|
-
this.errors.remove("ERR_scale");
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
const num = Number(newValue);
|
|
246
|
-
if (isNaN(num) || num <= 0) {
|
|
247
|
-
this.errors.addOrReplace({
|
|
248
|
-
id: "ERR_scale",
|
|
249
|
-
type: "warning",
|
|
250
|
-
message: `Invalid scale value: "${newValue}". Use "none", "auto", or a positive number.`,
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
this.errors.remove("ERR_scale");
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
constructor(hostRef) {
|
|
258
|
-
index.registerInstance(this, hostRef);
|
|
259
|
-
this.data = [];
|
|
260
|
-
this.datasetMeta = null;
|
|
261
|
-
this.appliedScaleFactor = 1;
|
|
262
|
-
/**
|
|
263
|
-
* A not mundane tile which should describes the shown data.
|
|
264
|
-
*/
|
|
265
|
-
this.tableTitle = "";
|
|
266
|
-
/**
|
|
267
|
-
* AlaSQL WHERE clause fragment injected into the data query to filter
|
|
268
|
-
* rows before rendering (e.g. `"category = 'Sales'"`).
|
|
269
|
-
*/
|
|
270
|
-
this.filter = "";
|
|
271
|
-
/**
|
|
272
|
-
* measureUnit displayed in table.
|
|
273
|
-
*/
|
|
274
|
-
this.measureUnit = "";
|
|
275
|
-
/**
|
|
276
|
-
* Scaling for absolute variance bar charts (ΔPY).
|
|
277
|
-
* <br /><br />
|
|
278
|
-
* Name of the 'scaling-group' which the table uses.
|
|
279
|
-
* Scaling groups are maintained globally.
|
|
280
|
-
* <br /><br />
|
|
281
|
-
* Alternatively a number which represents pixels per unit of measure.
|
|
282
|
-
* <br /><br />
|
|
283
|
-
* Example: 0.01 means 1000 units = 10 pixels width.
|
|
284
|
-
* <br /><br />
|
|
285
|
-
* Default: 0.01
|
|
286
|
-
*/
|
|
287
|
-
this.unitScaling = 0.01;
|
|
288
|
-
/**
|
|
289
|
-
* Scaling for relative variance pin charts (ΔPY%).
|
|
290
|
-
* <br /><br />
|
|
291
|
-
* Name of the 'scaling-group' which the table uses.
|
|
292
|
-
* Scaling groups are maintained globally.
|
|
293
|
-
* <br /><br />
|
|
294
|
-
* Alternatively a number which represents pixels per percentage point.
|
|
295
|
-
* <br /><br />
|
|
296
|
-
* Example: 0.5 means 100% = 50 pixels width.
|
|
297
|
-
* <br /><br />
|
|
298
|
-
* Default: 0.5
|
|
299
|
-
*/
|
|
300
|
-
this.percentageScaling = 0.5;
|
|
301
|
-
// Global scaling groups map - can be populated externally for shared scaling across components
|
|
302
|
-
this.pixelPerUnitGroupMap = new Map();
|
|
303
|
-
/**
|
|
304
|
-
* Defines the data unit type of the tables data.
|
|
305
|
-
* <br /><br />
|
|
306
|
-
* If percent is chosen all data values are converted into percent
|
|
307
|
-
* (0.02 -> 2%)
|
|
308
|
-
* <br /><br />
|
|
309
|
-
* values: <br />
|
|
310
|
-
* ```percent // decimal```
|
|
311
|
-
*/
|
|
312
|
-
this.dataFormat = "decimal";
|
|
313
|
-
/**
|
|
314
|
-
* Toggles of data should be grouped by
|
|
315
|
-
* 'rowgroup'.
|
|
316
|
-
* <br /><br />
|
|
317
|
-
* values: <br />
|
|
318
|
-
* ```true // false```
|
|
319
|
-
*/
|
|
320
|
-
this.grouped = "false";
|
|
321
|
-
/**
|
|
322
|
-
* Toggles display of measure units in table header
|
|
323
|
-
* <br /><br />
|
|
324
|
-
* values: <br />
|
|
325
|
-
* ```true // false```
|
|
326
|
-
*/
|
|
327
|
-
this.showMeasureScale = "false";
|
|
328
|
-
/**
|
|
329
|
-
* Toggles a title header for each (row-)group
|
|
330
|
-
* the title header value is found set by 'rowgroup'
|
|
331
|
-
* <br /><br />
|
|
332
|
-
* values: <br />
|
|
333
|
-
* ```true // false```
|
|
334
|
-
*
|
|
335
|
-
*/
|
|
336
|
-
this.showGroupTitle = "true";
|
|
337
|
-
/**
|
|
338
|
-
* Set the table type
|
|
339
|
-
* <br /><br />
|
|
340
|
-
* values: <br />
|
|
341
|
-
* ```list // sum // opt // sumnototal // optnototal```
|
|
342
|
-
*
|
|
343
|
-
*/
|
|
344
|
-
this.type = "list";
|
|
345
|
-
/**
|
|
346
|
-
* Set the maximum number of rows for each
|
|
347
|
-
* group. The value 0 means *no limit*
|
|
348
|
-
* <br /><br />
|
|
349
|
-
* rows wich where cut by the limit are cumulated as REST
|
|
350
|
-
*
|
|
351
|
-
*/
|
|
352
|
-
this.limit = 0;
|
|
353
|
-
/**
|
|
354
|
-
* Stringified Array of drilldown Objects {
|
|
355
|
-
"rowGroup": string,<br />
|
|
356
|
-
"category": string,<br />
|
|
357
|
-
"subCategory": string,<br />
|
|
358
|
-
},<br /><br />
|
|
359
|
-
* rowgroup, categroy defines the location of the drill
|
|
360
|
-
* subcategory is the displayed label of the data row
|
|
361
|
-
*<br /><br />
|
|
362
|
-
* example:<br />
|
|
363
|
-
* ```[{
|
|
364
|
-
"rowGroup":"Umsatz",
|
|
365
|
-
"category": "Applications",
|
|
366
|
-
"subCategory": "Applications-A",
|
|
367
|
-
},]```
|
|
368
|
-
*/
|
|
369
|
-
this.thereof = "[]";
|
|
370
|
-
/**
|
|
371
|
-
* Stringified Array of Partof Objects <br />{<br />
|
|
372
|
-
"rowGroup": string,<br />
|
|
373
|
-
"category": string<br />
|
|
374
|
-
},<br /><br />
|
|
375
|
-
* rowgroup, categroy defines the location of the drill
|
|
376
|
-
* percentage of category in rowgorup
|
|
377
|
-
*<br /><br />
|
|
378
|
-
* example:<br />
|
|
379
|
-
* ```[{
|
|
380
|
-
"rowGroups":"Umsatz",
|
|
381
|
-
"category": "Applications",
|
|
382
|
-
},]```
|
|
383
|
-
*/
|
|
384
|
-
this.partof = "[]";
|
|
385
|
-
/** List of the primary scenarios on which the order direction are applied valid scenarios are
|
|
386
|
-
* If order is set to a scenario it has also exists in scenariolist
|
|
387
|
-
* <br /><br />
|
|
388
|
-
* values: <br />
|
|
389
|
-
* ```category // categoryindex // rowgroup // rowgroup // rowgroupindex // ac[1-4] // fc[1-4] // pp[1-4] // pl[1-4] // auto```
|
|
390
|
-
* <br /><br />
|
|
391
|
-
* When set to ```auto```, order is detected from the dataset silently.
|
|
392
|
-
*/
|
|
393
|
-
this.order = "category";
|
|
394
|
-
/** Set sorting order direction
|
|
395
|
-
* <br /><br />
|
|
396
|
-
* values: <br />
|
|
397
|
-
* ```asc // desc```
|
|
398
|
-
*/
|
|
399
|
-
this.orderDirection = "asc";
|
|
400
|
-
/** Sets the Measure Type of the Table
|
|
401
|
-
* volume is different displayed and interpreted as currency
|
|
402
|
-
* names of siprefix are adapted.
|
|
403
|
-
* <br /><br />
|
|
404
|
-
* values: <br />
|
|
405
|
-
* ```volume // currency```
|
|
406
|
-
|
|
407
|
-
*/
|
|
408
|
-
this.measureType = "volume";
|
|
409
|
-
/**
|
|
410
|
-
* Sets the SiPrefix of the Mesaurements and converts the
|
|
411
|
-
* original value.
|
|
412
|
-
* <br /><br />
|
|
413
|
-
* values: <br />
|
|
414
|
-
* ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p // P // f // a // z // y // GREATEST // LEAST```
|
|
415
|
-
* <br /><br />
|
|
416
|
-
* SiPrefix overview:
|
|
417
|
-
* ``` "Y": 1E+24,```<br />
|
|
418
|
-
* ``` "Z": 1E+21,```<br />
|
|
419
|
-
* ``` "E": 1E+18,```<br />
|
|
420
|
-
* ``` "P": 1E+15,```<br />
|
|
421
|
-
* ``` "T": 1E+12,```<br />
|
|
422
|
-
* ``` "G": 1000000000,```<br />
|
|
423
|
-
* ``` "M": 1000000,```<br />
|
|
424
|
-
* ``` "k": 1000,```<br />
|
|
425
|
-
* <br />
|
|
426
|
-
* ``` "m": 0.001,```<br />
|
|
427
|
-
* ``` "μ": 0.000001,```<br />
|
|
428
|
-
* ``` "n": 0.000000001,```<br />
|
|
429
|
-
* ``` "p": 0.000000000001,```<br />
|
|
430
|
-
* ``` "f": 0.000000000000001,```<br />
|
|
431
|
-
* ``` "a": 0.000000000000000001,```<br />
|
|
432
|
-
* ``` "z": 0.000000000000000000001,```<br />
|
|
433
|
-
* ``` "y": 0.000000000000000000000001,```<br />
|
|
434
|
-
* <br /><br />
|
|
435
|
-
* Special modes:
|
|
436
|
-
* ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
437
|
-
* ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
438
|
-
*<br /><br />
|
|
439
|
-
* ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*/
|
|
443
|
-
this.measureScale = "greatest";
|
|
444
|
-
/**
|
|
445
|
-
* Number of decimal digits in a table cell
|
|
446
|
-
*/
|
|
447
|
-
this.dataFormatDigitsDecimal = 1;
|
|
448
|
-
/**
|
|
449
|
-
* Number of percent digits in a table cell
|
|
450
|
-
*/
|
|
451
|
-
this.dataFormatDigitsPercent = 2;
|
|
452
|
-
/**
|
|
453
|
-
* Set width of category column. <br />
|
|
454
|
-
* If INF is selected the columns scaling to the min space they need
|
|
455
|
-
* seperatly.
|
|
456
|
-
* <br /><br />
|
|
457
|
-
* values:<br />
|
|
458
|
-
* ``` w5 // w10 // w15 // w20 // w25 // w50 // inf ```
|
|
459
|
-
*/
|
|
460
|
-
this.categoryWidth = "w15";
|
|
461
|
-
/**
|
|
462
|
-
* Defines which drill-column is displayed. <br />
|
|
463
|
-
* <br /><br />
|
|
464
|
-
* ```scenario``` the scenaro to drill <br/>
|
|
465
|
-
* ```group``` is a list of child columns of the parent <br/><br/>
|
|
466
|
-
* ```subGroups``` is a list of child columns of the parent <br/><br/>
|
|
467
|
-
* example:<br />
|
|
468
|
-
* ```[{"scenario": "ac1", "name": "DE", "subGroups": ["Berlin"]},
|
|
469
|
-
* {"scenario": "ac2", "name": "UK", "subGroups": []}],
|
|
470
|
-
* ```
|
|
471
|
-
*/
|
|
472
|
-
this.columnthereof = null;
|
|
473
|
-
this._autoScaleGuard = false;
|
|
474
|
-
withStyled.withStyled(this);
|
|
475
|
-
withComponentStatus.withComponentStatus(this);
|
|
476
|
-
this.errors = withHasError.withHasError(this);
|
|
477
|
-
this.componentStyle = withComponentStyle.withComponentStyle(this);
|
|
478
|
-
scaling.withDataset(this, (_name, data) => {
|
|
479
|
-
this.data = (data || []);
|
|
480
|
-
}, (_name, meta) => {
|
|
481
|
-
this.datasetMeta = meta;
|
|
482
|
-
});
|
|
483
|
-
this.t = withTranslation.withTranslation(this).t;
|
|
484
|
-
}
|
|
485
|
-
validateScenario(newValue) {
|
|
486
|
-
const errId = "ERR_scenarios";
|
|
487
|
-
const invalidScenarios = withStyled.validateScenarioList(newValue);
|
|
488
|
-
if (invalidScenarios.length > 0) {
|
|
489
|
-
this.errors.addOrReplace({
|
|
490
|
-
id: errId,
|
|
491
|
-
type: "warning",
|
|
492
|
-
message: "scenarios: invalid value(s) '" + (invalidScenarios === null || invalidScenarios === void 0 ? void 0 : invalidScenarios.toString()) + "' are not supported.",
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
else {
|
|
496
|
-
this.errors.remove(errId);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
validateVariances(newValue) {
|
|
500
|
-
const errId = "ERR_variances";
|
|
501
|
-
const invalidVariances = withStyled.validateVariancesList(newValue);
|
|
502
|
-
if (invalidVariances.length > 0) {
|
|
503
|
-
this.errors.addOrReplace({
|
|
504
|
-
id: errId,
|
|
505
|
-
type: "warning",
|
|
506
|
-
message: "variances: invalid value(s) '" + JSON.stringify(invalidVariances) + "' are not supported.",
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
else {
|
|
510
|
-
this.errors.remove(errId);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
validateBarColumns(newValue) {
|
|
514
|
-
const errId = "ERR_barColumns";
|
|
515
|
-
if (withStyled.isBlankInput(newValue)) {
|
|
516
|
-
this.errors.remove(errId);
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
const invalidColumns = withStyled.validateVariancesList(newValue);
|
|
520
|
-
if (invalidColumns.length > 0) {
|
|
521
|
-
this.errors.addOrReplace({
|
|
522
|
-
id: errId,
|
|
523
|
-
type: "warning",
|
|
524
|
-
message: "barColumns: invalid value(s) '" + JSON.stringify(invalidColumns) + "' are not supported.",
|
|
525
|
-
});
|
|
526
|
-
}
|
|
527
|
-
else {
|
|
528
|
-
this.errors.remove(errId);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
validateUnitScaling(newValue) {
|
|
532
|
-
const errId = "ERR_unitScaling";
|
|
533
|
-
if (!withStyled.isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
534
|
-
this.errors.addOrReplace({
|
|
535
|
-
id: errId,
|
|
536
|
-
type: "warning",
|
|
537
|
-
message: "unitScaling: invalid value '" + newValue + "' is not supported.",
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
else {
|
|
541
|
-
this.errors.remove(errId);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
validatePercentageScaling(newValue) {
|
|
545
|
-
const errId = "ERR_percentageScaling";
|
|
546
|
-
if (!withStyled.isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
547
|
-
this.errors.addOrReplace({
|
|
548
|
-
id: errId,
|
|
549
|
-
type: "warning",
|
|
550
|
-
message: "percentageScaling: invalid value '" + newValue + "' is not supported.",
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
else {
|
|
554
|
-
this.errors.remove(errId);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
validateDataFormat(newValue) {
|
|
558
|
-
const errId = "ERR_dataFormat";
|
|
559
|
-
if (!withStyled.isValidDataFormat(newValue)) {
|
|
560
|
-
this.errors.addOrReplace({
|
|
561
|
-
id: errId,
|
|
562
|
-
type: "warning",
|
|
563
|
-
message: "dataFormat: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
else {
|
|
567
|
-
this.errors.remove(errId);
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
validateGrouped(newValue) {
|
|
571
|
-
const errId = "ERR_grouped";
|
|
572
|
-
if (!withStyled.isValidBoolean(newValue)) {
|
|
573
|
-
this.errors.addOrReplace({
|
|
574
|
-
id: errId,
|
|
575
|
-
type: "warning",
|
|
576
|
-
message: "grouped: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
else {
|
|
580
|
-
this.errors.remove(errId);
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
validateShowMeasureScale(newValue) {
|
|
584
|
-
const errId = "ERR_grouped";
|
|
585
|
-
if (!withStyled.isValidBoolean(newValue)) {
|
|
586
|
-
this.errors.addOrReplace({
|
|
587
|
-
id: errId,
|
|
588
|
-
type: "warning",
|
|
589
|
-
message: "showMeasureScale: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
else {
|
|
593
|
-
this.errors.remove(errId);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
validateShowGroupTitle(newValue) {
|
|
597
|
-
const errId = "ERR_showGroupTitle";
|
|
598
|
-
if (!withStyled.isValidBoolean(newValue)) {
|
|
599
|
-
this.errors.addOrReplace({
|
|
600
|
-
id: errId,
|
|
601
|
-
type: "warning",
|
|
602
|
-
message: "showGroupTitle: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
else {
|
|
606
|
-
this.errors.remove(errId);
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
validateType(newValue) {
|
|
610
|
-
const errId = "ERR_type";
|
|
611
|
-
if (!withStyled.isValidTableType(newValue)) {
|
|
612
|
-
this.errors.addOrReplace({
|
|
613
|
-
id: errId,
|
|
614
|
-
type: "warning",
|
|
615
|
-
message: "type: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
this.errors.remove(errId);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
validateLimit(newValue) {
|
|
623
|
-
const errId = "ERR_limit";
|
|
624
|
-
if (!withStyled.isValidInteger(newValue)) {
|
|
625
|
-
this.errors.addOrReplace({
|
|
626
|
-
id: errId,
|
|
627
|
-
type: "warning",
|
|
628
|
-
message: "order: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
this.errors.remove(errId);
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
validateThereOf(newValue) {
|
|
636
|
-
const errId = "ERR_thereof";
|
|
637
|
-
const invalidElements = withStyled.validateThereOfJsonStr(newValue);
|
|
638
|
-
if (invalidElements.length > 0) {
|
|
639
|
-
this.errors.addOrReplace({
|
|
640
|
-
id: errId,
|
|
641
|
-
type: "warning",
|
|
642
|
-
message: "ThereOf: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
else {
|
|
646
|
-
this.errors.remove(errId);
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
validatePartOf(newValue) {
|
|
650
|
-
const errId = "ERR_partof";
|
|
651
|
-
const invalidElements = withStyled.validatePartOfJsonStr(newValue);
|
|
652
|
-
if (invalidElements.length > 0) {
|
|
653
|
-
this.errors.addOrReplace({
|
|
654
|
-
id: errId,
|
|
655
|
-
type: "warning",
|
|
656
|
-
message: "partof: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
this.errors.remove(errId);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
validateOrderList(newValue) {
|
|
664
|
-
const errId = "ERR_order";
|
|
665
|
-
const invalidElements = withStyled.validateOrderList(newValue);
|
|
666
|
-
if (invalidElements.length > 0) {
|
|
667
|
-
this.errors.addOrReplace({
|
|
668
|
-
id: errId,
|
|
669
|
-
type: "warning",
|
|
670
|
-
message: "order: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
this.errors.remove(errId);
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
validateOrderDirection(newValue) {
|
|
678
|
-
const errId = "ERR_orderDirection";
|
|
679
|
-
if (!withStyled.isValidDirection(newValue)) {
|
|
680
|
-
this.errors.addOrReplace({
|
|
681
|
-
id: errId,
|
|
682
|
-
type: "warning",
|
|
683
|
-
message: "orderDirection: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
else {
|
|
687
|
-
this.errors.remove(errId);
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
validateMeasureType(newValue) {
|
|
691
|
-
const errId = "ERR_measureType";
|
|
692
|
-
if (!withStyled.isValidMeasureType(newValue)) {
|
|
693
|
-
this.errors.addOrReplace({
|
|
694
|
-
id: errId,
|
|
695
|
-
type: "warning",
|
|
696
|
-
message: "measureType: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
else {
|
|
700
|
-
this.errors.remove(errId);
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
validateMeasureScale(newValue) {
|
|
704
|
-
const errId = "ERR_measureScale";
|
|
705
|
-
if (!withStyled.isValidMeasureScale(newValue)) {
|
|
706
|
-
this.errors.addOrReplace({
|
|
707
|
-
id: errId,
|
|
708
|
-
type: "warning",
|
|
709
|
-
message: "measureScale: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
else {
|
|
713
|
-
this.errors.remove(errId);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
validateDataFormatDigitsDecimal(newValue) {
|
|
717
|
-
const errId = "ERR_dataFormatDigitsDecimal";
|
|
718
|
-
if (!withStyled.isValidInteger(newValue)) {
|
|
719
|
-
this.errors.addOrReplace({
|
|
720
|
-
id: errId,
|
|
721
|
-
type: "warning",
|
|
722
|
-
message: "dataFormatDigitsDecimal: invalid value(s) '" + newValue + "' are not supported.",
|
|
723
|
-
});
|
|
724
|
-
}
|
|
725
|
-
else {
|
|
726
|
-
this.errors.remove(errId);
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
validateDateFormatDigitsPercent(newValue) {
|
|
730
|
-
const errId = "ERR_dataFormatDigitsPercent";
|
|
731
|
-
if (!withStyled.isValidInteger(newValue)) {
|
|
732
|
-
this.errors.addOrReplace({
|
|
733
|
-
id: errId,
|
|
734
|
-
type: "warning",
|
|
735
|
-
message: "dataFormatDigitsPercent: invalid value(s) '" + newValue + "' are not supported.",
|
|
736
|
-
});
|
|
737
|
-
}
|
|
738
|
-
else {
|
|
739
|
-
this.errors.remove(errId);
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
validateCategoryWidth(newValue) {
|
|
743
|
-
const errId = "ERR_categoryWidth";
|
|
744
|
-
if (!withStyled.isTableCategoryWidth(newValue)) {
|
|
745
|
-
this.errors.addOrReplace({
|
|
746
|
-
id: errId,
|
|
747
|
-
type: "warning",
|
|
748
|
-
message: "categoryWidth: invalid value(s) '" + newValue + "' are not supported.",
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
else {
|
|
752
|
-
this.errors.remove(errId);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
validateColumnThereOf(newValue) {
|
|
756
|
-
const invalidElements = withStyled.validateColumnThereOfJsonStr(newValue);
|
|
757
|
-
const errId = "ERR_categorythereof";
|
|
758
|
-
if (invalidElements.length > 0) {
|
|
759
|
-
this.errors.addOrReplace({
|
|
760
|
-
id: errId,
|
|
761
|
-
type: "warning",
|
|
762
|
-
message: "columnthereof: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
else {
|
|
766
|
-
this.errors.remove(errId);
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
componentWillLoad() {
|
|
770
|
-
//this.datasouce = get("test");
|
|
771
|
-
// this.unsubscribe = onChange("test", (value) => this.datasouce = value);
|
|
772
|
-
this.validateScenario(this.scenarios);
|
|
773
|
-
this.validateVariances(this.variances);
|
|
774
|
-
this.validateDataFormat(this.dataFormat);
|
|
775
|
-
this.validateGrouped(this.grouped);
|
|
776
|
-
this.validateShowGroupTitle(this.showGroupTitle);
|
|
777
|
-
this.validateType(this.type);
|
|
778
|
-
this.validateLimit(this.limit);
|
|
779
|
-
this.validateThereOf(this.thereof);
|
|
780
|
-
this.validatePartOf(this.partof);
|
|
781
|
-
this.validateOrderDirection(this.orderDirection);
|
|
782
|
-
this.validateOrderList(this.order);
|
|
783
|
-
this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal);
|
|
784
|
-
this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent);
|
|
785
|
-
this.validateCategoryWidth(this.categoryWidth);
|
|
786
|
-
this.validateMeasureType(this.measureType);
|
|
787
|
-
this.validateMeasureScale(this.measureScale);
|
|
788
|
-
this.validateColumnThereOf(this.columnthereof);
|
|
789
|
-
this.validateShowMeasureScale(this.showMeasureScale);
|
|
790
|
-
this.validateBarColumns(this.barColumns);
|
|
791
|
-
this.validateUnitScaling(this.unitScaling);
|
|
792
|
-
this.validatePercentageScaling(this.percentageScaling);
|
|
793
|
-
this.validateScaling(this.scale);
|
|
794
|
-
}
|
|
795
|
-
disconnectedCallback() {
|
|
796
|
-
this.unsubscribe();
|
|
797
|
-
}
|
|
798
|
-
componentDidRender() {
|
|
799
|
-
var _a, _b;
|
|
800
|
-
const { mode } = scaling.parseScaling(this.scale);
|
|
801
|
-
// Only auto-scale for 'auto' and 'empty' (blank) modes
|
|
802
|
-
if (mode !== "auto" && mode !== "empty") {
|
|
803
|
-
this._autoScaleGuard = false;
|
|
804
|
-
return;
|
|
805
|
-
}
|
|
806
|
-
// Skip re-measurement after the state-triggered re-render
|
|
807
|
-
if (this._autoScaleGuard) {
|
|
808
|
-
this._autoScaleGuard = false;
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
811
|
-
const host = this.element;
|
|
812
|
-
const { width: parentWidth } = scaling.getParentDimensions(host);
|
|
813
|
-
if (parentWidth <= 0)
|
|
814
|
-
return;
|
|
815
|
-
// Measure at base (unscaled) font size to get true content width.
|
|
816
|
-
// This avoids the oscillation where scaled-down content fits → reset
|
|
817
|
-
// to 1 → overflows → scale down → fits → …
|
|
818
|
-
const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
819
|
-
host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
|
|
820
|
-
// Reading scrollWidth forces a synchronous reflow at base size
|
|
821
|
-
const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("div");
|
|
822
|
-
const unscaledWidth = (_b = div === null || div === void 0 ? void 0 : div.scrollWidth) !== null && _b !== void 0 ? _b : host.scrollWidth;
|
|
823
|
-
if (unscaledWidth <= parentWidth + 1) {
|
|
824
|
-
// Content fits at base size — no scaling needed
|
|
825
|
-
this.errors.remove("AUTO_scale");
|
|
826
|
-
if (this.appliedScaleFactor !== 1) {
|
|
827
|
-
this._autoScaleGuard = true;
|
|
828
|
-
this.appliedScaleFactor = 1;
|
|
829
|
-
}
|
|
830
|
-
return;
|
|
831
|
-
}
|
|
832
|
-
// Subtract 1px to account for sub-pixel rounding after scaling,
|
|
833
|
-
// preventing the right edge from being clipped by overflow:hidden.
|
|
834
|
-
const computedFactor = (parentWidth - 1) / unscaledWidth;
|
|
835
|
-
// Apply immediately via CSS var for smooth visual (before state re-render)
|
|
836
|
-
host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
|
|
837
|
-
if (mode === "empty") {
|
|
838
|
-
this.errors.addOrReplace({
|
|
839
|
-
id: "AUTO_scale",
|
|
840
|
-
type: "warning",
|
|
841
|
-
message: `Auto-scaled table by factor ${computedFactor.toFixed(3)}`,
|
|
842
|
-
});
|
|
843
|
-
}
|
|
844
|
-
else {
|
|
845
|
-
this.errors.remove("AUTO_scale");
|
|
846
|
-
}
|
|
847
|
-
// Update state so bar charts re-render at the new scale
|
|
848
|
-
if (Math.abs(computedFactor - this.appliedScaleFactor) > 0.001) {
|
|
849
|
-
this._autoScaleGuard = true;
|
|
850
|
-
this.appliedScaleFactor = computedFactor;
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
prepareDataFormat() {
|
|
854
|
-
var _a;
|
|
855
|
-
return Order.DataFormat[(_a = this.dataFormat) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
856
|
-
}
|
|
857
|
-
prepareGrouped() {
|
|
858
|
-
return this.grouped === "true";
|
|
859
|
-
}
|
|
860
|
-
prepareShowGroupTitle() {
|
|
861
|
-
return this.showGroupTitle === "true";
|
|
862
|
-
}
|
|
863
|
-
prepareTableType() {
|
|
864
|
-
var _a;
|
|
865
|
-
return TableType[(_a = this.type) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
866
|
-
}
|
|
867
|
-
prepareLimit() {
|
|
868
|
-
return Math.floor(Number(this.limit) || 0);
|
|
869
|
-
}
|
|
870
|
-
prepareThereOf() {
|
|
871
|
-
if (this.thereof == null || this.thereof.trim() === "") {
|
|
872
|
-
return [];
|
|
873
|
-
}
|
|
874
|
-
return JSON.parse(this.thereof);
|
|
875
|
-
}
|
|
876
|
-
preparePartOf() {
|
|
877
|
-
if (this.partof == null || this.partof.trim() === "") {
|
|
878
|
-
return [];
|
|
879
|
-
}
|
|
880
|
-
return JSON.parse(this.partof);
|
|
881
|
-
}
|
|
882
|
-
prepareOrder() {
|
|
883
|
-
var _a, _b, _c;
|
|
884
|
-
const isAuto = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
885
|
-
let orderStr = this.order;
|
|
886
|
-
if (isAuto && ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedOrder)) {
|
|
887
|
-
orderStr = this.datasetMeta.suggestedOrder;
|
|
888
|
-
}
|
|
889
|
-
const tableOrder = {
|
|
890
|
-
hierarchy: orderStr.split(",").map((entry) => Order.OrderColumn[entry === null || entry === void 0 ? void 0 : entry.toUpperCase()]),
|
|
891
|
-
direction: Order.OrderDirection[(_c = this.orderDirection) === null || _c === void 0 ? void 0 : _c.toUpperCase()],
|
|
892
|
-
};
|
|
893
|
-
return tableOrder;
|
|
894
|
-
}
|
|
895
|
-
prepareI18nMode() {
|
|
896
|
-
return Order.I18nMode.META;
|
|
897
|
-
}
|
|
898
|
-
prepareI18n() {
|
|
899
|
-
const i18nMetaLabelsLocal = ["in", "category", "operation", "there_of", "part_of", "SUM_TOTAL"];
|
|
900
|
-
const i18nMetaLabelsGlobal = contextProtocol.globalLabelKeys;
|
|
901
|
-
// system
|
|
902
|
-
const i18nMapLocal = new Map(i18nMetaLabelsLocal.map((key) => [key, this.t(".".concat(key))]));
|
|
903
|
-
const i18nMapGlobal = new Map(i18nMetaLabelsGlobal.map((key) => [key, this.t("global.".concat(key))]));
|
|
904
|
-
return new Map([...i18nMapGlobal.entries(), ...i18nMapLocal.entries()]);
|
|
905
|
-
}
|
|
906
|
-
prepareDataFormatDigits() {
|
|
907
|
-
const formatDigits = {
|
|
908
|
-
percent: this.dataFormatDigitsPercent,
|
|
909
|
-
decimal: this.dataFormatDigitsDecimal,
|
|
910
|
-
};
|
|
911
|
-
return formatDigits;
|
|
912
|
-
}
|
|
913
|
-
prepareScenarios() {
|
|
914
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
915
|
-
const isAuto = ((_a = this.scenarios) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
916
|
-
if ((withStyled.isBlankInput(this.scenarios) || isAuto) && withStyled.isBlankInput(this.variances)) {
|
|
917
|
-
if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
918
|
-
if (!isAuto) {
|
|
919
|
-
this.errors.addOrReplace({
|
|
920
|
-
id: "AUTO_scenarios",
|
|
921
|
-
type: "warning",
|
|
922
|
-
message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
else {
|
|
926
|
-
this.errors.remove("AUTO_scenarios");
|
|
927
|
-
}
|
|
928
|
-
return this.datasetMeta.availableScenarios;
|
|
929
|
-
}
|
|
930
|
-
return [];
|
|
931
|
-
}
|
|
932
|
-
let scenarios = [];
|
|
933
|
-
if (isAuto || withStyled.isBlankInput(this.scenarios)) {
|
|
934
|
-
if (((_e = (_d = this.datasetMeta) === null || _d === void 0 ? void 0 : _d.availableScenarios) === null || _e === void 0 ? void 0 : _e.length) > 0) {
|
|
935
|
-
if (!isAuto) {
|
|
936
|
-
this.errors.addOrReplace({
|
|
937
|
-
id: "AUTO_scenarios",
|
|
938
|
-
type: "warning",
|
|
939
|
-
message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
|
|
940
|
-
});
|
|
941
|
-
}
|
|
942
|
-
else {
|
|
943
|
-
this.errors.remove("AUTO_scenarios");
|
|
944
|
-
}
|
|
945
|
-
scenarios = scenarios.concat(this.datasetMeta.availableScenarios);
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
else {
|
|
949
|
-
this.errors.remove("AUTO_scenarios");
|
|
950
|
-
scenarios = scenarios.concat((_f = this.scenarios) === null || _f === void 0 ? void 0 : _f.split(","));
|
|
951
|
-
}
|
|
952
|
-
if (((_g = this.variances) === null || _g === void 0 ? void 0 : _g.trim().length) > 0) {
|
|
953
|
-
scenarios = scenarios.concat((_h = this.variances) === null || _h === void 0 ? void 0 : _h.split(","));
|
|
954
|
-
}
|
|
955
|
-
return scenarios.map((entry) => entry.trim());
|
|
956
|
-
}
|
|
957
|
-
prepareCategoryWidth() {
|
|
958
|
-
var _a;
|
|
959
|
-
if (withStyled.isBlankInput(this.categoryWidth)) {
|
|
960
|
-
return Order.TableCategoryWidth.INF;
|
|
961
|
-
}
|
|
962
|
-
return Order.TableCategoryWidth[(_a = this.categoryWidth) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
963
|
-
}
|
|
964
|
-
prepareMeasureScale() {
|
|
965
|
-
if (withStyled.isBlankInput(this.measureScale)) {
|
|
966
|
-
return "GREATEST";
|
|
967
|
-
}
|
|
968
|
-
if (["_", "k", "M", "G", "T", "P", "E", "Z", "Y", "m", "μ", "n", "p", "P", "f", "a", "z", "y"].includes(this.measureScale.trim())) {
|
|
969
|
-
return this.measureScale.trim();
|
|
970
|
-
}
|
|
971
|
-
if (this.measureScale.trim().toUpperCase() === "LEAST") {
|
|
972
|
-
return this.measureScale.trim();
|
|
973
|
-
}
|
|
974
|
-
return "GREATEST";
|
|
975
|
-
}
|
|
976
|
-
prepareMeasureType() {
|
|
977
|
-
var _a;
|
|
978
|
-
if (withStyled.isBlankInput(this.measureType)) {
|
|
979
|
-
return Order.MeasureType.VOLUME;
|
|
980
|
-
}
|
|
981
|
-
return Order.MeasureType[(_a = this.measureType) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
982
|
-
}
|
|
983
|
-
prepareColumnThereOf() {
|
|
984
|
-
if (this.columnthereof == null || this.columnthereof.trim() === "") {
|
|
985
|
-
return new Map();
|
|
986
|
-
}
|
|
987
|
-
const parsedString = JSON.parse(this.columnthereof);
|
|
988
|
-
const map = new Map();
|
|
989
|
-
for (const [_key, value] of Object.entries(parsedString)) {
|
|
990
|
-
if (map.has(value["scenario"]) === false) {
|
|
991
|
-
map.set(value["scenario"], []);
|
|
992
|
-
}
|
|
993
|
-
map.get(value["scenario"]).push(value);
|
|
994
|
-
}
|
|
995
|
-
return map;
|
|
996
|
-
}
|
|
997
|
-
prepareTableTitle() {
|
|
998
|
-
if (this.tableTitle === "" || this.tableTitle == null) {
|
|
999
|
-
return "SUM_TOTAL";
|
|
1000
|
-
}
|
|
1001
|
-
return this.tableTitle;
|
|
1002
|
-
}
|
|
1003
|
-
prepareShowMeasureScale() {
|
|
1004
|
-
return this.showMeasureScale === "true";
|
|
1005
|
-
}
|
|
1006
|
-
prepareMeasureUnit() {
|
|
1007
|
-
if (this.measureUnit === "" || this.measureUnit == null) {
|
|
1008
|
-
return "";
|
|
1009
|
-
}
|
|
1010
|
-
return this.measureUnit;
|
|
1011
|
-
}
|
|
1012
|
-
prepareFilter() {
|
|
1013
|
-
if (this.filter.length === 0) {
|
|
1014
|
-
return "";
|
|
1015
|
-
}
|
|
1016
|
-
return this.filter;
|
|
1017
|
-
}
|
|
1018
|
-
prepareBarColumns() {
|
|
1019
|
-
if (withStyled.isBlankInput(this.barColumns)) {
|
|
1020
|
-
return [];
|
|
1021
|
-
}
|
|
1022
|
-
return this.barColumns.split(",").map((col) => col.trim());
|
|
1023
|
-
}
|
|
1024
|
-
prepareUnitScaling() {
|
|
1025
|
-
if (this.pixelPerUnitGroupMap.has(this.unitScaling)) {
|
|
1026
|
-
return this.pixelPerUnitGroupMap.get(this.unitScaling);
|
|
1027
|
-
}
|
|
1028
|
-
return Number(this.unitScaling);
|
|
1029
|
-
}
|
|
1030
|
-
preparePercentageScaling() {
|
|
1031
|
-
if (this.pixelPerUnitGroupMap.has(this.percentageScaling)) {
|
|
1032
|
-
return this.pixelPerUnitGroupMap.get(this.percentageScaling);
|
|
1033
|
-
}
|
|
1034
|
-
return Number(this.percentageScaling);
|
|
1035
|
-
}
|
|
1036
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1037
|
-
getDataStructure() {
|
|
1038
|
-
const dataSetStructure = {
|
|
1039
|
-
ITableDataRow: {
|
|
1040
|
-
setName: { type: "string", isOptional: false, description: "" },
|
|
1041
|
-
date: { type: "string", isOptional: false, description: "" },
|
|
1042
|
-
operation: { type: "string", isOptional: false, description: "" },
|
|
1043
|
-
rowGroup: { type: "string", isOptional: false, description: "" },
|
|
1044
|
-
rowGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
1045
|
-
category: { type: "string", isOptional: false, description: "" },
|
|
1046
|
-
categoryIndex: { type: "number", isOptional: false, description: "" },
|
|
1047
|
-
subCategory: { type: "string", isOptional: false, description: "" },
|
|
1048
|
-
subCategoryIndex: { type: "number", isOptional: false, description: "" },
|
|
1049
|
-
columnGroup: { type: "string", isOptional: false, description: "" },
|
|
1050
|
-
columnGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
1051
|
-
columnSubGroup: { type: "string", isOptional: false, description: "" },
|
|
1052
|
-
columnSubGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
1053
|
-
ac1: { type: "number", isOptional: false, description: "" },
|
|
1054
|
-
ac2: { type: "number", isOptional: false, description: "" },
|
|
1055
|
-
ac3: { type: "number", isOptional: false, description: "" },
|
|
1056
|
-
ac4: { type: "number", isOptional: false, description: "" },
|
|
1057
|
-
pp1: { type: "number", isOptional: false, description: "" },
|
|
1058
|
-
pp2: { type: "number", isOptional: false, description: "" },
|
|
1059
|
-
pp3: { type: "number", isOptional: false, description: "" },
|
|
1060
|
-
pp4: { type: "number", isOptional: false, description: "" },
|
|
1061
|
-
fc1: { type: "number", isOptional: false, description: "" },
|
|
1062
|
-
fc2: { type: "number", isOptional: false, description: "" },
|
|
1063
|
-
fc3: { type: "number", isOptional: false, description: "" },
|
|
1064
|
-
fc4: { type: "number", isOptional: false, description: "" },
|
|
1065
|
-
pl1: { type: "number", isOptional: false, description: "" },
|
|
1066
|
-
pl2: { type: "number", isOptional: false, description: "" },
|
|
1067
|
-
pl3: { type: "number", isOptional: false, description: "" },
|
|
1068
|
-
pl4: { type: "number", isOptional: false, description: "" },
|
|
1069
|
-
},
|
|
1070
|
-
};
|
|
1071
|
-
return dataSetStructure;
|
|
1072
|
-
}
|
|
1073
|
-
getEffectiveScaleFactor() {
|
|
1074
|
-
const { mode, factor } = scaling.parseScaling(this.scale);
|
|
1075
|
-
if (mode === "factor")
|
|
1076
|
-
return factor;
|
|
1077
|
-
if (mode === "auto" || mode === "empty")
|
|
1078
|
-
return this.appliedScaleFactor;
|
|
1079
|
-
return 1;
|
|
1080
|
-
}
|
|
1081
|
-
getFontStyles() {
|
|
1082
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
1083
|
-
return this.componentStyle(($) => {
|
|
1084
|
-
var _a, _b, _c, _d;
|
|
1085
|
-
const baseFontSize = ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333;
|
|
1086
|
-
return {
|
|
1087
|
-
"--bn-font-family": ((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
1088
|
-
"--bn-font-size": `${baseFontSize * effectiveFactor}px`,
|
|
1089
|
-
"--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
|
|
1090
|
-
"--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
|
|
1091
|
-
};
|
|
1092
|
-
});
|
|
1093
|
-
}
|
|
1094
|
-
render() {
|
|
1095
|
-
const fontStyles = this.getFontStyles();
|
|
1096
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
1097
|
-
return (index.h(index.Host, { key: '5434656c0626dc8aceea109e4f6ab795443a7c7b', style: fontStyles }, index.h("div", { key: 'a3d90ae3bce33b025bac95cc486aba1778907762' }, index.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 }))));
|
|
1098
|
-
}
|
|
1099
|
-
get element() { return index.getElement(this); }
|
|
1100
|
-
static get watchers() { return {
|
|
1101
|
-
"scale": [{
|
|
1102
|
-
"validateScaling": 0
|
|
1103
|
-
}],
|
|
1104
|
-
"scenarios": [{
|
|
1105
|
-
"validateScenario": 0
|
|
1106
|
-
}],
|
|
1107
|
-
"variances": [{
|
|
1108
|
-
"validateVariances": 0
|
|
1109
|
-
}],
|
|
1110
|
-
"barColumns": [{
|
|
1111
|
-
"validateBarColumns": 0
|
|
1112
|
-
}],
|
|
1113
|
-
"unitScaling": [{
|
|
1114
|
-
"validateUnitScaling": 0
|
|
1115
|
-
}],
|
|
1116
|
-
"percentageScaling": [{
|
|
1117
|
-
"validatePercentageScaling": 0
|
|
1118
|
-
}],
|
|
1119
|
-
"dataFormat": [{
|
|
1120
|
-
"validateDataFormat": 0
|
|
1121
|
-
}],
|
|
1122
|
-
"grouped": [{
|
|
1123
|
-
"validateGrouped": 0
|
|
1124
|
-
}],
|
|
1125
|
-
"showMeasureScale": [{
|
|
1126
|
-
"validateShowMeasureScale": 0
|
|
1127
|
-
}],
|
|
1128
|
-
"showGroupTitle": [{
|
|
1129
|
-
"validateShowGroupTitle": 0
|
|
1130
|
-
}],
|
|
1131
|
-
"type": [{
|
|
1132
|
-
"validateType": 0
|
|
1133
|
-
}],
|
|
1134
|
-
"limit": [{
|
|
1135
|
-
"validateLimit": 0
|
|
1136
|
-
}],
|
|
1137
|
-
"thereof": [{
|
|
1138
|
-
"validateThereOf": 0
|
|
1139
|
-
}],
|
|
1140
|
-
"partof": [{
|
|
1141
|
-
"validatePartOf": 0
|
|
1142
|
-
}],
|
|
1143
|
-
"order": [{
|
|
1144
|
-
"validateOrderList": 0
|
|
1145
|
-
}],
|
|
1146
|
-
"orderDirection": [{
|
|
1147
|
-
"validateOrderDirection": 0
|
|
1148
|
-
}],
|
|
1149
|
-
"measureType": [{
|
|
1150
|
-
"validateMeasureType": 0
|
|
1151
|
-
}],
|
|
1152
|
-
"measureScale": [{
|
|
1153
|
-
"validateMeasureScale": 0
|
|
1154
|
-
}],
|
|
1155
|
-
"dataFormatDigitsDecimal": [{
|
|
1156
|
-
"validateDataFormatDigitsDecimal": 0
|
|
1157
|
-
}],
|
|
1158
|
-
"dataFormatDigitsPercent": [{
|
|
1159
|
-
"validateDateFormatDigitsPercent": 0
|
|
1160
|
-
}],
|
|
1161
|
-
"categoryWidth": [{
|
|
1162
|
-
"validateCategoryWidth": 0
|
|
1163
|
-
}],
|
|
1164
|
-
"columnthereof": [{
|
|
1165
|
-
"validateColumnThereOf": 0
|
|
1166
|
-
}]
|
|
1167
|
-
}; }
|
|
1168
|
-
};
|
|
1169
|
-
Table$1.style = bnTableCss();
|
|
12
|
+
require('./context-protocol-DRQWrwsA.js');
|
|
13
|
+
require('./utils-CwHIVbbL.js');
|
|
1170
14
|
|
|
1171
15
|
// import {Formatter} from "../../../../utils/formatter";
|
|
1172
16
|
// import {DataFormatDigits} from "../../../../utils/model/DataFormatDigits";
|
|
@@ -1260,22 +104,22 @@ class TableRow {
|
|
|
1260
104
|
}
|
|
1261
105
|
initCssStyle() {
|
|
1262
106
|
switch (this.type) {
|
|
1263
|
-
case TableRowType.HEADER: {
|
|
107
|
+
case index.TableRowType.HEADER: {
|
|
1264
108
|
return "groupheader";
|
|
1265
109
|
}
|
|
1266
|
-
case TableRowType.SEPERATORLINE: {
|
|
110
|
+
case index.TableRowType.SEPERATORLINE: {
|
|
1267
111
|
return "";
|
|
1268
112
|
}
|
|
1269
|
-
case TableRowType.DRILLELEMENT: {
|
|
113
|
+
case index.TableRowType.DRILLELEMENT: {
|
|
1270
114
|
return "ofit";
|
|
1271
115
|
}
|
|
1272
|
-
case TableRowType.PARTELEMENT: {
|
|
116
|
+
case index.TableRowType.PARTELEMENT: {
|
|
1273
117
|
return "partof";
|
|
1274
118
|
}
|
|
1275
|
-
case TableRowType.STANDARD: {
|
|
119
|
+
case index.TableRowType.STANDARD: {
|
|
1276
120
|
return "";
|
|
1277
121
|
}
|
|
1278
|
-
case TableRowType.SUM: {
|
|
122
|
+
case index.TableRowType.SUM: {
|
|
1279
123
|
return "sum";
|
|
1280
124
|
}
|
|
1281
125
|
default: {
|
|
@@ -1291,13 +135,13 @@ class TableRow {
|
|
|
1291
135
|
if (scenario === "category" && categoryWidth != null) {
|
|
1292
136
|
cssStyle = `category-${categoryWidth.toString()}`;
|
|
1293
137
|
}
|
|
1294
|
-
if (this.type === TableRowType.HEADER) {
|
|
138
|
+
if (this.type === index.TableRowType.HEADER) {
|
|
1295
139
|
cssStyle = "headerlabel";
|
|
1296
140
|
}
|
|
1297
|
-
else if (this.type === TableRowType.SEPERATORLINE) {
|
|
141
|
+
else if (this.type === index.TableRowType.SEPERATORLINE) {
|
|
1298
142
|
cssStyle = scenario;
|
|
1299
143
|
}
|
|
1300
|
-
if (this.type === TableRowType.PARTELEMENT) {
|
|
144
|
+
if (this.type === index.TableRowType.PARTELEMENT) {
|
|
1301
145
|
if (cellType === "percent") {
|
|
1302
146
|
value = "-";
|
|
1303
147
|
}
|
|
@@ -1313,7 +157,9 @@ class TableRow {
|
|
|
1313
157
|
if (isSecondaryElement) {
|
|
1314
158
|
prefixStyle = "prefix-second";
|
|
1315
159
|
}
|
|
1316
|
-
|
|
160
|
+
if (columnType) {
|
|
161
|
+
cssStyle = `${cssStyle} ${columnType}`;
|
|
162
|
+
}
|
|
1317
163
|
const cell = new Cell(scenario, this.elements.length, value, cssStyle, cellType, prefix, prefixStyle, 1, measureScale);
|
|
1318
164
|
cell.isBarChart = isBarChart;
|
|
1319
165
|
cell.columnStats = columnStats;
|
|
@@ -1357,7 +203,7 @@ const PatternDefs = ({ styles }) => {
|
|
|
1357
203
|
{ id: getPatternId("neg", styles.negative.stroke), stroke: styles.negative.stroke, fill: styles.negative.fill },
|
|
1358
204
|
{ id: getPatternId("neu", styles.neutral.stroke), stroke: styles.neutral.stroke, fill: styles.neutral.fill },
|
|
1359
205
|
];
|
|
1360
|
-
return (index.h("defs", null, patterns.map((p) => (index.h("pattern", { id: p.id, patternUnits: "userSpaceOnUse", width: patternSize, height: patternSize }, index.h("rect", { width: patternSize, height: patternSize, fill: "#ffffff" }), index.h("line", { x1: "0", y1: patternSize, x2: patternSize, y2: "0", stroke: p.stroke, "stroke-width": 1.5 * s }))))));
|
|
206
|
+
return (index$1.h("defs", null, patterns.map((p) => (index$1.h("pattern", { id: p.id, patternUnits: "userSpaceOnUse", width: patternSize, height: patternSize }, index$1.h("rect", { width: patternSize, height: patternSize, fill: "#ffffff" }), index$1.h("line", { x1: "0", y1: patternSize, x2: patternSize, y2: "0", stroke: p.stroke, "stroke-width": 1.5 * s }))))));
|
|
1361
207
|
};
|
|
1362
208
|
/**
|
|
1363
209
|
* Formats a number for display with appropriate SI prefix.
|
|
@@ -1472,34 +318,74 @@ function getBarStroke(varianceStyle) {
|
|
|
1472
318
|
// Solid and hatched bars don't need visible stroke
|
|
1473
319
|
return { stroke: "none", strokeWidth: 0 };
|
|
1474
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Renders a zigzag break indicator at a given x position, matching the structure chart style.
|
|
323
|
+
* Two mirrored zigzag lines with a white background covering the break gap.
|
|
324
|
+
*/
|
|
325
|
+
function renderZigzagBreak(breakX, breakGap, yTop, barHeight, s) {
|
|
326
|
+
const midX = breakX + breakGap / 2;
|
|
327
|
+
const halfGap = breakGap * 0.35;
|
|
328
|
+
const zigCount = 3;
|
|
329
|
+
const segHeight = barHeight / zigCount;
|
|
330
|
+
const amplitude = breakGap * 0.3;
|
|
331
|
+
let leftPath = `M ${midX - halfGap} ${yTop}`;
|
|
332
|
+
for (let i = 0; i < zigCount; i++) {
|
|
333
|
+
const y1 = yTop + segHeight * (i + 0.5);
|
|
334
|
+
const y2 = yTop + segHeight * (i + 1);
|
|
335
|
+
leftPath += ` L ${midX - halfGap - amplitude} ${y1} L ${midX - halfGap} ${y2}`;
|
|
336
|
+
}
|
|
337
|
+
let rightPath = `M ${midX + halfGap} ${yTop}`;
|
|
338
|
+
for (let i = 0; i < zigCount; i++) {
|
|
339
|
+
const y1 = yTop + segHeight * (i + 0.5);
|
|
340
|
+
const y2 = yTop + segHeight * (i + 1);
|
|
341
|
+
rightPath += ` L ${midX + halfGap + amplitude} ${y1} L ${midX + halfGap} ${y2}`;
|
|
342
|
+
}
|
|
343
|
+
return [
|
|
344
|
+
index$1.h("rect", { x: breakX, y: yTop - 1, width: breakGap, height: barHeight + 2, fill: "#ffffff" }),
|
|
345
|
+
index$1.h("path", { d: leftPath, fill: "none", stroke: "#000000", "stroke-width": 1 * s }),
|
|
346
|
+
index$1.h("path", { d: rightPath, fill: "none", stroke: "#000000", "stroke-width": 1 * s }),
|
|
347
|
+
];
|
|
348
|
+
}
|
|
1475
349
|
/**
|
|
1476
350
|
* Renders an absolute variance bar chart (d_ prefix).
|
|
1477
351
|
* Horizontal bar with centered axis, green for positive, red for negative.
|
|
1478
|
-
*
|
|
352
|
+
* When a bar exceeds maxBarWidth it is drawn as an overdrive bar:
|
|
353
|
+
* base segment + zigzag break + proportional overdrive stub (like structure chart).
|
|
1479
354
|
*
|
|
1480
355
|
* Layout: [left label area][bar area with axis][right label area]
|
|
1481
|
-
* Uses unitScaling to determine bar width (pixels per unit of measure).
|
|
1482
356
|
*/
|
|
1483
357
|
const AbsoluteVarianceBar = (props) => {
|
|
1484
|
-
const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
|
|
358
|
+
const { value, scenario, columnStats, height, isPositiveGood, formattedValue, measureScale, maxBarWidth: maxBarWidthEm = 10, styles = DEFAULT_STYLES, } = props;
|
|
1485
359
|
const s = styles.scaleFactor;
|
|
1486
|
-
const
|
|
1487
|
-
const
|
|
1488
|
-
const
|
|
1489
|
-
|
|
360
|
+
const fs = styles.fontSize;
|
|
361
|
+
const labelAreaWidth = 38 * s;
|
|
362
|
+
const maxBarWidth = maxBarWidthEm * fs;
|
|
363
|
+
// Overdrive layout constants
|
|
364
|
+
const breakGap = 4 * s;
|
|
365
|
+
const overdriveZoneWidth = maxBarWidth * 0.15;
|
|
366
|
+
const cutWidth = maxBarWidth - breakGap - overdriveZoneWidth;
|
|
367
|
+
// Direct unit scaling via fontSize
|
|
368
|
+
const scaledWidth = Math.abs(value) * styles.unitScaling * fs;
|
|
369
|
+
const isExtreme = scaledWidth > cutWidth;
|
|
370
|
+
// Compute proportional overdrive width across the column
|
|
371
|
+
const maxScaledWidth = columnStats.absMax * styles.unitScaling * fs;
|
|
372
|
+
const maxOverflow = Math.max(0, maxScaledWidth - cutWidth);
|
|
373
|
+
const overflowAmount = Math.max(0, scaledWidth - cutWidth);
|
|
374
|
+
const overdriveWidth = maxOverflow > 0 ? (overflowAmount / maxOverflow) * overdriveZoneWidth : 0;
|
|
375
|
+
// Adaptive axis placement based on data range
|
|
376
|
+
const hasNeg = columnStats.min < 0;
|
|
377
|
+
const hasPos = columnStats.max > 0;
|
|
378
|
+
const negBarWidth = hasNeg ? maxBarWidth : 0;
|
|
379
|
+
const posBarWidth = hasPos ? maxBarWidth : 0;
|
|
380
|
+
const barAreaWidth = negBarWidth + posBarWidth;
|
|
381
|
+
const totalWidth = (hasNeg ? labelAreaWidth : 0) + barAreaWidth + (hasPos ? labelAreaWidth : 0);
|
|
1490
382
|
const padding = 2 * s;
|
|
1491
383
|
const barHeight = height - padding * 2;
|
|
1492
|
-
const axisX =
|
|
1493
|
-
// Calculate bar width using unitScaling (pixels per unit)
|
|
1494
|
-
// Clamp to maxBarWidth to prevent overflow
|
|
1495
|
-
const scaledWidth = Math.abs(value) * styles.unitScaling * s;
|
|
1496
|
-
const barWidth = Math.min(scaledWidth, maxBarWidth);
|
|
1497
|
-
const isPositive = value >= 0;
|
|
1498
|
-
const barX = isPositive ? axisX : axisX - barWidth;
|
|
384
|
+
const axisX = (hasNeg ? labelAreaWidth : 0) + negBarWidth;
|
|
1499
385
|
const barY = padding;
|
|
386
|
+
const isPositive = value >= 0;
|
|
1500
387
|
// Get style based on column type (scenario vs variance)
|
|
1501
388
|
const barStyle = getBarStyle(scenario, value, isPositiveGood, styles);
|
|
1502
|
-
// Pattern prefix for scenarios uses scenario type, for variances uses pos/neg
|
|
1503
389
|
const patternPrefix = isScenarioColumn(scenario)
|
|
1504
390
|
? getScenarioType(scenario)
|
|
1505
391
|
: isPositiveGood
|
|
@@ -1512,12 +398,14 @@ const AbsoluteVarianceBar = (props) => {
|
|
|
1512
398
|
const fillValue = getBarFill(barStyle, patternPrefix);
|
|
1513
399
|
const { stroke: barStroke, strokeWidth: barStrokeWidth } = getBarStroke(barStyle);
|
|
1514
400
|
const displayValue = formattedValue || formatValue(value, false, measureScale);
|
|
1515
|
-
//
|
|
1516
|
-
|
|
1517
|
-
//
|
|
1518
|
-
const
|
|
401
|
+
// Normal bar width (clamped to cutWidth when extreme)
|
|
402
|
+
const baseBarWidth = isExtreme ? cutWidth : scaledWidth;
|
|
403
|
+
// Label position accounts for overdrive
|
|
404
|
+
const totalVisualWidth = isExtreme ? cutWidth + breakGap + overdriveWidth : scaledWidth;
|
|
405
|
+
const labelX = isPositive ? axisX + totalVisualWidth + 4 * s : axisX - totalVisualWidth - 4 * s;
|
|
1519
406
|
const labelAnchor = isPositive ? "start" : "end";
|
|
1520
|
-
return (index.h("svg", { width: totalWidth, height: height, class: "cell-bar-chart absolute-variance", style: { overflow: "visible" } }, index.h(PatternDefs, { styles: styles }), index.h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }),
|
|
407
|
+
return (index$1.h("svg", { width: totalWidth, height: height, class: "cell-bar-chart absolute-variance", style: { overflow: "visible" } }, index$1.h(PatternDefs, { styles: styles }), index$1.h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), baseBarWidth > 0 && (index$1.h("rect", { x: isPositive ? axisX : axisX - baseBarWidth, y: barY, width: baseBarWidth, height: barHeight, fill: fillValue, stroke: barStroke, "stroke-width": barStrokeWidth * s })), isExtreme && overdriveWidth > 0 && (index$1.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 &&
|
|
408
|
+
renderZigzagBreak(isPositive ? axisX + cutWidth : axisX - cutWidth - breakGap, breakGap, barY, barHeight, s), index$1.h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": labelAnchor, fill: styles.fontColor, "font-size": fs, "font-family": styles.fontFamily }, displayValue)));
|
|
1521
409
|
};
|
|
1522
410
|
/**
|
|
1523
411
|
* Renders a relative variance pin chart (dr_ prefix).
|
|
@@ -1527,30 +415,36 @@ const AbsoluteVarianceBar = (props) => {
|
|
|
1527
415
|
* Uses percentageScaling to determine pin length (pixels per percentage point).
|
|
1528
416
|
*/
|
|
1529
417
|
const RelativeVariancePin = (props) => {
|
|
1530
|
-
const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
|
|
418
|
+
const { value, scenario, columnStats, height, isPositiveGood, formattedValue, measureScale, maxBarWidth: maxBarWidthEm = 10, styles = DEFAULT_STYLES, } = props;
|
|
1531
419
|
const s = styles.scaleFactor;
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1534
|
-
const
|
|
420
|
+
const fs = styles.fontSize;
|
|
421
|
+
// Pin length is ~2/3 of bar width for visual balance
|
|
422
|
+
const maxPinLength = Math.round(maxBarWidthEm * 0.67 * fs);
|
|
423
|
+
const pinPadding = 5 * s;
|
|
424
|
+
// Adaptive axis placement based on data range
|
|
425
|
+
const hasNeg = columnStats.min < 0;
|
|
426
|
+
const hasPos = columnStats.max > 0;
|
|
427
|
+
const negPinWidth = hasNeg ? maxPinLength + pinPadding : 0;
|
|
428
|
+
const posPinWidth = hasPos ? maxPinLength + pinPadding : 0;
|
|
429
|
+
const pinAreaWidth = negPinWidth + posPinWidth;
|
|
430
|
+
const labelAreaWidth = 45 * s;
|
|
1535
431
|
const totalWidth = pinAreaWidth + labelAreaWidth;
|
|
1536
|
-
const axisX =
|
|
432
|
+
const axisX = negPinWidth;
|
|
1537
433
|
const centerY = height / 2;
|
|
1538
|
-
//
|
|
1539
|
-
// Value is in decimal form (e.g., 0.5 = 50%), multiply by 100 to get percentage
|
|
434
|
+
// Direct unit scaling via fontSize
|
|
1540
435
|
const percentValue = Math.abs(value) * 100;
|
|
1541
|
-
const scaledLength = percentValue * styles.percentageScaling *
|
|
436
|
+
const scaledLength = percentValue * styles.percentageScaling * fs;
|
|
437
|
+
const isExtreme = scaledLength > maxPinLength;
|
|
1542
438
|
const pinLength = Math.min(scaledLength, maxPinLength);
|
|
1543
439
|
const isPositive = value >= 0;
|
|
1544
440
|
const pinEndX = isPositive ? axisX + pinLength : axisX - pinLength;
|
|
1545
441
|
// Get style based on column type (scenario vs variance)
|
|
1546
442
|
const barStyle = getBarStyle(scenario, value, isPositiveGood, styles);
|
|
1547
443
|
const dotRadius = 3 * s;
|
|
1548
|
-
// Show arrow for extreme values (when pin would exceed max length)
|
|
1549
|
-
const isExtreme = scaledLength > maxPinLength;
|
|
1550
444
|
const displayValue = formattedValue || formatValue(value, true, measureScale);
|
|
1551
445
|
// Label always on the right side after the pin area
|
|
1552
446
|
const labelX = pinAreaWidth + 4 * s;
|
|
1553
|
-
return (index.h("svg", { width: totalWidth, height: height, class: "cell-bar-chart relative-variance", style: { overflow: "visible" } }, index.h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), !isExtreme && index.h("circle", { cx: pinEndX, cy: centerY, r: dotRadius, fill: styles.fontColor }), index.h("line", { x1: axisX, y1: centerY, x2: pinEndX, y2: centerY, stroke: barStyle.fill, "stroke-width": 2 * s }), isExtreme && isPositive && (index.h("polygon", { points: `${
|
|
447
|
+
return (index$1.h("svg", { width: totalWidth, height: height, class: "cell-bar-chart relative-variance", style: { overflow: "visible" } }, index$1.h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), !isExtreme && index$1.h("circle", { cx: pinEndX, cy: centerY, r: dotRadius, fill: styles.fontColor }), index$1.h("line", { x1: axisX, y1: centerY, x2: pinEndX, y2: centerY, stroke: barStyle.fill, "stroke-width": 2 * s }), isExtreme && isPositive && (index$1.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 && (index$1.h("polygon", { points: `${axisX - maxPinLength},${centerY} ${axisX - maxPinLength + 6 * s},${centerY - 3 * s} ${axisX - maxPinLength + 6 * s},${centerY + 3 * s}`, fill: barStyle.fill })), index$1.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)));
|
|
1554
448
|
};
|
|
1555
449
|
/**
|
|
1556
450
|
* CellBarChart - Renders IBCS-compliant variance bar charts.
|
|
@@ -1564,12 +458,12 @@ const CellBarChart = (props) => {
|
|
|
1564
458
|
const { value, columnStats, isRelative, styles = DEFAULT_STYLES } = props;
|
|
1565
459
|
// Handle invalid values
|
|
1566
460
|
if (value === null || value === undefined || isNaN(value) || !columnStats || columnStats.absMax === 0) {
|
|
1567
|
-
return (index.h("span", { class: "bar-chart-empty", style: { color: styles.fontColor, fontStyle: "italic" } }, "-"));
|
|
461
|
+
return (index$1.h("span", { class: "bar-chart-empty", style: { color: styles.fontColor, fontStyle: "italic" } }, "-"));
|
|
1568
462
|
}
|
|
1569
463
|
if (isRelative) {
|
|
1570
|
-
return index.h(RelativeVariancePin, Object.assign({}, props));
|
|
464
|
+
return index$1.h(RelativeVariancePin, Object.assign({}, props));
|
|
1571
465
|
}
|
|
1572
|
-
return index.h(AbsoluteVarianceBar, Object.assign({}, props));
|
|
466
|
+
return index$1.h(AbsoluteVarianceBar, Object.assign({}, props));
|
|
1573
467
|
};
|
|
1574
468
|
|
|
1575
469
|
/**
|
|
@@ -1589,7 +483,7 @@ class QueryGroups {
|
|
|
1589
483
|
return a === "-" ? -1 : 1;
|
|
1590
484
|
};
|
|
1591
485
|
this.groups = [formatter.QueryColumnNames.CATEGORY, formatter.QueryColumnNames.CATEGORYINDEX];
|
|
1592
|
-
if (TableType.OPT === config.type || TableType.OPTNOTOTAL === config.type) {
|
|
486
|
+
if (index.TableType.OPT === config.type || index.TableType.OPTNOTOTAL === config.type) {
|
|
1593
487
|
this.groups.unshift(formatter.QueryColumnNames.OPERATION);
|
|
1594
488
|
}
|
|
1595
489
|
if (config.grouped) {
|
|
@@ -1736,7 +630,7 @@ class DataQuery {
|
|
|
1736
630
|
createPartOfDrillRows(scenarios, order, sumGroupQueries, data, res) {
|
|
1737
631
|
if (this.config.partOf == null ||
|
|
1738
632
|
this.config.partOf.length === 0 ||
|
|
1739
|
-
this.config.type === TableType.LIST ||
|
|
633
|
+
this.config.type === index.TableType.LIST ||
|
|
1740
634
|
data == null ||
|
|
1741
635
|
data.length === 0) {
|
|
1742
636
|
return;
|
|
@@ -1814,10 +708,10 @@ class DataQuery {
|
|
|
1814
708
|
createGroupSumRow(querys, groupSumQuery, rowGroupEntry, scenariosSUMQuery, order) {
|
|
1815
709
|
// Generates SUM Row; sumsup all rows of group
|
|
1816
710
|
if (true === this.config.grouped &&
|
|
1817
|
-
(TableType.SUM === this.config.type ||
|
|
1818
|
-
TableType.SUMNOTOTAL === this.config.type ||
|
|
1819
|
-
TableType.OPT === this.config.type ||
|
|
1820
|
-
TableType.OPTNOTOTAL === this.config.type)) {
|
|
711
|
+
(index.TableType.SUM === this.config.type ||
|
|
712
|
+
index.TableType.SUMNOTOTAL === this.config.type ||
|
|
713
|
+
index.TableType.OPT === this.config.type ||
|
|
714
|
+
index.TableType.OPTNOTOTAL === this.config.type)) {
|
|
1821
715
|
querys.push(`SELECT ${querys.length} as ${formatter.QueryColumnNames.ROWGROUPINDEX},
|
|
1822
716
|
'=' as ${formatter.QueryColumnNames.OPERATION},
|
|
1823
717
|
'${rowGroupEntry.rowGroup}' as ${formatter.QueryColumnNames.ROWGROUP},
|
|
@@ -1838,7 +732,7 @@ class DataQuery {
|
|
|
1838
732
|
}
|
|
1839
733
|
/** Generates a total SUM row across all groups (only for SUM / OPT table types). */
|
|
1840
734
|
createTotalSumRow(querys, sumGroupQueries, scenariosSUMQuery) {
|
|
1841
|
-
if (TableType.SUM === this.config.type || TableType.OPT === this.config.type) {
|
|
735
|
+
if (index.TableType.SUM === this.config.type || index.TableType.OPT === this.config.type) {
|
|
1842
736
|
const title = `${this.hasPartOf && this.config.grouped === false ? `${this.i18n.get("SUM_TOTAL") || "SUM_TOTAL"} ` : ""}${this.config.title}`;
|
|
1843
737
|
querys.push(`SELECT ${querys.length} as ${formatter.QueryColumnNames.ROWGROUPINDEX},
|
|
1844
738
|
'${title}' as ${formatter.QueryColumnNames.ROWGROUP},
|
|
@@ -2074,7 +968,7 @@ class DataQuery {
|
|
|
2074
968
|
*/
|
|
2075
969
|
translateScenarioSQL(scenario, isSumRow, type) {
|
|
2076
970
|
const scenarios = new formatter.VarianceScenario(scenario);
|
|
2077
|
-
if (TableType.OPT === type || TableType.OPTNOTOTAL === type) {
|
|
971
|
+
if (index.TableType.OPT === type || index.TableType.OPTNOTOTAL === type) {
|
|
2078
972
|
if (scenarios.isValid) {
|
|
2079
973
|
if (scenarios.type === "dr") {
|
|
2080
974
|
return `SUM(${scenarios.base} - ${scenarios.delta}) as ${scenario}, SUM(${scenarios.delta}) as dr_${scenarios.delta}`;
|
|
@@ -2106,7 +1000,7 @@ class DataQuery {
|
|
|
2106
1000
|
*/
|
|
2107
1001
|
createOrderString(orderComponent) {
|
|
2108
1002
|
const base = `${orderComponent.hierarchy.toString()} ${orderComponent.direction}`;
|
|
2109
|
-
const inverted = `${orderComponent.hierarchy.toString()} ${OrderDirection.ASC === orderComponent.direction ? OrderDirection.DESC : OrderDirection.ASC}`;
|
|
1003
|
+
const inverted = `${orderComponent.hierarchy.toString()} ${index.OrderDirection.ASC === orderComponent.direction ? index.OrderDirection.DESC : index.OrderDirection.ASC}`;
|
|
2110
1004
|
return [base, inverted];
|
|
2111
1005
|
}
|
|
2112
1006
|
/** Returns a key/value pair mapping a relative variance column to its denominator, or null for non-relative scenarios. */
|
|
@@ -2381,8 +1275,8 @@ class TableDataSetFactory {
|
|
|
2381
1275
|
createHeader(type, scenarios, i18n, measureScale, measureUnit, showMeasureScale) {
|
|
2382
1276
|
const header = [];
|
|
2383
1277
|
this.normalizedHeader = this.normalizeHeader(type, scenarios);
|
|
2384
|
-
const headerRow = new TableRow(0, 0, TableRowType.HEADER);
|
|
2385
|
-
const separatorRow = new TableRow(1, 0, TableRowType.SEPERATORLINE);
|
|
1278
|
+
const headerRow = new TableRow(0, 0, index.TableRowType.HEADER);
|
|
1279
|
+
const separatorRow = new TableRow(1, 0, index.TableRowType.SEPERATORLINE);
|
|
2386
1280
|
for (const scenario of this.normalizedHeader) {
|
|
2387
1281
|
headerRow.createElement(formatter.Formatter.translateScenarioLabel(scenario.name, i18n), scenario.type, this.createColumnType(scenario), null, this.setHeaderPrefix(scenario, i18n, measureScale, measureUnit, showMeasureScale), null, null, null, null);
|
|
2388
1282
|
separatorRow.createElement(null, scenario.type, this.createColumnType(scenario), null, null, null, null, null, null);
|
|
@@ -2418,7 +1312,7 @@ class TableDataSetFactory {
|
|
|
2418
1312
|
order: undefined,
|
|
2419
1313
|
},
|
|
2420
1314
|
];
|
|
2421
|
-
if (TableType.OPT === type || TableType.OPTNOTOTAL === type) {
|
|
1315
|
+
if (index.TableType.OPT === type || index.TableType.OPTNOTOTAL === type) {
|
|
2422
1316
|
header = [
|
|
2423
1317
|
{
|
|
2424
1318
|
name: formatter.QueryColumnNames.OPERATION,
|
|
@@ -2464,9 +1358,11 @@ class TableDataSetFactory {
|
|
|
2464
1358
|
if (!barColumns || barColumns.length === 0) {
|
|
2465
1359
|
return statsMap;
|
|
2466
1360
|
}
|
|
2467
|
-
//
|
|
1361
|
+
// Collect all values per column for median calculation
|
|
1362
|
+
const valuesMap = new Map();
|
|
2468
1363
|
for (const column of barColumns) {
|
|
2469
|
-
statsMap.set(column, { min: Infinity, max: -Infinity, absMax: 0 });
|
|
1364
|
+
statsMap.set(column, { min: Infinity, max: -Infinity, absMax: 0, median: 0 });
|
|
1365
|
+
valuesMap.set(column, []);
|
|
2470
1366
|
}
|
|
2471
1367
|
// Iterate through all groups and rows
|
|
2472
1368
|
for (const groupData of queryData) {
|
|
@@ -2477,17 +1373,24 @@ class TableDataSetFactory {
|
|
|
2477
1373
|
const stats = statsMap.get(column);
|
|
2478
1374
|
stats.min = Math.min(stats.min, value);
|
|
2479
1375
|
stats.max = Math.max(stats.max, value);
|
|
1376
|
+
valuesMap.get(column).push(Math.abs(value));
|
|
2480
1377
|
}
|
|
2481
1378
|
}
|
|
2482
1379
|
}
|
|
2483
1380
|
}
|
|
2484
|
-
// Finalize absMax values
|
|
1381
|
+
// Finalize absMax and median values
|
|
2485
1382
|
for (const [column, stats] of statsMap) {
|
|
2486
1383
|
if (stats.min === Infinity || stats.max === -Infinity) {
|
|
2487
1384
|
stats.min = 0;
|
|
2488
1385
|
stats.max = 0;
|
|
2489
1386
|
}
|
|
2490
1387
|
stats.absMax = Math.max(Math.abs(stats.min), Math.abs(stats.max));
|
|
1388
|
+
const absValues = valuesMap.get(column);
|
|
1389
|
+
if (absValues.length > 0) {
|
|
1390
|
+
absValues.sort((a, b) => a - b);
|
|
1391
|
+
const mid = Math.floor(absValues.length / 2);
|
|
1392
|
+
stats.median = absValues.length % 2 === 0 ? (absValues[mid - 1] + absValues[mid]) / 2 : absValues[mid];
|
|
1393
|
+
}
|
|
2491
1394
|
statsMap.set(column, stats);
|
|
2492
1395
|
}
|
|
2493
1396
|
return statsMap;
|
|
@@ -2571,18 +1474,18 @@ class TableDataSetFactory {
|
|
|
2571
1474
|
*/
|
|
2572
1475
|
createDetailRow(type, rowIndex, groupIndex, maxIndex) {
|
|
2573
1476
|
switch (type) {
|
|
2574
|
-
case TableRowType.GROUPHEAD:
|
|
2575
|
-
return new TableRow(rowIndex, groupIndex, TableRowType.HEADER);
|
|
2576
|
-
case TableRowType.SUM:
|
|
2577
|
-
return new TableRow(maxIndex + 2, groupIndex, TableRowType.SUM);
|
|
2578
|
-
case TableRowType.GROUPSUM:
|
|
2579
|
-
return new TableRow(maxIndex + 2, groupIndex, TableRowType.SUM);
|
|
2580
|
-
case TableRowType.DRILLELEMENT:
|
|
2581
|
-
return new TableRow(maxIndex + 2, groupIndex, TableRowType.DRILLELEMENT);
|
|
2582
|
-
case TableRowType.PARTELEMENT:
|
|
2583
|
-
return new TableRow(maxIndex + 2, groupIndex, TableRowType.PARTELEMENT);
|
|
1477
|
+
case index.TableRowType.GROUPHEAD:
|
|
1478
|
+
return new TableRow(rowIndex, groupIndex, index.TableRowType.HEADER);
|
|
1479
|
+
case index.TableRowType.SUM:
|
|
1480
|
+
return new TableRow(maxIndex + 2, groupIndex, index.TableRowType.SUM);
|
|
1481
|
+
case index.TableRowType.GROUPSUM:
|
|
1482
|
+
return new TableRow(maxIndex + 2, groupIndex, index.TableRowType.SUM);
|
|
1483
|
+
case index.TableRowType.DRILLELEMENT:
|
|
1484
|
+
return new TableRow(maxIndex + 2, groupIndex, index.TableRowType.DRILLELEMENT);
|
|
1485
|
+
case index.TableRowType.PARTELEMENT:
|
|
1486
|
+
return new TableRow(maxIndex + 2, groupIndex, index.TableRowType.PARTELEMENT);
|
|
2584
1487
|
default:
|
|
2585
|
-
return new TableRow(rowIndex, groupIndex, TableRowType.STANDARD);
|
|
1488
|
+
return new TableRow(rowIndex, groupIndex, index.TableRowType.STANDARD);
|
|
2586
1489
|
}
|
|
2587
1490
|
}
|
|
2588
1491
|
/**
|
|
@@ -2750,12 +1653,12 @@ class Table {
|
|
|
2750
1653
|
this.data = [];
|
|
2751
1654
|
this.headerRows = [];
|
|
2752
1655
|
this.bodyRows = [];
|
|
2753
|
-
this.ruleSet = ruleSet || new
|
|
1656
|
+
this.ruleSet = ruleSet || new ibcsRuleSet.IBCSRuleSet();
|
|
2754
1657
|
this.dataSetFactory = new TableDataSetFactory();
|
|
2755
1658
|
this.config = this.initConfig(config);
|
|
2756
1659
|
this.i18n = this.initI18n(new Map());
|
|
2757
1660
|
this.setData(data, config.filter);
|
|
2758
|
-
this.state = FactoryState.DIRTY;
|
|
1661
|
+
this.state = index.FactoryState.DIRTY;
|
|
2759
1662
|
}
|
|
2760
1663
|
/**
|
|
2761
1664
|
* Init load of translation dictionary map
|
|
@@ -2807,11 +1710,11 @@ class Table {
|
|
|
2807
1710
|
["ibcssymbol_delta_generic_relative", "Δ({%})%"],
|
|
2808
1711
|
["SUM_TOTAL", "❖"],
|
|
2809
1712
|
]);
|
|
2810
|
-
this.state = FactoryState.DIRTY; // mark dataSet for update
|
|
1713
|
+
this.state = index.FactoryState.DIRTY; // mark dataSet for update
|
|
2811
1714
|
return new Map([...defaultI18n, ...(i18n || new Map())]);
|
|
2812
1715
|
}
|
|
2813
1716
|
initConfig(config) {
|
|
2814
|
-
this.state = FactoryState.DIRTY; // mark dataSet for update
|
|
1717
|
+
this.state = index.FactoryState.DIRTY; // mark dataSet for update
|
|
2815
1718
|
const tmpConfig = config;
|
|
2816
1719
|
// sorting scenario order based on Ruleset
|
|
2817
1720
|
const self = this;
|
|
@@ -2850,22 +1753,22 @@ class Table {
|
|
|
2850
1753
|
const normalizedScenarios = this.normalizeScenarios(this.config.scenarios, this.config.categoryThereOf, this.config.sortOrder);
|
|
2851
1754
|
this.headerRows = this.dataSetFactory.createHeader(this.config.type, normalizedScenarios, this.i18n, this.config.measureScale, this.config.measureUnit, this.config.showMeasureScale);
|
|
2852
1755
|
this.bodyRows = this.dataSetFactory.createBodyRows(this.config, this.i18n, this.data);
|
|
2853
|
-
this.state = FactoryState.UP_TO_DATE;
|
|
1756
|
+
this.state = index.FactoryState.UP_TO_DATE;
|
|
2854
1757
|
}
|
|
2855
1758
|
update() {
|
|
2856
1759
|
const normalizedScenarios = this.normalizeScenarios(this.config.scenarios, this.config.categoryThereOf, this.config.sortOrder);
|
|
2857
1760
|
this.headerRows = this.dataSetFactory.createHeader(this.config.type, normalizedScenarios, this.i18n, this.config.measureScale, this.config.measureUnit, this.config.showMeasureScale);
|
|
2858
1761
|
this.bodyRows = this.dataSetFactory.createBodyRows(this.config, this.i18n, this.data);
|
|
2859
|
-
this.state = FactoryState.UP_TO_DATE;
|
|
1762
|
+
this.state = index.FactoryState.UP_TO_DATE;
|
|
2860
1763
|
}
|
|
2861
1764
|
getHeader() {
|
|
2862
|
-
if (this.state === FactoryState.DIRTY) {
|
|
1765
|
+
if (this.state === index.FactoryState.DIRTY) {
|
|
2863
1766
|
this.update();
|
|
2864
1767
|
}
|
|
2865
1768
|
return this.headerRows;
|
|
2866
1769
|
}
|
|
2867
1770
|
getBody() {
|
|
2868
|
-
if (this.state === FactoryState.DIRTY) {
|
|
1771
|
+
if (this.state === index.FactoryState.DIRTY) {
|
|
2869
1772
|
this.update();
|
|
2870
1773
|
}
|
|
2871
1774
|
return this.bodyRows;
|
|
@@ -2937,9 +1840,9 @@ class TableComponentConfig {
|
|
|
2937
1840
|
this.categoryThereOf = new Map();
|
|
2938
1841
|
/** Percentage-of-total sub-row definitions. */
|
|
2939
1842
|
this.partOf = [];
|
|
2940
|
-
this.sortOrder = new Order.OrderAdapter(new
|
|
1843
|
+
this.sortOrder = new Order.OrderAdapter(new ibcsRuleSet.StringAdapter()).default();
|
|
2941
1844
|
/** Table aggregation mode: LIST (flat), SUM (with totals), OPT (with optional totals), etc. */
|
|
2942
|
-
this.type = TableType.LIST;
|
|
1845
|
+
this.type = index.TableType.LIST;
|
|
2943
1846
|
/** Maximum rows to display; 0 means unlimited. */
|
|
2944
1847
|
this.limit = 0;
|
|
2945
1848
|
this.i18n = Order.I18nMode.ALL;
|
|
@@ -3212,11 +2115,11 @@ class TableDataRowAdapter {
|
|
|
3212
2115
|
}
|
|
3213
2116
|
}
|
|
3214
2117
|
|
|
3215
|
-
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-
|
|
2118
|
+
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}`;
|
|
3216
2119
|
|
|
3217
2120
|
const IbcsTable = class {
|
|
3218
2121
|
constructor(hostRef) {
|
|
3219
|
-
index.registerInstance(this, hostRef);
|
|
2122
|
+
index$1.registerInstance(this, hostRef);
|
|
3220
2123
|
this.data = [];
|
|
3221
2124
|
this.tableTitle = "SUM_TOTAL";
|
|
3222
2125
|
this.scenarios = [];
|
|
@@ -3228,10 +2131,10 @@ const IbcsTable = class {
|
|
|
3228
2131
|
this.partof = [];
|
|
3229
2132
|
this.order = {
|
|
3230
2133
|
hierarchy: [],
|
|
3231
|
-
direction: OrderDirection.ASC,
|
|
2134
|
+
direction: index.OrderDirection.ASC,
|
|
3232
2135
|
};
|
|
3233
2136
|
this.categorythereof = new Map();
|
|
3234
|
-
this.type = TableType.LIST;
|
|
2137
|
+
this.type = index.TableType.LIST;
|
|
3235
2138
|
this.categoryWidth = Order.TableCategoryWidth.INF;
|
|
3236
2139
|
this.dataFormatDigits = { percent: 2, decimal: 1 };
|
|
3237
2140
|
this.i18n = new Map();
|
|
@@ -3242,6 +2145,7 @@ const IbcsTable = class {
|
|
|
3242
2145
|
this.measureType = Order.MeasureType.VOLUME;
|
|
3243
2146
|
this.filter = "";
|
|
3244
2147
|
this.barColumns = [];
|
|
2148
|
+
this.barColumnMaxWidth = 30;
|
|
3245
2149
|
this.unitScaling = 0.01;
|
|
3246
2150
|
this.percentageScaling = 0.5;
|
|
3247
2151
|
this.scaleFactor = 1;
|
|
@@ -3255,22 +2159,22 @@ const IbcsTable = class {
|
|
|
3255
2159
|
}
|
|
3256
2160
|
if (this.table.hasNoData()) {
|
|
3257
2161
|
const errorMsg = this.i18n.get("NO_DATA") || "==No Data==";
|
|
3258
|
-
return index.h("p", { class: "warning" }, errorMsg);
|
|
2162
|
+
return index$1.h("p", { class: "warning" }, errorMsg);
|
|
3259
2163
|
}
|
|
3260
|
-
return (index.h("table", null, index.h("thead", null, this.table.getHeader().map((row) => (index.h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (index.h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (index.h("span", null, i === arr.length - 1 ? (index.h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (index.h("span", null, line, cell.drawPrefix(), index.h("br", null))))))))))))), index.h("tbody", null, this.table.getBody().map((row) => (index.h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (index.h("td", { colSpan: cell.colSpan, class: cell.
|
|
2164
|
+
return (index$1.h("table", null, index$1.h("thead", null, this.table.getHeader().map((row) => (index$1.h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (index$1.h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (index$1.h("span", null, i === arr.length - 1 ? (index$1.h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (index$1.h("span", null, line, cell.drawPrefix(), index$1.h("br", null))))))))))))), index$1.h("tbody", null, this.table.getBody().map((row) => (index$1.h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (index$1.h("td", { colSpan: cell.colSpan, class: cell.type ? `${cell.cssStyle} ${cell.type}` : cell.cssStyle }, cell.prefix != null ? (index$1.h("span", { class: cell.cssStyle + " " + cell.prefixStyle }, cell.drawPrefix())) : (""), cell.isBarChart && cell.columnStats ? (index$1.h(CellBarChart, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: cell.key.startsWith("dr"), isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, maxBarWidth: this.barColumnMaxWidth, styles: this.barChartStyles })) : (cell.draw(this.componentDataFormatDigits)))))))))));
|
|
3261
2165
|
};
|
|
3262
|
-
return index.h(index.Host, null, helper());
|
|
2166
|
+
return index$1.h(index$1.Host, null, helper());
|
|
3263
2167
|
}
|
|
3264
2168
|
componentWillRender() {
|
|
3265
2169
|
const config = this.prepareConfig();
|
|
3266
2170
|
const data = this.prepareData();
|
|
3267
2171
|
this.componentDataFormatDigits = new DataFormatDigits.DataFormatDigitsAdapter().adapt(this.dataFormatDigits);
|
|
3268
2172
|
this.barChartStyles = this.prepareBarChartStyles();
|
|
3269
|
-
this.table = new Table(new
|
|
2173
|
+
this.table = new Table(new ibcsRuleSet.IBCSRuleSet(), data, config);
|
|
3270
2174
|
this.table.setI18n(this.i18n);
|
|
3271
2175
|
}
|
|
3272
2176
|
prepareConfig() {
|
|
3273
|
-
const config = new TableComponentConfigAdapter(new TableDrillGroupAdapter(), new
|
|
2177
|
+
const config = new TableComponentConfigAdapter(new TableDrillGroupAdapter(), new ibcsRuleSet.StringAdapter(), new Order.OrderAdapter(new ibcsRuleSet.StringAdapter()), this.data).adapt({
|
|
3274
2178
|
title: this.tableTitle,
|
|
3275
2179
|
scenarios: this.scenarios,
|
|
3276
2180
|
scenariosUnitType: this.scenariosDataFormat,
|
|
@@ -3365,12 +2269,8 @@ const IbcsTable = class {
|
|
|
3365
2269
|
};
|
|
3366
2270
|
});
|
|
3367
2271
|
}
|
|
3368
|
-
get element() { return index.getElement(this); }
|
|
2272
|
+
get element() { return index$1.getElement(this); }
|
|
3369
2273
|
};
|
|
3370
2274
|
IbcsTable.style = ibcsTableCss();
|
|
3371
2275
|
|
|
3372
|
-
exports.bn_context = Context;
|
|
3373
|
-
exports.bn_datasource = Datasource;
|
|
3374
|
-
exports.bn_page = Page;
|
|
3375
|
-
exports.bn_table = Table$1;
|
|
3376
2276
|
exports.ibcs_table = IbcsTable;
|