@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,1042 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-C1Z9vO7z.js');
4
- var withStyled = require('./withStyled-D0jLwCib.js');
5
- var index$1 = require('./index.cjs.js');
6
- var diagnostics = require('./diagnostics-CTgbq_Gc.js');
7
- var withHasError = require('./withHasError-BdDmiOXM.js');
8
- require('./context-protocol-DcTEh1rq.js');
9
- require('./VarianceMeasure-CQlSRzlp.js');
10
- require('./Order-2wRydarc.js');
11
-
12
- /**
13
- * Tree Parser utility for bn-tree component
14
- * Handles JSON parsing and validation for tree edge configurations
15
- */
16
- const VALID_OPERATORS = ["*", "/", "+", "-", "x", "÷", "none"];
17
- /**
18
- * Parse the JSON edges configuration string into a TreeConfig object
19
- * @param json - JSON string containing array of TreeEdge objects
20
- * @returns TreeConfig object or null if parsing fails
21
- */
22
- function parseTreeConfig(json) {
23
- if (!json || json.trim() === "") {
24
- return null;
25
- }
26
- try {
27
- const parsed = JSON.parse(json);
28
- if (!Array.isArray(parsed)) {
29
- return null;
30
- }
31
- const edges = parsed;
32
- const adjacencyList = buildAdjacencyList(edges);
33
- const allNodes = collectAllNodes(edges);
34
- const rootNode = findRootNode(edges, allNodes);
35
- return {
36
- edges,
37
- adjacencyList,
38
- rootNode,
39
- allNodes,
40
- };
41
- }
42
- catch (e) {
43
- console.error("parseTreeConfig: failed to parse tree configuration", e);
44
- return null;
45
- }
46
- }
47
- /**
48
- * Validate the edges JSON configuration and return validation errors
49
- * @param json - JSON string to validate
50
- * @returns Array of error messages (empty if valid)
51
- */
52
- function validateEdges(json) {
53
- const errors = [];
54
- if (!json || json.trim() === "") {
55
- errors.push("edges: value is required");
56
- return errors;
57
- }
58
- let parsed;
59
- try {
60
- parsed = JSON.parse(json);
61
- }
62
- catch (_a) {
63
- errors.push("edges: invalid JSON structure");
64
- return errors;
65
- }
66
- if (!Array.isArray(parsed)) {
67
- errors.push("edges: must be an array");
68
- return errors;
69
- }
70
- if (parsed.length === 0) {
71
- errors.push("edges: array must not be empty");
72
- return errors;
73
- }
74
- const allNodes = new Set();
75
- const targetNodes = new Set();
76
- parsed.forEach((edge, index) => {
77
- if (typeof edge !== "object" || edge === null) {
78
- errors.push(`edges[${index}]: must be an object`);
79
- return;
80
- }
81
- const typedEdge = edge;
82
- if (typeof typedEdge.from !== "string" || typedEdge.from.trim() === "") {
83
- errors.push(`edges[${index}]: 'from' is required and must be a non-empty string`);
84
- }
85
- else {
86
- allNodes.add(typedEdge.from);
87
- }
88
- if (typeof typedEdge.to !== "string" || typedEdge.to.trim() === "") {
89
- errors.push(`edges[${index}]: 'to' is required and must be a non-empty string`);
90
- }
91
- else {
92
- allNodes.add(typedEdge.to);
93
- targetNodes.add(typedEdge.to);
94
- }
95
- if (typedEdge.operator !== undefined) {
96
- if (typeof typedEdge.operator !== "string" || !VALID_OPERATORS.includes(typedEdge.operator)) {
97
- errors.push(`edges[${index}]: 'operator' must be one of: ${VALID_OPERATORS.join(", ")}`);
98
- }
99
- }
100
- if (typedEdge.label !== undefined && typeof typedEdge.label !== "string") {
101
- errors.push(`edges[${index}]: 'label' must be a string`);
102
- }
103
- if (typedEdge.style !== undefined) {
104
- if (typeof typedEdge.style !== "object" || typedEdge.style === null) {
105
- errors.push(`edges[${index}]: 'style' must be an object`);
106
- }
107
- else {
108
- const style = typedEdge.style;
109
- if (style.color !== undefined && typeof style.color !== "string") {
110
- errors.push(`edges[${index}]: 'style.color' must be a string`);
111
- }
112
- if (style.width !== undefined && typeof style.width !== "number") {
113
- errors.push(`edges[${index}]: 'style.width' must be a number`);
114
- }
115
- if (style.dasharray !== undefined && typeof style.dasharray !== "string") {
116
- errors.push(`edges[${index}]: 'style.dasharray' must be a string`);
117
- }
118
- }
119
- }
120
- });
121
- // Check for multiple roots (nodes that are not targets of any edge)
122
- const rootNodes = Array.from(allNodes).filter((node) => !targetNodes.has(node));
123
- if (rootNodes.length === 0) {
124
- errors.push("edges: tree has no root node (circular reference detected)");
125
- }
126
- else if (rootNodes.length > 1) {
127
- errors.push(`edges: tree has multiple root nodes: ${rootNodes.join(", ")}`);
128
- }
129
- return errors;
130
- }
131
- /**
132
- * Build an adjacency list from edges (parent -> children mapping)
133
- */
134
- function buildAdjacencyList(edges) {
135
- const adjacencyList = new Map();
136
- for (const edge of edges) {
137
- const children = adjacencyList.get(edge.from) || [];
138
- children.push(edge.to);
139
- adjacencyList.set(edge.from, children);
140
- }
141
- return adjacencyList;
142
- }
143
- /**
144
- * Collect all unique node IDs from edges
145
- */
146
- function collectAllNodes(edges) {
147
- const nodes = new Set();
148
- for (const edge of edges) {
149
- nodes.add(edge.from);
150
- nodes.add(edge.to);
151
- }
152
- return nodes;
153
- }
154
- /**
155
- * Find the root node (node with no incoming edges)
156
- */
157
- function findRootNode(edges, allNodes) {
158
- const targetNodes = new Set();
159
- for (const edge of edges) {
160
- targetNodes.add(edge.to);
161
- }
162
- const rootNodes = Array.from(allNodes).filter((node) => !targetNodes.has(node));
163
- return rootNodes.length === 1 ? rootNodes[0] : null;
164
- }
165
- /**
166
- * Get the operator symbol to display between sibling nodes
167
- */
168
- function getOperatorSymbol(operator) {
169
- switch (operator) {
170
- case "*":
171
- case "x":
172
- return "×";
173
- case "/":
174
- case "÷":
175
- return "÷";
176
- case "+":
177
- return "+";
178
- case "-":
179
- return "−";
180
- case "none":
181
- return "";
182
- default:
183
- return "";
184
- }
185
- }
186
- /**
187
- * Get the edge connecting a parent to a specific child
188
- */
189
- function getEdgeForChild(edges, parent, child) {
190
- return edges.find((edge) => edge.from === parent && edge.to === child);
191
- }
192
-
193
- /**
194
- * Tree Layout utility for bn-tree component
195
- * Handles level assignment and grid positioning for tree nodes
196
- */
197
- /**
198
- * Calculate the layout positions for all nodes in the tree
199
- */
200
- function calculateLayout(config, direction, levelSpacing, nodeSpacing) {
201
- if (!config.rootNode) {
202
- return {
203
- positions: new Map(),
204
- gridTemplateColumns: "",
205
- gridTemplateRows: "",
206
- maxLevel: 0,
207
- maxIndex: 0,
208
- };
209
- }
210
- // Step 1: Assign levels using BFS
211
- const nodeLevels = assignLevels(config);
212
- // Step 2: Calculate vertical positions (row indices) for each node
213
- const nodeIndices = calculateNodeIndices(config);
214
- // Step 3: Calculate grid positions based on direction
215
- const positions = calculateGridPositions(config, nodeLevels, nodeIndices, direction);
216
- // Step 4: Generate CSS grid templates
217
- const maxLevel = Math.max(...Array.from(nodeLevels.values()));
218
- const maxIndex = Math.max(...Array.from(nodeIndices.values()).map((ni) => ni.endIndex));
219
- const { gridTemplateColumns, gridTemplateRows } = generateGridTemplates(maxLevel, maxIndex, direction, levelSpacing, nodeSpacing);
220
- return {
221
- positions,
222
- gridTemplateColumns,
223
- gridTemplateRows,
224
- maxLevel,
225
- maxIndex,
226
- };
227
- }
228
- /**
229
- * Assign levels to each node using BFS from root
230
- */
231
- function assignLevels(config) {
232
- const levels = new Map();
233
- if (!config.rootNode) {
234
- return levels;
235
- }
236
- const queue = [{ node: config.rootNode, level: 0 }];
237
- const visited = new Set();
238
- while (queue.length > 0) {
239
- const { node, level } = queue.shift();
240
- if (visited.has(node)) {
241
- continue;
242
- }
243
- visited.add(node);
244
- levels.set(node, level);
245
- const children = config.adjacencyList.get(node) || [];
246
- for (const child of children) {
247
- if (!visited.has(child)) {
248
- queue.push({ node: child, level: level + 1 });
249
- }
250
- }
251
- }
252
- return levels;
253
- }
254
- /**
255
- * Calculate vertical indices for nodes, ensuring parent nodes span their children.
256
- * Handles DAG structures where a node may have multiple parents.
257
- */
258
- function calculateNodeIndices(config) {
259
- const indices = new Map();
260
- if (!config.rootNode) {
261
- return indices;
262
- }
263
- // Assign indices using DFS, tracking visited nodes for DAG support
264
- let currentIndex = 0;
265
- function assignIndex(node) {
266
- // If already visited (node has multiple parents), return existing index
267
- const existing = indices.get(node);
268
- if (existing) {
269
- return existing;
270
- }
271
- const children = config.adjacencyList.get(node) || [];
272
- if (children.length === 0) {
273
- // Leaf node
274
- const info = { startIndex: currentIndex, endIndex: currentIndex };
275
- indices.set(node, info);
276
- currentIndex++;
277
- return info;
278
- }
279
- // Parent node: process children first
280
- let startIndex = Infinity;
281
- let endIndex = -Infinity;
282
- for (const child of children) {
283
- const childInfo = assignIndex(child);
284
- startIndex = Math.min(startIndex, childInfo.startIndex);
285
- endIndex = Math.max(endIndex, childInfo.endIndex);
286
- }
287
- const info = { startIndex, endIndex };
288
- indices.set(node, info);
289
- return info;
290
- }
291
- assignIndex(config.rootNode);
292
- return indices;
293
- }
294
- /**
295
- * Convert levels and indices to CSS grid positions based on direction
296
- */
297
- function calculateGridPositions(config, levels, indices, direction) {
298
- var _a, _b;
299
- const positions = new Map();
300
- const maxLevel = Math.max(...Array.from(levels.values()));
301
- for (const nodeId of config.allNodes) {
302
- const level = (_a = levels.get(nodeId)) !== null && _a !== void 0 ? _a : 0;
303
- const indexInfo = (_b = indices.get(nodeId)) !== null && _b !== void 0 ? _b : { startIndex: 0, endIndex: 0 };
304
- let gridColumn;
305
- let gridRow;
306
- let gridRowSpan;
307
- switch (direction) {
308
- case "ltr":
309
- // Left to right: levels are columns, indices are rows
310
- gridColumn = level + 1; // CSS grid is 1-indexed
311
- gridRow = indexInfo.startIndex + 1;
312
- gridRowSpan = indexInfo.endIndex - indexInfo.startIndex + 1;
313
- break;
314
- case "rtl":
315
- // Right to left: levels are reversed columns
316
- gridColumn = maxLevel - level + 1;
317
- gridRow = indexInfo.startIndex + 1;
318
- gridRowSpan = indexInfo.endIndex - indexInfo.startIndex + 1;
319
- break;
320
- case "ttb":
321
- // Top to bottom: levels are rows, indices are columns
322
- gridRow = level + 1;
323
- gridColumn = indexInfo.startIndex + 1;
324
- gridRowSpan = 1;
325
- break;
326
- case "btt":
327
- // Bottom to top: levels are reversed rows
328
- gridRow = maxLevel - level + 1;
329
- gridColumn = indexInfo.startIndex + 1;
330
- gridRowSpan = 1;
331
- break;
332
- }
333
- positions.set(nodeId, {
334
- nodeId,
335
- level,
336
- index: indexInfo.startIndex,
337
- gridColumn,
338
- gridRow,
339
- gridRowSpan,
340
- });
341
- }
342
- return positions;
343
- }
344
- /**
345
- * Generate CSS grid template strings
346
- */
347
- function generateGridTemplates(maxLevel, maxIndex, direction, levelSpacing, nodeSpacing) {
348
- const isHorizontal = direction === "ltr" || direction === "rtl";
349
- const numLevels = maxLevel + 1;
350
- const numNodes = maxIndex + 1;
351
- if (isHorizontal) {
352
- // For horizontal layouts, columns represent levels, rows represent nodes
353
- const columns = [];
354
- for (let i = 0; i < numLevels; i++) {
355
- columns.push("auto");
356
- if (i < numLevels - 1) {
357
- columns.push(`${levelSpacing}px`); // Spacer column
358
- }
359
- }
360
- const rows = [];
361
- for (let i = 0; i < numNodes; i++) {
362
- rows.push("auto");
363
- if (i < numNodes - 1) {
364
- rows.push(`${nodeSpacing}px`); // Spacer row
365
- }
366
- }
367
- return {
368
- gridTemplateColumns: columns.join(" "),
369
- gridTemplateRows: rows.join(" "),
370
- };
371
- }
372
- else {
373
- // For vertical layouts, rows represent levels, columns represent nodes
374
- const rows = [];
375
- for (let i = 0; i < numLevels; i++) {
376
- rows.push("auto");
377
- if (i < numLevels - 1) {
378
- rows.push(`${levelSpacing}px`); // Spacer row
379
- }
380
- }
381
- const columns = [];
382
- for (let i = 0; i < numNodes; i++) {
383
- columns.push("auto");
384
- if (i < numNodes - 1) {
385
- columns.push(`${nodeSpacing}px`); // Spacer column
386
- }
387
- }
388
- return {
389
- gridTemplateColumns: columns.join(" "),
390
- gridTemplateRows: rows.join(" "),
391
- };
392
- }
393
- }
394
- /**
395
- * Get the actual grid column accounting for spacer columns
396
- */
397
- function getActualGridColumn(baseColumn) {
398
- // Account for spacer columns between levels
399
- return (baseColumn - 1) * 2 + 1;
400
- }
401
- /**
402
- * Get the actual grid row accounting for spacer rows
403
- */
404
- function getActualGridRow(baseRow) {
405
- // Account for spacer rows between nodes
406
- return (baseRow - 1) * 2 + 1;
407
- }
408
- /**
409
- * Get the actual grid row span accounting for spacer rows
410
- */
411
- function getActualGridRowSpan(baseRowSpan) {
412
- if (baseRowSpan <= 1) {
413
- return 1;
414
- }
415
- // Span includes the spacer rows between nodes
416
- return (baseRowSpan - 1) * 2 + 1;
417
- }
418
-
419
- /**
420
- * Edge Renderer utility for bn-tree component
421
- * Handles SVG path generation for connecting tree nodes
422
- */
423
- /**
424
- * Calculate the bounding rectangle of a node element
425
- */
426
- function getNodeRect(element, containerRect) {
427
- const rect = element.getBoundingClientRect();
428
- const left = rect.left - containerRect.left;
429
- const top = rect.top - containerRect.top;
430
- return {
431
- left,
432
- top,
433
- width: rect.width,
434
- height: rect.height,
435
- centerX: left + rect.width / 2,
436
- centerY: top + rect.height / 2,
437
- };
438
- }
439
- /**
440
- * Get the connection point on a node based on layout direction
441
- */
442
- function getConnectionPoint(rect, isSource, direction) {
443
- switch (direction) {
444
- case "ltr":
445
- // Left to right: source connects from right, target from left
446
- return isSource ? { x: rect.left + rect.width, y: rect.centerY } : { x: rect.left, y: rect.centerY };
447
- case "rtl":
448
- // Right to left: source connects from left, target from right
449
- return isSource ? { x: rect.left, y: rect.centerY } : { x: rect.left + rect.width, y: rect.centerY };
450
- case "ttb":
451
- // Top to bottom: source connects from bottom, target from top
452
- return isSource ? { x: rect.centerX, y: rect.top + rect.height } : { x: rect.centerX, y: rect.top };
453
- case "btt":
454
- // Bottom to top: source connects from top, target from bottom
455
- return isSource ? { x: rect.centerX, y: rect.top } : { x: rect.centerX, y: rect.top + rect.height };
456
- }
457
- }
458
- /**
459
- * Get the connection point on a node for multi-parent scenarios.
460
- * When a node has multiple parents, each parent connects at a different
461
- * vertical position on the target node's edge, spread around the center.
462
- * @param parentIndex - Index of this parent (0-based)
463
- * @param totalParents - Total number of parents for this node
464
- * @param spacing - Spacing between connection points in pixels
465
- */
466
- function getMultiParentConnectionPoint(rect, direction, parentIndex, totalParents, spacing = 8) {
467
- // Calculate offset from center for this parent
468
- // Parents are spread evenly around center with given spacing
469
- const totalSpread = (totalParents - 1) * spacing;
470
- const offset = -totalSpread / 2 + parentIndex * spacing;
471
- switch (direction) {
472
- case "ltr":
473
- // Left to right: target connects from left, offset vertically
474
- return { x: rect.left, y: rect.centerY + offset };
475
- case "rtl":
476
- // Right to left: target connects from right, offset vertically
477
- return { x: rect.left + rect.width, y: rect.centerY + offset };
478
- case "ttb":
479
- // Top to bottom: target connects from top, offset horizontally
480
- return { x: rect.centerX + offset, y: rect.top };
481
- case "btt":
482
- // Bottom to top: target connects from bottom, offset horizontally
483
- return { x: rect.centerX + offset, y: rect.top + rect.height };
484
- }
485
- }
486
- /**
487
- * Generate an SVG path connecting two points with the specified style
488
- */
489
- function generateEdgePath(start, end, style, direction) {
490
- switch (style) {
491
- case "straight":
492
- return generateStraightPath(start, end);
493
- case "curved":
494
- return generateCurvedPath(start, end, direction);
495
- case "orthogonal":
496
- default:
497
- return generateOrthogonalPath(start, end, direction);
498
- }
499
- }
500
- /**
501
- * Generate a straight line path
502
- */
503
- function generateStraightPath(start, end) {
504
- const path = `M ${start.x} ${start.y} L ${end.x} ${end.y}`;
505
- const midpoint = {
506
- x: (start.x + end.x) / 2,
507
- y: (start.y + end.y) / 2,
508
- };
509
- return { path, midpoint };
510
- }
511
- /**
512
- * Generate a curved bezier path
513
- */
514
- function generateCurvedPath(start, end, direction) {
515
- const isHorizontal = direction === "ltr" || direction === "rtl";
516
- let controlPoint1;
517
- let controlPoint2;
518
- if (isHorizontal) {
519
- const midX = (start.x + end.x) / 2;
520
- controlPoint1 = { x: midX, y: start.y };
521
- controlPoint2 = { x: midX, y: end.y };
522
- }
523
- else {
524
- const midY = (start.y + end.y) / 2;
525
- controlPoint1 = { x: start.x, y: midY };
526
- controlPoint2 = { x: end.x, y: midY };
527
- }
528
- const path = `M ${start.x} ${start.y} C ${controlPoint1.x} ${controlPoint1.y}, ${controlPoint2.x} ${controlPoint2.y}, ${end.x} ${end.y}`;
529
- // Midpoint of a cubic bezier at t=0.5
530
- const midpoint = {
531
- x: 0.125 * start.x + 0.375 * controlPoint1.x + 0.375 * controlPoint2.x + 0.125 * end.x,
532
- y: 0.125 * start.y + 0.375 * controlPoint1.y + 0.375 * controlPoint2.y + 0.125 * end.y,
533
- };
534
- return { path, midpoint };
535
- }
536
- /**
537
- * Generate an orthogonal (right-angle) path
538
- * The bend point is positioned closer to the children (70% of the way) for better visual balance
539
- */
540
- function generateOrthogonalPath(start, end, direction) {
541
- const isHorizontal = direction === "ltr" || direction === "rtl";
542
- let path;
543
- let midpoint;
544
- const bendRatio = 0.7; // Position bend point 70% towards the end
545
- if (isHorizontal) {
546
- // For horizontal layouts, go horizontally first, then vertically
547
- const midX = start.x + (end.x - start.x) * bendRatio;
548
- path = `M ${start.x} ${start.y} L ${midX} ${start.y} L ${midX} ${end.y} L ${end.x} ${end.y}`;
549
- midpoint = { x: midX, y: (start.y + end.y) / 2 };
550
- }
551
- else {
552
- // For vertical layouts, go vertically first, then horizontally
553
- const midY = start.y + (end.y - start.y) * bendRatio;
554
- path = `M ${start.x} ${start.y} L ${start.x} ${midY} L ${end.x} ${midY} L ${end.x} ${end.y}`;
555
- midpoint = { x: (start.x + end.x) / 2, y: midY };
556
- }
557
- return { path, midpoint };
558
- }
559
- /**
560
- * Calculate the position for an operator label between sibling nodes.
561
- * The operator is placed at the T-junction where the parent's line meets the vertical/horizontal split.
562
- */
563
- function calculateOperatorPosition(parentRect, sibling1Rect, sibling2Rect, direction) {
564
- const bendRatio = 0.7; // Must match the bendRatio in generateOrthogonalPath
565
- switch (direction) {
566
- case "ltr": {
567
- // T-junction: where parent's horizontal line meets the vertical split
568
- const parentRight = parentRect.left + parentRect.width;
569
- const childrenLeft = Math.min(sibling1Rect.left, sibling2Rect.left);
570
- const midX = parentRight + (childrenLeft - parentRight) * bendRatio;
571
- return {
572
- x: midX,
573
- y: parentRect.centerY, // At parent's Y level (the T-junction)
574
- };
575
- }
576
- case "rtl": {
577
- // T-junction for RTL
578
- const parentLeft = parentRect.left;
579
- const childrenRight = Math.max(sibling1Rect.left + sibling1Rect.width, sibling2Rect.left + sibling2Rect.width);
580
- const midX = childrenRight + (parentLeft - childrenRight) * bendRatio;
581
- return {
582
- x: midX,
583
- y: parentRect.centerY,
584
- };
585
- }
586
- case "ttb": {
587
- // T-junction for top-to-bottom
588
- const parentBottom = parentRect.top + parentRect.height;
589
- const childrenTop = Math.min(sibling1Rect.top, sibling2Rect.top);
590
- const midY = parentBottom + (childrenTop - parentBottom) * bendRatio;
591
- return {
592
- x: parentRect.centerX, // At parent's X level (the T-junction)
593
- y: midY,
594
- };
595
- }
596
- case "btt": {
597
- // T-junction for bottom-to-top
598
- const parentTop = parentRect.top;
599
- const childrenBottom = Math.max(sibling1Rect.top + sibling1Rect.height, sibling2Rect.top + sibling2Rect.height);
600
- const midY = childrenBottom + (parentTop - childrenBottom) * bendRatio;
601
- return {
602
- x: parentRect.centerX,
603
- y: midY,
604
- };
605
- }
606
- }
607
- }
608
- /**
609
- * Get SVG style attributes for an edge
610
- */
611
- function getEdgeSvgStyle(defaultColor, defaultWidth, edgeStyle) {
612
- var _a, _b;
613
- return Object.assign({ stroke: (_a = edgeStyle === null || edgeStyle === void 0 ? void 0 : edgeStyle.color) !== null && _a !== void 0 ? _a : defaultColor, strokeWidth: (_b = edgeStyle === null || edgeStyle === void 0 ? void 0 : edgeStyle.width) !== null && _b !== void 0 ? _b : defaultWidth }, ((edgeStyle === null || edgeStyle === void 0 ? void 0 : edgeStyle.dasharray) ? { strokeDasharray: edgeStyle.dasharray } : {}));
614
- }
615
-
616
- const bnTreeCss = () => `:host{display:inline-block;position:relative;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.tree-container{position:relative;display:inline-block}.tree-grid{position:relative;display:grid;align-items:center}.tree-node{position:relative;z-index:1;border:1px solid #404040;background:var(--bn-font-background, white)}.edge-layer{position:absolute;top:0;left:0;z-index:0;pointer-events:none;overflow:visible}.tree-error{display:flex;flex-wrap:wrap;gap:20px}`;
617
-
618
- const ChartTree = class {
619
- validateEdgesProp(newValue) {
620
- const errId = "ERR_edges";
621
- const validationErrors = validateEdges(newValue);
622
- if (validationErrors.length > 0) {
623
- this.errors.addOrReplace({
624
- id: errId,
625
- type: "error",
626
- message: `edges: ${validationErrors.join("; ")}`,
627
- });
628
- this.treeConfig = null;
629
- }
630
- else {
631
- this.errors.remove(errId);
632
- this.treeConfig = parseTreeConfig(newValue);
633
- }
634
- this.recalculateLayout();
635
- }
636
- validateDirection(newValue) {
637
- const errId = "ERR_direction";
638
- const validValues = ["ltr", "rtl", "ttb", "btt"];
639
- if (!validValues.includes(newValue)) {
640
- this.errors.addOrReplace({
641
- id: errId,
642
- type: "warning",
643
- message: `direction: invalid value '${newValue}', must be one of: ${validValues.join(", ")}`,
644
- });
645
- }
646
- else {
647
- this.errors.remove(errId);
648
- }
649
- this.recalculateLayout();
650
- }
651
- validateLevelSpacing(newValue) {
652
- const errId = "ERR_levelSpacing";
653
- if (!withStyled.isValidNumber(newValue) || newValue < 0) {
654
- this.errors.addOrReplace({
655
- id: errId,
656
- type: "warning",
657
- message: `level-spacing: invalid value '${newValue}', must be a non-negative number`,
658
- });
659
- }
660
- else {
661
- this.errors.remove(errId);
662
- }
663
- this.recalculateLayout();
664
- }
665
- validateNodeSpacing(newValue) {
666
- const errId = "ERR_nodeSpacing";
667
- if (!withStyled.isValidNumber(newValue) || newValue < 0) {
668
- this.errors.addOrReplace({
669
- id: errId,
670
- type: "warning",
671
- message: `node-spacing: invalid value '${newValue}', must be a non-negative number`,
672
- });
673
- }
674
- else {
675
- this.errors.remove(errId);
676
- }
677
- this.recalculateLayout();
678
- }
679
- validateEdgeStyle(newValue) {
680
- const errId = "ERR_edgeStyle";
681
- const validValues = ["straight", "orthogonal", "curved"];
682
- if (!validValues.includes(newValue)) {
683
- this.errors.addOrReplace({
684
- id: errId,
685
- type: "warning",
686
- message: `edge-style: invalid value '${newValue}', must be one of: ${validValues.join(", ")}`,
687
- });
688
- }
689
- else {
690
- this.errors.remove(errId);
691
- }
692
- }
693
- validateShowOperators(newValue) {
694
- const errId = "ERR_showOperators";
695
- if (!withStyled.isValidBoolean(newValue)) {
696
- this.errors.addOrReplace({
697
- id: errId,
698
- type: "warning",
699
- message: `show-operators: invalid value '${newValue}', must be 'true' or 'false'`,
700
- });
701
- }
702
- else {
703
- this.errors.remove(errId);
704
- }
705
- }
706
- constructor(hostRef) {
707
- index.registerInstance(this, hostRef);
708
- this.treeConfig = null;
709
- this.layout = null;
710
- this.nodeRects = new Map();
711
- this.svgWidth = 0;
712
- this.svgHeight = 0;
713
- this.resizeObserver = null;
714
- this.gridContainer = null;
715
- /**
716
- * Layout direction of the tree.
717
- * - 'ltr': left to right (root on left)
718
- * - 'rtl': right to left (root on right)
719
- * - 'ttb': top to bottom (root on top)
720
- * - 'btt': bottom to top (root on bottom)
721
- */
722
- this.direction = "ltr";
723
- /**
724
- * Spacing between hierarchy levels in pixels.
725
- */
726
- this.levelSpacing = 60;
727
- /**
728
- * Spacing between sibling nodes in pixels.
729
- */
730
- this.nodeSpacing = 20;
731
- /**
732
- * Edge line style.
733
- * - 'straight': direct line between nodes
734
- * - 'orthogonal': right-angle lines (default)
735
- * - 'curved': smooth bezier curves
736
- */
737
- this.edgeStyle = "orthogonal";
738
- /**
739
- * Show operator labels between sibling nodes.
740
- */
741
- this.showOperators = "true";
742
- withStyled.withStyled(this);
743
- withHasError.withComponentStatus(this);
744
- this.errors = withHasError.withHasError(this);
745
- this.componentStyle = withStyled.withComponentStyle(this);
746
- }
747
- /**
748
- * Lazily generates this tree's layout state: host box (context- and
749
- * component-relative, CSS px), the grid region and node/edge counts. With
750
- * `detail: "full"` every node (slotted content), edge path and operator is
751
- * listed with its geometry.
752
- *
753
- * @param options - `{ detail: "summary" | "full" }`, default `"summary"`
754
- */
755
- async getLayoutState(options) {
756
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
757
- const detail = (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : "summary";
758
- const origins = diagnostics.originsFor(this.element);
759
- const fontSizePx = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
760
- const state = {
761
- version: index$1.LAYOUT_STATE_VERSION,
762
- tag: this.element.localName,
763
- id: diagnostics.resolveStandaloneId(this.element),
764
- slot: (_b = this.element.getAttribute("slot")) !== null && _b !== void 0 ? _b : undefined,
765
- rect: diagnostics.measure(this.element, origins),
766
- em: { fontSizePx, appliedScaleFactor: 1 },
767
- regions: [],
768
- metadata: {
769
- nodeCount: (_d = (_c = this.treeConfig) === null || _c === void 0 ? void 0 : _c.allNodes.size) !== null && _d !== void 0 ? _d : 0,
770
- edgeCount: (_f = (_e = this.treeConfig) === null || _e === void 0 ? void 0 : _e.edges.length) !== null && _f !== void 0 ? _f : 0,
771
- },
772
- diagnostics: diagnostics.readDiagnostics(this.element),
773
- };
774
- const grid = (_g = this.element.shadowRoot) === null || _g === void 0 ? void 0 : _g.querySelector(".tree-grid");
775
- if (grid)
776
- state.regions.push({ id: "grid", rect: diagnostics.measure(grid, origins) });
777
- if (detail !== "full" || !this.treeConfig) {
778
- return state;
779
- }
780
- const elements = [];
781
- for (const nodeId of this.treeConfig.allNodes) {
782
- const slotted = this.element.querySelector(`[slot="${nodeId}"]`);
783
- if (!slotted)
784
- continue;
785
- const node = { kind: "node", nodeId, rect: diagnostics.measure(slotted, origins) };
786
- elements.push(node);
787
- }
788
- // Pair model edges with the rendered paths, replicating renderEdges()'s
789
- // skip of edges whose node rects are missing.
790
- const paths = Array.from((_j = (_h = this.element.shadowRoot) === null || _h === void 0 ? void 0 : _h.querySelectorAll("svg.edge-layer path")) !== null && _j !== void 0 ? _j : []);
791
- let pathIndex = 0;
792
- for (const edge of this.treeConfig.edges) {
793
- if (!this.nodeRects.get(edge.from) || !this.nodeRects.get(edge.to))
794
- continue;
795
- const pathEl = paths[pathIndex++];
796
- if (!pathEl)
797
- break;
798
- const edgeElement = {
799
- kind: "edge",
800
- from: edge.from,
801
- to: edge.to,
802
- operator: edge.operator,
803
- path: (_k = pathEl.getAttribute("d")) !== null && _k !== void 0 ? _k : undefined,
804
- rect: diagnostics.measure(pathEl, origins),
805
- };
806
- elements.push(edgeElement);
807
- }
808
- (_l = this.element.shadowRoot) === null || _l === void 0 ? void 0 : _l.querySelectorAll("svg.edge-layer g.operator-group").forEach((group) => {
809
- var _a, _b;
810
- const text = (_b = (_a = group.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : "";
811
- if (!text)
812
- return;
813
- const operator = { kind: "label", role: "operator", text, rect: diagnostics.measure(group, origins) };
814
- elements.push(operator);
815
- });
816
- state.elements = elements;
817
- return state;
818
- }
819
- /**
820
- * Get tree chart styles from component style store
821
- */
822
- getTreeStyle() {
823
- return this.componentStyle(($) => {
824
- const baseFontSize = $["global"].fontSizePx;
825
- return {
826
- edgeColor: $["bn-tree"].edgeColor,
827
- edgeWidth: $["bn-tree"].edgeWidth,
828
- operatorCircleRadius: $["bn-tree"].operatorCircleRadius,
829
- operatorFontSize: baseFontSize * $["bn-tree"].operatorFontSizeScale,
830
- operatorColor: $["bn-tree"].operatorColor,
831
- };
832
- });
833
- }
834
- componentWillLoad() {
835
- this.validateEdgesProp(this.edges);
836
- this.validateDirection(this.direction);
837
- this.validateLevelSpacing(this.levelSpacing);
838
- this.validateNodeSpacing(this.nodeSpacing);
839
- this.validateEdgeStyle(this.edgeStyle);
840
- this.validateShowOperators(this.showOperators);
841
- }
842
- componentDidLoad() {
843
- this.setupResizeObserver();
844
- // Defer DOM measurement to after the browser has completed layout.
845
- // getBoundingClientRect() can return zeros if called before first paint.
846
- requestAnimationFrame(() => {
847
- this.updateNodeRects();
848
- });
849
- }
850
- disconnectedCallback() {
851
- if (this.resizeObserver) {
852
- this.resizeObserver.disconnect();
853
- this.resizeObserver = null;
854
- }
855
- }
856
- setupResizeObserver() {
857
- var _a;
858
- this.gridContainer = (_a = this.element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".tree-grid");
859
- if (!this.gridContainer) {
860
- return;
861
- }
862
- this.resizeObserver = new ResizeObserver(() => {
863
- this.updateNodeRects();
864
- });
865
- // Observe the grid container
866
- this.resizeObserver.observe(this.gridContainer);
867
- // Observe all slotted elements
868
- const slots = this.element.querySelectorAll("[slot]");
869
- slots.forEach((slot) => {
870
- this.resizeObserver.observe(slot);
871
- });
872
- }
873
- recalculateLayout() {
874
- if (!this.treeConfig) {
875
- this.layout = null;
876
- return;
877
- }
878
- this.layout = calculateLayout(this.treeConfig, this.direction, this.levelSpacing, this.nodeSpacing);
879
- }
880
- updateNodeRects() {
881
- if (!this.treeConfig || !this.gridContainer) {
882
- return;
883
- }
884
- const containerRect = this.gridContainer.getBoundingClientRect();
885
- const newRects = new Map();
886
- for (const nodeId of this.treeConfig.allNodes) {
887
- const slotElement = this.element.querySelector(`[slot="${nodeId}"]`);
888
- if (slotElement) {
889
- newRects.set(nodeId, getNodeRect(slotElement, containerRect));
890
- }
891
- }
892
- this.nodeRects = newRects;
893
- this.svgWidth = containerRect.width;
894
- this.svgHeight = containerRect.height;
895
- }
896
- getSlotStyle(nodeId) {
897
- if (!this.layout) {
898
- return {};
899
- }
900
- const position = this.layout.positions.get(nodeId);
901
- if (!position) {
902
- return {};
903
- }
904
- const isHorizontal = this.direction === "ltr" || this.direction === "rtl";
905
- if (isHorizontal) {
906
- return {
907
- "grid-column": String(getActualGridColumn(position.gridColumn)),
908
- "grid-row": `${getActualGridRow(position.gridRow)} / span ${getActualGridRowSpan(position.gridRowSpan)}`,
909
- "align-self": "center",
910
- };
911
- }
912
- else {
913
- return {
914
- "grid-row": String(getActualGridRow(position.gridRow)),
915
- "grid-column": String(getActualGridColumn(position.gridColumn)),
916
- "justify-self": "center",
917
- };
918
- }
919
- }
920
- renderEdges() {
921
- var _a;
922
- if (!this.treeConfig || this.nodeRects.size === 0) {
923
- return null;
924
- }
925
- const treeStyle = this.getTreeStyle();
926
- const paths = [];
927
- const operators = [];
928
- // Build a map of child -> list of parents (to detect nodes with multiple parents)
929
- const childToParents = new Map();
930
- for (const edge of this.treeConfig.edges) {
931
- const parents = childToParents.get(edge.to) || [];
932
- parents.push(edge.from);
933
- childToParents.set(edge.to, parents);
934
- }
935
- // Render edges connecting parents to children
936
- for (const edge of this.treeConfig.edges) {
937
- const fromRect = this.nodeRects.get(edge.from);
938
- const toRect = this.nodeRects.get(edge.to);
939
- if (!fromRect || !toRect) {
940
- continue;
941
- }
942
- const start = getConnectionPoint(fromRect, true, this.direction);
943
- // For nodes with multiple parents, use offset connection points
944
- const parents = childToParents.get(edge.to) || [];
945
- let end;
946
- if (parents.length > 1) {
947
- const parentIndex = parents.indexOf(edge.from);
948
- end = getMultiParentConnectionPoint(toRect, this.direction, parentIndex, parents.length);
949
- }
950
- else {
951
- end = getConnectionPoint(toRect, false, this.direction);
952
- }
953
- const { path } = generateEdgePath(start, end, this.edgeStyle, this.direction);
954
- const svgStyle = getEdgeSvgStyle(treeStyle.edgeColor, treeStyle.edgeWidth, edge.style);
955
- paths.push(index.h("path", { key: `edge-${edge.from}-${edge.to}`, d: path, fill: "none", stroke: svgStyle.stroke, "stroke-width": svgStyle.strokeWidth, "stroke-dasharray": svgStyle.strokeDasharray }));
956
- }
957
- // Render operators between siblings
958
- if (this.showOperators === "true") {
959
- for (const [parent, children] of this.treeConfig.adjacencyList.entries()) {
960
- const parentRect = this.nodeRects.get(parent);
961
- if (!parentRect) {
962
- continue;
963
- }
964
- for (let i = 0; i < children.length - 1; i++) {
965
- const child = children[i];
966
- const nextChild = children[i + 1];
967
- const edge = getEdgeForChild(this.treeConfig.edges, parent, child);
968
- if (!(edge === null || edge === void 0 ? void 0 : edge.operator) || edge.operator === "none") {
969
- continue;
970
- }
971
- const childRect = this.nodeRects.get(child);
972
- const nextChildRect = this.nodeRects.get(nextChild);
973
- if (!childRect || !nextChildRect) {
974
- continue;
975
- }
976
- const operatorSymbol = (_a = edge.label) !== null && _a !== void 0 ? _a : getOperatorSymbol(edge.operator);
977
- const position = calculateOperatorPosition(parentRect, childRect, nextChildRect, this.direction);
978
- operators.push(index.h("g", { key: `operator-${parent}-${child}`, class: "operator-group" }, index.h("circle", { cx: position.x, cy: position.y, r: treeStyle.operatorCircleRadius, fill: "white", stroke: treeStyle.edgeColor, "stroke-width": treeStyle.edgeWidth }), index.h("text", { x: position.x, y: position.y, "text-anchor": "middle", "dominant-baseline": "central", style: {
979
- fontSize: `${treeStyle.operatorFontSize}px`,
980
- fill: treeStyle.operatorColor,
981
- fontWeight: "bold",
982
- } }, operatorSymbol)));
983
- }
984
- }
985
- }
986
- return (index.h("svg", { class: "edge-layer", width: this.svgWidth, height: this.svgHeight, style: { position: "absolute", top: "0", left: "0", pointerEvents: "none" } }, paths, operators));
987
- }
988
- renderSlots() {
989
- if (!this.treeConfig || !this.layout) {
990
- return null;
991
- }
992
- return Array.from(this.treeConfig.allNodes).map((nodeId) => (index.h("div", { key: nodeId, class: "tree-node", style: this.getSlotStyle(nodeId) }, index.h("slot", { name: nodeId }))));
993
- }
994
- getFontStyles() {
995
- return this.componentStyle(($) => {
996
- var _a, _b, _c, _d;
997
- return ({
998
- "--bn-font-family": ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontFamily"]) || "'Noto Sans', sans-serif",
999
- "--bn-font-size": `${((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontSizePx"]) || 13.3333}px`,
1000
- "--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
1001
- "--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
1002
- });
1003
- });
1004
- }
1005
- render() {
1006
- const fontStyles = this.getFontStyles();
1007
- if (!this.treeConfig || !this.layout) {
1008
- return (index.h(index.Host, { style: fontStyles }, index.h("div", { class: "tree-container tree-error" }, index.h("slot", null))));
1009
- }
1010
- const gridStyle = {
1011
- display: "grid",
1012
- "grid-template-columns": this.layout.gridTemplateColumns,
1013
- "grid-template-rows": this.layout.gridTemplateRows,
1014
- position: "relative",
1015
- };
1016
- return (index.h(index.Host, { style: fontStyles }, index.h("div", { class: "tree-container" }, index.h("div", { class: "tree-grid", style: gridStyle }, this.renderEdges(), this.renderSlots()))));
1017
- }
1018
- get element() { return index.getElement(this); }
1019
- static get watchers() { return {
1020
- "edges": [{
1021
- "validateEdgesProp": 0
1022
- }],
1023
- "direction": [{
1024
- "validateDirection": 0
1025
- }],
1026
- "levelSpacing": [{
1027
- "validateLevelSpacing": 0
1028
- }],
1029
- "nodeSpacing": [{
1030
- "validateNodeSpacing": 0
1031
- }],
1032
- "edgeStyle": [{
1033
- "validateEdgeStyle": 0
1034
- }],
1035
- "showOperators": [{
1036
- "validateShowOperators": 0
1037
- }]
1038
- }; }
1039
- };
1040
- ChartTree.style = bnTreeCss();
1041
-
1042
- exports.bn_tree = ChartTree;