@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,20 +1,21 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import withBodyObserver from "../../utils/withBodyObserver";
3
- import { getStores } from "../../context/context-protocol";
3
+ import { getStores, clearStoresCache } from "../../context/context-protocol";
4
4
  import withComponentStatus from "../../utils/withComponentStatus";
5
5
  import withHasError from "../../utils/withHasError";
6
6
  import { computeContentHash, decodeCompressedContent } from "../../utils/contentDecoder";
7
+ import { errorText } from "../../utils/queryError";
7
8
  /**
8
9
  * Ingests data and writes it to the scoped `datasources` store.
9
10
  *
10
11
  * Data can be provided in three ways:
11
- * 1. **Inline JSON** — Place JSON text inside the element body (default).
12
- * 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
13
- * 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
14
- * starting with `/` in the body to fetch JSON from an HTTP endpoint.
12
+ * 1. **Inline JSON** - Place JSON text inside the element body (default).
13
+ * 2. **Compressed payload** - Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
14
+ * 3. **URL** - Set the `src` attribute to fetch JSON from an HTTP endpoint.
15
+ * Set the `interval` prop (in seconds) to enable periodic re-fetching
16
+ * (polling).
15
17
  *
16
- * In URL mode the component fetches JSON from the URL. Set the `interval`
17
- * prop (in seconds) to enable periodic re-fetching (polling).
18
+ * The body is always inline data and is ignored while `src` is set.
18
19
  *
19
20
  * Other components (e.g. `bn-dataset`) reference the stored data by the
20
21
  * `name` prop to run queries against it.
@@ -24,68 +25,112 @@ export class Datasource {
24
25
  /**
25
26
  * When true (default), body content is plain JSON text.
26
27
  * When false, body content is a compressed payload (`<hash>:<base64_gzip>`).
27
- * Ignored in URL mode.
28
+ * Ignored when `src` is set.
28
29
  */
29
30
  this.raw = true;
30
31
  /**
31
- * Polling interval in **seconds** for URL mode.
32
- * When set and the body content is a URL, the component re-fetches
33
- * data at this interval. Has no effect for inline JSON or compressed content.
32
+ * Polling interval in **seconds** for `src`.
33
+ * When set together with `src`, the component re-fetches data at this
34
+ * interval. Has no effect for inline JSON or compressed content.
34
35
  * Set to `0` or leave unset to disable polling.
35
36
  */
36
37
  this.interval = 0;
37
38
  this.lastHash = null;
39
+ this.nameShared = false;
38
40
  /** The currently active URL (`null` when in inline-JSON mode). */
39
41
  this.currentUrl = null;
40
42
  /** Timer ID for the polling interval. */
41
43
  this.pollTimerId = null;
42
44
  /** AbortController for cancelling in-flight fetch requests. */
43
45
  this.abortController = null;
44
- withComponentStatus(this);
46
+ /** True until the first request for the current `src` has delivered. A poll tick is skipped meanwhile: it would cancel that request and release readiness with no data. */
47
+ this.firstLoadPending = false;
48
+ /** Two producers of one name overwrite each other's data. Both report it. */
49
+ this.onNameShared = (shared) => {
50
+ const wasShared = this.nameShared;
51
+ this.nameShared = shared;
52
+ if (shared) {
53
+ this.errors.addOrReplace({
54
+ id: "ERR_name",
55
+ type: "error",
56
+ message: `name: "${this.name}" is used by more than one dataset or datasource.`,
57
+ });
58
+ }
59
+ else {
60
+ this.errors.remove("ERR_name");
61
+ // the other producer may have written the name last: load the own data again
62
+ if (wasShared)
63
+ this.reload();
64
+ }
65
+ };
66
+ this.holdStatus = withComponentStatus(this);
45
67
  this.errors = withHasError(this);
