@bino-bi/bn-template-engine 1.0.0-alpha.8 → 1.0.0-next.19

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 (392) 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-19bbac66.entry.js +1 -0
  4. package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
  5. package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
  6. package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
  7. package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
  8. package/dist/bn-template-engine/p-74c5a95d.entry.js +1 -0
  9. package/dist/bn-template-engine/p-7bdc0e28.entry.js +1 -0
  10. package/dist/bn-template-engine/p-83c71b16.entry.js +1 -0
  11. package/dist/bn-template-engine/p-90806e7a.entry.js +1 -0
  12. package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
  13. package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
  14. package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
  15. package/dist/bn-template-engine/p-BZV1b5VH.js +1 -0
  16. package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
  17. package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
  18. package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
  19. package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
  20. package/dist/bn-template-engine/p-CiudZRQr.js +1 -0
  21. package/dist/bn-template-engine/p-DTuaq8Pj.js +1 -0
  22. package/dist/bn-template-engine/p-DY7YYmpa.js +1 -0
  23. package/dist/bn-template-engine/p-Dg9OcXAO.js +1 -0
  24. package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
  25. package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
  26. package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
  27. package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
  28. package/dist/bn-template-engine/p-b25455a7.entry.js +1 -0
  29. package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
  30. package/dist/bn-template-engine/p-eca8e2e2.entry.js +1 -0
  31. package/dist/bn-template-engine/p-f9dfd120.entry.js +1 -0
  32. package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
  33. package/dist/cjs/AxisConfig-VnVelfSV.js +233 -0
  34. package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
  35. package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
  36. package/dist/cjs/Order-DobBozQC.js +87 -0
  37. package/dist/cjs/SVGStyle-BQOmGWLX.js +8209 -0
  38. package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
  39. package/dist/cjs/VarianceMeasure-NY9yhiNV.js +372 -0
  40. package/dist/cjs/XYChartDataRow-B7OKrAcC.js +829 -0
  41. package/dist/cjs/bn-asset_21.cjs.entry.js +16047 -0
  42. package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
  43. package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
  44. package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
  45. package/dist/cjs/bn-grid.cjs.entry.js +5 -3
  46. package/dist/cjs/bn-image.cjs.entry.js +5 -3
  47. package/dist/cjs/bn-internationalization.cjs.entry.js +10 -8
  48. package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
  49. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  50. package/dist/cjs/bn-template.cjs.entry.js +1 -1
  51. package/dist/cjs/bn-text.cjs.entry.js +8 -79
  52. package/dist/cjs/bn-tree.cjs.entry.js +9 -3
  53. package/dist/cjs/context-protocol-BDrMkhc4.js +9499 -0
  54. package/dist/cjs/editor-companion.cjs.entry.js +13 -6
  55. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
  56. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
  57. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
  58. package/dist/cjs/layoutObserver-o03YUfn_.js +199 -0
  59. package/dist/cjs/loader.cjs.js +1 -1
  60. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
  61. package/dist/cjs/scaling-DKZyjWj5.js +587 -0
  62. package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
  63. package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
  64. package/dist/cjs/withStyled-CRiC9fzc.js +1137 -0
  65. package/dist/collection/collection-manifest.json +9 -1
  66. package/dist/collection/components/bn-body/bn-body.css +1 -0
  67. package/dist/collection/components/bn-card/bn-card.css +2 -0
  68. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
  69. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
  70. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
  71. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
  72. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
  73. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
  74. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
  75. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
  76. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
  77. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
  78. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
  79. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
  80. package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
  81. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
  82. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
  83. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
  84. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
  85. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
  86. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +127 -41
  87. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +103 -36
  88. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +82 -58
  89. package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
  90. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
  91. package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
  92. package/dist/collection/components/bn-chart-time/bn-chart-time.js +162 -42
  93. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +94 -31
  94. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +132 -74
  95. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
  96. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -4
  97. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
  98. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  99. package/dist/collection/components/bn-context/bn-context.js +1 -1
  100. package/dist/collection/components/bn-dataset/bn-dataset.js +226 -23
  101. package/dist/collection/components/bn-datasource/bn-datasource.js +163 -12
  102. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  103. package/dist/collection/components/bn-grid/bn-grid.js +1 -1
  104. package/dist/collection/components/bn-image/bn-image.js +1 -1
  105. package/dist/collection/components/bn-internationalization/bn-internationalization.js +10 -7
  106. package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -3
  107. package/dist/collection/components/bn-layout-card/bn-layout-card.js +98 -35
  108. package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -3
  109. package/dist/collection/components/bn-layout-page/bn-layout-page.js +98 -25
  110. package/dist/collection/components/bn-message/bn-message.css +6 -2
  111. package/dist/collection/components/bn-message/bn-message.js +3 -2
  112. package/dist/collection/components/bn-page/bn-page.js +1 -1
  113. package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
  114. package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
  115. package/dist/collection/components/bn-scaling-group/bn-scaling-group.css +3 -0
  116. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
  117. package/dist/collection/components/bn-table/bn-table.js +317 -61
  118. package/dist/collection/components/bn-table/ibcs-table.css +8 -0
  119. package/dist/collection/components/bn-table/ibcs-table.js +161 -32
  120. package/dist/collection/components/bn-table/utils/Table.js +72 -28
  121. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
  122. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
  123. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
  124. package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
  125. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +117 -22
  126. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +380 -50
  127. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
  128. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
  129. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
  130. package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
  131. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
  132. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +20 -4
  133. package/dist/collection/components/bn-template/bn-template.js +1 -1
  134. package/dist/collection/components/bn-text/bn-text.js +2 -75
  135. package/dist/collection/components/bn-title/bn-title.js +27 -3
  136. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
  137. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +29 -6
  138. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -0
  139. package/dist/collection/components/bn-tree/bn-tree.js +5 -1
  140. package/dist/collection/components/editor-companion/editor-companion.js +12 -5
  141. package/dist/collection/context/scopedDb.js +127 -0
  142. package/dist/collection/stores/componentStyles.js +67 -0
  143. package/dist/collection/stores/createScopedStores.js +11 -5
  144. package/dist/collection/stores/internationalization.js +68 -0
  145. package/dist/collection/stores/ruleSets.js +46 -0
  146. package/dist/collection/utils/constants.js +5 -0
  147. package/dist/collection/utils/dataAnalyzer.js +14 -8
  148. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  149. package/dist/collection/utils/layoutObserver.js +88 -0
  150. package/dist/collection/utils/parentDimensions.js +71 -15
  151. package/dist/collection/utils/sanitizeHtml.js +81 -0
  152. package/dist/collection/utils/validate.js +47 -0
  153. package/dist/collection/utils/withBodyObserver.js +12 -7
  154. package/dist/collection/utils/withComponentStyle.js +3 -5
  155. package/dist/collection/utils/withDataset.js +43 -39
  156. package/dist/collection/utils/withDatasource.js +28 -18
  157. package/dist/collection/utils/withInheritedProps.js +26 -1
  158. package/dist/collection/utils/withRuleSet.js +105 -0
  159. package/dist/collection/utils/withScalingGroup.js +69 -0
  160. package/dist/collection/utils/withTranslation.js +50 -14
  161. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  162. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  163. package/dist/collection/utils/xy/NumericScale.js +103 -0
  164. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  165. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  166. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  167. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  168. package/dist/collection/utils/xy/XYFrame.js +120 -0
  169. package/dist/collection/utils/xy/XYLegend.js +107 -0
  170. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  171. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  172. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  173. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  174. package/dist/components/AxisConfig.js +1 -0
  175. package/dist/components/CompareUtil.js +1 -0
  176. package/dist/components/DataFormatDigits.js +1 -1
  177. package/dist/components/DateStringFactory.js +1 -1
  178. package/dist/components/LabelCollisionManager.js +1 -0
  179. package/dist/components/NumericScale.js +1 -0
  180. package/dist/components/Order.js +1 -1
  181. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  182. package/dist/components/SiPrefix.js +1 -0
  183. package/dist/components/StringAdapter.js +1 -0
  184. package/dist/components/VarianceMeasure.js +1 -0
  185. package/dist/components/XYChartDataRow.js +1 -0
  186. package/dist/components/bn-body2.js +1 -1
  187. package/dist/components/bn-card2.js +1 -1
  188. package/dist/components/bn-chart-bubble.d.ts +11 -0
  189. package/dist/components/bn-chart-bubble.js +1 -0
  190. package/dist/components/bn-chart-bullet.d.ts +11 -0
  191. package/dist/components/bn-chart-bullet.js +1 -0
  192. package/dist/components/bn-chart-scatter.d.ts +11 -0
  193. package/dist/components/bn-chart-scatter.js +1 -0
  194. package/dist/components/bn-chart-structure.js +1 -1
  195. package/dist/components/bn-chart-time.js +1 -1
  196. package/dist/components/bn-component-style.js +1 -1
  197. package/dist/components/bn-context.js +1 -1
  198. package/dist/components/bn-dataset.js +1 -1
  199. package/dist/components/bn-datasource.js +1 -1
  200. package/dist/components/bn-footer2.js +1 -1
  201. package/dist/components/bn-grid.js +1 -1
  202. package/dist/components/bn-image.js +1 -1
  203. package/dist/components/bn-internationalization.js +1 -1
  204. package/dist/components/bn-layout-card.js +1 -1
  205. package/dist/components/bn-layout-page.js +1 -1
  206. package/dist/components/bn-message2.js +1 -1
  207. package/dist/components/bn-page2.js +1 -1
  208. package/dist/components/bn-ruleset.d.ts +11 -0
  209. package/dist/components/bn-ruleset.js +1 -0
  210. package/dist/components/bn-scaling-group.d.ts +11 -0
  211. package/dist/components/bn-scaling-group.js +1 -0
  212. package/dist/components/bn-table.js +1 -1
  213. package/dist/components/bn-template.js +1 -1
  214. package/dist/components/bn-text.js +1 -1
  215. package/dist/components/bn-title2.js +1 -1
  216. package/dist/components/bn-tree.js +1 -1
  217. package/dist/components/context-protocol.js +1 -1
  218. package/dist/components/editor-companion.js +1 -1
  219. package/dist/components/formatter.js +1 -0
  220. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  221. package/dist/components/ibcs-chart-bubble.js +1 -0
  222. package/dist/components/ibcs-chart-bubble2.js +1 -0
  223. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  224. package/dist/components/ibcs-chart-bullet.js +1 -0
  225. package/dist/components/ibcs-chart-bullet2.js +1 -0
  226. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  227. package/dist/components/ibcs-chart-scatter.js +1 -0
  228. package/dist/components/ibcs-chart-scatter2.js +1 -0
  229. package/dist/components/ibcs-chart-structure2.js +1 -1
  230. package/dist/components/ibcs-chart-time2.js +1 -1
  231. package/dist/components/ibcs-table2.js +1 -1
  232. package/dist/components/ibcs-title2.js +1 -1
  233. package/dist/components/layoutObserver.js +1 -0
  234. package/dist/components/luxon.js +1 -0
  235. package/dist/components/main.js +1 -0
  236. package/dist/components/merge.js +1 -0
  237. package/dist/components/sanitizeHtml.js +1 -0
  238. package/dist/components/stackColors.js +1 -0
  239. package/dist/components/validate.js +1 -1
  240. package/dist/components/withBodyObserver.js +1 -1
  241. package/dist/components/withComponentStyle.js +1 -1
  242. package/dist/components/withDataset.js +1 -0
  243. package/dist/components/withRuleSet.js +1 -0
  244. package/dist/components/withScalingGroup.js +1 -0
  245. package/dist/components/withStyled.js +1 -1
  246. package/dist/components/withTranslation.js +1 -1
  247. package/dist/esm/AxisConfig-C_zWCKlL.js +224 -0
  248. package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
  249. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  250. package/dist/esm/Order-BPeWfygb.js +83 -0
  251. package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
  252. package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
  253. package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
  254. package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
  255. package/dist/esm/bn-asset_21.entry.js +16025 -0
  256. package/dist/esm/bn-chart-bubble.entry.js +760 -0
  257. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  258. package/dist/esm/bn-chart-scatter.entry.js +656 -0
  259. package/dist/esm/bn-grid.entry.js +5 -3
  260. package/dist/esm/bn-image.entry.js +5 -3
  261. package/dist/esm/bn-internationalization.entry.js +10 -8
  262. package/dist/esm/bn-ruleset.entry.js +39 -0
  263. package/dist/esm/bn-template-engine.js +1 -1
  264. package/dist/esm/bn-template.entry.js +1 -1
  265. package/dist/esm/bn-text.entry.js +7 -78
  266. package/dist/esm/bn-tree.entry.js +9 -3
  267. package/dist/esm/context-protocol-1Yj1uKvh.js +9484 -0
  268. package/dist/esm/editor-companion.entry.js +13 -6
  269. package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
  270. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  271. package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
  272. package/dist/esm/layoutObserver-BG5dOBYH.js +196 -0
  273. package/dist/esm/loader.js +1 -1
  274. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  275. package/dist/esm/scaling-CeSRcRl1.js +579 -0
  276. package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
  277. package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
  278. package/dist/esm/withStyled-Br2DGTPs.js +1104 -0
  279. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  280. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  281. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  282. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  283. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  284. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  285. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  286. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  287. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  288. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  289. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  290. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  291. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
  292. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
  293. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +16 -12
  294. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  295. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  296. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
  297. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
  298. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +16 -12
  299. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
  300. package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
  301. package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
  302. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +35 -8
  303. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +32 -1
  304. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  305. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  306. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
  307. package/dist/types/components/bn-table/bn-table.d.ts +74 -12
  308. package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
  309. package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
  310. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  311. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  312. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  313. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  314. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  315. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
  316. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
  317. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  318. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  319. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  320. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  321. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  322. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
  323. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  324. package/dist/types/components/bn-title/bn-title.d.ts +11 -1
  325. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
  326. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  327. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  328. package/dist/types/components.d.ts +1691 -120
  329. package/dist/types/context/context-protocol.d.ts +7 -3
  330. package/dist/types/context/scopedDb.d.ts +37 -0
  331. package/dist/types/stores/componentStyles.d.ts +41 -0
  332. package/dist/types/stores/createScopedStores.d.ts +4 -2
  333. package/dist/types/stores/ruleSets.d.ts +40 -0
  334. package/dist/types/utils/DateStringFactory.d.ts +1 -1
  335. package/dist/types/utils/constants.d.ts +5 -0
  336. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  337. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  338. package/dist/types/utils/layoutObserver.d.ts +27 -0
  339. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  340. package/dist/types/utils/parentDimensions.d.ts +1 -1
  341. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  342. package/dist/types/utils/validate.d.ts +18 -0
  343. package/dist/types/utils/withDataset.d.ts +6 -2
  344. package/dist/types/utils/withDatasource.d.ts +3 -3
  345. package/dist/types/utils/withInheritedProps.d.ts +19 -0
  346. package/dist/types/utils/withRuleSet.d.ts +24 -0
  347. package/dist/types/utils/withScalingGroup.d.ts +14 -0
  348. package/dist/types/utils/withTranslation.d.ts +12 -4
  349. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  350. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  351. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  352. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  353. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  354. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  355. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  356. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  357. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  358. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  359. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  360. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  361. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  362. package/package.json +5 -4
  363. package/readme.md +9 -5
  364. package/dist/bn-template-engine/p-0d41c5d8.entry.js +0 -1
  365. package/dist/bn-template-engine/p-67538176.entry.js +0 -1
  366. package/dist/bn-template-engine/p-825a07a8.entry.js +0 -1
  367. package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
  368. package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
  369. package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
  370. package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
  371. package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
  372. package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
  373. package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
  374. package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
  375. package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
  376. package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23541
  377. package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
  378. package/dist/cjs/scaling-CIAClQR5.js +0 -314
  379. package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
  380. package/dist/collection/stores/datasets.js +0 -14
  381. package/dist/collection/stores/datasources.js +0 -14
  382. package/dist/components/_commonjsHelpers.js +0 -1
  383. package/dist/components/alasql.min.js +0 -1
  384. package/dist/components/ibcsRuleSet.js +0 -1
  385. package/dist/components/scaling.js +0 -1
  386. package/dist/components/withInheritedProps.js +0 -1
  387. package/dist/esm/bn-asset_20.entry.js +0 -23520
  388. package/dist/esm/context-protocol-DdbSplvE.js +0 -656
  389. package/dist/esm/scaling-DGKKkuL9.js +0 -309
  390. package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
  391. package/dist/types/stores/datasets.d.ts +0 -14
  392. package/dist/types/stores/datasources.d.ts +0 -14
