@bino-bi/bn-template-engine 1.0.0-next.26 → 1.0.0-next.28

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 (420) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-5075771a.entry.js +1 -0
  3. package/dist/bn-template-engine/p-5d516435.entry.js +1 -0
  4. package/dist/bn-template-engine/p-5e90e728.entry.js +1 -0
  5. package/dist/bn-template-engine/p-9ef7e132.entry.js +1 -0
  6. package/dist/bn-template-engine/{p-f06c3703.entry.js → p-9f7a1980.entry.js} +1 -1
  7. package/dist/bn-template-engine/p-BeXgxHkW.js +1 -0
  8. package/dist/bn-template-engine/p-CH0bpt_k.js +1 -0
  9. package/dist/bn-template-engine/p-ClruFZD_.js +1 -0
  10. package/dist/bn-template-engine/{p-CTrNbSXN.js → p-DFmSrSnf.js} +1 -1
  11. package/dist/bn-template-engine/{p-BcLsoDrW.js → p-DI3efDSV.js} +1 -1
  12. package/dist/bn-template-engine/p-DXLTTILG.js +1 -0
  13. package/dist/bn-template-engine/p-DtP4jqG5.js +1 -0
  14. package/dist/bn-template-engine/p-a8281b71.entry.js +1 -0
  15. package/dist/bn-template-engine/p-b31277e7.entry.js +1 -0
  16. package/dist/bn-template-engine/p-b396ac84.entry.js +1 -0
  17. package/dist/cjs/{bn-asset_21.cjs.entry.js → bn-asset_28.cjs.entry.js} +21358 -6528
  18. package/dist/cjs/bn-grid.cjs.entry.js +4 -6
  19. package/dist/cjs/bn-image.cjs.entry.js +3 -5
  20. package/dist/cjs/bn-internationalization.cjs.entry.js +17 -6
  21. package/dist/cjs/bn-ruleset.cjs.entry.js +5 -5
  22. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  23. package/dist/cjs/bn-template.cjs.entry.js +2 -2
  24. package/dist/cjs/bn-text.cjs.entry.js +115 -43
  25. package/dist/cjs/{context-protocol-DcTEh1rq.js → context-protocol-C0rKepqu.js} +108 -22
  26. package/dist/cjs/{diagnostics-CTgbq_Gc.js → diagnostics-Cq-qDtXq.js} +1 -1
  27. package/dist/cjs/editor-companion.cjs.entry.js +2 -2
  28. package/dist/cjs/loader.cjs.js +1 -1
  29. package/dist/cjs/queryError-BZjnIW_w.js +16 -0
  30. package/dist/cjs/{scaling-Dsb5_NXy.js → sanitizeHtml-Yx1xn6i_.js} +467 -287
  31. package/dist/cjs/{withBodyObserver-DJO98AJ-.js → withBodyObserver-CaPUjuC5.js} +1 -1
  32. package/dist/cjs/withHasError-qGW_yqIv.js +426 -0
  33. package/dist/cjs/{withStyled-D0jLwCib.js → withStyled-vSfogp9J.js} +543 -42
  34. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +37 -0
  35. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +53 -28
  36. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +37 -5
  37. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +16 -7
  38. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +67 -30
  39. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +37 -0
  40. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +49 -29
  41. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +37 -5
  42. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +17 -7
  43. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +34 -18
  44. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +2 -0
  45. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +1 -1
  46. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +37 -0
  47. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +52 -27
  48. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +37 -5
  49. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +16 -7
  50. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +52 -18
  51. package/dist/collection/components/bn-chart-structure/bn-chart-structure.css +37 -5
  52. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +74 -44
  53. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +60 -19
  54. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +218 -262
  55. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +1 -1
  56. package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +11 -4
  57. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +16 -25
  58. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +3 -2
  59. package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +2 -0
  60. package/dist/collection/components/bn-chart-time/bn-chart-time.css +37 -0
  61. package/dist/collection/components/bn-chart-time/bn-chart-time.js +122 -52
  62. package/dist/collection/components/bn-chart-time/ibcs-chart-time.css +37 -0
  63. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +60 -19
  64. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +245 -250
  65. package/dist/collection/components/bn-chart-time/utils/elements/AreaFill.js +1 -1
  66. package/dist/collection/components/bn-chart-time/utils/elements/Label.js +1 -1
  67. package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +1 -1
  68. package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +11 -4
  69. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +22 -34
  70. package/dist/collection/components/bn-chart-time/utils/helper/LabelCollisionManager.js +3 -3
  71. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +4 -3
  72. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -2
  73. package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +2 -0
  74. package/dist/collection/components/bn-component-style/bn-component-style.js +14 -2
  75. package/dist/collection/components/bn-context/bn-context.js +92 -22
  76. package/dist/collection/components/bn-dataset/bn-dataset.js +246 -90
  77. package/dist/collection/components/bn-datasource/bn-datasource.js +169 -77
  78. package/dist/collection/components/bn-footer/bn-footer.js +6 -6
  79. package/dist/collection/components/bn-internationalization/bn-internationalization.js +14 -3
  80. package/dist/collection/components/bn-layout-card/bn-layout-card.js +25 -74
  81. package/dist/collection/components/bn-layout-page/bn-layout-page.js +59 -71
  82. package/dist/collection/components/bn-message/bn-message.js +2 -2
  83. package/dist/collection/components/bn-page/bn-page.css +0 -240
  84. package/dist/collection/components/bn-page/bn-page.js +14 -4
  85. package/dist/collection/components/bn-page/pageFormats.js +69 -0
  86. package/dist/collection/components/bn-ruleset/bn-ruleset.js +2 -2
  87. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +7 -7
  88. package/dist/collection/components/bn-table/bn-table.css +38 -1
  89. package/dist/collection/components/bn-table/bn-table.js +96 -59
  90. package/dist/collection/components/bn-table/ibcs-table.css +39 -1
  91. package/dist/collection/components/bn-table/ibcs-table.js +89 -30
  92. package/dist/collection/components/bn-table/utils/Table.js +12 -13
  93. package/dist/collection/components/bn-table/utils/elements/Cell.js +9 -3
  94. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +38 -34
  95. package/dist/collection/components/bn-table/utils/elements/TableRow.js +2 -1
  96. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +4 -4
  97. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +17 -4
  98. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +128 -98
  99. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +6 -20
  100. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +9 -2
  101. package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +2 -2
  102. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +2 -2
  103. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +3 -2
  104. package/dist/collection/components/bn-template/bn-template.js +1 -1
  105. package/dist/collection/components/bn-text/bn-text.js +36 -39
  106. package/dist/collection/components/bn-text/utils/template.js +79 -0
  107. package/dist/collection/components/bn-title/bn-title.js +10 -4
  108. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +3 -1
  109. package/dist/collection/components/bn-tree/bn-tree.js +119 -23
  110. package/dist/collection/components/bn-tree/utils/EdgeRenderer.js +59 -51
  111. package/dist/collection/components/bn-tree/utils/TreeLayout.js +30 -5
  112. package/dist/collection/components/bn-tree/utils/TreeParser.js +35 -0
  113. package/dist/collection/components/editor-companion/editor-companion.js +1 -1
  114. package/dist/collection/context/context-protocol.js +1 -1
  115. package/dist/collection/context/scopedDb.js +47 -4
  116. package/dist/collection/stores/componentStyles.js +39 -0
  117. package/dist/collection/stores/internationalization.js +15 -13
  118. package/dist/collection/utils/DateStringFactory.js +17 -15
  119. package/dist/collection/utils/autoFit.js +2 -2
  120. package/dist/collection/utils/componentRegister.js +60 -16
  121. package/dist/collection/utils/constants.js +2 -2
  122. package/dist/collection/utils/dataAnalyzer.js +9 -12
  123. package/dist/collection/utils/emptyState.js +21 -0
  124. package/dist/collection/utils/formatter.js +29 -20
  125. package/dist/collection/utils/layoutObserver.js +1 -1
  126. package/dist/collection/utils/layoutState/generic.js +1 -1
  127. package/dist/collection/utils/layoutState/svgChartElements.js +2 -2
  128. package/dist/collection/utils/layoutTemplate.js +81 -0
  129. package/dist/collection/utils/measurementHost.js +2 -2
  130. package/dist/collection/utils/model/Order.js +1 -1
  131. package/dist/collection/utils/model/styles/SVGStyle.js +12 -4
  132. package/dist/collection/utils/parentDimensions.js +35 -3
  133. package/dist/collection/utils/queryError.js +11 -0
  134. package/dist/collection/utils/relativeVariance.js +14 -0
  135. package/dist/collection/utils/sanitizeHtml.js +30 -16
  136. package/dist/collection/utils/scaling.js +2 -2
  137. package/dist/collection/utils/stackColors.js +27 -5
  138. package/dist/collection/utils/stackLayout.js +71 -0
  139. package/dist/collection/utils/styled/attributes.js +16 -3
  140. package/dist/collection/utils/styled/style-sheet.js +1 -1
  141. package/dist/collection/utils/styled/withStyled.js +1 -1
  142. package/dist/collection/utils/testing/fakeGroup.js +21 -0
  143. package/dist/collection/utils/testing/mutationObserver.js +44 -0
  144. package/dist/collection/utils/testing/structureChart.js +26 -0
  145. package/dist/collection/utils/testing/timeChart.js +28 -0
  146. package/dist/collection/utils/validate.js +1 -1
  147. package/dist/collection/utils/withComponentStatus.js +137 -12
  148. package/dist/collection/utils/withInheritedProps.js +113 -64
  149. package/dist/collection/utils/withRuleSet.js +10 -7
  150. package/dist/collection/utils/withTranslation.js +3 -3
  151. package/dist/collection/utils/xy/FacetGrid.js +1 -1
  152. package/dist/collection/utils/xy/IsoCurves.js +1 -1
  153. package/dist/collection/utils/xy/NumericScale.js +46 -15
  154. package/dist/collection/utils/xy/PointLabeler.js +2 -2
  155. package/dist/collection/utils/xy/RadiusScale.js +2 -2
  156. package/dist/collection/utils/xy/SeriesPalette.js +3 -3
  157. package/dist/collection/utils/xy/VarianceMeasure.js +22 -4
  158. package/dist/collection/utils/xy/XYFrame.js +4 -4
  159. package/dist/collection/utils/xy/XYLegend.js +5 -7
  160. package/dist/collection/utils/xy/checkXYOverflow.js +32 -0
  161. package/dist/collection/utils/xy/formatXYValue.js +13 -0
  162. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  163. package/dist/collection/utils/xy/model/XYChartStyle.js +2 -0
  164. package/dist/components/DataFormatDigits.js +1 -1
  165. package/dist/components/DateStringFactory.js +1 -1
  166. package/dist/components/LabelCollisionManager.js +1 -1
  167. package/dist/components/NumericScale.js +1 -1
  168. package/dist/components/Order.js +1 -1
  169. package/dist/components/SVGStyle.js +1 -0
  170. package/dist/components/TableAttribute.js +1 -0
  171. package/dist/components/VarianceMeasure.js +1 -1
  172. package/dist/components/XYChartDataRow.js +1 -1
  173. package/dist/components/bn-asset.js +1 -1
  174. package/dist/components/bn-body2.js +1 -1
  175. package/dist/components/bn-card2.js +1 -1
  176. package/dist/components/bn-chart-bubble.js +1 -1
  177. package/dist/components/bn-chart-bullet.js +1 -1
  178. package/dist/components/bn-chart-scatter.js +1 -1
  179. package/dist/components/bn-chart-structure.js +1 -1
  180. package/dist/components/bn-chart-time.js +1 -1
  181. package/dist/components/bn-component-style.js +1 -1
  182. package/dist/components/bn-context.js +1 -1
  183. package/dist/components/bn-dataset.js +1 -1
  184. package/dist/components/bn-datasource.js +1 -1
  185. package/dist/components/bn-footer2.js +1 -1
  186. package/dist/components/bn-grid.js +1 -1
  187. package/dist/components/bn-image.js +1 -1
  188. package/dist/components/bn-internationalization.js +1 -1
  189. package/dist/components/bn-layout-card.js +1 -1
  190. package/dist/components/bn-layout-page.js +1 -1
  191. package/dist/components/bn-message2.js +1 -1
  192. package/dist/components/bn-page2.js +1 -1
  193. package/dist/components/bn-ruleset.js +1 -1
  194. package/dist/components/bn-scaling-group.js +1 -1
  195. package/dist/components/bn-table.js +1 -1
  196. package/dist/components/bn-template.js +1 -1
  197. package/dist/components/bn-text.js +1 -1
  198. package/dist/components/bn-title2.js +1 -1
  199. package/dist/components/bn-tree.js +1 -1
  200. package/dist/components/checkXYOverflow.js +1 -0
  201. package/dist/components/context-protocol.js +1 -1
  202. package/dist/components/editor-companion.js +1 -1
  203. package/dist/components/emptyState.js +1 -0
  204. package/dist/components/formatter.js +1 -1
  205. package/dist/components/ibcs-chart-bubble2.js +1 -1
  206. package/dist/components/ibcs-chart-bullet2.js +1 -1
  207. package/dist/components/ibcs-chart-scatter2.js +1 -1
  208. package/dist/components/ibcs-chart-structure2.js +1 -1
  209. package/dist/components/ibcs-chart-time2.js +1 -1
  210. package/dist/components/ibcs-table2.js +1 -1
  211. package/dist/components/ibcs-title2.js +1 -1
  212. package/dist/components/layoutTemplate.js +1 -0
  213. package/dist/components/pageFormats.js +1 -0
  214. package/dist/components/parentDimensions.js +1 -0
  215. package/dist/components/queryError.js +1 -0
  216. package/dist/components/relativeVariance.js +1 -0
  217. package/dist/components/sanitizeHtml.js +1 -1
  218. package/dist/components/stackColors.js +1 -1
  219. package/dist/components/stackLayout.js +1 -0
  220. package/dist/components/svg.esm.js +1 -0
  221. package/dist/components/validate.js +1 -1
  222. package/dist/components/withBodyObserver.js +1 -1
  223. package/dist/components/withComponentStatus.js +1 -0
  224. package/dist/components/withComponentStyle.js +1 -1
  225. package/dist/components/withDataset.js +1 -1
  226. package/dist/components/withHasError.js +1 -1
  227. package/dist/components/withRuleSet.js +1 -1
  228. package/dist/components/withScalingGroup.js +1 -1
  229. package/dist/components/withStyled.js +1 -1
  230. package/dist/components/withTranslation.js +1 -1
  231. package/dist/esm/{bn-asset_21.entry.js → bn-asset_28.entry.js} +20948 -6125
  232. package/dist/esm/bn-grid.entry.js +4 -6
  233. package/dist/esm/bn-image.entry.js +3 -5
  234. package/dist/esm/bn-internationalization.entry.js +17 -6
  235. package/dist/esm/bn-ruleset.entry.js +5 -5
  236. package/dist/esm/bn-template-engine.js +1 -1
  237. package/dist/esm/bn-template.entry.js +2 -2
  238. package/dist/esm/bn-text.entry.js +111 -39
  239. package/dist/esm/{context-protocol-B-vdGKeG.js → context-protocol-CdTp19uA.js} +106 -22
  240. package/dist/esm/{diagnostics-CiquIw8B.js → diagnostics-vw6TKMiT.js} +1 -1
  241. package/dist/esm/editor-companion.entry.js +2 -2
  242. package/dist/esm/loader.js +1 -1
  243. package/dist/esm/queryError-ClruFZD_.js +13 -0
  244. package/dist/esm/{scaling-Dggyeqts.js → sanitizeHtml-C5bFtARM.js} +464 -287
  245. package/dist/esm/{withBodyObserver-Cb9ZC5_J.js → withBodyObserver-DD_-r04o.js} +1 -1
  246. package/dist/esm/withHasError-73WV2SP5.js +422 -0
  247. package/dist/esm/{withStyled-DoNsbwS3.js → withStyled-BDEyKd_H.js} +513 -27
  248. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +8 -4
  249. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +2 -1
  250. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +14 -2
  251. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +12 -11
  252. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +2 -1
  253. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +8 -5
  254. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +2 -0
  255. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +1 -1
  256. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +8 -4
  257. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +2 -1
  258. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +11 -1
  259. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +13 -12
  260. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +8 -1
  261. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +29 -6
  262. package/dist/types/components/bn-chart-structure/utils/elements/StackedBar.d.ts +4 -3
  263. package/dist/types/components/bn-chart-structure/utils/model/DataPoint.d.ts +3 -2
  264. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +2 -1
  265. package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +2 -0
  266. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +19 -15
  267. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +8 -1
  268. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +63 -5
  269. package/dist/types/components/bn-chart-time/utils/elements/AreaFill.d.ts +1 -1
  270. package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +9 -8
  271. package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +3 -2
  272. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +3 -2
  273. package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +2 -0
  274. package/dist/types/components/bn-context/bn-context.d.ts +15 -3
  275. package/dist/types/components/bn-dataset/bn-dataset.d.ts +41 -20
  276. package/dist/types/components/bn-datasource/bn-datasource.d.ts +34 -18
  277. package/dist/types/components/bn-footer/bn-footer.d.ts +2 -2
  278. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +3 -10
  279. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +13 -6
  280. package/dist/types/components/bn-message/bn-message.d.ts +2 -1
  281. package/dist/types/components/bn-page/bn-page.d.ts +2 -1
  282. package/dist/types/components/bn-page/pageFormats.d.ts +40 -0
  283. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +2 -2
  284. package/dist/types/components/bn-table/bn-table.d.ts +11 -10
  285. package/dist/types/components/bn-table/ibcs-table.d.ts +8 -5
  286. package/dist/types/components/bn-table/utils/Table.d.ts +3 -1
  287. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -2
  288. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +6 -4
  289. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +1 -1
  290. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +2 -0
  291. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +14 -5
  292. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +2 -2
  293. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +6 -1
  294. package/dist/types/components/bn-table/utils/helper/barColumnGeometry.d.ts +2 -2
  295. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +2 -0
  296. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +2 -1
  297. package/dist/types/components/bn-text/bn-text.d.ts +20 -13
  298. package/dist/types/components/bn-text/utils/template.d.ts +10 -0
  299. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +1 -0
  300. package/dist/types/components/bn-tree/bn-tree.d.ts +8 -1
  301. package/dist/types/components/bn-tree/utils/EdgeRenderer.d.ts +18 -5
  302. package/dist/types/components/bn-tree/utils/TreeLayout.d.ts +5 -0
  303. package/dist/types/components.d.ts +226 -184
  304. package/dist/types/context/scopedDb.d.ts +20 -0
  305. package/dist/types/stores/componentStyles.d.ts +6 -0
  306. package/dist/types/utils/DateStringFactory.d.ts +3 -2
  307. package/dist/types/utils/autoFit.d.ts +2 -2
  308. package/dist/types/utils/componentRegister.d.ts +21 -5
  309. package/dist/types/utils/constants.d.ts +2 -2
  310. package/dist/types/utils/dataAnalyzer.d.ts +1 -1
  311. package/dist/types/utils/emptyState.d.ts +10 -0
  312. package/dist/types/utils/formatter.d.ts +7 -9
  313. package/dist/types/utils/layoutState/generic.d.ts +1 -1
  314. package/dist/types/utils/layoutState/svgChartElements.d.ts +2 -2
  315. package/dist/types/utils/layoutTemplate.d.ts +16 -0
  316. package/dist/types/utils/model/ChartStyles.d.ts +1 -1
  317. package/dist/types/utils/model/DataQueryResultRow.d.ts +2 -2
  318. package/dist/types/utils/model/Order.d.ts +1 -1
  319. package/dist/types/utils/model/styles/SVGStyle.d.ts +5 -1
  320. package/dist/types/utils/parentDimensions.d.ts +9 -0
  321. package/dist/types/utils/queryError.d.ts +5 -0
  322. package/dist/types/utils/relativeVariance.d.ts +9 -0
  323. package/dist/types/utils/sanitizeHtml.d.ts +2 -2
  324. package/dist/types/utils/scaling.d.ts +1 -1
  325. package/dist/types/utils/stackColors.d.ts +3 -2
  326. package/dist/types/utils/stackLayout.d.ts +49 -0
  327. package/dist/types/utils/testing/fakeGroup.d.ts +8 -0
  328. package/dist/types/utils/testing/mutationObserver.d.ts +5 -0
  329. package/dist/types/utils/testing/structureChart.d.ts +5 -0
  330. package/dist/types/utils/testing/timeChart.d.ts +5 -0
  331. package/dist/types/utils/validate.d.ts +1 -1
  332. package/dist/types/utils/withComponentStatus.d.ts +11 -3
  333. package/dist/types/utils/withInheritedProps.d.ts +42 -15
  334. package/dist/types/utils/withRuleSet.d.ts +2 -1
  335. package/dist/types/utils/withTranslation.d.ts +2 -2
  336. package/dist/types/utils/xy/FacetGrid.d.ts +1 -1
  337. package/dist/types/utils/xy/IsoCurves.d.ts +1 -1
  338. package/dist/types/utils/xy/NumericScale.d.ts +9 -4
  339. package/dist/types/utils/xy/PointLabeler.d.ts +2 -2
  340. package/dist/types/utils/xy/RadiusScale.d.ts +2 -2
  341. package/dist/types/utils/xy/SeriesPalette.d.ts +3 -3
  342. package/dist/types/utils/xy/VarianceMeasure.d.ts +10 -2
  343. package/dist/types/utils/xy/XYFrame.d.ts +4 -1
  344. package/dist/types/utils/xy/XYLegend.d.ts +3 -1
  345. package/dist/types/utils/xy/checkXYOverflow.d.ts +8 -0
  346. package/dist/types/utils/xy/formatXYValue.d.ts +7 -0
  347. package/dist/types/utils/xy/model/AxisConfig.d.ts +1 -1
  348. package/dist/types/utils/xy/model/XYChartStyle.d.ts +2 -0
  349. package/package.json +4 -2
  350. package/readme.md +11 -11
  351. package/dist/bn-template-engine/p-03304284.entry.js +0 -1
  352. package/dist/bn-template-engine/p-0fb02c57.entry.js +0 -1
  353. package/dist/bn-template-engine/p-4419db8f.entry.js +0 -1
  354. package/dist/bn-template-engine/p-45508f1b.entry.js +0 -1
  355. package/dist/bn-template-engine/p-461fdffa.entry.js +0 -1
  356. package/dist/bn-template-engine/p-5d7a3a77.entry.js +0 -1
  357. package/dist/bn-template-engine/p-62cc95b7.entry.js +0 -1
  358. package/dist/bn-template-engine/p-686d8e44.entry.js +0 -1
  359. package/dist/bn-template-engine/p-829212c3.entry.js +0 -1
  360. package/dist/bn-template-engine/p-B5Jd_eCX.js +0 -1
  361. package/dist/bn-template-engine/p-BA48JiHe.js +0 -1
  362. package/dist/bn-template-engine/p-BbmobTg0.js +0 -1
  363. package/dist/bn-template-engine/p-BcaI745G.js +0 -1
  364. package/dist/bn-template-engine/p-CG_Bcm6V.js +0 -1
  365. package/dist/bn-template-engine/p-CWWWM-XC.js +0 -1
  366. package/dist/bn-template-engine/p-CsJ84YRk.js +0 -1
  367. package/dist/bn-template-engine/p-D5e8I9Qe.js +0 -1
  368. package/dist/bn-template-engine/p-DVrDYxlh.js +0 -1
  369. package/dist/bn-template-engine/p-DjPXefnq.js +0 -1
  370. package/dist/bn-template-engine/p-DsTzlzxQ.js +0 -1
  371. package/dist/bn-template-engine/p-DtLI_CzV.js +0 -1
  372. package/dist/bn-template-engine/p-EtT29btN.js +0 -1
  373. package/dist/bn-template-engine/p-TuLpbB5O.js +0 -1
  374. package/dist/bn-template-engine/p-a5867a4c.entry.js +0 -1
  375. package/dist/bn-template-engine/p-b27009eb.entry.js +0 -1
  376. package/dist/bn-template-engine/p-bfa87b07.entry.js +0 -1
  377. package/dist/bn-template-engine/p-ceb80db3.entry.js +0 -1
  378. package/dist/bn-template-engine/p-fcfbb329.entry.js +0 -1
  379. package/dist/bn-template-engine/p-qRZrT-U3.js +0 -1
  380. package/dist/cjs/AxisConfig-DwiNUyYG.js +0 -233
  381. package/dist/cjs/LabelCollisionManager-Bv-xkeXw.js +0 -415
  382. package/dist/cjs/NumericScale-BAyYXpKL.js +0 -107
  383. package/dist/cjs/Order-2wRydarc.js +0 -87
  384. package/dist/cjs/SVGStyle-DoxylrEQ.js +0 -8219
  385. package/dist/cjs/SVGVariancesStyleGroup-CiI4GeWe.js +0 -50
  386. package/dist/cjs/VarianceMeasure-CQlSRzlp.js +0 -372
  387. package/dist/cjs/XYChartDataRow-C2FdL58s.js +0 -829
  388. package/dist/cjs/bn-chart-bubble.cjs.entry.js +0 -792
  389. package/dist/cjs/bn-chart-bullet.cjs.entry.js +0 -805
  390. package/dist/cjs/bn-chart-scatter.cjs.entry.js +0 -678
  391. package/dist/cjs/bn-tree.cjs.entry.js +0 -1042
  392. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +0 -624
  393. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +0 -673
  394. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +0 -667
  395. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +0 -85
  396. package/dist/cjs/svgChartElements-tDA43aYj.js +0 -400
  397. package/dist/cjs/withHasError-BdDmiOXM.js +0 -258
  398. package/dist/cjs/withScalingGroup-CFIc5-6s.js +0 -73
  399. package/dist/components/autoFit.js +0 -1
  400. package/dist/components/main.js +0 -1
  401. package/dist/components/utils.js +0 -1
  402. package/dist/esm/AxisConfig-KqzWQbML.js +0 -224
  403. package/dist/esm/LabelCollisionManager-585bQMtP.js +0 -407
  404. package/dist/esm/NumericScale-DsTzlzxQ.js +0 -105
  405. package/dist/esm/Order-DZVWjEL_.js +0 -83
  406. package/dist/esm/SVGStyle-OrPkzjcb.js +0 -8209
  407. package/dist/esm/SVGVariancesStyleGroup-DO5QJfRQ.js +0 -48
  408. package/dist/esm/VarianceMeasure-DDjChp8C.js +0 -364
  409. package/dist/esm/XYChartDataRow-Dn83Tqh9.js +0 -820
  410. package/dist/esm/bn-chart-bubble.entry.js +0 -790
  411. package/dist/esm/bn-chart-bullet.entry.js +0 -803
  412. package/dist/esm/bn-chart-scatter.entry.js +0 -676
  413. package/dist/esm/bn-tree.entry.js +0 -1040
  414. package/dist/esm/ibcs-chart-bubble.entry.js +0 -622
  415. package/dist/esm/ibcs-chart-bullet.entry.js +0 -671
  416. package/dist/esm/ibcs-chart-scatter.entry.js +0 -665
  417. package/dist/esm/sanitizeHtml-BA48JiHe.js +0 -83
  418. package/dist/esm/svgChartElements-B3YClivG.js +0 -395
  419. package/dist/esm/withHasError-Bh1Viz52.js +0 -254
  420. package/dist/esm/withScalingGroup-DNBSqRC0.js +0 -71
