@bino-bi/bn-template-engine 1.0.0-alpha.3 → 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-B4ySv9KQ.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-C0yAPzJz.js → p-u8igQLRZ.js} +1 -1
- package/dist/cjs/{DataFormatDigits-DAmZzqbD.js → DataFormatDigits-DKcOeLNK.js} +1 -1
- package/dist/cjs/{DateStringFactory-CcluhpGI.js → DateStringFactory-CSKvbS8K.js} +1 -1
- package/dist/cjs/{Order-BKoDS21t.js → Order-iG11HI4R.js} +8 -5
- package/dist/cjs/{SVGVariancesStyleGroup-DYYAU-81.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} +122 -1293
- package/dist/cjs/{StringAdapter-Bneo8T4k.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-CW30Bh6c.js → withStyled-CS1Yp4sv.js} +8 -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 +9 -12
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +58 -41
- package/dist/collection/stores/componentStyles.js +2 -0
- package/dist/collection/utils/constants.js +8 -5
- package/dist/collection/utils/contentDecoder.js +28 -0
- package/dist/collection/utils/stackColors.js +2 -2
- package/dist/collection/utils/validate.js +1 -1
- package/dist/components/DataFormatDigits.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/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--qIbKvXa.js → DataFormatDigits-oSZ1hBKE.js} +1 -1
- package/dist/esm/{DateStringFactory-XWdUjsn8.js → DateStringFactory-CSGz6TDk.js} +1 -1
- package/dist/esm/{Order-sqjrku2z.js → Order-Bnhh02CF.js} +9 -6
- package/dist/esm/{SVGVariancesStyleGroup-ibg3sLjM.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} +68 -1235
- package/dist/esm/{StringAdapter-BCLJpQQ8.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-D1fAWJ3g.js → withStyled--qQWquTH.js} +6 -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 +3 -3
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +0 -2
- package/dist/types/components.d.ts +100 -36
- package/dist/types/stores/componentStyles.d.ts +2 -0
- package/dist/types/utils/constants.d.ts +8 -5
- package/dist/types/utils/contentDecoder.d.ts +12 -0
- package/package.json +2 -1
- package/dist/bn-template-engine/p-05a82a77.entry.js +0 -1
- package/dist/bn-template-engine/p-1970906d.entry.js +0 -1
- package/dist/bn-template-engine/p-1dbd339c.entry.js +0 -1
- package/dist/bn-template-engine/p-2e68cf09.entry.js +0 -1
- package/dist/bn-template-engine/p-31cc6a2d.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-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-8tsCnxIz.js +0 -1
- package/dist/bn-template-engine/p-997b2fe4.entry.js +0 -1
- package/dist/bn-template-engine/p-BL8gyUwE.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-DtdQCMzj.js +0 -1
- package/dist/bn-template-engine/p-a90f1cbe.entry.js +0 -1
- package/dist/bn-template-engine/p-b7bec050.entry.js +0 -1
- package/dist/bn-template-engine/p-d7f0cbaf.entry.js +0 -1
- package/dist/bn-template-engine/p-dfb61aa5.entry.js +0 -1
- package/dist/bn-template-engine/p-ece17f84.entry.js +0 -1
- package/dist/bn-template-engine/p-f27995c9.entry.js +0 -1
- package/dist/bn-template-engine/p-fd427179.entry.js +0 -1
- package/dist/bn-template-engine/p-sqjrku2z.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
|
@@ -0,0 +1,977 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-JNHhIe7t.js';
|
|
2
|
+
import { w as withStyled, v as validateScenarioList, a as validateVariancesList, l as isBlankInput, m as isTableBarColumnWidth, i as isValidNumber, n as isValidDataFormat, j as isValidBoolean, o as isValidTableType, b as isValidInteger, p as validateThereOfJsonStr, q as validatePartOfJsonStr, d as validateOrderList, e as isValidDirection, r as isValidMeasureType, k as isValidMeasureScale, s as isTableCategoryWidth, t as validateColumnThereOfJsonStr } from './withStyled--qQWquTH.js';
|
|
3
|
+
import { w as withDataset, g as getParentDimensions, p as parseScaling } from './scaling-Cehc74IE.js';
|
|
4
|
+
import { w as withComponentStatus } from './withComponentStatus-DWjDYtZ7.js';
|
|
5
|
+
import { a as globalLabelKeys } from './context-protocol-BHnQsVsr.js';
|
|
6
|
+
import { w as withTranslation } from './withTranslation-BqD0Kp7b.js';
|
|
7
|
+
import { w as withComponentStyle } from './withComponentStyle-9uP_hcDq.js';
|
|
8
|
+
import { w as withHasError } from './withHasError-FyY5mQ_3.js';
|
|
9
|
+
import { d as DataFormat, O as OrderDirection, a as OrderColumn, I as I18nMode, T as TableCategoryWidth, M as MeasureType, B as BAR_COLUMN_WIDTH_EM, e as TableBarColumnWidth } from './Order-Bnhh02CF.js';
|
|
10
|
+
import { T as TableType } from './index-DHezf8pZ.js';
|
|
11
|
+
import './emotion-hash.esm-BYBpC0EO.js';
|
|
12
|
+
import './DateStringFactory-CSGz6TDk.js';
|
|
13
|
+
import './utils-DvvwfRQG.js';
|
|
14
|
+
|
|
15
|
+
const bnTableCss = () => `:host{display:inline-block;position:relative;overflow:hidden}`;
|
|
16
|
+
|
|
17
|
+
const Table = class {
|
|
18
|
+
validateScaling(newValue) {
|
|
19
|
+
if (newValue == null || newValue === "" || newValue === "none" || newValue === "auto") {
|
|
20
|
+
this.errors.remove("ERR_scale");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const num = Number(newValue);
|
|
24
|
+
if (isNaN(num) || num <= 0) {
|
|
25
|
+
this.errors.addOrReplace({
|
|
26
|
+
id: "ERR_scale",
|
|
27
|
+
type: "warning",
|
|
28
|
+
message: `Invalid scale value: "${newValue}". Use "none", "auto", or a positive number.`,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this.errors.remove("ERR_scale");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
constructor(hostRef) {
|
|
36
|
+
registerInstance(this, hostRef);
|
|
37
|
+
this.data = [];
|
|
38
|
+
this.datasetMeta = null;
|
|
39
|
+
this.appliedScaleFactor = 1;
|
|
40
|
+
/**
|
|
41
|
+
* A not mundane tile which should describes the shown data.
|
|
42
|
+
*/
|
|
43
|
+
this.tableTitle = "";
|
|
44
|
+
/**
|
|
45
|
+
* AlaSQL WHERE clause fragment injected into the data query to filter
|
|
46
|
+
* rows before rendering (e.g. `"category = 'Sales'"`).
|
|
47
|
+
*/
|
|
48
|
+
this.filter = "";
|
|
49
|
+
/**
|
|
50
|
+
* measureUnit displayed in table.
|
|
51
|
+
*/
|
|
52
|
+
this.measureUnit = "";
|
|
53
|
+
/**
|
|
54
|
+
* Set width of bar chart columns. Controls the max bar/pin width in pixels.
|
|
55
|
+
* <br /><br />
|
|
56
|
+
* values:<br />
|
|
57
|
+
* ``` w5 // w10 // w15 // w20 // w25 // w30 // w40 // w60 // w80 // w100 ```
|
|
58
|
+
*/
|
|
59
|
+
this.barColumnWidth = "w10";
|
|
60
|
+
/**
|
|
61
|
+
* Pixels per unit for absolute variance bar charts (ΔPY).
|
|
62
|
+
* Controls bar width: barWidth = value × unitScaling.
|
|
63
|
+
* Bars exceeding barColumnWidth are shown with an arrow indicator.
|
|
64
|
+
* <br /><br />
|
|
65
|
+
* Default: 0.01
|
|
66
|
+
*/
|
|
67
|
+
this.unitScaling = 0.01;
|
|
68
|
+
/**
|
|
69
|
+
* Scaling for relative variance pin charts (ΔPY%).
|
|
70
|
+
* <br /><br />
|
|
71
|
+
* Name of the 'scaling-group' which the table uses.
|
|
72
|
+
* Scaling groups are maintained globally.
|
|
73
|
+
* <br /><br />
|
|
74
|
+
* Alternatively a number which represents pixels per percentage point.
|
|
75
|
+
* <br /><br />
|
|
76
|
+
* Example: 0.5 means 100% = 50 pixels width.
|
|
77
|
+
* <br /><br />
|
|
78
|
+
* Default: 0.5
|
|
79
|
+
*/
|
|
80
|
+
this.percentageScaling = 0.5;
|
|
81
|
+
// Global scaling groups map - can be populated externally for shared scaling across components
|
|
82
|
+
this.pixelPerUnitGroupMap = new Map();
|
|
83
|
+
/**
|
|
84
|
+
* Defines the data unit type of the tables data.
|
|
85
|
+
* <br /><br />
|
|
86
|
+
* If percent is chosen all data values are converted into percent
|
|
87
|
+
* (0.02 -> 2%)
|
|
88
|
+
* <br /><br />
|
|
89
|
+
* values: <br />
|
|
90
|
+
* ```percent // decimal```
|
|
91
|
+
*/
|
|
92
|
+
this.dataFormat = "decimal";
|
|
93
|
+
/**
|
|
94
|
+
* Toggles of data should be grouped by
|
|
95
|
+
* 'rowgroup'.
|
|
96
|
+
* <br /><br />
|
|
97
|
+
* values: <br />
|
|
98
|
+
* ```true // false```
|
|
99
|
+
*/
|
|
100
|
+
this.grouped = "false";
|
|
101
|
+
/**
|
|
102
|
+
* Toggles display of measure units in table header
|
|
103
|
+
* <br /><br />
|
|
104
|
+
* values: <br />
|
|
105
|
+
* ```true // false```
|
|
106
|
+
*/
|
|
107
|
+
this.showMeasureScale = "false";
|
|
108
|
+
/**
|
|
109
|
+
* Toggles a title header for each (row-)group
|
|
110
|
+
* the title header value is found set by 'rowgroup'
|
|
111
|
+
* <br /><br />
|
|
112
|
+
* values: <br />
|
|
113
|
+
* ```true // false```
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
116
|
+
this.showGroupTitle = "true";
|
|
117
|
+
/**
|
|
118
|
+
* Set the table type
|
|
119
|
+
* <br /><br />
|
|
120
|
+
* values: <br />
|
|
121
|
+
* ```list // sum // opt // sumnototal // optnototal```
|
|
122
|
+
*
|
|
123
|
+
*/
|
|
124
|
+
this.type = "list";
|
|
125
|
+
/**
|
|
126
|
+
* Set the maximum number of rows for each
|
|
127
|
+
* group. The value 0 means *no limit*
|
|
128
|
+
* <br /><br />
|
|
129
|
+
* rows wich where cut by the limit are cumulated as REST
|
|
130
|
+
*
|
|
131
|
+
*/
|
|
132
|
+
this.limit = 0;
|
|
133
|
+
/**
|
|
134
|
+
* Stringified Array of drilldown Objects {
|
|
135
|
+
"rowGroup": string,<br />
|
|
136
|
+
"category": string,<br />
|
|
137
|
+
"subCategory": string,<br />
|
|
138
|
+
},<br /><br />
|
|
139
|
+
* rowgroup, categroy defines the location of the drill
|
|
140
|
+
* subcategory is the displayed label of the data row
|
|
141
|
+
*<br /><br />
|
|
142
|
+
* example:<br />
|
|
143
|
+
* ```[{
|
|
144
|
+
"rowGroup":"Umsatz",
|
|
145
|
+
"category": "Applications",
|
|
146
|
+
"subCategory": "Applications-A",
|
|
147
|
+
},]```
|
|
148
|
+
*/
|
|
149
|
+
this.thereof = "[]";
|
|
150
|
+
/**
|
|
151
|
+
* Stringified Array of Partof Objects <br />{<br />
|
|
152
|
+
"rowGroup": string,<br />
|
|
153
|
+
"category": string<br />
|
|
154
|
+
},<br /><br />
|
|
155
|
+
* rowgroup, categroy defines the location of the drill
|
|
156
|
+
* percentage of category in rowgorup
|
|
157
|
+
*<br /><br />
|
|
158
|
+
* example:<br />
|
|
159
|
+
* ```[{
|
|
160
|
+
"rowGroups":"Umsatz",
|
|
161
|
+
"category": "Applications",
|
|
162
|
+
},]```
|
|
163
|
+
*/
|
|
164
|
+
this.partof = "[]";
|
|
165
|
+
/** List of the primary scenarios on which the order direction are applied valid scenarios are
|
|
166
|
+
* If order is set to a scenario it has also exists in scenariolist
|
|
167
|
+
* <br /><br />
|
|
168
|
+
* values: <br />
|
|
169
|
+
* ```category // categoryindex // rowgroup // rowgroup // rowgroupindex // ac[1-4] // fc[1-4] // pp[1-4] // pl[1-4] // auto```
|
|
170
|
+
* <br /><br />
|
|
171
|
+
* When set to ```auto```, order is detected from the dataset silently.
|
|
172
|
+
*/
|
|
173
|
+
this.order = "category";
|
|
174
|
+
/** Set sorting order direction
|
|
175
|
+
* <br /><br />
|
|
176
|
+
* values: <br />
|
|
177
|
+
* ```asc // desc```
|
|
178
|
+
*/
|
|
179
|
+
this.orderDirection = "asc";
|
|
180
|
+
/** Sets the Measure Type of the Table
|
|
181
|
+
* volume is different displayed and interpreted as currency
|
|
182
|
+
* names of siprefix are adapted.
|
|
183
|
+
* <br /><br />
|
|
184
|
+
* values: <br />
|
|
185
|
+
* ```volume // currency```
|
|
186
|
+
|
|
187
|
+
*/
|
|
188
|
+
this.measureType = "volume";
|
|
189
|
+
/**
|
|
190
|
+
* Sets the SiPrefix of the Mesaurements and converts the
|
|
191
|
+
* original value.
|
|
192
|
+
* <br /><br />
|
|
193
|
+
* values: <br />
|
|
194
|
+
* ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p // P // f // a // z // y // GREATEST // LEAST```
|
|
195
|
+
* <br /><br />
|
|
196
|
+
* SiPrefix overview:
|
|
197
|
+
* ``` "Y": 1E+24,```<br />
|
|
198
|
+
* ``` "Z": 1E+21,```<br />
|
|
199
|
+
* ``` "E": 1E+18,```<br />
|
|
200
|
+
* ``` "P": 1E+15,```<br />
|
|
201
|
+
* ``` "T": 1E+12,```<br />
|
|
202
|
+
* ``` "G": 1000000000,```<br />
|
|
203
|
+
* ``` "M": 1000000,```<br />
|
|
204
|
+
* ``` "k": 1000,```<br />
|
|
205
|
+
* <br />
|
|
206
|
+
* ``` "m": 0.001,```<br />
|
|
207
|
+
* ``` "μ": 0.000001,```<br />
|
|
208
|
+
* ``` "n": 0.000000001,```<br />
|
|
209
|
+
* ``` "p": 0.000000000001,```<br />
|
|
210
|
+
* ``` "f": 0.000000000000001,```<br />
|
|
211
|
+
* ``` "a": 0.000000000000000001,```<br />
|
|
212
|
+
* ``` "z": 0.000000000000000000001,```<br />
|
|
213
|
+
* ``` "y": 0.000000000000000000000001,```<br />
|
|
214
|
+
* <br /><br />
|
|
215
|
+
* Special modes:
|
|
216
|
+
* ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
217
|
+
* ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
218
|
+
*<br /><br />
|
|
219
|
+
* ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
|
|
220
|
+
*
|
|
221
|
+
*
|
|
222
|
+
*/
|
|
223
|
+
this.measureScale = "greatest";
|
|
224
|
+
/**
|
|
225
|
+
* Number of decimal digits in a table cell
|
|
226
|
+
*/
|
|
227
|
+
this.dataFormatDigitsDecimal = 1;
|
|
228
|
+
/**
|
|
229
|
+
* Number of percent digits in a table cell
|
|
230
|
+
*/
|
|
231
|
+
this.dataFormatDigitsPercent = 2;
|
|
232
|
+
/**
|
|
233
|
+
* Set width of category column. <br />
|
|
234
|
+
* If INF is selected the columns scaling to the min space they need
|
|
235
|
+
* seperatly.
|
|
236
|
+
* <br /><br />
|
|
237
|
+
* values:<br />
|
|
238
|
+
* ``` w5 // w10 // w15 // w20 // w25 // w50 // inf ```
|
|
239
|
+
*/
|
|
240
|
+
this.categoryWidth = "w15";
|
|
241
|
+
/**
|
|
242
|
+
* Defines which drill-column is displayed. <br />
|
|
243
|
+
* <br /><br />
|
|
244
|
+
* ```scenario``` the scenaro to drill <br/>
|
|
245
|
+
* ```group``` is a list of child columns of the parent <br/><br/>
|
|
246
|
+
* ```subGroups``` is a list of child columns of the parent <br/><br/>
|
|
247
|
+
* example:<br />
|
|
248
|
+
* ```[{"scenario": "ac1", "name": "DE", "subGroups": ["Berlin"]},
|
|
249
|
+
* {"scenario": "ac2", "name": "UK", "subGroups": []}],
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
this.columnthereof = null;
|
|
253
|
+
this._autoScaleGuard = false;
|
|
254
|
+
withStyled(this);
|
|
255
|
+
withComponentStatus(this);
|
|
256
|
+
this.errors = withHasError(this);
|
|
257
|
+
this.componentStyle = withComponentStyle(this);
|
|
258
|
+
withDataset(this, (_name, data) => {
|
|
259
|
+
this.data = (data || []);
|
|
260
|
+
}, (_name, meta) => {
|
|
261
|
+
this.datasetMeta = meta;
|
|
262
|
+
});
|
|
263
|
+
this.t = withTranslation(this).t;
|
|
264
|
+
}
|
|
265
|
+
validateScenario(newValue) {
|
|
266
|
+
const errId = "ERR_scenarios";
|
|
267
|
+
const invalidScenarios = validateScenarioList(newValue);
|
|
268
|
+
if (invalidScenarios.length > 0) {
|
|
269
|
+
this.errors.addOrReplace({
|
|
270
|
+
id: errId,
|
|
271
|
+
type: "warning",
|
|
272
|
+
message: "scenarios: invalid value(s) '" + (invalidScenarios === null || invalidScenarios === void 0 ? void 0 : invalidScenarios.toString()) + "' are not supported.",
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
this.errors.remove(errId);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
validateVariances(newValue) {
|
|
280
|
+
const errId = "ERR_variances";
|
|
281
|
+
const invalidVariances = validateVariancesList(newValue);
|
|
282
|
+
if (invalidVariances.length > 0) {
|
|
283
|
+
this.errors.addOrReplace({
|
|
284
|
+
id: errId,
|
|
285
|
+
type: "warning",
|
|
286
|
+
message: "variances: invalid value(s) '" + JSON.stringify(invalidVariances) + "' are not supported.",
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
this.errors.remove(errId);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
validateBarColumns(newValue) {
|
|
294
|
+
const errId = "ERR_barColumns";
|
|
295
|
+
if (isBlankInput(newValue)) {
|
|
296
|
+
this.errors.remove(errId);
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const invalidColumns = validateVariancesList(newValue);
|
|
300
|
+
if (invalidColumns.length > 0) {
|
|
301
|
+
this.errors.addOrReplace({
|
|
302
|
+
id: errId,
|
|
303
|
+
type: "warning",
|
|
304
|
+
message: "barColumns: invalid value(s) '" + JSON.stringify(invalidColumns) + "' are not supported.",
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
this.errors.remove(errId);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
validateBarColumnWidth(newValue) {
|
|
312
|
+
const errId = "ERR_barColumnWidth";
|
|
313
|
+
if (!isTableBarColumnWidth(newValue)) {
|
|
314
|
+
this.errors.addOrReplace({
|
|
315
|
+
id: errId,
|
|
316
|
+
type: "warning",
|
|
317
|
+
message: "barColumnWidth: invalid value '" + newValue + "' is not supported.",
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
this.errors.remove(errId);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
validateUnitScaling(newValue) {
|
|
325
|
+
const errId = "ERR_unitScaling";
|
|
326
|
+
if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
327
|
+
this.errors.addOrReplace({
|
|
328
|
+
id: errId,
|
|
329
|
+
type: "warning",
|
|
330
|
+
message: "unitScaling: invalid value '" + newValue + "' is not supported.",
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
this.errors.remove(errId);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
validatePercentageScaling(newValue) {
|
|
338
|
+
const errId = "ERR_percentageScaling";
|
|
339
|
+
if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
340
|
+
this.errors.addOrReplace({
|
|
341
|
+
id: errId,
|
|
342
|
+
type: "warning",
|
|
343
|
+
message: "percentageScaling: invalid value '" + newValue + "' is not supported.",
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
this.errors.remove(errId);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
validateDataFormat(newValue) {
|
|
351
|
+
const errId = "ERR_dataFormat";
|
|
352
|
+
if (!isValidDataFormat(newValue)) {
|
|
353
|
+
this.errors.addOrReplace({
|
|
354
|
+
id: errId,
|
|
355
|
+
type: "warning",
|
|
356
|
+
message: "dataFormat: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
this.errors.remove(errId);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
validateGrouped(newValue) {
|
|
364
|
+
const errId = "ERR_grouped";
|
|
365
|
+
if (!isValidBoolean(newValue)) {
|
|
366
|
+
this.errors.addOrReplace({
|
|
367
|
+
id: errId,
|
|
368
|
+
type: "warning",
|
|
369
|
+
message: "grouped: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
this.errors.remove(errId);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
validateShowMeasureScale(newValue) {
|
|
377
|
+
const errId = "ERR_grouped";
|
|
378
|
+
if (!isValidBoolean(newValue)) {
|
|
379
|
+
this.errors.addOrReplace({
|
|
380
|
+
id: errId,
|
|
381
|
+
type: "warning",
|
|
382
|
+
message: "showMeasureScale: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
this.errors.remove(errId);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
validateShowGroupTitle(newValue) {
|
|
390
|
+
const errId = "ERR_showGroupTitle";
|
|
391
|
+
if (!isValidBoolean(newValue)) {
|
|
392
|
+
this.errors.addOrReplace({
|
|
393
|
+
id: errId,
|
|
394
|
+
type: "warning",
|
|
395
|
+
message: "showGroupTitle: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
this.errors.remove(errId);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
validateType(newValue) {
|
|
403
|
+
const errId = "ERR_type";
|
|
404
|
+
if (!isValidTableType(newValue)) {
|
|
405
|
+
this.errors.addOrReplace({
|
|
406
|
+
id: errId,
|
|
407
|
+
type: "warning",
|
|
408
|
+
message: "type: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
this.errors.remove(errId);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
validateLimit(newValue) {
|
|
416
|
+
const errId = "ERR_limit";
|
|
417
|
+
if (!isValidInteger(newValue)) {
|
|
418
|
+
this.errors.addOrReplace({
|
|
419
|
+
id: errId,
|
|
420
|
+
type: "warning",
|
|
421
|
+
message: "order: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
this.errors.remove(errId);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
validateThereOf(newValue) {
|
|
429
|
+
const errId = "ERR_thereof";
|
|
430
|
+
const invalidElements = validateThereOfJsonStr(newValue);
|
|
431
|
+
if (invalidElements.length > 0) {
|
|
432
|
+
this.errors.addOrReplace({
|
|
433
|
+
id: errId,
|
|
434
|
+
type: "warning",
|
|
435
|
+
message: "ThereOf: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
this.errors.remove(errId);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
validatePartOf(newValue) {
|
|
443
|
+
const errId = "ERR_partof";
|
|
444
|
+
const invalidElements = validatePartOfJsonStr(newValue);
|
|
445
|
+
if (invalidElements.length > 0) {
|
|
446
|
+
this.errors.addOrReplace({
|
|
447
|
+
id: errId,
|
|
448
|
+
type: "warning",
|
|
449
|
+
message: "partof: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
this.errors.remove(errId);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
validateOrderList(newValue) {
|
|
457
|
+
const errId = "ERR_order";
|
|
458
|
+
const invalidElements = validateOrderList(newValue);
|
|
459
|
+
if (invalidElements.length > 0) {
|
|
460
|
+
this.errors.addOrReplace({
|
|
461
|
+
id: errId,
|
|
462
|
+
type: "warning",
|
|
463
|
+
message: "order: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
this.errors.remove(errId);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
validateOrderDirection(newValue) {
|
|
471
|
+
const errId = "ERR_orderDirection";
|
|
472
|
+
if (!isValidDirection(newValue)) {
|
|
473
|
+
this.errors.addOrReplace({
|
|
474
|
+
id: errId,
|
|
475
|
+
type: "warning",
|
|
476
|
+
message: "orderDirection: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
this.errors.remove(errId);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
validateMeasureType(newValue) {
|
|
484
|
+
const errId = "ERR_measureType";
|
|
485
|
+
if (!isValidMeasureType(newValue)) {
|
|
486
|
+
this.errors.addOrReplace({
|
|
487
|
+
id: errId,
|
|
488
|
+
type: "warning",
|
|
489
|
+
message: "measureType: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
this.errors.remove(errId);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
validateMeasureScale(newValue) {
|
|
497
|
+
const errId = "ERR_measureScale";
|
|
498
|
+
if (!isValidMeasureScale(newValue)) {
|
|
499
|
+
this.errors.addOrReplace({
|
|
500
|
+
id: errId,
|
|
501
|
+
type: "warning",
|
|
502
|
+
message: "measureScale: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
this.errors.remove(errId);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
validateDataFormatDigitsDecimal(newValue) {
|
|
510
|
+
const errId = "ERR_dataFormatDigitsDecimal";
|
|
511
|
+
if (!isValidInteger(newValue)) {
|
|
512
|
+
this.errors.addOrReplace({
|
|
513
|
+
id: errId,
|
|
514
|
+
type: "warning",
|
|
515
|
+
message: "dataFormatDigitsDecimal: invalid value(s) '" + newValue + "' are not supported.",
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
this.errors.remove(errId);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
validateDateFormatDigitsPercent(newValue) {
|
|
523
|
+
const errId = "ERR_dataFormatDigitsPercent";
|
|
524
|
+
if (!isValidInteger(newValue)) {
|
|
525
|
+
this.errors.addOrReplace({
|
|
526
|
+
id: errId,
|
|
527
|
+
type: "warning",
|
|
528
|
+
message: "dataFormatDigitsPercent: invalid value(s) '" + newValue + "' are not supported.",
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
this.errors.remove(errId);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
validateCategoryWidth(newValue) {
|
|
536
|
+
const errId = "ERR_categoryWidth";
|
|
537
|
+
if (!isTableCategoryWidth(newValue)) {
|
|
538
|
+
this.errors.addOrReplace({
|
|
539
|
+
id: errId,
|
|
540
|
+
type: "warning",
|
|
541
|
+
message: "categoryWidth: invalid value(s) '" + newValue + "' are not supported.",
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
this.errors.remove(errId);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
validateColumnThereOf(newValue) {
|
|
549
|
+
const invalidElements = validateColumnThereOfJsonStr(newValue);
|
|
550
|
+
const errId = "ERR_categorythereof";
|
|
551
|
+
if (invalidElements.length > 0) {
|
|
552
|
+
this.errors.addOrReplace({
|
|
553
|
+
id: errId,
|
|
554
|
+
type: "warning",
|
|
555
|
+
message: "columnthereof: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
this.errors.remove(errId);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
componentWillLoad() {
|
|
563
|
+
//this.datasouce = get("test");
|
|
564
|
+
// this.unsubscribe = onChange("test", (value) => this.datasouce = value);
|
|
565
|
+
this.validateScenario(this.scenarios);
|
|
566
|
+
this.validateVariances(this.variances);
|
|
567
|
+
this.validateDataFormat(this.dataFormat);
|
|
568
|
+
this.validateGrouped(this.grouped);
|
|
569
|
+
this.validateShowGroupTitle(this.showGroupTitle);
|
|
570
|
+
this.validateType(this.type);
|
|
571
|
+
this.validateLimit(this.limit);
|
|
572
|
+
this.validateThereOf(this.thereof);
|
|
573
|
+
this.validatePartOf(this.partof);
|
|
574
|
+
this.validateOrderDirection(this.orderDirection);
|
|
575
|
+
this.validateOrderList(this.order);
|
|
576
|
+
this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal);
|
|
577
|
+
this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent);
|
|
578
|
+
this.validateCategoryWidth(this.categoryWidth);
|
|
579
|
+
this.validateMeasureType(this.measureType);
|
|
580
|
+
this.validateMeasureScale(this.measureScale);
|
|
581
|
+
this.validateColumnThereOf(this.columnthereof);
|
|
582
|
+
this.validateShowMeasureScale(this.showMeasureScale);
|
|
583
|
+
this.validateBarColumns(this.barColumns);
|
|
584
|
+
this.validateBarColumnWidth(this.barColumnWidth);
|
|
585
|
+
this.validateUnitScaling(this.unitScaling);
|
|
586
|
+
this.validatePercentageScaling(this.percentageScaling);
|
|
587
|
+
this.validateScaling(this.scale);
|
|
588
|
+
}
|
|
589
|
+
disconnectedCallback() {
|
|
590
|
+
this.unsubscribe();
|
|
591
|
+
}
|
|
592
|
+
componentDidRender() {
|
|
593
|
+
var _a, _b;
|
|
594
|
+
const { mode } = parseScaling(this.scale);
|
|
595
|
+
// Only auto-scale for 'auto' and 'empty' (blank) modes
|
|
596
|
+
if (mode !== "auto" && mode !== "empty") {
|
|
597
|
+
this._autoScaleGuard = false;
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
// Skip re-measurement after the state-triggered re-render
|
|
601
|
+
if (this._autoScaleGuard) {
|
|
602
|
+
this._autoScaleGuard = false;
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
const host = this.element;
|
|
606
|
+
const { width: parentWidth } = getParentDimensions(host);
|
|
607
|
+
if (parentWidth <= 0)
|
|
608
|
+
return;
|
|
609
|
+
// Measure at base (unscaled) font size to get true content width.
|
|
610
|
+
// This avoids the oscillation where scaled-down content fits → reset
|
|
611
|
+
// to 1 → overflows → scale down → fits → …
|
|
612
|
+
const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
613
|
+
host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
|
|
614
|
+
// Reading scrollWidth forces a synchronous reflow at base size
|
|
615
|
+
const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("div");
|
|
616
|
+
const unscaledWidth = (_b = div === null || div === void 0 ? void 0 : div.scrollWidth) !== null && _b !== void 0 ? _b : host.scrollWidth;
|
|
617
|
+
if (unscaledWidth <= parentWidth + 1) {
|
|
618
|
+
// Content fits at base size — no scaling needed
|
|
619
|
+
this.errors.remove("AUTO_scale");
|
|
620
|
+
if (this.appliedScaleFactor !== 1) {
|
|
621
|
+
this._autoScaleGuard = true;
|
|
622
|
+
this.appliedScaleFactor = 1;
|
|
623
|
+
}
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
// Subtract 1px to account for sub-pixel rounding after scaling,
|
|
627
|
+
// preventing the right edge from being clipped by overflow:hidden.
|
|
628
|
+
const computedFactor = (parentWidth - 1) / unscaledWidth;
|
|
629
|
+
// Apply immediately via CSS var for smooth visual (before state re-render)
|
|
630
|
+
host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
|
|
631
|
+
if (mode === "empty") {
|
|
632
|
+
this.errors.addOrReplace({
|
|
633
|
+
id: "AUTO_scale",
|
|
634
|
+
type: "warning",
|
|
635
|
+
message: `Auto-scaled table by factor ${computedFactor.toFixed(3)}`,
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
this.errors.remove("AUTO_scale");
|
|
640
|
+
}
|
|
641
|
+
// Update state so bar charts re-render at the new scale
|
|
642
|
+
if (Math.abs(computedFactor - this.appliedScaleFactor) > 0.001) {
|
|
643
|
+
this._autoScaleGuard = true;
|
|
644
|
+
this.appliedScaleFactor = computedFactor;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
prepareDataFormat() {
|
|
648
|
+
var _a;
|
|
649
|
+
return DataFormat[(_a = this.dataFormat) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
650
|
+
}
|
|
651
|
+
prepareGrouped() {
|
|
652
|
+
return this.grouped === "true";
|
|
653
|
+
}
|
|
654
|
+
prepareShowGroupTitle() {
|
|
655
|
+
return this.showGroupTitle === "true";
|
|
656
|
+
}
|
|
657
|
+
prepareTableType() {
|
|
658
|
+
var _a;
|
|
659
|
+
return TableType[(_a = this.type) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
660
|
+
}
|
|
661
|
+
prepareLimit() {
|
|
662
|
+
return Math.floor(Number(this.limit) || 0);
|
|
663
|
+
}
|
|
664
|
+
prepareThereOf() {
|
|
665
|
+
if (this.thereof == null || this.thereof.trim() === "") {
|
|
666
|
+
return [];
|
|
667
|
+
}
|
|
668
|
+
return JSON.parse(this.thereof);
|
|
669
|
+
}
|
|
670
|
+
preparePartOf() {
|
|
671
|
+
if (this.partof == null || this.partof.trim() === "") {
|
|
672
|
+
return [];
|
|
673
|
+
}
|
|
674
|
+
return JSON.parse(this.partof);
|
|
675
|
+
}
|
|
676
|
+
prepareOrder() {
|
|
677
|
+
var _a, _b, _c;
|
|
678
|
+
const isAuto = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
679
|
+
let orderStr = this.order;
|
|
680
|
+
if (isAuto && ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedOrder)) {
|
|
681
|
+
orderStr = this.datasetMeta.suggestedOrder;
|
|
682
|
+
}
|
|
683
|
+
const tableOrder = {
|
|
684
|
+
hierarchy: orderStr.split(",").map((entry) => OrderColumn[entry === null || entry === void 0 ? void 0 : entry.toUpperCase()]),
|
|
685
|
+
direction: OrderDirection[(_c = this.orderDirection) === null || _c === void 0 ? void 0 : _c.toUpperCase()],
|
|
686
|
+
};
|
|
687
|
+
return tableOrder;
|
|
688
|
+
}
|
|
689
|
+
prepareI18nMode() {
|
|
690
|
+
return I18nMode.META;
|
|
691
|
+
}
|
|
692
|
+
prepareI18n() {
|
|
693
|
+
const i18nMetaLabelsLocal = ["in", "category", "operation", "there_of", "part_of", "SUM_TOTAL"];
|
|
694
|
+
const i18nMetaLabelsGlobal = globalLabelKeys;
|
|
695
|
+
// system
|
|
696
|
+
const i18nMapLocal = new Map(i18nMetaLabelsLocal.map((key) => [key, this.t(".".concat(key))]));
|
|
697
|
+
const i18nMapGlobal = new Map(i18nMetaLabelsGlobal.map((key) => [key, this.t("global.".concat(key))]));
|
|
698
|
+
return new Map([...i18nMapGlobal.entries(), ...i18nMapLocal.entries()]);
|
|
699
|
+
}
|
|
700
|
+
prepareDataFormatDigits() {
|
|
701
|
+
const formatDigits = {
|
|
702
|
+
percent: this.dataFormatDigitsPercent,
|
|
703
|
+
decimal: this.dataFormatDigitsDecimal,
|
|
704
|
+
};
|
|
705
|
+
return formatDigits;
|
|
706
|
+
}
|
|
707
|
+
prepareScenarios() {
|
|
708
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
709
|
+
const isAuto = ((_a = this.scenarios) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
710
|
+
if ((isBlankInput(this.scenarios) || isAuto) && isBlankInput(this.variances)) {
|
|
711
|
+
if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
712
|
+
if (!isAuto) {
|
|
713
|
+
this.errors.addOrReplace({
|
|
714
|
+
id: "AUTO_scenarios",
|
|
715
|
+
type: "warning",
|
|
716
|
+
message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
this.errors.remove("AUTO_scenarios");
|
|
721
|
+
}
|
|
722
|
+
return this.datasetMeta.availableScenarios;
|
|
723
|
+
}
|
|
724
|
+
return [];
|
|
725
|
+
}
|
|
726
|
+
let scenarios = [];
|
|
727
|
+
if (isAuto || isBlankInput(this.scenarios)) {
|
|
728
|
+
if (((_e = (_d = this.datasetMeta) === null || _d === void 0 ? void 0 : _d.availableScenarios) === null || _e === void 0 ? void 0 : _e.length) > 0) {
|
|
729
|
+
if (!isAuto) {
|
|
730
|
+
this.errors.addOrReplace({
|
|
731
|
+
id: "AUTO_scenarios",
|
|
732
|
+
type: "warning",
|
|
733
|
+
message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
else {
|
|
737
|
+
this.errors.remove("AUTO_scenarios");
|
|
738
|
+
}
|
|
739
|
+
scenarios = scenarios.concat(this.datasetMeta.availableScenarios);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
else {
|
|
743
|
+
this.errors.remove("AUTO_scenarios");
|
|
744
|
+
scenarios = scenarios.concat((_f = this.scenarios) === null || _f === void 0 ? void 0 : _f.split(","));
|
|
745
|
+
}
|
|
746
|
+
if (((_g = this.variances) === null || _g === void 0 ? void 0 : _g.trim().length) > 0) {
|
|
747
|
+
scenarios = scenarios.concat((_h = this.variances) === null || _h === void 0 ? void 0 : _h.split(","));
|
|
748
|
+
}
|
|
749
|
+
return scenarios.map((entry) => entry.trim());
|
|
750
|
+
}
|
|
751
|
+
prepareCategoryWidth() {
|
|
752
|
+
var _a;
|
|
753
|
+
if (isBlankInput(this.categoryWidth)) {
|
|
754
|
+
return TableCategoryWidth.INF;
|
|
755
|
+
}
|
|
756
|
+
return TableCategoryWidth[(_a = this.categoryWidth) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
757
|
+
}
|
|
758
|
+
prepareMeasureScale() {
|
|
759
|
+
if (isBlankInput(this.measureScale)) {
|
|
760
|
+
return "GREATEST";
|
|
761
|
+
}
|
|
762
|
+
if (["_", "k", "M", "G", "T", "P", "E", "Z", "Y", "m", "μ", "n", "p", "P", "f", "a", "z", "y"].includes(this.measureScale.trim())) {
|
|
763
|
+
return this.measureScale.trim();
|
|
764
|
+
}
|
|
765
|
+
if (this.measureScale.trim().toUpperCase() === "LEAST") {
|
|
766
|
+
return this.measureScale.trim();
|
|
767
|
+
}
|
|
768
|
+
return "GREATEST";
|
|
769
|
+
}
|
|
770
|
+
prepareMeasureType() {
|
|
771
|
+
var _a;
|
|
772
|
+
if (isBlankInput(this.measureType)) {
|
|
773
|
+
return MeasureType.VOLUME;
|
|
774
|
+
}
|
|
775
|
+
return MeasureType[(_a = this.measureType) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
776
|
+
}
|
|
777
|
+
prepareColumnThereOf() {
|
|
778
|
+
if (this.columnthereof == null || this.columnthereof.trim() === "") {
|
|
779
|
+
return new Map();
|
|
780
|
+
}
|
|
781
|
+
const parsedString = JSON.parse(this.columnthereof);
|
|
782
|
+
const map = new Map();
|
|
783
|
+
for (const [_key, value] of Object.entries(parsedString)) {
|
|
784
|
+
if (map.has(value["scenario"]) === false) {
|
|
785
|
+
map.set(value["scenario"], []);
|
|
786
|
+
}
|
|
787
|
+
map.get(value["scenario"]).push(value);
|
|
788
|
+
}
|
|
789
|
+
return map;
|
|
790
|
+
}
|
|
791
|
+
prepareTableTitle() {
|
|
792
|
+
if (this.tableTitle === "" || this.tableTitle == null) {
|
|
793
|
+
return "SUM_TOTAL";
|
|
794
|
+
}
|
|
795
|
+
return this.tableTitle;
|
|
796
|
+
}
|
|
797
|
+
prepareShowMeasureScale() {
|
|
798
|
+
return this.showMeasureScale === "true";
|
|
799
|
+
}
|
|
800
|
+
prepareMeasureUnit() {
|
|
801
|
+
if (this.measureUnit === "" || this.measureUnit == null) {
|
|
802
|
+
return "";
|
|
803
|
+
}
|
|
804
|
+
return this.measureUnit;
|
|
805
|
+
}
|
|
806
|
+
prepareFilter() {
|
|
807
|
+
if (this.filter.length === 0) {
|
|
808
|
+
return "";
|
|
809
|
+
}
|
|
810
|
+
return this.filter;
|
|
811
|
+
}
|
|
812
|
+
prepareBarColumnWidth() {
|
|
813
|
+
var _a;
|
|
814
|
+
const key = (_a = this.barColumnWidth) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
815
|
+
const preset = TableBarColumnWidth[key];
|
|
816
|
+
if (preset) {
|
|
817
|
+
return BAR_COLUMN_WIDTH_EM[preset];
|
|
818
|
+
}
|
|
819
|
+
return BAR_COLUMN_WIDTH_EM[TableBarColumnWidth.W10];
|
|
820
|
+
}
|
|
821
|
+
prepareBarColumns() {
|
|
822
|
+
if (isBlankInput(this.barColumns)) {
|
|
823
|
+
return [];
|
|
824
|
+
}
|
|
825
|
+
return this.barColumns.split(",").map((col) => col.trim());
|
|
826
|
+
}
|
|
827
|
+
prepareUnitScaling() {
|
|
828
|
+
if (this.pixelPerUnitGroupMap.has(this.unitScaling)) {
|
|
829
|
+
return this.pixelPerUnitGroupMap.get(this.unitScaling);
|
|
830
|
+
}
|
|
831
|
+
return Number(this.unitScaling);
|
|
832
|
+
}
|
|
833
|
+
preparePercentageScaling() {
|
|
834
|
+
if (this.pixelPerUnitGroupMap.has(this.percentageScaling)) {
|
|
835
|
+
return this.pixelPerUnitGroupMap.get(this.percentageScaling);
|
|
836
|
+
}
|
|
837
|
+
return Number(this.percentageScaling);
|
|
838
|
+
}
|
|
839
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
840
|
+
getDataStructure() {
|
|
841
|
+
const dataSetStructure = {
|
|
842
|
+
ITableDataRow: {
|
|
843
|
+
setName: { type: "string", isOptional: false, description: "" },
|
|
844
|
+
date: { type: "string", isOptional: false, description: "" },
|
|
845
|
+
operation: { type: "string", isOptional: false, description: "" },
|
|
846
|
+
rowGroup: { type: "string", isOptional: false, description: "" },
|
|
847
|
+
rowGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
848
|
+
category: { type: "string", isOptional: false, description: "" },
|
|
849
|
+
categoryIndex: { type: "number", isOptional: false, description: "" },
|
|
850
|
+
subCategory: { type: "string", isOptional: false, description: "" },
|
|
851
|
+
subCategoryIndex: { type: "number", isOptional: false, description: "" },
|
|
852
|
+
columnGroup: { type: "string", isOptional: false, description: "" },
|
|
853
|
+
columnGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
854
|
+
columnSubGroup: { type: "string", isOptional: false, description: "" },
|
|
855
|
+
columnSubGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
856
|
+
ac1: { type: "number", isOptional: false, description: "" },
|
|
857
|
+
ac2: { type: "number", isOptional: false, description: "" },
|
|
858
|
+
ac3: { type: "number", isOptional: false, description: "" },
|
|
859
|
+
ac4: { type: "number", isOptional: false, description: "" },
|
|
860
|
+
pp1: { type: "number", isOptional: false, description: "" },
|
|
861
|
+
pp2: { type: "number", isOptional: false, description: "" },
|
|
862
|
+
pp3: { type: "number", isOptional: false, description: "" },
|
|
863
|
+
pp4: { type: "number", isOptional: false, description: "" },
|
|
864
|
+
fc1: { type: "number", isOptional: false, description: "" },
|
|
865
|
+
fc2: { type: "number", isOptional: false, description: "" },
|
|
866
|
+
fc3: { type: "number", isOptional: false, description: "" },
|
|
867
|
+
fc4: { type: "number", isOptional: false, description: "" },
|
|
868
|
+
pl1: { type: "number", isOptional: false, description: "" },
|
|
869
|
+
pl2: { type: "number", isOptional: false, description: "" },
|
|
870
|
+
pl3: { type: "number", isOptional: false, description: "" },
|
|
871
|
+
pl4: { type: "number", isOptional: false, description: "" },
|
|
872
|
+
},
|
|
873
|
+
};
|
|
874
|
+
return dataSetStructure;
|
|
875
|
+
}
|
|
876
|
+
getEffectiveScaleFactor() {
|
|
877
|
+
const { mode, factor } = parseScaling(this.scale);
|
|
878
|
+
if (mode === "factor")
|
|
879
|
+
return factor;
|
|
880
|
+
if (mode === "auto" || mode === "empty")
|
|
881
|
+
return this.appliedScaleFactor;
|
|
882
|
+
return 1;
|
|
883
|
+
}
|
|
884
|
+
getFontStyles() {
|
|
885
|
+
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
886
|
+
return this.componentStyle(($) => {
|
|
887
|
+
var _a, _b, _c, _d;
|
|
888
|
+
const baseFontSize = ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333;
|
|
889
|
+
return {
|
|
890
|
+
"--bn-font-family": ((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
891
|
+
"--bn-font-size": `${baseFontSize * effectiveFactor}px`,
|
|
892
|
+
"--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
|
|
893
|
+
"--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
|
|
894
|
+
};
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
render() {
|
|
898
|
+
const fontStyles = this.getFontStyles();
|
|
899
|
+
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
900
|
+
return (h(Host, { key: '788f67af1bbc37c0ffe1467503e0708ec52a7f53', style: fontStyles }, h("div", { key: '3f9bcc8cddc8bbdf88681ca3d0ee35e67aa1a04f' }, h("ibcs-table", { key: '74657d8bca08c78313db7f497c0d7267eee97d00', data: this.data, "table-title": this.prepareTableTitle(), scenarios: this.prepareScenarios(), "scenarios-data-format": this.prepareDataFormat(), grouped: this.prepareGrouped(), limit: this.prepareLimit(), showGroupTitle: this.prepareShowGroupTitle(), thereof: this.prepareThereOf(), partof: this.preparePartOf(), order: this.prepareOrder(), categorythereof: this.prepareColumnThereOf(), type: this.prepareTableType(), "category-width": this.prepareCategoryWidth(), dataFormatDigits: this.prepareDataFormatDigits(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode(), "measure-scale": this.prepareMeasureScale(), "measure-type": this.prepareMeasureType(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(), filter: this.prepareFilter(), barColumns: this.prepareBarColumns(), barColumnMaxWidth: this.prepareBarColumnWidth(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), scaleFactor: effectiveFactor }))));
|
|
901
|
+
}
|
|
902
|
+
get element() { return getElement(this); }
|
|
903
|
+
static get watchers() { return {
|
|
904
|
+
"scale": [{
|
|
905
|
+
"validateScaling": 0
|
|
906
|
+
}],
|
|
907
|
+
"scenarios": [{
|
|
908
|
+
"validateScenario": 0
|
|
909
|
+
}],
|
|
910
|
+
"variances": [{
|
|
911
|
+
"validateVariances": 0
|
|
912
|
+
}],
|
|
913
|
+
"barColumns": [{
|
|
914
|
+
"validateBarColumns": 0
|
|
915
|
+
}],
|
|
916
|
+
"barColumnWidth": [{
|
|
917
|
+
"validateBarColumnWidth": 0
|
|
918
|
+
}],
|
|
919
|
+
"unitScaling": [{
|
|
920
|
+
"validateUnitScaling": 0
|
|
921
|
+
}],
|
|
922
|
+
"percentageScaling": [{
|
|
923
|
+
"validatePercentageScaling": 0
|
|
924
|
+
}],
|
|
925
|
+
"dataFormat": [{
|
|
926
|
+
"validateDataFormat": 0
|
|
927
|
+
}],
|
|
928
|
+
"grouped": [{
|
|
929
|
+
"validateGrouped": 0
|
|
930
|
+
}],
|
|
931
|
+
"showMeasureScale": [{
|
|
932
|
+
"validateShowMeasureScale": 0
|
|
933
|
+
}],
|
|
934
|
+
"showGroupTitle": [{
|
|
935
|
+
"validateShowGroupTitle": 0
|
|
936
|
+
}],
|
|
937
|
+
"type": [{
|
|
938
|
+
"validateType": 0
|
|
939
|
+
}],
|
|
940
|
+
"limit": [{
|
|
941
|
+
"validateLimit": 0
|
|
942
|
+
}],
|
|
943
|
+
"thereof": [{
|
|
944
|
+
"validateThereOf": 0
|
|
945
|
+
}],
|
|
946
|
+
"partof": [{
|
|
947
|
+
"validatePartOf": 0
|
|
948
|
+
}],
|
|
949
|
+
"order": [{
|
|
950
|
+
"validateOrderList": 0
|
|
951
|
+
}],
|
|
952
|
+
"orderDirection": [{
|
|
953
|
+
"validateOrderDirection": 0
|
|
954
|
+
}],
|
|
955
|
+
"measureType": [{
|
|
956
|
+
"validateMeasureType": 0
|
|
957
|
+
}],
|
|
958
|
+
"measureScale": [{
|
|
959
|
+
"validateMeasureScale": 0
|
|
960
|
+
}],
|
|
961
|
+
"dataFormatDigitsDecimal": [{
|
|
962
|
+
"validateDataFormatDigitsDecimal": 0
|
|
963
|
+
}],
|
|
964
|
+
"dataFormatDigitsPercent": [{
|
|
965
|
+
"validateDateFormatDigitsPercent": 0
|
|
966
|
+
}],
|
|
967
|
+
"categoryWidth": [{
|
|
968
|
+
"validateCategoryWidth": 0
|
|
969
|
+
}],
|
|
970
|
+
"columnthereof": [{
|
|
971
|
+
"validateColumnThereOf": 0
|
|
972
|
+
}]
|
|
973
|
+
}; }
|
|
974
|
+
};
|
|
975
|
+
Table.style = bnTableCss();
|
|
976
|
+
|
|
977
|
+
export { Table as bn_table };
|