@@ -3,15 +3,15 @@ import { OrderDirection, TableRowType, TableType } from "./utils/model";
3
3
  import { Table } from "./utils/Table";
4
4
  import { TableComponentConfigAdapter } from "./utils/model/TableComponentConfig";
5
5
  import { TableDrillGroupAdapter } from "./utils/model/TableDrillGroup";
6
- import { TableDataRowAdapter } from "./utils/model/TableDataRow";
7
6
  import { DataFormat, I18nMode, MeasureType, TableCategoryWidth } from "../../utils/constants";
8
- import { AdapterUtils } from "../../utils/helper/AdapterUtils";
9
7
  import { StringAdapter } from "../../utils/helper/StringAdapter";
10
8
  import { IBCSRuleSet } from "../../utils/ibcsRuleSet";
11
9
  import { DataFormatDigits, DataFormatDigitsAdapter } from "../../utils/model/DataFormatDigits";
12
10
  import { OrderAdapter } from "../../utils/model/Order";
13
11
  import { CellBarChart } from "./utils/elements/CellBarChart";
12
+ import { WaterfallBar } from "./utils/elements/WaterfallBar";
14
13
  import withComponentStyle from "../../utils/withComponentStyle";
14
+ import { getStores } from "../../context/context-protocol";
15
15
  /**
16
16
  * Internal rendering engine for `bn-table`.
17
17
  *
@@ -23,8 +23,21 @@ import withComponentStyle from "../../utils/withComponentStyle";
23
23
  */