@@ -1,5 +1,6 @@
1
1
  import { forceUpdate, getElement } from "@stencil/core";
2
2
  import { runIfExisits } from "./utils";
3
+ import { isBlankInput } from "./validate";
3
4
  /**
4
5
  * Reserved prop values that activate inheritance from ancestor layout
5
6
  * components (`bn-layout-card` or `bn-layout-page`).
@@ -16,28 +17,27 @@ export function isInheritedValue(value) {
16
17
  return value === INHERITED_CLOSEST || value === INHERITED_PAGE;
17
18
  }
18
19
  /**
19
- * Walks up the DOM tree (crossing shadow boundaries) to find the nearest
20
- * ancestor layout component.
20
+ * Walks up the DOM tree (crossing shadow boundaries) and collects the layout
21
+ * ancestors an inheritance keyword can take its value from, nearest first.
21
22
  *
22
- * - `"inherited-closest"` matches the first `bn-layout-card` or `bn-layout-page`.
23
- * - `"inherited-page"` skips cards and matches only `bn-layout-page`.
23
+ * - `"inherited-closest"`: every `bn-layout-card` up to and including the
24
+ * first `bn-layout-page`.
25
+ * - `"inherited-page"`: that `bn-layout-page` only.
24
26
  *
25
27
  * Uses the same traversal pattern as `findContextElement` in
26
28
  * `context-protocol.ts`.
27
29
  */
