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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/LICENSE +203 -21
  2. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  3. package/dist/bn-template-engine/p-19bbac66.entry.js +1 -0
  4. package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
  5. package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
  6. package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
  7. package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
  8. package/dist/bn-template-engine/p-74c5a95d.entry.js +1 -0
  9. package/dist/bn-template-engine/p-7bdc0e28.entry.js +1 -0
  10. package/dist/bn-template-engine/p-83c71b16.entry.js +1 -0
  11. package/dist/bn-template-engine/p-90806e7a.entry.js +1 -0
  12. package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
  13. package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
  14. package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
  15. package/dist/bn-template-engine/p-BZV1b5VH.js +1 -0
  16. package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
  17. package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
  18. package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
  19. package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
  20. package/dist/bn-template-engine/p-CiudZRQr.js +1 -0
  21. package/dist/bn-template-engine/p-DTuaq8Pj.js +1 -0
  22. package/dist/bn-template-engine/p-DY7YYmpa.js +1 -0
  23. package/dist/bn-template-engine/p-Dg9OcXAO.js +1 -0
  24. package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
  25. package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
  26. package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
  27. package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
  28. package/dist/bn-template-engine/p-b25455a7.entry.js +1 -0
  29. package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
  30. package/dist/bn-template-engine/p-eca8e2e2.entry.js +1 -0
  31. package/dist/bn-template-engine/p-f9dfd120.entry.js +1 -0
  32. package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
  33. package/dist/cjs/AxisConfig-VnVelfSV.js +233 -0
  34. package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
  35. package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
  36. package/dist/cjs/Order-DobBozQC.js +87 -0
  37. package/dist/cjs/SVGStyle-BQOmGWLX.js +8209 -0
  38. package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
  39. package/dist/cjs/VarianceMeasure-NY9yhiNV.js +372 -0
  40. package/dist/cjs/XYChartDataRow-B7OKrAcC.js +829 -0
  41. package/dist/cjs/bn-asset_21.cjs.entry.js +16047 -0
  42. package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
  43. package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
  44. package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
  45. package/dist/cjs/bn-grid.cjs.entry.js +5 -3
  46. package/dist/cjs/bn-image.cjs.entry.js +5 -3
  47. package/dist/cjs/bn-internationalization.cjs.entry.js +10 -8
  48. package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
  49. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  50. package/dist/cjs/bn-template.cjs.entry.js +1 -1
  51. package/dist/cjs/bn-text.cjs.entry.js +8 -79
  52. package/dist/cjs/bn-tree.cjs.entry.js +4 -2
  53. package/dist/cjs/context-protocol-BDrMkhc4.js +9499 -0
  54. package/dist/cjs/editor-companion.cjs.entry.js +13 -6
  55. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
  56. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
  57. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
  58. package/dist/cjs/layoutObserver-o03YUfn_.js +199 -0
  59. package/dist/cjs/loader.cjs.js +1 -1
  60. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
  61. package/dist/cjs/scaling-DKZyjWj5.js +587 -0
  62. package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
  63. package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
  64. package/dist/cjs/withStyled-CRiC9fzc.js +1137 -0
  65. package/dist/collection/collection-manifest.json +9 -1
  66. package/dist/collection/components/bn-body/bn-body.css +1 -0
  67. package/dist/collection/components/bn-card/bn-card.css +2 -0
  68. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
  69. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
  70. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
  71. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
  72. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
  73. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
  74. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
  75. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
  76. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
  77. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
  78. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
  79. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
  80. package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
  81. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
  82. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
  83. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
  84. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
  85. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
  86. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +125 -42
  87. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +103 -36
  88. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +82 -58
  89. package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
  90. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
  91. package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
  92. package/dist/collection/components/bn-chart-time/bn-chart-time.js +160 -43
  93. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +94 -31
  94. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +132 -74
  95. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
  96. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -4
  97. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
  98. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  99. package/dist/collection/components/bn-context/bn-context.js +1 -1
  100. package/dist/collection/components/bn-dataset/bn-dataset.js +226 -23
  101. package/dist/collection/components/bn-datasource/bn-datasource.js +163 -12
  102. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  103. package/dist/collection/components/bn-grid/bn-grid.js +1 -1
  104. package/dist/collection/components/bn-image/bn-image.js +1 -1
  105. package/dist/collection/components/bn-internationalization/bn-internationalization.js +10 -7
  106. package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -3
  107. package/dist/collection/components/bn-layout-card/bn-layout-card.js +98 -35
  108. package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -3
  109. package/dist/collection/components/bn-layout-page/bn-layout-page.js +98 -25
  110. package/dist/collection/components/bn-message/bn-message.css +6 -2
  111. package/dist/collection/components/bn-message/bn-message.js +3 -2
  112. package/dist/collection/components/bn-page/bn-page.js +1 -1
  113. package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
  114. package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
  115. package/dist/collection/components/bn-scaling-group/bn-scaling-group.css +3 -0
  116. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
  117. package/dist/collection/components/bn-table/bn-table.js +317 -61
  118. package/dist/collection/components/bn-table/ibcs-table.css +8 -0
  119. package/dist/collection/components/bn-table/ibcs-table.js +161 -32
  120. package/dist/collection/components/bn-table/utils/Table.js +72 -28
  121. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
  122. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
  123. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
  124. package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
  125. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +117 -22
  126. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +380 -50
  127. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
  128. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
  129. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
  130. package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
  131. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
  132. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +20 -4
  133. package/dist/collection/components/bn-template/bn-template.js +1 -1
  134. package/dist/collection/components/bn-text/bn-text.js +2 -75
  135. package/dist/collection/components/bn-title/bn-title.js +27 -3
  136. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
  137. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +29 -6
  138. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -0
  139. package/dist/collection/components/editor-companion/editor-companion.js +12 -5
  140. package/dist/collection/context/scopedDb.js +127 -0
  141. package/dist/collection/stores/componentStyles.js +67 -0
  142. package/dist/collection/stores/createScopedStores.js +11 -5
  143. package/dist/collection/stores/internationalization.js +68 -0
  144. package/dist/collection/stores/ruleSets.js +46 -0
  145. package/dist/collection/utils/constants.js +5 -0
  146. package/dist/collection/utils/dataAnalyzer.js +14 -8
  147. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  148. package/dist/collection/utils/layoutObserver.js +88 -0
  149. package/dist/collection/utils/parentDimensions.js +71 -15
  150. package/dist/collection/utils/sanitizeHtml.js +81 -0
  151. package/dist/collection/utils/validate.js +47 -0
  152. package/dist/collection/utils/withBodyObserver.js +12 -7
  153. package/dist/collection/utils/withComponentStyle.js +3 -5
  154. package/dist/collection/utils/withDataset.js +43 -39
  155. package/dist/collection/utils/withDatasource.js +28 -18
  156. package/dist/collection/utils/withInheritedProps.js +26 -1
  157. package/dist/collection/utils/withRuleSet.js +105 -0
  158. package/dist/collection/utils/withScalingGroup.js +69 -0
  159. package/dist/collection/utils/withTranslation.js +50 -14
  160. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  161. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  162. package/dist/collection/utils/xy/NumericScale.js +103 -0
  163. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  164. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  165. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  166. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  167. package/dist/collection/utils/xy/XYFrame.js +120 -0
  168. package/dist/collection/utils/xy/XYLegend.js +107 -0
  169. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  170. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  171. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  172. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  173. package/dist/components/AxisConfig.js +1 -0
  174. package/dist/components/CompareUtil.js +1 -0
  175. package/dist/components/DataFormatDigits.js +1 -1
  176. package/dist/components/DateStringFactory.js +1 -1
  177. package/dist/components/LabelCollisionManager.js +1 -0
  178. package/dist/components/NumericScale.js +1 -0
  179. package/dist/components/Order.js +1 -1
  180. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  181. package/dist/components/SiPrefix.js +1 -0
  182. package/dist/components/StringAdapter.js +1 -0
  183. package/dist/components/VarianceMeasure.js +1 -0
  184. package/dist/components/XYChartDataRow.js +1 -0
  185. package/dist/components/bn-body2.js +1 -1
  186. package/dist/components/bn-card2.js +1 -1
  187. package/dist/components/bn-chart-bubble.d.ts +11 -0
  188. package/dist/components/bn-chart-bubble.js +1 -0
  189. package/dist/components/bn-chart-bullet.d.ts +11 -0
  190. package/dist/components/bn-chart-bullet.js +1 -0
  191. package/dist/components/bn-chart-scatter.d.ts +11 -0
  192. package/dist/components/bn-chart-scatter.js +1 -0
  193. package/dist/components/bn-chart-structure.js +1 -1
  194. package/dist/components/bn-chart-time.js +1 -1
  195. package/dist/components/bn-component-style.js +1 -1
  196. package/dist/components/bn-context.js +1 -1
  197. package/dist/components/bn-dataset.js +1 -1
  198. package/dist/components/bn-datasource.js +1 -1
  199. package/dist/components/bn-footer2.js +1 -1
  200. package/dist/components/bn-grid.js +1 -1
  201. package/dist/components/bn-image.js +1 -1
  202. package/dist/components/bn-internationalization.js +1 -1
  203. package/dist/components/bn-layout-card.js +1 -1
  204. package/dist/components/bn-layout-page.js +1 -1
  205. package/dist/components/bn-message2.js +1 -1
  206. package/dist/components/bn-page2.js +1 -1
  207. package/dist/components/bn-ruleset.d.ts +11 -0
  208. package/dist/components/bn-ruleset.js +1 -0
  209. package/dist/components/bn-scaling-group.d.ts +11 -0
  210. package/dist/components/bn-scaling-group.js +1 -0
  211. package/dist/components/bn-table.js +1 -1
  212. package/dist/components/bn-template.js +1 -1
  213. package/dist/components/bn-text.js +1 -1
  214. package/dist/components/bn-title2.js +1 -1
  215. package/dist/components/bn-tree.js +1 -1
  216. package/dist/components/context-protocol.js +1 -1
  217. package/dist/components/editor-companion.js +1 -1
  218. package/dist/components/formatter.js +1 -0
  219. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  220. package/dist/components/ibcs-chart-bubble.js +1 -0
  221. package/dist/components/ibcs-chart-bubble2.js +1 -0
  222. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  223. package/dist/components/ibcs-chart-bullet.js +1 -0
  224. package/dist/components/ibcs-chart-bullet2.js +1 -0
  225. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  226. package/dist/components/ibcs-chart-scatter.js +1 -0
  227. package/dist/components/ibcs-chart-scatter2.js +1 -0
  228. package/dist/components/ibcs-chart-structure2.js +1 -1
  229. package/dist/components/ibcs-chart-time2.js +1 -1
  230. package/dist/components/ibcs-table2.js +1 -1
  231. package/dist/components/ibcs-title2.js +1 -1
  232. package/dist/components/layoutObserver.js +1 -0
  233. package/dist/components/luxon.js +1 -0
  234. package/dist/components/main.js +1 -0
  235. package/dist/components/merge.js +1 -0
  236. package/dist/components/sanitizeHtml.js +1 -0
  237. package/dist/components/stackColors.js +1 -0
  238. package/dist/components/validate.js +1 -1
  239. package/dist/components/withBodyObserver.js +1 -1
  240. package/dist/components/withComponentStyle.js +1 -1
  241. package/dist/components/withDataset.js +1 -0
  242. package/dist/components/withRuleSet.js +1 -0
  243. package/dist/components/withScalingGroup.js +1 -0
  244. package/dist/components/withStyled.js +1 -1
  245. package/dist/components/withTranslation.js +1 -1
  246. package/dist/esm/AxisConfig-C_zWCKlL.js +224 -0
  247. package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
  248. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  249. package/dist/esm/Order-BPeWfygb.js +83 -0
  250. package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
  251. package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
  252. package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
  253. package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
  254. package/dist/esm/bn-asset_21.entry.js +16025 -0
  255. package/dist/esm/bn-chart-bubble.entry.js +760 -0
  256. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  257. package/dist/esm/bn-chart-scatter.entry.js +656 -0
  258. package/dist/esm/bn-grid.entry.js +5 -3
  259. package/dist/esm/bn-image.entry.js +5 -3
  260. package/dist/esm/bn-internationalization.entry.js +10 -8
  261. package/dist/esm/bn-ruleset.entry.js +39 -0
  262. package/dist/esm/bn-template-engine.js +1 -1
  263. package/dist/esm/bn-template.entry.js +1 -1
  264. package/dist/esm/bn-text.entry.js +7 -78
  265. package/dist/esm/bn-tree.entry.js +4 -2
  266. package/dist/esm/context-protocol-1Yj1uKvh.js +9484 -0
  267. package/dist/esm/editor-companion.entry.js +13 -6
  268. package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
  269. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  270. package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
  271. package/dist/esm/layoutObserver-BG5dOBYH.js +196 -0
  272. package/dist/esm/loader.js +1 -1
  273. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  274. package/dist/esm/scaling-CeSRcRl1.js +579 -0
  275. package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
  276. package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
  277. package/dist/esm/withStyled-Br2DGTPs.js +1104 -0
  278. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  279. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  280. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  281. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  282. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  283. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  284. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  285. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  286. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  287. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  288. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  289. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  290. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
  291. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
  292. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +16 -12
  293. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  294. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  295. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
  296. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
  297. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +16 -12
  298. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
  299. package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
  300. package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
  301. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +35 -8
  302. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +32 -1
  303. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  304. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  305. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
  306. package/dist/types/components/bn-table/bn-table.d.ts +74 -12
  307. package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
  308. package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
  309. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  310. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  311. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  312. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  313. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  314. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
  315. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
  316. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  317. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  318. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  319. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  320. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  321. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
  322. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  323. package/dist/types/components/bn-title/bn-title.d.ts +11 -1
  324. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
  325. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  326. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  327. package/dist/types/components.d.ts +1691 -120
  328. package/dist/types/context/context-protocol.d.ts +7 -3
  329. package/dist/types/context/scopedDb.d.ts +37 -0
  330. package/dist/types/stores/componentStyles.d.ts +41 -0
  331. package/dist/types/stores/createScopedStores.d.ts +4 -2
  332. package/dist/types/stores/ruleSets.d.ts +40 -0
  333. package/dist/types/utils/DateStringFactory.d.ts +1 -1
  334. package/dist/types/utils/constants.d.ts +5 -0
  335. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  336. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  337. package/dist/types/utils/layoutObserver.d.ts +27 -0
  338. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  339. package/dist/types/utils/parentDimensions.d.ts +1 -1
  340. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  341. package/dist/types/utils/validate.d.ts +18 -0
  342. package/dist/types/utils/withDataset.d.ts +6 -2
  343. package/dist/types/utils/withDatasource.d.ts +3 -3
  344. package/dist/types/utils/withInheritedProps.d.ts +19 -0
  345. package/dist/types/utils/withRuleSet.d.ts +24 -0
  346. package/dist/types/utils/withScalingGroup.d.ts +14 -0
  347. package/dist/types/utils/withTranslation.d.ts +12 -4
  348. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  349. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  350. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  351. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  352. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  353. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  354. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  355. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  356. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  357. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  358. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  359. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  360. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  361. package/package.json +5 -4
  362. package/readme.md +9 -5
  363. package/dist/bn-template-engine/p-3141c4a2.entry.js +0 -1
  364. package/dist/bn-template-engine/p-67538176.entry.js +0 -1
  365. package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
  366. package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
  367. package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
  368. package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
  369. package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
  370. package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
  371. package/dist/bn-template-engine/p-c86395b8.entry.js +0 -1
  372. package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
  373. package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
  374. package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
  375. package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23547
  376. package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
  377. package/dist/cjs/scaling-CIAClQR5.js +0 -314
  378. package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
  379. package/dist/collection/stores/datasets.js +0 -14
  380. package/dist/collection/stores/datasources.js +0 -14
  381. package/dist/components/_commonjsHelpers.js +0 -1
  382. package/dist/components/alasql.min.js +0 -1
  383. package/dist/components/ibcsRuleSet.js +0 -1
  384. package/dist/components/scaling.js +0 -1
  385. package/dist/components/withInheritedProps.js +0 -1
  386. package/dist/esm/bn-asset_20.entry.js +0 -23526
  387. package/dist/esm/context-protocol-DdbSplvE.js +0 -656
  388. package/dist/esm/scaling-DGKKkuL9.js +0 -309
  389. package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
  390. package/dist/types/stores/datasets.d.ts +0 -14
  391. package/dist/types/stores/datasources.d.ts +0 -14