24
24
  export class IbcsTable {
25
25
  constructor() {
26
- this.data = [];
27
- this.tableTitle = "SUM_TOTAL";
26
+ /**
27
+ * Name of the dataset (a table or view in the shared alasql database). The
28
+ * inner `Table` helper queries it directly — no array copy.
29
+ */
30
+ this.tableName = "";
31
+ /**
32
+ * Bumped by the outer `bn-table` whenever the dataset's data changes. Triggers
33
+ * a re-render via Stencil's prop-change detection.
34
+ */
35
+ this.dataVersion = 0;
36
+ /**
37
+ * Label of the grand-total row (`sum` / `opt` types only). The default
38
+ * `SUM_TOTAL` is an i18n key that resolves to the IBCS total symbol (❖).
39
+ */
40
+ this.sumTitle = "SUM_TOTAL";
28
41
  this.scenarios = [];
29
42
  this.scenariosDataFormat = DataFormat.DECIMAL;
30
43
  this.grouped = false;
@@ -37,6 +50,7 @@ export class IbcsTable {
37
50
  direction: OrderDirection.ASC,
38
51
  };
39
52
  this.categorythereof = new Map();
53
+ this.attributeColumns = [];
40
54
  this.type = TableType.LIST;
41
55
  this.categoryWidth = TableCategoryWidth.INF;
42
56
  this.dataFormatDigits = { percent: 2, decimal: 1 };
@@ -48,6 +62,7 @@ export class IbcsTable {
48
62
  this.measureType = MeasureType.VOLUME;
49
63
  this.filter = "";
50
64
  this.barColumns = [];
65
+ this.interval = "none";
51
66
  this.barColumnMaxWidth = 30;
52
67
  this.unitScaling = 0.01;
53
68
  this.percentageScaling = 0.5;
@@ -64,21 +79,31 @@ export class IbcsTable {
64
79
  const errorMsg = this.i18n.get("NO_DATA") || "==No Data==";
65
80
  return h("p", { class: "warning" }, errorMsg);
66
81
  }
67
- return (h("table", null, h("thead", null, this.table.getHeader().map((row) => (h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (h("span", null, i === arr.length - 1 ? (h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (h("span", null, line, cell.drawPrefix(), h("br", null))))))))))))), h("tbody", null, this.table.getBody().map((row) => (h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (h("td", { colSpan: cell.colSpan, class: cell.type ? `${cell.cssStyle} ${cell.type}` : cell.cssStyle }, cell.prefix != null ? (h("span", { class: cell.cssStyle + " " + cell.prefixStyle }, cell.drawPrefix())) : (""), cell.isBarChart && cell.columnStats && row.type !== TableRowType.SUM ? (h(CellBarChart, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: cell.key.startsWith("dr"), isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, maxBarWidth: this.barColumnMaxWidth, styles: this.barChartStyles })) : (cell.draw(this.componentDataFormatDigits)))))))))));
82
+ return (h("table", null, h("thead", null, this.table.getHeader().map((row) => (h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (h("span", null, i === arr.length - 1 ? (h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (h("span", null, line, cell.drawPrefix(), h("br", null))))))))))))), h("tbody", null, this.table.getBody().map((row) => (h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (h("td", { colSpan: cell.colSpan, class: cell.type ? `${cell.cssStyle} ${cell.type}` : cell.cssStyle }, cell.prefix != null ? (h("span", { class: cell.cssStyle + " " + cell.prefixStyle }, cell.drawPrefix())) : (""), cell.isBarChart &&
83
+ cell.columnStats &&
84
+ (cell.waterfall !== undefined || row.type !== TableRowType.SUM) ? (cell.waterfall !== undefined ? (h(WaterfallBar, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: false, isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, maxBarWidth: this.barColumnMaxWidth, styles: this.barChartStyles, waterfall: cell.waterfall })) : (h(CellBarChart, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: cell.key.startsWith("dr"), isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, maxBarWidth: this.barColumnMaxWidth, styles: this.barChartStyles }))) : (cell.draw(this.componentDataFormatDigits)))))))))));
68
85
  };