28
- export function findAncestor(element, mode) {
30
+ export function findLayoutAncestors(element, mode) {
31
+ const ancestors = [];
29
32
  let current = element.parentNode;
30
33
  while (current) {
31
- if (current instanceof HTMLElement) {
32
- const tag = current.nodeName.toLowerCase();
33
- if (mode === INHERITED_PAGE) {
34
- if (tag === ANCESTOR_PAGE)
35
- return current;
36
- }
37
- else {
38
- if (tag === ANCESTOR_CARD || tag === ANCESTOR_PAGE)
39
- return current;
40
- }
34
+ const tag = current.nodeName.toLowerCase();
35
+ if (tag === ANCESTOR_PAGE) {
36
+ ancestors.push(current);
37
+ break;
38
+ }
39
+ if (tag === ANCESTOR_CARD && mode !== INHERITED_PAGE) {
40
+ ancestors.push(current);
41
41
  }
42
42
  if (current.parentNode) {
43
43
  current = current.parentNode;
@@ -49,14 +49,43 @@ export function findAncestor(element, mode) {
49
49
  break;
50
50
  }
51
51
  }
52
+ return ancestors;
53
+ }
54
+ /**
55
+ * Reads `attr` from the nearest of `ancestors` that sets it.
56
+ *
57
+ * An ancestor whose attribute is missing, blank or an inheritance keyword it
58
+ * cannot resolve does not set it and is skipped, so a keyword is never handed
59
+ * down as a value. A card with `inherited-page` stands for the value of the
60
+ * page when the page has one: the cards between the two are not asked.
61
+ */
62
+ export function readInherited(ancestors, attr) {
63
+ var _a;
64
+ const own = (ancestor) => {
65
+ const value = ancestor.getAttribute(attr);
66
+ const trimmed = value === null || value === void 0 ? void 0 : value.trim();
67
+ return !isBlankInput(trimmed) && !isInheritedValue(trimmed) ? value : undefined;
68
+ };
69
+ for (const ancestor of ancestors) {
70
+ if (((_a = ancestor.getAttribute(attr)) === null || _a === void 0 ? void 0 : _a.trim()) === INHERITED_PAGE) {
71
+ const page = ancestors.find((candidate) => candidate.nodeName.toLowerCase() === ANCESTOR_PAGE);
72
+ const pageValue = page && own(page);
73
+ if (pageValue !== undefined)
74
+ return pageValue;
75
+ continue;
76
+ }
77
+ const value = own(ancestor);
78
+ if (value !== undefined)
79
+ return value;
80
+ }
52
81
  return undefined;
53
82
  }
54
83
  /**
55
84
  * Walks up the DOM tree (crossing shadow boundaries) to find the nearest
56
85
  * ancestor element that carries the given attribute, whatever its tag.
57
86
  * Used for attributes that inherit by default (e.g. `i18n-namespace`), where
58
- * any container — layout card, layout page, tree, grid, or the `bn-context`
59
- * itself — can act as the provider.
87
+ * any container - layout card, layout page, tree, grid, or the `bn-context`
88
+ * itself - can act as the provider.
60
89
  */
61
90
  export function findAncestorWithAttr(element, attr) {
62
91
  let current = element.parentNode;
@@ -80,71 +109,71 @@ export function findAncestorWithAttr(element, attr) {
80
109
  * Mixin that enables property inheritance from ancestor layout components.
81
110
  *
82
111
  * When a component sets a prop to `"inherited-closest"` or `"inherited-page"`,
83
- * this mixin resolves the actual value by walking up the DOM to find the
84
- * nearest `bn-layout-card` / `bn-layout-page` and reading the corresponding
85
- * HTML attribute. A `MutationObserver` watches the ancestor for attribute
86
- * changes, triggering a re-render when inherited values update.
112
+ * this mixin resolves the actual value by walking up the DOM and reading the
113
+ * corresponding HTML attribute from the nearest `bn-layout-card` /
114
+ * `bn-layout-page` that sets it. A `MutationObserver` watches every ancestor
115
+ * on that path for attribute changes, triggering a re-render when inherited
116
+ * values update.
87
117
  *
88
118
  * Follows the same decorator-style pattern as `withComponentStyle`.
89
119
  *
120
+ * A keyword that no ancestor satisfies is never used as a value: the resolver
121
+ * returns the fallback instead and, when `errors` is given, keeps a
122
+ * `WARN_inherited_<prop>` warning in it for as long as the keyword is
123
+ * unresolved.
124
+ *
90
125
  * @param component The Stencil component instance
91
126
  * @param mappings Array of prop-to-attribute mappings
127
+ * @param errors The component's error list, to report unresolved keywords
92
128
  * @returns A resolver function used inside `prepare*()` methods
93
129
  */
130
+ const withInheritedProps = (
94
131
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
- const withInheritedProps = (component, mappings) => {
132
+ component, mappings, errors) => {
96
133
  /** Resolved values keyed by propName. */
97
134
  const resolved = new Map();
98
- /** Observer watching the ancestor element's attributes. */
135
+ /** The keyword each prop held at the last lookup, keyed by propName. */
136
+ const lookedUp = new Map();
137
+ /** Observer watching the layout ancestors' attributes. */
99
138
  let observer = null;
100
- /** The ancestor element currently being observed. */
101
- let ancestorEl;
102
139
  /**
103
- * For each mapping whose prop is an inheritance keyword, walk the DOM once
104
- * and read the corresponding attribute from the ancestor.
140
+ * Resolves each mapping whose prop is an inheritance keyword and watches
141
+ * every ancestor that can change the outcome, so a value that appears later
142
+ * on a card or the page is picked up.
105
143
  */
106
144
  const resolveAll = () => {
145
+ var _a;
107
146
  const element = getElement(component);
108
147
  resolved.clear();
109
- // Determine which attrs to watch on which ancestor
110
- const attrsToWatch = [];
148
+ lookedUp.clear();
149
+ if (observer) {
150
+ observer.disconnect();
151
+ observer = null;
152
+ }
153
+ const attrsToWatch = new Map();
111
154
  for (const mapping of mappings) {
112
155
  const value = component[mapping.propName];
113
156
  if (typeof value !== "string" || !isInheritedValue(value))
114
157
  continue;
115
- // Find ancestor (re-use the first one found for the same mode)
116
- if (!ancestorEl) {
117
- ancestorEl = findAncestor(element, value);
158
+ lookedUp.set(mapping.propName, value);
159
+ // Looked up per prop: scenarios may come from a card and order from the page.
160
+ const ancestors = findLayoutAncestors(element, value);
161
+ const inherited = readInherited(ancestors, mapping.ancestorAttr);
162
+ if (inherited !== undefined) {
163
+ resolved.set(mapping.propName, inherited);
118
164
  }
119
- if (!ancestorEl)
120
- continue;
121
- const attrValue = ancestorEl.getAttribute(mapping.ancestorAttr);
122
- if (attrValue != null) {
123
- resolved.set(mapping.propName, attrValue);
165
+ for (const ancestor of ancestors) {
166
+ attrsToWatch.set(ancestor, [...((_a = attrsToWatch.get(ancestor)) !== null && _a !== void 0 ? _a : []), mapping.ancestorAttr]);
124
167
  }
125
- attrsToWatch.push(mapping.ancestorAttr);
126
168
  }
127
- // Set up MutationObserver on the ancestor
128
- if (ancestorEl && attrsToWatch.length > 0) {
169
+ if (attrsToWatch.size > 0) {
129
170
  observer = new MutationObserver(() => {
130
- // Re-read all inherited attributes from the ancestor
131
- for (const mapping of mappings) {
132
- if (!isInheritedValue(component[mapping.propName]))
133
- continue;
134
- const attrValue = ancestorEl.getAttribute(mapping.ancestorAttr);
135
- if (attrValue != null) {
136
- resolved.set(mapping.propName, attrValue);
137
- }
138
- else {
139
- resolved.delete(mapping.propName);
140
- }
141
- }
171
+ resolveAll();
142
172
  forceUpdate(component);
143
173
  });
144
- observer.observe(ancestorEl, {
145
- attributes: true,
146
- attributeFilter: attrsToWatch,
147
- });
174
+ for (const [ancestor, attributeFilter] of attrsToWatch) {
175
+ observer.observe(ancestor, { attributes: true, attributeFilter });
176
+ }
148
177
  }
149
178
  };
150
179
  const connectedCallback = component["connectedCallback"];
@@ -158,19 +187,39 @@ const withInheritedProps = (component, mappings) => {
158
187
  observer.disconnect();
159
188
  observer = null;
160
189
  }
161
- ancestorEl = undefined;
162
190
  resolved.clear();
191
+ lookedUp.clear();
163
192
  runIfExisits(disconnectedCallback, component);
164
193
  };
194
+ /** The layout field behind a mapped attribute, e.g. `title-scenarios` -> `titleScenarios`. */
195
+ const fieldName = (propName) => {
196
+ var _a;
197
+ return (_a = mappings
198
+ .find((mapping) => mapping.propName === propName)) === null || _a === void 0 ? void 0 : _a.ancestorAttr.replace(/-(\w)/g, (_match, char) => char.toUpperCase());
199
+ };
165
200
  /**
166
- * Resolver: returns the inherited value for the given prop, or `undefined`
167
- * when the prop is not using inheritance (so the caller falls through to
168
- * its normal logic).
201
+ * Resolver: the one place that decides which value a mapped prop stands
202
+ * for, and that reports a keyword no ancestor satisfies.
169
203
  */
170
- const resolve = (propName, currentValue) => {
171
- if (!isInheritedValue(currentValue))
172
- return undefined;
173
- return resolved.get(propName);
204
+ const resolve = (propName, currentValue, fallback) => {
205
+ const warningId = `WARN_inherited_${propName}`;
206
+ const isKeyword = isInheritedValue(currentValue);
207
+ // The prop became a keyword, or a different one, after the last lookup.
208
+ if (isKeyword && lookedUp.get(propName) !== currentValue) {
209
+ resolveAll();
210
+ }
211
+ const inherited = isKeyword ? resolved.get(propName) : undefined;
212
+ if (isKeyword && inherited === undefined) {
213
+ const scope = currentValue === INHERITED_PAGE ? "page" : "card or page";
214
+ errors === null || errors === void 0 ? void 0 : errors.addOrReplace({
215
+ id: warningId,
216
+ type: "warning",
217
+ message: `${propName}: '${currentValue}' could not be resolved, no surrounding ${scope} sets ${fieldName(propName)}`,
218
+ });
219
+ return { value: fallback, inherited: false, unresolved: true };
220
+ }
221
+ errors === null || errors === void 0 ? void 0 : errors.remove(warningId);
222
+ return { value: inherited !== null && inherited !== void 0 ? inherited : currentValue, inherited: inherited !== undefined, unresolved: false };
174
223
  };
175
224
  return resolve;
176
225
  };
@@ -1,7 +1,7 @@
1
1
  import { forceUpdate, getElement } from "@stencil/core";
2
2
  import { getStores, clearStoresCache } from "../context/context-protocol";
3
3
  import { runIfExisits } from "./utils";
4
- import { isInheritedValue, findAncestor } from "./withInheritedProps";
4
+ import { isInheritedValue, findLayoutAncestors, readInherited } from "./withInheritedProps";
5
5
  import { merge } from "@corex/deepmerge";
6
6
  /**
7
7
  * Mixin that provides the IBCS rule-set configuration to a Stencil component
@@ -19,7 +19,8 @@ import { merge } from "@corex/deepmerge";
19
19
  * The `ruleset` attribute supports the `"inherited-closest"` /
20
20
  * `"inherited-page"` keywords from `withInheritedProps`: the actual name is
21
21
  * then read from the `ruleset` attribute of the nearest ancestor
22
- * `bn-layout-card` / `bn-layout-page`, which is observed for changes.
22
+ * `bn-layout-card` / `bn-layout-page` that sets one. Every ancestor on that
23
+ * path is observed for changes.
23
24
  *
24
25
  * @param component - The Stencil component instance
25
26
  * @returns A function returning the merged {@link RuleSetConfig}
@@ -47,15 +48,17 @@ const withRuleSet = (component) => {
47
48
  ancestorObserver = null;
48
49
  }
49
50
  if (raw && isInheritedValue(raw)) {
50
- const ancestor = findAncestor(element, raw);
51
- selectedRuleset = ancestor === null || ancestor === void 0 ? void 0 : ancestor.getAttribute("ruleset");
52
- if (ancestor) {
51
+ const ancestors = findLayoutAncestors(element, raw);
52
+ selectedRuleset = readInherited(ancestors, "ruleset");
53
+ if (ancestors.length > 0) {
53
54
  ancestorObserver = new MutationObserver(() => {
54
- selectedRuleset = ancestor.getAttribute("ruleset");
55
+ selectedRuleset = readInherited(ancestors, "ruleset");
55
56
  updateConfig();
56
57
  forceUpdate(component);
57
58
  });
58
- ancestorObserver.observe(ancestor, { attributes: true, attributeFilter: ["ruleset"] });
59
+ for (const ancestor of ancestors) {
60
+ ancestorObserver.observe(ancestor, { attributes: true, attributeFilter: ["ruleset"] });
61
+ }
59
62
  }
60
63
  }
61
64
  else {
@@ -12,8 +12,8 @@ import { findAncestorWithAttr } from "./withInheritedProps";
12
12
  * 1. The host element's own `i18n-namespace` attribute (the deprecated
13
13
  * `namespace` attribute is honored as a fallback).
14
14
  * 2. Otherwise the `i18n-namespace` attribute of the nearest ancestor that
15
- * carries one — a layout card, layout page, tree, grid, or the
16
- * `bn-context` itself — crossing shadow boundaries. The resolved ancestor
15
+ * carries one - a layout card, layout page, tree, grid, or the
16
+ * `bn-context` itself - crossing shadow boundaries. The resolved ancestor
17
17
  * is observed so attribute changes re-render the component.
18
18
  * 3. Otherwise the built-in `_system` namespace.
19
19
  *
@@ -99,7 +99,7 @@ const withTranslation = (component) => {
99
99
  const locales = stores.internationalization.state;
100
100
  const locale = stores.context.state.locale;
101
101
  // Per-key fallback chain: resolved namespace → _system → the key itself.
102
- // Never throws — a missing key or unknown locale must not blank the component.
102
+ // Never throws - a missing key or unknown locale must not blank the component.
103
103
  const tpl = (_c = (_b = (_a = locales[namespace]) === null || _a === void 0 ? void 0 : _a[locale]) === null || _b === void 0 ? void 0 : _b[key]) !== null && _c !== void 0 ? _c : (_e = (_d = locales["_system"]) === null || _d === void 0 ? void 0 : _d[locale]) === null || _e === void 0 ? void 0 : _e[key];
104
104
  if (tpl == null) {
105
105
  return key;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Small-multiple panel layout: divides a drawing area into equal panels,
3
3
  * wrapping row-major at `columns`. Axis tick labels render on the outer
4
- * edges only (IBCS 10F/10G style) — the `isOuterLeft`/`isOuterBottom`
4
+ * edges only (IBCS 10F/10G style) - the `isOuterLeft`/`isOuterBottom`
5
5
  * flags tell the renderer which panels carry them.
6
6
  */
7
7
  export class FacetGrid {
@@ -16,7 +16,7 @@ export class IsoCurves {
16
16
  return this.xScale.domainMin > 0 && this.yScale.domainMin > 0;
17
17
  }
18
18
  /**
19
- * Picks 2–4 nice k values from the 1-2-5 ladder spanning the central
19
+ * Picks 2-4 nice k values from the 1-2-5 ladder spanning the central
20
20
  * product range of the data (products = `x·y` per point).
21
21
  */
22
22
  static autoK(products) {
@@ -1,8 +1,10 @@
1
+ /** Most decimals a label gets: a double has about 15 significant digits. */
2
+ const MAX_DECIMALS = 15;
1
3
  /**
2
4
  * Linear numeric scale with nice-tick generation for the XY charts.
3
5
  *
4
6
  * Domains default to the data extent padded 4% on each side; zero-inclusion
5
- * is NOT forced — points encode by position, not length, so IBCS's
7
+ * is NOT forced - points encode by position, not length, so IBCS's
6
8
  * zero-baseline rule for bars does not apply. Explicit `min`/`max`
7
9
  * overrides disable the padding on that side.
8
10
  */
@@ -69,7 +71,7 @@ export class NumericScale {
69
71
  }
70
72
  /**
71
73
  * Nice tick values inside the domain, aiming for `targetCount` ticks
72
- * (the renderer picks 4–8 depending on panel size).
74
+ * (the renderer picks 4-8 depending on panel size).
73
75
  */
74
76
  ticks(targetCount) {
75
77
  const span = this.domainMax - this.domainMin;
@@ -78,26 +80,55 @@ export class NumericScale {
78
80
  }
79
81
  const step = NumericScale.niceStep(span, targetCount);
80
82
  const first = Math.ceil(this.domainMin / step) * step;
81
- const ticks = [];
83
+ // One tick when a second one cannot be told from the first: the span is below the float
84
+ // resolution of its values, or the step is finer than the decimals a label can show.
85
+ if (first + step === first || step < Math.pow(10, -MAX_DECIMALS)) {
86
+ return [this.domainMin];
87
+ }
88
+ const decimals = NumericScale.stepDecimals(step);
82
89
  // Guard against floating-point drift at the domain edge.
83
- for (let tick = first; tick <= this.domainMax + step * 1e-9; tick += step) {
84
- ticks.push(Math.abs(tick) < step * 1e-9 ? 0 : tick);
90
+ const count = Math.floor((this.domainMax + step * 1e-9 - first) / step) + 1;
91
+ const ticks = [];
92
+ for (let index = 0; index < count; index++) {
93
+ // rounded to the decimals of the step: 3 * 0.2 is 0.6000000000000001
94
+ const rounded = Number((first + index * step).toFixed(decimals));
95
+ const tick = rounded === 0 ? 0 : rounded;
96
+ // values that differ by float noise only can round two ticks to the same number
97
+ if (ticks.length === 0 || tick !== ticks[ticks.length - 1]) {
98
+ ticks.push(tick);
99
+ }
85
100
  }
86
101
  return ticks;
87
102
  }
88
103
  /**
89
- * Decimal places (0–2) needed to render the given ticks without
90
- * ambiguity between adjacent values.
104
+ * Decimal places needed to print multiples of `step` without rounding two of them
105
+ * to the same text: 0.025 needs 3, 2.5 needs 1, 10 needs 0.
91
106
  */
92
- static tickDecimals(ticks) {
93
- let decimals = 0;
94
- for (const tick of ticks) {
95
- const text = String(tick);
96
- const dot = text.indexOf(".");
97
- if (dot >= 0) {
98
- decimals = Math.max(decimals, Math.min(2, text.length - dot - 1));
107
+ static stepDecimals(step) {
108
+ if (!Number.isFinite(step) || step <= 0) {
109
+ return 0;
110
+ }
111
+ for (let decimals = 0; decimals < MAX_DECIMALS; decimals++) {
112
+ const scaled = step * Math.pow(10, decimals);
113
+ const whole = Math.round(scaled);
114
+ // a whole number of at least 1, up to float noise
115
+ if (whole >= 1 && Math.abs(scaled - whole) < whole * 1e-9) {
116
+ return decimals;
99
117
  }
100
118
  }
101
- return decimals;
119
+ return MAX_DECIMALS;
120
+ }
121
+ /**
122
+ * Decimal places needed to render the given ticks without ambiguity between
123
+ * adjacent values: the decimals of their distance, for one tick those of its value.
124
+ */
125
+ static tickDecimals(ticks) {
126
+ if (ticks.length === 0) {
127
+ return 0;
128
+ }
129
+ if (ticks.length === 1) {
130
+ return NumericScale.stepDecimals(Math.abs(ticks[0]));
131
+ }
132
+ return NumericScale.stepDecimals((ticks[ticks.length - 1] - ticks[0]) / (ticks.length - 1));
102
133
  }
103
134
  }
@@ -6,11 +6,11 @@ const DIAGONAL = Math.SQRT1_2;
6
6
  * Selective point labeling with greedy collision-free placement for the XY
7
7
  * charts. Composes the existing {@link LabelCollisionManager} (AABB
8
8
  * register/hasCollision core); marks are pre-registered as bounding
9
- * squares — conservative for circles, acceptable for label proximity.
9
+ * squares - conservative for circles, acceptable for label proximity.
10
10
  *
11
11
  * Placement tries eight anchors clockwise from north and rejects positions
12
12
  * that leave the frame or collide with marks or other labels; unplaceable
13
- * labels are dropped (IBCS wants proximate labels — no leader lines).
13
+ * labels are dropped (IBCS wants proximate labels - no leader lines).
14
14
  */
15
15
  export class PointLabeler {
16
16
  constructor(frame, gapPx, manager = new LabelCollisionManager()) {
@@ -4,11 +4,11 @@
4
4
  *
5
5
  * Two modes:
6
6
  * - **Local** (default): radii are normalized to the chart's own maximum
7
- * value — `r = rMax · √(v / vMax)` with a minimum visible radius.
7
+ * value - `r = rMax · √(v / vMax)` with a minimum visible radius.
8
8
  * `vMax` must be the max across all panels and both scenario sets of the
9
9
  * chart instance (shared size scale, mandatory for comparability).
10
10
  * - **Grouped** (`bn-scaling-group`): the group value is interpreted as
11
- * **area px² per data unit** — `r = √(area · v / π)` with no
11
+ * **area px² per data unit** - `r = √(area · v / π)` with no
12
12
  * normalization and no radius caps, so identical values render at
13
13
  * identical sizes across every chart referencing the group.
14
14
  */
@@ -5,7 +5,7 @@
5
5
  * XY charts compose two orthogonal encodings: the **series hue** (which
6
6
  * product line / group a point belongs to) and the **scenario treatment**
7
7
  * (solid / tinted / hatched / outlined, selected through the rule-set
8
- * `colorIndex`). Tints and shades are computed colors, never opacity —
8
+ * `colorIndex`). Tints and shades are computed colors, never opacity -
9
9
  * opacity creates blend artifacts where marks overlap.
10
10
  */
11
11
  /**
@@ -29,11 +29,11 @@ export function mixHex(hexA, hexB, ratioOfB) {
29
29
  };
30
30
  return `#${channel(1)}${channel(3)}${channel(5)}`;
31
31
  }
32
- /** Light variant of a series hue (60% white) — the PP/PY treatment. */
32
+ /** Light variant of a series hue (60% white) - the PP/PY treatment. */
33
33
  export function tint(hex) {
34
34
  return mixHex(hex, "#ffffff", 0.6);
35
35
  }
36
- /** Dark variant of a series hue (25% black) — used for pie-share slices. */
36
+ /** Dark variant of a series hue (25% black) - used for pie-share slices. */
37
37
  export function shade(hex) {
38
38
  return mixHex(hex, "#000000", 0.25);
39
39
  }
@@ -1,11 +1,12 @@
1
1
  import { Scenarios } from "../constants";
2
+ import { relativeVariance } from "../relativeVariance";
2
3
  /**
3
4
  * Variance-token parser for XY chart axis measures.
4
5
  *
5
6
  * Reuses the engine's variance grammar (`d{base}_{delta}_{sentiment}` /
6
7
  * `dr{base}_{delta}_{sentiment}`) with one deviation from
7
8
  * {@link VarianceScenario}: on axes the trailing sentiment segment is
8
- * **optional and ignored** — position encodes the value, there is no
9
+ * **optional and ignored** - position encodes the value, there is no
9
10
  * pos/neg coloring. The regex is anchored, so partial matches inside a
10
11
  * longer token are rejected.
11
12
  */
@@ -33,10 +34,11 @@ export class VarianceMeasure {
33
34
  /**
34
35
  * Computes the variance value, mirroring the null-safe math of the
35
36
  * existing charts: absolute = `base - delta`, relative =
36
- * `(base - delta) / delta`. Returns `null` when either operand is
37
+ * `(base - delta) / |delta|`. Returns `null` when either operand is
37
38
  * missing or a relative variance would divide by zero.
38
39
  */
39
40
  compute(base, delta) {
41
+ var _a;
40
42
  if (base == null || delta == null) {
41
43
  return null;
42
44
  }
@@ -44,7 +46,7 @@ export class VarianceMeasure {
44
46
  if (delta === 0) {
45
47
  return null;
46
48
  }
47
- return (base - delta) / delta;
49
+ return (_a = relativeVariance(base - delta, delta)) !== null && _a !== void 0 ? _a : null;
48
50
  }
49
51
  return base - delta;
50
52
  }
@@ -70,7 +72,23 @@ export function resolveMeasure(token) {
70
72
  export function scenarioFamily(slot) {
71
73
  return slot.replace(/\d+$/, "");
72
74
  }
73
- /** Slot number (`1`–`4`) of a plain scenario slot. */
75
+ /** Slot number (`1`-`4`) of a plain scenario slot. */
74
76
  export function scenarioSlotNumber(slot) {
75
77
  return slot.replace(/^[a-z]+/, "");
76
78
  }
79
+ /** True for a relative variance token (`dr…`): its values are fractions and are shown in percent. */
80
+ export function isRelativeMeasure(token) {
81
+ var _a;
82
+ return ((_a = VarianceMeasure.parse(token.trim())) === null || _a === void 0 ? void 0 : _a.type) === "dr";
83
+ }
84
+ /**
85
+ * The axis config in the unit of the axis values. A relative variance axis is written
86
+ * in percent (`min: -40`, `refLine: 20`), while its values are fractions (0.2 for 20 %).
87
+ */
88
+ export function axisInValueUnits(axis) {
89
+ if (!isRelativeMeasure(axis.measure)) {
90
+ return axis;
91
+ }
92
+ const fraction = (percent) => percent === undefined ? undefined : percent / 100;
93
+ return Object.assign(Object.assign({}, axis), { min: fraction(axis.min), max: fraction(axis.max), refLine: fraction(axis.refLine), highlight: axis.highlight && { from: fraction(axis.highlight.from), to: fraction(axis.highlight.to) } });
94
+ }
@@ -1,4 +1,4 @@
1
- import { Formatter } from "../formatter";
1
+ import { formatXYValue } from "./formatXYValue";
2
2
  /**
3
3
  * Per-panel plot frame for the XY charts: highlight bands, gridlines,
4
4
  * reference lines, the frame rectangle, tick labels, and the panel title.
@@ -75,7 +75,7 @@ export class XYFrame {
75
75
  .fill("none")
76
76
  .stroke({ color: this.styles.axisStyles.ac.stroke, width: this.styles.scaleFactors.gridLineWidth });
77
77
  }
78
- /** Tick labels along the outer edges (no tick marks — template style). */
78
+ /** Tick labels along the outer edges (no tick marks - template style). */
79
79
  drawTickLabels(group, config) {
80
80
  const gap = this.styles.scaleFactors.axisTickLength * this.em;
81
81
  const font = { size: this.styles.fontStyles.size, anchor: "start" };
@@ -85,7 +85,7 @@ export class XYFrame {
85
85
  for (const tick of config.ticksX) {
86
86
  const x = this.xScale.scale(tick);
87
87
  group
88
- .text(Formatter.number(tick, "decimal", config.xDecimals, config.xDecimals))
88
+ .text(formatXYValue(tick, config.xDecimals, this.styles.locale, config.xPercent))
89
89
  .font(Object.assign(Object.assign({}, font), { anchor: "middle" }))
90
90
  .fill(color)
91
91
  .attr({ x, y: this.rect.y + this.rect.height + gap + this.em * 0.8, "font-family": family });
@@ -95,7 +95,7 @@ export class XYFrame {
95
95
  for (const tick of config.ticksY) {
96
96
  const y = this.yScale.scale(tick);
97
97
  group
98
- .text(Formatter.number(tick, "decimal", config.yDecimals, config.yDecimals))
98
+ .text(formatXYValue(tick, config.yDecimals, this.styles.locale, config.yPercent))
99
99
  .font(Object.assign(Object.assign({}, font), { anchor: "end" }))
100
100
  .fill(color)
101
101
  .attr({ x: this.rect.x - gap, y: y + this.em * 0.35, "font-family": family });
@@ -1,7 +1,7 @@
1
1
  import CalculateSize from "calculate-size";
2
2
  /**
3
3
  * Series-color legend + bubble-size caption for the XY charts
4
- * (IBCS requires a legend explaining colors — and, for bubbles, size).
4
+ * (IBCS requires a legend explaining colors - and, for bubbles, size).
5
5
  * Positioned by the orchestrator: right column (default) or bottom row.
6
6
  */
7
7
  export class XYLegend {
@@ -34,11 +34,8 @@ export class XYLegend {
34
34
  if (model.title !== null && model.title !== "") {
35
35
  rows.push({ text: model.title, bold: true, treatment: null });
36
36
  }
37
- for (const entry of model.compareEntries) {
38
- rows.push({ text: entry.label, bold: false, treatment: entry.treatment });
39
- }
40
- for (const entry of model.entries) {
41
- rows.push({ text: entry.label, bold: false, treatment: entry.treatment });
37
+ for (const entry of [...model.compareEntries, ...model.entries]) {
38
+ rows.push({ text: entry.label, bold: false, treatment: entry.treatment, fill: entry.fill });
42
39
  }
43
40
  return rows;
44
41
  }
@@ -64,6 +61,7 @@ export class XYLegend {
64
61
  }
65
62
  /** Draws the legend with its top-left corner at `x`/`y`. */
66
63
  draw(group, model, x, y, position) {
64
+ var _a;
67
65
  const rows = this.rows(model);
68
66
  const swatchSpan = this.swatchSize + 0.4 * this.em;
69
67
  let cursorX = x;
@@ -74,7 +72,7 @@ export class XYLegend {
74
72
  const swatch = group
75
73
  .circle(this.swatchSize)
76
74
  .move(cursorX, cursorY + (this.rowHeight - this.swatchSize) / 2)
77
- .fill(row.treatment.hatch ? "#ffffff" : row.treatment.fill)
75
+ .fill((_a = row.fill) !== null && _a !== void 0 ? _a : (row.treatment.hatch ? "#ffffff" : row.treatment.fill))
78
76
  .stroke({
79
77
  color: row.treatment.stroke === "#ffffff" ? row.treatment.fill : row.treatment.stroke,
80
78
  width: row.treatment.strokeWidth,
@@ -0,0 +1,32 @@
1
+ import { getClippedHeight, getParentDimensions } from "../parentDimensions";
2
+ /**
3
+ * Sets or removes WARN_overflow on the facade of an XY chart. The chart takes the width
4
+ * of its parent and its height follows from `aspect`, so the height is what usually does
5
+ * not fit. It does not adapt to the height it has, so the height counts only when an
6
+ * ancestor really cuts the chart off: on a page that grows or scrolls nothing is lost.
7
+ */
8
+ export function checkXYOverflow(host, innerTag, errors) {
9
+ var _a, _b, _c, _d, _e;
10
+ const errId = "WARN_overflow";
11
+ const parent = getParentDimensions(host);
12
+ const svgHeight = parseFloat((_e = (_d = (_c = (_b = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(innerTag)) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector("svg#drawCanvas")) === null || _d === void 0 ? void 0 : _d.getAttribute("height")) !== null && _e !== void 0 ? _e : "");
13
+ const contentHeight = Math.max(Number.isNaN(svgHeight) ? 0 : Math.floor(svgHeight), host.scrollHeight || 0);
14
+ const contentWidth = host.scrollWidth || 0;
15
+ const dims = [];
16
+ if (parent.width > 0 && contentWidth > parent.width + 1) {
17
+ dims.push(`width (${Math.round(contentWidth)}px > ${Math.round(parent.width)}px)`);
18
+ }
19
+ const clipped = getClippedHeight(host, contentHeight);
20
+ if (clipped > 1) {
21
+ dims.push(`height (${Math.round(contentHeight)}px > ${Math.round(contentHeight - clipped)}px)`);
22
+ }
23
+ if (dims.length === 0) {
24
+ errors.remove(errId);
25
+ return;
26
+ }
27
+ errors.addOrReplace({
28
+ id: errId,
29
+ type: "warning",
30
+ message: `Chart exceeds available ${dims.join(" and ")} and will be cut off. Check the scale and aspect values or enlarge the container.`,
31
+ });
32
+ }