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