69
86
  return h(Host, null, helper());
70
87
  }
71
88
  componentWillRender() {
72
- const config = this.prepareConfig();
73
- const data = this.prepareData();
89
+ if (!this.stores)
90
+ this.stores = getStores(this.element);
91
+ const db = this.stores.db.db;
92
+ const config = this.prepareConfig(db);
74
93
  this.componentDataFormatDigits = new DataFormatDigitsAdapter().adapt(this.dataFormatDigits);
75
- this.table = new Table(new IBCSRuleSet(), data, config);
94
+ this.table = new Table(new IBCSRuleSet(this.ruleSetConfig), db, this.tableName, config);
76
95
  this.table.setI18n(this.i18n);
77
96
  this.barChartStyles = this.prepareBarChartStyles();
78
97
  }
79
- prepareConfig() {
80
- const config = new TableComponentConfigAdapter(new TableDrillGroupAdapter(), new StringAdapter(), new OrderAdapter(new StringAdapter()), this.data).adapt({
81
- title: this.tableTitle,
98
+ prepareConfig(db) {
99
+ var _a, _b, _c;
100
+ const fromExpr = this.tableName
101
+ ? this.filter && this.filter.length > 0
102
+ ? `(SELECT * FROM \`${this.tableName}\` WHERE ${this.filter}) AS __src`
103
+ : `\`${this.tableName}\``
104
+ : "";
105
+ const config = new TableComponentConfigAdapter(new TableDrillGroupAdapter(), new StringAdapter(), new OrderAdapter(new StringAdapter()), db, fromExpr).adapt({
106
+ title: this.sumTitle,
82
107
  scenarios: this.scenarios,
83
108
  scenariosUnitType: this.scenariosDataFormat,
84
109
  grouped: this.grouped,
@@ -86,6 +111,7 @@ export class IbcsTable {
86
111
  thereOf: this.thereof,
87
112
  partOf: this.partof,
88
113
  categoryThereOf: this.categorythereof,
114
+ attributes: this.attributeColumns,
89
115
  order: this.order,
90
116
  type: this.type,
91
117
  limit: this.limit,
@@ -97,12 +123,11 @@ export class IbcsTable {
97
123
  showMeasureScale: this.showMeasureScale,
98
124
  filter: this.filter,
99
125
  barColumns: this.barColumns,
126
+ interval: this.interval,
127
+ locale: ((_c = (_b = (_a = this.stores) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.state) === null || _c === void 0 ? void 0 : _c.locale) || "de",
100
128
  });
101
129
  return config;
102
130
  }
103
- prepareData() {
104
- return AdapterUtils.adaptArray(this.data, new TableDataRowAdapter());
105
- }
106
131
  /**
107
132
  * Prepares bar chart styles from componentStyle store.
108
133
  * Uses the same variance styles as bn-chart-time for consistency.
@@ -211,7 +236,8 @@ export class IbcsTable {
211
236
  if (row.type === TableRowType.SUM)
212
237
  continue;
213
238
  for (const cell of row.getCells()) {
214
- if (cell.isBarChart && cell.columnStats && !cell.key.startsWith("dr")) {
239
+ // waterfall cells scale independently and must not skew variance auto-scaling
240
+ if (cell.isBarChart && cell.columnStats && !cell.key.startsWith("dr") && !cell.waterfall) {
215
241
  max = Math.max(max, cell.columnStats.absMax);
216
242
  }
217
243
  }
@@ -251,32 +277,66 @@ export class IbcsTable {
251
277
  }
252
278
  static get properties() {
253
279
  return {
254
- "data": {
255
- "type": "unknown",
280
+ "tableName": {
281
+ "type": "string",
256
282
  "mutable": false,
257
283
  "complexType": {
258
- "original": "TableDataRow[]",
259
- "resolved": "TableDataRow[]",
260
- "references": {
261
- "TableDataRow": {
262
- "location": "import",
263
- "path": "./utils/model/TableDataRow",
264
- "id": "src/components/bn-table/utils/model/TableDataRow.ts::TableDataRow",
265
- "referenceLocation": "TableDataRow"
266
- }
267
- }
284
+ "original": "string",
285
+ "resolved": "string",
286
+ "references": {}
268
287
  },
269
288
  "required": false,
270
289
  "optional": false,
271
290
  "docs": {
272
291
  "tags": [],
273
- "text": ""
292
+ "text": "Name of the dataset (a table or view in the shared alasql database). The\ninner `Table` helper queries it directly \u2014 no array copy."
274
293
  },
275
294
  "getter": false,
276
295
  "setter": false,
277
- "defaultValue": "[]"
296
+ "reflect": false,
297
+ "attribute": "table-name",
298
+ "defaultValue": "\"\""
278
299
  },
279
- "tableTitle": {
300
+ "dataVersion": {
301
+ "type": "number",
302
+ "mutable": false,
303
+ "complexType": {
304
+ "original": "number",
305
+ "resolved": "number",
306
+ "references": {}
307
+ },
308
+ "required": false,
309
+ "optional": false,
310
+ "docs": {
311
+ "tags": [],
312
+ "text": "Bumped by the outer `bn-table` whenever the dataset's data changes. Triggers\na re-render via Stencil's prop-change detection."
313
+ },
314
+ "getter": false,
315
+ "setter": false,
316
+ "reflect": false,
317
+ "attribute": "data-version",
318
+ "defaultValue": "0"
319
+ },
320
+ "selectedStyle": {
321
+ "type": "string",
322
+ "mutable": false,
323
+ "complexType": {
324
+ "original": "string",
325
+ "resolved": "string",
326
+ "references": {}
327
+ },
328
+ "required": false,
329
+ "optional": true,
330
+ "docs": {
331
+ "tags": [],
332
+ "text": "Name of a registered component style, forwarded by the outer `bn-table`.\nReflected so the `withComponentStyle` mixin can read the `selected-style`\nattribute from the host element."
333
+ },
334
+ "getter": false,
335
+ "setter": false,
336
+ "reflect": true,
337
+ "attribute": "selected-style"
338
+ },
339
+ "sumTitle": {
280
340
  "type": "string",
281
341
  "mutable": false,
282
342
  "complexType": {
@@ -288,12 +348,12 @@ export class IbcsTable {
288
348
  "optional": false,
289
349
  "docs": {
290
350
  "tags": [],
291
- "text": ""
351
+ "text": "Label of the grand-total row (`sum` / `opt` types only). The default\n`SUM_TOTAL` is an i18n key that resolves to the IBCS total symbol (\u2756)."
292
352
  },
293
353
  "getter": false,
294
354
  "setter": false,
295
355
  "reflect": false,
296
- "attribute": "table-title",
356
+ "attribute": "sum-title",
297
357
  "defaultValue": "\"SUM_TOTAL\""
298
358
  },
299
359
  "scenarios": {
@@ -503,6 +563,31 @@ export class IbcsTable {
503
563
  "setter": false,
504
564
  "defaultValue": "new Map()"
505
565
  },
566
+ "attributeColumns": {
567
+ "type": "unknown",
568
+ "mutable": false,
569
+ "complexType": {
570
+ "original": "TableAttribute[]",
571
+ "resolved": "TableAttribute[]",
572
+ "references": {
573
+ "TableAttribute": {
574
+ "location": "import",
575
+ "path": "./utils/model/TableAttribute",
576
+ "id": "src/components/bn-table/utils/model/TableAttribute.ts::TableAttribute",
577
+ "referenceLocation": "TableAttribute"
578
+ }
579
+ }
580
+ },
581
+ "required": false,
582
+ "optional": false,
583
+ "docs": {
584
+ "tags": [],
585
+ "text": ""
586
+ },
587
+ "getter": false,
588
+ "setter": false,
589
+ "defaultValue": "[]"
590
+ },
506
591
  "type": {
507
592
  "type": "string",
508
593
  "mutable": false,
@@ -582,6 +667,30 @@ export class IbcsTable {
582
667
  "setter": false,
583
668
  "defaultValue": "{ percent: 2, decimal: 1 }"
584
669
  },
670
+ "ruleSetConfig": {
671
+ "type": "unknown",
672
+ "mutable": false,
673
+ "complexType": {
674
+ "original": "RuleSetConfig",
675
+ "resolved": "RuleSetConfig",
676
+ "references": {
677
+ "RuleSetConfig": {
678
+ "location": "import",
679
+ "path": "../../stores/ruleSets",
680
+ "id": "src/stores/ruleSets.ts::RuleSetConfig",
681
+ "referenceLocation": "RuleSetConfig"
682
+ }
683
+ }
684
+ },
685
+ "required": false,
686
+ "optional": true,
687
+ "docs": {
688
+ "tags": [],
689
+ "text": ""
690
+ },
691
+ "getter": false,
692
+ "setter": false
693
+ },
585
694
  "i18n": {
586
695
  "type": "unknown",
587
696
  "mutable": true,
@@ -757,6 +866,26 @@ export class IbcsTable {
757
866
  "setter": false,
758
867
  "defaultValue": "[]"
759
868
  },
869
+ "interval": {
870
+ "type": "string",
871
+ "mutable": false,
872
+ "complexType": {
873
+ "original": "string",
874
+ "resolved": "string",
875
+ "references": {}
876
+ },
877
+ "required": false,
878
+ "optional": false,
879
+ "docs": {
880
+ "tags": [],
881
+ "text": ""
882
+ },
883
+ "getter": false,
884
+ "setter": false,
885
+ "reflect": false,
886
+ "attribute": "interval",
887
+ "defaultValue": "\"none\""
888
+ },
760
889
  "barColumnMaxWidth": {
761
890
  "type": "number",
762
891
  "mutable": false,
@@ -2,8 +2,9 @@ import { FactoryState } from "./model";
2
2
  // import {IBCSRuleSet} from "../../../utils/ibcsRuleSet";
3
3
  import { TableDataSetFactory } from "./factories/tableDataSetFactory";
4
4
  // import { Order } from "../../../utils/model/Order";
5
- import alasql from "alasql";
6
5
  import { IBCSRuleSet } from "../../../utils/ibcsRuleSet";
6
+ import { buildFromExpr } from "../../../context/scopedDb";
7
+ import { INTERVAL_NONE, queryIntervalBuckets, resolveIntervalGranularity } from "./helper";
7
8
  /**
8
9
  * High-level controller for IBCS table generation.
9
10
  *
@@ -17,18 +18,21 @@ import { IBCSRuleSet } from "../../../utils/ibcsRuleSet";
17
18
  */
18
19
  export class Table {
19
20
  /**
20
- * Initialises all Variables for the DataSet, created by the factory
21
- * @param ruleSet
21
+ * Initialises all Variables for the DataSet, created by the factory.
22
+ * Reads data directly from the shared alasql database (named by `tableName`).
22
23
  */
23
- constructor(ruleSet, data, config) {
24
- this.data = [];
24
+ constructor(ruleSet, db, tableName, config) {
25
+ this.fromExpr = "";
26
+ this.rowCount = 0;
25
27
  this.headerRows = [];
26
28
  this.bodyRows = [];
29
+ this.intervalBuckets = [];
27
30
  this.ruleSet = ruleSet || new IBCSRuleSet();
31
+ this.db = db;
28
32
  this.dataSetFactory = new TableDataSetFactory();
29
33
  this.config = this.initConfig(config);
30
34
  this.i18n = this.initI18n(new Map());
31
- this.setData(data, config.filter);
35
+ this.setSource(tableName, config.filter);
32
36
  this.state = FactoryState.DIRTY;
33
37
  }
34
38
  /**
@@ -105,31 +109,37 @@ export class Table {
105
109
  setConfig(config) {
106
110
  this.config = this.initConfig(config);
107
111
  }
108
- setData(data, filter) {
109
- if (data == null) {
112
+ setSource(tableName, filter) {
113
+ var _a, _b;
114
+ if (!tableName) {
115
+ this.fromExpr = "";
116
+ this.rowCount = 0;
110
117
  return;
111
118
  }
112
- if (filter != null && filter.length > 0) {
113
- try {
114
- this.data = alasql(`SELECT * FROM ? WHERE ${filter}`, [data]);
115
- }
116
- catch (e) {
117
- console.error("Table: filter query failed, using unfiltered data", filter, e);
118
- this.data = data;
119
- }
119
+ this.fromExpr = buildFromExpr(tableName, filter);
120
+ try {
121
+ const r = this.db.exec(`SELECT COUNT(*) AS cnt FROM ${this.fromExpr}`);
122
+ this.rowCount = ((_b = (_a = r[0]) === null || _a === void 0 ? void 0 : _a.cnt) !== null && _b !== void 0 ? _b : 0);
120
123
  }
121
- else {
122
- this.data = data;
124
+ catch (_e) {
125
+ // Table may not exist yet (e.g. datasource hasn't loaded). Treat as empty.
126
+ this.rowCount = 0;
123
127
  }
124
- const normalizedScenarios = this.normalizeScenarios(this.config.scenarios, this.config.categoryThereOf, this.config.sortOrder);
125
- this.headerRows = this.dataSetFactory.createHeader(this.config.type, normalizedScenarios, this.i18n, this.config.measureScale, this.config.measureUnit, this.config.showMeasureScale);
126
- this.bodyRows = this.dataSetFactory.createBodyRows(this.config, this.i18n, this.data);
128
+ this.prepareIntervalBuckets();
129
+ const normalizedScenarios = this.normalizeScenarios(this.config.scenarios, this.config.categoryThereOf, this.config.sortOrder, this.intervalBuckets);
130
+ this.headerRows = this.dataSetFactory.createHeader(this.config.type, normalizedScenarios, this.i18n, this.config.measureScale, this.config.measureUnit, this.config.showMeasureScale, this.config.attributes);
131
+ this.bodyRows =
132
+ this.rowCount === 0 ? [] : this.dataSetFactory.createBodyRows(this.config, this.i18n, this.db, this.fromExpr);
127
133
  this.state = FactoryState.UP_TO_DATE;
128
134
  }
129
135
  update() {
130
- const normalizedScenarios = this.normalizeScenarios(this.config.scenarios, this.config.categoryThereOf, this.config.sortOrder);
131
- this.headerRows = this.dataSetFactory.createHeader(this.config.type, normalizedScenarios, this.i18n, this.config.measureScale, this.config.measureUnit, this.config.showMeasureScale);
132
- this.bodyRows = this.dataSetFactory.createBodyRows(this.config, this.i18n, this.data);
136
+ this.prepareIntervalBuckets();
137
+ const normalizedScenarios = this.normalizeScenarios(this.config.scenarios, this.config.categoryThereOf, this.config.sortOrder, this.intervalBuckets);
138
+ this.headerRows = this.dataSetFactory.createHeader(this.config.type, normalizedScenarios, this.i18n, this.config.measureScale, this.config.measureUnit, this.config.showMeasureScale, this.config.attributes);
139
+ this.bodyRows =
140
+ this.rowCount === 0 || !this.fromExpr
141
+ ? []
142
+ : this.dataSetFactory.createBodyRows(this.config, this.i18n, this.db, this.fromExpr);
133
143
  this.state = FactoryState.UP_TO_DATE;
134
144
  }
135
145
  getHeader() {
@@ -144,9 +154,43 @@ export class Table {
144
154
  }
145
155
  return this.bodyRows;
146
156
  }
147
- normalizeScenarios(scenarios, categoryThereOf, order) {
148
- var _a;
157
+ /**
158
+ * Resolves the interval configuration into the concrete bucket list.
159
+ * `auto` is narrowed to a concrete granularity (written back to the config so
160
+ * the query engine sees it); when no usable buckets exist the feature is
161
+ * deactivated. `columnthereof` takes precedence (both use the `##` namespace).
162
+ */
163
+ prepareIntervalBuckets() {
164
+ this.intervalBuckets = [];
165
+ if (this.config.interval === INTERVAL_NONE || !this.fromExpr || this.config.categoryThereOf.size > 0) {
166
+ this.config.interval = INTERVAL_NONE;
167
+ return;
168
+ }
169
+ this.config.interval = resolveIntervalGranularity(this.db, this.fromExpr, this.config.interval);
170
+ this.intervalBuckets = queryIntervalBuckets(this.db, this.fromExpr, this.config.interval, this.config.locale);
171
+ if (this.intervalBuckets.length === 0) {
172
+ // e.g. date interval selected but the data carries no valid dates
173
+ this.config.interval = INTERVAL_NONE;
174
+ }
175
+ }
176
+ normalizeScenarios(scenarios, categoryThereOf, order, intervalBuckets = []) {
177
+ var _a, _b;
149
178
  const normalizedScenarios = [];
179
+ if (intervalBuckets.length > 0) {
180
+ for (const bucket of intervalBuckets) {
181
+ for (const scenario of scenarios) {
182
+ normalizedScenarios.push({
183
+ name: scenario,
184
+ group: scenario,
185
+ type: scenario,
186
+ order: ((_a = order === null || order === void 0 ? void 0 : order.hierarchy) === null || _a === void 0 ? void 0 : _a.at(0)) === scenario ? order.direction : undefined,
187
+ bucket: bucket.key,
188
+ bucketLabel: bucket.label,
189
+ });
190
+ }
191
+ }
192
+ return normalizedScenarios;
193
+ }
150
194
  for (const scenario of scenarios) {
151
195
  if (categoryThereOf === null || categoryThereOf === void 0 ? void 0 : categoryThereOf.has(scenario)) {
152
196
  const categoryDrills = categoryThereOf.get(scenario);
@@ -169,7 +213,7 @@ export class Table {
169
213
  normalizedScenarios.push({ name: "REST", group: "REST", type: scenario, order: undefined });
170
214
  }
171
215
  let orderDirection = undefined;
172
- if (((_a = order === null || order === void 0 ? void 0 : order.hierarchy) === null || _a === void 0 ? void 0 : _a.at(0)) === scenario) {
216
+ if (((_b = order === null || order === void 0 ? void 0 : order.hierarchy) === null || _b === void 0 ? void 0 : _b.at(0)) === scenario) {
173
217
  orderDirection = order.direction;
174
218
  }
175
219
  normalizedScenarios.push({ name: scenario, group: scenario, type: scenario, order: orderDirection });
@@ -177,6 +221,6 @@ export class Table {
177
221
  return normalizedScenarios;
178
222
  }
179
223
  hasNoData() {
180
- return this.data.length === 0;
224
+ return this.rowCount === 0;
181
225
  }
182
226
  }
@@ -1,6 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  // Default fallback colors (should come from componentStyle)
3
- const DEFAULT_STYLES = {
3
+ export const DEFAULT_STYLES = {
4
4
  positive: { stroke: "#008f96", fill: "#008f96", fillpattern: "solid" },
5
5
  negative: { stroke: "#ff0000", fill: "#ff0000", fillpattern: "solid" },
6
6
  neutral: { stroke: "#808080", fill: "#808080", fillpattern: "outlined" },
@@ -17,7 +17,7 @@ const DEFAULT_STYLES = {
17
17
  percentageScaling: 0.5, // Default: 100% = 50 pixels
18
18
  scaleFactor: 1,
19
19
  };
20
- const AXIS_COLOR = "#666666";
20
+ export const AXIS_COLOR = "#666666";
21
21
  /**
22
22
  * Creates a unique pattern ID for the SVG defs
23
23
  */
@@ -27,20 +27,25 @@ function getPatternId(prefix, color) {
27
27
  /**
28
28
  * Renders SVG pattern definitions for hatched fills
29
29
  */
30
- const PatternDefs = ({ styles }) => {
30
+ export const PatternDefs = ({ styles }) => {
31
31
  const s = styles.scaleFactor;
32
32
  const patternSize = 6 * s;
33
33
  const patterns = [
34
34
  { id: getPatternId("pos", styles.positive.stroke), stroke: styles.positive.stroke, fill: styles.positive.fill },
35
35
  { id: getPatternId("neg", styles.negative.stroke), stroke: styles.negative.stroke, fill: styles.negative.fill },
36
36
  { id: getPatternId("neu", styles.neutral.stroke), stroke: styles.neutral.stroke, fill: styles.neutral.fill },
37
+ ...["ac", "pp", "fc", "pl"].map((type) => ({
38
+ id: getPatternId(type, styles.scenarios[type].stroke),
39
+ stroke: styles.scenarios[type].stroke,
40
+ fill: styles.scenarios[type].fill,
41
+ })),
37
42
  ];
38
43
  return (h("defs", null, patterns.map((p) => (h("pattern", { id: p.id, patternUnits: "userSpaceOnUse", width: patternSize, height: patternSize }, h("rect", { width: patternSize, height: patternSize, fill: "#ffffff" }), h("line", { x1: "0", y1: patternSize, x2: patternSize, y2: "0", stroke: p.stroke, "stroke-width": 1.5 * s }))))));
39
44
  };
40
45
  /**
41
46
  * Formats a number for display with appropriate SI prefix.
42
47
  */
43
- function formatValue(value, isRelative, measureScale = 1) {
48
+ export function formatValue(value, isRelative, measureScale = 1) {
44
49
  let scaledValue;
45
50
  let absValue;
46
51
  const prefix = value >= 0 ? "+" : "";
@@ -83,7 +88,7 @@ function isScenarioColumn(scenario) {
83
88
  /**
84
89
  * Gets the scenario type from the column name (ac, pp, fc, pl).
85
90
  */
86
- function getScenarioType(scenario) {
91
+ export function getScenarioType(scenario) {
87
92
  const scenarioPrefix = scenario.slice(0, 2).toLowerCase();
88
93
  if (scenarioPrefix === "pp")
89
94
  return "pp";
@@ -119,7 +124,7 @@ function getVarianceStyle(value, isPositiveGood, styles) {
119
124
  * Scenarios (ac, pp, fc, pl) use scenario styles.
120
125
  * Variances (d_, dr_) use variance styles with pos/neg/neu coloring.
121
126
  */
122
- function getBarStyle(scenario, value, isPositiveGood, styles) {
127
+ export function getBarStyle(scenario, value, isPositiveGood, styles) {
123
128
  if (isScenarioColumn(scenario)) {
124
129
  return getScenarioStyle(scenario, styles);
125
130
  }
@@ -128,7 +133,7 @@ function getBarStyle(scenario, value, isPositiveGood, styles) {
128
133
  /**
129
134
  * Gets the fill value for a bar - either solid color, pattern URL, or transparent with stroke.
130
135
  */
131
- function getBarFill(varianceStyle, patternPrefix) {
136
+ export function getBarFill(varianceStyle, patternPrefix) {
132
137
  const pattern = varianceStyle.fillpattern;
133
138
  if (pattern === "hatched") {
134
139
  return `url(#${getPatternId(patternPrefix, varianceStyle.stroke)})`;
@@ -142,7 +147,7 @@ function getBarFill(varianceStyle, patternPrefix) {
142
147
  /**
143
148
  * Gets the stroke for a bar based on pattern type.
144
149
  */
145
- function getBarStroke(varianceStyle) {
150
+ export function getBarStroke(varianceStyle) {
146
151
  const pattern = varianceStyle.fillpattern;
147
152
  if (pattern === "outlined") {
148
153
  return { stroke: varianceStyle.stroke, strokeWidth: 1.5 }; // scaled by caller via * s
@@ -52,7 +52,7 @@ export class TableRow {
52
52
  getCells() {
53
53
  return this.elements;
54
54
  }
55
- createElement(value, scenario, columnType, cellType, prefix, cellStyle, isSecondaryElement, categoryWidth, measureScale, isBarChart = false, columnStats) {
55
+ createElement(value, scenario, columnType, cellType, prefix, cellStyle, isSecondaryElement, categoryWidth, measureScale, isBarChart = false, columnStats, colSpan = 1, waterfall) {
56
56
  let cssStyle = cellStyle;
57
57
  if (scenario === "category" && categoryWidth != null) {
58
58
  cssStyle = `category-${categoryWidth.toString()}`;
@@ -82,9 +82,10 @@ export class TableRow {
82
82
  if (columnType) {
83
83
  cssStyle = `${cssStyle} ${columnType}`;
84
84
  }
85
- const cell = new Cell(scenario, this.elements.length, value, cssStyle, cellType, prefix, prefixStyle, 1, measureScale);
85
+ const cell = new Cell(scenario, this.elements.length, value, cssStyle, cellType, prefix, prefixStyle, colSpan, measureScale);
86
86
  cell.isBarChart = isBarChart;
87
87
  cell.columnStats = columnStats;
88
+ cell.waterfall = waterfall;
88
89
  this.elements.push(cell);
89
90
  }
90
91
  }
@@ -0,0 +1,47 @@
1
+ import { h } from "@stencil/core";
2
+ import { AXIS_COLOR, DEFAULT_STYLES, formatValue, getBarFill, getBarStroke, getBarStyle, getScenarioType, PatternDefs, } from "./CellBarChart";
3
+ /**
4
+ * Renders one row of an IBCS waterfall for a scenario bar column.
5
+ *
6
+ * All rows of a column share the same coordinate system: the geometry's
7
+ * min/max extents (value units, always including zero) are mapped onto the
8
+ * bar area, so bars always fit and the zero axis sits at the same x position
9
+ * in every row. Fixed unit scaling is deliberately not applied — a clipped
10
+ * bar would break the start position of every subsequent bar.
11
+ *
12
+ * Layout: [left label area][bar area][right label area]
13
+ * The value label sits at the bar's free end (right of rightward bars,
14
+ * left of leftward bars). thereof/partof rows additionally get dashed
15
+ * guides marking their parent bar's extent.
16
+ */
17
+ export const WaterfallBar = (props) => {
18
+ const { value, scenario, height, measureScale, maxBarWidth: maxBarWidthEm = 10, styles = DEFAULT_STYLES, waterfall, } = props;
19
+ const s = styles.scaleFactor;
20
+ const fs = styles.fontSize;
21
+ const range = waterfall.max - waterfall.min;
22
+ if (value === null || value === undefined || isNaN(value) || range <= 0) {
23
+ return (h("span", { class: "bar-chart-empty", style: { color: styles.fontColor, fontStyle: "italic" } }, "-"));
24
+ }
25
+ const labelAreaWidth = 38 * s;
26
+ const barAreaWidth = maxBarWidthEm * fs;
27
+ const totalWidth = labelAreaWidth + barAreaWidth + labelAreaWidth;
28
+ const pxPerUnit = barAreaWidth / range;
29
+ const xOf = (coordinate) => labelAreaWidth + (coordinate - waterfall.min) * pxPerUnit;
30
+ const padding = 2 * s;
31
+ const barHeight = height - padding * 2;
32
+ const barY = padding;
33
+ const axisX = xOf(0);
34
+ const startX = xOf(waterfall.start);
35
+ const endX = xOf(waterfall.end);
36
+ const barX = Math.min(startX, endX);
37
+ const barWidth = Math.abs(endX - startX);
38
+ const barStyle = getBarStyle(scenario, value, false, styles);
39
+ const fillValue = getBarFill(barStyle, getScenarioType(scenario));
40
+ const { stroke: barStroke, strokeWidth: barStrokeWidth } = getBarStroke(barStyle);
41
+ // Scenario values carry no variance sentiment — labels are unsigned per IBCS
42
+ const displayValue = formatValue(value, waterfall.kind === "partof", measureScale).replace(/^\+/, "");
43
+ const pointsLeft = endX < startX;
44
+ const labelX = pointsLeft ? barX - 4 * s : barX + barWidth + 4 * s;
45
+ const labelAnchor = pointsLeft ? "end" : "start";
46
+ return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart waterfall-bar", style: { overflow: "visible" } }, h(PatternDefs, { styles: styles }), h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), waterfall.parentStart !== undefined && waterfall.parentEnd !== undefined && (h("line", { x1: xOf(waterfall.parentStart), y1: 0, x2: xOf(waterfall.parentStart), y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s, "stroke-dasharray": `${2 * s},${2 * s}` })), waterfall.parentStart !== undefined && waterfall.parentEnd !== undefined && (h("line", { x1: xOf(waterfall.parentEnd), y1: 0, x2: xOf(waterfall.parentEnd), y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s, "stroke-dasharray": `${2 * s},${2 * s}` })), barWidth > 0 && (h("rect", { x: barX, y: barY, width: barWidth, height: barHeight, fill: fillValue, stroke: barStroke, "stroke-width": barStrokeWidth * s })), h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": labelAnchor, fill: styles.fontColor, "font-size": fs, "font-family": styles.fontFamily }, displayValue)));
47
+ };
@@ -1,3 +1,4 @@
1
1
  export * from "./TableRow";
2
2
  export * from "./Cell";
3
3
  export * from "./CellBarChart";
4
+ export * from "./WaterfallBar";