@bino-bi/bn-template-engine 1.0.0-alpha.0 → 1.0.0-alpha.11

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 (361) hide show
  1. package/LICENSE +203 -21
  2. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  3. package/dist/bn-template-engine/p-095f74d7.entry.js +1 -0
  4. package/dist/bn-template-engine/p-14318b0d.entry.js +1 -0
  5. package/dist/bn-template-engine/{p-c9f050bf.entry.js → p-2133e02b.entry.js} +1 -1
  6. package/dist/bn-template-engine/p-6b469808.entry.js +1 -0
  7. package/dist/bn-template-engine/p-7HSTE79g.js +1 -0
  8. package/dist/bn-template-engine/p-B4JfKvVT.js +1 -0
  9. package/dist/bn-template-engine/p-B_d-jp99.js +2 -0
  10. package/dist/bn-template-engine/p-Bi2wx-el.js +1 -0
  11. package/dist/bn-template-engine/p-CWiZks2h.js +1 -0
  12. package/dist/bn-template-engine/{p-BQp6ZPYW.js → p-DSXNgKLa.js} +1 -1
  13. package/dist/bn-template-engine/p-c2cbb8ea.entry.js +1 -0
  14. package/dist/bn-template-engine/p-e783733e.entry.js +1 -0
  15. package/dist/bn-template-engine/p-e94b4e31.entry.js +1 -0
  16. package/dist/bn-template-engine/p-fdb3e99a.entry.js +1 -0
  17. package/dist/cjs/bn-asset_21.cjs.entry.js +23995 -0
  18. package/dist/cjs/bn-grid.cjs.entry.js +6 -13
  19. package/dist/cjs/bn-image.cjs.entry.js +6 -13
  20. package/dist/cjs/bn-internationalization.cjs.entry.js +5 -7
  21. package/dist/cjs/bn-template-engine.cjs.js +2 -2
  22. package/dist/cjs/bn-template.cjs.entry.js +4 -6
  23. package/dist/cjs/bn-text.cjs.entry.js +10 -19
  24. package/dist/cjs/bn-tree.cjs.entry.js +11 -14
  25. package/dist/cjs/{context-protocol-BkYHFkXE.js → context-protocol-B_jipZpJ.js} +6 -2
  26. package/dist/cjs/editor-companion.cjs.entry.js +3 -3
  27. package/dist/cjs/{index-CScBFiS1.js → index-CDKG4xmO.js} +2 -2
  28. package/dist/cjs/loader.cjs.js +2 -2
  29. package/dist/cjs/scaling-eyzCrFB8.js +329 -0
  30. package/dist/cjs/{withBodyObserver-B0_W1VOf.js → withBodyObserver-D7BKWN2N.js} +2 -2
  31. package/dist/cjs/{withHasError-Dspb3lIV.js → withHasError-Cl2gTQzA.js} +106 -2
  32. package/dist/{esm/luxon-DbyXf6dF.js → cjs/withStyled-V7xz_x1c.js} +1406 -1
  33. package/dist/collection/collection-manifest.json +2 -10
  34. package/dist/collection/components/bn-body/bn-body.css +1 -0
  35. package/dist/collection/components/bn-card/bn-card.css +2 -0
  36. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +368 -130
  37. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +34 -10
  38. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +94 -11
  39. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +11 -0
  40. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +8 -6
  41. package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +4 -0
  42. package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
  43. package/dist/collection/components/bn-chart-time/bn-chart-time.js +172 -51
  44. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +22 -9
  45. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +3 -3
  46. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -4
  47. package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +4 -0
  48. package/dist/collection/components/bn-dataset/bn-dataset.js +49 -2
  49. package/dist/collection/components/bn-datasource/bn-datasource.js +173 -8
  50. package/dist/collection/components/bn-layout-card/bn-layout-card.css +3 -2
  51. package/dist/collection/components/bn-layout-card/bn-layout-card.js +207 -32
  52. package/dist/collection/components/bn-layout-page/bn-layout-page.css +1 -3
  53. package/dist/collection/components/bn-layout-page/bn-layout-page.js +172 -43
  54. package/dist/collection/components/bn-message/bn-message.js +1 -1
  55. package/dist/collection/components/bn-page/bn-page.js +1 -1
  56. package/dist/collection/components/bn-scaling-group/bn-scaling-group.css +3 -0
  57. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
  58. package/dist/collection/components/bn-table/bn-table.js +201 -58
  59. package/dist/collection/components/bn-table/ibcs-table.css +7 -5
  60. package/dist/collection/components/bn-table/ibcs-table.js +91 -5
  61. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +79 -31
  62. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -1
  63. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +12 -3
  64. package/dist/collection/components/bn-table/utils/helper/ColumnStatistics.js +9 -1
  65. package/dist/collection/components/bn-template/bn-template.js +1 -1
  66. package/dist/collection/components/bn-text/bn-text.js +1 -1
  67. package/dist/collection/components/bn-title/bn-title.js +1 -9
  68. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +1 -4
  69. package/dist/collection/components/bn-tree/bn-tree.js +5 -1
  70. package/dist/collection/components/editor-companion/editor-companion.js +1 -1
  71. package/dist/collection/stores/componentStyles.js +2 -0
  72. package/dist/collection/stores/createScopedStores.js +3 -1
  73. package/dist/collection/utils/DateStringFactory.js +0 -1
  74. package/dist/collection/utils/constants.js +35 -5
  75. package/dist/collection/utils/contentDecoder.js +28 -0
  76. package/dist/collection/utils/layoutObserver.js +88 -0
  77. package/dist/collection/utils/parentDimensions.js +57 -10
  78. package/dist/collection/utils/stackColors.js +2 -2
  79. package/dist/collection/utils/validate.js +5 -2
  80. package/dist/collection/utils/withInheritedProps.js +152 -0
  81. package/dist/collection/utils/withScalingGroup.js +66 -0
  82. package/dist/components/DataFormatDigits.js +1 -1
  83. package/dist/components/DateStringFactory.js +1 -1
  84. package/dist/components/Order.js +1 -1
  85. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  86. package/dist/components/bn-body2.js +1 -1
  87. package/dist/components/bn-card2.js +1 -1
  88. package/dist/components/bn-chart-structure.js +1 -1
  89. package/dist/components/bn-chart-time.js +1 -1
  90. package/dist/components/bn-dataset.js +1 -1
  91. package/dist/components/bn-datasource.js +1 -1
  92. package/dist/components/bn-layout-card.js +1 -1
  93. package/dist/components/bn-layout-page.js +1 -1
  94. package/dist/components/bn-message2.js +1 -1
  95. package/dist/components/bn-page2.js +1 -1
  96. package/dist/components/{test-runner-time.d.ts → bn-scaling-group.d.ts} +4 -4
  97. package/dist/components/bn-scaling-group.js +1 -0
  98. package/dist/components/bn-table.js +1 -1
  99. package/dist/components/bn-template.js +1 -1
  100. package/dist/components/bn-text.js +1 -1
  101. package/dist/components/bn-title2.js +1 -1
  102. package/dist/components/bn-tree.js +1 -1
  103. package/dist/components/contentDecoder.js +1 -0
  104. package/dist/components/context-protocol.js +1 -1
  105. package/dist/components/editor-companion.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/layoutObserver.js +1 -0
  113. package/dist/components/scaling.js +1 -1
  114. package/dist/components/validate.js +1 -1
  115. package/dist/components/withHasError.js +1 -1
  116. package/dist/components/withInheritedProps.js +1 -0
  117. package/dist/components/withStyled.js +1 -1
  118. package/dist/esm/bn-asset_21.entry.js +23973 -0
  119. package/dist/esm/bn-grid.entry.js +4 -11
  120. package/dist/esm/bn-image.entry.js +4 -11
  121. package/dist/esm/bn-internationalization.entry.js +4 -6
  122. package/dist/esm/bn-template-engine.js +3 -3
  123. package/dist/esm/bn-template.entry.js +3 -5
  124. package/dist/esm/bn-text.entry.js +6 -15
  125. package/dist/esm/bn-tree.entry.js +9 -12
  126. package/dist/esm/{context-protocol-DzeqZxg6.js → context-protocol-D-o_UZ33.js} +6 -2
  127. package/dist/esm/editor-companion.entry.js +3 -3
  128. package/dist/esm/{index-B27Ax6P_.js → index-B_d-jp99.js} +2 -2
  129. package/dist/esm/loader.js +3 -3
  130. package/dist/esm/scaling-BzbiBnuN.js +324 -0
  131. package/dist/esm/{withBodyObserver-gZpZiEIK.js → withBodyObserver-AFk2wwHT.js} +2 -2
  132. package/dist/esm/{withHasError-C48fTE2k.js → withHasError-DW_vMDUp.js} +106 -2
  133. package/dist/{cjs/luxon-8hyy5YD7.js → esm/withStyled-5RqF8WBL.js} +1371 -2
  134. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +163 -110
  135. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +4 -3
  136. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +7 -0
  137. package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +2 -0
  138. package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +1 -0
  139. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +29 -12
  140. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +4 -3
  141. package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +1 -0
  142. package/dist/types/components/bn-dataset/bn-dataset.d.ts +6 -0
  143. package/dist/types/components/bn-datasource/bn-datasource.d.ts +48 -5
  144. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +153 -0
  145. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +160 -1
  146. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
  147. package/dist/types/components/bn-table/bn-table.d.ts +32 -17
  148. package/dist/types/components/bn-table/ibcs-table.d.ts +20 -0
  149. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +1 -0
  150. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +1 -0
  151. package/dist/types/components/bn-title/bn-title.d.ts +0 -1
  152. package/dist/types/components.d.ts +438 -461
  153. package/dist/types/context/context-protocol.d.ts +2 -1
  154. package/dist/types/stores/componentStyles.d.ts +2 -0
  155. package/dist/types/stores/createScopedStores.d.ts +1 -0
  156. package/dist/types/utils/constants.d.ts +23 -5
  157. package/dist/types/utils/contentDecoder.d.ts +12 -0
  158. package/dist/types/utils/layoutObserver.d.ts +27 -0
  159. package/dist/types/utils/parentDimensions.d.ts +7 -2
  160. package/dist/types/utils/validate.d.ts +1 -0
  161. package/dist/types/utils/withInheritedProps.d.ts +38 -0
  162. package/dist/types/utils/withScalingGroup.d.ts +14 -0
  163. package/package.json +4 -4
  164. package/readme.md +2 -3
  165. package/dist/bn-template-engine/assets/gpx/Chasing_Legends.gpx +0 -195076
  166. package/dist/bn-template-engine/assets/gpx/Fahrt_am_Nachmittag.gpx +0 -142007
  167. package/dist/bn-template-engine/assets/icons/gpx-finish.png +0 -0
  168. package/dist/bn-template-engine/assets/icons/gpx-shadow.png +0 -0
  169. package/dist/bn-template-engine/assets/icons/gpx-start.png +0 -0
  170. package/dist/bn-template-engine/assets/icons/marker-example.png +0 -0
  171. package/dist/bn-template-engine/assets/icons/pin-icon-end.png +0 -0
  172. package/dist/bn-template-engine/assets/icons/pin-icon-start.png +0 -0
  173. package/dist/bn-template-engine/assets/icons/pin-icon-wpt.png +0 -0
  174. package/dist/bn-template-engine/assets/icons/pin-shadow.png +0 -0
  175. package/dist/bn-template-engine/assets/icons/pin.png +0 -0
  176. package/dist/bn-template-engine/p--TeDldm8.js +0 -1
  177. package/dist/bn-template-engine/p-0e7dc113.entry.js +0 -1
  178. package/dist/bn-template-engine/p-1jFf17Vj.js +0 -1
  179. package/dist/bn-template-engine/p-264c6bad.entry.js +0 -1
  180. package/dist/bn-template-engine/p-326a0902.entry.js +0 -1
  181. package/dist/bn-template-engine/p-38a8bde3.entry.js +0 -1
  182. package/dist/bn-template-engine/p-577eafcd.entry.js +0 -1
  183. package/dist/bn-template-engine/p-5905cc43.entry.js +0 -1
  184. package/dist/bn-template-engine/p-5d155a72.entry.js +0 -1
  185. package/dist/bn-template-engine/p-65f8962a.entry.js +0 -1
  186. package/dist/bn-template-engine/p-6b8d1ebf.entry.js +0 -1
  187. package/dist/bn-template-engine/p-7995acb2.entry.js +0 -1
  188. package/dist/bn-template-engine/p-7afe431e.entry.js +0 -1
  189. package/dist/bn-template-engine/p-8014b1ac.entry.js +0 -1
  190. package/dist/bn-template-engine/p-80423fc8.entry.js +0 -1
  191. package/dist/bn-template-engine/p-91e74d42.entry.js +0 -1
  192. package/dist/bn-template-engine/p-930a9e29.entry.js +0 -1
  193. package/dist/bn-template-engine/p-93C9jL8R.js +0 -1
  194. package/dist/bn-template-engine/p-93ff8584.entry.js +0 -1
  195. package/dist/bn-template-engine/p-B0m0U4wJ.js +0 -1
  196. package/dist/bn-template-engine/p-B27Ax6P_.js +0 -2
  197. package/dist/bn-template-engine/p-B79VcHiT.js +0 -1
  198. package/dist/bn-template-engine/p-BBd0ZVLL.js +0 -1
  199. package/dist/bn-template-engine/p-BFTU3MAI.js +0 -1
  200. package/dist/bn-template-engine/p-BFatTBqh.js +0 -1
  201. package/dist/bn-template-engine/p-BYmPQYxx.js +0 -1
  202. package/dist/bn-template-engine/p-BhEQy-2D.js +0 -1
  203. package/dist/bn-template-engine/p-BtVfu16B.js +0 -1
  204. package/dist/bn-template-engine/p-CY1RzLjU.js +0 -1
  205. package/dist/bn-template-engine/p-CfWnag33.js +0 -1
  206. package/dist/bn-template-engine/p-CnI71OA9.js +0 -1
  207. package/dist/bn-template-engine/p-Cp4MVxCu.js +0 -1
  208. package/dist/bn-template-engine/p-DbyXf6dF.js +0 -1
  209. package/dist/bn-template-engine/p-TdL-LRR9.js +0 -1
  210. package/dist/bn-template-engine/p-_LBTIfNN.js +0 -1
  211. package/dist/bn-template-engine/p-a342cd3c.entry.js +0 -1
  212. package/dist/bn-template-engine/p-ad94cf63.entry.js +0 -1
  213. package/dist/bn-template-engine/p-bc37d750.entry.js +0 -1
  214. package/dist/bn-template-engine/p-d07a0ca3.entry.js +0 -1
  215. package/dist/bn-template-engine/p-e5f372af.entry.js +0 -1
  216. package/dist/bn-template-engine/p-e620028c.entry.js +0 -1
  217. package/dist/bn-template-engine/p-e81e116a.entry.js +0 -1
  218. package/dist/bn-template-engine/p-eca98070.entry.js +0 -1
  219. package/dist/bn-template-engine/p-ee6de950.entry.js +0 -1
  220. package/dist/bn-template-engine/p-efe0ef1e.entry.js +0 -1
  221. package/dist/bn-template-engine/p-f034f1b8.entry.js +0 -1
  222. package/dist/bn-template-engine/p-f1c1a8a3.entry.js +0 -1
  223. package/dist/bn-template-engine/p-fe573a1a.entry.js +0 -1
  224. package/dist/bn-template-engine/p-kMyLevYy.js +0 -1
  225. package/dist/cjs/DataFormatDigits-DmTbhF8q.js +0 -142
  226. package/dist/cjs/DateStringFactory-Dn0aRj2Y.js +0 -453
  227. package/dist/cjs/Order-B4NIqQWe.js +0 -129
  228. package/dist/cjs/SVGVariancesStyleGroup-Czizhngt.js +0 -7973
  229. package/dist/cjs/StringAdapter-0EbYMkR0.js +0 -136
  230. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +0 -10
  231. package/dist/cjs/alasql.min-C_nHTuEQ.js +0 -306
  232. package/dist/cjs/bn-asset.cjs.entry.js +0 -42
  233. package/dist/cjs/bn-body_3.cjs.entry.js +0 -413
  234. package/dist/cjs/bn-card.cjs.entry.js +0 -37
  235. package/dist/cjs/bn-chart-structure.cjs.entry.js +0 -705
  236. package/dist/cjs/bn-chart-time.cjs.entry.js +0 -987
  237. package/dist/cjs/bn-component-style.cjs.entry.js +0 -44
  238. package/dist/cjs/bn-context_5.cjs.entry.js +0 -3380
  239. package/dist/cjs/bn-dataset.cjs.entry.js +0 -278
  240. package/dist/cjs/bn-layout-card.cjs.entry.js +0 -128
  241. package/dist/cjs/bn-layout-page.cjs.entry.js +0 -142
  242. package/dist/cjs/bn-map.cjs.entry.js +0 -425
  243. package/dist/cjs/bn-message.cjs.entry.js +0 -52
  244. package/dist/cjs/componentRegister-C17UFNPh.js +0 -72
  245. package/dist/cjs/constants-DHqQXSSd.js +0 -158
  246. package/dist/cjs/formatter-DIJL_crx.js +0 -215
  247. package/dist/cjs/ibcs-chart-structure.cjs.entry.js +0 -2906
  248. package/dist/cjs/ibcs-chart-time.cjs.entry.js +0 -4140
  249. package/dist/cjs/ibcs-map.cjs.entry.js +0 -1075
  250. package/dist/cjs/ibcs-title.cjs.entry.js +0 -352
  251. package/dist/cjs/scaling-B23eOtsC.js +0 -67
  252. package/dist/cjs/test-runner-card.cjs.entry.js +0 -27
  253. package/dist/cjs/test-runner-chart-time.cjs.entry.js +0 -230
  254. package/dist/cjs/test-runner-chart.cjs.entry.js +0 -326
  255. package/dist/cjs/test-runner-map.cjs.entry.js +0 -1862
  256. package/dist/cjs/test-runner-table.cjs.entry.js +0 -477
  257. package/dist/cjs/test-runner-time.cjs.entry.js +0 -381
  258. package/dist/cjs/test-runner-title.cjs.entry.js +0 -115
  259. package/dist/cjs/withComponentStatus-BrxL7usr.js +0 -39
  260. package/dist/cjs/withComponentStyle-C6KHnZHt.js +0 -128
  261. package/dist/cjs/withDataset-ZdN-RRTx.js +0 -146
  262. package/dist/cjs/withStyled-Bf-stJTR.js +0 -567
  263. package/dist/cjs/withTranslation-Cz0M5maV.js +0 -77
  264. package/dist/collection/components/bn-map/bn-map.css +0 -4
  265. package/dist/collection/components/bn-map/bn-map.js +0 -725
  266. package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Chasing_Legends.gpx +0 -195076
  267. package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Fahrt_am_Nachmittag.gpx +0 -142007
  268. package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-finish.png +0 -0
  269. package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-shadow.png +0 -0
  270. package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-start.png +0 -0
  271. package/dist/collection/components/bn-map/ibcs-map/assets/icons/marker-example.png +0 -0
  272. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-end.png +0 -0
  273. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-start.png +0 -0
  274. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-wpt.png +0 -0
  275. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-shadow.png +0 -0
  276. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin.png +0 -0
  277. package/dist/collection/components/bn-map/ibcs-map/ibcs-map.css +0 -674
  278. package/dist/collection/components/bn-map/ibcs-map/ibcs-map.js +0 -744
  279. package/dist/collection/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.js +0 -9
  280. package/dist/collection/components/bn-map/ibcs-map/utils/model/GpxLayer.js +0 -13
  281. package/dist/collection/components/bn-map/ibcs-map/utils/model/Marker.js +0 -11
  282. package/dist/collection/components/bn-map/ibcs-map/utils/model/index.js +0 -2
  283. package/dist/collection/test-runner/test-runner-card.js +0 -36
  284. package/dist/collection/test-runner/test-runner-chart-time.js +0 -234
  285. package/dist/collection/test-runner/test-runner-chart.js +0 -364
  286. package/dist/collection/test-runner/test-runner-map.js +0 -1901
  287. package/dist/collection/test-runner/test-runner-table.js +0 -469
  288. package/dist/collection/test-runner/test-runner-time.js +0 -399
  289. package/dist/collection/test-runner/test-runner-title.js +0 -108
  290. package/dist/components/bn-map.d.ts +0 -11
  291. package/dist/components/bn-map.js +0 -1
  292. package/dist/components/componentRegister.js +0 -1
  293. package/dist/components/ibcs-map.d.ts +0 -11
  294. package/dist/components/ibcs-map.js +0 -1
  295. package/dist/components/ibcs-map2.js +0 -1
  296. package/dist/components/test-runner-card.d.ts +0 -11
  297. package/dist/components/test-runner-card.js +0 -1
  298. package/dist/components/test-runner-chart-time.d.ts +0 -11
  299. package/dist/components/test-runner-chart-time.js +0 -1
  300. package/dist/components/test-runner-chart.d.ts +0 -11
  301. package/dist/components/test-runner-chart.js +0 -1
  302. package/dist/components/test-runner-map.d.ts +0 -11
  303. package/dist/components/test-runner-map.js +0 -1
  304. package/dist/components/test-runner-table.d.ts +0 -11
  305. package/dist/components/test-runner-table.js +0 -1
  306. package/dist/components/test-runner-time.js +0 -1
  307. package/dist/components/test-runner-title.d.ts +0 -11
  308. package/dist/components/test-runner-title.js +0 -1
  309. package/dist/components/withDataset.js +0 -1
  310. package/dist/esm/DataFormatDigits-Dt6gpIiZ.js +0 -137
  311. package/dist/esm/DateStringFactory-_Qiv0IvF.js +0 -451
  312. package/dist/esm/Order-B4fpLe_f.js +0 -125
  313. package/dist/esm/SVGVariancesStyleGroup-DlWgvpzs.js +0 -7961
  314. package/dist/esm/StringAdapter-BLvo1Krl.js +0 -133
  315. package/dist/esm/_commonjsHelpers-BFTU3MAI.js +0 -7
  316. package/dist/esm/alasql.min-CWu4NkIt.js +0 -304
  317. package/dist/esm/bn-asset.entry.js +0 -40
  318. package/dist/esm/bn-body_3.entry.js +0 -409
  319. package/dist/esm/bn-card.entry.js +0 -35
  320. package/dist/esm/bn-chart-structure.entry.js +0 -703
  321. package/dist/esm/bn-chart-time.entry.js +0 -985
  322. package/dist/esm/bn-component-style.entry.js +0 -42
  323. package/dist/esm/bn-context_5.entry.js +0 -3374
  324. package/dist/esm/bn-dataset.entry.js +0 -276
  325. package/dist/esm/bn-layout-card.entry.js +0 -126
  326. package/dist/esm/bn-layout-page.entry.js +0 -140
  327. package/dist/esm/bn-map.entry.js +0 -423
  328. package/dist/esm/bn-message.entry.js +0 -50
  329. package/dist/esm/componentRegister-BtVfu16B.js +0 -72
  330. package/dist/esm/constants-kMyLevYy.js +0 -158
  331. package/dist/esm/formatter-DTMEZ6d8.js +0 -211
  332. package/dist/esm/ibcs-chart-structure.entry.js +0 -2904
  333. package/dist/esm/ibcs-chart-time.entry.js +0 -4138
  334. package/dist/esm/ibcs-map.entry.js +0 -1073
  335. package/dist/esm/ibcs-title.entry.js +0 -350
  336. package/dist/esm/scaling-BBd0ZVLL.js +0 -64
  337. package/dist/esm/test-runner-card.entry.js +0 -25
  338. package/dist/esm/test-runner-chart-time.entry.js +0 -228
  339. package/dist/esm/test-runner-chart.entry.js +0 -324
  340. package/dist/esm/test-runner-map.entry.js +0 -1860
  341. package/dist/esm/test-runner-table.entry.js +0 -475
  342. package/dist/esm/test-runner-time.entry.js +0 -379
  343. package/dist/esm/test-runner-title.entry.js +0 -113
  344. package/dist/esm/withComponentStatus-elELReKt.js +0 -37
  345. package/dist/esm/withComponentStyle-NaxfakAG.js +0 -126
  346. package/dist/esm/withDataset-BT2VQCsG.js +0 -144
  347. package/dist/esm/withStyled-CpUTv74m.js +0 -539
  348. package/dist/esm/withTranslation-Do4GhleK.js +0 -75
  349. package/dist/types/components/bn-map/bn-map.d.ts +0 -122
  350. package/dist/types/components/bn-map/ibcs-map/ibcs-map.d.ts +0 -73
  351. package/dist/types/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.d.ts +0 -8
  352. package/dist/types/components/bn-map/ibcs-map/utils/model/GpxLayer.d.ts +0 -11
  353. package/dist/types/components/bn-map/ibcs-map/utils/model/Marker.d.ts +0 -9
  354. package/dist/types/components/bn-map/ibcs-map/utils/model/index.d.ts +0 -2
  355. package/dist/types/test-runner/test-runner-card.d.ts +0 -3
  356. package/dist/types/test-runner/test-runner-chart-time.d.ts +0 -3
  357. package/dist/types/test-runner/test-runner-chart.d.ts +0 -3
  358. package/dist/types/test-runner/test-runner-map.d.ts +0 -3
  359. package/dist/types/test-runner/test-runner-table.d.ts +0 -3
  360. package/dist/types/test-runner/test-runner-time.d.ts +0 -3
  361. package/dist/types/test-runner/test-runner-title.d.ts +0 -3