@@ -0,0 +1,1137 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-CDKG4xmO.js');
4
+ var contextProtocol = require('./context-protocol-BDrMkhc4.js');
5
+ var withHasError = require('./withHasError-Cl2gTQzA.js');
6
+ var VarianceMeasure = require('./VarianceMeasure-NY9yhiNV.js');
7
+ var Order = require('./Order-DobBozQC.js');
8
+
9
+ /**
10
+ * Mixin that provides themed styling to a Stencil component using a
11
+ * three-layer merge strategy.
12
+ *
13
+ * The effective style is computed by deep-merging three layers in order:
14
+ * 1. `_system` -- built-in defaults (lowest priority)
15
+ * 2. `_default` -- user-defined global overrides
16
+ * 3. The value of the host element's `selected-style` attribute (highest priority)
17
+ *
18
+ * A MutationObserver watches `selected-style` and the store subscription
19
+ * reacts to updates in the componentStyles store, triggering a re-merge
20
+ * and forced re-render on changes.
21
+ *
22
+ * @param component - The Stencil component instance
23
+ * @returns A query function `componentStyle(<selector>)` that provides type-safe
24
+ * access to the merged style object, e.g. `componentStyle(s => s.table.headerBg)`
25
+ */
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ const withComponentStyle = (component) => {
28
+ let subscription;
29
+ let stores;
30
+ let selectedStyle;
31
+ let style;
32
+ const updateStyle = () => {
33
+ const state = stores.componentStyles.state;
34
+ // Arrays overwrite instead of concatenating: ordered color lists like
35
+ // seriesColors/stackColors must be replaced wholesale by an override.
36
+ style = VarianceMeasure.merge([state["_system"] || {}, state["_default"] || {}, state[selectedStyle] || {}], { arrayMergeType: "overwrite" });
37
+ };
38
+ const observer = new MutationObserver((mutations) => {
39
+ mutations.forEach((mutation) => {
40
+ if (mutation.attributeName === "selected-style") {
41
+ selectedStyle = index.getElement(component).getAttribute("selected-style");
42
+ updateStyle();
43
+ index.forceUpdate(component);
44
+ }
45
+ });
46
+ });
47
+ const connectedCallback = component["connectedCallback"];
48
+ component["connectedCallback"] = () => {
49
+ const element = index.getElement(component);
50
+ stores = contextProtocol.getStores(element);
51
+ style = stores.componentStyles.state["_system"];
52
+ observer.observe(element, { attributes: true, attributeFilter: ["selected-style"] });
53
+ selectedStyle = index.getElement(component).getAttribute("selected-style");
54
+ updateStyle();
55
+ subscription = stores.componentStyles.on("set", (key) => {
56
+ if (key === selectedStyle) {
57
+ selectedStyle = index.getElement(component).getAttribute("selected-style");
58
+ updateStyle();
59
+ index.forceUpdate(index.getElement(component));
60
+ }
61
+ });
62
+ withHasError.runIfExisits(connectedCallback, component);
63
+ };
64
+ const disconnectedCallback = component["disconnectedCallback"];
65
+ component["disconnectedCallback"] = () => {
66
+ observer.disconnect();
67
+ withHasError.runIfExisits(subscription);
68
+ contextProtocol.clearStoresCache(index.getElement(component));
69
+ withHasError.runIfExisits(disconnectedCallback, component);
70
+ };
71
+ const componentStyle = (q) => {
72
+ return q(style);
73
+ };
74
+ return componentStyle;
75
+ };
76
+
77
+ const EXPRESSION_REGEX = /^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/;
78
+ /** Field arguments must be plain identifiers — keeps user input out of SQL syntax. */
79
+ const FIELD_IDENTIFIER_REGEX = /^[A-Za-z_][A-Za-z0-9_]*$/;
80
+ const NUMERIC_FNS = ["min", "max", "avg", "sum"];
81
+ /**
82
+ * A custom table column computed from dataset fields via an aggregate expression,
83
+ * e.g. `set(_leiter)` or `sum(ac1)` (see the `attributes` prop on bn-table).
84
+ *
85
+ * The {@link label} is the user-facing header text and never enters SQL; queries
86
+ * use the positional {@link alias} (`attr_0`, `attr_1`, ...) instead.
87
+ */
88
+ class TableAttribute {
89
+ constructor(label, alias, fn, arg) {
90
+ this.label = label;
91
+ this.alias = alias;
92
+ this.fn = fn;
93
+ this.arg = arg;
94
+ }
95
+ /** Numeric aggregates are formatted like scenario cells (measure scale + decimals). */
96
+ get isNumeric() {
97
+ return NUMERIC_FNS.includes(this.fn);
98
+ }
99
+ }
100
+ /** Checks a single attribute expression string like "set(_leiter)" or "lit(Fix)". */
101
+ function isValidAttributeExpression(expression) {
102
+ if (typeof expression !== "string") {
103
+ return false;
104
+ }
105
+ const match = EXPRESSION_REGEX.exec(expression);
106
+ if (!match) {
107
+ return false;
108
+ }
109
+ const [, fn, arg] = match;
110
+ if (fn === "lit") {
111
+ return arg.length > 0;
112
+ }
113
+ return FIELD_IDENTIFIER_REGEX.test(arg);
114
+ }
115
+ /** Parses an attribute expression into a {@link TableAttribute}; null when invalid. */
116
+ function parseTableAttributeExpression(label, alias, expression) {
117
+ if (!isValidAttributeExpression(expression)) {
118
+ return null;
119
+ }
120
+ const [, fn, arg] = EXPRESSION_REGEX.exec(expression);
121
+ return new TableAttribute(label, alias, fn, arg);
122
+ }
123
+
124
+ /** Granularity levels for date intervals, from YEAR down to MILLISECOND. AUTO triggers auto-detection. */
125
+ exports.DateDistance = void 0;
126
+ (function (DateDistance) {
127
+ DateDistance["YEAR"] = "year";
128
+ DateDistance["QUARTER"] = "quarter";
129
+ DateDistance["MONTH"] = "month";
130
+ DateDistance["WEEK"] = "week";
131
+ DateDistance["DAY"] = "day";
132
+ DateDistance["HOUR"] = "hour";
133
+ DateDistance["MINUTE"] = "minute";
134
+ DateDistance["SECOND"] = "second";
135
+ DateDistance["MILLISECOND"] = "millisecond";
136
+ DateDistance["NONE"] = "fallback";
137
+ DateDistance["AUTO"] = "auto";
138
+ })(exports.DateDistance || (exports.DateDistance = {}));
139
+ /** IBCS date-link modes controlling how start/end dates are rendered in titles and axis labels. */
140
+ exports.DateLink = void 0;
141
+ (function (DateLink) {
142
+ DateLink["AVG"] = "avg";
143
+ DateLink["INTERVAL"] = "interval";
144
+ DateLink["START"] = "start";
145
+ DateLink["END"] = "end";
146
+ DateLink["YTD"] = "ytd";
147
+ DateLink["YTG"] = "ytg";
148
+ DateLink["CUM"] = "cum";
149
+ DateLink["MAT"] = "mat";
150
+ DateLink["NONE"] = "none";
151
+ DateLink["AUTO"] = "auto";
152
+ })(exports.DateLink || (exports.DateLink = {}));
153
+ /**
154
+ * Produces formatted date strings and IBCS date-link notations for time-series charts.
155
+ *
156
+ * Supports configurable date formats (full and abbreviated), locale-aware formatting
157
+ * via Luxon, smart boundary labels that append the parent period at crossings
158
+ * (e.g. month name shown at the first day of a new month), and IBCS date-link
159
+ * notation (AVG, YTD, YTG, CUM, MAT, INTERVAL, START, END).
160
+ */
161
+ class DateStringFactory {
162
+ constructor() {
163
+ this._dateFormat = {
164
+ year: "yyyy",
165
+ quarter: "q'Q' yyyy",
166
+ month: "LLL yyyy",
167
+ week: "'KW'WW yyyy",
168
+ day: "dd.MM.yyyy",
169
+ hour: "TT",
170
+ minute: "TT",
171
+ second: "TT",
172
+ millisecond: "TT:SSS",
173
+ fallback: "dd.MM.yyyy",
174
+ };
175
+ this._dateFormatShort = {
176
+ year: "yy",
177
+ quarter: "q'Q'",
178
+ month: "LLL",
179
+ week: "'KW'WW",
180
+ day: "dd",
181
+ hour: "hh'h'",
182
+ minute: "mm'm'",
183
+ second: "ss's'",
184
+ millisecond: "SSS'ms'",
185
+ fallback: "dd.MM.yyyy",
186
+ };
187
+ this._dateLinkFormat = {
188
+ avg: "Ø[LINK]",
189
+ interval: "[DATE]..[DATE2]",
190
+ start: ".[DATE]",
191
+ end: "[DATE].",
192
+ ytd: "_[DATE]",
193
+ ytg: "[DATE]_",
194
+ cum: "[DATE]_[DATE2]",
195
+ mat: "~[DATE]",
196
+ none: "[DATE]",
197
+ };
198
+ this.locale = "de";
199
+ this.dateFormat = this._dateFormat;
200
+ this.dateLinkFormat = this._dateLinkFormat;
201
+ this.dateFormatShort = this._dateFormatShort;
202
+ }
203
+ setDateLinkFormat(datelink) {
204
+ this.dateLinkFormat = datelink;
205
+ }
206
+ setDateFormat(dateFormat) {
207
+ this.dateFormat = dateFormat;
208
+ }
209
+ setDateFormatShort(dateFormatShort) {
210
+ this.dateFormatShort = dateFormatShort;
211
+ }
212
+ setLocale(locale) {
213
+ this.locale = locale;
214
+ }
215
+ /**
216
+ * Converts date string based on dateFormatMap and the selected Type
217
+ *
218
+ * @param date
219
+ * @param type?
220
+ */
221
+ getDateString(date, type) {
222
+ return date.setLocale(this.locale).toFormat(this.dateFormat[type] || this.dateFormat["fallback"]);
223
+ }
224
+ /**
225
+ * Produces abbreviated date labels that include the parent period at boundary crossings.
226
+ *
227
+ * For example, with MONTH granularity, most ticks show just "Jan", "Feb", etc.,
228
+ * but the first month of a new year also appends the year ("Jan 24").
229
+ * This avoids redundant repetition while keeping boundary context visible.
230
+ */
231
+ getSmartDateString(date, type) {
232
+ switch (type) {
233
+ case exports.DateDistance.DAY: {
234
+ return this.getFormatedDayDate(date);
235
+ }
236
+ case exports.DateDistance.MONTH: {
237
+ return this.getFormatedMonthDate(date);
238
+ }
239
+ case exports.DateDistance.QUARTER: {
240
+ return this.getFormatedQuarterDate(date);
241
+ }
242
+ case exports.DateDistance.WEEK: {
243
+ return this.getFormatedWeekDate(date);
244
+ }
245
+ case exports.DateDistance.HOUR: {
246
+ return this.getFormatedHourDate(date);
247
+ }
248
+ case exports.DateDistance.MINUTE: {
249
+ return this.getFormatedMinuteDate(date);
250
+ }
251
+ case exports.DateDistance.SECOND: {
252
+ return this.getFormatedSecondDate(date);
253
+ }
254
+ case exports.DateDistance.MILLISECOND: {
255
+ return this.getFormatedMilliSecondDate(date);
256
+ }
257
+ default: {
258
+ return this.getDateString(date, type);
259
+ }
260
+ }
261
+ }
262
+ /**
263
+ * Determines the best-fitting {@link DateDistance} granularity for the span between two dates.
264
+ *
265
+ * Cascades through granularities from finest (millisecond) to coarsest (year),
266
+ * comparing the span against the `limit` threshold at each level. Returns the
267
+ * first granularity where the span is below the limit, ensuring the number of
268
+ * axis ticks stays manageable. Defaults to DAY for zero-span or null end dates.
269
+ *
270
+ * @param limit Maximum number of intervals before stepping up to a coarser granularity (default 32).
271
+ */
272
+ calculateDistanceType(start, end, limit = 32) {
273
+ if (end == null) {
274
+ return exports.DateDistance.DAY;
275
+ }
276
+ const mStart = typeof start == "number" ? contextProtocol.DateTime.fromMillis(start) : start;
277
+ const mEnd = typeof end == "number" ? contextProtocol.DateTime.fromMillis(end) : end;
278
+ if (mEnd.diff(mStart).as("milliseconds") === 0) {
279
+ return exports.DateDistance.DAY;
280
+ }
281
+ else if (mEnd.diff(mStart).as("milliseconds") < limit) {
282
+ return exports.DateDistance.MILLISECOND;
283
+ }
284
+ else if (mEnd.diff(mStart).as("seconds") < limit) {
285
+ return exports.DateDistance.SECOND;
286
+ }
287
+ else if (mEnd.diff(mStart).as("minutes") < limit) {
288
+ return exports.DateDistance.MINUTE;
289
+ }
290
+ else if (mEnd.diff(mStart).as("hours") < limit) {
291
+ return exports.DateDistance.HOUR;
292
+ }
293
+ else if (mEnd.diff(mStart).as("days") < limit) {
294
+ return exports.DateDistance.DAY;
295
+ }
296
+ else if (mEnd.diff(mStart).as("weeks") < limit) {
297
+ return exports.DateDistance.WEEK;
298
+ }
299
+ else if (mEnd.diff(mStart).as("months") < limit) {
300
+ return exports.DateDistance.MONTH;
301
+ }
302
+ else if (mEnd.diff(mStart).as("quarters") < limit) {
303
+ return exports.DateDistance.QUARTER;
304
+ }
305
+ else {
306
+ return exports.DateDistance.YEAR;
307
+ }
308
+ }
309
+ /**
310
+ * Get an array of moment instances, each representing a day beween given timestamps.
311
+ * @param {string|Date} from start date
312
+ * @param {string|Date} to end date
313
+ * @param dateInterval
314
+ * @param spanLimit
315
+ */
316
+ datesBetween(from, to, dateInterval, spanLimit) {
317
+ const unit = this.convertDateDistanceToMomentunitOfTime(dateInterval);
318
+ const fromDate = from.startOf(unit);
319
+ const toDate = to.endOf(unit);
320
+ let span = toDate.diff(fromDate).as(unit);
321
+ const days = [];
322
+ if (span >= spanLimit) {
323
+ span = spanLimit;
324
+ }
325
+ let currentDate = fromDate;
326
+ do {
327
+ days.push(currentDate);
328
+ currentDate = currentDate.plus(this.createDiratonLike(unit, 1));
329
+ } while (currentDate <= toDate && days.length < span);
330
+ return days;
331
+ }
332
+ /**
333
+ * Produces an IBCS date-link string combining date formatting with link notation.
334
+ *
335
+ * Supported modes map to IBCS conventions:
336
+ * - `AVG`: average symbol `Ø` wrapping the interval
337
+ * - `YTD` / `YTG`: year-to-date / year-to-go underline notation
338
+ * - `CUM`: cumulative range `start_end`
339
+ * - `MAT`: moving annual total `~date`
340
+ * - `INTERVAL`: `start..end` range
341
+ * - `START` / `END`: dot-prefixed/suffixed single date
342
+ *
343
+ * When start and end resolve to the same formatted string, INTERVAL is collapsed
344
+ * to NONE to avoid redundant display. Year parts are deduplicated when both dates
345
+ * share the same year (e.g. "Q1 .. Q3 2024" instead of "Q1 2024 .. Q3 2024").
346
+ *
347
+ * @param type DateDistance granularity; when AUTO, it is auto-detected via `calculateDistanceType`.
348
+ */
349
+ getDateLinkString(startDateTime, endDateTime, mode, type, spanLimit) {
350
+ // No Start/ End Date exists
351
+ if (startDateTime == null && endDateTime == null) {
352
+ // BinoSystem.warn('NO START AND END DATE SELECTED');
353
+ return "";
354
+ }
355
+ if (startDateTime == null && !(mode === exports.DateLink.END || mode === exports.DateLink.YTD)) {
356
+ // BinoSystem.warn('NO START N SELECTED');
357
+ return "";
358
+ }
359
+ if (endDateTime == null &&
360
+ (exports.DateLink.INTERVAL === mode || exports.DateLink.CUM === mode || exports.DateLink.END === mode || exports.DateLink.YTD === mode)) {
361
+ // BinoSystem.warn('NO END N SELECTED');
362
+ return "";
363
+ }
364
+ const date1 = startDateTime || contextProtocol.DateTime.now();
365
+ const date2 = endDateTime;
366
+ // calculate type value aka. auto-mode
367
+ if (type === exports.DateDistance.AUTO) {
368
+ type = this.calculateDistanceType(date1, date2, spanLimit);
369
+ }
370
+ let dateString1 = this.getDateString(date1, type);
371
+ let dateString2 = "";
372
+ let link = exports.DateLink.NONE;
373
+ if (date2 != null) {
374
+ dateString2 = this.getDateString(date2, type);
375
+ link = exports.DateLink.INTERVAL;
376
+ // clean up visualisation if start and end (formated) ist identical
377
+ if (dateString1 === dateString2 && mode === exports.DateLink.INTERVAL) {
378
+ // BinoSystem.warn('CHANGED INTERVAL TO NONE; START AND END ARE IDENTICAL');
379
+ mode = exports.DateLink.NONE;
380
+ }
381
+ if (dateString1 === dateString2 && mode === exports.DateLink.AVG) {
382
+ // BinoSystem.warn('CHANGED INTERVAL TO NONE; START AND END ARE IDENTICAL');
383
+ link = exports.DateLink.NONE;
384
+ }
385
+ if (exports.DateLink.END === mode || exports.DateLink.YTD === mode) {
386
+ dateString1 = dateString2;
387
+ }
388
+ // clean up dateString1 if same year
389
+ if (mode === exports.DateLink.INTERVAL || mode === exports.DateLink.CUM || exports.DateLink.AVG) {
390
+ if (type === exports.DateDistance.QUARTER) {
391
+ if (date1.quarter === date2.quarter && date1.year === date2.year) {
392
+ dateString2 = dateString2.replace(" " + date2.year, "");
393
+ }
394
+ else if (date1.year === date2.year) {
395
+ dateString1 = dateString1.replace(" " + date1.year, "");
396
+ }
397
+ }
398
+ else if (type === exports.DateDistance.MONTH) {
399
+ if (date1.month === date2.month && date1.year === date2.year) {
400
+ dateString2 = dateString2.replace(" " + date2.year, "");
401
+ }
402
+ else if (date1.year === date2.year) {
403
+ dateString1 = dateString1.replace(" " + date1.year, "");
404
+ }
405
+ }
406
+ else if (type === exports.DateDistance.WEEK) {
407
+ if (date1.weekNumber === date2.weekNumber && date1.year === date2.year) {
408
+ dateString2 = dateString2.replace(" " + date2.year, "");
409
+ }
410
+ else if (date1.year === date2.year) {
411
+ dateString1 = dateString1.replace(" " + date1.year, "");
412
+ }
413
+ }
414
+ }
415
+ }
416
+ return this.dateLinkFormat[mode]
417
+ .replace("[LINK]", this.dateLinkFormat[link])
418
+ .replace("[DATE]", dateString1)
419
+ .replace("[DATE2]", dateString2);
420
+ }
421
+ /** Returns an abbreviated date string using the short format map (e.g. "yy" for year, "LLL" for month). */
422
+ getShortDateString(date, type) {
423
+ return date
424
+ .setLocale(this.locale)
425
+ .toFormat(this.dateFormatShort[type] || this.dateFormatShort["fallback"]);
426
+ }
427
+ getFormatedDayDate(date) {
428
+ let format = this.dateFormatShort["day"];
429
+ if (this.isFirstInMonth(date)) {
430
+ format += " " + this.dateFormatShort["month"];
431
+ }
432
+ if (this.isJanuary(date)) {
433
+ format += " " + this.dateFormatShort["year"];
434
+ }
435
+ return date.setLocale(this.locale).toFormat(format);
436
+ }
437
+ getFormatedMonthDate(date) {
438
+ let format = this.dateFormatShort["month"];
439
+ if (this.isJanuary(date)) {
440
+ format += " " + this.dateFormatShort["year"];
441
+ }
442
+ return date.setLocale(this.locale).toFormat(format);
443
+ }
444
+ getFormatedQuarterDate(date) {
445
+ let format = this.dateFormatShort["quarter"];
446
+ if (this.isFirstQuarter(date)) {
447
+ format += " " + this.dateFormatShort["year"];
448
+ }
449
+ return date.setLocale(this.locale).toFormat(format);
450
+ }
451
+ getFormatedWeekDate(date) {
452
+ let format = this.dateFormatShort["week"];
453
+ if (this.isFirstWeek(date)) {
454
+ format += " " + this.dateFormatShort["year"];
455
+ }
456
+ return date.setLocale(this.locale).toFormat(format);
457
+ }
458
+ getFormatedHourDate(date) {
459
+ let format = this.dateFormatShort["hour"];
460
+ if (this.isFirstHour(date)) {
461
+ format += " " + this.dateFormatShort["day"];
462
+ }
463
+ return date.setLocale(this.locale).toFormat(format);
464
+ }
465
+ getFormatedMinuteDate(date) {
466
+ let format = this.dateFormatShort["minute"];
467
+ if (this.isFirstMinute(date)) {
468
+ format = this.dateFormatShort["hour"] + ":" + format;
469
+ }
470
+ return date.setLocale(this.locale).toFormat(format);
471
+ }
472
+ getFormatedSecondDate(date) {
473
+ let format = this.dateFormatShort["second"];
474
+ if (this.isFirstSecond(date)) {
475
+ format = this.dateFormatShort["minute"] + ":" + format;
476
+ }
477
+ return date.setLocale(this.locale).toFormat(format);
478
+ }
479
+ getFormatedMilliSecondDate(date) {
480
+ let format = this.dateFormatShort["millisecond"];
481
+ if (this.isFirstMilliSecond(date)) {
482
+ format = this.dateFormatShort["second"] + ":" + format;
483
+ }
484
+ return date.setLocale(this.locale).toFormat(format);
485
+ }
486
+ isFirstInMonth(date) {
487
+ return date.day === 1;
488
+ }
489
+ isJanuary(date) {
490
+ return date.month === 1;
491
+ }
492
+ isFirstQuarter(date) {
493
+ return date.quarter === 1;
494
+ }
495
+ isFirstWeek(date) {
496
+ return date.weekNumber === 1;
497
+ }
498
+ isFirstHour(date) {
499
+ return date.hour === 0;
500
+ }
501
+ isFirstMinute(date) {
502
+ return date.minute === 0;
503
+ }
504
+ isFirstSecond(date) {
505
+ return date.second === 0;
506
+ }
507
+ isFirstMilliSecond(date) {
508
+ return date.millisecond === 0;
509
+ }
510
+ convertDateDistanceToMomentunitOfTime(dateInterval) {
511
+ let unitOfTime;
512
+ switch (dateInterval) {
513
+ case exports.DateDistance.YEAR:
514
+ unitOfTime = "year";
515
+ break;
516
+ case exports.DateDistance.MONTH:
517
+ unitOfTime = "month";
518
+ break;
519
+ case exports.DateDistance.QUARTER:
520
+ unitOfTime = "quarter";
521
+ break;
522
+ case exports.DateDistance.WEEK:
523
+ unitOfTime = "week";
524
+ break;
525
+ case exports.DateDistance.DAY:
526
+ unitOfTime = "day";
527
+ break;
528
+ case exports.DateDistance.HOUR:
529
+ unitOfTime = "hour";
530
+ break;
531
+ case exports.DateDistance.MINUTE:
532
+ unitOfTime = "minute";
533
+ break;
534
+ case exports.DateDistance.SECOND:
535
+ unitOfTime = "second";
536
+ break;
537
+ case exports.DateDistance.MILLISECOND:
538
+ unitOfTime = "millisecond";
539
+ break;
540
+ default:
541
+ unitOfTime = "day";
542
+ }
543
+ return unitOfTime;
544
+ }
545
+ createDiratonLike(unit, number) {
546
+ switch (unit) {
547
+ case "year":
548
+ return { years: number };
549
+ case "month":
550
+ return { months: number };
551
+ case "quarter":
552
+ return { quarters: number };
553
+ case "week":
554
+ return { weeks: number };
555
+ case "day":
556
+ return { days: number };
557
+ case "hour":
558
+ return { hours: number };
559
+ case "minute":
560
+ return { minutes: number };
561
+ case "second":
562
+ return { seconds: number };
563
+ case "millisecond":
564
+ return { milliseconds: number };
565
+ default:
566
+ return { days: number };
567
+ }
568
+ }
569
+ }
570
+
571
+ /**
572
+ * Prop validators for Stencil @Watch handlers.
573
+ *
574
+ * Each validator returns an array of invalid items; an empty array means the input is valid.
575
+ * These are used in component @Watch methods to warn about malformed attribute values
576
+ * without crashing the component.
577
+ */
578
+ /**
579
+ * Checks whether a value is blank, null, undefined, or the string `"null"`.
580
+ * The string `"null"` check handles serialized null values from HTML attributes,
581
+ * which arrive as the literal string "null" rather than a JS null.
582
+ */
583
+ function isBlankInput(value) {
584
+ return value === null || value === undefined || value === "" || value === "null";
585
+ }
586
+ /**
587
+ * Validates a comma-separated list of scenario identifiers.
588
+ * The special value `"auto"` is always valid. Base scenarios are validated against
589
+ * the Scenarios enum; remaining invalid entries are passed to `validateVariancesList`
590
+ * for variance format checking (e.g. `d_ac1_pl1_pos`).
591
+ */
592
+ function validateScenarioList(value) {
593
+ if (isBlankInput(value)) {
594
+ return [];
595
+ }
596
+ if (value.trim().toLowerCase() === "auto") {
597
+ return [];
598
+ }
599
+ const invalidScenarios = value === null || value === void 0 ? void 0 : value.split(",").filter((element) => !(element.toUpperCase().trim() in VarianceMeasure.Scenarios));
600
+ return validateVariancesList(invalidScenarios.toString());
601
+ }
602
+ /**
603
+ * Validates variance identifiers in the format `d_<base>_<delta>_<sentiment>` or
604
+ * `dr_<base>_<delta>_<sentiment>`. Each component is checked against the Scenarios
605
+ * and Sentiments enums. Returns items that fail validation.
606
+ */
607
+ function validateVariancesList(value) {
608
+ if (isBlankInput(value)) {
609
+ return [];
610
+ }
611
+ const invalidScenarios = value
612
+ .replace(";", ",")
613
+ .split(",")
614
+ .filter((element) => {
615
+ var _a, _b, _c;
616
+ const splittedElement = element.split("_");
617
+ const scenarioSubtrahend = (_a = splittedElement[0]) === null || _a === void 0 ? void 0 : _a.replace(/^dr|^d/, "").toUpperCase().trim();
618
+ const scenarioMinuend = (_b = splittedElement[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase().trim();
619
+ const scenarioSentiment = (_c = splittedElement[2]) === null || _c === void 0 ? void 0 : _c.toUpperCase().trim();
620
+ return (splittedElement.length !== 3 ||
621
+ !(scenarioSubtrahend in VarianceMeasure.Scenarios) ||
622
+ !(scenarioMinuend in VarianceMeasure.Scenarios) ||
623
+ !(scenarioSentiment in VarianceMeasure.Sentiments));
624
+ });
625
+ return invalidScenarios;
626
+ }
627
+ /**
628
+ * Validates a comma-separated list of bar column identifiers. Both base scenarios
629
+ * (e.g. `ac1`) and variances (e.g. `dac1_pp1_pos`) are valid entries.
630
+ * Returns items that fail validation.
631
+ */
632
+ function validateBarColumnsList(value) {
633
+ if (isBlankInput(value)) {
634
+ return [];
635
+ }
636
+ const invalidScenarios = value.split(",").filter((element) => !(element.toUpperCase().trim() in VarianceMeasure.Scenarios));
637
+ return validateVariancesList(invalidScenarios.toString());
638
+ }
639
+ function validateOrderList(value) {
640
+ if (isBlankInput(value)) {
641
+ return [];
642
+ }
643
+ if (value.trim().toLowerCase() === "auto") {
644
+ return [];
645
+ }
646
+ const invalidScenarios = value.split(",").filter((element) => !(element.toUpperCase() in Order.OrderColumn));
647
+ return validateVariancesList(invalidScenarios.toString());
648
+ }
649
+ function isValidInteger(value) {
650
+ if (isBlankInput(value)) {
651
+ return false;
652
+ }
653
+ return Number.isInteger(Number(value));
654
+ }
655
+ function isValidNumber(value) {
656
+ if (isBlankInput(value)) {
657
+ return false;
658
+ }
659
+ return !Number.isNaN(Number(value));
660
+ }
661
+ function isValidDirection(value) {
662
+ if (isBlankInput(value)) {
663
+ return false;
664
+ }
665
+ return (value === null || value === void 0 ? void 0 : value.toUpperCase()) in Order.OrderDirection;
666
+ }
667
+ function isValidLevel(value) {
668
+ if ((value === null || value === void 0 ? void 0 : value.toLowerCase()) === "auto") {
669
+ return true;
670
+ }
671
+ return (value === null || value === void 0 ? void 0 : value.toUpperCase()) in VarianceMeasure.AggregationLevel;
672
+ }
673
+ function validateMeasureList(value) {
674
+ if (isBlankInput(value)) {
675
+ return [];
676
+ }
677
+ try {
678
+ const newObj = JSON.parse(value);
679
+ if (newObj instanceof Array) {
680
+ return newObj.filter((elem) => !(elem.hasOwnProperty("name") && elem.hasOwnProperty("unit")));
681
+ }
682
+ }
683
+ catch (e) {
684
+ console.error("validateMeasureList: failed to parse JSON", e);
685
+ }
686
+ return ["Invalid JSON structure"];
687
+ }
688
+ function isValidDate(value) {
689
+ const newDate = Date.parse(value);
690
+ return Number.isInteger(newDate);
691
+ }
692
+ function isValidDateLink(value) {
693
+ return (value === null || value === void 0 ? void 0 : value.toUpperCase()) in exports.DateLink;
694
+ }
695
+ function isValidDateFormat(value) {
696
+ return (value === null || value === void 0 ? void 0 : value.toUpperCase()) in exports.DateDistance;
697
+ }
698
+ function isValidAxisLabelsMode(value) {
699
+ return (value === null || value === void 0 ? void 0 : value.toUpperCase()) in VarianceMeasure.AxisLabelsMode;
700
+ }
701
+ function isValidDataFormat(value) {
702
+ if (isBlankInput(value)) {
703
+ return false;
704
+ }
705
+ return (value === null || value === void 0 ? void 0 : value.toUpperCase()) in VarianceMeasure.DataFormat;
706
+ }
707
+ function isValidBoolean(value) {
708
+ if (isBlankInput(value)) {
709
+ return false;
710
+ }
711
+ const validValues = ["true", "false", true, false];
712
+ return validValues.some((elem) => elem === value);
713
+ }
714
+ function isValidTableType(value) {
715
+ if (isBlankInput(value)) {
716
+ return false;
717
+ }
718
+ return (value === null || value === void 0 ? void 0 : value.toUpperCase()) in VarianceMeasure.TableType;
719
+ }
720
+ function validateThereOfJsonStr(value) {
721
+ if (isBlankInput(value)) {
722
+ return [];
723
+ }
724
+ try {
725
+ const jsonObject = JSON.parse(value);
726
+ if (jsonObject instanceof Array) {
727
+ // return newObj.filter(elem => elem.hasOwnProperty('rowgroup') && elem.hasOwnProperty('category') && elem.hasOwnProperty('subcategory'))
728
+ return jsonObject.filter((elem) => !(elem.hasOwnProperty("rowGroup") && elem.hasOwnProperty("category") && elem.hasOwnProperty("subCategory")));
729
+ }
730
+ }
731
+ catch (err) {
732
+ console.error("validateThereOfJsonStr: failed to parse JSON", err);
733
+ }
734
+ return ["Invalid JSON structure"];
735
+ }
736
+ /**
737
+ * Validates the bn-table `attributes` prop: a JSON object mapping column labels
738
+ * to aggregate expressions like `set(_leiter)` or `sum(ac1)`.
739
+ * Returns the offending `label: expression` entries; empty array means valid.
740
+ */
741
+ function validateAttributesJsonStr(value) {
742
+ if (isBlankInput(value)) {
743
+ return [];
744
+ }
745
+ try {
746
+ const jsonObject = JSON.parse(value);
747
+ if (jsonObject !== null && typeof jsonObject === "object" && !(jsonObject instanceof Array)) {
748
+ return Object.entries(jsonObject)
749
+ .filter(([, expression]) => typeof expression !== "string" || !isValidAttributeExpression(expression))
750
+ .map(([label, expression]) => `${label}: ${expression}`);
751
+ }
752
+ }
753
+ catch (err) {
754
+ console.error("validateAttributesJsonStr: failed to parse JSON", err);
755
+ }
756
+ return ["Invalid JSON structure"];
757
+ }
758
+ function validatePartOfJsonStr(value) {
759
+ if (isBlankInput(value)) {
760
+ return [];
761
+ }
762
+ try {
763
+ const jsonObject = JSON.parse(value);
764
+ if (jsonObject instanceof Array) {
765
+ // return newObj.filter(elem => elem.hasOwnProperty('rowgroup') && elem.hasOwnProperty('category') && elem.hasOwnProperty('subcategory'))
766
+ return jsonObject.filter((elem) => !(elem.hasOwnProperty("rowGroup") && elem.hasOwnProperty("category")));
767
+ }
768
+ }
769
+ catch (e) {
770
+ console.error("validatePartOfJsonStr: failed to parse JSON", e);
771
+ }
772
+ return ["Invalid JSON structure"];
773
+ }
774
+ function isValidMeasureType(value) {
775
+ return (value === null || value === void 0 ? void 0 : value.trim().toUpperCase()) in VarianceMeasure.MeasureType;
776
+ }
777
+ /**
778
+ * Validates a measure-scale attribute value.
779
+ * Accepted values: `"_"` (no scaling), SI prefix letters (k, M, G, T, P, E, Z, Y, m, etc.),
780
+ * or auto-detection modes `"GREATEST"` / `"LEAST"`.
781
+ */
782
+ function isValidMeasureScale(value) {
783
+ return (["_", "k", "M", "G", "T", "P", "E", "Z", "Y", "m", "μ", "n", "p", "P", "f", "a", "z", "y"].includes(value === null || value === void 0 ? void 0 : value.trim()) || ["GREATEST", "LEAST"].includes(value === null || value === void 0 ? void 0 : value.trim().toUpperCase()));
784
+ }
785
+ function isTableCategoryWidth(value) {
786
+ return (value === null || value === void 0 ? void 0 : value.toUpperCase().trim()) in VarianceMeasure.TableCategoryWidth;
787
+ }
788
+ function isTableBarColumnWidth(value) {
789
+ return (value === null || value === void 0 ? void 0 : value.toUpperCase().trim()) in VarianceMeasure.TableBarColumnWidth;
790
+ }
791
+ function validateColumnThereOfJsonStr(value) {
792
+ if (isBlankInput(value)) {
793
+ return [];
794
+ }
795
+ try {
796
+ const jsonObject = JSON.parse(value);
797
+ return jsonObject.filter((elem) => !(elem.hasOwnProperty("scenario") && elem.hasOwnProperty("name") && elem.hasOwnProperty("subGroups")));
798
+ }
799
+ catch (e) {
800
+ console.error("validateColumnThereOfJsonStr: failed to parse JSON", e);
801
+ }
802
+ return ["Invalid JSON structure"];
803
+ }
804
+ function validateStackConfig(value) {
805
+ if (isBlankInput(value)) {
806
+ return [];
807
+ }
808
+ try {
809
+ const config = JSON.parse(value);
810
+ if (typeof config !== "object" || config === null || Array.isArray(config)) {
811
+ return ["stack: must be a JSON object"];
812
+ }
813
+ const errors = [];
814
+ if (!config.hasOwnProperty("by")) {
815
+ errors.push("stack: 'by' is required");
816
+ }
817
+ else {
818
+ const validBy = ["scenarios", "dimensions"];
819
+ if (!validBy.includes(config.by)) {
820
+ errors.push(`stack: 'by' must be one of: ${validBy.join(", ")}`);
821
+ }
822
+ }
823
+ if (config.hasOwnProperty("mode")) {
824
+ const validModes = ["absolute", "relative", "absolute-relative"];
825
+ if (!validModes.includes(config.mode)) {
826
+ errors.push(`stack: 'mode' must be one of: ${validModes.join(", ")}`);
827
+ }
828
+ }
829
+ if (config.hasOwnProperty("order")) {
830
+ const validOrders = ["asc", "desc", "dataset"];
831
+ if (!validOrders.includes(config.order)) {
832
+ errors.push(`stack: 'order' must be one of: ${validOrders.join(", ")}`);
833
+ }
834
+ }
835
+ return errors;
836
+ }
837
+ catch (_e) {
838
+ return ["stack: invalid JSON"];
839
+ }
840
+ }
841
+ /**
842
+ * Checks whether a value is a valid XY chart measure token: a scenario
843
+ * column (`ac1`…`pl4`) or a variance token (`d…`/`dr…`, sentiment suffix
844
+ * optional — spec §4.4 of the scatter/bubble charts).
845
+ */
846
+ function isValidMeasureToken(value) {
847
+ if (isBlankInput(value)) {
848
+ return false;
849
+ }
850
+ return VarianceMeasure.resolveMeasure(value) !== null;
851
+ }
852
+
853
+ class StyleSheet {
854
+ constructor() {
855
+ this.cache = new Map();
856
+ this.tag = StyleSheet.makeStyleTag();
857
+ }
858
+ static makeStyleTag() {
859
+ const tag = document.createElement("style");
860
+ tag.type = "text/css";
861
+ tag.setAttribute("data-bn-computed-style", "");
862
+ tag.append(document.createTextNode(""));
863
+ (document.head || document.querySelector("head")).append(tag);
864
+ return tag;
865
+ }
866
+ apply(data) {
867
+ data.forEach((value) => this.cache.set(value.className, value.style));
868
+ this.tag.innerHTML = Array.from(this.cache.values())
869
+ .map((value) => value)
870
+ .join("\n");
871
+ }
872
+ }
873
+ const styleSheet = new StyleSheet();
874
+
875
+ /* eslint-disable */
876
+ // Inspired by https://github.com/garycourt/murmurhash-js
877
+ // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
878
+ function murmur2(str) {
879
+ // 'm' and 'r' are mixing constants generated offline.
880
+ // They're not really 'magic', they just happen to work well.
881
+ // const m = 0x5bd1e995;
882
+ // const r = 24;
883
+ // Initialize the hash
884
+ var h = 0; // Mix 4 bytes at a time into the hash
885
+
886
+ var k,
887
+ i = 0,
888
+ len = str.length;
889
+
890
+ for (; len >= 4; ++i, len -= 4) {
891
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
892
+ k =
893
+ /* Math.imul(k, m): */
894
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
895
+ k ^=
896
+ /* k >>> r: */
897
+ k >>> 24;
898
+ h =
899
+ /* Math.imul(k, m): */
900
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
901
+ /* Math.imul(h, m): */
902
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
903
+ } // Handle the last few bytes of the input array
904
+
905
+
906
+ switch (len) {
907
+ case 3:
908
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
909
+
910
+ case 2:
911
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
912
+
913
+ case 1:
914
+ h ^= str.charCodeAt(i) & 0xff;
915
+ h =
916
+ /* Math.imul(h, m): */
917
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
918
+ } // Do a few final mixes of the hash to ensure the last few
919
+ // bytes are well-incorporated.
920
+
921
+
922
+ h ^= h >>> 13;
923
+ h =
924
+ /* Math.imul(h, m): */
925
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
926
+ return ((h ^ h >>> 15) >>> 0).toString(36);
927
+ }
928
+
929
+ const transofrmToUnitString = (value) => {
930
+ if (isValidNumber(value)) {
931
+ return `${value}px`;
932
+ }
933
+ else {
934
+ return value;
935
+ }
936
+ };
937
+ const width = {
938
+ className: "w",
939
+ cssName: "width",
940
+ attrName: "width",
941
+ transform: transofrmToUnitString,
942
+ };
943
+ const height = {
944
+ className: "h",
945
+ cssName: "height",
946
+ attrName: "height",
947
+ transform: transofrmToUnitString,
948
+ };
949
+ const position = {
950
+ className: "pst",
951
+ cssName: "position",
952
+ attrName: "position",
953
+ };
954
+ const top = {
955
+ className: "top",
956
+ cssName: "top",
957
+ attrName: "top",
958
+ transform: transofrmToUnitString,
959
+ };
960
+ const right = {
961
+ className: "rgt",
962
+ cssName: "right",
963
+ attrName: "right",
964
+ transform: transofrmToUnitString,
965
+ };
966
+ const bottom = {
967
+ className: "btm",
968
+ cssName: "bottom",
969
+ attrName: "bottom",
970
+ transform: transofrmToUnitString,
971
+ };
972
+ const left = {
973
+ className: "lft",
974
+ cssName: "left",
975
+ attrName: "left",
976
+ transform: transofrmToUnitString,
977
+ };
978
+ const fontSize = {
979
+ className: "fts",
980
+ cssName: "font-size",
981
+ attrName: "font-size",
982
+ transform: transofrmToUnitString,
983
+ };
984
+ const gridColumn = {
985
+ className: "gdc",
986
+ cssName: "grid-column",
987
+ attrName: "grid-column",
988
+ };
989
+ const gridRow = {
990
+ className: "gdr",
991
+ cssName: "grid-row",
992
+ attrName: "grid-row",
993
+ };
994
+ const attributes = {
995
+ width: width,
996
+ height: height,
997
+ position: position,
998
+ top: top,
999
+ right: right,
1000
+ bottom: bottom,
1001
+ left: left,
1002
+ "font-size": fontSize,
1003
+ "grid-column": gridColumn,
1004
+ "grid-row": gridRow,
1005
+ };
1006
+ const attributesNames = Object.keys(attributes);
1007
+ function getClassName(attr, value) {
1008
+ const valueKey = murmur2(value);
1009
+ return `bn-c-${attr.className}_${valueKey}`;
1010
+ }
1011
+ function getStyle(attr, className, value) {
1012
+ return `.${className} {${attr.cssName}: ${value};}`;
1013
+ }
1014
+ function getCSS(attr, value) {
1015
+ const className = getClassName(attr, value);
1016
+ const style = getStyle(attr, className, value);
1017
+ return { className, style };
1018
+ }
1019
+ const apply = (el) => {
1020
+ const map = new Map();
1021
+ //map.set("position", getCSS(attributes["position"], "absolute"))
1022
+ attributesNames.forEach((name) => {
1023
+ const value = el.getAttribute(name);
1024
+ if (value) {
1025
+ if (["top", "left", "right", "bottom"].includes(name)) {
1026
+ map.set("position", getCSS(attributes["position"], "absolute"));
1027
+ }
1028
+ const transform = attributes[name].transform ||
1029
+ function (v) {
1030
+ return v;
1031
+ };
1032
+ map.set(name, getCSS(attributes[name], transform(value)));
1033
+ }
1034
+ });
1035
+ return map;
1036
+ };
1037
+
1038
+ /**
1039
+ * Shared MutationObserver that watches for style-attribute changes on all
1040
+ * subscribed elements. When a monitored attribute changes, it re-applies the
1041
+ * Styletron CSS-in-JS stylesheet and updates the element's className,
1042
+ * preserving any non-`bn-c-` classes.
1043
+ */
1044
+ const observer = new MutationObserver((mutations) => {
1045
+ for (const mutation of mutations) {
1046
+ const el = mutation.target;
1047
+ const map = apply(el);
1048
+ styleSheet.apply(map);
1049
+ const classes = Array.from(map.values()).map((value) => value.className);
1050
+ el.className = el.className
1051
+ .split(" ")
1052
+ .filter((value) => !value.startsWith("bn-c-"))
1053
+ .concat(...classes)
1054
+ .join(" ");
1055
+ index.forceUpdate(el);
1056
+ }
1057
+ });
1058
+ /**
1059
+ * Registers an element with the Styletron observer: applies the initial
1060
+ * stylesheet, assigns generated `bn-c-*` class names, and begins watching
1061
+ * for attribute mutations that affect styling.
1062
+ */
1063
+ const subscribe = (el) => {
1064
+ const map = apply(el);
1065
+ styleSheet.apply(map);
1066
+ const classes = Array.from(map.values()).map((value) => value.className);
1067
+ el.className = el.className
1068
+ .split(" ")
1069
+ .filter((value) => !value.startsWith("bn-c-"))
1070
+ .concat(...classes)
1071
+ .join(" ");
1072
+ observer.observe(el, { attributes: true, attributeFilter: attributesNames, childList: false, subtree: false });
1073
+ };
1074
+ /**
1075
+ * Mixin that integrates Styletron CSS-in-JS styling into a Stencil component.
1076
+ *
1077
+ * On `connectedCallback`, it subscribes the host element to a shared
1078
+ * MutationObserver that watches for style-related attribute changes. When
1079
+ * attributes change, the Styletron stylesheet is re-applied and the element's
1080
+ * class list is updated with generated `bn-c-*` class names, followed by a
1081
+ * forced re-render.
1082
+ *
1083
+ * @param component - The Stencil component instance
1084
+ */
1085
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1086
+ const withStyled = (component) => {
1087
+ const cstrConnectedCallback = component["connectedCallback"];
1088
+ const cstrDisconnectedCallback = component["disconnectedCallback"];
1089
+ component["connectedCallback"] = () => {
1090
+ const elm = index.getElement(component);
1091
+ if (elm) {
1092
+ subscribe(elm);
1093
+ }
1094
+ else {
1095
+ throw new Error(`Can't find element field in component ${undefined}`);
1096
+ }
1097
+ withHasError.runIfExisits(cstrConnectedCallback, component);
1098
+ };
1099
+ component["disconnectedCallback"] = () => {
1100
+ // MutationObserver has no per-element unobserve — the shared observer
1101
+ // automatically stops firing for elements removed from the DOM.
1102
+ withHasError.runIfExisits(cstrDisconnectedCallback, component);
1103
+ };
1104
+ };
1105
+
1106
+ exports.DateStringFactory = DateStringFactory;
1107
+ exports.isBlankInput = isBlankInput;
1108
+ exports.isTableBarColumnWidth = isTableBarColumnWidth;
1109
+ exports.isTableCategoryWidth = isTableCategoryWidth;
1110
+ exports.isValidAxisLabelsMode = isValidAxisLabelsMode;
1111
+ exports.isValidBoolean = isValidBoolean;
1112
+ exports.isValidDataFormat = isValidDataFormat;
1113
+ exports.isValidDate = isValidDate;
1114
+ exports.isValidDateFormat = isValidDateFormat;
1115
+ exports.isValidDateLink = isValidDateLink;
1116
+ exports.isValidDirection = isValidDirection;
1117
+ exports.isValidInteger = isValidInteger;
1118
+ exports.isValidLevel = isValidLevel;
1119
+ exports.isValidMeasureScale = isValidMeasureScale;
1120
+ exports.isValidMeasureToken = isValidMeasureToken;
1121
+ exports.isValidMeasureType = isValidMeasureType;
1122
+ exports.isValidNumber = isValidNumber;
1123
+ exports.isValidTableType = isValidTableType;
1124
+ exports.murmur2 = murmur2;
1125
+ exports.parseTableAttributeExpression = parseTableAttributeExpression;
1126
+ exports.validateAttributesJsonStr = validateAttributesJsonStr;
1127
+ exports.validateBarColumnsList = validateBarColumnsList;
1128
+ exports.validateColumnThereOfJsonStr = validateColumnThereOfJsonStr;
1129
+ exports.validateMeasureList = validateMeasureList;
1130
+ exports.validateOrderList = validateOrderList;
1131
+ exports.validatePartOfJsonStr = validatePartOfJsonStr;
1132
+ exports.validateScenarioList = validateScenarioList;
1133
+ exports.validateStackConfig = validateStackConfig;
1134
+ exports.validateThereOfJsonStr = validateThereOfJsonStr;
1135
+ exports.validateVariancesList = validateVariancesList;
1136
+ exports.withComponentStyle = withComponentStyle;
1137
+ exports.withStyled = withStyled;