46
- withBodyObserver(this, (data) => {
47
- if (!this.stores)
48
- this.stores = getStores(this.element);
49
- const trimmed = data.trim();
50
- // --- URL mode ---
51
- if (this.isUrl(trimmed)) {
52
- if (trimmed === this.currentUrl)
53
- return;
54
- this.currentUrl = trimmed;
55
- this.lastHash = null;
56
- this.fetchAndStore(trimmed);
57
- this.startPolling();
68
+ withBodyObserver(this, (data) => this.sync(data));
69
+ }
70
+ /** Loads from `src` when it is set, otherwise from the inline body. */
71
+ sync(data) {
72
+ var _a;
73
+ // a re-attached element may sit in another bn-context
74
+ this.stores = getStores(this.element);
75
+ if (!this.releaseName && this.name)
76
+ this.releaseName = this.stores.db.claim(this.name, this.onNameShared);
77
+ // --- URL mode ---
78
+ if (this.src) {
79
+ if (this.src === this.currentUrl)
58
80
  return;
81
+ this.currentUrl = this.src;
82
+ this.lastHash = null;
83
+ this.errors.remove("ERR_body");
84
+ this.firstLoadPending = true;
85
+ this.holdStatus(this.fetchAndStore(this.src));
86
+ this.startPolling();
87
+ return;
88
+ }
89
+ // --- Leaving URL mode → clean up ---
90
+ if (this.currentUrl !== null) {
91
+ this.cancelInFlight();
92
+ this.currentUrl = null;
93
+ }
94
+ // --- Inline JSON / compressed mode ---
95
+ this.errors.remove("ERR_src");
96
+ try {
97
+ let contentHash;
98
+ let jsonString;
99
+ if (this.raw || data.trim() === "") {
100
+ contentHash = computeContentHash(data);
101
+ jsonString = data;
59
102
  }
60
- // --- Leaving URL mode → clean up ---
61
- if (this.currentUrl !== null) {
62
- this.cancelInFlight();
63
- this.currentUrl = null;
103
+ else {
104
+ const decoded = decodeCompressedContent(data);
105
+ contentHash = decoded.hash;
106
+ jsonString = decoded.json;
64
107
  }
65
- // --- Inline JSON / compressed mode ---
66
- try {
67
- let contentHash;
68
- let jsonString;
69
- if (this.raw) {
70
- contentHash = computeContentHash(data);
71
- jsonString = data;
72
- }
73
- else {
74
- const decoded = decodeCompressedContent(data);
75
- contentHash = decoded.hash;
76
- jsonString = decoded.json;
77
- }
78
- if (contentHash === this.lastHash)
79
- return;
80
- this.lastHash = contentHash;
81
- const json = JSON.parse(jsonString);
82
- this.publish(json);
108
+ if (contentHash === this.lastHash)
109
+ return;
110
+ this.lastHash = contentHash;
111
+ // an empty body is "no data given", not a failure. The JSON value null is a list without rows.
112
+ const json = jsonString.trim() === "" ? [] : ((_a = JSON.parse(jsonString)) !== null && _a !== void 0 ? _a : []);
113
+ if (Array.isArray(json)) {
114
+ this.errors.remove("ERR_body");
83
115
  }
84
- catch (e) {
85
- console.error("Error parsing datasource", e, String(data).slice(0, 200));
86
- this.publish([]);
116
+ else {
117
+ this.errors.addOrReplace({ id: "ERR_body", type: "error", message: "Body: not a JSON array." });
87
118
  }
88
- });
119
+ this.publish(json);
120
+ }
121
+ catch (e) {
122
+ // the body that was loaded before must be read again when it comes back
123
+ this.lastHash = null;
124
+ this.errors.addOrReplace({ id: "ERR_body", type: "error", message: `Body: ${errorText(e)}` });
125
+ this.publish([]);
126
+ }
127
+ }
128
+ /** Forgets what was loaded and loads again from `src` or the body. */
129
+ reload() {
130
+ var _a;
131
+ this.lastHash = null;
132
+ this.currentUrl = null;
133
+ this.sync((_a = this.element.textContent) !== null && _a !== void 0 ? _a : "");
89
134
  }
90
135
  /**
91
136
  * Writes the parsed data into the shared alasql database (as a table named
@@ -94,6 +139,7 @@ export class Datasource {
94
139
  publish(json) {
95
140
  const db = this.stores.db.db;
96
141
  db.tables[this.name] = { data: Array.isArray(json) ? json : [] };
142
+ this.registered = db.tables[this.name];
97
143
  this.stores.db.notify(this.name);
98
144
  }
99
145
  onIntervalChange() {
@@ -101,53 +147,74 @@ export class Datasource {
101
147
  this.startPolling();
102
148
  }
103
149
  }
150
+ onSrcChange() {
151
+ var _a;
152
+ // a detached element must not fetch or poll; the body callback reads src again on connect
153
+ if (this.element.isConnected)
154
+ this.sync((_a = this.element.textContent) !== null && _a !== void 0 ? _a : "");
155
+ }
156
+ nameUpdated(_name, oldName) {
157
+ var _a;
158
+ this.unregister(oldName);
159
+ if (this.name && this.element.isConnected)
160
+ this.sync((_a = this.element.textContent) !== null && _a !== void 0 ? _a : "");
161
+ }
104
162
  disconnectedCallback() {
105
- var _a, _b;
106
163
  this.cancelInFlight();
107
- const db = (_b = (_a = this.stores) === null || _a === void 0 ? void 0 : _a.db) === null || _b === void 0 ? void 0 : _b.db;
108
- if (db && this.name) {
109
- if (db.tables[this.name] != null) {
110
- delete db.tables[this.name];
164
+ this.unregister(this.name);
165
+ clearStoresCache(this.element);
166
+ }
167
+ /** Drops the table registered under `name` and forgets the loaded state, so the next sync loads again. */
168
+ unregister(name) {
169
+ var _a, _b, _c;
170
+ (_a = this.releaseName) === null || _a === void 0 ? void 0 : _a.call(this);
171
+ this.releaseName = undefined;
172
+ this.lastHash = null;
173
+ this.currentUrl = null;
174
+ const db = (_c = (_b = this.stores) === null || _b === void 0 ? void 0 : _b.db) === null || _c === void 0 ? void 0 : _c.db;
175
+ // another element may have taken the name since: its table and consumers stay untouched
176
+ const taken = (db === null || db === void 0 ? void 0 : db.tables[name]) != null && db.tables[name] !== this.registered;
177
+ this.registered = undefined;
178
+ if (db && name && !taken) {
179
+ if (db.tables[name] != null) {
180
+ delete db.tables[name];
111
181
  }
112
182
  // @ts-ignore - views typing is loose
113
- if (db.views && db.views[this.name] != null) {
183
+ if (db.views && db.views[name] != null) {
114
184
  // @ts-ignore
115
- delete db.views[this.name];
185
+ delete db.views[name];
116
186
  }
117
- this.stores.db.notify(this.name);
187
+ this.stores.db.notify(name);
118
188
  }
119
189
  }
120
- /**
121
- * Returns `true` if the text is a fetchable URL: an absolute `http(s)://`
122
- * URL, or a same-origin path starting with `/` (but not `//`, which is a
123
- * protocol-relative URL we treat as inline-mode escape).
124
- */
125
- isUrl(text) {
126
- if (text.startsWith("http://") || text.startsWith("https://"))
127
- return true;
128
- return text.startsWith("/") && !text.startsWith("//");
129
- }
130
190
  /**
131
191
  * Fetches JSON from the given URL and stores the result.
132
192
  * Cancels any in-flight request before starting a new one.
133
193
  */
134
194
  async fetchAndStore(url) {
135
- var _a;
195
+ var _a, _b;
136
196
  (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
137
197
  this.abortController = new AbortController();
138
198
  if (!this.stores)
139
199
  this.stores = getStores(this.element);
140
200
  try {
141
201
  const response = await fetch(url, { signal: this.abortController.signal });
142
- const json = await response.json();
202
+ if (!response.ok)
203
+ throw new Error(`HTTP ${response.status}`);
204
+ // the JSON value null is a response without rows
205
+ const json = (_b = (await response.json())) !== null && _b !== void 0 ? _b : [];
206
+ if (!Array.isArray(json))
207
+ throw new Error("not a JSON array.");
208
+ this.errors.remove("ERR_src");
143
209
  this.publish(json);
144
210
  }
145
211
  catch (e) {
146
212
  if (e instanceof DOMException && e.name === "AbortError")
147
213
  return;
148
- console.error("bn-datasource: error fetching URL", e, url);
214
+ this.errors.addOrReplace({ id: "ERR_src", type: "error", message: `src: ${errorText(e)}` });
149
215
  this.publish([]);
150
216
  }
217
+ this.firstLoadPending = false;
151
218
  }
152
219
  /** Stops the polling timer (does NOT touch any in-flight fetch). */
153
220
  clearPollTimer() {
@@ -157,7 +224,7 @@ export class Datasource {
157
224
  }
158
225
  }
159
226
  /** Stops the polling timer AND cancels any in-flight fetch. Use only when
160
- * leaving URL mode entirely (disconnect or body changed to inline). */
227
+ * leaving URL mode entirely (disconnect or `src` removed). */
161
228
  cancelInFlight() {
162
229
  var _a;
163
230
  this.clearPollTimer();
@@ -165,20 +232,20 @@ export class Datasource {
165
232
  this.abortController = null;
166
233
  }
167
234
  /** Starts (or restarts) the polling timer if in URL mode with a positive
168
- * interval. Does NOT abort the kick-off fetch issued by the caller — it
235
+ * interval. Does NOT abort the kick-off fetch issued by the caller - it
169
236
  * only resets the interval timer. */
170
237
  startPolling() {
171
238
  this.clearPollTimer();
172
239
  if (this.currentUrl && this.interval > 0) {
173
240
  this.pollTimerId = setInterval(() => {
174
- if (this.currentUrl) {
241
+ if (this.currentUrl && !this.firstLoadPending) {
175
242
  this.fetchAndStore(this.currentUrl);
176
243
  }
177
244
  }, this.interval * 1000);
178
245
  }
179
246
  }
180
247
  render() {
181
- return h(Host, { key: '4beaa62937dea949255669bfd5008a2928e460fc' });
248
+ return h(Host, { key: '4e164358c873601f39332f5d35d14a1ad5f66f73' });
182
249
  }
183
250
  static get is() { return "bn-datasource"; }
184
251
  static get originalStyleUrls() {
@@ -224,7 +291,7 @@ export class Datasource {
224
291
  "optional": false,
225
292
  "docs": {
226
293
  "tags": [],
227
- "text": "When true (default), body content is plain JSON text.\nWhen false, body content is a compressed payload (`<hash>:<base64_gzip>`).\nIgnored in URL mode."
294
+ "text": "When true (default), body content is plain JSON text.\nWhen false, body content is a compressed payload (`<hash>:<base64_gzip>`).\nIgnored when `src` is set."
228
295
  },
229
296
  "getter": false,
230
297
  "setter": false,
@@ -244,13 +311,32 @@ export class Datasource {
244
311
  "optional": false,
245
312
  "docs": {
246
313
  "tags": [],
247
- "text": "Polling interval in **seconds** for URL mode.\nWhen set and the body content is a URL, the component re-fetches\ndata at this interval. Has no effect for inline JSON or compressed content.\nSet to `0` or leave unset to disable polling."
314
+ "text": "Polling interval in **seconds** for `src`.\nWhen set together with `src`, the component re-fetches data at this\ninterval. Has no effect for inline JSON or compressed content.\nSet to `0` or leave unset to disable polling."
248
315
  },
249
316
  "getter": false,
250
317
  "setter": false,
251
318
  "reflect": false,
252
319
  "attribute": "interval",
253
320
  "defaultValue": "0"
321
+ },
322
+ "src": {
323
+ "type": "string",
324
+ "mutable": false,
325
+ "complexType": {
326
+ "original": "string",
327
+ "resolved": "string",
328
+ "references": {}
329
+ },
330
+ "required": false,
331
+ "optional": true,
332
+ "docs": {
333
+ "tags": [],
334
+ "text": "URL to fetch the JSON from. When set, the body is ignored."
335
+ },
336
+ "getter": false,
337
+ "setter": false,
338
+ "reflect": false,
339
+ "attribute": "src"
254
340
  }
255
341
  };
256
342
  }
@@ -259,6 +345,12 @@ export class Datasource {
259
345
  return [{
260
346
  "propName": "interval",
261
347
  "methodName": "onIntervalChange"
348
+ }, {
349
+ "propName": "src",
350
+ "methodName": "onSrcChange"
351
+ }, {
352
+ "propName": "name",
353
+ "methodName": "nameUpdated"
262
354
  }];
263
355
  }
264
356
  }
@@ -5,7 +5,7 @@ import withHasError from "../../utils/withHasError";
5
5
  export class Footer {
6
6
  constructor() {
7
7
  /**
8
- * Pagenumber value.
8
+ * Page label: a number or any text, e.g. `3` or `A-1`.
9
9
  * Is displayed if displayPageNumber == true
10
10
  */
11
11
  this.pageNumber = null;
@@ -45,7 +45,7 @@ export class Footer {
45
45
  return `./assets/${imgUrl}.png`;
46
46
  }
47
47
  render() {
48
- return (h(Host, { key: '666fa787056f32825c15427f2a6c15b971fbc25e', id: this.displayPageNumber || this.text || this.code ? "container-page-footer" : "container", style: this.getFontStyles() }, h("div", { key: '691752d51748c4e1eb7ec25d380c00ddf0095c83', id: "footer-text" }, this.text != null ? h("span", { class: "note" }, this.text) : ""), h("div", { key: '561a81e063e110ef6386fb0056a05f1b6a0e0f44', id: "code" }, this.code != null ? h("img", { class: "image", src: getAssetPath(`${this.prepareAssetUrl(this.code)}`) }) : ""), h("div", { key: '963658fcff1a6dd07b448f85e8d170000422e3cc', id: "page-number" }, this.displayPageNumber ? h("span", { class: "page" }, this.pageNumber) : "")));
48
+ return (h(Host, { key: '8751cf4e338d54605350f06743956689eb4286ce', id: this.displayPageNumber || this.text || this.code ? "container-page-footer" : "container", style: this.getFontStyles() }, h("div", { key: '7a9fb20453df0db4755d90c00043fff4c262eda2', id: "footer-text" }, this.text != null ? h("span", { class: "note" }, this.text) : ""), h("div", { key: '7ef166a4d0d48b1fb5cceb7e79ca678c4c4e0d63', id: "code" }, this.code != null ? h("img", { class: "image", src: getAssetPath(`${this.prepareAssetUrl(this.code)}`) }) : ""), h("div", { key: 'bf74b278f43540612327e03539278f7fa35996f1', id: "page-number" }, this.displayPageNumber ? h("span", { class: "page" }, this.pageNumber) : "")));
49
49
  }
50
50
  static get is() { return "bn-footer"; }
51
51
  static get encapsulation() { return "shadow"; }
@@ -63,18 +63,18 @@ export class Footer {
63
63
  static get properties() {
64
64
  return {
65
65
  "pageNumber": {
66
- "type": "number",
66
+ "type": "string",
67
67
  "mutable": true,
68
68
  "complexType": {
69
- "original": "number | null",
70
- "resolved": "number",
69
+ "original": "string | null",
70
+ "resolved": "string",
71
71
  "references": {}
72
72
  },
73
73
  "required": false,
74
74
  "optional": false,
75
75
  "docs": {
76
76
  "tags": [],
77
- "text": "Pagenumber value.\nIs displayed if displayPageNumber == true"
77
+ "text": "Page label: a number or any text, e.g. `3` or `A-1`.\nIs displayed if displayPageNumber == true"
78
78
  },
79
79
  "getter": false,
80
80
  "setter": false,
@@ -2,6 +2,7 @@ import { h, Host } from "@stencil/core";
2
2
  import withBodyObserver from "../../utils/withBodyObserver";
3
3
  import { getStores } from "../../context/context-protocol";
4
4
  import flattenObject from "../../utils/flattenObject";
5
+ import { errorText } from "../../utils/queryError";
5
6
  import withComponentStatus from "../../utils/withComponentStatus";
6
7
  import withHasError from "../../utils/withHasError";
7
8
  export class Internationalization {
@@ -12,22 +13,32 @@ export class Internationalization {
12
13
  withBodyObserver(this, (data) => {
13
14
  if (!this.stores)
14
15
  this.stores = getStores(this.element);
16
+ // an empty body is "nothing to add", not a failure
17
+ if (data.trim() === "") {
18
+ this.errors.remove("ERR_body");
19
+ return;
20
+ }
15
21
  try {
16
- const i18n = flattenObject(JSON.parse(data));
22
+ const parsed = JSON.parse(data);
23
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
24
+ throw new Error("not a JSON object.");
25
+ }
26
+ const i18n = flattenObject(parsed);
17
27
  const ns = this.namespace || "_system";
18
28
  const namespace = Object.assign({}, this.stores.internationalization.get(ns));
19
29
  // Merge over the existing bundle (built-ins or earlier manifests) so
20
30
  // partial overrides don't wipe unrelated keys.
21
31
  namespace[this.code] = Object.assign(Object.assign({}, namespace[this.code]), i18n);
22
32
  this.stores.internationalization.set(ns, namespace);
33
+ this.errors.remove("ERR_body");
23
34
  }
24
35
  catch (e) {
25
- console.error(e);
36
+ this.errors.addOrReplace({ id: "ERR_body", type: "error", message: `Body: ${errorText(e)}` });
26
37
  }
27
38
  });
28
39
  }
29
40
  render() {
30
- return h(Host, { key: '1b5e46fd06494aada4db697402746be6bcf950db' });
41
+ return h(Host, { key: '9b45d8f87b99238f5a83d9a3c231d10de8e53acf' });
31
42
  }
32
43
  static get is() { return "bn-internationalization"; }
33
44
  static get originalStyleUrls() {
@@ -1,7 +1,9 @@
1
1
  import { h, Fragment } from "@stencil/core";
2
2
  import { getStores } from "../../context/context-protocol";
3
+ import withComponentStatus from "../../utils/withComponentStatus";
3
4
  import withHasError from "../../utils/withHasError";
4
5
  import withInheritedProps from "../../utils/withInheritedProps";
6
+ import { CUSTOM_TEMPLATE, templateAreas, templateColumns, templateProblem, templateRows, templateSlotNames, } from "../../utils/layoutTemplate";
5
7
  export class LayoutCard {
6
8
  constructor() {
7
9
  /**
@@ -114,20 +116,7 @@ export class LayoutCard {
114
116
  * Whether to display a visible border around the card.
115
117
  */
116
118
  this.cardShowBorder = true;
117
- this.templateMap = new Map([
118
- ["split-vertical", '"a b"'],
119
- ["split-horizontal", '"a" "b"'],
120
- ["2x2", '"a b" "c d"'],
121
- ["3x3", '"a b c" "d e f" "g h i"'],
122
- ["4x4", '"a b c d" "e f g h" "i j k l" "m n o p"'],
123
- ["1-over-2", '"a a" "b c"'],
124
- ["2-over-1", '"a b" "c c"'],
125
- ["1-over-3", '"a a a " "b c d"'],
126
- ["3-over-1", '"a b c" "d d d"'],
127
- ["custom-template", '"a b" "c c c"'],
128
- ["gold3", '"a c" "b c"'],
129
- ["gold4", '"a b c c" "d d c c"'],
130
- ]);
119
+ withComponentStatus(this);
131
120
  this.errors = withHasError(this);
132
121
  this.resolveInherited = withInheritedProps(this, [
133
122
  { propName: "titleScenarios", ancestorAttr: "title-scenarios" },
@@ -139,16 +128,13 @@ export class LayoutCard {
139
128
  }
140
129
  connectedCallback() {
141
130
  this.stores = getStores(this.element);
142
- // Reflect resolved inherited values to host attributes so child vis
143
- // components can read them during their own DOM traversal.
144
- this.reflectInheritedAttrs();
145
131
  }
146
132
  getCommonStyles() {
147
133
  let height = "100%";
148
134
  if (this.cardFitToContent === true) {
149
135
  height = "fit-content";
150
136
  }
151
- // Width is always 100% — the card is bounded by its parent grid cell.
137
+ // Width is always 100% - the card is bounded by its parent grid cell.
152
138
  // Using fit-content for width creates a circular dependency where the
153
139
  // card width depends on child content but children need the card width
154
140
  // for auto-scaling.
@@ -159,26 +145,11 @@ export class LayoutCard {
159
145
  gap: this.cardGridGap + "px",
160
146
  };
161
147
  }
162
- calculateFractions(input) {
163
- const items = input.trim().split(/\s+/);
164
- const count = items.length;
165
- if (count === 0)
166
- return "minmax(0, 1fr)";
167
- return Array(count).fill("minmax(0, 1fr)").join(" ");
168
- }
169
148
  getGridTemplateColumns(name) {
170
- const template = this.getTemplatePattern(name);
171
- const pattern = /"[\w\d\s.]+"/g;
172
- const matches = template.match(pattern);
173
- if (!matches || matches.length === 0)
174
- return "minmax(0, 1fr)";
175
- return this.calculateFractions(matches[0]);
149
+ return templateColumns(this.getTemplatePattern(name));
176
150
  }
177
151
  getRowCount(name) {
178
- const template = this.getTemplatePattern(name);
179
- const pattern = /"[\w\d\s.]+"/g;
180
- const matches = template.match(pattern);
181
- return matches ? matches.length : 1;
152
+ return templateRows(this.getTemplatePattern(name)).length || 1;
182
153
  }
183
154
  getGridTemplateRows(name) {
184
155
  const rowCount = this.getRowCount(name);
@@ -207,30 +178,27 @@ export class LayoutCard {
207
178
  })));
208
179
  }
209
180
  extractSlotNames(styleElement) {
210
- if (styleElement == null) {
211
- return [];
212
- }
213
- const words = styleElement.match(/\b\w+\b/g);
214
- if (!words) {
215
- return [];
216
- }
217
- return Array.from(new Set(words));
181
+ return templateSlotNames(styleElement);
218
182
  }
219
183
  getTemplatePattern(name) {
220
- if (this.templateMap.has(name) === false && name !== "custom-template") {
221
- return '"a"';
222
- }
223
- if (name === "custom-template") {
224
- return this.cardCustomTemplate;
225
- }
226
- return this.templateMap.get(name);
184
+ return templateAreas(name, this.cardCustomTemplate);
227
185
  }
228
186
  async getNumberOfSlot(name) {
229
187
  const template = this.getTemplatePattern(name);
230
188
  return this.extractSlotNames(template).length;
231
189
  }
232
- componentDidUpdate() {
233
- // workaround for the render rotation issue
190
+ componentWillRender() {
191
+ const problem = this.cardLayout === CUSTOM_TEMPLATE ? templateProblem(this.cardCustomTemplate) : undefined;
192
+ if (problem) {
193
+ this.errors.addOrReplace({
194
+ id: "ERR_cardCustomTemplate",
195
+ type: "warning",
196
+ message: `cardCustomTemplate: ${problem}`,
197
+ });
198
+ }
199
+ else {
200
+ this.errors.remove("ERR_cardCustomTemplate");
201
+ }
234
202
  }
235
203
  setCardClass() {
236
204
  if (this.cardShowBorder === true) {
@@ -238,26 +206,9 @@ export class LayoutCard {
238
206
  }
239
207
  return "card_box";
240
208
  }
241
- /**
242
- * When the card itself inherits a title prop from a page, write the
243
- * resolved value back to the host element's attribute so that child
244
- * vis components (bn-table, bn-chart-*) performing their own DOM walk
245
- * read the actual value instead of the literal "inherited-page" keyword.
246
- */
247
- reflectInheritedAttrs() {
248
- const mappings = [
249
- { prop: "titleScenarios", attr: "title-scenarios" },
250
- { prop: "titleVariances", attr: "title-variances" },
251
- { prop: "titleOrder", attr: "title-order" },
252
- { prop: "titleOrderDirection", attr: "title-order-direction" },
253
- { prop: "ruleset", attr: "ruleset" },
254
- ];
255
- for (const { prop, attr } of mappings) {
256
- const resolved = this.resolveInherited(prop, this[prop]);
257
- if (resolved !== undefined) {
258
- this.element.setAttribute(attr, resolved);
259
- }
260
- }
209
+ /** The value of a prop for the inner title. An unresolved keyword reaches it as blank. */
210
+ titleProp(prop) {
211
+ return this.resolveInherited(prop, this[prop], "").value;
261
212
  }
262
213
  prepareTitleImage(value) {
263
214
  if (value == null || value === "") {
@@ -271,10 +222,10 @@ export class LayoutCard {
271
222
  return assetsState[value] || value;
272
223
  }
273
224
  render() {
274
- var _a, _b, _c, _d, _e, _f;
225
+ var _a;
275
226
  const style = this.getLayoutStyle();
276
227
  const arrOfSlots = this.extractSlotNames(style["grid-template-areas"]);
277
- return (h("bn-card", { key: '2aa7bd3e3beb1a6b6b0dc0b06c7d7eda324299a0', styles: this.styles, "selected-style": this.selectedStyle, class: this.setCardClass() }, h("div", { key: '65fe54ff342691b7f2b7df747af88499ffdbebc0', class: "cardtitle" }, h("bn-title", { key: 'be70a8c4e5cef0be0fb264fe74dc3732c2a42939', "i18n-namespace": (_a = this.i18nNamespace) !== null && _a !== void 0 ? _a : this.titleNamespace, ruleset: (_b = this.resolveInherited("ruleset", this.ruleset)) !== null && _b !== void 0 ? _b : this.ruleset, "business-unit": this.titleBusinessUnit, scenarios: (_c = this.resolveInherited("titleScenarios", this.titleScenarios)) !== null && _c !== void 0 ? _c : this.titleScenarios, variances: (_d = this.resolveInherited("titleVariances", this.titleVariances)) !== null && _d !== void 0 ? _d : this.titleVariances, order: (_e = this.resolveInherited("titleOrder", this.titleOrder)) !== null && _e !== void 0 ? _e : this.titleOrder, "order-direction": (_f = this.resolveInherited("titleOrderDirection", this.titleOrderDirection)) !== null && _f !== void 0 ? _f : this.titleOrderDirection, measures: this.titleMeasures, "date-start": this.titleDateStart, "date-end": this.titleDateEnd, "date-format": this.titleDateFormat, "date-link": this.titleDateLink }), this.titleImage != null && this.titleImage !== "" ? (h("img", { class: "image", src: this.prepareTitleImage(this.titleImage) })) : ("")), h("bn-body", { key: '5875c3e62ca38095588f13907936974259816215' }, h("div", { key: 'c845d5f8c130f2dd0ae48fc4c2301a55842f001a', style: style, "data-bn-fit-content": this.cardFitToContent ? String(this.getRowCount(this.cardLayout)) : null }, this.getSlots(arrOfSlots))), h("bn-footer", { key: '388596894d04dc2f93d6d71b9f8a0348fb46195f', text: this.footerText, "page-number": 0, "display-page-number": "false" })));
228
+ return (h("bn-card", { key: '5356123d5ccb6a4d201b19f27b739d2e3738654c', styles: this.styles, "selected-style": this.selectedStyle, class: this.setCardClass() }, h("div", { key: '2847a91836d59929ce6c14d934ec20f408159b0e', class: "cardtitle" }, h("bn-title", { key: '54a7d3136ef39c616319001bf10575be3de787e6', "i18n-namespace": (_a = this.i18nNamespace) !== null && _a !== void 0 ? _a : this.titleNamespace, ruleset: this.titleProp("ruleset"), "business-unit": this.titleBusinessUnit, scenarios: this.titleProp("titleScenarios"), variances: this.titleProp("titleVariances"), order: this.titleProp("titleOrder"), "order-direction": this.titleProp("titleOrderDirection"), measures: this.titleMeasures, "date-start": this.titleDateStart, "date-end": this.titleDateEnd, "date-format": this.titleDateFormat, "date-link": this.titleDateLink }), this.titleImage != null && this.titleImage !== "" ? (h("img", { class: "image", src: this.prepareTitleImage(this.titleImage) })) : ("")), h("bn-body", { key: '6109186cc1d27c73b38a5fd08db72373e0e147c4' }, h("div", { key: '673e56a5d2a313a968c4d4e52e697f1f8590f265', style: style, "data-bn-fit-content": this.cardFitToContent ? String(this.getRowCount(this.cardLayout)) : null }, this.getSlots(arrOfSlots))), h("bn-footer", { key: 'd7788950df85f3babff77294ccadb6ea72490192', text: this.footerText, "page-number": "0", "display-page-number": "false" })));
278
229
  }
279
230
  static get is() { return "bn-layout-card"; }
280
231
  static get encapsulation() { return "shadow"; }