@@ -1,3380 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CScBFiS1.js');
4
- var contextProtocol = require('./context-protocol-BkYHFkXE.js');
5
- var withComponentStatus = require('./withComponentStatus-BrxL7usr.js');
6
- var withHasError = require('./withHasError-Dspb3lIV.js');
7
- var withBodyObserver = require('./withBodyObserver-B0_W1VOf.js');
8
- var withStyled = require('./withStyled-Bf-stJTR.js');
9
- var withComponentStyle = require('./withComponentStyle-C6KHnZHt.js');
10
- var withDataset = require('./withDataset-ZdN-RRTx.js');
11
- var withTranslation = require('./withTranslation-Cz0M5maV.js');
12
- var scaling = require('./scaling-B23eOtsC.js');
13
- var constants = require('./constants-DHqQXSSd.js');
14
- var Order = require('./Order-B4NIqQWe.js');
15
- var formatter = require('./formatter-DIJL_crx.js');
16
- var alasql_min = require('./alasql.min-C_nHTuEQ.js');
17
- var StringAdapter = require('./StringAdapter-0EbYMkR0.js');
18
- var DataFormatDigits = require('./DataFormatDigits-DmTbhF8q.js');
19
- require('./componentRegister-C17UFNPh.js');
20
- require('./DateStringFactory-Dn0aRj2Y.js');
21
- require('./luxon-8hyy5YD7.js');
22
- require('./_commonjsHelpers-BJu3ubxk.js');
23
-
24
- const bnContextCss = () => `:host{display:block}`;
25
-
26
- const Context = class {
27
- constructor(hostRef) {
28
- index.registerInstance(this, hostRef);
29
- this.currentPageUpdate = undefined;
30
- withComponentStatus.withComponentStatus(this);
31
- this.errors = withHasError.withHasError(this);
32
- }
33
- setLocale(newValue) {
34
- this.stores.context.state.locale = newValue;
35
- }
36
- connectedCallback() {
37
- // Retrieve (or create) the stores for this context element.
38
- // A descendant component may have already triggered creation via
39
- // getStores() if Stencil initialized it before this component.
40
- this.stores = contextProtocol.getOrCreateStores(this.element);
41
- if (this.locale) {
42
- this.stores.context.state.locale = this.locale;
43
- }
44
- this.currentPageUpdate = setTimeout(() => {
45
- this.element.querySelectorAll("bn-page, bn-layout-page").forEach((page, index) => {
46
- if (page.localName === "bn-layout-page") {
47
- page.setAttribute("page-number", (index + 1).toString());
48
- }
49
- else {
50
- const footer = page.querySelector("bn-footer");
51
- if (footer) {
52
- // @ts-ignore
53
- footer.setAttribute("page-number", (index + 1).toString());
54
- }
55
- }
56
- });
57
- }, 250);
58
- }
59
- disconnectedCallback() {
60
- if (this.currentPageUpdate) {
61
- clearTimeout(this.currentPageUpdate);
62
- }
63
- }
64
- componentWillLoad() {
65
- // stencil needs one componenet implementing all lifecycle steps to get mixing working
66
- }
67
- componentDidLoad() { }
68
- componentShouldUpdate() { }
69
- componentWillRender() { }
70
- componentDidRender() { }
71
- componentWillUpdate() { }
72
- componentDidUpdate() { }
73
- render() {
74
- return (index.h(index.Host, { key: 'b92019b909e271225baca2cf740c8301e324164e' }, index.h("slot", { key: '87bac4bb29bca32d961afe31355dc1bd48fff0f8' })));
75
- }
76
- get element() { return index.getElement(this); }
77
- static get watchers() { return {
78
- "locale": [{
79
- "setLocale": 0
80
- }]
81
- }; }
82
- };
83
- Context.style = bnContextCss();
84
-
85
- const bnDatasourceCss = () => `bn-datasource{display:none}`;
86
-
87
- const Datasource = class {
88
- constructor(hostRef) {
89
- index.registerInstance(this, hostRef);
90
- withComponentStatus.withComponentStatus(this);
91
- this.errors = withHasError.withHasError(this);
92
- withBodyObserver.withBodyObserver(this, (data) => {
93
- if (!this.stores)
94
- this.stores = contextProtocol.getStores(this.element);
95
- try {
96
- const json = JSON.parse(data);
97
- // @ts-ignore
98
- this.stores.datasources.set(this.name, json);
99
- }
100
- catch (e) {
101
- console.error("Error parsing datasource", e, data);
102
- // @ts-ignore
103
- this.stores.datasources.set(this.name, []);
104
- }
105
- });
106
- }
107
- render() {
108
- return index.h(index.Host, { key: 'e47e62c941bb7954cabe331cb500a7d2fdd7c487' });
109
- }
110
- get element() { return index.getElement(this); }
111
- };
112
- Datasource.style = bnDatasourceCss();
113
-
114
- const bnPageCss = () => `:host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);height:768px;width:1024px;display:flex;flex-direction:column;page-break-after:always;overflow:hidden}:host([format=xga]){height:768px;width:1024px}:host([format=xga][orientation=portrait]){height:1024px;width:768px}:host([format=xga][orientation=landscape]){height:768px;width:1024px}:host([format=hd]){height:720px;width:1280px}:host([format=hd][orientation=portrait]){height:1280px;width:720px}:host([format=hd][orientation=landscape]){height:720px;width:1280px}:host([format=full_hd]){height:1080px;width:1920px}:host([format=full_hd][orientation=portrait]){height:1920px;width:1080px}:host([format=full_hd][orientation=landscape]){height:1080px;width:1920px}:host([format="4k"]){height:2160px;width:3840px}:host([format="4k"][orientation=portrait]){height:3840px;width:2160px}:host([format="4k"][orientation=landscape]){height:2160px;width:3840px}:host([format="4k2k"]){height:2160px;width:4096px}:host([format="4k2k"][orientation=portrait]){height:4096px;width:2160px}:host([format="4k2k"][orientation=landscape]){height:2160px;width:4096px}:host([format=a6]){height:5.83in;width:4.13in}:host([format=a6][orientation=portrait]){height:5.83in;width:4.13in}:host([format=a6][orientation=landscape]){height:4.13in;width:5.83in}:host([format=a5]){height:8.27in;width:5.83in}:host([format=a5][orientation=portrait]){height:8.27in;width:5.83in}:host([format=a5][orientation=landscape]){height:5.83in;width:8.27in}:host([format=a4]){height:11.6in;width:8.17in}:host([format=a4][orientation=portrait]){height:11.6in;width:8.17in}:host([format=a4][orientation=landscape]){height:8.17in;width:11.6in}:host([format=a3]){height:16.54in;width:11.7in}:host([format=a3][orientation=portrait]){height:16.54in;width:11.7in}:host([format=a3][orientation=landscape]){height:11.7in;width:16.54in}:host([format=a2]){height:23.4in;width:16.54in}:host([format=a2][orientation=portrait]){height:23.4in;width:16.54in}:host([format=a2][orientation=landscape]){height:16.54in;width:23.4in}:host([format=a1]){height:33.1in;width:23.4in}:host([format=a1][orientation=portrait]){height:33.1in;width:23.4in}:host([format=a1][orientation=landscape]){height:23.4in;width:33.1in}:host([format=a0]){height:46.8in;width:33.1in}:host([format=a0][orientation=portrait]){height:46.8in;width:33.1in}:host([format=a0][orientation=landscape]){height:33.1in;width:46.8in}:host([format=letter]){height:11in;width:8.5in}:host([format=letter][orientation=portrait]){height:11in;width:8.5in}:host([format=letter][orientation=landscape]){height:8.5in;width:11in}:host([format=legal]){height:14in;width:8.5in}:host([format=legal][orientation=portrait]){height:14in;width:8.5in}:host([format=legal][orientation=landscape]){height:8.5in;width:14in}:host([format=tabloid]){height:17in;width:11in}:host([format=tabloid][orientation=portrait]){height:17in;width:11in}:host([format=tabloid][orientation=landscape]){height:11in;width:17in}:host([format=ledger]){height:11in;width:17in}:host([format=ledger][orientation=portrait]){height:17in;width:11in}:host([format=ledger][orientation=landscape]){height:11in;width:17in}`;
115
-
116
- const VALID_FORMATS = ["xga", "hd", "full-hd", "4k", "4k2k", "a4", "a3", "a2", "a1", "a0", "letter", "legal"];
117
- const VALID_ORIENTATIONS = ["landscape", "portrait"];
118
- const Page = class {
119
- constructor(hostRef) {
120
- index.registerInstance(this, hostRef);
121
- withComponentStatus.withComponentStatus(this);
122
- this.errors = withHasError.withHasError(this);
123
- this.componentStyle = withComponentStyle.withComponentStyle(this);
124
- }
125
- validateFormat(newValue) {
126
- const errId = "ERR_format";
127
- if (!withStyled.isBlankInput(newValue) && !VALID_FORMATS.includes(newValue)) {
128
- this.errors.addOrReplace({
129
- id: errId,
130
- type: "warning",
131
- message: `format: invalid value '${newValue}' is not supported. Valid values: ${VALID_FORMATS.join(", ")}`,
132
- });
133
- }
134
- else {
135
- this.errors.remove(errId);
136
- }
137
- }
138
- validateOrientation(newValue) {
139
- const errId = "ERR_orientation";
140
- if (!withStyled.isBlankInput(newValue) && !VALID_ORIENTATIONS.includes(newValue)) {
141
- this.errors.addOrReplace({
142
- id: errId,
143
- type: "warning",
144
- message: `orientation: invalid value '${newValue}' is not supported. Valid values: ${VALID_ORIENTATIONS.join(", ")}`,
145
- });
146
- }
147
- else {
148
- this.errors.remove(errId);
149
- }
150
- }
151
- render() {
152
- return (index.h(index.Host, { key: '7623fe9a67534d467f10d7ad25afb201e895110f', format: this.format, orientation: this.orientation, style: this.prepareStyle() }, index.h("slot", { key: '8a2e3cce4449d2ce5ce898aff45ca8b4b903ab6c' })));
153
- }
154
- prepareStyle() {
155
- const pageStyle = {
156
- "font-family": this.componentStyle(($) => $.global["fontFamily"]),
157
- "font-size": `${this.componentStyle(($) => $.global["fontSizePx"])}px`,
158
- "--bn-font-family": this.componentStyle(($) => $.global["fontFamily"]) || "'Noto Sans', sans-serif",
159
- "--bn-font-size": `${this.componentStyle(($) => $.global["fontSizePx"]) || 13.3333}px`,
160
- "--bn-font-color": this.componentStyle(($) => $.global["fontColor"]) || "#000000",
161
- "--bn-font-background": this.componentStyle(($) => $.global["fontBackgroundColor"]) || "#ffffff",
162
- };
163
- return pageStyle;
164
- }
165
- get element() { return index.getElement(this); }
166
- static get watchers() { return {
167
- "format": [{
168
- "validateFormat": 0
169
- }],
170
- "orientation": [{
171
- "validateOrientation": 0
172
- }]
173
- }; }
174
- };
175
- Page.style = bnPageCss();
176
-
177
- /** Sentinel value indicating all groups should be included. */
178
- var GroupSelection;
179
- (function (GroupSelection) {
180
- GroupSelection[GroupSelection["ALL"] = -1] = "ALL";
181
- })(GroupSelection || (GroupSelection = {}));
182
- /**
183
- * Tracks whether a factory's output is current or needs recalculation.
184
- * Used to avoid redundant re-rendering when underlying data has not changed.
185
- */
186
- var FactoryState;
187
- (function (FactoryState) {
188
- /** Output matches the current input data. */
189
- FactoryState[FactoryState["UP_TO_DATE"] = 0] = "UP_TO_DATE";
190
- /** Input data has changed; output needs to be regenerated. */
191
- FactoryState[FactoryState["DIRTY"] = 1] = "DIRTY";
192
- })(FactoryState || (FactoryState = {}));
193
- /**
194
- * Table aggregation modes controlling how rows are grouped and totalled.
195
- *
196
- * - `LIST` -- Flat list with no aggregation.
197
- * - `SUM` -- Grouped rows with sum totals per group and a grand total.
198
- * - `SUMNOTOTAL` -- Grouped rows with group sums but no grand total row.
199
- * - `OPT` -- Operation-aware aggregation (respects the +/- operation field).
200
- * - `OPTNOTOTAL` -- Operation-aware aggregation without a grand total row.
201
- */
202
- var TableType;
203
- (function (TableType) {
204
- TableType["LIST"] = "list";
205
- TableType["SUM"] = "sum";
206
- TableType["SUMNOTOTAL"] = "sumnototal";
207
- TableType["OPT"] = "opt";
208
- TableType["OPTNOTOTAL"] = "optnototal";
209
- })(TableType || (TableType = {}));
210
- var OrderDirection;
211
- (function (OrderDirection) {
212
- OrderDirection["ASC"] = "asc";
213
- OrderDirection["DESC"] = "desc";
214
- })(OrderDirection || (OrderDirection = {}));
215
- /**
216
- * Discriminator for rendered table rows, controlling visual styling and behavior.
217
- *
218
- * - `HEADER` -- Column header row.
219
- * - `GROUPHEAD` -- Group title row (rendered when `grouped` is true).
220
- * - `SEPERATORLINE` -- Visual divider between groups.
221
- * - `SUM` -- Grand total row.
222
- * - `GROUPSUM` -- Sub-total row for a single group.
223
- * - `DRILLELEMENT` -- "Thereof" drill-down sub-row.
224
- * - `STANDARD` -- Normal data row.
225
- * - `PARTELEMENT` -- "Part of" percentage row.
226
- * - `ENTRY` -- Generic entry row.
227
- */
228
- var TableRowType;
229
- (function (TableRowType) {
230
- TableRowType["HEADER"] = "HEADER";
231
- TableRowType["GROUPHEAD"] = "GROUPHEAD";
232
- TableRowType["SEPERATORLINE"] = "SEPERATORLINE";
233
- TableRowType["SUM"] = "SUM";
234
- TableRowType["GROUPSUM"] = "GROUP_SUM";
235
- TableRowType["DRILLELEMENT"] = "DRILLELEMENT";
236
- TableRowType["STANDARD"] = "STANDARD";
237
- TableRowType["PARTELEMENT"] = "PARTELEMENT";
238
- TableRowType["ENTRY"] = "ENTRY";
239
- })(TableRowType || (TableRowType = {}));
240
-
241
- const bnTableCss = () => `:host{display:inline-block;position:relative;overflow:hidden}`;
242
-
243
- const Table$1 = class Table {
244
- validateScaling(newValue) {
245
- if (newValue == null || newValue === "" || newValue === "none" || newValue === "auto") {
246
- this.errors.remove("ERR_scale");
247
- return;
248
- }
249
- const num = Number(newValue);
250
- if (isNaN(num) || num <= 0) {
251
- this.errors.addOrReplace({
252
- id: "ERR_scale",
253
- type: "warning",
254
- message: `Invalid scale value: "${newValue}". Use "none", "auto", or a positive number.`,
255
- });
256
- }
257
- else {
258
- this.errors.remove("ERR_scale");
259
- }
260
- }
261
- constructor(hostRef) {
262
- index.registerInstance(this, hostRef);
263
- this.data = [];
264
- this.datasetMeta = null;
265
- this.appliedScaleFactor = 1;
266
- /**
267
- * A not mundane tile which should describes the shown data.
268
- */
269
- this.tableTitle = "";
270
- /**
271
- * AlaSQL WHERE clause fragment injected into the data query to filter
272
- * rows before rendering (e.g. `"category = 'Sales'"`).
273
- */
274
- this.filter = "";
275
- /**
276
- * measureUnit displayed in table.
277
- */
278
- this.measureUnit = "";
279
- /**
280
- * Scaling for absolute variance bar charts (ΔPY).
281
- * <br /><br />
282
- * Name of the 'scaling-group' which the table uses.
283
- * Scaling groups are maintained globally.
284
- * <br /><br />
285
- * Alternatively a number which represents pixels per unit of measure.
286
- * <br /><br />
287
- * Example: 0.01 means 1000 units = 10 pixels width.
288
- * <br /><br />
289
- * Default: 0.01
290
- */
291
- this.unitScaling = 0.01;
292
- /**
293
- * Scaling for relative variance pin charts (ΔPY%).
294
- * <br /><br />
295
- * Name of the 'scaling-group' which the table uses.
296
- * Scaling groups are maintained globally.
297
- * <br /><br />
298
- * Alternatively a number which represents pixels per percentage point.
299
- * <br /><br />
300
- * Example: 0.5 means 100% = 50 pixels width.
301
- * <br /><br />
302
- * Default: 0.5
303
- */
304
- this.percentageScaling = 0.5;
305
- // Global scaling groups map - can be populated externally for shared scaling across components
306
- this.pixelPerUnitGroupMap = new Map();
307
- /**
308
- * Defines the data unit type of the tables data.
309
- * <br /><br />
310
- * If percent is chosen all data values are converted into percent
311
- * (0.02 -> 2%)
312
- * <br /><br />
313
- * values: <br />
314
- * ```percent // decimal```
315
- */
316
- this.dataFormat = "decimal";
317
- /**
318
- * Toggles of data should be grouped by
319
- * 'rowgroup'.
320
- * <br /><br />
321
- * values: <br />
322
- * ```true // false```
323
- */
324
- this.grouped = "false";
325
- /**
326
- * Toggles display of measure units in table header
327
- * <br /><br />
328
- * values: <br />
329
- * ```true // false```
330
- */
331
- this.showMeasureScale = "false";
332
- /**
333
- * Toggles a title header for each (row-)group
334
- * the title header value is found set by 'rowgroup'
335
- * <br /><br />
336
- * values: <br />
337
- * ```true // false```
338
- *
339
- */
340
- this.showGroupTitle = "true";
341
- /**
342
- * Set the table type
343
- * <br /><br />
344
- * values: <br />
345
- * ```list // sum // opt // sumnototal // optnototal```
346
- *
347
- */
348
- this.type = "list";
349
- /**
350
- * Set the maximum number of rows for each
351
- * group. The value 0 means *no limit*
352
- * <br /><br />
353
- * rows wich where cut by the limit are cumulated as REST
354
- *
355
- */
356
- this.limit = 0;
357
- /**
358
- * Stringified Array of drilldown Objects {
359
- "rowGroup": string,<br />
360
- "category": string,<br />
361
- "subCategory": string,<br />
362
- },<br /><br />
363
- * rowgroup, categroy defines the location of the drill
364
- * subcategory is the displayed label of the data row
365
- *<br /><br />
366
- * example:<br />
367
- * ```[{
368
- "rowGroup":"Umsatz",
369
- "category": "Applications",
370
- "subCategory": "Applications-A",
371
- },]```
372
- */
373
- this.thereof = "[]";
374
- /**
375
- * Stringified Array of Partof Objects <br />{<br />
376
- "rowGroup": string,<br />
377
- "category": string<br />
378
- },<br /><br />
379
- * rowgroup, categroy defines the location of the drill
380
- * percentage of category in rowgorup
381
- *<br /><br />
382
- * example:<br />
383
- * ```[{
384
- "rowGroups":"Umsatz",
385
- "category": "Applications",
386
- },]```
387
- */
388
- this.partof = "[]";
389
- /** List of the primary scenarios on which the order direction are applied valid scenarios are
390
- * If order is set to a scenario it has also exists in scenariolist
391
- * <br /><br />
392
- * values: <br />
393
- * ```category // categoryindex // rowgroup // rowgroup // rowgroupindex // ac[1-4] // fc[1-4] // pp[1-4] // pl[1-4] // auto```
394
- * <br /><br />
395
- * When set to ```auto```, order is detected from the dataset silently.
396
- */
397
- this.order = "category";
398
- /** Set sorting order direction
399
- * <br /><br />
400
- * values: <br />
401
- * ```asc // desc```
402
- */
403
- this.orderDirection = "asc";
404
- /** Sets the Measure Type of the Table
405
- * volume is different displayed and interpreted as currency
406
- * names of siprefix are adapted.
407
- * <br /><br />
408
- * values: <br />
409
- * ```volume // currency```
410
-
411
- */
412
- this.measureType = "volume";
413
- /**
414
- * Sets the SiPrefix of the Mesaurements and converts the
415
- * original value.
416
- * <br /><br />
417
- * values: <br />
418
- * ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p // P // f // a // z // y // GREATEST // LEAST```
419
- * <br /><br />
420
- * SiPrefix overview:
421
- * ``` "Y": 1E+24,```<br />
422
- * ``` "Z": 1E+21,```<br />
423
- * ``` "E": 1E+18,```<br />
424
- * ``` "P": 1E+15,```<br />
425
- * ``` "T": 1E+12,```<br />
426
- * ``` "G": 1000000000,```<br />
427
- * ``` "M": 1000000,```<br />
428
- * ``` "k": 1000,```<br />
429
- * <br />
430
- * ``` "m": 0.001,```<br />
431
- * ``` "μ": 0.000001,```<br />
432
- * ``` "n": 0.000000001,```<br />
433
- * ``` "p": 0.000000000001,```<br />
434
- * ``` "f": 0.000000000000001,```<br />
435
- * ``` "a": 0.000000000000000001,```<br />
436
- * ``` "z": 0.000000000000000000001,```<br />
437
- * ``` "y": 0.000000000000000000000001,```<br />
438
- * <br /><br />
439
- * Special modes:
440
- * ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br />
441
- * ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br />
442
- *<br /><br />
443
- * ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
444
- *
445
- *
446
- */
447
- this.measureScale = "greatest";
448
- /**
449
- * Number of decimal digits in a table cell
450
- */
451
- this.dataFormatDigitsDecimal = 1;
452
- /**
453
- * Number of percent digits in a table cell
454
- */
455
- this.dataFormatDigitsPercent = 2;
456
- /**
457
- * Set width of category column. <br />
458
- * If INF is selected the columns scaling to the min space they need
459
- * seperatly.
460
- * <br /><br />
461
- * values:<br />
462
- * ``` w5 // w10 // w15 // w20 // w25 // w50 // inf ```
463
- */
464
- this.categoryWidth = "w15";
465
- /**
466
- * Defines which drill-column is displayed. <br />
467
- * <br /><br />
468
- * ```scenario``` the scenaro to drill <br/>
469
- * ```group``` is a list of child columns of the parent <br/><br/>
470
- * ```subGroups``` is a list of child columns of the parent <br/><br/>
471
- * example:<br />
472
- * ```[{"scenario": "ac1", "name": "DE", "subGroups": ["Berlin"]},
473
- * {"scenario": "ac2", "name": "UK", "subGroups": []}],
474
- * ```
475
- */
476
- this.columnthereof = null;
477
- this._autoScaleGuard = false;
478
- withStyled.withStyled(this);
479
- withComponentStatus.withComponentStatus(this);
480
- this.errors = withHasError.withHasError(this);
481
- this.componentStyle = withComponentStyle.withComponentStyle(this);
482
- withDataset.withDataset(this, (_name, data) => {
483
- this.data = (data || []);
484
- }, (_name, meta) => {
485
- this.datasetMeta = meta;
486
- });
487
- this.t = withTranslation.withTranslation(this).t;
488
- }
489
- validateScenario(newValue) {
490
- const errId = "ERR_scenarios";
491
- const invalidScenarios = withStyled.validateScenarioList(newValue);
492
- if (invalidScenarios.length > 0) {
493
- this.errors.addOrReplace({
494
- id: errId,
495
- type: "warning",
496
- message: "scenarios: invalid value(s) '" + (invalidScenarios === null || invalidScenarios === void 0 ? void 0 : invalidScenarios.toString()) + "' are not supported.",
497
- });
498
- }
499
- else {
500
- this.errors.remove(errId);
501
- }
502
- }
503
- validateVariances(newValue) {
504
- const errId = "ERR_variances";
505
- const invalidVariances = withStyled.validateVariancesList(newValue);
506
- if (invalidVariances.length > 0) {
507
- this.errors.addOrReplace({
508
- id: errId,
509
- type: "warning",
510
- message: "variances: invalid value(s) '" + JSON.stringify(invalidVariances) + "' are not supported.",
511
- });
512
- }
513
- else {
514
- this.errors.remove(errId);
515
- }
516
- }
517
- validateBarColumns(newValue) {
518
- const errId = "ERR_barColumns";
519
- if (withStyled.isBlankInput(newValue)) {
520
- this.errors.remove(errId);
521
- return;
522
- }
523
- const invalidColumns = withStyled.validateVariancesList(newValue);
524
- if (invalidColumns.length > 0) {
525
- this.errors.addOrReplace({
526
- id: errId,
527
- type: "warning",
528
- message: "barColumns: invalid value(s) '" + JSON.stringify(invalidColumns) + "' are not supported.",
529
- });
530
- }
531
- else {
532
- this.errors.remove(errId);
533
- }
534
- }
535
- validateUnitScaling(newValue) {
536
- const errId = "ERR_unitScaling";
537
- if (!withStyled.isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
538
- this.errors.addOrReplace({
539
- id: errId,
540
- type: "warning",
541
- message: "unitScaling: invalid value '" + newValue + "' is not supported.",
542
- });
543
- }
544
- else {
545
- this.errors.remove(errId);
546
- }
547
- }
548
- validatePercentageScaling(newValue) {
549
- const errId = "ERR_percentageScaling";
550
- if (!withStyled.isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
551
- this.errors.addOrReplace({
552
- id: errId,
553
- type: "warning",
554
- message: "percentageScaling: invalid value '" + newValue + "' is not supported.",
555
- });
556
- }
557
- else {
558
- this.errors.remove(errId);
559
- }
560
- }
561
- validateDataFormat(newValue) {
562
- const errId = "ERR_dataFormat";
563
- if (!withStyled.isValidDataFormat(newValue)) {
564
- this.errors.addOrReplace({
565
- id: errId,
566
- type: "warning",
567
- message: "dataFormat: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
568
- });
569
- }
570
- else {
571
- this.errors.remove(errId);
572
- }
573
- }
574
- validateGrouped(newValue) {
575
- const errId = "ERR_grouped";
576
- if (!withStyled.isValidBoolean(newValue)) {
577
- this.errors.addOrReplace({
578
- id: errId,
579
- type: "warning",
580
- message: "grouped: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
581
- });
582
- }
583
- else {
584
- this.errors.remove(errId);
585
- }
586
- }
587
- validateShowMeasureScale(newValue) {
588
- const errId = "ERR_grouped";
589
- if (!withStyled.isValidBoolean(newValue)) {
590
- this.errors.addOrReplace({
591
- id: errId,
592
- type: "warning",
593
- message: "showMeasureScale: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
594
- });
595
- }
596
- else {
597
- this.errors.remove(errId);
598
- }
599
- }
600
- validateShowGroupTitle(newValue) {
601
- const errId = "ERR_showGroupTitle";
602
- if (!withStyled.isValidBoolean(newValue)) {
603
- this.errors.addOrReplace({
604
- id: errId,
605
- type: "warning",
606
- message: "showGroupTitle: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
607
- });
608
- }
609
- else {
610
- this.errors.remove(errId);
611
- }
612
- }
613
- validateType(newValue) {
614
- const errId = "ERR_type";
615
- if (!withStyled.isValidTableType(newValue)) {
616
- this.errors.addOrReplace({
617
- id: errId,
618
- type: "warning",
619
- message: "type: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
620
- });
621
- }
622
- else {
623
- this.errors.remove(errId);
624
- }
625
- }
626
- validateLimit(newValue) {
627
- const errId = "ERR_limit";
628
- if (!withStyled.isValidInteger(newValue)) {
629
- this.errors.addOrReplace({
630
- id: errId,
631
- type: "warning",
632
- message: "order: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
633
- });
634
- }
635
- else {
636
- this.errors.remove(errId);
637
- }
638
- }
639
- validateThereOf(newValue) {
640
- const errId = "ERR_thereof";
641
- const invalidElements = withStyled.validateThereOfJsonStr(newValue);
642
- if (invalidElements.length > 0) {
643
- this.errors.addOrReplace({
644
- id: errId,
645
- type: "warning",
646
- message: "ThereOf: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
647
- });
648
- }
649
- else {
650
- this.errors.remove(errId);
651
- }
652
- }
653
- validatePartOf(newValue) {
654
- const errId = "ERR_partof";
655
- const invalidElements = withStyled.validatePartOfJsonStr(newValue);
656
- if (invalidElements.length > 0) {
657
- this.errors.addOrReplace({
658
- id: errId,
659
- type: "warning",
660
- message: "partof: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
661
- });
662
- }
663
- else {
664
- this.errors.remove(errId);
665
- }
666
- }
667
- validateOrderList(newValue) {
668
- const errId = "ERR_order";
669
- const invalidElements = withStyled.validateOrderList(newValue);
670
- if (invalidElements.length > 0) {
671
- this.errors.addOrReplace({
672
- id: errId,
673
- type: "warning",
674
- message: "order: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
675
- });
676
- }
677
- else {
678
- this.errors.remove(errId);
679
- }
680
- }
681
- validateOrderDirection(newValue) {
682
- const errId = "ERR_orderDirection";
683
- if (!withStyled.isValidDirection(newValue)) {
684
- this.errors.addOrReplace({
685
- id: errId,
686
- type: "warning",
687
- message: "orderDirection: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
688
- });
689
- }
690
- else {
691
- this.errors.remove(errId);
692
- }
693
- }
694
- validateMeasureType(newValue) {
695
- const errId = "ERR_measureType";
696
- if (!withStyled.isValidMeasureType(newValue)) {
697
- this.errors.addOrReplace({
698
- id: errId,
699
- type: "warning",
700
- message: "measureType: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
701
- });
702
- }
703
- else {
704
- this.errors.remove(errId);
705
- }
706
- }
707
- validateMeasureScale(newValue) {
708
- const errId = "ERR_measureScale";
709
- if (!withStyled.isValidMeasureScale(newValue)) {
710
- this.errors.addOrReplace({
711
- id: errId,
712
- type: "warning",
713
- message: "measureScale: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
714
- });
715
- }
716
- else {
717
- this.errors.remove(errId);
718
- }
719
- }
720
- validateDataFormatDigitsDecimal(newValue) {
721
- const errId = "ERR_dataFormatDigitsDecimal";
722
- if (!withStyled.isValidInteger(newValue)) {
723
- this.errors.addOrReplace({
724
- id: errId,
725
- type: "warning",
726
- message: "dataFormatDigitsDecimal: invalid value(s) '" + newValue + "' are not supported.",
727
- });
728
- }
729
- else {
730
- this.errors.remove(errId);
731
- }
732
- }
733
- validateDateFormatDigitsPercent(newValue) {
734
- const errId = "ERR_dataFormatDigitsPercent";
735
- if (!withStyled.isValidInteger(newValue)) {
736
- this.errors.addOrReplace({
737
- id: errId,
738
- type: "warning",
739
- message: "dataFormatDigitsPercent: invalid value(s) '" + newValue + "' are not supported.",
740
- });
741
- }
742
- else {
743
- this.errors.remove(errId);
744
- }
745
- }
746
- validateCategoryWidth(newValue) {
747
- const errId = "ERR_categoryWidth";
748
- if (!withStyled.isTableCategoryWidth(newValue)) {
749
- this.errors.addOrReplace({
750
- id: errId,
751
- type: "warning",
752
- message: "categoryWidth: invalid value(s) '" + newValue + "' are not supported.",
753
- });
754
- }
755
- else {
756
- this.errors.remove(errId);
757
- }
758
- }
759
- validateColumnThereOf(newValue) {
760
- const invalidElements = withStyled.validateColumnThereOfJsonStr(newValue);
761
- const errId = "ERR_categorythereof";
762
- if (invalidElements.length > 0) {
763
- this.errors.addOrReplace({
764
- id: errId,
765
- type: "warning",
766
- message: "columnthereof: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
767
- });
768
- }
769
- else {
770
- this.errors.remove(errId);
771
- }
772
- }
773
- componentWillLoad() {
774
- //this.datasouce = get("test");
775
- // this.unsubscribe = onChange("test", (value) => this.datasouce = value);
776
- this.validateScenario(this.scenarios);
777
- this.validateVariances(this.variances);
778
- this.validateDataFormat(this.dataFormat);
779
- this.validateGrouped(this.grouped);
780
- this.validateShowGroupTitle(this.showGroupTitle);
781
- this.validateType(this.type);
782
- this.validateLimit(this.limit);
783
- this.validateThereOf(this.thereof);
784
- this.validatePartOf(this.partof);
785
- this.validateOrderDirection(this.orderDirection);
786
- this.validateOrderList(this.order);
787
- this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal);
788
- this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent);
789
- this.validateCategoryWidth(this.categoryWidth);
790
- this.validateMeasureType(this.measureType);
791
- this.validateMeasureScale(this.measureScale);
792
- this.validateColumnThereOf(this.columnthereof);
793
- this.validateShowMeasureScale(this.showMeasureScale);
794
- this.validateBarColumns(this.barColumns);
795
- this.validateUnitScaling(this.unitScaling);
796
- this.validatePercentageScaling(this.percentageScaling);
797
- this.validateScaling(this.scale);
798
- }
799
- disconnectedCallback() {
800
- this.unsubscribe();
801
- }
802
- componentDidRender() {
803
- var _a, _b;
804
- const { mode } = scaling.parseScaling(this.scale);
805
- // Only auto-scale for 'auto' and 'empty' (blank) modes
806
- if (mode !== "auto" && mode !== "empty") {
807
- this._autoScaleGuard = false;
808
- return;
809
- }
810
- // Skip re-measurement after the state-triggered re-render
811
- if (this._autoScaleGuard) {
812
- this._autoScaleGuard = false;
813
- return;
814
- }
815
- const host = this.element;
816
- const { width: parentWidth } = scaling.getParentDimensions(host);
817
- if (parentWidth <= 0)
818
- return;
819
- // Measure at base (unscaled) font size to get true content width.
820
- // This avoids the oscillation where scaled-down content fits → reset
821
- // to 1 → overflows → scale down → fits → …
822
- const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
823
- host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
824
- // Reading scrollWidth forces a synchronous reflow at base size
825
- const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("div");
826
- const unscaledWidth = (_b = div === null || div === void 0 ? void 0 : div.scrollWidth) !== null && _b !== void 0 ? _b : host.scrollWidth;
827
- if (unscaledWidth <= parentWidth + 1) {
828
- // Content fits at base size — no scaling needed
829
- this.errors.remove("AUTO_scale");
830
- if (this.appliedScaleFactor !== 1) {
831
- this._autoScaleGuard = true;
832
- this.appliedScaleFactor = 1;
833
- }
834
- return;
835
- }
836
- // Subtract 1px to account for sub-pixel rounding after scaling,
837
- // preventing the right edge from being clipped by overflow:hidden.
838
- const computedFactor = (parentWidth - 1) / unscaledWidth;
839
- // Apply immediately via CSS var for smooth visual (before state re-render)
840
- host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
841
- if (mode === "empty") {
842
- this.errors.addOrReplace({
843
- id: "AUTO_scale",
844
- type: "warning",
845
- message: `Auto-scaled table by factor ${computedFactor.toFixed(3)}`,
846
- });
847
- }
848
- else {
849
- this.errors.remove("AUTO_scale");
850
- }
851
- // Update state so bar charts re-render at the new scale
852
- if (Math.abs(computedFactor - this.appliedScaleFactor) > 0.001) {
853
- this._autoScaleGuard = true;
854
- this.appliedScaleFactor = computedFactor;
855
- }
856
- }
857
- prepareDataFormat() {
858
- var _a;
859
- return constants.DataFormat[(_a = this.dataFormat) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
860
- }
861
- prepareGrouped() {
862
- return this.grouped === "true";
863
- }
864
- prepareShowGroupTitle() {
865
- return this.showGroupTitle === "true";
866
- }
867
- prepareTableType() {
868
- var _a;
869
- return TableType[(_a = this.type) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
870
- }
871
- prepareLimit() {
872
- return Math.floor(Number(this.limit) || 0);
873
- }
874
- prepareThereOf() {
875
- if (this.thereof == null || this.thereof.trim() === "") {
876
- return [];
877
- }
878
- return JSON.parse(this.thereof);
879
- }
880
- preparePartOf() {
881
- if (this.partof == null || this.partof.trim() === "") {
882
- return [];
883
- }
884
- return JSON.parse(this.partof);
885
- }
886
- prepareOrder() {
887
- var _a, _b, _c;
888
- const isAuto = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
889
- let orderStr = this.order;
890
- if (isAuto && ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedOrder)) {
891
- orderStr = this.datasetMeta.suggestedOrder;
892
- }
893
- const tableOrder = {
894
- hierarchy: orderStr.split(",").map((entry) => Order.OrderColumn[entry === null || entry === void 0 ? void 0 : entry.toUpperCase()]),
895
- direction: Order.OrderDirection[(_c = this.orderDirection) === null || _c === void 0 ? void 0 : _c.toUpperCase()],
896
- };
897
- return tableOrder;
898
- }
899
- prepareI18nMode() {
900
- return constants.I18nMode.META;
901
- }
902
- prepareI18n() {
903
- const i18nMetaLabelsLocal = ["in", "category", "operation", "there_of", "part_of", "SUM_TOTAL"];
904
- const i18nMetaLabelsGlobal = contextProtocol.globalLabelKeys;
905
- // system
906
- const i18nMapLocal = new Map(i18nMetaLabelsLocal.map((key) => [key, this.t(".".concat(key))]));
907
- const i18nMapGlobal = new Map(i18nMetaLabelsGlobal.map((key) => [key, this.t("global.".concat(key))]));
908
- return new Map([...i18nMapGlobal.entries(), ...i18nMapLocal.entries()]);
909
- }
910
- prepareDataFormatDigits() {
911
- const formatDigits = {
912
- percent: this.dataFormatDigitsPercent,
913
- decimal: this.dataFormatDigitsDecimal,
914
- };
915
- return formatDigits;
916
- }
917
- prepareScenarios() {
918
- var _a, _b, _c, _d, _e, _f, _g, _h;
919
- const isAuto = ((_a = this.scenarios) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
920
- if ((withStyled.isBlankInput(this.scenarios) || isAuto) && withStyled.isBlankInput(this.variances)) {
921
- if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
922
- if (!isAuto) {
923
- this.errors.addOrReplace({
924
- id: "AUTO_scenarios",
925
- type: "warning",
926
- message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
927
- });
928
- }
929
- else {
930
- this.errors.remove("AUTO_scenarios");
931
- }
932
- return this.datasetMeta.availableScenarios;
933
- }
934
- return [];
935
- }
936
- let scenarios = [];
937
- if (isAuto || withStyled.isBlankInput(this.scenarios)) {
938
- if (((_e = (_d = this.datasetMeta) === null || _d === void 0 ? void 0 : _d.availableScenarios) === null || _e === void 0 ? void 0 : _e.length) > 0) {
939
- if (!isAuto) {
940
- this.errors.addOrReplace({
941
- id: "AUTO_scenarios",
942
- type: "warning",
943
- message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
944
- });
945
- }
946
- else {
947
- this.errors.remove("AUTO_scenarios");
948
- }
949
- scenarios = scenarios.concat(this.datasetMeta.availableScenarios);
950
- }
951
- }
952
- else {
953
- this.errors.remove("AUTO_scenarios");
954
- scenarios = scenarios.concat((_f = this.scenarios) === null || _f === void 0 ? void 0 : _f.split(","));
955
- }
956
- if (((_g = this.variances) === null || _g === void 0 ? void 0 : _g.trim().length) > 0) {
957
- scenarios = scenarios.concat((_h = this.variances) === null || _h === void 0 ? void 0 : _h.split(","));
958
- }
959
- return scenarios.map((entry) => entry.trim());
960
- }
961
- prepareCategoryWidth() {
962
- var _a;
963
- if (withStyled.isBlankInput(this.categoryWidth)) {
964
- return constants.TableCategoryWidth.INF;
965
- }
966
- return constants.TableCategoryWidth[(_a = this.categoryWidth) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
967
- }
968
- prepareMeasureScale() {
969
- if (withStyled.isBlankInput(this.measureScale)) {
970
- return "GREATEST";
971
- }
972
- if (["_", "k", "M", "G", "T", "P", "E", "Z", "Y", "m", "μ", "n", "p", "P", "f", "a", "z", "y"].includes(this.measureScale.trim())) {
973
- return this.measureScale.trim();
974
- }
975
- if (this.measureScale.trim().toUpperCase() === "LEAST") {
976
- return this.measureScale.trim();
977
- }
978
- return "GREATEST";
979
- }
980
- prepareMeasureType() {
981
- var _a;
982
- if (withStyled.isBlankInput(this.measureType)) {
983
- return constants.MeasureType.VOLUME;
984
- }
985
- return constants.MeasureType[(_a = this.measureType) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
986
- }
987
- prepareColumnThereOf() {
988
- if (this.columnthereof == null || this.columnthereof.trim() === "") {
989
- return new Map();
990
- }
991
- const parsedString = JSON.parse(this.columnthereof);
992
- const map = new Map();
993
- for (const [_key, value] of Object.entries(parsedString)) {
994
- if (map.has(value["scenario"]) === false) {
995
- map.set(value["scenario"], []);
996
- }
997
- map.get(value["scenario"]).push(value);
998
- }
999
- return map;
1000
- }
1001
- prepareTableTitle() {
1002
- if (this.tableTitle === "" || this.tableTitle == null) {
1003
- return "SUM_TOTAL";
1004
- }
1005
- return this.tableTitle;
1006
- }
1007
- prepareShowMeasureScale() {
1008
- return this.showMeasureScale === "true";
1009
- }
1010
- prepareMeasureUnit() {
1011
- if (this.measureUnit === "" || this.measureUnit == null) {
1012
- return "";
1013
- }
1014
- return this.measureUnit;
1015
- }
1016
- prepareFilter() {
1017
- if (this.filter.length === 0) {
1018
- return "";
1019
- }
1020
- return this.filter;
1021
- }
1022
- prepareBarColumns() {
1023
- if (withStyled.isBlankInput(this.barColumns)) {
1024
- return [];
1025
- }
1026
- return this.barColumns.split(",").map((col) => col.trim());
1027
- }
1028
- prepareUnitScaling() {
1029
- if (this.pixelPerUnitGroupMap.has(this.unitScaling)) {
1030
- return this.pixelPerUnitGroupMap.get(this.unitScaling);
1031
- }
1032
- return Number(this.unitScaling);
1033
- }
1034
- preparePercentageScaling() {
1035
- if (this.pixelPerUnitGroupMap.has(this.percentageScaling)) {
1036
- return this.pixelPerUnitGroupMap.get(this.percentageScaling);
1037
- }
1038
- return Number(this.percentageScaling);
1039
- }
1040
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1041
- getDataStructure() {
1042
- const dataSetStructure = {
1043
- ITableDataRow: {
1044
- setName: { type: "string", isOptional: false, description: "" },
1045
- date: { type: "string", isOptional: false, description: "" },
1046
- operation: { type: "string", isOptional: false, description: "" },
1047
- rowGroup: { type: "string", isOptional: false, description: "" },
1048
- rowGroupIndex: { type: "number", isOptional: false, description: "" },
1049
- category: { type: "string", isOptional: false, description: "" },
1050
- categoryIndex: { type: "number", isOptional: false, description: "" },
1051
- subCategory: { type: "string", isOptional: false, description: "" },
1052
- subCategoryIndex: { type: "number", isOptional: false, description: "" },
1053
- columnGroup: { type: "string", isOptional: false, description: "" },
1054
- columnGroupIndex: { type: "number", isOptional: false, description: "" },
1055
- columnSubGroup: { type: "string", isOptional: false, description: "" },
1056
- columnSubGroupIndex: { type: "number", isOptional: false, description: "" },
1057
- ac1: { type: "number", isOptional: false, description: "" },
1058
- ac2: { type: "number", isOptional: false, description: "" },
1059
- ac3: { type: "number", isOptional: false, description: "" },
1060
- ac4: { type: "number", isOptional: false, description: "" },
1061
- pp1: { type: "number", isOptional: false, description: "" },
1062
- pp2: { type: "number", isOptional: false, description: "" },
1063
- pp3: { type: "number", isOptional: false, description: "" },
1064
- pp4: { type: "number", isOptional: false, description: "" },
1065
- fc1: { type: "number", isOptional: false, description: "" },
1066
- fc2: { type: "number", isOptional: false, description: "" },
1067
- fc3: { type: "number", isOptional: false, description: "" },
1068
- fc4: { type: "number", isOptional: false, description: "" },
1069
- pl1: { type: "number", isOptional: false, description: "" },
1070
- pl2: { type: "number", isOptional: false, description: "" },
1071
- pl3: { type: "number", isOptional: false, description: "" },
1072
- pl4: { type: "number", isOptional: false, description: "" },
1073
- },
1074
- };
1075
- return dataSetStructure;
1076
- }
1077
- getEffectiveScaleFactor() {
1078
- const { mode, factor } = scaling.parseScaling(this.scale);
1079
- if (mode === "factor")
1080
- return factor;
1081
- if (mode === "auto" || mode === "empty")
1082
- return this.appliedScaleFactor;
1083
- return 1;
1084
- }
1085
- getFontStyles() {
1086
- const effectiveFactor = this.getEffectiveScaleFactor();
1087
- return this.componentStyle(($) => {
1088
- var _a, _b, _c, _d;
1089
- const baseFontSize = ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333;
1090
- return {
1091
- "--bn-font-family": ((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontFamily"]) || "'Noto Sans', sans-serif",
1092
- "--bn-font-size": `${baseFontSize * effectiveFactor}px`,
1093
- "--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
1094
- "--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
1095
- };
1096
- });
1097
- }
1098
- render() {
1099
- const fontStyles = this.getFontStyles();
1100
- const effectiveFactor = this.getEffectiveScaleFactor();
1101
- return (index.h(index.Host, { key: 'ff1e93fe32fef547dfcd092016cbde05a82e54ce', style: fontStyles }, index.h("div", { key: '54a4539d8f67b50ed96036e66492a5a280cef987' }, index.h("ibcs-table", { key: '54a47b6ffd1ca979583b79339bfe19cbbaa00ce8', data: this.data, "table-title": this.prepareTableTitle(), scenarios: this.prepareScenarios(), "scenarios-data-format": this.prepareDataFormat(), grouped: this.prepareGrouped(), limit: this.prepareLimit(), showGroupTitle: this.prepareShowGroupTitle(), thereof: this.prepareThereOf(), partof: this.preparePartOf(), order: this.prepareOrder(), categorythereof: this.prepareColumnThereOf(), type: this.prepareTableType(), "category-width": this.prepareCategoryWidth(), dataFormatDigits: this.prepareDataFormatDigits(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode(), "measure-scale": this.prepareMeasureScale(), "measure-type": this.prepareMeasureType(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(), filter: this.prepareFilter(), barColumns: this.prepareBarColumns(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), scaleFactor: effectiveFactor }))));
1102
- }
1103
- get element() { return index.getElement(this); }
1104
- static get watchers() { return {
1105
- "scale": [{
1106
- "validateScaling": 0
1107
- }],
1108
- "scenarios": [{
1109
- "validateScenario": 0
1110
- }],
1111
- "variances": [{
1112
- "validateVariances": 0
1113
- }],
1114
- "barColumns": [{
1115
- "validateBarColumns": 0
1116
- }],
1117
- "unitScaling": [{
1118
- "validateUnitScaling": 0
1119
- }],
1120
- "percentageScaling": [{
1121
- "validatePercentageScaling": 0
1122
- }],
1123
- "dataFormat": [{
1124
- "validateDataFormat": 0
1125
- }],
1126
- "grouped": [{
1127
- "validateGrouped": 0
1128
- }],
1129
- "showMeasureScale": [{
1130
- "validateShowMeasureScale": 0
1131
- }],
1132
- "showGroupTitle": [{
1133
- "validateShowGroupTitle": 0
1134
- }],
1135
- "type": [{
1136
- "validateType": 0
1137
- }],
1138
- "limit": [{
1139
- "validateLimit": 0
1140
- }],
1141
- "thereof": [{
1142
- "validateThereOf": 0
1143
- }],
1144
- "partof": [{
1145
- "validatePartOf": 0
1146
- }],
1147
- "order": [{
1148
- "validateOrderList": 0
1149
- }],
1150
- "orderDirection": [{
1151
- "validateOrderDirection": 0
1152
- }],
1153
- "measureType": [{
1154
- "validateMeasureType": 0
1155
- }],
1156
- "measureScale": [{
1157
- "validateMeasureScale": 0
1158
- }],
1159
- "dataFormatDigitsDecimal": [{
1160
- "validateDataFormatDigitsDecimal": 0
1161
- }],
1162
- "dataFormatDigitsPercent": [{
1163
- "validateDateFormatDigitsPercent": 0
1164
- }],
1165
- "categoryWidth": [{
1166
- "validateCategoryWidth": 0
1167
- }],
1168
- "columnthereof": [{
1169
- "validateColumnThereOf": 0
1170
- }]
1171
- }; }
1172
- };
1173
- Table$1.style = bnTableCss();
1174
-
1175
- // import {Formatter} from "../../../../utils/formatter";
1176
- // import {DataFormatDigits} from "../../../../utils/model/DataFormatDigits";
1177
- /**
1178
- * Represents a single table cell with formatting and rendering capabilities.
1179
- *
1180
- * The draw() method implements a formatting pipeline:
1181
- * 1. Checks for undefined/null/NaN values -- returns empty string for missing data
1182
- * 2. Non-numeric values (category labels) are returned as-is
1183
- * 3. Numeric values are routed through Formatter.number() with the cell's type
1184
- * (decimal or percent) and configured digit precision
1185
- * 4. For decimal type, the raw value is divided by measureScale before formatting,
1186
- * enabling SI prefix display (e.g. "in Mio EUR")
1187
- */
1188
- class Cell {
1189
- constructor(scenario, index, value, cssStyle, type, prefix, prefixStyle, colSpan, measureScale) {
1190
- this.prefixStyle = "prefix";
1191
- this.isBarChart = false;
1192
- this.key = scenario;
1193
- this.index = index;
1194
- this.value = value;
1195
- this.prefix = prefix || "";
1196
- this.cssStyle = cssStyle || "";
1197
- this.prefixStyle = prefixStyle || "prefix";
1198
- this.type = type;
1199
- this.mark = undefined;
1200
- this.colSpan = colSpan || 1;
1201
- this.measureScale = measureScale || 1;
1202
- }
1203
- getAsHeaderList() {
1204
- if (this.value == null) {
1205
- return [""];
1206
- }
1207
- const result = [];
1208
- for (const line of this.value.toString().split("<br/>")) {
1209
- result.push(line);
1210
- }
1211
- return result;
1212
- }
1213
- draw(dataFormatDigits) {
1214
- let cellValue = this.value;
1215
- if (cellValue === "undefined" || cellValue === undefined || cellValue == null) {
1216
- return "";
1217
- }
1218
- if (Number.isNaN(Number(cellValue))) {
1219
- return cellValue;
1220
- }
1221
- if (this.type === "" || this.type === undefined || this.type == null) {
1222
- return cellValue;
1223
- }
1224
- let digitsMin = dataFormatDigits.percent;
1225
- let scale = dataFormatDigits.percent;
1226
- if (this.type === "decimal") {
1227
- cellValue = +cellValue / this.measureScale;
1228
- digitsMin = dataFormatDigits.decimal;
1229
- scale = dataFormatDigits.decimal;
1230
- }
1231
- return formatter.Formatter.number(Number(cellValue), this.type, digitsMin, scale);
1232
- }
1233
- drawPrefix() {
1234
- if (this.prefix == null) {
1235
- return "";
1236
- }
1237
- return this.prefix;
1238
- }
1239
- }
1240
-
1241
- /**
1242
- * Represents a single row in an IBCS table, containing an ordered list of Cells.
1243
- *
1244
- * The CSS class is determined by the TableRowType:
1245
- * - HEADER -> "groupheader"
1246
- * - SEPERATORLINE -> "" (styled via cell-level scenario classes)
1247
- * - DRILLELEMENT -> "ofit" (thereof rows)
1248
- * - PARTELEMENT -> "partof" (percentage-of-parent rows)
1249
- * - SUM -> "sum"
1250
- * - STANDARD -> ""
1251
- *
1252
- * createElement() applies type-specific overrides:
1253
- * - HEADER rows force "headerlabel" CSS on all cells
1254
- * - SEPERATORLINE rows use the scenario name as CSS class for border styling
1255
- * - PARTELEMENT rows show "-" for percent cells and force percent type on data cells
1256
- */
1257
- class TableRow {
1258
- constructor(index, groupIndex, type) {
1259
- this.index = index;
1260
- this.groupindex = groupIndex;
1261
- this.type = type;
1262
- this.cssStyle = this.initCssStyle();
1263
- this.elements = [];
1264
- }
1265
- initCssStyle() {
1266
- switch (this.type) {
1267
- case TableRowType.HEADER: {
1268
- return "groupheader";
1269
- }
1270
- case TableRowType.SEPERATORLINE: {
1271
- return "";
1272
- }
1273
- case TableRowType.DRILLELEMENT: {
1274
- return "ofit";
1275
- }
1276
- case TableRowType.PARTELEMENT: {
1277
- return "partof";
1278
- }
1279
- case TableRowType.STANDARD: {
1280
- return "";
1281
- }
1282
- case TableRowType.SUM: {
1283
- return "sum";
1284
- }
1285
- default: {
1286
- return "";
1287
- }
1288
- }
1289
- }
1290
- getCells() {
1291
- return this.elements;
1292
- }
1293
- createElement(value, scenario, columnType, cellType, prefix, cellStyle, isSecondaryElement, categoryWidth, measureScale, isBarChart = false, columnStats) {
1294
- let cssStyle = cellStyle;
1295
- if (scenario === "category" && categoryWidth != null) {
1296
- cssStyle = `category-${categoryWidth.toString()}`;
1297
- }
1298
- if (this.type === TableRowType.HEADER) {
1299
- cssStyle = "headerlabel";
1300
- }
1301
- else if (this.type === TableRowType.SEPERATORLINE) {
1302
- cssStyle = scenario;
1303
- }
1304
- if (this.type === TableRowType.PARTELEMENT) {
1305
- if (cellType === "percent") {
1306
- value = "-";
1307
- }
1308
- if (scenario !== "category" && scenario !== "operation") {
1309
- cellType = "percent";
1310
- cssStyle = "";
1311
- }
1312
- }
1313
- if (value === "-") {
1314
- cssStyle = "";
1315
- }
1316
- let prefixStyle = "prefix-first";
1317
- if (isSecondaryElement) {
1318
- prefixStyle = "prefix-second";
1319
- }
1320
- cssStyle = `${cssStyle} ${columnType}`;
1321
- const cell = new Cell(scenario, this.elements.length, value, cssStyle, cellType, prefix, prefixStyle, 1, measureScale);
1322
- cell.isBarChart = isBarChart;
1323
- cell.columnStats = columnStats;
1324
- this.elements.push(cell);
1325
- }
1326
- }
1327
-
1328
- // Default fallback colors (should come from componentStyle)
1329
- const DEFAULT_STYLES = {
1330
- positive: { stroke: "#008f96", fill: "#008f96", fillpattern: "solid" },
1331
- negative: { stroke: "#ff0000", fill: "#ff0000", fillpattern: "solid" },
1332
- neutral: { stroke: "#808080", fill: "#808080", fillpattern: "outlined" },
1333
- scenarios: {
1334
- ac: { stroke: "#404040", fill: "#404040", fillpattern: "solid" },
1335
- pp: { stroke: "#A6A6A6", fill: "#A6A6A6", fillpattern: "solid" },
1336
- fc: { stroke: "#404040", fill: "#ffffff", fillpattern: "hatched" },
1337
- pl: { stroke: "#404040", fill: "#ffffff", fillpattern: "outlined" },
1338
- },
1339
- fontColor: "#000000",
1340
- fontSize: 11,
1341
- fontFamily: "'Noto Sans', sans-serif",
1342
- unitScaling: 0.01, // Default: 1000 units = 10 pixels
1343
- percentageScaling: 0.5, // Default: 100% = 50 pixels
1344
- scaleFactor: 1,
1345
- };
1346
- const AXIS_COLOR = "#666666";
1347
- /**
1348
- * Creates a unique pattern ID for the SVG defs
1349
- */
1350
- function getPatternId(prefix, color) {
1351
- return `pattern-${prefix}-${color.replace("#", "")}`;
1352
- }
1353
- /**
1354
- * Renders SVG pattern definitions for hatched fills
1355
- */
1356
- const PatternDefs = ({ styles }) => {
1357
- const s = styles.scaleFactor;
1358
- const patternSize = 6 * s;
1359
- const patterns = [
1360
- { id: getPatternId("pos", styles.positive.stroke), stroke: styles.positive.stroke, fill: styles.positive.fill },
1361
- { id: getPatternId("neg", styles.negative.stroke), stroke: styles.negative.stroke, fill: styles.negative.fill },
1362
- { id: getPatternId("neu", styles.neutral.stroke), stroke: styles.neutral.stroke, fill: styles.neutral.fill },
1363
- ];
1364
- return (index.h("defs", null, patterns.map((p) => (index.h("pattern", { id: p.id, patternUnits: "userSpaceOnUse", width: patternSize, height: patternSize }, index.h("rect", { width: patternSize, height: patternSize, fill: "#ffffff" }), index.h("line", { x1: "0", y1: patternSize, x2: patternSize, y2: "0", stroke: p.stroke, "stroke-width": 1.5 * s }))))));
1365
- };
1366
- /**
1367
- * Formats a number for display with appropriate SI prefix.
1368
- */
1369
- function formatValue(value, isRelative, measureScale = 1) {
1370
- let scaledValue;
1371
- let absValue;
1372
- const prefix = value >= 0 ? "+" : "";
1373
- if (isRelative) {
1374
- // Relative variance is stored as decimal (e.g., -2.0 = -200%)
1375
- // Multiply by 100 to get percentage value for display
1376
- scaledValue = value * 100;
1377
- // Show as integer percentage with % suffix
1378
- return prefix + Math.round(scaledValue).toString() + "%";
1379
- }
1380
- else {
1381
- // Absolute variance - apply measure scale and use SI prefixes
1382
- scaledValue = value / measureScale;
1383
- absValue = Math.abs(scaledValue);
1384
- let formatted;
1385
- if (absValue >= 1000000000) {
1386
- formatted = (scaledValue / 1000000000).toFixed(absValue >= 10000000000 ? 0 : 1) + "B";
1387
- }
1388
- else if (absValue >= 1000000) {
1389
- formatted = (scaledValue / 1000000).toFixed(absValue >= 10000000 ? 0 : 1) + "M";
1390
- }
1391
- else if (absValue >= 1000) {
1392
- formatted = (scaledValue / 1000).toFixed(absValue >= 10000 ? 0 : 1) + "K";
1393
- }
1394
- else {
1395
- formatted = scaledValue.toFixed(absValue >= 10 ? 0 : 1);
1396
- }
1397
- // Remove trailing .0 if present
1398
- formatted = formatted.replace(/\.0([KMB]?)$/, "$1");
1399
- return prefix + formatted;
1400
- }
1401
- }
1402
- /**
1403
- * Checks if the column is a scenario column (ac, pp, fc, pl) vs variance (d_, dr_).
1404
- */
1405
- function isScenarioColumn(scenario) {
1406
- const scenarioPrefix = scenario.slice(0, 2).toLowerCase();
1407
- return ["ac", "pp", "fc", "pl"].includes(scenarioPrefix);
1408
- }
1409
- /**
1410
- * Gets the scenario type from the column name (ac, pp, fc, pl).
1411
- */
1412
- function getScenarioType(scenario) {
1413
- const scenarioPrefix = scenario.slice(0, 2).toLowerCase();
1414
- if (scenarioPrefix === "pp")
1415
- return "pp";
1416
- if (scenarioPrefix === "fc")
1417
- return "fc";
1418
- if (scenarioPrefix === "pl")
1419
- return "pl";
1420
- return "ac"; // default
1421
- }
1422
- /**
1423
- * Gets the style for a scenario column (ac, pp, fc, pl).
1424
- */
1425
- function getScenarioStyle(scenario, styles) {
1426
- const type = getScenarioType(scenario);
1427
- return styles.scenarios[type];
1428
- }
1429
- /**
1430
- * Gets the variance style based on value and sentiment direction.
1431
- * pos suffix = positive values are good (green), negative are bad (red)
1432
- * neg suffix = negative values are good (green), positive are bad (red)
1433
- */
1434
- function getVarianceStyle(value, isPositiveGood, styles) {
1435
- const isPositive = value >= 0;
1436
- if (isPositiveGood) {
1437
- return isPositive ? styles.positive : styles.negative;
1438
- }
1439
- else {
1440
- return isPositive ? styles.negative : styles.positive;
1441
- }
1442
- }
1443
- /**
1444
- * Gets the appropriate style for a bar based on column type.
1445
- * Scenarios (ac, pp, fc, pl) use scenario styles.
1446
- * Variances (d_, dr_) use variance styles with pos/neg/neu coloring.
1447
- */
1448
- function getBarStyle(scenario, value, isPositiveGood, styles) {
1449
- if (isScenarioColumn(scenario)) {
1450
- return getScenarioStyle(scenario, styles);
1451
- }
1452
- return getVarianceStyle(value, isPositiveGood, styles);
1453
- }
1454
- /**
1455
- * Gets the fill value for a bar - either solid color, pattern URL, or transparent with stroke.
1456
- */
1457
- function getBarFill(varianceStyle, patternPrefix) {
1458
- const pattern = varianceStyle.fillpattern;
1459
- if (pattern === "hatched") {
1460
- return `url(#${getPatternId(patternPrefix, varianceStyle.stroke)})`;
1461
- }
1462
- if (pattern === "outlined") {
1463
- return "transparent";
1464
- }
1465
- // Default: solid fill
1466
- return varianceStyle.fill;
1467
- }
1468
- /**
1469
- * Gets the stroke for a bar based on pattern type.
1470
- */
1471
- function getBarStroke(varianceStyle) {
1472
- const pattern = varianceStyle.fillpattern;
1473
- if (pattern === "outlined") {
1474
- return { stroke: varianceStyle.stroke, strokeWidth: 1.5 }; // scaled by caller via * s
1475
- }
1476
- // Solid and hatched bars don't need visible stroke
1477
- return { stroke: "none", strokeWidth: 0 };
1478
- }
1479
- /**
1480
- * Renders an absolute variance bar chart (d_ prefix).
1481
- * Horizontal bar with centered axis, green for positive, red for negative.
1482
- * Value label shown next to the bar (black text per IBCS).
1483
- *
1484
- * Layout: [left label area][bar area with axis][right label area]
1485
- * Uses unitScaling to determine bar width (pixels per unit of measure).
1486
- */
1487
- const AbsoluteVarianceBar = (props) => {
1488
- const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
1489
- const s = styles.scaleFactor;
1490
- const labelAreaWidth = 50 * s;
1491
- const maxBarWidth = 40 * s;
1492
- const barAreaWidth = maxBarWidth * 2;
1493
- const totalWidth = labelAreaWidth + barAreaWidth + labelAreaWidth;
1494
- const padding = 2 * s;
1495
- const barHeight = height - padding * 2;
1496
- const axisX = labelAreaWidth + maxBarWidth; // Axis in center of bar area
1497
- // Calculate bar width using unitScaling (pixels per unit)
1498
- // Clamp to maxBarWidth to prevent overflow
1499
- const scaledWidth = Math.abs(value) * styles.unitScaling * s;
1500
- const barWidth = Math.min(scaledWidth, maxBarWidth);
1501
- const isPositive = value >= 0;
1502
- const barX = isPositive ? axisX : axisX - barWidth;
1503
- const barY = padding;
1504
- // Get style based on column type (scenario vs variance)
1505
- const barStyle = getBarStyle(scenario, value, isPositiveGood, styles);
1506
- // Pattern prefix for scenarios uses scenario type, for variances uses pos/neg
1507
- const patternPrefix = isScenarioColumn(scenario)
1508
- ? getScenarioType(scenario)
1509
- : isPositiveGood
1510
- ? isPositive
1511
- ? "pos"
1512
- : "neg"
1513
- : isPositive
1514
- ? "neg"
1515
- : "pos";
1516
- const fillValue = getBarFill(barStyle, patternPrefix);
1517
- const { stroke: barStroke, strokeWidth: barStrokeWidth } = getBarStroke(barStyle);
1518
- const displayValue = formattedValue || formatValue(value, false, measureScale);
1519
- // Label position: in the label area on the appropriate side
1520
- // Positive values: label in right area, left-aligned
1521
- // Negative values: label in left area, right-aligned
1522
- const labelX = isPositive ? axisX + barWidth + 4 * s : axisX - barWidth - 4 * s;
1523
- const labelAnchor = isPositive ? "start" : "end";
1524
- return (index.h("svg", { width: totalWidth, height: height, class: "cell-bar-chart absolute-variance", style: { overflow: "visible" } }, index.h(PatternDefs, { styles: styles }), index.h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), barWidth > 0 && (index.h("rect", { x: barX, y: barY, width: barWidth, height: barHeight, fill: fillValue, stroke: barStroke, "stroke-width": barStrokeWidth * s })), index.h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": labelAnchor, fill: styles.fontColor, "font-size": styles.fontSize, "font-family": styles.fontFamily }, displayValue)));
1525
- };
1526
- /**
1527
- * Renders a relative variance pin chart (dr_ prefix).
1528
- * Thin horizontal line from axis with dot at end and value label.
1529
- *
1530
- * Layout: [pin area with axis][label area on right]
1531
- * Uses percentageScaling to determine pin length (pixels per percentage point).
1532
- */
1533
- const RelativeVariancePin = (props) => {
1534
- const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
1535
- const s = styles.scaleFactor;
1536
- const maxPinLength = 25 * s;
1537
- const pinAreaWidth = maxPinLength * 2 + 10 * s;
1538
- const labelAreaWidth = 70 * s;
1539
- const totalWidth = pinAreaWidth + labelAreaWidth;
1540
- const axisX = pinAreaWidth / 2;
1541
- const centerY = height / 2;
1542
- // Calculate pin length using percentageScaling (pixels per percentage point)
1543
- // Value is in decimal form (e.g., 0.5 = 50%), multiply by 100 to get percentage
1544
- const percentValue = Math.abs(value) * 100;
1545
- const scaledLength = percentValue * styles.percentageScaling * s;
1546
- const pinLength = Math.min(scaledLength, maxPinLength);
1547
- const isPositive = value >= 0;
1548
- const pinEndX = isPositive ? axisX + pinLength : axisX - pinLength;
1549
- // Get style based on column type (scenario vs variance)
1550
- const barStyle = getBarStyle(scenario, value, isPositiveGood, styles);
1551
- const dotRadius = 3 * s;
1552
- // Show arrow for extreme values (when pin would exceed max length)
1553
- const isExtreme = scaledLength > maxPinLength;
1554
- const displayValue = formattedValue || formatValue(value, true, measureScale);
1555
- // Label always on the right side after the pin area
1556
- const labelX = pinAreaWidth + 4 * s;
1557
- return (index.h("svg", { width: totalWidth, height: height, class: "cell-bar-chart relative-variance", style: { overflow: "visible" } }, index.h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), !isExtreme && index.h("circle", { cx: pinEndX, cy: centerY, r: dotRadius, fill: styles.fontColor }), index.h("line", { x1: axisX, y1: centerY, x2: pinEndX, y2: centerY, stroke: barStyle.fill, "stroke-width": 2 * s }), isExtreme && isPositive && (index.h("polygon", { points: `${pinAreaWidth - 2 * s},${centerY} ${pinAreaWidth - 8 * s},${centerY - 3 * s} ${pinAreaWidth - 8 * s},${centerY + 3 * s}`, fill: barStyle.fill })), isExtreme && !isPositive && (index.h("polygon", { points: `${2 * s},${centerY} ${8 * s},${centerY - 3 * s} ${8 * s},${centerY + 3 * s}`, fill: barStyle.fill })), index.h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": "start", fill: styles.fontColor, "font-size": styles.fontSize, "font-style": "italic", "font-family": styles.fontFamily }, displayValue)));
1558
- };
1559
- /**
1560
- * CellBarChart - Renders IBCS-compliant variance bar charts.
1561
- *
1562
- * Absolute variance (d_ prefix): Horizontal bars with centered axis
1563
- * Relative variance (dr_ prefix): Pin/dot charts with value indication
1564
- *
1565
- * Uses componentStyle patterns from chart components for consistent styling.
1566
- */
1567
- const CellBarChart = (props) => {
1568
- const { value, columnStats, isRelative, styles = DEFAULT_STYLES } = props;
1569
- // Handle invalid values
1570
- if (value === null || value === undefined || isNaN(value) || !columnStats || columnStats.absMax === 0) {
1571
- return (index.h("span", { class: "bar-chart-empty", style: { color: styles.fontColor, fontStyle: "italic" } }, "-"));
1572
- }
1573
- if (isRelative) {
1574
- return index.h(RelativeVariancePin, Object.assign({}, props));
1575
- }
1576
- return index.h(AbsoluteVarianceBar, Object.assign({}, props));
1577
- };
1578
-
1579
- /**
1580
- * Manages the GROUP BY column list for DataQuery's SQL statements and registers
1581
- * the `transformOperator` AlaSQL custom function.
1582
- *
1583
- * `transformOperator` converts the dataset's `operation` field (`"+"` or `"-"`)
1584
- * into a numeric multiplier (+1 / -1) so that SUM aggregations correctly add
1585
- * or subtract rows based on their sign.
1586
- *
1587
- * The GROUP BY columns are composed dynamically: always category + categoryIndex,
1588
- * plus operation for OPT types, plus rowGroup/rowGroupIndex when grouping is active.
1589
- */
1590
- class QueryGroups {
1591
- constructor(config) {
1592
- alasql_min.alasql.fn.transformOperator = function (a) {
1593
- return a === "-" ? -1 : 1;
1594
- };
1595
- this.groups = [formatter.QueryColumnNames.CATEGORY, formatter.QueryColumnNames.CATEGORYINDEX];
1596
- if (TableType.OPT === config.type || TableType.OPTNOTOTAL === config.type) {
1597
- this.groups.unshift(formatter.QueryColumnNames.OPERATION);
1598
- }
1599
- if (config.grouped) {
1600
- this.groups.push(formatter.QueryColumnNames.ROWGROUP);
1601
- this.groups.push(formatter.QueryColumnNames.ROWGROUPINDEX);
1602
- }
1603
- }
1604
- toString() {
1605
- return this.groups.map((s) => `${s}`).toString();
1606
- }
1607
- noCategory() {
1608
- return this.groups.filter((element) => element !== formatter.QueryColumnNames.CATEGORY);
1609
- }
1610
- toArray() {
1611
- return this.groups;
1612
- }
1613
- }
1614
-
1615
- /**
1616
- * AlaSQL-based query builder that produces the complete table result set for bn-table.
1617
- *
1618
- * Translates a {@link TableComponentConfig} into a series of SQL statements executed
1619
- * against in-memory data rows. The pipeline handles scenario aggregation, row/column
1620
- * grouping, drill-down expansion (thereof / partof), REST rows, sum rows, NaN detection,
1621
- * column-level drill columns, and relative variance calculation.
1622
- */
1623
- class DataQuery {
1624
- constructor(config, i18n) {
1625
- this.hasPartOf = false;
1626
- this.config = config;
1627
- this.i18n = i18n;
1628
- }
1629
- /**
1630
- * Executes the full query pipeline and returns a segmented result set.
1631
- *
1632
- * Pipeline steps:
1633
- * 1. Translate scenario columns into SQL aggregation expressions
1634
- * 2. Run a meta query to discover row groups and their category counts
1635
- * 3. For each group: generate header row, data rows, REST overflow row, and group sum row
1636
- * 4. Append a total sum row (if table type requires it)
1637
- * 5. Execute all accumulated SQL statements against the input data
1638
- * 6. Detect NaN cells (aggregated cells with zero contributing rows)
1639
- * 7. Inject thereof/partof drill rows and column-level drill columns
1640
- * 8. Calculate REST columns (parent minus drilled children)
1641
- * 9. Divide absolute variances by their denominator to produce relative variances
1642
- *
1643
- * @returns Array of row-group segments; each segment is an array of result rows.
1644
- */
1645
- execute(data) {
1646
- if (data.length === 0) {
1647
- return [];
1648
- }
1649
- const queries = [];
1650
- const sumGroupQueries = [];
1651
- const res = [];
1652
- const scenarios = this.config.scenarios
1653
- .map((s) => this.translateScenarioSQL(s, false, this.config.type))
1654
- .toString();
1655
- const scenariosSUMQuery = this.config.scenarios
1656
- .map((s) => this.translateScenarioSQL(s, true, this.config.type))
1657
- .toString();
1658
- const relativeScenarios = this.getRelativeScenarios();
1659
- const groups = new QueryGroups(this.config);
1660
- const groupsAggregated = this.config.grouped ? [formatter.QueryColumnNames.ROWGROUP, formatter.QueryColumnNames.ROWGROUPINDEX] : [];
1661
- let order = ["", ""];
1662
- if (this.config.sortOrder.hierarchy.length > 0) {
1663
- order = this.createOrderString(this.config.sortOrder);
1664
- }
1665
- this.hasPartOf = this.checkConfigForPartOf();
1666
- // meta defines groups and the number detail rows in each group
1667
- // Bsp: 0: Object { totalrowcnt: 7, rowgroup: "Umsatz" }
1668
- const meta = alasql_min.alasql(`SELECT COUNT(DISTINCT ${formatter.QueryColumnNames.CATEGORY}) as ${formatter.QueryColumnNames.TOTALROWCOUNT} ${groupsAggregated.length > 0 ? "," + groupsAggregated : ""}
1669
- FROM ? ${groupsAggregated.length > 0 ? "GROUP BY " + groupsAggregated : ""}
1670
- ORDER BY ${order[0]}`, [data]);
1671
- // Creates DataSelection for LIST
1672
- meta.forEach((rowGroupEntry) => {
1673
- // the following variables are 'helper sections' which are used to constuct dynamicly the sql statement depending of the given config
1674
- // is grouping active?
1675
- const queryWhereSection = rowGroupEntry.rowGroup && rowGroupEntry.rowGroup.length > 0
1676
- ? `WHERE ${formatter.QueryColumnNames.ROWGROUP} = '${rowGroupEntry.rowGroup}'`
1677
- : ``;
1678
- // is limit active?
1679
- let queryLimitSection = "";
1680
- if (this.config.limit) {
1681
- queryLimitSection = `LIMIT ${this.config.limit}`;
1682
- }
1683
- this.createGroupHeaderRow(rowGroupEntry, queries);
1684
- this.createDataRow(queries, rowGroupEntry, groups, scenarios, queryWhereSection, order, queryLimitSection);
1685
- this.createRestRow(rowGroupEntry, queries, groups, scenarios, queryWhereSection, order);
1686
- this.createGroupSumRow(queries, sumGroupQueries, rowGroupEntry, scenariosSUMQuery, order);
1687
- });
1688
- this.createTotalSumRow(queries, sumGroupQueries, scenariosSUMQuery);
1689
- // executes main queries
1690
- queries.forEach((query) => {
1691
- try {
1692
- res.push(alasql_min.alasql(query, [data]));
1693
- }
1694
- catch (err) {
1695
- console.error("DataQuery: SQL query execution failed", query, err);
1696
- }
1697
- });
1698
- this.detectNaNCells(this.config.scenarios, res);
1699
- this.createThereOfDrillRows(scenarios, order, data, res);
1700
- this.createPartOfDrillRows(scenarios, order, sumGroupQueries, data, res);
1701
- this.createThereOfDrillColumns(this.config.categoryThereOf, data, res);
1702
- this.calculateColumnGroupRest(res, this.config.categoryThereOf);
1703
- this.calculateRelativeVariances(res, relativeScenarios);
1704
- return res;
1705
- }
1706
- /**
1707
- * Marks aggregated cells as NaN when no source rows contributed to the sum.
1708
- *
1709
- * Without this step, SUM() over zero matching rows would produce 0, which is
1710
- * misleading -- it would be indistinguishable from an actual zero value.
1711
- * Each scenario column has a companion `_cnt` counter; when that counter is 0
1712
- * the cell is overwritten with NaN. For variance scenarios, both base and delta
1713
- * counters must be non-zero.
1714
- */
1715
- detectNaNCells(scenarios, res) {
1716
- res.forEach((group) => {
1717
- group.map((row) => {
1718
- scenarios.forEach((scenario) => {
1719
- const varianceScenario = new formatter.VarianceScenario(scenario);
1720
- if (varianceScenario.isValid === true) {
1721
- if (row[varianceScenario.base + "_cnt"] === 0 || row[varianceScenario.delta + "_cnt"] === 0) {
1722
- row[scenario] = Number.NaN;
1723
- }
1724
- }
1725
- else {
1726
- if (row[scenario + "_cnt"] === 0) {
1727
- row[scenario] = Number.NaN;
1728
- }
1729
- }
1730
- });
1731
- return row;
1732
- });
1733
- });
1734
- }
1735
- /**
1736
- * Creates "part-of" drill rows that express each category's value as a fraction
1737
- * of its row group sum. Queries the drill subset, then divides each scenario
1738
- * value by the corresponding group sum to produce a percentage.
1739
- */
1740
- createPartOfDrillRows(scenarios, order, sumGroupQueries, data, res) {
1741
- if (this.config.partOf == null ||
1742
- this.config.partOf.length === 0 ||
1743
- this.config.type === TableType.LIST ||
1744
- data == null ||
1745
- data.length === 0) {
1746
- return;
1747
- }
1748
- const drillQueries = this.createPartOfQuery(scenarios, order);
1749
- let resDrill = []; // set of drill (subquery result injected into resultset)
1750
- drillQueries.forEach(function (query) {
1751
- resDrill.push(...alasql_min.alasql(query, [data]));
1752
- });
1753
- const scenarioNames = this.exctractScenarioNames(scenarios);
1754
- const rowGroupSumResultRows = [];
1755
- sumGroupQueries.forEach(function (query) {
1756
- rowGroupSumResultRows.push(...alasql_min.alasql(query, [data]));
1757
- });
1758
- const rowGroupSumResultMap = new Map();
1759
- rowGroupSumResultRows.forEach((row) => rowGroupSumResultMap.set(row[formatter.QueryColumnNames.ROWGROUP], row));
1760
- resDrill = this.reduceResDrillByCategoryGroups(resDrill, scenarioNames);
1761
- resDrill.forEach(function (drillItem) {
1762
- scenarioNames.forEach((key) => {
1763
- try {
1764
- drillItem[key] =
1765
- drillItem[key] /
1766
- rowGroupSumResultMap.get(drillItem[formatter.QueryColumnNames.ROWGROUP])[key];
1767
- }
1768
- catch (err) {
1769
- console.error("DataQuery: partOf drill row calculation failed", key, err);
1770
- drillItem[key] = Number.NaN;
1771
- }
1772
- });
1773
- });
1774
- this.injectDrillRowsToResultRows(resDrill, res);
1775
- }
1776
- /**
1777
- * Generates a REST row that aggregates all data rows beyond the configured limit.
1778
- * Only emitted when a limit is set and the group has more rows than the limit.
1779
- */
1780
- createRestRow(rowGroupEntry, querys, groups, scenarios, queryWhereSection, order) {
1781
- // Generates REST Row; sumsup the Bottom (total number of rows - limit)
1782
- if (rowGroupEntry.totalRowCnt - this.config.limit > 0 && this.config.limit !== 0) {
1783
- const rest_scenarios = ", SUM(ac1) as ac1, SUM(pp1) as pp1, SUM(dpp1_ac1_pos) as dpp1_ac1_pos, SUM(drpp1_ac1_pos) as drpp1_ac1_pos, SUM(dr_pp1)";
1784
- querys.push(`SELECT ${formatter.QueryColumnNames.ROWNR}, 1 as ${formatter.QueryColumnNames.ROWGROUPINDEX} , 'ENTRY' as ${formatter.QueryColumnNames.TYPE}, 'NO_GROUP' as ${formatter.QueryColumnNames.ROWGROUP}, 'REST' as ${formatter.QueryColumnNames.CATEGORY} ${rest_scenarios} as dr_pp1 FROM` +
1785
- ` (SELECT ROWNUM() AS ${formatter.QueryColumnNames.ROWNR}, ${querys.length} as ${formatter.QueryColumnNames.ROWGROUPINDEX} , 'ENTRY' as ${formatter.QueryColumnNames.TYPE}, '${rowGroupEntry.rowGroup || "NO_GROUP"}' as ${formatter.QueryColumnNames.ROWGROUP}, ${groups} ${scenarios.length > 0 ? ",".concat(scenarios) : ""} FROM ? ${queryWhereSection} GROUP BY ${groups} ORDER BY ${order[0]})` +
1786
- ` t WHERE t.rowNr > ${this.config.limit}`);
1787
- }
1788
- }
1789
- /** Generates the main data rows for a single row group, applying GROUP BY, ORDER, and LIMIT. */
1790
- createDataRow(querys, rowGroupEntry, groups, scenarios, queryWhereSection, order, queryLimitSection) {
1791
- // Generates DataRows
1792
- querys.push(`SELECT ROWNUM() AS ${formatter.QueryColumnNames.ROWNR},
1793
- ${querys.length} as ${formatter.QueryColumnNames.ROWGROUPINDEX},
1794
- 'ENTRY' as ${formatter.QueryColumnNames.TYPE},
1795
- '${rowGroupEntry.rowGroup || "NO_GROUP"}' as ${formatter.QueryColumnNames.ROWGROUP},
1796
- '${formatter.QueryColumnNames.CATEGORYINDEX}',
1797
- ${groups} ${scenarios.length > 0 ? ",".concat(scenarios) : ""}
1798
- FROM ? ${queryWhereSection}
1799
- GROUP BY ${groups}
1800
- ORDER BY ${order[0]} ${queryLimitSection}`);
1801
- }
1802
- /** Generates a GROUPHEAD row used as a visual header when row grouping is active. */
1803
- createGroupHeaderRow(rowGroupEntry, querys) {
1804
- // Generates GroupHeader Row
1805
- if (true === this.config.grouped) {
1806
- const groupTitle = this.config.showGroupTitle
1807
- ? `,'${rowGroupEntry.rowGroup}' as ${formatter.QueryColumnNames.CATEGORY}`
1808
- : "";
1809
- querys.push(`SELECT ROWNUM() AS ${formatter.QueryColumnNames.ROWNR},
1810
- ${querys.length} as ${formatter.QueryColumnNames.ROWGROUPINDEX},
1811
- 'GROUPHEAD' as ${formatter.QueryColumnNames.TYPE},
1812
- '${rowGroupEntry.rowGroup}' as ${formatter.QueryColumnNames.ROWGROUP} ${groupTitle}
1813
- FROM ?
1814
- GROUP BY '1'`);
1815
- }
1816
- }
1817
- /** Generates a GROUP_SUM row that aggregates all entries within a single row group. */
1818
- createGroupSumRow(querys, groupSumQuery, rowGroupEntry, scenariosSUMQuery, order) {
1819
- // Generates SUM Row; sumsup all rows of group
1820
- if (true === this.config.grouped &&
1821
- (TableType.SUM === this.config.type ||
1822
- TableType.SUMNOTOTAL === this.config.type ||
1823
- TableType.OPT === this.config.type ||
1824
- TableType.OPTNOTOTAL === this.config.type)) {
1825
- querys.push(`SELECT ${querys.length} as ${formatter.QueryColumnNames.ROWGROUPINDEX},
1826
- '=' as ${formatter.QueryColumnNames.OPERATION},
1827
- '${rowGroupEntry.rowGroup}' as ${formatter.QueryColumnNames.ROWGROUP},
1828
- ROWNUM() AS ${formatter.QueryColumnNames.ROWNR},
1829
- 'GROUP_SUM' as ${formatter.QueryColumnNames.TYPE} ${scenariosSUMQuery.length > 0 ? ",".concat(scenariosSUMQuery) : ""}
1830
- FROM ?
1831
- WHERE ${formatter.QueryColumnNames.ROWGROUP} = '${rowGroupEntry.rowGroup}'
1832
- ORDER BY ${order[0]} `);
1833
- groupSumQuery.push(`SELECT ${querys.length} as ${formatter.QueryColumnNames.ROWGROUPINDEX},
1834
- '=' as ${formatter.QueryColumnNames.OPERATION},
1835
- '${rowGroupEntry.rowGroup}' as ${formatter.QueryColumnNames.ROWGROUP},
1836
- ROWNUM() AS ${formatter.QueryColumnNames.ROWNR},
1837
- 'GROUP_SUM' as ${formatter.QueryColumnNames.TYPE} ${scenariosSUMQuery.length > 0 ? ",".concat(scenariosSUMQuery) : ""}
1838
- FROM ?
1839
- WHERE ${formatter.QueryColumnNames.ROWGROUP} = '${rowGroupEntry.rowGroup}'
1840
- ORDER BY ${order[0]} `);
1841
- }
1842
- }
1843
- /** Generates a total SUM row across all groups (only for SUM / OPT table types). */
1844
- createTotalSumRow(querys, sumGroupQueries, scenariosSUMQuery) {
1845
- if (TableType.SUM === this.config.type || TableType.OPT === this.config.type) {
1846
- const title = `${this.hasPartOf && this.config.grouped === false ? `${this.i18n.get("SUM_TOTAL") || "SUM_TOTAL"} ` : ""}${this.config.title}`;
1847
- querys.push(`SELECT ${querys.length} as ${formatter.QueryColumnNames.ROWGROUPINDEX},
1848
- '${title}' as ${formatter.QueryColumnNames.ROWGROUP},
1849
- '=' as ${formatter.QueryColumnNames.OPERATION},
1850
- 'SUM' as ${formatter.QueryColumnNames.TYPE} ${scenariosSUMQuery.length > 0 ? ",".concat(scenariosSUMQuery) : ""}
1851
- FROM ? `);
1852
- }
1853
- sumGroupQueries.push(`SELECT ${querys.length} as ${formatter.QueryColumnNames.ROWGROUPINDEX},
1854
- 'SUM_TOTAL' as ${formatter.QueryColumnNames.ROWGROUP},
1855
- '=' as ${formatter.QueryColumnNames.OPERATION},
1856
- 'SUM' as ${formatter.QueryColumnNames.TYPE} ${scenariosSUMQuery.length > 0 ? ",".concat(scenariosSUMQuery) : ""}
1857
- FROM ? `);
1858
- }
1859
- /**
1860
- * Manually merges drill rows that AlaSQL fails to aggregate correctly.
1861
- * Groups by composite key (rowNr + rowGroup + type + category) and sums scenario values.
1862
- */
1863
- reduceResDrillByCategoryGroups(resDrill, scenarioNames) {
1864
- // This is workarround because alasql is not merging the rows as expected.
1865
- const tmpSumMap = new Map();
1866
- resDrill.forEach(function (drillItem) {
1867
- const key = drillItem.rowNr + drillItem.rowGroup + drillItem.type + drillItem.category;
1868
- if (tmpSumMap.has(key)) {
1869
- const element = tmpSumMap.get(key);
1870
- scenarioNames.forEach((key) => {
1871
- try {
1872
- element[key] += drillItem[key];
1873
- }
1874
- catch (e) {
1875
- console.error("DataQuery: drill row aggregation failed", key, e);
1876
- }
1877
- });
1878
- }
1879
- else {
1880
- tmpSumMap.set(key, drillItem);
1881
- }
1882
- });
1883
- return [...tmpSumMap.values()];
1884
- }
1885
- /**
1886
- * Inserts drill (thereof/partof) rows into the result set directly after their
1887
- * parent category row. Handles both grouped and ungrouped modes, disambiguating
1888
- * duplicate subCategory names by appending the rowGroup in parentheses.
1889
- */
1890
- injectDrillRowsToResultRows(resDrill, res) {
1891
- // resDrill = resDrill.reverse();
1892
- const numberOfElement = new Map();
1893
- if (this.config.grouped === true) {
1894
- // finds ParentElement of Drill Element and injects into result arra
1895
- resDrill.forEach(function (drillItem) {
1896
- res.forEach(function (resSegment) {
1897
- const index = resSegment.findIndex((e) => e.category === drillItem.category && e.rowGroup === drillItem.rowGroup);
1898
- if (index >= 0) {
1899
- if (numberOfElement.has(`${drillItem.category}_${drillItem.rowGroup}`)) {
1900
- const num = numberOfElement.get(`${drillItem.category}_${drillItem.rowGroup}`) || 0;
1901
- numberOfElement.set(`${drillItem.category}_${drillItem.rowGroup}`, num + 1);
1902
- }
1903
- else {
1904
- numberOfElement.set(`${drillItem.category}_${drillItem.rowGroup}`, 1);
1905
- }
1906
- drillItem[formatter.QueryColumnNames.ROWNR] = numberOfElement.get(`${drillItem.category}_${drillItem.rowGroup}`);
1907
- resSegment.splice(index + drillItem[formatter.QueryColumnNames.ROWNR], 0, drillItem);
1908
- }
1909
- });
1910
- });
1911
- }
1912
- else {
1913
- // if no grouped mode selected matching only searching for category not for groupname
1914
- const duplicateSubCategoriesList = this.findDuplicateSubCategories(resDrill);
1915
- resDrill.forEach(function (drillItem) {
1916
- res.forEach(function (resSegment) {
1917
- const index = resSegment.findIndex((e) => e.category != null && e.category === drillItem.category);
1918
- if (index >= 0) {
1919
- if (numberOfElement.has(`${drillItem.category}`)) {
1920
- const num = numberOfElement.get(`${drillItem.category}`) || 0;
1921
- numberOfElement.set(`${drillItem.category}`, num + 1);
1922
- }
1923
- else {
1924
- numberOfElement.set(`${drillItem.category}`, 1);
1925
- }
1926
- if (drillItem[formatter.QueryColumnNames.ROWNR] === 1) {
1927
- drillItem.subCategory = `${drillItem.subCategory} (${drillItem.rowGroup})`;
1928
- }
1929
- else if (duplicateSubCategoriesList.includes(drillItem.subCategory)) {
1930
- drillItem.subCategory = `${drillItem.subCategory} (${drillItem.rowGroup})`;
1931
- }
1932
- resSegment.splice(index + drillItem[formatter.QueryColumnNames.ROWNR], 0, drillItem);
1933
- }
1934
- });
1935
- });
1936
- }
1937
- }
1938
- /**
1939
- * Creates "thereof" drill rows -- sub-breakdowns shown with absolute values
1940
- * beneath their parent category row. Each thereof config entry produces a
1941
- * filtered/grouped SQL query whose results are spliced into the result set.
1942
- */
1943
- createThereOfDrillRows(scenarios, order, data, res) {
1944
- // adds drill rows if setup in config
1945
- // if there of is set drilldown row is displayed with absolute numbers,
1946
- // if part of is also not null a relative percenatage based of the selected basis is displayed
1947
- if (this.config.thereOf === undefined || this.config.thereOf.length === 0) {
1948
- return;
1949
- }
1950
- const drillQueries = [];
1951
- const resDrill = []; // set of drill (subquery result injected into resultset)
1952
- // let rollgroups = ['category']; // frage wo kommt das her ?
1953
- // create drill queryies based on config
1954
- this.config.thereOf.forEach((element) => {
1955
- let isFirst = true;
1956
- let fromString = "1 <> 1 OR ( "; // helper for strin concat 1<>1 OR ... OR ...
1957
- if (!(null == element.category || 0 === element.category.length || !element.category.trim())) {
1958
- // if not empty
1959
- fromString += ` ${formatter.QueryColumnNames.CATEGORY} = '${element.category}'`;
1960
- isFirst = false;
1961
- }
1962
- if (!(null == element.rowGroup || 0 === element.rowGroup.length || !element.rowGroup.trim())) {
1963
- // if not empty
1964
- fromString += ` ${isFirst ? "" : "AND"} ${formatter.QueryColumnNames.ROWGROUP} = '${element.rowGroup}'`;
1965
- isFirst = false;
1966
- }
1967
- if (!(null == element.subCategory || 0 === element.subCategory.length || !element.subCategory.trim())) {
1968
- // if not empty
1969
- fromString += ` ${isFirst ? "" : "AND"} ${formatter.QueryColumnNames.SUBCATEGORY} = '${element.subCategory}'`;
1970
- }
1971
- fromString += `)`;
1972
- drillQueries.push(`SELECT ROWNUM() AS ${formatter.QueryColumnNames.ROWNR},
1973
- null as operation,
1974
- 'DRILLELEMENT' as ${formatter.QueryColumnNames.TYPE},
1975
- ${formatter.QueryColumnNames.CATEGORY},
1976
- ${formatter.QueryColumnNames.SUBCATEGORY},
1977
- ${formatter.QueryColumnNames.ROWGROUP} as ${formatter.QueryColumnNames.ROWGROUP},
1978
- ${scenarios}
1979
- FROM ?
1980
- WHERE ${fromString}
1981
- GROUP BY ${formatter.QueryColumnNames.ROWGROUP}, ${formatter.QueryColumnNames.CATEGORY}, ${formatter.QueryColumnNames.SUBCATEGORY}
1982
- ORDER BY ${order[1]}`);
1983
- });
1984
- // invertet Sort directon because the later used insertion which results into expected order direction
1985
- //drillQueries.push(`SELECT ROWNUM() AS ${QueryColumnNames.ROWNR}, null as operation, 'DRILLELEMENT' as ${QueryColumnNames.TYPE}, ${QueryColumnNames.CATEGORY}, ${QueryColumnNames.SUBCATEGORY}, ${QueryColumnNames.ROWGROUP} as ${QueryColumnNames.ROWGROUP} , ${scenarios} FROM ? WHERE ${fromString} GROUP BY ${QueryColumnNames.ROWGROUP}, ${QueryColumnNames.CATEGORY}, ${QueryColumnNames.SUBCATEGORY} ORDER BY ${order[1]}`);
1986
- drillQueries.forEach(function (query) {
1987
- resDrill.push(...alasql_min.alasql(query, [data]));
1988
- });
1989
- this.injectDrillRowsToResultRows(resDrill, res);
1990
- }
1991
- /**
1992
- * Converts absolute variance columns into relative (percentage) variances by dividing
1993
- * each `dr_*` cell by its denominator column (the delta scenario's aggregated value).
1994
- */
1995
- calculateRelativeVariances(res, relativeScenarios) {
1996
- res.forEach((group) => {
1997
- group.forEach((row) => {
1998
- if (row[formatter.QueryColumnNames.TYPE] !== "GROUPHEAD") {
1999
- relativeScenarios.forEach((value, key) => {
2000
- row[key] = row[key] / row[value];
2001
- });
2002
- }
2003
- });
2004
- });
2005
- }
2006
- /**
2007
- * Calculates REST columns for column-level thereof drills.
2008
- * REST = parent scenario value minus sum of all drilled child columns.
2009
- * Columns where REST is zero across all rows are removed entirely.
2010
- */
2011
- calculateColumnGroupRest(res, categoryThereOf) {
2012
- if (categoryThereOf == null || categoryThereOf.size === 0) {
2013
- return;
2014
- }
2015
- const scenarioRestMap = new Map();
2016
- const scenarioRestHasValuesMap = new Map();
2017
- categoryThereOf.forEach((value, key) => {
2018
- const categoryDrills = value;
2019
- const columnsList = [];
2020
- for (const drillElement of categoryDrills) {
2021
- columnsList.push(`${key}##${drillElement.name}`);
2022
- }
2023
- scenarioRestMap.set(key, columnsList);
2024
- scenarioRestHasValuesMap.set(`${key}##REST`, false);
2025
- });
2026
- res.forEach((group) => {
2027
- group.forEach((row) => {
2028
- if (row[formatter.QueryColumnNames.TYPE] !== "GROUPHEAD") {
2029
- scenarioRestMap.forEach((values, key) => {
2030
- let minuent = 0;
2031
- values.forEach((value) => {
2032
- if (row[value] !== undefined) {
2033
- minuent += row[value];
2034
- }
2035
- });
2036
- row[`${key}##REST`] = row[key] - minuent;
2037
- if (row[`${key}##REST`] !== 0) {
2038
- scenarioRestHasValuesMap.set(`${key}##REST`, true);
2039
- }
2040
- });
2041
- }
2042
- });
2043
- });
2044
- const emptyRestColumns = Array.from(scenarioRestHasValuesMap.entries())
2045
- .filter(([_key, value]) => !value)
2046
- .map(([key]) => key);
2047
- res.forEach((group) => {
2048
- group.forEach((row) => {
2049
- for (const deleteColumn of emptyRestColumns) {
2050
- delete row[deleteColumn];
2051
- }
2052
- });
2053
- });
2054
- }
2055
- /** Collects all relative variance scenarios and maps each to its denominator column name. */
2056
- getRelativeScenarios() {
2057
- const relativeScenarios = new Map();
2058
- this.config.scenarios.forEach((s) => {
2059
- const tmp = this.createRelativeScenario(s);
2060
- if (tmp != null) {
2061
- relativeScenarios.set(tmp.key, tmp.value);
2062
- }
2063
- });
2064
- return relativeScenarios;
2065
- }
2066
- /**
2067
- * Translates a scenario identifier into a SQL aggregation expression.
2068
- *
2069
- * - **OPT/OPTNOTOTAL types**: Values are summed without `transformOperator` (the
2070
- * operation sign is already baked into the data). Variance scenarios produce
2071
- * `SUM(base - delta)`.
2072
- * - **Other types**: Each value is multiplied by `transformOperator(operation)` which
2073
- * converts the `"+"` / `"-"` operation field into +1 / -1, so rows with negative
2074
- * operation are subtracted from the aggregate.
2075
- * - **Relative variances** (`dr_*`): additionally select the delta denominator column
2076
- * so `calculateRelativeVariances` can divide later.
2077
- * - A companion `_cnt` column (COUNT of non-null values) is emitted for NaN detection.
2078
- */
2079
- translateScenarioSQL(scenario, isSumRow, type) {
2080
- const scenarios = new formatter.VarianceScenario(scenario);
2081
- if (TableType.OPT === type || TableType.OPTNOTOTAL === type) {
2082
- if (scenarios.isValid) {
2083
- if (scenarios.type === "dr") {
2084
- return `SUM(${scenarios.base} - ${scenarios.delta}) as ${scenario}, SUM(${scenarios.delta}) as dr_${scenarios.delta}`;
2085
- }
2086
- else {
2087
- return `SUM(${scenarios.base} - ${scenarios.delta}) as ${scenario}`;
2088
- }
2089
- }
2090
- if (isSumRow) {
2091
- return `SUM(${scenario} * transformOperator(operation)) as ${scenario}, COUNT(ISNULL(${scenario})) as ${scenario}_cnt`;
2092
- }
2093
- return `SUM(${scenario}) as ${scenario}, COUNT(ISNULL(${scenario})) as ${scenario}_cnt`;
2094
- }
2095
- if (scenarios.isValid) {
2096
- if (scenarios.type === "dr") {
2097
- return `SUM((${scenarios.base} * transformOperator(operation)) - (${scenarios.delta} * transformOperator(operation))) as ${scenario}, SUM(${scenarios.delta} * transformOperator(operation)) as dr_${scenarios.delta}`;
2098
- }
2099
- else {
2100
- return `SUM((${scenarios.base} * transformOperator(operation))- (${scenarios.delta} * transformOperator(operation))) as ${scenario}`;
2101
- }
2102
- }
2103
- return `SUM(${scenario} * transformOperator(operation)) as ${scenario}, COUNT(ISNULL(${scenario})) as ${scenario}_cnt`;
2104
- }
2105
- /**
2106
- * generates Tuple
2107
- * [0] orderby string example: category asc
2108
- * [1] inverted order example: category desc
2109
- * @param orderComponent
2110
- */
2111
- createOrderString(orderComponent) {
2112
- const base = `${orderComponent.hierarchy.toString()} ${orderComponent.direction}`;
2113
- const inverted = `${orderComponent.hierarchy.toString()} ${OrderDirection.ASC === orderComponent.direction ? OrderDirection.DESC : OrderDirection.ASC}`;
2114
- return [base, inverted];
2115
- }
2116
- /** Returns a key/value pair mapping a relative variance column to its denominator, or null for non-relative scenarios. */
2117
- createRelativeScenario(scenario) {
2118
- const scenarios = new formatter.VarianceScenario(scenario);
2119
- if (scenarios.isValid && scenarios.type === "dr") {
2120
- return { key: `${scenario}`, value: `dr_${scenarios.delta}` };
2121
- }
2122
- return null;
2123
- }
2124
- /** Parses the comma-separated SQL scenario fragment to extract the alias names (the part after `as`). */
2125
- exctractScenarioNames(scenarios) {
2126
- const scenarioNames = [];
2127
- scenarios.split(",").forEach((item) => (item.length >= 2 ? scenarioNames.push(item.split("as")[1].trim()) : null));
2128
- return scenarioNames;
2129
- }
2130
- /** Identifies subCategory values that appear more than once in the drill set, requiring disambiguation. */
2131
- findDuplicateSubCategories(resDrill) {
2132
- const uniq = resDrill
2133
- .map((element) => {
2134
- return {
2135
- count: 1,
2136
- subCategory: element.subCategory,
2137
- };
2138
- })
2139
- .reduce((a, b) => {
2140
- a[b.subCategory] = (a[b.subCategory] || 0) + b.count;
2141
- return a;
2142
- }, {});
2143
- return Object.keys(uniq).filter((a) => uniq[a] > 1);
2144
- }
2145
- /** Builds the SQL query for partof drill rows, filtering to configured partOf categories. */
2146
- createPartOfQuery(scenarios, order) {
2147
- var _a;
2148
- const drillQueries = [];
2149
- let fromString = "1 <> 1 "; // helper for strin concat 1<>1 OR ... OR ...
2150
- let groupName = ` ${formatter.QueryColumnNames.ROWGROUP}`;
2151
- let rowNum = "ROWNUM()";
2152
- (_a = this.config.partOf) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
2153
- fromString += `OR (${formatter.QueryColumnNames.CATEGORY} = '${element.category}'`;
2154
- if (!(null == element.rowGroup || 0 === element.rowGroup.length || !element.rowGroup.trim())) {
2155
- // if not empty
2156
- fromString += `and ${formatter.QueryColumnNames.ROWGROUP} = '${element.rowGroup}'`;
2157
- }
2158
- if (this.config.grouped === false) {
2159
- groupName = ` 'SUM_TOTAL' as ${formatter.QueryColumnNames.ROWGROUP} `;
2160
- rowNum = "1";
2161
- }
2162
- fromString += `)`;
2163
- });
2164
- // let dimensionGroups = `${QueryColumnNames.CATEGORY}, ${QueryColumnNames.SUBCATEGORY}, ${QueryColumnNames.ROWGROUP}`;
2165
- // invertet Sort directon because the later used insertion which results into expected order direction
2166
- drillQueries.push(`SELECT ${rowNum} AS ${formatter.QueryColumnNames.ROWNR},
2167
- 'PARTELEMENT' as ${formatter.QueryColumnNames.TYPE},
2168
- ${formatter.QueryColumnNames.CATEGORY},
2169
- ${groupName},
2170
- ${scenarios}
2171
- FROM ?
2172
- WHERE ${fromString}
2173
- GROUP BY ${formatter.QueryColumnNames.ROWGROUP}, ${formatter.QueryColumnNames.CATEGORY}, ${formatter.QueryColumnNames.TYPE}
2174
- ORDER BY ${order[1]}`);
2175
- return drillQueries;
2176
- }
2177
- checkConfigForPartOf() {
2178
- if (this.config.partOf == null || this.config.partOf.length === 0) {
2179
- return false;
2180
- }
2181
- return true;
2182
- }
2183
- /**
2184
- * Creates column-level thereof drill breakdowns for the configured `categoryThereOf` map.
2185
- *
2186
- * For each scenario key, queries are generated at multiple aggregation levels
2187
- * (ENTRY, DRILLELEMENT, GROUP_SUM, SUM) crossed with column dimensions
2188
- * (COLUMNGROUP, SUBGROUP). Results are stored as new properties on existing
2189
- * result rows using the `"##"` separator convention: `scenario##columnGroup` or
2190
- * `scenario##columnGroup##columnSubGroup`.
2191
- */
2192
- createThereOfDrillColumns(categoryThereOf, data, res) {
2193
- if (categoryThereOf == null || categoryThereOf.size === 0) {
2194
- return;
2195
- }
2196
- const drillQueries = [];
2197
- const resDrill = [];
2198
- categoryThereOf.forEach((value, key) => {
2199
- let whereClause = "1 <> 1 ";
2200
- value.forEach((drillColumn) => {
2201
- whereClause += ` or columnGroup = '${drillColumn.name}' `;
2202
- });
2203
- drillQueries.push(`SELECT 'ENTRY' as rowlevel,
2204
- 'COLUMNGROUP' as columnlevel,
2205
- rowGroup,
2206
- category,
2207
- columnGroup,
2208
- '${key}' as scenario,
2209
- sum(${key} * transformOperator(operation)) as val
2210
- FROM ?
2211
- WHERE ${whereClause}
2212
- GROUP BY rowlevel, rowGroup, category, columnGroup, scenario`);
2213
- drillQueries.push(`SELECT 'ENTRY' as rowlevel,
2214
- 'SUBGROUP' as columnlevel,
2215
- rowGroup,
2216
- category,
2217
- columnGroup,
2218
- columnSubGroup,
2219
- '${key}' as scenario,
2220
- sum(${key} * transformOperator(operation)) as val
2221
- FROM ?
2222
- WHERE ${whereClause}
2223
- GROUP BY rowlevel, rowGroup, category, columnGroup, columnSubGroup, scenario`);
2224
- drillQueries.push(`SELECT 'DRILLELEMENT' as rowlevel,
2225
- 'COLUMNGROUP' as columnlevel,
2226
- rowGroup,
2227
- category,
2228
- subCategory,
2229
- columnGroup,
2230
- '${key}' as scenario,
2231
- sum(${key} * transformOperator(operation)) as val
2232
- FROM ?
2233
- WHERE ${whereClause}
2234
- GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, scenario`);
2235
- drillQueries.push(`SELECT 'DRILLELEMENT' as rowlevel,
2236
- 'SUBGROUP' as columnlevel,
2237
- rowGroup,
2238
- category,
2239
- subCategory,
2240
- columnGroup,
2241
- columnSubGroup,
2242
- '${key}' as scenario,
2243
- sum(${key} * transformOperator(operation)) as val
2244
- FROM ?
2245
- WHERE ${whereClause}
2246
- GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, columnSubGroup, scenario`);
2247
- drillQueries.push(`SELECT 'GROUP_SUM' as rowlevel,
2248
- 'COLUMNGROUP' as columnlevel,
2249
- rowGroup,
2250
- columnGroup,
2251
- '${key}' as scenario,
2252
- sum(${key} * transformOperator(operation)) as val
2253
- FROM ?
2254
- WHERE ${whereClause}
2255
- GROUP BY rowlevel, rowGroup, columnGroup, scenario`);
2256
- drillQueries.push(`SELECT 'GROUP_SUM' as rowlevel,
2257
- 'SUBGROUP' as columnlevel,
2258
- rowGroup,
2259
- columnGroup,
2260
- columnSubGroup,
2261
- '${key}' as scenario,
2262
- sum(${key} * transformOperator(operation)) as val
2263
- FROM ?
2264
- WHERE ${whereClause}
2265
- GROUP BY rowlevel, rowGroup, columnGroup, columnSubGroup, scenario`);
2266
- drillQueries.push(`SELECT 'SUM' as rowlevel,
2267
- 'COLUMNGROUP' as columnlevel,
2268
- columnGroup,
2269
- '${key}' as scenario,
2270
- sum(${key} * transformOperator(operation)) as val
2271
- FROM ?
2272
- WHERE ${whereClause}
2273
- GROUP BY rowlevel, columnGroup, scenario`);
2274
- drillQueries.push(`SELECT 'SUM' as rowlevel,
2275
- 'SUBGROUP' as columnlevel,
2276
- columnGroup,
2277
- columnSubGroup,
2278
- '${key}' as scenario,
2279
- sum(${key} * transformOperator(operation)) as val
2280
- FROM ?
2281
- WHERE ${whereClause}
2282
- GROUP BY rowlevel, columnGroup, columnSubGroup, scenario`);
2283
- });
2284
- for (const query of drillQueries) {
2285
- resDrill.push(...alasql_min.alasql(query, [data]));
2286
- }
2287
- this.injectDrillColumnsToResultRows(resDrill, res);
2288
- }
2289
- /**
2290
- * Merges column-drill query results into existing result rows by matching
2291
- * row type, category, subCategory, and rowGroup. Uses the `"##"` separator
2292
- * to form composite property keys for drill column values.
2293
- */
2294
- injectDrillColumnsToResultRows(resDrill, res) {
2295
- const separator = "##";
2296
- for (const drillElement of resDrill) {
2297
- for (const tableSegment of res) {
2298
- for (const row of tableSegment) {
2299
- if (row.type !== drillElement.rowlevel) {
2300
- continue;
2301
- }
2302
- if ("ENTRY" === drillElement.rowlevel) {
2303
- if (drillElement.columnlevel === "COLUMNGROUP" && row.category === drillElement.category) {
2304
- row[drillElement.scenario + separator + drillElement.columnGroup] = drillElement.val;
2305
- }
2306
- else if (drillElement.columnlevel === "SUBGROUP" && row.category === drillElement.category) {
2307
- row[drillElement.scenario + separator + drillElement.columnGroup + separator + drillElement.columnSubGroup] = drillElement.val;
2308
- }
2309
- }
2310
- else if ("DRILLELEMENT" === drillElement.rowlevel) {
2311
- if (drillElement.columnlevel === "COLUMNGROUP" &&
2312
- row.category === drillElement.category &&
2313
- row.subCategory === drillElement.subCategory) {
2314
- row[drillElement.scenario + separator + drillElement.columnGroup] = drillElement.val;
2315
- }
2316
- else if (drillElement.columnlevel === "SUBGROUP" &&
2317
- row.category === drillElement.category &&
2318
- row.subCategory === drillElement.subCategory) {
2319
- row[drillElement.scenario + separator + drillElement.columnGroup + separator + drillElement.columnSubGroup] = drillElement.val;
2320
- }
2321
- else if (drillElement.columnlevel === "COLUMNGROUP" &&
2322
- row.category === drillElement.category &&
2323
- row.subCategory === `${drillElement.subCategory} (${drillElement.rowGroup})`) {
2324
- row[drillElement.scenario + separator + drillElement.columnGroup] = drillElement.val;
2325
- }
2326
- else if (drillElement.columnlevel === "SUBGROUP" &&
2327
- row.category === drillElement.category &&
2328
- row.subCategory === `${drillElement.subCategory} (${drillElement.rowGroup})`) {
2329
- row[drillElement.scenario + separator + drillElement.columnGroup + separator + drillElement.columnSubGroup] = drillElement.val;
2330
- }
2331
- }
2332
- else if ("SUM" === drillElement.rowlevel) {
2333
- if (drillElement.columnlevel === "COLUMNGROUP" &&
2334
- row.category === drillElement.category &&
2335
- row.subCategory === drillElement.subCategory) {
2336
- row[drillElement.scenario + separator + drillElement.columnGroup] = drillElement.val;
2337
- }
2338
- if (drillElement.columnlevel === "SUBGROUP" &&
2339
- row.category === drillElement.category &&
2340
- row.subCategory === drillElement.subCategory) {
2341
- row[drillElement.scenario + separator + drillElement.columnGroup + separator + drillElement.columnSubGroup] = drillElement.val;
2342
- }
2343
- }
2344
- else if ("GROUP_SUM" === drillElement.rowlevel) {
2345
- if (drillElement.columnlevel === "COLUMNGROUP" &&
2346
- row.category === drillElement.category &&
2347
- row.subCategory === drillElement.subCategory) {
2348
- row[drillElement.scenario + separator + drillElement.columnGroup] = drillElement.val;
2349
- }
2350
- if (drillElement.columnlevel === "SUBGROUP" &&
2351
- row.category === drillElement.category &&
2352
- row.subCategory === drillElement.subCategory) {
2353
- row[drillElement.scenario + separator + drillElement.columnGroup + separator + drillElement.columnSubGroup] = drillElement.val;
2354
- }
2355
- }
2356
- }
2357
- }
2358
- }
2359
- }
2360
- }
2361
-
2362
- /**
2363
- * Transforms raw query results into structured TableRow collections for header and body.
2364
- *
2365
- * Header normalization: prepends fixed columns (operation, category) to the configured
2366
- * scenarios, then translates labels via i18n and adds separator rows for IBCS-style borders.
2367
- *
2368
- * Body row creation: iterates DataQuery results grouped by rowGroup, creates detail rows
2369
- * with type-specific logic (GROUPHEAD, SUM, DRILLELEMENT, PARTELEMENT, ENTRY), and
2370
- * translates cell values/prefixes via i18n. Supports inline bar chart columns via
2371
- * columnStats calculation.
2372
- */
2373
- class TableDataSetFactory {
2374
- constructor() {
2375
- this.normalizedHeader = [];
2376
- }
2377
- /**
2378
- * Creates Tableheader based on the configured scenarios (in config)
2379
- * the created header is stored in the dataset json
2380
- * the lables are translated based on the used i18n map
2381
- * based on the structure of the scenarios 'spacer'coulumns are added, to
2382
- * visualise grouping.
2383
- * finally a seperator header row is created for the header underlining (border)
2384
- */
2385
- createHeader(type, scenarios, i18n, measureScale, measureUnit, showMeasureScale) {
2386
- const header = [];
2387
- this.normalizedHeader = this.normalizeHeader(type, scenarios);
2388
- const headerRow = new TableRow(0, 0, TableRowType.HEADER);
2389
- const separatorRow = new TableRow(1, 0, TableRowType.SEPERATORLINE);
2390
- for (const scenario of this.normalizedHeader) {
2391
- headerRow.createElement(formatter.Formatter.translateScenarioLabel(scenario.name, i18n), scenario.type, this.createColumnType(scenario), null, this.setHeaderPrefix(scenario, i18n, measureScale, measureUnit, showMeasureScale), null, null, null, null);
2392
- separatorRow.createElement(null, scenario.type, this.createColumnType(scenario), null, null, null, null, null, null);
2393
- }
2394
- header.push(headerRow);
2395
- header.push(separatorRow);
2396
- return header;
2397
- }
2398
- setHeaderPrefix(scenario, i18n, measureScale, measureUnit, showMeasureScale) {
2399
- let prefix = "";
2400
- if (scenario.name === "category" && showMeasureScale) {
2401
- if (measureScale.prefix.length !== 0 || measureUnit.length !== 0) {
2402
- prefix = formatter.Formatter.translateScenarioLabel("in", i18n) + " " + measureScale.prefix + measureUnit;
2403
- }
2404
- }
2405
- if (scenario.order) {
2406
- prefix += formatter.Formatter.translateScenarioLabel("ORDER_" + scenario.order, i18n);
2407
- }
2408
- return prefix;
2409
- }
2410
- /**
2411
- * combines the default columnnames (operation and category) with the
2412
- * configured scenarios.
2413
- * depending of table type operation column is used (OPT) or not (SUM | LIST)
2414
- * in addition the headers are sorted based on the ruleset and duplicates are removed
2415
- */
2416
- normalizeHeader(type, scenarios) {
2417
- let header = [
2418
- {
2419
- name: formatter.QueryColumnNames.CATEGORY,
2420
- group: formatter.QueryColumnNames.CATEGORY,
2421
- type: formatter.QueryColumnNames.CATEGORY,
2422
- order: undefined,
2423
- },
2424
- ];
2425
- if (TableType.OPT === type || TableType.OPTNOTOTAL === type) {
2426
- header = [
2427
- {
2428
- name: formatter.QueryColumnNames.OPERATION,
2429
- group: formatter.QueryColumnNames.OPERATION,
2430
- type: formatter.QueryColumnNames.OPERATION,
2431
- order: undefined,
2432
- },
2433
- {
2434
- name: formatter.QueryColumnNames.CATEGORY,
2435
- group: formatter.QueryColumnNames.CATEGORY,
2436
- type: formatter.QueryColumnNames.CATEGORY,
2437
- order: undefined,
2438
- },
2439
- ];
2440
- }
2441
- // NOTE: scenarios are already sorted in setConfig
2442
- return [...header, ...scenarios];
2443
- }
2444
- /**
2445
- * Creates table data colelction,
2446
- * eachh row consists of data columns and 'spacer' columns which are needed to seperate
2447
- * the columns correctyl (IBCS style)
2448
- */
2449
- createBodyRows(config, i18n, data) {
2450
- const bodyRows = [];
2451
- let iGroupIndex = -1; // index used in detailRow JSON to count the current group
2452
- const queryData = new DataQuery(config, i18n).execute(data); // collection of all query results
2453
- // Calculate column statistics for bar columns
2454
- const columnStatsMap = this.calculateColumnStatistics(queryData, config.barColumns);
2455
- for (const groupData of queryData) {
2456
- // groupData is a collection of dataRows, each group base on a query and represents a 'row' group
2457
- iGroupIndex += 1;
2458
- const iRowIndex = -1;
2459
- bodyRows.push(...this.createRow(config.i18n, i18n, config.scenariosUnitType, groupData, iGroupIndex, iRowIndex, config.categoryWidth, config.measureScale, config.barColumns, columnStatsMap));
2460
- }
2461
- return bodyRows;
2462
- }
2463
- /**
2464
- * Calculate min/max statistics for bar chart columns across all query data.
2465
- */
2466
- calculateColumnStatistics(queryData, barColumns) {
2467
- const statsMap = new Map();
2468
- if (!barColumns || barColumns.length === 0) {
2469
- return statsMap;
2470
- }
2471
- // Initialize stats for each bar column
2472
- for (const column of barColumns) {
2473
- statsMap.set(column, { min: Infinity, max: -Infinity, absMax: 0 });
2474
- }
2475
- // Iterate through all groups and rows
2476
- for (const groupData of queryData) {
2477
- for (const row of groupData) {
2478
- for (const column of barColumns) {
2479
- const value = this.extractColumnValue(row, column);
2480
- if (value !== null && !isNaN(value)) {
2481
- const stats = statsMap.get(column);
2482
- stats.min = Math.min(stats.min, value);
2483
- stats.max = Math.max(stats.max, value);
2484
- }
2485
- }
2486
- }
2487
- }
2488
- // Finalize absMax values
2489
- for (const [column, stats] of statsMap) {
2490
- if (stats.min === Infinity || stats.max === -Infinity) {
2491
- stats.min = 0;
2492
- stats.max = 0;
2493
- }
2494
- stats.absMax = Math.max(Math.abs(stats.min), Math.abs(stats.max));
2495
- statsMap.set(column, stats);
2496
- }
2497
- return statsMap;
2498
- }
2499
- /**
2500
- * Extract a numeric value from a row for a given column name.
2501
- * Handles the various naming conventions used in the table data.
2502
- */
2503
- extractColumnValue(row, column) {
2504
- // Try direct access
2505
- if (row[column] !== undefined) {
2506
- const val = Number(row[column]);
2507
- return isNaN(val) ? null : val;
2508
- }
2509
- // Search for keys that match the column (handles scenario## prefix patterns)
2510
- for (const key of Object.keys(row)) {
2511
- if (key === column || key.endsWith("##" + column) || key === column + "##" + column) {
2512
- const val = Number(row[key]);
2513
- if (!isNaN(val)) {
2514
- return val;
2515
- }
2516
- }
2517
- }
2518
- return null;
2519
- }
2520
- /**
2521
- * Helper funciton to generate a new Table Row,
2522
- * it calls itsself recursive if a drilldown is set by the config file.
2523
- * a drilldown is detected if there is a colection of rows in .drill
2524
- *
2525
- * @param i18nMode
2526
- * @param i18n
2527
- * @param scenariosUnitType
2528
- * @param groupData
2529
- * @param iGroupIndex
2530
- * @param iRowIndex
2531
- * @param categoryWidth
2532
- * @param measureScale
2533
- * @param barColumns
2534
- * @param columnStatsMap
2535
- */
2536
- createRow(i18nMode, i18n, scenariosUnitType, groupData, iGroupIndex, iRowIndex, categoryWidth, measureScale, barColumns, columnStatsMap) {
2537
- var _a;
2538
- const result = [];
2539
- for (const rawDataRow of groupData) {
2540
- iRowIndex += 1;
2541
- // create next table row
2542
- const groupName = rawDataRow[formatter.QueryColumnNames.ROWGROUP];
2543
- const subCategory = rawDataRow[formatter.QueryColumnNames.SUBCATEGORY];
2544
- const type = rawDataRow[formatter.QueryColumnNames.TYPE];
2545
- const isSecondElement = rawDataRow[formatter.QueryColumnNames.ROWNR] >= 2;
2546
- const detailsRow = this.createDetailRow(type, iRowIndex, iGroupIndex, groupData.length);
2547
- for (const scenario of this.normalizedHeader) {
2548
- const value = this.getRawDataRowElement(rawDataRow, scenario);
2549
- const isBarChart = (_a = barColumns === null || barColumns === void 0 ? void 0 : barColumns.includes(scenario.type)) !== null && _a !== void 0 ? _a : false;
2550
- const columnStats = isBarChart ? columnStatsMap === null || columnStatsMap === void 0 ? void 0 : columnStatsMap.get(scenario.type) : undefined;
2551
- detailsRow.createElement(this.translateSumCellLabel(i18nMode, i18n, value, groupName, subCategory, type, scenario.type), scenario.type, this.createColumnType(scenario), this.setCellType(scenario.type, scenariosUnitType), this.translateCellPrefix(i18n, type, scenario.type), this.translateScenarioCSS(scenario.type, value), isSecondElement, categoryWidth, measureScale === null || measureScale === void 0 ? void 0 : measureScale.value, isBarChart, columnStats);
2552
- }
2553
- result.push(detailsRow);
2554
- }
2555
- return result;
2556
- }
2557
- getRawDataRowElement(rawDataRow, scenario) {
2558
- if (scenario.name === scenario.group && scenario.name === scenario.type) {
2559
- // Default Sum Scenario (e.g. AC)
2560
- return rawDataRow[scenario.name];
2561
- }
2562
- else if (scenario.name === scenario.group && scenario.name !== scenario.type) {
2563
- return rawDataRow[scenario.type + "##" + scenario.name];
2564
- }
2565
- return rawDataRow[scenario.type + "##" + scenario.group + "##" + scenario.name];
2566
- }
2567
- /**
2568
- * Crates a detail row depending on the radDataRow Type
2569
- * it switches between header, sum and standard,
2570
- *
2571
- * @param type valid values GROUPHEADER, SUM other values are interpreted as standard
2572
- * @param rowIndex
2573
- * @param groupIndex
2574
- * @param maxIndex total number of rows
2575
- */
2576
- createDetailRow(type, rowIndex, groupIndex, maxIndex) {
2577
- switch (type) {
2578
- case TableRowType.GROUPHEAD:
2579
- return new TableRow(rowIndex, groupIndex, TableRowType.HEADER);
2580
- case TableRowType.SUM:
2581
- return new TableRow(maxIndex + 2, groupIndex, TableRowType.SUM);
2582
- case TableRowType.GROUPSUM:
2583
- return new TableRow(maxIndex + 2, groupIndex, TableRowType.SUM);
2584
- case TableRowType.DRILLELEMENT:
2585
- return new TableRow(maxIndex + 2, groupIndex, TableRowType.DRILLELEMENT);
2586
- case TableRowType.PARTELEMENT:
2587
- return new TableRow(maxIndex + 2, groupIndex, TableRowType.PARTELEMENT);
2588
- default:
2589
- return new TableRow(rowIndex, groupIndex, TableRowType.STANDARD);
2590
- }
2591
- }
2592
- /**
2593
- * Translates Cell-Value (value) if possible,
2594
- * Numbers are not translated, just category names,
2595
- * if it is a SUM ROW rowGroup is used
2596
- * if it is a variance in OPT mode the absolute value is used
2597
- *
2598
- * @param value
2599
- * @param rowGroup
2600
- * @param type
2601
- * @param scenario
2602
- * @param subCategory
2603
- */
2604
- translateSumCellLabel(i18nMode, i18n, value, rowGroup, subCategory, type, scenario) {
2605
- if (Number.isNaN(Number(value)) === false) {
2606
- return value;
2607
- }
2608
- if (this.isOperationColumn(scenario)) {
2609
- return value;
2610
- }
2611
- if (this.isGroupHeadCategory(type, scenario)) {
2612
- if (i18nMode === constants.I18nMode.ALL) {
2613
- return `${i18n.get(value) || value}`;
2614
- }
2615
- return value;
2616
- }
2617
- if (this.isEntryCategory(type, scenario)) {
2618
- if (i18nMode === constants.I18nMode.ALL) {
2619
- return `${i18n.get(value) || value}`;
2620
- }
2621
- return value;
2622
- }
2623
- if (this.isDrillElementCategory(type, scenario)) {
2624
- if (i18nMode === constants.I18nMode.ALL) {
2625
- return `${i18n.get(subCategory) || subCategory}`;
2626
- }
2627
- return `${subCategory}`;
2628
- }
2629
- if (this.isPartElementCategory(type, scenario)) {
2630
- // translate allways because of default sum symbol.
2631
- if (i18nMode === constants.I18nMode.ALL || rowGroup === "SUM_TOTAL") {
2632
- return `${i18n.get(rowGroup) || rowGroup}`;
2633
- }
2634
- return `${rowGroup}`;
2635
- }
2636
- if (this.isSumElementCategory(type, scenario)) {
2637
- if (i18nMode === constants.I18nMode.ALL || rowGroup === "SUM_TOTAL") {
2638
- return `${i18n.get(rowGroup) || rowGroup}`;
2639
- }
2640
- return rowGroup;
2641
- }
2642
- if ("GROUPHEAD" === type && value == null) {
2643
- return value;
2644
- }
2645
- if (Number.isNaN(Number(value))) {
2646
- return "-";
2647
- }
2648
- else {
2649
- return Number(value);
2650
- }
2651
- }
2652
- isOperationColumn(scenario) {
2653
- return scenario === "operation";
2654
- }
2655
- /**
2656
- * converts Scenario to CSS class
2657
- *
2658
- * @param scenario
2659
- * @param value
2660
- */
2661
- translateScenarioCSS(scenario, value) {
2662
- const scenarios = new formatter.VarianceScenario(scenario);
2663
- let prefix = "pos";
2664
- if (value < 0) {
2665
- prefix = "neg";
2666
- }
2667
- if (scenarios.isValid) {
2668
- return prefix + "_" + scenarios.direction + (scenarios.type === "dr" ? " relative_variance" : "");
2669
- }
2670
- return scenario;
2671
- }
2672
- setCellType(scenario, scenariosUnitType) {
2673
- if (scenario === "category") {
2674
- return "";
2675
- }
2676
- let unitType;
2677
- const scenarios = new formatter.VarianceScenario(scenario);
2678
- if (scenariosUnitType === constants.DataFormat.PERCENT) {
2679
- unitType = "percent";
2680
- if (scenarios.isValid && scenarios.type === "d") {
2681
- unitType = "decimal";
2682
- }
2683
- }
2684
- else {
2685
- unitType = "decimal";
2686
- if (scenarios.isValid && scenarios.type === "dr") {
2687
- unitType = "percent";
2688
- }
2689
- }
2690
- return unitType;
2691
- }
2692
- isDrillElementCategory(type, scenario) {
2693
- return "DRILLELEMENT" === type && "category" === scenario;
2694
- }
2695
- isPartElementCategory(type, scenario) {
2696
- return "PARTELEMENT" === type && "category" === scenario;
2697
- }
2698
- isSumElementCategory(type, scenario) {
2699
- return ("GROUP_SUM" === type || "SUM" === type) && "category" === scenario;
2700
- }
2701
- isEntryCategory(type, scenario) {
2702
- return "ENTRY" === type && "category" === scenario;
2703
- }
2704
- isGroupHeadCategory(type, scenario) {
2705
- return "GROUPHEAD" === type && "category" === scenario;
2706
- }
2707
- translateCellPrefix(i18n, type, scenario) {
2708
- if (this.isOperationColumn(scenario)) {
2709
- return null;
2710
- }
2711
- if (this.isGroupHeadCategory(type, scenario)) {
2712
- return null;
2713
- }
2714
- if (this.isEntryCategory(type, scenario)) {
2715
- return null;
2716
- }
2717
- if (this.isDrillElementCategory(type, scenario)) {
2718
- return `${i18n.get("there_of")} `;
2719
- }
2720
- if (this.isPartElementCategory(type, scenario)) {
2721
- // translate allways because of default sum symbol.
2722
- return `${i18n.get("part_of")} `;
2723
- }
2724
- return null;
2725
- }
2726
- createColumnType(scenario) {
2727
- if (scenario.name === scenario.group && scenario.name === scenario.type) {
2728
- return "base";
2729
- }
2730
- if (scenario.name === scenario.group) {
2731
- return "columnGroup";
2732
- }
2733
- return "columnSubGroup";
2734
- }
2735
- }
2736
-
2737
- /**
2738
- * High-level controller for IBCS table generation.
2739
- *
2740
- * Coordinates the data pipeline: raw data is filtered via AlaSQL, scenarios are
2741
- * sorted by the visualization rule set, and TableDataSetFactory produces the
2742
- * header rows (with i18n-translated labels) and body rows (with grouped/drilled data).
2743
- *
2744
- * Uses a dirty-flag pattern (FactoryState) to lazily regenerate header/body rows
2745
- * only when configuration, data, or i18n changes. getHeader() and getBody() trigger
2746
- * regeneration if the state is dirty.
2747
- */
2748
- class Table {
2749
- /**
2750
- * Initialises all Variables for the DataSet, created by the factory
2751
- * @param ruleSet
2752
- */
2753
- constructor(ruleSet, data, config) {
2754
- this.data = [];
2755
- this.headerRows = [];
2756
- this.bodyRows = [];
2757
- this.ruleSet = ruleSet || new StringAdapter.IBCSRuleSet();
2758
- this.dataSetFactory = new TableDataSetFactory();
2759
- this.config = this.initConfig(config);
2760
- this.i18n = this.initI18n(new Map());
2761
- this.setData(data, config.filter);
2762
- this.state = FactoryState.DIRTY;
2763
- }
2764
- /**
2765
- * Init load of translation dictionary map
2766
- * map is used to translate lables in the table
2767
- *
2768
- * example:
2769
- * ```
2770
- * let i18n: Map<string, string> = new Map();
2771
- * [{key: 'ac',value: 'AC'}].forEach(function(entry){
2772
- * i18n.set(entry.key, entry.value);
2773
- * })
2774
- * ```
2775
- * @param i18n
2776
- */
2777
- setI18n(i18n) {
2778
- this.i18n = this.initI18n(i18n);
2779
- }
2780
- initI18n(i18n) {
2781
- const defaultI18n = new Map([
2782
- ["", ""],
2783
- ["SEPERATOR_WS", ", "],
2784
- ["in", "in"],
2785
- ["ORDER_asc", "↑"],
2786
- ["ORDER_desc", "↓"],
2787
- ["ac1", "AC"],
2788
- ["pp1", "PY"],
2789
- ["fc1", "FC"],
2790
- ["pl1", "PL"],
2791
- ["ac2", "AC2"],
2792
- ["pp2", "PY2"],
2793
- ["fc2", "FC2"],
2794
- ["pl2", "PL2"],
2795
- ["ac3", "AC3"],
2796
- ["pp3", "PY3"],
2797
- ["fc3", "FC3"],
2798
- ["pl3", "PL3"],
2799
- ["ac4", "AC4"],
2800
- ["pp4", "PY4"],
2801
- ["fc4", "FC4"],
2802
- ["pl4", "PL4"],
2803
- ["in", "in"],
2804
- ["category", " "],
2805
- ["operation", " "],
2806
- ["there_of", "davon"],
2807
- ["part_of", "in % von"],
2808
- ["ibcssymbol_delta_ac", "Δ{%}"],
2809
- ["ibcssymbol_delta_generic", "Δ({%})"],
2810
- ["ibcssymbol_delta_ac_relative", "Δ{%}%"],
2811
- ["ibcssymbol_delta_generic_relative", "Δ({%})%"],
2812
- ["SUM_TOTAL", "❖"],
2813
- ]);
2814
- this.state = FactoryState.DIRTY; // mark dataSet for update
2815
- return new Map([...defaultI18n, ...(i18n || new Map())]);
2816
- }
2817
- initConfig(config) {
2818
- this.state = FactoryState.DIRTY; // mark dataSet for update
2819
- const tmpConfig = config;
2820
- // sorting scenario order based on Ruleset
2821
- const self = this;
2822
- config.scenarios.sort((n1, n2) => {
2823
- return self.ruleSet.getScenarioSorIndex(n1) - self.ruleSet.getScenarioSorIndex(n2);
2824
- });
2825
- return tmpConfig;
2826
- }
2827
- /**
2828
- * loads and varifies configuration which describes
2829
- * the filte for the to be generated dataset
2830
- *
2831
- * missing but necessary attributes are replaced by default values
2832
- *
2833
- * @param config
2834
- */
2835
- setConfig(config) {
2836
- this.config = this.initConfig(config);
2837
- }
2838
- setData(data, filter) {
2839
- if (data == null) {
2840
- return;
2841
- }
2842
- if (filter != null && filter.length > 0) {
2843
- try {
2844
- this.data = alasql_min.alasql(`SELECT * FROM ? WHERE ${filter}`, [data]);
2845
- }
2846
- catch (e) {
2847
- console.error("Table: filter query failed, using unfiltered data", filter, e);
2848
- this.data = data;
2849
- }
2850
- }
2851
- else {
2852
- this.data = data;
2853
- }
2854
- const normalizedScenarios = this.normalizeScenarios(this.config.scenarios, this.config.categoryThereOf, this.config.sortOrder);
2855
- this.headerRows = this.dataSetFactory.createHeader(this.config.type, normalizedScenarios, this.i18n, this.config.measureScale, this.config.measureUnit, this.config.showMeasureScale);
2856
- this.bodyRows = this.dataSetFactory.createBodyRows(this.config, this.i18n, this.data);
2857
- this.state = FactoryState.UP_TO_DATE;
2858
- }
2859
- update() {
2860
- const normalizedScenarios = this.normalizeScenarios(this.config.scenarios, this.config.categoryThereOf, this.config.sortOrder);
2861
- this.headerRows = this.dataSetFactory.createHeader(this.config.type, normalizedScenarios, this.i18n, this.config.measureScale, this.config.measureUnit, this.config.showMeasureScale);
2862
- this.bodyRows = this.dataSetFactory.createBodyRows(this.config, this.i18n, this.data);
2863
- this.state = FactoryState.UP_TO_DATE;
2864
- }
2865
- getHeader() {
2866
- if (this.state === FactoryState.DIRTY) {
2867
- this.update();
2868
- }
2869
- return this.headerRows;
2870
- }
2871
- getBody() {
2872
- if (this.state === FactoryState.DIRTY) {
2873
- this.update();
2874
- }
2875
- return this.bodyRows;
2876
- }
2877
- normalizeScenarios(scenarios, categoryThereOf, order) {
2878
- var _a;
2879
- const normalizedScenarios = [];
2880
- for (const scenario of scenarios) {
2881
- if (categoryThereOf === null || categoryThereOf === void 0 ? void 0 : categoryThereOf.has(scenario)) {
2882
- const categoryDrills = categoryThereOf.get(scenario);
2883
- for (const drillElement of categoryDrills) {
2884
- normalizedScenarios.push({
2885
- name: drillElement.name,
2886
- group: drillElement.name,
2887
- type: scenario,
2888
- order: undefined,
2889
- });
2890
- for (const drillSubElement of drillElement.subGroups) {
2891
- normalizedScenarios.push({
2892
- name: drillSubElement,
2893
- group: drillElement.name,
2894
- type: scenario,
2895
- order: undefined,
2896
- });
2897
- }
2898
- }
2899
- normalizedScenarios.push({ name: "REST", group: "REST", type: scenario, order: undefined });
2900
- }
2901
- let orderDirection = undefined;
2902
- if (((_a = order === null || order === void 0 ? void 0 : order.hierarchy) === null || _a === void 0 ? void 0 : _a.at(0)) === scenario) {
2903
- orderDirection = order.direction;
2904
- }
2905
- normalizedScenarios.push({ name: scenario, group: scenario, type: scenario, order: orderDirection });
2906
- }
2907
- return normalizedScenarios;
2908
- }
2909
- hasNoData() {
2910
- return this.data.length === 0;
2911
- }
2912
- }
2913
-
2914
- /**
2915
- * Configuration for an IBCS table component.
2916
- *
2917
- * Controls table behavior including drill-down groups, data formatting, and display modes.
2918
- *
2919
- * Drill-down concepts:
2920
- * - **thereOf** -- Sub-rows that break down a parent row's total (e.g. "thereof: domestic / international").
2921
- * Configured as an array of {@link TableDrillGroup} filters.
2922
- * - **partOf** -- Rows shown as a percentage share of a parent total.
2923
- * Also configured via {@link TableDrillGroup} filters.
2924
- * - **categoryThereOf** -- Column-level drill-down using the `##` separator convention in category names
2925
- * (e.g. `"Revenue##Product A"`) to expand a single category column into detail sub-columns.
2926
- * The Map key is the parent category, values are the detail records.
2927
- */
2928
- class TableComponentConfig {
2929
- constructor() {
2930
- this.title = "";
2931
- /** Active scenario column names (e.g. `["ac1", "pl1"]`). */
2932
- this.scenarios = [];
2933
- /** Number format for scenario values (decimal, percent, etc.). */
2934
- this.scenariosUnitType = constants.DataFormat.DECIMAL;
2935
- /** When true, rows are visually grouped by rowGroup. */
2936
- this.grouped = false;
2937
- this.showGroupTitle = true;
2938
- /** Drill-down sub-row definitions -- "thereof" breakdowns within a category. */
2939
- this.thereOf = [];
2940
- /** Column-level drill-down using `##` separator in category names. */
2941
- this.categoryThereOf = new Map();
2942
- /** Percentage-of-total sub-row definitions. */
2943
- this.partOf = [];
2944
- this.sortOrder = new Order.OrderAdapter(new StringAdapter.StringAdapter()).default();
2945
- /** Table aggregation mode: LIST (flat), SUM (with totals), OPT (with optional totals), etc. */
2946
- this.type = TableType.LIST;
2947
- /** Maximum rows to display; 0 means unlimited. */
2948
- this.limit = 0;
2949
- this.i18n = constants.I18nMode.ALL;
2950
- /** Proportion of table width allocated to the category label column. */
2951
- this.categoryWidth = constants.TableCategoryWidth.W25;
2952
- /** SI prefix for measure scaling (e.g. "k" for thousands, "M" for millions). */
2953
- this.measureScale = new DataFormatDigits.SiPrefix();
2954
- /** Unit label displayed in the table header (e.g. "EUR", "USD"). */
2955
- this.measureUnit = "";
2956
- /** Whether the measure represents a volume or a ratio, affecting formatting. */
2957
- this.measureType = constants.MeasureType.VOLUME;
2958
- this.showMeasureScale = true;
2959
- /** AlaSQL WHERE clause for additional row filtering. */
2960
- this.filter = "";
2961
- /** Scenario columns to render as inline bar charts instead of numbers. */
2962
- this.barColumns = [];
2963
- }
2964
- }
2965
- /**
2966
- * Converts untyped JSON into a validated {@link TableComponentConfig}.
2967
- *
2968
- * Requires the raw dataset for measure scale auto-calculation when `measureScale` is set to "auto".
2969
- */
2970
- class TableComponentConfigAdapter {
2971
- constructor(tableDrillGroupAdapter, stringAdapter, orderAdapter, dataSet) {
2972
- this.tableDrillGroupAdapter = tableDrillGroupAdapter;
2973
- this.stringAdapter = stringAdapter;
2974
- this.orderAdapter = orderAdapter;
2975
- this.dataSet = dataSet;
2976
- }
2977
- adapt(data) {
2978
- const config = new TableComponentConfig();
2979
- if (Order.CompareUtil.isString(data.title)) {
2980
- config.title = data.title;
2981
- }
2982
- if (Order.CompareUtil.isArray(data.scenarios)) {
2983
- config.scenarios = Order.AdapterUtils.adaptArray(data.scenarios, this.stringAdapter);
2984
- }
2985
- if (Order.CompareUtil.isExisting(data.scenariosUnitType)) {
2986
- config.scenariosUnitType = data.scenariosUnitType;
2987
- }
2988
- if (Order.CompareUtil.isBoolean(data.grouped)) {
2989
- config.grouped = data.grouped;
2990
- }
2991
- if (Order.CompareUtil.isBoolean(data.showGroupTitle)) {
2992
- config.showGroupTitle = data.showGroupTitle;
2993
- }
2994
- if (Order.CompareUtil.isBoolean(data.showMeasureScale)) {
2995
- config.showMeasureScale = data.showMeasureScale;
2996
- }
2997
- if (Order.CompareUtil.isArray(data.thereOf)) {
2998
- config.thereOf = Order.AdapterUtils.adaptArray(data.thereOf, this.tableDrillGroupAdapter);
2999
- }
3000
- if (Order.CompareUtil.isExisting(data.categoryThereOf)) {
3001
- config.categoryThereOf = data.categoryThereOf;
3002
- }
3003
- if (Order.CompareUtil.isArray(data.partOf)) {
3004
- config.partOf = Order.AdapterUtils.adaptArray(data.partOf, this.tableDrillGroupAdapter);
3005
- }
3006
- if (Order.CompareUtil.isExisting(data.order)) {
3007
- config.sortOrder = this.orderAdapter.adapt(data.order);
3008
- }
3009
- if (Order.CompareUtil.isExisting(data.type)) {
3010
- config.type = data.type;
3011
- }
3012
- if (Order.CompareUtil.isNumber(data.limit)) {
3013
- config.limit = data.limit;
3014
- }
3015
- if (Order.CompareUtil.isExisting(data.i18n)) {
3016
- config.i18n = data.i18n;
3017
- }
3018
- if (Order.CompareUtil.isExisting(data.categoryWidth)) {
3019
- config.categoryWidth = data.categoryWidth;
3020
- }
3021
- if (Order.CompareUtil.isExisting(data.measureScale)) {
3022
- config.measureScale = DataFormatDigits.DataAnalyzer.calculateMeasureScale(this.dataSet, config.scenarios, data.measureScale);
3023
- }
3024
- if (Order.CompareUtil.isExisting(data.measureType)) {
3025
- config.measureType = data.measureType;
3026
- }
3027
- if (Order.CompareUtil.isString(data.measureUnit)) {
3028
- config.measureUnit = data.measureUnit;
3029
- }
3030
- if (Order.CompareUtil.isString(data.filter)) {
3031
- config.filter = data.filter.trim();
3032
- }
3033
- if (Order.CompareUtil.isArray(data.barColumns)) {
3034
- config.barColumns = data.barColumns;
3035
- }
3036
- return config;
3037
- }
3038
- default() {
3039
- return new TableComponentConfig();
3040
- }
3041
- }
3042
-
3043
- // import { IAdapter } from "../../../../utils/helper/IAdapter";
3044
- // import { CompareUtil } from "../../../../utils/helper/CompareUtil";
3045
- /**
3046
- * Filter definition for a table drill-down operation (thereOf or partOf).
3047
- *
3048
- * Identifies which rows in the dataset participate in a drill-down group by matching
3049
- * on the three-level row hierarchy. For partOf drill-downs, the {@link partOf} field
3050
- * names the parent category whose total is used as the 100% reference.
3051
- */
3052
- class TableDrillGroup {
3053
- constructor() {
3054
- this.rowGroup = "";
3055
- this.category = "";
3056
- this.subCategory = "";
3057
- /** Parent category name for percentage-of-total (partOf) calculations. Empty for thereOf groups. */
3058
- this.partOf = "";
3059
- }
3060
- }
3061
- /** Converts untyped JSON into a validated {@link TableDrillGroup}. */
3062
- class TableDrillGroupAdapter {
3063
- constructor() { }
3064
- adapt(data) {
3065
- const group = new TableDrillGroup();
3066
- if (Order.CompareUtil.isString(data.rowGroup)) {
3067
- group.rowGroup = data.rowGroup;
3068
- }
3069
- if (Order.CompareUtil.isString(data.category)) {
3070
- group.category = data.category;
3071
- }
3072
- if (Order.CompareUtil.isString(data.subCategory)) {
3073
- group.subCategory = data.subCategory;
3074
- }
3075
- if (Order.CompareUtil.isString(data.partOf)) {
3076
- group.partOf = data.partOf;
3077
- }
3078
- return group;
3079
- }
3080
- default() {
3081
- return new TableDrillGroup();
3082
- }
3083
- }
3084
-
3085
- // import { IAdapter } from "../../../../utils/helper/IAdapter";
3086
- // import { CompareUtil } from "../../../../utils/helper/CompareUtil";
3087
- /**
3088
- * IBCS-compliant data row for table visualizations.
3089
- *
3090
- * Represents a single record with a three-level row hierarchy (rowGroup > category > subCategory),
3091
- * a two-level column hierarchy (columnGroup > columnSubGroup), and 16 scenario value slots across
3092
- * four scenario types: actual (ac1-4), previous period (pp1-4), forecast (fc1-4), and plan (pl1-4).
3093
- *
3094
- * The {@link operation} field controls how this row participates in aggregations:
3095
- * `"+"` adds and `"-"` subtracts the row's values. This is converted to a numeric multiplier
3096
- * by `transformOperator()` in the SQL query engine.
3097
- */
3098
- class TableDataRow {
3099
- constructor() {
3100
- /** Aggregation operator: `"+"` adds values, `"-"` subtracts them in SUM/OPT roll-ups. */
3101
- this.operation = "+";
3102
- }
3103
- addRowGroup(name, index) {
3104
- this.rowGroup = name;
3105
- this.rowGroupIndex = index;
3106
- }
3107
- addCategory(name, index) {
3108
- this.category = name;
3109
- this.categoryIndex = index;
3110
- }
3111
- addSubCategory(name, index) {
3112
- this.subCategory = name;
3113
- this.subCategoryIndex = index;
3114
- }
3115
- addColumnGroup(name, index) {
3116
- this.columnGroup = name;
3117
- this.columnGroupIndex = index;
3118
- }
3119
- addSubColumnGroup(name, index) {
3120
- this.columnSubGroup = name;
3121
- this.columnSubGroupIndex = index;
3122
- }
3123
- }
3124
- /**
3125
- * Converts untyped JSON records into validated {@link TableDataRow} instances.
3126
- *
3127
- * Only assigns fields that pass type validation via {@link CompareUtil}, so malformed
3128
- * input data is silently dropped and defaults are preserved.
3129
- */
3130
- class TableDataRowAdapter {
3131
- constructor() { }
3132
- adapt(data) {
3133
- const dataRow = new TableDataRow();
3134
- if (Order.CompareUtil.isOperator(data.operation)) {
3135
- dataRow.operation = data.operation;
3136
- }
3137
- if (Order.CompareUtil.isNumber(data.rowGroupIndex) && Order.CompareUtil.isString(data.rowGroup)) {
3138
- dataRow.addRowGroup(data.rowGroup, data.rowGroupIndex);
3139
- }
3140
- if (Order.CompareUtil.isNumber(data.categoryIndex) && Order.CompareUtil.isString(data.category)) {
3141
- dataRow.addCategory(data.category, data.categoryIndex);
3142
- }
3143
- if (Order.CompareUtil.isNumber(data.subCategoryIndex) && Order.CompareUtil.isString(data.subCategory)) {
3144
- dataRow.addSubCategory(data.subCategory, data.subCategoryIndex);
3145
- }
3146
- if (Order.CompareUtil.isNumber(data.columnGroupIndex) && Order.CompareUtil.isString(data.columnGroup)) {
3147
- dataRow.addColumnGroup(data.columnGroup, data.columnGroupIndex);
3148
- }
3149
- if (Order.CompareUtil.isNumber(data.columnSubGroupIndex) && Order.CompareUtil.isString(data.columnSubGroup)) {
3150
- dataRow.addSubColumnGroup(data.columnSubGroup, data.columnSubGroupIndex);
3151
- }
3152
- this.setActualValues(data, dataRow);
3153
- this.setPlanValues(data, dataRow);
3154
- this.setPreviousPeriodValues(data, dataRow);
3155
- this.setForecastValues(data, dataRow);
3156
- return dataRow;
3157
- }
3158
- default() {
3159
- return new TableDataRow();
3160
- }
3161
- setActualValues(data, dataRow) {
3162
- if (Order.CompareUtil.isNumber(data.ac1)) {
3163
- dataRow.ac1 = data.ac1;
3164
- }
3165
- if (Order.CompareUtil.isNumber(data.ac2)) {
3166
- dataRow.ac2 = data.ac2;
3167
- }
3168
- if (Order.CompareUtil.isNumber(data.ac3)) {
3169
- dataRow.ac3 = data.ac3;
3170
- }
3171
- if (Order.CompareUtil.isNumber(data.ac4)) {
3172
- dataRow.ac4 = data.ac4;
3173
- }
3174
- }
3175
- setPlanValues(data, dataRow) {
3176
- if (Order.CompareUtil.isNumber(data.pp1)) {
3177
- dataRow.pp1 = data.pp1;
3178
- }
3179
- if (Order.CompareUtil.isNumber(data.pp2)) {
3180
- dataRow.pp2 = data.pp2;
3181
- }
3182
- if (Order.CompareUtil.isNumber(data.pp3)) {
3183
- dataRow.pp3 = data.pp3;
3184
- }
3185
- if (Order.CompareUtil.isNumber(data.pp4)) {
3186
- dataRow.pp4 = data.pp4;
3187
- }
3188
- }
3189
- setPreviousPeriodValues(data, dataRow) {
3190
- if (Order.CompareUtil.isNumber(data.pl1)) {
3191
- dataRow.pl1 = data.pl1;
3192
- }
3193
- if (Order.CompareUtil.isNumber(data.pl2)) {
3194
- dataRow.pl2 = data.pl2;
3195
- }
3196
- if (Order.CompareUtil.isNumber(data.pl3)) {
3197
- dataRow.pl3 = data.pl3;
3198
- }
3199
- if (Order.CompareUtil.isNumber(data.pl4)) {
3200
- dataRow.pl4 = data.pl4;
3201
- }
3202
- }
3203
- setForecastValues(data, dataRow) {
3204
- if (Order.CompareUtil.isNumber(data.fc1)) {
3205
- dataRow.fc1 = data.fc1;
3206
- }
3207
- if (Order.CompareUtil.isNumber(data.fc2)) {
3208
- dataRow.fc2 = data.fc2;
3209
- }
3210
- if (Order.CompareUtil.isNumber(data.fc3)) {
3211
- dataRow.fc3 = data.fc3;
3212
- }
3213
- if (Order.CompareUtil.isNumber(data.fc4)) {
3214
- dataRow.fc4 = data.fc4;
3215
- }
3216
- }
3217
- }
3218
-
3219
- const ibcsTableCss = () => `:host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral{text-align:right}.category-inf{max-width:1000em}.category-w100{max-width:100em}.category-w50{max-width:50em}.category-w25{max-width:25em}.category-w20{max-width:20em}.category-w15{max-width:15em}.category-w10{max-width:10em}.category-w5{max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;max-width:15em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}td:has(.cell-bar-chart).pos_pos:before,td:has(.cell-bar-chart).pos_neg:before,td:has(.cell-bar-chart).pos_neu:before{content:none}td:has(.cell-bar-chart).variance:after{content:none}`;
3220
-
3221
- const IbcsTable = class {
3222
- constructor(hostRef) {
3223
- index.registerInstance(this, hostRef);
3224
- this.data = [];
3225
- this.tableTitle = "SUM_TOTAL";
3226
- this.scenarios = [];
3227
- this.scenariosDataFormat = constants.DataFormat.DECIMAL;
3228
- this.grouped = false;
3229
- this.limit = 0;
3230
- this.showGroupTitle = true;
3231
- this.thereof = [];
3232
- this.partof = [];
3233
- this.order = {
3234
- hierarchy: [],
3235
- direction: OrderDirection.ASC,
3236
- };
3237
- this.categorythereof = new Map();
3238
- this.type = TableType.LIST;
3239
- this.categoryWidth = constants.TableCategoryWidth.INF;
3240
- this.dataFormatDigits = { percent: 2, decimal: 1 };
3241
- this.i18n = new Map();
3242
- this.i18nMode = constants.I18nMode.ALL;
3243
- this.measureScale = "_";
3244
- this.measureUnit = "";
3245
- this.showMeasureScale = true;
3246
- this.measureType = constants.MeasureType.VOLUME;
3247
- this.filter = "";
3248
- this.barColumns = [];
3249
- this.unitScaling = 0.01;
3250
- this.percentageScaling = 0.5;
3251
- this.scaleFactor = 1;
3252
- this.componentDataFormatDigits = new DataFormatDigits.DataFormatDigits();
3253
- this.componentStyle = withComponentStyle.withComponentStyle(this);
3254
- }
3255
- render() {
3256
- const helper = () => {
3257
- if (this.table === undefined) {
3258
- return;
3259
- }
3260
- if (this.table.hasNoData()) {
3261
- const errorMsg = this.i18n.get("NO_DATA") || "==No Data==";
3262
- return index.h("p", { class: "warning" }, errorMsg);
3263
- }
3264
- return (index.h("table", null, index.h("thead", null, this.table.getHeader().map((row) => (index.h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (index.h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (index.h("span", null, i === arr.length - 1 ? (index.h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (index.h("span", null, line, cell.drawPrefix(), index.h("br", null))))))))))))), index.h("tbody", null, this.table.getBody().map((row) => (index.h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (index.h("td", { colSpan: cell.colSpan, class: cell.cssStyle + " " + cell.type }, cell.prefix != null ? (index.h("span", { class: cell.cssStyle + " " + cell.prefixStyle }, cell.drawPrefix())) : (""), cell.isBarChart && cell.columnStats ? (index.h(CellBarChart, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: cell.key.startsWith("dr"), isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, styles: this.barChartStyles })) : (cell.draw(this.componentDataFormatDigits)))))))))));
3265
- };
3266
- return index.h(index.Host, null, helper());
3267
- }
3268
- componentWillRender() {
3269
- const config = this.prepareConfig();
3270
- const data = this.prepareData();
3271
- this.componentDataFormatDigits = new DataFormatDigits.DataFormatDigitsAdapter().adapt(this.dataFormatDigits);
3272
- this.barChartStyles = this.prepareBarChartStyles();
3273
- this.table = new Table(new StringAdapter.IBCSRuleSet(), data, config);
3274
- this.table.setI18n(this.i18n);
3275
- }
3276
- prepareConfig() {
3277
- const config = new TableComponentConfigAdapter(new TableDrillGroupAdapter(), new StringAdapter.StringAdapter(), new Order.OrderAdapter(new StringAdapter.StringAdapter()), this.data).adapt({
3278
- title: this.tableTitle,
3279
- scenarios: this.scenarios,
3280
- scenariosUnitType: this.scenariosDataFormat,
3281
- grouped: this.grouped,
3282
- showGroupTitle: this.showGroupTitle,
3283
- thereOf: this.thereof,
3284
- partOf: this.partof,
3285
- categoryThereOf: this.categorythereof,
3286
- order: this.order,
3287
- type: this.type,
3288
- limit: this.limit,
3289
- i18n: this.i18nMode,
3290
- categoryWidth: this.categoryWidth,
3291
- measureScale: this.measureScale,
3292
- measureUnit: this.measureUnit,
3293
- measureType: this.measureType,
3294
- showMeasureScale: this.showMeasureScale,
3295
- filter: this.filter,
3296
- barColumns: this.barColumns,
3297
- });
3298
- return config;
3299
- }
3300
- prepareData() {
3301
- return Order.AdapterUtils.adaptArray(this.data, new TableDataRowAdapter());
3302
- }
3303
- /**
3304
- * Prepares bar chart styles from componentStyle store.
3305
- * Uses the same variance styles as bn-chart-time for consistency.
3306
- * Supports fillpattern for different visual treatments (solid, hatched, outlined).
3307
- * Scenario styles (ac, pp, fc, pl) use barStyles for IBCS-compliant grayscale coloring.
3308
- */
3309
- prepareBarChartStyles() {
3310
- return this.componentStyle(($) => {
3311
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
3312
- const varianceStyles = (_a = $["bn-chart-time"]) === null || _a === void 0 ? void 0 : _a["varianceStyles"];
3313
- const barStyles = (_b = $["bn-chart-time"]) === null || _b === void 0 ? void 0 : _b["barStyles"];
3314
- // Default variance styles with fillpattern
3315
- const defaultPos = { stroke: "#008f96", fill: "#008f96", fillpattern: "solid" };
3316
- const defaultNeg = { stroke: "#ff0000", fill: "#ff0000", fillpattern: "solid" };
3317
- const defaultNeu = { stroke: "#808080", fill: "#808080", fillpattern: "outlined" };
3318
- // Default scenario styles (IBCS grayscale)
3319
- const defaultAc = { stroke: "#404040", fill: "#404040", fillpattern: "solid" };
3320
- const defaultPp = { stroke: "#A6A6A6", fill: "#A6A6A6", fillpattern: "solid" };
3321
- const defaultFc = { stroke: "#404040", fill: "#ffffff", fillpattern: "hatched" };
3322
- const defaultPl = { stroke: "#404040", fill: "#ffffff", fillpattern: "outlined" };
3323
- /* eslint-disable @typescript-eslint/no-explicit-any */
3324
- return {
3325
- positive: {
3326
- stroke: ((_c = varianceStyles === null || varianceStyles === void 0 ? void 0 : varianceStyles.pos) === null || _c === void 0 ? void 0 : _c.stroke) || defaultPos.stroke,
3327
- fill: ((_d = varianceStyles === null || varianceStyles === void 0 ? void 0 : varianceStyles.pos) === null || _d === void 0 ? void 0 : _d.fill) || defaultPos.fill,
3328
- fillpattern: ((_e = varianceStyles === null || varianceStyles === void 0 ? void 0 : varianceStyles.pos) === null || _e === void 0 ? void 0 : _e.fillpattern) || defaultPos.fillpattern,
3329
- },
3330
- negative: {
3331
- stroke: ((_f = varianceStyles === null || varianceStyles === void 0 ? void 0 : varianceStyles.neg) === null || _f === void 0 ? void 0 : _f.stroke) || defaultNeg.stroke,
3332
- fill: ((_g = varianceStyles === null || varianceStyles === void 0 ? void 0 : varianceStyles.neg) === null || _g === void 0 ? void 0 : _g.fill) || defaultNeg.fill,
3333
- fillpattern: ((_h = varianceStyles === null || varianceStyles === void 0 ? void 0 : varianceStyles.neg) === null || _h === void 0 ? void 0 : _h.fillpattern) || defaultNeg.fillpattern,
3334
- },
3335
- neutral: {
3336
- stroke: ((_j = varianceStyles === null || varianceStyles === void 0 ? void 0 : varianceStyles.neu) === null || _j === void 0 ? void 0 : _j.stroke) || defaultNeu.stroke,
3337
- fill: ((_k = varianceStyles === null || varianceStyles === void 0 ? void 0 : varianceStyles.neu) === null || _k === void 0 ? void 0 : _k.fill) || defaultNeu.fill,
3338
- fillpattern: ((_l = varianceStyles === null || varianceStyles === void 0 ? void 0 : varianceStyles.neu) === null || _l === void 0 ? void 0 : _l.fillpattern) || defaultNeu.fillpattern,
3339
- },
3340
- scenarios: {
3341
- ac: {
3342
- stroke: ((_m = barStyles === null || barStyles === void 0 ? void 0 : barStyles.ac) === null || _m === void 0 ? void 0 : _m.stroke) || defaultAc.stroke,
3343
- fill: ((_o = barStyles === null || barStyles === void 0 ? void 0 : barStyles.ac) === null || _o === void 0 ? void 0 : _o.fill) || defaultAc.fill,
3344
- fillpattern: ((_p = barStyles === null || barStyles === void 0 ? void 0 : barStyles.ac) === null || _p === void 0 ? void 0 : _p.fillpattern) || defaultAc.fillpattern,
3345
- },
3346
- pp: {
3347
- stroke: ((_q = barStyles === null || barStyles === void 0 ? void 0 : barStyles.pp) === null || _q === void 0 ? void 0 : _q.stroke) || defaultPp.stroke,
3348
- fill: ((_r = barStyles === null || barStyles === void 0 ? void 0 : barStyles.pp) === null || _r === void 0 ? void 0 : _r.fill) || defaultPp.fill,
3349
- fillpattern: ((_s = barStyles === null || barStyles === void 0 ? void 0 : barStyles.pp) === null || _s === void 0 ? void 0 : _s.fillpattern) || defaultPp.fillpattern,
3350
- },
3351
- fc: {
3352
- stroke: ((_t = barStyles === null || barStyles === void 0 ? void 0 : barStyles.fc) === null || _t === void 0 ? void 0 : _t.stroke) || defaultFc.stroke,
3353
- fill: ((_u = barStyles === null || barStyles === void 0 ? void 0 : barStyles.fc) === null || _u === void 0 ? void 0 : _u.fill) || defaultFc.fill,
3354
- fillpattern: ((_v = barStyles === null || barStyles === void 0 ? void 0 : barStyles.fc) === null || _v === void 0 ? void 0 : _v.fillpattern) || defaultFc.fillpattern,
3355
- },
3356
- pl: {
3357
- stroke: ((_w = barStyles === null || barStyles === void 0 ? void 0 : barStyles.pl) === null || _w === void 0 ? void 0 : _w.stroke) || defaultPl.stroke,
3358
- fill: ((_x = barStyles === null || barStyles === void 0 ? void 0 : barStyles.pl) === null || _x === void 0 ? void 0 : _x.fill) || defaultPl.fill,
3359
- fillpattern: ((_y = barStyles === null || barStyles === void 0 ? void 0 : barStyles.pl) === null || _y === void 0 ? void 0 : _y.fillpattern) || defaultPl.fillpattern,
3360
- },
3361
- },
3362
- /* eslint-enable @typescript-eslint/no-explicit-any */
3363
- fontColor: ((_z = $["global"]) === null || _z === void 0 ? void 0 : _z["fontColor"]) || "#000000",
3364
- fontSize: (((_0 = $["global"]) === null || _0 === void 0 ? void 0 : _0["fontSizePx"]) || 13.3333) * 0.85 * this.scaleFactor,
3365
- fontFamily: ((_1 = $["global"]) === null || _1 === void 0 ? void 0 : _1["fontFamily"]) || "'Noto Sans', sans-serif",
3366
- unitScaling: this.unitScaling,
3367
- percentageScaling: this.percentageScaling,
3368
- scaleFactor: this.scaleFactor,
3369
- };
3370
- });
3371
- }
3372
- get element() { return index.getElement(this); }
3373
- };
3374
- IbcsTable.style = ibcsTableCss();
3375
-
3376
- exports.bn_context = Context;
3377
- exports.bn_datasource = Datasource;
3378
- exports.bn_page = Page;
3379
- exports.bn_table = Table$1;
3380
- exports.ibcs_table = IbcsTable;