@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 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as s,Fragment as a,transformTag as i}from"@stencil/core/internal/client";import{a as r}from"./withHasError.js";import{d as n}from"./bn-body2.js";import{d as o}from"./bn-footer2.js";import{d as l}from"./bn-message2.js";import{d as c}from"./bn-page2.js";import{d as m}from"./bn-title2.js";import{d}from"./ibcs-title2.js";const b=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.messageText="",this.messageImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.footerDisplayPageNumber=!0,this.pageLayout="full",this.pageCustomTemplate='"a b" "c d"',this.pageGridGap="0",this.pageFitToContent=!1,this.templateMap=new Map([["split-vertical",'"a b"'],["split-horizontal",'"a" "b"'],["2x2",'"a b" "c d"'],["3x3",'"a b c" "d e f" "g h i"'],["4x4",'"a b c d" "e f g h" "i j k l" "m n o p"'],["1-over-2",'"a a" "b c"'],["2-over-1",'"a b" "c c"'],["1-over-3",'"a a a " "b c d"'],["3-over-1",'"a b c" "d d d"'],["custom-template",'"a b" "c c c"'],["gold3",'"a c" "b c"'],["gold4",'"a b c c" "d d c c"']]),this.errors=r(this)}getCommonStyles(){let t="100%";return!0===this.pageFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.pageGridGap+"px"}}getRowCount(t){const e=this.getTemplateAreas(t).match(/"[\w\d\s.]+"/g);return e?e.length:1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.pageFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplateAreas(this.pageLayout),"grid-template-columns":this.getGridTemplateColumns(this.pageLayout),"grid-template-rows":this.getGridTemplateRows(this.pageLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(a,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"slot-"+e})))))}extractSlotNames(t){if(null==t)return[];const e=t.match(/\b\w+\b/g);return e?Array.from(new Set(e)):[]}getTemplateAreas(t){return!1===this.templateMap.has(t)&&"custom-template"!==t?'"a"':"custom-template"===t?this.pageCustomTemplate:this.templateMap.get(t)}calculateFractions(t){const e=t.trim().split(/\s+/).length;return 0===e?"minmax(0, 1fr)":Array(e).fill("minmax(0, 1fr)").join(" ")}getGridTemplateColumns(t){if(!1===this.templateMap.has(t)&&"custom-template"!==t)return"1fr";let e;e="custom-template"===t?this.pageCustomTemplate:this.templateMap.get(t);const s=e.match(/"[\w\d\s.]+"/g);return this.calculateFractions(s[0])}async getNumberOfSlot(t){const e=this.getTemplateAreas(t);return this.extractSlotNames(e).length}componentDidUpdate(){const t=this.element.closest("bn-context").getAttribute("render-orientation");if(t&&t!==this.pageOrientation){const t=this.element.shadowRoot.querySelector("bn-page"),e=this.element.closest("bn-layout-page");e&&t&&(t.style.transform="rotate(-90deg) translate(-100%)",t.style.transformOrigin="top left",e.style.width=t.clientHeight+"px",e.style.height=t.clientWidth+"px")}}render(){var t;const e=this.getLayoutStyle(),a=this.extractSlotNames(e["grid-template-areas"]);return s("bn-page",{key:"6ce75e58dfb8ccab0686d8f34cc6f7830fd42db7",styles:this.styles,"selected-style":this.selectedStyle,format:this.pageFormat,orientation:this.pageOrientation},s("bn-message",{key:"0b7f297afe281b0df05691485a93ba6c3d8abbae",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"b02de31fa8f7e03c38e12cd45ec7f02e2d986d70","i18n-namespace":null!==(t=this.i18nNamespace)&&void 0!==t?t:this.titleNamespace,ruleset:this.ruleset,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),s("bn-body",{key:"8d43429effcb755ee69665820120838c60b8b9d1"},s("div",{key:"f2d61818b1272551c73bf174f91f61904799a780",style:e,"data-bn-fit-content":this.pageFitToContent?this.getRowCount(this.pageLayout)+"":null},this.getSlots(a))),s("bn-footer",{key:"8d6a6d76c7bef823ee7063586e87084654705771",text:this.footerText,"page-number":this.pageNumber,"display-page-number":this.footerDisplayPageNumber}))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:block;overflow:hidden}::slotted(*){flex:1 1 auto;min-width:0}'}},[257,"bn-layout-page",{styles:[1],selectedStyle:[1,"selected-style"],ruleset:[1],messageText:[1,"message-text"],messageImage:[1,"message-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],i18nNamespace:[513,"i18n-namespace"],pageFormat:[1,"page-format"],pageOrientation:[1,"page-orientation"],pageNumber:[1,"page-number"],footerText:[1,"footer-text"],footerDisplayPageNumber:[4,"footer-display-page-number"],pageLayout:[1,"page-layout"],pageCustomTemplate:[1,"page-custom-template"],pageGridGap:[1,"page-grid-gap"],pageFitToContent:[4,"page-fit-to-content"],getNumberOfSlot:[64]}]),h=b,p=function(){"undefined"!=typeof customElements&&["bn-layout-page","bn-body","bn-footer","bn-message","bn-page","bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-layout-page":customElements.get(i(t))||customElements.define(i(t),b);break;case"bn-body":customElements.get(i(t))||n();break;case"bn-footer":customElements.get(i(t))||o();break;case"bn-message":customElements.get(i(t))||l();break;case"bn-page":customElements.get(i(t))||c();break;case"bn-title":customElements.get(i(t))||m();break;case"ibcs-title":customElements.get(i(t))||d()}}))};export{h as BnLayoutPage,p as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as s,Fragment as a,Host as i,transformTag as r}from"@stencil/core/internal/client";import{s as o}from"./pageFormats.js";import{w as n}from"./withComponentStatus.js";import{w as l}from"./withHasError.js";import{a as m,b as d,c as h,t as c,i as b,C as p,d as u}from"./layoutTemplate.js";import{d as g}from"./bn-body2.js";import{d as f}from"./bn-footer2.js";import{d as y}from"./bn-message2.js";import{d as k}from"./bn-page2.js";import{d as v}from"./bn-title2.js";import{d as w}from"./ibcs-title2.js";const x=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.messageText="",this.messageImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.footerDisplayPageNumber=!0,this.pageLayout="full",this.pageCustomTemplate='"a b" "c d"',this.pageGridGap="0",this.pageFitToContent=!1,n(this),this.errors=l(this)}getCommonStyles(){let t="100%";return!0===this.pageFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.pageGridGap+"px"}}getRowCount(t){return m(this.getTemplateAreas(t)).length||1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.pageFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplateAreas(this.pageLayout),"grid-template-columns":this.getGridTemplateColumns(this.pageLayout),"grid-template-rows":this.getGridTemplateRows(this.pageLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(a,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"slot-"+e})))))}extractSlotNames(t){return d(t)}getTemplateAreas(t){return h(t,this.pageCustomTemplate)}getGridTemplateColumns(t){return b(t)?c(this.getTemplateAreas(t)):"1fr"}async getNumberOfSlot(t){const e=this.getTemplateAreas(t);return this.extractSlotNames(e).length}mirror(t,e){null==e?this.element.hasAttribute(t)&&this.element.removeAttribute(t):this.element.getAttribute(t)!==e&&this.element.setAttribute(t,e)}componentWillRender(){this.mirror("page-format",this.pageFormat),this.mirror("page-orientation",this.pageOrientation);const t=this.pageLayout===p?u(this.pageCustomTemplate):void 0;t?this.errors.addOrReplace({id:"ERR_pageCustomTemplate",type:"warning",message:"pageCustomTemplate: "+t}):this.errors.remove("ERR_pageCustomTemplate")}rotation(){var t;const e=null===(t=this.element.closest("bn-context"))||void 0===t?void 0:t.getAttribute("render-orientation"),s=o(this.pageFormat,this.pageOrientation,e);if(s.turned)return{host:{width:s.width,height:s.height},page:{transform:"rotate(-90deg) translate(-100%)",transformOrigin:"top left"}}}render(){var t;const e=this.getLayoutStyle(),a=this.extractSlotNames(e["grid-template-areas"]),r=this.rotation();return s(i,{key:"ab0aa5ecfd46b0cd8dfbf14d51adfc269c539e75",style:null==r?void 0:r.host},s("bn-page",{key:"fe6c5e57a982b1ac45215a9673e78e3b692e4877",styles:this.styles,"selected-style":this.selectedStyle,format:this.pageFormat,orientation:this.pageOrientation,style:null==r?void 0:r.page},s("bn-message",{key:"d8b71030848157c6ae53fa2923d89fd528946e6c",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"77cca44524b0414868b953c83df711445bdf2d55","i18n-namespace":null!==(t=this.i18nNamespace)&&void 0!==t?t:this.titleNamespace,ruleset:this.ruleset,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),s("bn-body",{key:"f701dd8428a20babaffff8410c76d8a3cc05f1e3"},s("div",{key:"379a923754c6517e9834a4ab9aed6b956c3593a8",style:e,"data-bn-fit-content":this.pageFitToContent?this.getRowCount(this.pageLayout)+"":null},this.getSlots(a))),s("bn-footer",{key:"a1373cbbd4a81c34d86d48a56d7bf1a9f5baa543",text:this.footerText,"page-number":this.pageNumber,"display-page-number":this.footerDisplayPageNumber})))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:block;overflow:hidden}::slotted(*){flex:1 1 auto;min-width:0}'}},[257,"bn-layout-page",{styles:[1],selectedStyle:[1,"selected-style"],ruleset:[1],messageText:[1,"message-text"],messageImage:[1,"message-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],i18nNamespace:[513,"i18n-namespace"],pageFormat:[1,"page-format"],pageOrientation:[1,"page-orientation"],pageNumber:[1,"page-number"],footerText:[1,"footer-text"],footerDisplayPageNumber:[4,"footer-display-page-number"],pageLayout:[1,"page-layout"],pageCustomTemplate:[1,"page-custom-template"],pageGridGap:[1,"page-grid-gap"],pageFitToContent:[4,"page-fit-to-content"],getNumberOfSlot:[64]}]),E=x,j=function(){"undefined"!=typeof customElements&&["bn-layout-page","bn-body","bn-footer","bn-message","bn-page","bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-layout-page":customElements.get(r(t))||customElements.define(r(t),x);break;case"bn-body":customElements.get(r(t))||g();break;case"bn-footer":customElements.get(r(t))||f();break;case"bn-message":customElements.get(r(t))||y();break;case"bn-page":customElements.get(r(t))||k();break;case"bn-title":customElements.get(r(t))||v();break;case"ibcs-title":customElements.get(r(t))||w()}}))};export{E as BnLayoutPage,j as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as s,Host as i,transformTag as n}from"@stencil/core/internal/client";import{w as o,a as r}from"./withHasError.js";import{w as a}from"./withComponentStyle.js";import{g as l}from"./context-protocol.js";import{s as d}from"./sanitizeHtml.js";const c=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),o(this),this.errors=r(this),this.componentStyle=a(this)}connectedCallback(){this.stores=l(this.element)}getFontStyles(){return this.componentStyle((e=>{var t,s,i,n;return{"--bn-font-family":(null===(t=e.global)||void 0===t?void 0:t.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(s=e.global)||void 0===s?void 0:s.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(i=e.global)||void 0===i?void 0:i.fontColor)||"#000000","--bn-font-background":(null===(n=e.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(e){if(null==e||""===e)return"";const t=this.stores.assets.state;return e.startsWith("asset:")?t[e.substring(6)]:t[e]||e}render(){return s(i,{key:"9ddcd517464de7fce9fda3c67a6b4c803e6ac4b9",id:this.text||this.image?"container-page-message":"container",style:this.getFontStyles()},s("div",{key:"4618ec0f8cf5b6573278dee2ceb861ca2ad7984d",id:"message-text"},null!=this.text&&""!==this.text?s("span",{class:"note",innerHTML:d(this.text)}):""),s("div",{key:"c8c090354330d866fd8431e2df345153bf537c30",id:"page-image"},null!=this.image&&""!==this.image?s("img",{class:"image",src:this.prepareAssetUrl(this.image)}):""))}static get assetsDirs(){return["assets"]}get element(){return this}static get style(){return':host{padding:0.2em 0.5em;display:flex;flex-direction:row;justify-content:space-between;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}:host(#container-page-message){min-height:4.55em;box-sizing:border-box;-webkit-box-sizing:border-box;border-bottom:0.1em solid #ddd}div#message-text{font-size:1.4em;overflow:clip;display:inline}span.note p{margin:0}.image{z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:block}'}},[1,"bn-message",{text:[1025],image:[1]}]);function m(){"undefined"!=typeof customElements&&["bn-message"].forEach((e=>{"bn-message"===e&&(customElements.get(n(e))||customElements.define(n(e),c))}))}export{c as F,m as d}
1
+ import{proxyCustomElement as e,HTMLElement as t,h as s,Host as i,transformTag as n}from"@stencil/core/internal/client";import{w as o}from"./withComponentStatus.js";import{w as r}from"./withComponentStyle.js";import{g as a}from"./context-protocol.js";import{w as l}from"./withHasError.js";import{s as m}from"./sanitizeHtml.js";const c=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),o(this),this.errors=l(this),this.componentStyle=r(this)}connectedCallback(){this.stores=a(this.element)}getFontStyles(){return this.componentStyle((e=>{var t,s,i,n;return{"--bn-font-family":(null===(t=e.global)||void 0===t?void 0:t.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(s=e.global)||void 0===s?void 0:s.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(i=e.global)||void 0===i?void 0:i.fontColor)||"#000000","--bn-font-background":(null===(n=e.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(e){if(null==e||""===e)return"";const t=this.stores.assets.state;return e.startsWith("asset:")?t[e.substring(6)]:t[e]||e}render(){return s(i,{key:"b9edc58322ef8a1932030f6e601a094c12905ef6",id:this.text||this.image?"container-page-message":"container",style:this.getFontStyles()},s("div",{key:"d7b93d754a4063534d8fe022511161715a4c595b",id:"message-text"},null!=this.text&&""!==this.text?s("span",{class:"note",innerHTML:m(this.text)}):""),s("div",{key:"f140147c0ab1c9882eba74ec56e0ce011894eb6f",id:"page-image"},null!=this.image&&""!==this.image?s("img",{class:"image",src:this.prepareAssetUrl(this.image)}):""))}static get assetsDirs(){return["assets"]}get element(){return this}static get style(){return':host{padding:0.2em 0.5em;display:flex;flex-direction:row;justify-content:space-between;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}:host(#container-page-message){min-height:4.55em;box-sizing:border-box;-webkit-box-sizing:border-box;border-bottom:0.1em solid #ddd}div#message-text{font-size:1.4em;overflow:clip;display:inline}span.note p{margin:0}.image{z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:block}'}},[1,"bn-message",{text:[1025],image:[1]}]);function d(){"undefined"!=typeof customElements&&["bn-message"].forEach((e=>{"bn-message"===e&&(customElements.get(n(e))||customElements.define(n(e),c))}))}export{c as F,d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as i,h as o,Host as a,transformTag as n}from"@stencil/core/internal/client";import{i as h}from"./validate.js";import{w as e,a as r}from"./withHasError.js";import{w as s}from"./withComponentStyle.js";const d=["xga","hd","full-hd","4k","4k2k","a4","a3","a2","a1","a0","letter","legal"],f=["landscape","portrait"],p=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),e(this),this.errors=r(this),this.componentStyle=s(this)}validateFormat(t){const i="ERR_format";h(t)||d.includes(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`format: invalid value '${t}' is not supported. Valid values: ${d.join(", ")}`})}validateOrientation(t){const i="ERR_orientation";h(t)||f.includes(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`orientation: invalid value '${t}' is not supported. Valid values: ${f.join(", ")}`})}render(){return o(a,{key:"8a24c1c3d796d335826e9dec5e73415a44cf6a1e",format:this.format,orientation:this.orientation,style:this.prepareStyle()},o("slot",{key:"23a59d11c2ac469047e11a7bf189e041bb58928b"}))}prepareStyle(){return{"font-family":this.componentStyle((t=>t.global.fontFamily)),"font-size":`${this.componentStyle((t=>t.global.fontSizePx))}px`,"--bn-font-family":this.componentStyle((t=>t.global.fontFamily))||"'Noto Sans', sans-serif","--bn-font-size":`${this.componentStyle((t=>t.global.fontSizePx))||13.3333}px`,"--bn-font-color":this.componentStyle((t=>t.global.fontColor))||"#000000","--bn-font-background":this.componentStyle((t=>t.global.fontBackgroundColor))||"#ffffff"}}get element(){return this}static get watchers(){return{format:[{validateFormat:0}],orientation:[{validateOrientation:0}]}}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);height:768px;width:1024px;display:flex;flex-direction:column;page-break-after:always;overflow:hidden}:host([format=xga]){height:768px;width:1024px}:host([format=xga][orientation=portrait]){height:1024px;width:768px}:host([format=xga][orientation=landscape]){height:768px;width:1024px}:host([format=hd]){height:720px;width:1280px}:host([format=hd][orientation=portrait]){height:1280px;width:720px}:host([format=hd][orientation=landscape]){height:720px;width:1280px}:host([format=full_hd]){height:1080px;width:1920px}:host([format=full_hd][orientation=portrait]){height:1920px;width:1080px}:host([format=full_hd][orientation=landscape]){height:1080px;width:1920px}:host([format="4k"]){height:2160px;width:3840px}:host([format="4k"][orientation=portrait]){height:3840px;width:2160px}:host([format="4k"][orientation=landscape]){height:2160px;width:3840px}:host([format="4k2k"]){height:2160px;width:4096px}:host([format="4k2k"][orientation=portrait]){height:4096px;width:2160px}:host([format="4k2k"][orientation=landscape]){height:2160px;width:4096px}:host([format=a6]){height:5.83in;width:4.13in}:host([format=a6][orientation=portrait]){height:5.83in;width:4.13in}:host([format=a6][orientation=landscape]){height:4.13in;width:5.83in}:host([format=a5]){height:8.27in;width:5.83in}:host([format=a5][orientation=portrait]){height:8.27in;width:5.83in}:host([format=a5][orientation=landscape]){height:5.83in;width:8.27in}:host([format=a4]){height:11.6in;width:8.17in}:host([format=a4][orientation=portrait]){height:11.6in;width:8.17in}:host([format=a4][orientation=landscape]){height:8.17in;width:11.6in}:host([format=a3]){height:16.54in;width:11.7in}:host([format=a3][orientation=portrait]){height:16.54in;width:11.7in}:host([format=a3][orientation=landscape]){height:11.7in;width:16.54in}:host([format=a2]){height:23.4in;width:16.54in}:host([format=a2][orientation=portrait]){height:23.4in;width:16.54in}:host([format=a2][orientation=landscape]){height:16.54in;width:23.4in}:host([format=a1]){height:33.1in;width:23.4in}:host([format=a1][orientation=portrait]){height:33.1in;width:23.4in}:host([format=a1][orientation=landscape]){height:23.4in;width:33.1in}:host([format=a0]){height:46.8in;width:33.1in}:host([format=a0][orientation=portrait]){height:46.8in;width:33.1in}:host([format=a0][orientation=landscape]){height:33.1in;width:46.8in}:host([format=letter]){height:11in;width:8.5in}:host([format=letter][orientation=portrait]){height:11in;width:8.5in}:host([format=letter][orientation=landscape]){height:8.5in;width:11in}:host([format=legal]){height:14in;width:8.5in}:host([format=legal][orientation=portrait]){height:14in;width:8.5in}:host([format=legal][orientation=landscape]){height:8.5in;width:14in}:host([format=tabloid]){height:17in;width:11in}:host([format=tabloid][orientation=portrait]){height:17in;width:11in}:host([format=tabloid][orientation=landscape]){height:11in;width:17in}:host([format=ledger]){height:11in;width:17in}:host([format=ledger][orientation=portrait]){height:17in;width:11in}:host([format=ledger][orientation=landscape]){height:11in;width:17in}'}},[257,"bn-page",{format:[1],orientation:[1]},void 0,{format:[{validateFormat:0}],orientation:[{validateOrientation:0}]}]);function l(){"undefined"!=typeof customElements&&["bn-page"].forEach((t=>{"bn-page"===t&&(customElements.get(n(t))||customElements.define(n(t),p))}))}export{p as P,l as d}
1
+ import{proxyCustomElement as t,HTMLElement as i,h as a,Host as e,transformTag as o}from"@stencil/core/internal/client";import{i as s}from"./validate.js";import{w as n}from"./withComponentStatus.js";import{w as r}from"./withComponentStyle.js";import{w as f}from"./withHasError.js";import{V as l,a as h,p as m}from"./pageFormats.js";const d=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),n(this),this.errors=f(this),this.componentStyle=r(this)}validateFormat(t){const i="ERR_format";s(t)||l.includes(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`format: invalid value '${t}' is not supported. Valid values: ${l.join(", ")}`})}validateOrientation(t){const i="ERR_orientation";s(t)||h.includes(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`orientation: invalid value '${t}' is not supported. Valid values: ${h.join(", ")}`})}componentWillLoad(){this.validateFormat(this.format),this.validateOrientation(this.orientation)}render(){return a(e,{key:"81cbdaed9d6fc9325cab39fff23e7f588aa0aab0",format:this.format,orientation:this.orientation,style:this.prepareStyle()},a("slot",{key:"ba63b8dbed121cba3eb7e1a5bf5d3d496a030707"}))}prepareStyle(){const t={"font-family":this.componentStyle((t=>t.global.fontFamily)),"font-size":`${this.componentStyle((t=>t.global.fontSizePx))}px`,"--bn-font-family":this.componentStyle((t=>t.global.fontFamily))||"'Noto Sans', sans-serif","--bn-font-size":`${this.componentStyle((t=>t.global.fontSizePx))||13.3333}px`,"--bn-font-color":this.componentStyle((t=>t.global.fontColor))||"#000000","--bn-font-background":this.componentStyle((t=>t.global.fontBackgroundColor))||"#ffffff"};if(l.includes(this.format)){const{width:i,height:a}=m(this.format,this.orientation);t.width=i,t.height=a}return t}get element(){return this}static get watchers(){return{format:[{validateFormat:0}],orientation:[{validateOrientation:0}]}}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);height:768px;width:1024px;display:flex;flex-direction:column;page-break-after:always;overflow:hidden}'}},[257,"bn-page",{format:[1],orientation:[1]},void 0,{format:[{validateFormat:0}],orientation:[{validateOrientation:0}]}]);function c(){"undefined"!=typeof customElements&&["bn-page"].forEach((t=>{"bn-page"===t&&(customElements.get(o(t))||customElements.define(o(t),d))}))}export{d as P,c as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as s,Host as r,transformTag as o}from"@stencil/core/internal/client";import{w as n}from"./withBodyObserver.js";import{g as i}from"./context-protocol.js";import{w as a,a as c}from"./withHasError.js";const l=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.name="_default",a(this),this.errors=c(this),n(this,(t=>{this.stores||(this.stores=i(this.element));try{const e=JSON.parse(t);this.stores.ruleSets.set(this.name,e),this.errors.remove("JSON_PARSE")}catch(t){this.errors.addOrReplace({id:"JSON_PARSE",type:"error",message:"bn-ruleset: Failed to parse JSON body — "+t.message}),console.error(t)}}))}render(){return s(r,{key:"9fa99c590cee15a870554baa592395a50ee0d311"})}get element(){return this}static get style(){return"bn-ruleset{display:none}"}},[0,"bn-ruleset",{name:[1]}]),h=l,m=function(){"undefined"!=typeof customElements&&["bn-ruleset"].forEach((t=>{"bn-ruleset"===t&&(customElements.get(o(t))||customElements.define(o(t),l))}))};export{h as BnRuleset,m as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as s,Host as r,transformTag as o}from"@stencil/core/internal/client";import{w as n}from"./withBodyObserver.js";import{g as i}from"./context-protocol.js";import{w as c}from"./withComponentStatus.js";import{w as a}from"./withHasError.js";const m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.name="_default",c(this),this.errors=a(this),n(this,(t=>{this.stores||(this.stores=i(this.element));try{const e=JSON.parse(t);this.stores.ruleSets.set(this.name,e),this.errors.remove("JSON_PARSE")}catch(t){this.errors.addOrReplace({id:"JSON_PARSE",type:"error",message:"bn-ruleset: Failed to parse JSON body - "+t.message}),console.error(t)}}))}render(){return s(r,{key:"e5edadc4e95e62fc5c75190661f0aaab84e933b5"})}get element(){return this}static get style(){return"bn-ruleset{display:none}"}},[0,"bn-ruleset",{name:[1]}]),l=m,h=function(){"undefined"!=typeof customElements&&["bn-ruleset"].forEach((t=>{"bn-ruleset"===t&&(customElements.get(o(t))||customElements.define(o(t),m))}))};export{l as BnRuleset,h as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as i,h as t,Host as s,transformTag as n}from"@stencil/core/internal/client";import{g as a}from"./context-protocol.js";import{a as r,f as o}from"./scaling.js";import{w as u,a as h}from"./withHasError.js";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),u(this),this.errors=h(this)}connectedCallback(){this.stores=a(this.element),this.pushToStore()}disconnectedCallback(){this.removeEntryIfOurs(this.storedName)}onNameChange(e,i){const t=null==i?void 0:(""+i).trim();t&&t!==(null==e?void 0:(""+e).trim())&&this.removeEntryIfOurs(t),this.pushToStore()}onValueChange(){this.pushToStore()}removeEntryIfOurs(e){e&&this.stores&&(this.storedName===e&&this.stores.scalingGroups.state[e]===this.storedValue&&this.stores.scalingGroups.set(e,void 0),this.storedName===e&&(this.storedName=void 0,this.storedValue=void 0))}pushToStore(){var e;if(!this.stores)return;const i=null===(e=this.name)||void 0===e?void 0:(""+e).trim(),t=r(i);if("auto"===t.kind)return void this.errors.addOrReplace({id:"ERR_reserved_name",type:"warning",message:'bn-scaling-group: name "auto" is reserved and cannot be used.'});if(this.errors.remove("ERR_reserved_name"),!i)return void this.errors.addOrReplace({id:"ERR_empty_name",type:"warning",message:"bn-scaling-group: name is required."});if(this.errors.remove("ERR_empty_name"),"number"===t.kind)return void this.errors.addOrReplace({id:"ERR_numeric_name",type:"warning",message:`bn-scaling-group: name "${i}" is not allowed — it would be ambiguous with a numeric scaling value.`});this.errors.remove("ERR_numeric_name");const s=r(this.value);if("number"!==s.kind)return void this.errors.addOrReplace({id:"ERR_invalid_value",type:"warning",message:`bn-scaling-group: invalid value "${this.value}" — must be a positive number, optionally with k/M/G/T suffix.`});this.errors.remove("ERR_invalid_value");const n=this.stores.scalingGroups.state[i];void 0===n||n===s.value||this.storedName===i&&this.storedValue===n?this.errors.remove("WARN_duplicate_group"):this.errors.addOrReplace({id:"WARN_duplicate_group",type:"warning",message:`bn-scaling-group: "${i}" is already registered with a different value (${o(n)}); overwriting.`}),this.storedName&&this.storedName!==i&&this.removeEntryIfOurs(this.storedName),this.stores.scalingGroups.set(i,s.value),this.storedName=i,this.storedValue=s.value}render(){return t(s,{key:"7b125b03953f91d15c6c9df7ca178c9f33b054cc"})}get element(){return this}static get watchers(){return{name:[{onNameChange:0}],value:[{onValueChange:0}]}}static get style(){return"bn-scaling-group{display:none}"}},[0,"bn-scaling-group",{name:[1],value:[8]},void 0,{name:[{onNameChange:0}],value:[{onValueChange:0}]}]),c=l,m=function(){"undefined"!=typeof customElements&&["bn-scaling-group"].forEach((e=>{"bn-scaling-group"===e&&(customElements.get(n(e))||customElements.define(n(e),l))}))};export{c as BnScalingGroup,m as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as i,h as t,Host as s,transformTag as n}from"@stencil/core/internal/client";import{g as a}from"./context-protocol.js";import{a as r,f as o}from"./scaling.js";import{w as u}from"./withComponentStatus.js";import{w as h}from"./withHasError.js";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),u(this),this.errors=h(this)}connectedCallback(){this.stores=a(this.element),this.pushToStore()}disconnectedCallback(){this.removeEntryIfOurs(this.storedName)}onNameChange(e,i){const t=null==i?void 0:(""+i).trim();t&&t!==(null==e?void 0:(""+e).trim())&&this.removeEntryIfOurs(t),this.pushToStore()}onValueChange(){this.pushToStore()}removeEntryIfOurs(e){e&&this.stores&&(this.storedName===e&&this.stores.scalingGroups.state[e]===this.storedValue&&this.stores.scalingGroups.set(e,void 0),this.storedName===e&&(this.storedName=void 0,this.storedValue=void 0))}pushToStore(){var e;if(!this.stores)return;const i=null===(e=this.name)||void 0===e?void 0:(""+e).trim(),t=r(i);if("auto"===t.kind)return void this.errors.addOrReplace({id:"ERR_reserved_name",type:"warning",message:'bn-scaling-group: name "auto" is reserved and cannot be used.'});if(this.errors.remove("ERR_reserved_name"),!i)return void this.errors.addOrReplace({id:"ERR_empty_name",type:"warning",message:"bn-scaling-group: name is required."});if(this.errors.remove("ERR_empty_name"),"number"===t.kind)return void this.errors.addOrReplace({id:"ERR_numeric_name",type:"warning",message:`bn-scaling-group: name "${i}" is not allowed - it would be ambiguous with a numeric scaling value.`});this.errors.remove("ERR_numeric_name");const s=r(this.value);if("number"!==s.kind)return void this.errors.addOrReplace({id:"ERR_invalid_value",type:"warning",message:`bn-scaling-group: invalid value "${this.value}" - must be a positive number, optionally with k/M/G/T suffix.`});this.errors.remove("ERR_invalid_value");const n=this.stores.scalingGroups.state[i];void 0===n||n===s.value||this.storedName===i&&this.storedValue===n?this.errors.remove("WARN_duplicate_group"):this.errors.addOrReplace({id:"WARN_duplicate_group",type:"warning",message:`bn-scaling-group: "${i}" is already registered with a different value (${o(n)}); overwriting.`}),this.storedName&&this.storedName!==i&&this.removeEntryIfOurs(this.storedName),this.stores.scalingGroups.set(i,s.value),this.storedName=i,this.storedValue=s.value}render(){return t(s,{key:"ffdeed9b4a44d43a51950fd400325a5298468f34"})}get element(){return this}static get watchers(){return{name:[{onNameChange:0}],value:[{onValueChange:0}]}}static get style(){return"bn-scaling-group{display:none}"}},[0,"bn-scaling-group",{name:[1],value:[8]},void 0,{name:[{onNameChange:0}],value:[{onValueChange:0}]}]),m=l,d=function(){"undefined"!=typeof customElements&&["bn-scaling-group"].forEach((e=>{"bn-scaling-group"===e&&(customElements.get(n(e))||customElements.define(n(e),l))}))};export{m as BnScalingGroup,d as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as i,writeTask as e,h as a,Host as s,transformTag as r,forceUpdate as n}from"@stencil/core/internal/client";import{v as o,a as l,i as h,q as d,r as u,s as p,l as c,t as v,h as m,u as g,w as f,b as y,c as b,x as S,m as w,y as O,z as T,f as R,A as D,B as _}from"./validate.js";import{w as E,g as M}from"./withDataset.js";import{w as A,a as C}from"./withHasError.js";import{w as F}from"./withScalingGroup.js";import{a as U}from"./context-protocol.js";import{w as N,a as G,i as j}from"./withTranslation.js";import{w as W}from"./withStyled.js";import{w as x}from"./withComponentStyle.js";import{w as P}from"./withRuleSet.js";import{f as I,r as L,p as $}from"./scaling.js";import{o as k}from"./layoutObserver.js";import{D as B,I as J,d as z,M as V,B as q,T as H}from"./CompareUtil.js";import{a as Y,b as Z,T as K,d as Q}from"./ibcs-table2.js";import{O as X,a as tt}from"./Order.js";import{L as it}from"./types.js";import{o as et,m as at}from"./geometry.js";import{r as st,a as rt}from"./diagnostics.js";const nt=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.layoutObserver=null,this._lastScaledParentWidth=0,this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.hasBlankSetnames=!1,this.sumTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling="100",this.percentageScaling="2",this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped="false",this.showMeasureScale="false",this.showGroupTitle="true",this.type="list",this.limit=0,this.thereof="[]",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this.interval="none",this.tableAttributes="",this._autoScaleGuard=!1,this.autoUnitWarningActive=!1,this.autoPctWarningActive=!1,this.handleAutoScalingReport=t=>{var i,e,a,s;this.lastAutoScalingReport={unit:null!==(i=t.unit)&&void 0!==i?i:null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.unit,percentage:null!==(a=t.percentage)&&void 0!==a?a:null===(s=this.lastAutoScalingReport)||void 0===s?void 0:s.percentage};const r=(t,i)=>void 0===i||Math.abs(t-i)>.001*Math.abs(t);if(void 0!==t.unit&&t.unit>0&&this.autoUnitWarningActive){const i=1/t.unit;r(i,this.lastReportedUnitsPerEm)&&(this.lastReportedUnitsPerEm=i,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${this.unitScaling}" — auto-fitted to 1 em ≈ ${I(i)} units.`}))}if(void 0!==t.percentage&&t.percentage>0&&this.autoPctWarningActive){const i=1/t.percentage;r(i,this.lastReportedPpPerEm)&&(this.lastReportedPpPerEm=i,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${this.percentageScaling}" — auto-fitted to 1 em ≈ ${I(i)} percentage points.`}))}},W(this),A(this),this.errors=C(this),F(this),this.componentStyle=x(this),this.ruleSetConfig=P(this),E(this,((t,i)=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1,this.hasBlankSetnames=Array.isArray(i)&&i.some((t=>{var i;return h(null!==(i=null==t?void 0:t.setname)&&void 0!==i?i:null==t?void 0:t.setName)}))}),((t,i)=>{this.datasetMeta=i})),this.t=N(this).t,this.resolveInherited=G(this,[{propName:"scenarios",ancestorAttr:"title-scenarios"},{propName:"variances",ancestorAttr:"title-variances"},{propName:"order",ancestorAttr:"title-order"},{propName:"orderDirection",ancestorAttr:"title-order-direction"}])}validateScenario(t){const i="ERR_scenarios";if(j(t))return void this.errors.remove(i);const e=o(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="ERR_variances";if(j(t))return void this.errors.remove(i);const e=l(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="ERR_barColumns";if(h(t))return void this.errors.remove(i);const e=d(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="ERR_barColumnWidth";u(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="ERR_unitScaling";"invalid"===L(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validatePercentageScaling(t){const i="ERR_percentageScaling";"invalid"===L(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validateDataFormat(t){const i="ERR_dataFormat";p(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateGrouped(t){const i="ERR_grouped";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"grouped: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowMeasureScale(t){const i="ERR_grouped";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowGroupTitle(t){const i="ERR_showGroupTitle";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showGroupTitle: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="ERR_type";v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="ERR_limit";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="ERR_thereof",e=g(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validatePartOf(t){const i="ERR_partof",e=f(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="ERR_order";if(j(t))return void this.errors.remove(i);const e=y(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="ERR_orderDirection";j(t)||b(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="ERR_measureType";S(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="ERR_measureScale";w(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="ERR_dataFormatDigitsDecimal";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="ERR_dataFormatDigitsPercent";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="ERR_categoryWidth";O(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=T(t),e="ERR_categorythereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}validateInterval(t){const i="ERR_interval",e=null==t?void 0:t.trim().toLowerCase();h(t)||e===Y||e===Z||R(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"interval: invalid value '"+t+"' is not supported."})}validateTableAttributes(t){const i="ERR_attributes",e=D(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"attributes: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateGrouped(this.grouped),this.validateShowGroupTitle(this.showGroupTitle),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateInterval(this.interval),this.validateTableAttributes(this.tableAttributes),this.validateShowMeasureScale(this.showMeasureScale),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}componentDidLoad(){this.layoutObserver=k(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=M(this.element);t>0&&Math.abs(t-this._lastScaledParentWidth)>2&&(this._lastScaledParentWidth=t,n(this))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}componentDidRender(){const{mode:t}=$(this.scale);if("auto"!==t&&"empty"!==t)return this._autoScaleGuard=!1,void this.checkOverflow();if(this._autoScaleGuard)return this._autoScaleGuard=!1,void this.checkOverflow();const i=this.element,{width:a}=M(i);if(a<=0)return void this.checkOverflow();this._lastScaledParentWidth=a;const s=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(r<=a+1)return this.errors.remove("AUTO_scale"),void this.checkOverflow();const o=Math.max(.3,n*(a-1)/r);Math.abs(o-n)<.001||(i.style.setProperty("--bn-font-size",s*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,e((()=>{this.appliedScaleFactor=o}))),this.checkOverflow()}checkOverflow(){const t="WARN_overflow",i=M(this.element),e=this.element.scrollWidth,a=this.element.scrollHeight,s=i.width>0&&e>i.width+1,r=i.height>0&&a>i.height+1;if(!s&&!r)return void this.errors.remove(t);const{mode:n}=$(this.scale),o="auto"!==n&&"empty"!==n,l=[];s&&l.push(`width (${Math.round(e)}px > ${Math.round(i.width)}px)`),r&&l.push(`height (${Math.round(a)}px > ${Math.round(i.height)}px)`),this.errors.addOrReplace({id:t,type:o?"error":"warning",message:`Table exceeds available ${l.join(" and ")}. Give the component more space, reduce rows (e.g. limit), or set a smaller scale.`})}prepareDataFormat(){var t;return B[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return"true"===this.grouped}prepareShowGroupTitle(){return"true"===this.showGroupTitle}prepareTableType(){var t;return K[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){return null==this.thereof||""===this.thereof.trim()?[]:JSON.parse(this.thereof)}preparePartOf(){return null==this.partof||""===this.partof.trim()?[]:JSON.parse(this.partof)}prepareOrder(){var t;const i=this.resolveInherited("order",this.order),e=this.resolveInherited("orderDirection",this.orderDirection),a=null!=i?i:this.order,s=null!=e?e:this.orderDirection,r="auto"===(null==a?void 0:a.trim().toLowerCase());let n=a;return r&&(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)&&(n=this.datasetMeta.suggestedOrder),{hierarchy:n.split(",").map((t=>tt[null==t?void 0:t.toUpperCase()])),direction:X[null==s?void 0:s.toUpperCase()]}}prepareI18nMode(){return J.META}prepareI18n(){const t=U,i=new Map(["in","category","operation","there_of","part_of","SUM_TOTAL","no-data","REST"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries()])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,o,l;const d=this.resolveInherited("scenarios",this.scenarios),u=this.resolveInherited("variances",this.variances);if(void 0!==d||void 0!==u){this.errors.remove("AUTO_scenarios");let i=[];return void 0!==d?i=i.concat(d.split(",")):h(this.scenarios)||(i=i.concat(this.scenarios.split(","))),void 0!==u?i=i.concat(u.split(",")):(null===(t=this.variances)||void 0===t?void 0:t.trim().length)>0&&(i=i.concat(this.variances.split(","))),i.map((t=>t.trim()))}const p="auto"===(null===(i=this.scenarios)||void 0===i?void 0:i.trim().toLowerCase());if((h(this.scenarios)||p)&&h(this.variances))return(null===(a=null===(e=this.datasetMeta)||void 0===e?void 0:e.availableScenarios)||void 0===a?void 0:a.length)>0?(p?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),this.datasetMeta.availableScenarios):[];let c=[];return p||h(this.scenarios)?(null===(r=null===(s=this.datasetMeta)||void 0===s?void 0:s.availableScenarios)||void 0===r?void 0:r.length)>0&&(p?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),c=c.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),c=c.concat(null===(n=this.scenarios)||void 0===n?void 0:n.split(","))),(null===(o=this.variances)||void 0===o?void 0:o.trim().length)>0&&(c=c.concat(null===(l=this.variances)||void 0===l?void 0:l.split(","))),c.map((t=>t.trim()))}prepareCategoryWidth(){var t;return h(this.categoryWidth)?z.INF:z[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return h(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareMeasureType(){var t;return h(this.measureType)?V.VOLUME:V[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=JSON.parse(this.columnthereof),i=new Map;for(const[e,a]of Object.entries(t))!1===i.has(a.scenario)&&i.set(a.scenario,[]),i.get(a.scenario).push(a);return i}prepareInterval(){var t;const i="ERR_intervalConflict",e="ERR_intervalNoDate",a="ERR_intervalSetname",s=h(this.interval)?Y:this.interval.trim().toLowerCase();return s!==Y&&s!==Z&&!R(s)||s===Y?(this.errors.remove(i),this.errors.remove(e),this.errors.remove(a),Y):null!=this.columnthereof&&""!==this.columnthereof.trim()?(this.errors.addOrReplace({id:i,type:"warning",message:"interval: cannot be combined with columnthereof, interval is ignored."}),this.errors.remove(e),this.errors.remove(a),Y):(this.errors.remove(i),s===Z?(this.hasBlankSetnames?this.errors.addOrReplace({id:a,type:"warning",message:"interval: rows with blank setname found, they are grouped under '—'."}):this.errors.remove(a),this.errors.remove(e),Z):(this.errors.remove(a),this.datasetMeta&&!(null===(t=this.datasetMeta.dateRange)||void 0===t?void 0:t.hasData)?(this.errors.addOrReplace({id:e,type:"warning",message:"interval: dataset has no date values, interval is ignored."}),Y):(this.errors.remove(e),s)))}prepareAttributes(){if(null==this.tableAttributes||""===this.tableAttributes.trim())return[];try{const t=JSON.parse(this.tableAttributes);return null===t||"object"!=typeof t||t instanceof Array?[]:Object.entries(t).map((([t,i],e)=>"string"==typeof i?_(t,"attr_"+e,i):null)).filter((t=>null!==t))}catch(t){return[]}}prepareSumTitle(){return""===this.sumTitle||null==this.sumTitle?"SUM_TOTAL":this.sumTitle}prepareShowMeasureScale(){return"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=H[i];return e?q[e]:q[H.W10]}prepareBarColumns(){return h(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){const t=L(this.unitScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,0):(this.autoUnitWarningActive=!0,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${t.raw}" — auto-fitting to the bar column width.`}),0)}preparePercentageScaling(){const t=L(this.percentageScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,0):(this.autoPctWarningActive=!0,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${t.raw}" — auto-fitting to the pin area.`}),0)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},date:{type:"string",isOptional:!1,description:""},operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}async getLayoutState(t){var i,e,a,s;const r=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",n=et(this.element),o=this.getEffectiveScaleFactor(),l=Number.isFinite(o)&&o>0?o:1,h=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}))*l,d={version:it,tag:this.element.localName,id:rt(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:at(this.element,n),em:{fontSizePx:h,appliedScaleFactor:l},regions:[],metadata:{},diagnostics:st(this.element),scaling:this.resolveScalingInfo(h)},u=null===(a=this.element.shadowRoot)||void 0===a?void 0:a.querySelector("ibcs-table");if(u){const t=null!==(s=u.scenarios)&&void 0!==s?s:[];if(d.metadata.scenarios=t.filter((t=>!t.startsWith("d"))),d.metadata.variances=t.filter((t=>t.startsWith("d"))),"function"==typeof u.getLayoutDetail){const t=await u.getLayoutDetail(n,r);d.regions=t.regions,d.metadata=Object.assign(Object.assign({},d.metadata),t.metadata),d.diagnostics=[...d.diagnostics,...t.diagnostics],t.elements&&(d.elements=t.elements),t.table&&(d.table=t.table)}}return d}resolveScalingInfo(t){var i,e;const a={},s=L(this.unitScaling,this.pixelPerUnitGroupMap);if("value"===s.kind)a.unitMode="fixed",a.unitsPerEm=s.value,a.unitPxPerUnit=t/s.value;else{a.unitMode="auto";const e=null===(i=this.lastAutoScalingReport)||void 0===i?void 0:i.unit;void 0!==e&&e>0&&(a.unitsPerEm=1/e,a.unitPxPerUnit=e*t)}const r=L(this.percentageScaling,this.pixelPerUnitGroupMap);if("value"===r.kind)a.percentageMode="fixed",a.percentagePointsPerEm=r.value,a.percentagePxPerPoint=t/r.value;else{a.percentageMode="auto";const i=null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.percentage;void 0!==i&&i>0&&(a.percentagePointsPerEm=1/i,a.percentagePxPerPoint=i*t)}return a}getEffectiveScaleFactor(){const{mode:t,factor:i}=$(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return a(s,{key:"10a4b95a0115864ad324efcdffcd10b05b583820",style:t},a("div",{key:"28456489f9d8200ddc89cdd35ca217df347bc2a5"},a("ibcs-table",{key:"c2a19bd85883171a3e1baf3110eeefc1072b4a58",tableName:this.datasetName,dataVersion:this.dataVersion,sumTitle:this.prepareSumTitle(),scenarios:this.prepareScenarios(),scenariosDataFormat:this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),thereof:this.prepareThereOf(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),attributeColumns:this.prepareAttributes(),type:this.prepareTableType(),categoryWidth:this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),i18nMode:this.prepareI18nMode(),measureScale:this.prepareMeasureScale(),measureType:this.prepareMeasureType(),measureUnit:this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),interval:this.prepareInterval(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),reportAutoScaling:this.handleAutoScalingReport,scaleFactor:i,ruleSetConfig:this.ruleSetConfig(),selectedStyle:this.selectedStyle})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],tableAttributes:[{validateTableAttributes:0}]}}static get style(){return':host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-table",{scale:[1],ruleset:[513],selectedStyle:[1,"selected-style"],sumTitle:[1,"sum-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[1],showMeasureScale:[1,"show-measure-scale"],showGroupTitle:[1,"show-group-title"],type:[1],limit:[2],thereof:[1],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],interval:[1],tableAttributes:[1,"attributes"],datasetName:[32],dataVersion:[32],datasetMeta:[32],appliedScaleFactor:[32],hasBlankSetnames:[32],getLayoutState:[64]},void 0,{scale:[{validateScaling:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],tableAttributes:[{validateTableAttributes:0}]}]),ot=nt,lt=function(){"undefined"!=typeof customElements&&["bn-table","ibcs-table"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),nt);break;case"ibcs-table":customElements.get(r(t))||Q()}}))};export{ot as BnTable,lt as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as i,writeTask as e,h as a,Host as s,transformTag as r,forceUpdate as n}from"@stencil/core/internal/client";import{h as o,a as l}from"./context-protocol.js";import{v as h,a as d,i as u,q as p,r as c,s as v,l as m,t as g,h as f,u as y,w as b,b as w,c as S,x as O,m as T,y as R,z as D,f as _,A as E}from"./validate.js";import{w as M}from"./withDataset.js";import{w as A}from"./withComponentStatus.js";import{w as C}from"./withScalingGroup.js";import{w as F,a as x,i as N}from"./withTranslation.js";import{w as U}from"./withStyled.js";import{w as j}from"./withComponentStyle.js";import{w as G}from"./withRuleSet.js";import{w as W}from"./withHasError.js";import{g as P}from"./parentDimensions.js";import{f as I,r as L,p as k}from"./scaling.js";import{o as $}from"./layoutObserver.js";import{D as z,I as J,d as B,M as V,B as q,T as H}from"./CompareUtil.js";import{a as Y,b as Z,T as K,d as Q}from"./ibcs-table2.js";import{p as X}from"./TableAttribute.js";import{a as tt,O as it}from"./Order.js";import{L as et}from"./types.js";import{o as at,m as st}from"./geometry.js";import{r as rt,a as nt}from"./diagnostics.js";import{s as ot}from"./emptyState.js";const lt=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.layoutObserver=null,this._lastScaledParentWidth=0,this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.hasBlankSetnames=!1,this.sumTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling="100",this.percentageScaling="2",this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped="false",this.showMeasureScale="false",this.showGroupTitle="true",this.type="list",this.limit=0,this.thereof="[]",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this.interval="none",this.tableAttributes="",this._autoScaleGuard=!1,this.autoUnitWarningActive=!1,this.autoPctWarningActive=!1,this.handleAutoScalingReport=t=>{var i,e,a,s;this.lastAutoScalingReport={unit:null!==(i=t.unit)&&void 0!==i?i:null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.unit,percentage:null!==(a=t.percentage)&&void 0!==a?a:null===(s=this.lastAutoScalingReport)||void 0===s?void 0:s.percentage};const r=(t,i)=>void 0===i||Math.abs(t-i)>.001*Math.abs(t);if(void 0!==t.unit&&t.unit>0&&this.autoUnitWarningActive){const i=1/t.unit;r(i,this.lastReportedUnitsPerEm)&&(this.lastReportedUnitsPerEm=i,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${this.unitScaling}" - auto-fitted to 1 em ≈ ${I(i)} units.`}))}if(void 0!==t.percentage&&t.percentage>0&&this.autoPctWarningActive){const i=1/t.percentage;r(i,this.lastReportedPpPerEm)&&(this.lastReportedPpPerEm=i,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${this.percentageScaling}" - auto-fitted to 1 em ≈ ${I(i)} percentage points.`}))}},U(this),A(this),this.errors=W(this),C(this),this.componentStyle=j(this),this.ruleSetConfig=G(this),M(this,((t,i)=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1,this.hasBlankSetnames=Array.isArray(i)&&i.some((t=>{var i;return u(null!==(i=null==t?void 0:t.setname)&&void 0!==i?i:null==t?void 0:t.setName)}))}),((t,i)=>{this.datasetMeta=i})),this.t=F(this).t,this.resolveInherited=x(this,[{propName:"scenarios",ancestorAttr:"title-scenarios"},{propName:"variances",ancestorAttr:"title-variances"},{propName:"order",ancestorAttr:"title-order"},{propName:"orderDirection",ancestorAttr:"title-order-direction"}],this.errors)}validateFilter(t){const i="ERR_filter";o(t)?this.errors.addOrReplace({id:i,type:"error",message:"filter: double backticks are not allowed."}):this.errors.remove(i)}validateScenario(t){const i="ERR_scenarios";if(N(t))return void this.errors.remove(i);const e=h(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="ERR_variances";if(N(t))return void this.errors.remove(i);const e=d(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="ERR_barColumns";if(u(t))return void this.errors.remove(i);const e=p(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="ERR_barColumnWidth";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="ERR_unitScaling";"invalid"===L(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validatePercentageScaling(t){const i="ERR_percentageScaling";"invalid"===L(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validateDataFormat(t){const i="ERR_dataFormat";v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateGrouped(t){const i="ERR_grouped";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"grouped: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowMeasureScale(t){const i="ERR_showMeasureScale";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowGroupTitle(t){const i="ERR_showGroupTitle";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showGroupTitle: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="ERR_type";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="ERR_limit";f(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="ERR_thereof",e=y(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validatePartOf(t){const i="ERR_partof",e=b(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="ERR_order";if(N(t))return void this.errors.remove(i);const e=w(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="ERR_orderDirection";N(t)||S(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="ERR_measureType";O(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="ERR_measureScale";T(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="ERR_dataFormatDigitsDecimal";f(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="ERR_dataFormatDigitsPercent";f(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="ERR_categoryWidth";R(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=D(t),e="ERR_categorythereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}validateInterval(t){const i="ERR_interval",e=null==t?void 0:t.trim().toLowerCase();u(t)||e===Y||e===Z||_(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"interval: invalid value '"+t+"' is not supported."})}validateTableAttributes(t){const i="ERR_attributes",e=E(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"attributes: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}componentWillLoad(){this.validateFilter(this.filter),this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateGrouped(this.grouped),this.validateShowGroupTitle(this.showGroupTitle),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateInterval(this.interval),this.validateTableAttributes(this.tableAttributes),this.validateShowMeasureScale(this.showMeasureScale),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}componentDidLoad(){this.layoutObserver=$(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=P(this.element);t>0&&Math.abs(t-this._lastScaledParentWidth)>2&&(this._lastScaledParentWidth=t,n(this))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}componentDidRender(){ot(this.element,"ibcs-table");const{mode:t}=k(this.scale);if("auto"!==t&&"empty"!==t)return this._autoScaleGuard=!1,void this.checkOverflow();if(this._autoScaleGuard)return this._autoScaleGuard=!1,void this.checkOverflow();const i=this.element,{width:a}=P(i);if(a<=0)return void this.checkOverflow();this._lastScaledParentWidth=a;const s=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(r<=a+1)return this.errors.remove("AUTO_scale"),void this.checkOverflow();const o=Math.max(.3,n*(a-1)/r);Math.abs(o-n)<.001||(i.style.setProperty("--bn-font-size",s*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,e((()=>{this.appliedScaleFactor=o}))),this.checkOverflow()}checkOverflow(){const t="WARN_overflow",i=P(this.element),e=this.element.scrollWidth,a=this.element.scrollHeight,s=i.width>0&&e>i.width+1,r=i.height>0&&a>i.height+1;if(!s&&!r)return void this.errors.remove(t);const{mode:n}=k(this.scale),o="auto"!==n&&"empty"!==n,l=[];s&&l.push(`width (${Math.round(e)}px > ${Math.round(i.width)}px)`),r&&l.push(`height (${Math.round(a)}px > ${Math.round(i.height)}px)`),this.errors.addOrReplace({id:t,type:o?"error":"warning",message:`Table exceeds available ${l.join(" and ")}. Give the component more space, reduce rows (e.g. limit), or set a smaller scale.`})}prepareDataFormat(){var t;return z[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return"true"===this.grouped}prepareShowGroupTitle(){return"true"===this.showGroupTitle}prepareTableType(){var t;return K[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){if(null==this.thereof||""===this.thereof.trim())return[];try{return JSON.parse(this.thereof)}catch(t){return[]}}preparePartOf(){if(null==this.partof||""===this.partof.trim())return[];try{return JSON.parse(this.partof)}catch(t){return[]}}prepareOrder(){var t;const i=this.resolveInherited("order",this.order,"category").value,e=this.resolveInherited("orderDirection",this.orderDirection,"asc").value,a="auto"===(null==i?void 0:i.trim().toLowerCase());let s=i;return a&&(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>it[null==t?void 0:t.toUpperCase()])),direction:tt[null==e?void 0:e.toUpperCase()]}}prepareI18nMode(){return J.META}prepareI18n(){const t=l,i=new Map(["in","category","operation","there_of","part_of","SUM_TOTAL","no-data","REST"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries()])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,o,l,h,d;const p=this.resolveInherited("scenarios",this.scenarios),c=this.resolveInherited("variances",this.variances);if(p.inherited||c.inherited){this.errors.remove("AUTO_scenarios");let a=[];return u(p.value)?p.unresolved&&(a=a.concat(null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[])):a=a.concat(p.value.split(",")),(null===(e=c.value)||void 0===e?void 0:e.trim().length)>0&&(a=a.concat(c.value.split(","))),a.map((t=>t.trim()))}const v="auto"===(null===(a=p.value)||void 0===a?void 0:a.trim().toLowerCase()),m=v||p.unresolved;if((u(p.value)||v)&&u(c.value))return(null===(r=null===(s=this.datasetMeta)||void 0===s?void 0:s.availableScenarios)||void 0===r?void 0:r.length)>0?(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),this.datasetMeta.availableScenarios):[];let g=[];return v||u(p.value)?(null===(o=null===(n=this.datasetMeta)||void 0===n?void 0:n.availableScenarios)||void 0===o?void 0:o.length)>0&&(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),g=g.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),g=g.concat(null===(l=p.value)||void 0===l?void 0:l.split(","))),(null===(h=c.value)||void 0===h?void 0:h.trim().length)>0&&(g=g.concat(null===(d=c.value)||void 0===d?void 0:d.split(","))),g.map((t=>t.trim()))}prepareCategoryWidth(){var t;return u(this.categoryWidth)?B.INF:B[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return u(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareMeasureType(){var t;return u(this.measureType)?V.VOLUME:V[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=new Map;try{const i=JSON.parse(this.columnthereof);for(const[e,a]of Object.entries(i))!1===t.has(a.scenario)&&t.set(a.scenario,[]),t.get(a.scenario).push(a)}catch(t){return new Map}return t}prepareInterval(){var t;const i="ERR_intervalConflict",e="ERR_intervalNoDate",a="ERR_intervalSetname",s=u(this.interval)?Y:this.interval.trim().toLowerCase();return s!==Y&&s!==Z&&!_(s)||s===Y?(this.errors.remove(i),this.errors.remove(e),this.errors.remove(a),Y):null!=this.columnthereof&&""!==this.columnthereof.trim()?(this.errors.addOrReplace({id:i,type:"warning",message:"interval: cannot be combined with columnthereof, interval is ignored."}),this.errors.remove(e),this.errors.remove(a),Y):(this.errors.remove(i),s===Z?(this.hasBlankSetnames?this.errors.addOrReplace({id:a,type:"warning",message:"interval: rows with blank setname found, they are grouped under '-'."}):this.errors.remove(a),this.errors.remove(e),Z):(this.errors.remove(a),this.datasetMeta&&!(null===(t=this.datasetMeta.dateRange)||void 0===t?void 0:t.hasData)?(this.errors.addOrReplace({id:e,type:"warning",message:"interval: dataset has no date values, interval is ignored."}),Y):(this.errors.remove(e),s)))}prepareAttributes(){if(null==this.tableAttributes||""===this.tableAttributes.trim())return[];try{const t=JSON.parse(this.tableAttributes);return null===t||"object"!=typeof t||t instanceof Array?[]:Object.entries(t).map((([t,i],e)=>"string"==typeof i?X(t,"attr_"+e,i):null)).filter((t=>null!==t))}catch(t){return[]}}prepareSumTitle(){return""===this.sumTitle||null==this.sumTitle?"SUM_TOTAL":this.sumTitle}prepareShowMeasureScale(){return"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=H[i];return e?q[e]:q[H.W10]}prepareBarColumns(){return u(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){const t=L(this.unitScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,0):(this.autoUnitWarningActive=!0,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${t.raw}" - auto-fitting to the bar column width.`}),0)}preparePercentageScaling(){const t=L(this.percentageScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,0):(this.autoPctWarningActive=!0,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${t.raw}" - auto-fitting to the pin area.`}),0)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},date:{type:"string",isOptional:!1,description:""},operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}async getLayoutState(t){var i,e,a,s;const r=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",n=at(this.element),o=this.getEffectiveScaleFactor(),l=Number.isFinite(o)&&o>0?o:1,h=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}))*l,d={version:et,tag:this.element.localName,id:nt(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:st(this.element,n),em:{fontSizePx:h,appliedScaleFactor:l},regions:[],metadata:{},diagnostics:rt(this.element),scaling:this.resolveScalingInfo(h)},u=null===(a=this.element.shadowRoot)||void 0===a?void 0:a.querySelector("ibcs-table");if(u){const t=null!==(s=u.scenarios)&&void 0!==s?s:[];if(d.metadata.scenarios=t.filter((t=>!t.startsWith("d"))),d.metadata.variances=t.filter((t=>t.startsWith("d"))),"function"==typeof u.getLayoutDetail){const t=await u.getLayoutDetail(n,r);d.regions=t.regions,d.metadata=Object.assign(Object.assign({},d.metadata),t.metadata),d.diagnostics=[...d.diagnostics,...t.diagnostics],t.elements&&(d.elements=t.elements),t.table&&(d.table=t.table)}}return d}resolveScalingInfo(t){var i,e;const a={},s=L(this.unitScaling,this.pixelPerUnitGroupMap);if("value"===s.kind)a.unitMode="fixed",a.unitsPerEm=s.value,a.unitPxPerUnit=t/s.value;else{a.unitMode="auto";const e=null===(i=this.lastAutoScalingReport)||void 0===i?void 0:i.unit;void 0!==e&&e>0&&(a.unitsPerEm=1/e,a.unitPxPerUnit=e*t)}const r=L(this.percentageScaling,this.pixelPerUnitGroupMap);if("value"===r.kind)a.percentageMode="fixed",a.percentagePointsPerEm=r.value,a.percentagePxPerPoint=t/r.value;else{a.percentageMode="auto";const i=null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.percentage;void 0!==i&&i>0&&(a.percentagePointsPerEm=1/i,a.percentagePxPerPoint=i*t)}return a}getEffectiveScaleFactor(){const{mode:t,factor:i}=k(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return a(s,{key:"ba76b60711ca2b8fb83226d3473aefdc394036f8",style:t},a("div",{key:"425f6a33db9d0baffd4edcffe4a986b4e114886c"},a("ibcs-table",{key:"4b7c445d24314f515a1432e88f54ec4b52bd76d2",tableName:this.datasetName,dataVersion:this.dataVersion,sumTitle:this.prepareSumTitle(),scenarios:this.prepareScenarios(),scenariosDataFormat:this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),thereof:this.prepareThereOf(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),attributeColumns:this.prepareAttributes(),type:this.prepareTableType(),categoryWidth:this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),i18nMode:this.prepareI18nMode(),measureScale:this.prepareMeasureScale(),measureType:this.prepareMeasureType(),measureUnit:this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),interval:this.prepareInterval(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),reportAutoScaling:this.handleAutoScalingReport,errors:this.errors,scaleFactor:i,ruleSetConfig:this.ruleSetConfig(),selectedStyle:this.selectedStyle})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],tableAttributes:[{validateTableAttributes:0}]}}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-table",{scale:[1],ruleset:[513],selectedStyle:[1,"selected-style"],sumTitle:[1,"sum-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[1],showMeasureScale:[1,"show-measure-scale"],showGroupTitle:[1,"show-group-title"],type:[1],limit:[2],thereof:[1],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],interval:[1],tableAttributes:[1,"attributes"],datasetName:[32],dataVersion:[32],datasetMeta:[32],appliedScaleFactor:[32],hasBlankSetnames:[32],getLayoutState:[64]},void 0,{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],tableAttributes:[{validateTableAttributes:0}]}]),ht=lt,dt=function(){"undefined"!=typeof customElements&&["bn-table","ibcs-table"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),lt);break;case"ibcs-table":customElements.get(r(t))||Q()}}))};export{ht as BnTable,dt as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as s,Host as n,transformTag as r}from"@stencil/core/internal/client";import{w as c,a as m}from"./withHasError.js";const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),c(this),this.errors=m(this)}render(){return s(n,{key:"d8c7214c5beab0eb52999b596d241ac052bee543"},s("slot",{key:"41cc485bf9666117d449642d3e7948551b5b0701"}))}get element(){return this}},[257,"bn-template",{templateId:[1,"template-id"]}]),i=o,l=function(){"undefined"!=typeof customElements&&["bn-template"].forEach((e=>{"bn-template"===e&&(customElements.get(r(e))||customElements.define(r(e),o))}))};export{i as BnTemplate,l as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as s,Host as n,transformTag as a}from"@stencil/core/internal/client";import{w as r}from"./withComponentStatus.js";import{w as o}from"./withHasError.js";const m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),r(this),this.errors=o(this)}render(){return s(n,{key:"a447ab9420bfaa577da0fcd0105676b65428a3b8"},s("slot",{key:"5aea212f0899f03064187bf3393edfe7ccea78a5"}))}get element(){return this}},[257,"bn-template",{templateId:[1,"template-id"]}]),i=m,c=function(){"undefined"!=typeof customElements&&["bn-template"].forEach((t=>{"bn-template"===t&&(customElements.get(a(t))||customElements.define(a(t),m))}))};export{i as BnTemplate,c as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as i,Host as o,transformTag as n}from"@stencil/core/internal/client";import{w as s,g as a}from"./withDataset.js";import{w as l}from"./withTranslation.js";import{w as r,a as d}from"./withHasError.js";import{w as c}from"./withStyled.js";import{w as f}from"./withComponentStyle.js";import{p as v}from"./scaling.js";import{s as u}from"./sanitizeHtml.js";const h=/\b(__proto__|globalThis)\b|\.constructor\b/,m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.data={},c(this),r(this),this.errors=d(this),this.t=l(this).t,s(this,((t,e)=>{this.data=Object.assign(Object.assign({},this.data),{[t]:e})})),this.componentStyle=f(this)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"no_value",type:"warning",message:"Empty value"}):this.errors.remove("no_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const e=Number(t);isNaN(e)||e<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}evalTemplate(t){if(!t)return"";if(h.test(t))return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:"Template contains forbidden pattern"}),"";try{const e=new Proxy({data:this.data,t:this.t},{has:()=>!0,get:(t,e)=>e===Symbol.unscopables?void 0:t[e],set:()=>!0}),i=Function("sandbox","with(sandbox){try{return`"+t+'`}catch(e){return""}}').call(e,e);return this.errors.remove("ERR_value_eval"),null!=i?i+"":""}catch(t){return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:"Template evaluation failed: "+(t instanceof Error?t.message:t+"")}),""}}prepareStyle(){return this.componentStyle((t=>{var e,i,o,n,s,a,l,r,d,c,f,v,u,h,m,p,b,g,y,w,_,R;return{fontStyles:{font:`${null!==(n=null!==(i=null===(e=t["bn-text"])||void 0===e?void 0:e.fontSizePx)&&void 0!==i?i:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==n?n:13.3333}px ${null!==(r=null!==(a=null===(s=t["bn-text"])||void 0===s?void 0:s.fontFamily)&&void 0!==a?a:null===(l=t.global)||void 0===l?void 0:l.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(v=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(f=t.global)||void 0===f?void 0:f.fontSizePx)&&void 0!==v?v:13.3333,color:null!==(p=null!==(h=null===(u=t["bn-text"])||void 0===u?void 0:u.fontColor)&&void 0!==h?h:null===(m=t.global)||void 0===m?void 0:m.fontColor)&&void 0!==p?p:"#000000",background:null!==(w=null!==(g=null===(b=t["bn-text"])||void 0===b?void 0:b.fontBackgroundColor)&&void 0!==g?g:null===(y=t.global)||void 0===y?void 0:y.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==(R=null===(_=t["bn-text"])||void 0===_?void 0:_.leading)&&void 0!==R?R:1.8}}}))}applyScaling(t){const e=this.element,{mode:i,factor:o}=v(this.scale),{width:n,height:s}=a(e),l=e.scrollHeight>e.clientHeight+1?e.clientHeight:s,r=n,d=r>0&&e.scrollWidth>r+1,c=l>0&&e.scrollHeight>l+1,f=d||c;if(r<=0&&l<=0)return;if("none"===i){if(f){const t=[];d&&t.push(`w:${e.scrollWidth}>${Math.round(r)}`),c&&t.push(`h:${e.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===i){if(f){const t=[];d&&t.push(`w:${e.scrollWidth}>${Math.round(r)}`),c&&t.push(`h:${e.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}e.style.setProperty("--bn-font-size",t+"px");const u=e.scrollWidth,h=e.scrollHeight,m=e.clientHeight,p=h>m+1?m:s,b=r<=0||u<=r+1,g=p<=0||h<=p+1;if(b&&g)return void this.errors.remove("AUTO_scale");const y=Math.min(1,!b&&r>0?r/u:1,!g&&p>0?p/h:1);e.style.setProperty("--bn-font-size",t*y+"px"),"empty"===i?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled font by factor "+y.toFixed(3)}):this.errors.remove("AUTO_scale")}componentDidRender(){this.container.innerHTML=u(this.evalTemplate(this.value)),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:e,factor:n}=v(this.scale),s="factor"===e?t.size*n+"px":t.size+"px",a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":s,"--bn-font-color":t.color,"--bn-font-background":t.background};return i(o,{key:"b5516777bb29ddddf3fb43ff518fdc383c86a812",style:a},i("div",{key:"dc325b0679f0a151ac60d32cae70f2a2f14ae205"},i("span",{key:"fcdc9c6cb9224428e7b47df3ac10336bcdffb260",class:"container",ref:t=>{this.container=t}})))}get element(){return this}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}static get style(){return':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}'}},[1,"bn-text",{value:[1],scale:[1],data:[32]},void 0,{value:[{validateValue:0}],scale:[{validateScaling:0}]}]),p=m,b=function(){"undefined"!=typeof customElements&&["bn-text"].forEach((t=>{"bn-text"===t&&(customElements.get(n(t))||customElements.define(n(t),m))}))};export{p as BnText,b as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as n,forceUpdate as i,h as o,Host as e,transformTag as s}from"@stencil/core/internal/client";import{w as l}from"./withDataset.js";import{w as a}from"./withTranslation.js";import{w as r}from"./withComponentStatus.js";import{w as d}from"./withStyled.js";import{w as c}from"./withComponentStyle.js";import{w as u}from"./withHasError.js";import{g as v}from"./parentDimensions.js";import{p as h}from"./scaling.js";import{s as f}from"./sanitizeHtml.js";const m="[A-Za-z_$\\u00C0-\\uFFFF][\\w$\\u00C0-\\uFFFF]*",p="'[^'\\\\]*'|\"[^\"\\\\]*\"",b=`(?:this\\.)?data(?:\\.(${m})|\\[\\s*(${p})\\s*\\])\\[\\s*(\\d+)\\s*\\]\\.(${m})`,g=RegExp(`\\$\\{\\s*(?:${b}|t\\(\\s*(${p})\\s*(?:,\\s*\\{([^{}]*)\\}\\s*)?\\))\\s*\\}`,"g"),w=RegExp(`\\s*(?:(${m})|(${p}))\\s*:\\s*(?:(${p})|(-?\\d+(?:\\.\\d+)?)|(${b}))\\s*(?:,|$)`,"y"),y=t=>(t+"").replace(/[&<>"'\t\n\f\r ]/g,(t=>`&#${t.charCodeAt(0)};`)),$=(t,n)=>"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0,_=t=>t.slice(1,-1);const R=t(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.refit=()=>{i(this)},this.data={},d(this),r(this),this.errors=u(this),this.t=a(this).t,l(this,((t,n)=>{this.data=Object.assign(Object.assign({},this.data),{[t]:n})})),this.componentStyle=c(this)}connectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.refit)}disconnectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.removeEventListener("loadingdone",this.refit)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"no_value",type:"warning",message:"Empty value"}):this.errors.remove("no_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const n=Number(t);isNaN(n)||n<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}prepareStyle(){return this.componentStyle((t=>{var n,i,o,e,s,l,a,r,d,c,u,v,h,f,m,p,b,g,w,y,$,_;return{fontStyles:{font:`${null!==(e=null!==(i=null===(n=t["bn-text"])||void 0===n?void 0:n.fontSizePx)&&void 0!==i?i:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==e?e:13.3333}px ${null!==(r=null!==(l=null===(s=t["bn-text"])||void 0===s?void 0:s.fontFamily)&&void 0!==l?l:null===(a=t.global)||void 0===a?void 0:a.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(v=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(u=t.global)||void 0===u?void 0:u.fontSizePx)&&void 0!==v?v:13.3333,color:null!==(p=null!==(f=null===(h=t["bn-text"])||void 0===h?void 0:h.fontColor)&&void 0!==f?f:null===(m=t.global)||void 0===m?void 0:m.fontColor)&&void 0!==p?p:"#000000",background:null!==(y=null!==(g=null===(b=t["bn-text"])||void 0===b?void 0:b.fontBackgroundColor)&&void 0!==g?g:null===(w=t.global)||void 0===w?void 0:w.fontBackgroundColor)&&void 0!==y?y:"#ffffff",leading:null!==(_=null===($=t["bn-text"])||void 0===$?void 0:$.leading)&&void 0!==_?_:1.8}}}))}applyScaling(t){const n=this.element,{mode:i,factor:o}=h(this.scale),{width:e,height:s}=v(n),l=n.scrollHeight>n.clientHeight+1?n.clientHeight:s,a=e,r=a>0&&n.scrollWidth>a+1,d=l>0&&n.scrollHeight>l+1,c=r||d;if(a<=0&&l<=0)return;if("none"===i){if(c){const t=[];r&&t.push(`w:${n.scrollWidth}>${Math.round(a)}`),d&&t.push(`h:${n.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===i){if(c){const t=[];r&&t.push(`w:${n.scrollWidth}>${Math.round(a)}`),d&&t.push(`h:${n.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}n.style.setProperty("--bn-font-size",t+"px");const u=n.scrollWidth,f=n.scrollHeight,m=n.clientHeight,p=f>m+1?m:s,b=a<=0||u<=a+1,g=p<=0||f<=p+1;if(b&&g)return void this.errors.remove("AUTO_scale");const w=Math.min(1,!b&&a>0?a/u:1,!g&&p>0?p/f:1);n.style.setProperty("--bn-font-size",t*w+"px"),"empty"===i?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled font by factor "+w.toFixed(3)}):this.errors.remove("AUTO_scale")}componentDidRender(){var t;const{html:n,unknown:i}=function(t,n,i){const o=[],e=t=>{o.includes(t)||o.push(t)},s=(t,i,o,s,l)=>{const a=$($($(n,null!=i?i:_(o)),Number(s)+""),l);return void 0===a&&e(t),a};return{html:t.replace(g,((t,n,o,l,a,r,d)=>{const c=t.slice(2,-1).trim();try{if(void 0===r){const t=s(c,n,o,l,a);return null==t?"":y(t)}const e=void 0===d?void 0:(t=>{const n={};for(w.lastIndex=0;""!==t.slice(w.lastIndex).trim();){const i=w.exec(t);if(!i)return null;const[,o,e,l,a,r,d,c,u,v]=i;n[null!=o?o:_(e)]=void 0!==l?_(l):void 0!==a?Number(a):s(r,d,c,u,v)}return n})(d);return null===e?t:y(i(_(r),e))}catch(t){return e(c),""}})),unknown:o}}(null!==(t=this.value)&&void 0!==t?t:"",this.data,this.t);i.length>0?this.errors.addOrReplace({id:"WARN_value_path",type:"warning",message:"Unknown template path: "+i.join(", ")}):this.errors.remove("WARN_value_path"),this.container.innerHTML=f(n),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:n,factor:i}=h(this.scale),s="factor"===n?t.size*i+"px":t.size+"px",l={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":s,"--bn-font-color":t.color,"--bn-font-background":t.background};return o(e,{key:"a09d93b0c15d8172bc739406df52b1dab6a48842",style:l},o("div",{key:"725fd0ce4b5500c3b5c2d31ef4d0f7072bb2670d"},o("span",{key:"cb5bf2eaca4bfb936d58821c375be131084a75e2",class:"container",ref:t=>{this.container=t}})))}get element(){return this}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}static get style(){return':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}'}},[1,"bn-text",{value:[1],scale:[1],data:[32]},void 0,{value:[{validateValue:0}],scale:[{validateScaling:0}]}]),x=R,j=function(){"undefined"!=typeof customElements&&["bn-text"].forEach((t=>{"bn-text"===t&&(customElements.get(s(t))||customElements.define(s(t),R))}))};export{x as BnText,j as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as i,h as e,Host as a,transformTag as s}from"@stencil/core/internal/client";import{v as r,a as n,b as o,c as d,d as l,e as h,i as v,f as u,g as c}from"./validate.js";import{D as m}from"./luxon.js";import{w as p,a as f}from"./withHasError.js";import{w as b}from"./withTranslation.js";import{a as g,g as w}from"./context-protocol.js";import{w as E}from"./withStyled.js";import{w as S}from"./withComponentStyle.js";import{w as y}from"./withRuleSet.js";import{I as D}from"./CompareUtil.js";import{O as R}from"./Order.js";import{D as k,a as O}from"./DateStringFactory.js";import{d as j}from"./ibcs-title2.js";const x=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.order="category",this.orderDirection="asc",this.dateFormat="none",this.dateLink="none",E(this),p(this),this.t=b(this).t,this.errors=f(this),this.componentStyle=S(this),this.ruleSetConfig=y(this)}validateScenario(t){const i="ERR_scenarios",e=r(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:e.toString())+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="ERR_variances",e=n(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+(null==e?void 0:e.toString())+"' are not supported."}):this.errors.remove(i)}validateOrder(t){const i=o(t),e="ERR_order";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"order: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(e)}validateOrderDirection(t){const i="ERR_orderDirection";d(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateMeasures(t){const i="ERR_measures",e=l(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"measures: invalid value(s) '"+(null==e?void 0:e.toString())+'\' are not supported. Valid format example: [{"name": "Bruttoumsatz", "unit": "mEUR"}]'}):this.errors.remove(i)}validateDateStart(t){const i="ERR_dateStart";h(t)||v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateEnd(t){const i="ERR_dateEnd";h(t)||v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateFormat(t){const i="ERR_dateFormat";u(t)||v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateFormat: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateLink(t){const i="ERR_dateLink";c(t)||v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateLink: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateMeasures(this.measures),this.validateDateStart(this.dateStart),this.validateDateEnd(this.dateEnd),this.validateDateFormat(this.dateFormat),this.validateDateLink(this.dateLink),this.validateOrderDirection(this.orderDirection),this.validateOrder(this.order)}prepareI18n(){const t=g,i=new Map(["SEPERATOR_WS","in","CONNECTOR_WS"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries()])}prepareI18nMode(){return D.META}prepareLocale(){return w(this.element).context.state.locale||"de"}prepareTitleOrder(){var t;return v(this.order)||v(this.orderDirection)?null:{hierarchy:this.order.split(",").map((t=>t.trim())),direction:R[null===(t=this.orderDirection)||void 0===t?void 0:t.toUpperCase()]}}prepareTitleTimePeriod(){var t,i;return v(this.dateStart)&&v(this.dateEnd)||v(this.dateLink)?null:{start:m.fromISO(this.dateStart),end:m.fromISO(this.dateEnd),format:O[null===(t=this.dateFormat)||void 0===t?void 0:t.toUpperCase()],link:k[null===(i=this.dateLink)||void 0===i?void 0:i.toUpperCase()]}}prepareMeasures(){return v(this.measures)?[]:JSON.parse(this.measures)}prepareScenarios(){var t,i,e,a;if(v(this.scenarios)&&v(this.variances))return[];let s=[];return(null===(t=this.scenarios)||void 0===t?void 0:t.trim().length)>0&&(s=s.concat(null===(i=this.scenarios)||void 0===i?void 0:i.split(","))),(null===(e=this.variances)||void 0===e?void 0:e.trim().length)>0&&(s=s.concat(null===(a=this.variances)||void 0===a?void 0:a.split(","))),s.map((t=>t.trim()))}prepareBusinessUnit(){return v(this.businessUnit)||"null"===this.businessUnit?null:this.businessUnit}getFontStyles(){return this.componentStyle((t=>{var i,e,a,s;return{"--bn-font-family":(null===(i=t.global)||void 0===i?void 0:i.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(a=t.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(s=t.global)||void 0===s?void 0:s.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return e(a,{key:"9b9c216010209bd5acaaeee39b6b5d8a8972710f",style:t},e("ibcs-title",{key:"5ccf7ddc7a4fbf1308d1d09d80f5b8aa3cbf6cbd",businessUnit:this.prepareBusinessUnit(),scenarios:this.prepareScenarios(),measures:this.prepareMeasures(),timeperiod:this.prepareTitleTimePeriod(),order:this.prepareTitleOrder(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),locale:this.prepareLocale(),ruleSetConfig:this.ruleSetConfig()}))}get element(){return this}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}}static get style(){return':host{padding:0.5em;margin-bottom:0.5em;box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-title",{ruleset:[513],businessUnit:[1,"business-unit"],scenarios:[1],variances:[1],order:[1],orderDirection:[1,"order-direction"],measures:[1],dateStart:[1,"date-start"],dateEnd:[1,"date-end"],dateFormat:[1,"date-format"],dateLink:[1,"date-link"]},void 0,{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}]);function _(){"undefined"!=typeof customElements&&["bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-title":customElements.get(s(t))||customElements.define(s(t),x);break;case"ibcs-title":customElements.get(s(t))||j()}}))}export{x as T,_ as d}
1
+ import{proxyCustomElement as t,HTMLElement as i,h as e,Host as a,transformTag as s}from"@stencil/core/internal/client";import{v as r,a as n,b as o,c as d,d as l,e as h,i as u,f as v,g as c}from"./validate.js";import{D as m}from"./luxon.js";import{w as p}from"./withComponentStatus.js";import{w as f}from"./withTranslation.js";import{a as g,g as b}from"./context-protocol.js";import{w}from"./withStyled.js";import{w as S}from"./withComponentStyle.js";import{w as y}from"./withRuleSet.js";import{w as E}from"./withHasError.js";import{I as D}from"./CompareUtil.js";import{a as R}from"./Order.js";import{a as k,D as j}from"./DateStringFactory.js";import{d as O}from"./ibcs-title2.js";const x=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.order="category",this.orderDirection="asc",this.dateFormat="none",this.dateLink="none",w(this),p(this),this.t=f(this).t,this.errors=E(this),this.componentStyle=S(this),this.ruleSetConfig=y(this)}validateScenario(t){const i="ERR_scenarios",e=r(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:e.toString())+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="ERR_variances",e=n(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+(null==e?void 0:e.toString())+"' are not supported."}):this.errors.remove(i)}validateOrder(t){const i=o(t),e="ERR_order";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"order: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(e)}validateOrderDirection(t){const i="ERR_orderDirection";d(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateMeasures(t){const i="ERR_measures",e=l(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"measures: invalid value(s) '"+(null==e?void 0:e.toString())+'\' are not supported. Valid format example: [{"name": "Bruttoumsatz", "unit": "mEUR"}]'}):this.errors.remove(i)}validateDateStart(t){const i="ERR_dateStart";h(t)||u(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateEnd(t){const i="ERR_dateEnd";h(t)||u(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateFormat(t){const i="ERR_dateFormat";v(t)||u(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateFormat: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateLink(t){const i="ERR_dateLink";c(t)||u(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateLink: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateMeasures(this.measures),this.validateDateStart(this.dateStart),this.validateDateEnd(this.dateEnd),this.validateDateFormat(this.dateFormat),this.validateDateLink(this.dateLink),this.validateOrderDirection(this.orderDirection),this.validateOrder(this.order)}prepareI18n(){const t=g,i=new Map(["SEPERATOR_WS","in","CONNECTOR_WS"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries()])}prepareI18nMode(){return D.META}prepareLocale(){return b(this.element).context.state.locale||"de"}prepareTitleOrder(){var t;return u(this.order)||u(this.orderDirection)?null:{hierarchy:this.order.split(",").map((t=>t.trim())),direction:R[null===(t=this.orderDirection)||void 0===t?void 0:t.toUpperCase()]}}prepareTitleTimePeriod(){var t,i;return u(this.dateStart)&&u(this.dateEnd)||u(this.dateLink)?null:{start:m.fromISO(this.dateStart,{zone:"utc"}),end:m.fromISO(this.dateEnd,{zone:"utc"}),format:j[null===(t=this.dateFormat)||void 0===t?void 0:t.toUpperCase()],link:k[null===(i=this.dateLink)||void 0===i?void 0:i.toUpperCase()]}}prepareMeasures(){if(u(this.measures))return[];try{return JSON.parse(this.measures)}catch(t){return[]}}prepareScenarios(){var t,i,e,a;if(u(this.scenarios)&&u(this.variances))return[];let s=[];return(null===(t=this.scenarios)||void 0===t?void 0:t.trim().length)>0&&(s=s.concat(null===(i=this.scenarios)||void 0===i?void 0:i.split(","))),(null===(e=this.variances)||void 0===e?void 0:e.trim().length)>0&&(s=s.concat(null===(a=this.variances)||void 0===a?void 0:a.split(","))),s.map((t=>t.trim()))}prepareBusinessUnit(){return u(this.businessUnit)||"null"===this.businessUnit?null:this.businessUnit}getFontStyles(){return this.componentStyle((t=>{var i,e,a,s;return{"--bn-font-family":(null===(i=t.global)||void 0===i?void 0:i.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(a=t.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(s=t.global)||void 0===s?void 0:s.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return e(a,{key:"542f7c564c8675dd7a493fc697a65a308601321f",style:t},e("ibcs-title",{key:"aea2b5c0395d68a2d2cb947aa0284e0d0d7c4787",businessUnit:this.prepareBusinessUnit(),scenarios:this.prepareScenarios(),measures:this.prepareMeasures(),timeperiod:this.prepareTitleTimePeriod(),order:this.prepareTitleOrder(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),locale:this.prepareLocale(),ruleSetConfig:this.ruleSetConfig()}))}get element(){return this}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}}static get style(){return':host{padding:0.5em;margin-bottom:0.5em;box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-title",{ruleset:[513],businessUnit:[1,"business-unit"],scenarios:[1],variances:[1],order:[1],orderDirection:[1,"order-direction"],measures:[1],dateStart:[1,"date-start"],dateEnd:[1,"date-end"],dateFormat:[1,"date-format"],dateLink:[1,"date-link"]},void 0,{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}]);function _(){"undefined"!=typeof customElements&&["bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-title":customElements.get(s(t))||customElements.define(s(t),x);break;case"ibcs-title":customElements.get(s(t))||O()}}))}export{x as T,_ as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as n,Host as i,transformTag as s}from"@stencil/core/internal/client";import{o,l as r}from"./validate.js";import{L as a}from"./types.js";import{o as l,m as d}from"./geometry.js";import{r as c,a as u}from"./diagnostics.js";import{w as h,a as f}from"./withHasError.js";import{w as g}from"./withStyled.js";import{w as p}from"./withComponentStyle.js";const v=["*","/","+","-","x","÷","none"];function y(t){switch(t){case"*":case"x":return"×";case"/":case"÷":return"÷";case"+":return"+";case"-":return"−";default:return""}}function m(t,e,n){return t.find((t=>t.from===e&&t.to===n))}function b(t){return 2*(t-1)+1}function w(t){return 2*(t-1)+1}function x(t){return t<=1?1:2*(t-1)+1}function $(t,e){const n=t.getBoundingClientRect(),i=n.left-e.left,s=n.top-e.top;return{left:i,top:s,width:n.width,height:n.height,centerX:i+n.width/2,centerY:s+n.height/2}}function S(t,e,n){switch(n){case"ltr":return e?{x:t.left+t.width,y:t.centerY}:{x:t.left,y:t.centerY};case"rtl":return e?{x:t.left,y:t.centerY}:{x:t.left+t.width,y:t.centerY};case"ttb":return e?{x:t.centerX,y:t.top+t.height}:{x:t.centerX,y:t.top};case"btt":return e?{x:t.centerX,y:t.top}:{x:t.centerX,y:t.top+t.height}}}function k(t,e,n,i,s=8){const o=-(i-1)*s/2+n*s;switch(e){case"ltr":return{x:t.left,y:t.centerY+o};case"rtl":return{x:t.left+t.width,y:t.centerY+o};case"ttb":return{x:t.centerX+o,y:t.top};case"btt":return{x:t.centerX+o,y:t.top+t.height}}}function R(t,e,n,i){switch(n){case"straight":return function(t,e){return{path:`M ${t.x} ${t.y} L ${e.x} ${e.y}`,midpoint:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}(t,e);case"curved":return function(t,e,n){let i,s;if("ltr"===n||"rtl"===n){const n=(t.x+e.x)/2;i={x:n,y:t.y},s={x:n,y:e.y}}else{const n=(t.y+e.y)/2;i={x:t.x,y:n},s={x:e.x,y:n}}return{path:`M ${t.x} ${t.y} C ${i.x} ${i.y}, ${s.x} ${s.y}, ${e.x} ${e.y}`,midpoint:{x:.125*t.x+.375*i.x+.375*s.x+.125*e.x,y:.125*t.y+.375*i.y+.375*s.y+.125*e.y}}}(t,e,i);default:return function(t,e,n){let i,s;if("ltr"===n||"rtl"===n){const n=t.x+.7*(e.x-t.x);i=`M ${t.x} ${t.y} L ${n} ${t.y} L ${n} ${e.y} L ${e.x} ${e.y}`,s={x:n,y:(t.y+e.y)/2}}else{const n=t.y+.7*(e.y-t.y);i=`M ${t.x} ${t.y} L ${t.x} ${n} L ${e.x} ${n} L ${e.x} ${e.y}`,s={x:(t.x+e.x)/2,y:n}}return{path:i,midpoint:s}}(t,e,i)}}function M(t,e,n,i){const s=.7;switch(i){case"ltr":{const i=t.left+t.width;return{x:i+(Math.min(e.left,n.left)-i)*s,y:t.centerY}}case"rtl":{const i=t.left,o=Math.max(e.left+e.width,n.left+n.width);return{x:o+(i-o)*s,y:t.centerY}}case"ttb":{const i=t.top+t.height;return{x:t.centerX,y:i+(Math.min(e.top,n.top)-i)*s}}case"btt":{const i=t.top,o=Math.max(e.top+e.height,n.top+n.height);return{x:t.centerX,y:o+(i-o)*s}}}}function L(t,e,n){var i,s;return Object.assign({stroke:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t,strokeWidth:null!==(s=null==n?void 0:n.width)&&void 0!==s?s:e},(null==n?void 0:n.dasharray)?{strokeDasharray:n.dasharray}:{})}const E=t(class extends e{validateEdgesProp(t){const e="ERR_edges",n=function(t){const e=[];if(!t||""===t.trim())return e.push("edges: value is required"),e;let n;try{n=JSON.parse(t)}catch(t){return e.push("edges: invalid JSON structure"),e}if(!Array.isArray(n))return e.push("edges: must be an array"),e;if(0===n.length)return e.push("edges: array must not be empty"),e;const i=new Set,s=new Set;n.forEach(((t,n)=>{if("object"!=typeof t||null===t)return void e.push(`edges[${n}]: must be an object`);const o=t;if("string"!=typeof o.from||""===o.from.trim()?e.push(`edges[${n}]: 'from' is required and must be a non-empty string`):i.add(o.from),"string"!=typeof o.to||""===o.to.trim()?e.push(`edges[${n}]: 'to' is required and must be a non-empty string`):(i.add(o.to),s.add(o.to)),void 0!==o.operator&&("string"==typeof o.operator&&v.includes(o.operator)||e.push(`edges[${n}]: 'operator' must be one of: ${v.join(", ")}`)),void 0!==o.label&&"string"!=typeof o.label&&e.push(`edges[${n}]: 'label' must be a string`),void 0!==o.style)if("object"!=typeof o.style||null===o.style)e.push(`edges[${n}]: 'style' must be an object`);else{const t=o.style;void 0!==t.color&&"string"!=typeof t.color&&e.push(`edges[${n}]: 'style.color' must be a string`),void 0!==t.width&&"number"!=typeof t.width&&e.push(`edges[${n}]: 'style.width' must be a number`),void 0!==t.dasharray&&"string"!=typeof t.dasharray&&e.push(`edges[${n}]: 'style.dasharray' must be a string`)}}));const o=Array.from(i).filter((t=>!s.has(t)));return 0===o.length?e.push("edges: tree has no root node (circular reference detected)"):o.length>1&&e.push("edges: tree has multiple root nodes: "+o.join(", ")),e}(t);n.length>0?(this.errors.addOrReplace({id:e,type:"error",message:"edges: "+n.join("; ")}),this.treeConfig=null):(this.errors.remove(e),this.treeConfig=function(t){if(!t||""===t.trim())return null;try{const e=JSON.parse(t);if(!Array.isArray(e))return null;const n=e,i=function(t){const e=new Map;for(const n of t){const t=e.get(n.from)||[];t.push(n.to),e.set(n.from,t)}return e}(n),s=function(t){const e=new Set;for(const n of t)e.add(n.from),e.add(n.to);return e}(n),o=function(t,e){const n=new Set;for(const e of t)n.add(e.to);const i=Array.from(e).filter((t=>!n.has(t)));return 1===i.length?i[0]:null}(n,s);return{edges:n,adjacencyList:i,rootNode:o,allNodes:s}}catch(t){return console.error("parseTreeConfig: failed to parse tree configuration",t),null}}(t)),this.recalculateLayout()}validateDirection(t){const e="ERR_direction",n=["ltr","rtl","ttb","btt"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`direction: invalid value '${t}', must be one of: ${n.join(", ")}`}),this.recalculateLayout()}validateLevelSpacing(t){const e="ERR_levelSpacing";!o(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`level-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateNodeSpacing(t){const e="ERR_nodeSpacing";!o(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`node-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateEdgeStyle(t){const e="ERR_edgeStyle",n=["straight","orthogonal","curved"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`edge-style: invalid value '${t}', must be one of: ${n.join(", ")}`})}validateShowOperators(t){const e="ERR_showOperators";r(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-operators: invalid value '${t}', must be 'true' or 'false'`})}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.treeConfig=null,this.layout=null,this.nodeRects=new Map,this.svgWidth=0,this.svgHeight=0,this.resizeObserver=null,this.gridContainer=null,this.direction="ltr",this.levelSpacing=60,this.nodeSpacing=20,this.edgeStyle="orthogonal",this.showOperators="true",g(this),h(this),this.errors=f(this),this.componentStyle=p(this)}async getLayoutState(t){var e,n,i,s,o,r,h,f,g,p,v;const y=null!==(e=null==t?void 0:t.detail)&&void 0!==e?e:"summary",m=l(this.element),b=this.componentStyle((t=>{var e;return(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333})),w={version:a,tag:this.element.localName,id:u(this.element),slot:null!==(n=this.element.getAttribute("slot"))&&void 0!==n?n:void 0,rect:d(this.element,m),em:{fontSizePx:b,appliedScaleFactor:1},regions:[],metadata:{nodeCount:null!==(s=null===(i=this.treeConfig)||void 0===i?void 0:i.allNodes.size)&&void 0!==s?s:0,edgeCount:null!==(r=null===(o=this.treeConfig)||void 0===o?void 0:o.edges.length)&&void 0!==r?r:0},diagnostics:c(this.element)},x=null===(h=this.element.shadowRoot)||void 0===h?void 0:h.querySelector(".tree-grid");if(x&&w.regions.push({id:"grid",rect:d(x,m)}),"full"!==y||!this.treeConfig)return w;const $=[];for(const t of this.treeConfig.allNodes){const e=this.element.querySelector(`[slot="${t}"]`);if(!e)continue;const n={kind:"node",nodeId:t,rect:d(e,m)};$.push(n)}const S=Array.from(null!==(g=null===(f=this.element.shadowRoot)||void 0===f?void 0:f.querySelectorAll("svg.edge-layer path"))&&void 0!==g?g:[]);let k=0;for(const t of this.treeConfig.edges){if(!this.nodeRects.get(t.from)||!this.nodeRects.get(t.to))continue;const e=S[k++];if(!e)break;const n={kind:"edge",from:t.from,to:t.to,operator:t.operator,path:null!==(p=e.getAttribute("d"))&&void 0!==p?p:void 0,rect:d(e,m)};$.push(n)}return null===(v=this.element.shadowRoot)||void 0===v||v.querySelectorAll("svg.edge-layer g.operator-group").forEach((t=>{var e,n;const i=null!==(n=null===(e=t.textContent)||void 0===e?void 0:e.trim())&&void 0!==n?n:"";if(!i)return;const s={kind:"label",role:"operator",text:i,rect:d(t,m)};$.push(s)})),w.elements=$,w}getTreeStyle(){return this.componentStyle((t=>({edgeColor:t["bn-tree"].edgeColor,edgeWidth:t["bn-tree"].edgeWidth,operatorCircleRadius:t["bn-tree"].operatorCircleRadius,operatorFontSize:t.global.fontSizePx*t["bn-tree"].operatorFontSizeScale,operatorColor:t["bn-tree"].operatorColor})))}componentWillLoad(){this.validateEdgesProp(this.edges),this.validateDirection(this.direction),this.validateLevelSpacing(this.levelSpacing),this.validateNodeSpacing(this.nodeSpacing),this.validateEdgeStyle(this.edgeStyle),this.validateShowOperators(this.showOperators)}componentDidLoad(){this.setupResizeObserver(),requestAnimationFrame((()=>{this.updateNodeRects()}))}disconnectedCallback(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}setupResizeObserver(){var t;this.gridContainer=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".tree-grid"),this.gridContainer&&(this.resizeObserver=new ResizeObserver((()=>{this.updateNodeRects()})),this.resizeObserver.observe(this.gridContainer),this.element.querySelectorAll("[slot]").forEach((t=>{this.resizeObserver.observe(t)})))}recalculateLayout(){this.layout=this.treeConfig?function(t,e,n,i){if(!t.rootNode)return{positions:new Map,gridTemplateColumns:"",gridTemplateRows:"",maxLevel:0,maxIndex:0};const s=function(t){const e=new Map;if(!t.rootNode)return e;const n=[{node:t.rootNode,level:0}],i=new Set;for(;n.length>0;){const{node:s,level:o}=n.shift();if(i.has(s))continue;i.add(s),e.set(s,o);const r=t.adjacencyList.get(s)||[];for(const t of r)i.has(t)||n.push({node:t,level:o+1})}return e}(t),o=function(t){const e=new Map;if(!t.rootNode)return e;let n=0;return function i(s){const o=e.get(s);if(o)return o;const r=t.adjacencyList.get(s)||[];if(0===r.length){const t={startIndex:n,endIndex:n};return e.set(s,t),n++,t}let a=1/0,l=-1/0;for(const t of r){const e=i(t);a=Math.min(a,e.startIndex),l=Math.max(l,e.endIndex)}const d={startIndex:a,endIndex:l};return e.set(s,d),d}(t.rootNode),e}(t),r=function(t,e,n,i){var s,o;const r=new Map,a=Math.max(...Array.from(e.values()));for(const l of t.allNodes){const t=null!==(s=e.get(l))&&void 0!==s?s:0,d=null!==(o=n.get(l))&&void 0!==o?o:{startIndex:0,endIndex:0};let c,u,h;switch(i){case"ltr":c=t+1,u=d.startIndex+1,h=d.endIndex-d.startIndex+1;break;case"rtl":c=a-t+1,u=d.startIndex+1,h=d.endIndex-d.startIndex+1;break;case"ttb":u=t+1,c=d.startIndex+1,h=1;break;case"btt":u=a-t+1,c=d.startIndex+1,h=1}r.set(l,{nodeId:l,level:t,index:d.startIndex,gridColumn:c,gridRow:u,gridRowSpan:h})}return r}(t,s,o,e),a=Math.max(...Array.from(s.values())),l=Math.max(...Array.from(o.values()).map((t=>t.endIndex))),{gridTemplateColumns:d,gridTemplateRows:c}=function(t,e,n,i,s){const o=t+1,r=e+1;if("ltr"===n||"rtl"===n){const t=[];for(let e=0;e<o;e++)t.push("auto"),e<o-1&&t.push(i+"px");const e=[];for(let t=0;t<r;t++)e.push("auto"),t<r-1&&e.push(s+"px");return{gridTemplateColumns:t.join(" "),gridTemplateRows:e.join(" ")}}{const t=[];for(let e=0;e<o;e++)t.push("auto"),e<o-1&&t.push(i+"px");const e=[];for(let t=0;t<r;t++)e.push("auto"),t<r-1&&e.push(s+"px");return{gridTemplateColumns:e.join(" "),gridTemplateRows:t.join(" ")}}}(a,l,e,n,i);return{positions:r,gridTemplateColumns:d,gridTemplateRows:c,maxLevel:a,maxIndex:l}}(this.treeConfig,this.direction,this.levelSpacing,this.nodeSpacing):null}updateNodeRects(){if(!this.treeConfig||!this.gridContainer)return;const t=this.gridContainer.getBoundingClientRect(),e=new Map;for(const n of this.treeConfig.allNodes){const i=this.element.querySelector(`[slot="${n}"]`);i&&e.set(n,$(i,t))}this.nodeRects=e,this.svgWidth=t.width,this.svgHeight=t.height}getSlotStyle(t){if(!this.layout)return{};const e=this.layout.positions.get(t);return e?"ltr"===this.direction||"rtl"===this.direction?{"grid-column":b(e.gridColumn)+"","grid-row":`${w(e.gridRow)} / span ${x(e.gridRowSpan)}`,"align-self":"center"}:{"grid-row":w(e.gridRow)+"","grid-column":b(e.gridColumn)+"","justify-self":"center"}:{}}renderEdges(){var t;if(!this.treeConfig||0===this.nodeRects.size)return null;const e=this.getTreeStyle(),i=[],s=[],o=new Map;for(const t of this.treeConfig.edges){const e=o.get(t.to)||[];e.push(t.from),o.set(t.to,e)}for(const t of this.treeConfig.edges){const s=this.nodeRects.get(t.from),r=this.nodeRects.get(t.to);if(!s||!r)continue;const a=S(s,!0,this.direction),l=o.get(t.to)||[];let d;if(l.length>1){const e=l.indexOf(t.from);d=k(r,this.direction,e,l.length)}else d=S(r,!1,this.direction);const{path:c}=R(a,d,this.edgeStyle,this.direction),u=L(e.edgeColor,e.edgeWidth,t.style);i.push(n("path",{key:`edge-${t.from}-${t.to}`,d:c,fill:"none",stroke:u.stroke,"stroke-width":u.strokeWidth,"stroke-dasharray":u.strokeDasharray}))}if("true"===this.showOperators)for(const[i,o]of this.treeConfig.adjacencyList.entries()){const r=this.nodeRects.get(i);if(r)for(let a=0;a<o.length-1;a++){const l=o[a],d=o[a+1],c=m(this.treeConfig.edges,i,l);if(!(null==c?void 0:c.operator)||"none"===c.operator)continue;const u=this.nodeRects.get(l),h=this.nodeRects.get(d);if(!u||!h)continue;const f=null!==(t=c.label)&&void 0!==t?t:y(c.operator),g=M(r,u,h,this.direction);s.push(n("g",{key:`operator-${i}-${l}`,class:"operator-group"},n("circle",{cx:g.x,cy:g.y,r:e.operatorCircleRadius,fill:"white",stroke:e.edgeColor,"stroke-width":e.edgeWidth}),n("text",{x:g.x,y:g.y,"text-anchor":"middle","dominant-baseline":"central",style:{fontSize:e.operatorFontSize+"px",fill:e.operatorColor,fontWeight:"bold"}},f)))}}return n("svg",{class:"edge-layer",width:this.svgWidth,height:this.svgHeight,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none"}},i,s)}renderSlots(){return this.treeConfig&&this.layout?Array.from(this.treeConfig.allNodes).map((t=>n("div",{key:t,class:"tree-node",style:this.getSlotStyle(t)},n("slot",{name:t})))):null}getFontStyles(){return this.componentStyle((t=>{var e,n,i,s;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":((null===(n=t.global)||void 0===n?void 0:n.fontSizePx)||13.3333)+"px","--bn-font-color":(null===(i=t.global)||void 0===i?void 0:i.fontColor)||"#000000","--bn-font-background":(null===(s=t.global)||void 0===s?void 0:s.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return n(i,{style:t},this.treeConfig&&this.layout?n("div",{class:"tree-container"},n("div",{class:"tree-grid",style:{display:"grid","grid-template-columns":this.layout.gridTemplateColumns,"grid-template-rows":this.layout.gridTemplateRows,position:"relative"}},this.renderEdges(),this.renderSlots())):n("div",{class:"tree-container tree-error"},n("slot",null)))}get element(){return this}static get watchers(){return{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}}static get style(){return':host{display:inline-block;position:relative;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.tree-container{position:relative;display:inline-block}.tree-grid{position:relative;display:grid;align-items:center}.tree-node{position:relative;z-index:1;border:1px solid #404040;background:var(--bn-font-background, white)}.edge-layer{position:absolute;top:0;left:0;z-index:0;pointer-events:none;overflow:visible}.tree-error{display:flex;flex-wrap:wrap;gap:20px}'}},[257,"bn-tree",{edges:[1],direction:[1],levelSpacing:[2,"level-spacing"],nodeSpacing:[2,"node-spacing"],edgeStyle:[1,"edge-style"],i18nNamespace:[513,"i18n-namespace"],showOperators:[1,"show-operators"],treeConfig:[32],layout:[32],nodeRects:[32],svgWidth:[32],svgHeight:[32],getLayoutState:[64]},void 0,{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}]),C=E,j=function(){"undefined"!=typeof customElements&&["bn-tree"].forEach((t=>{"bn-tree"===t&&(customElements.get(s(t))||customElements.define(s(t),E))}))};export{C as BnTree,j as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as n,Host as i,transformTag as s}from"@stencil/core/internal/client";import{o,l as r}from"./validate.js";import{L as a}from"./types.js";import{o as l,m as d}from"./geometry.js";import{r as c,a as u}from"./diagnostics.js";import{w as h}from"./withComponentStatus.js";import{w as f}from"./withStyled.js";import{w as g}from"./withComponentStyle.js";import{w as p}from"./withHasError.js";import{g as v,a as m}from"./parentDimensions.js";import{o as y}from"./layoutObserver.js";const b=["*","/","+","-","x","÷","none"];function w(t){switch(t){case"*":case"x":return"×";case"/":case"÷":return"÷";case"+":return"+";case"-":return"−";default:return""}}function x(t,e,n){return t.find((t=>t.from===e&&t.to===n))}function $(t){return 2*(t-1)+1}function S(t){return 2*(t-1)+1}function k(t){return t<=1?1:2*(t-1)+1}function R(t){return k(t)}function M(t,e){const n=t.getBoundingClientRect(),i=n.left-e.left,s=n.top-e.top;return{left:i,top:s,width:n.width,height:n.height,centerX:i+n.width/2,centerY:s+n.height/2}}function L(t,e,n){switch(n){case"ltr":return e?{x:t.left+t.width,y:t.centerY}:{x:t.left,y:t.centerY};case"rtl":return e?{x:t.left,y:t.centerY}:{x:t.left+t.width,y:t.centerY};case"ttb":return e?{x:t.centerX,y:t.top+t.height}:{x:t.centerX,y:t.top};case"btt":return e?{x:t.centerX,y:t.top}:{x:t.centerX,y:t.top+t.height}}}function C(t,e,n,i,s=8){const o=-(i-1)*s/2+n*s;switch(e){case"ltr":return{x:t.left,y:t.centerY+o};case"rtl":return{x:t.left+t.width,y:t.centerY+o};case"ttb":return{x:t.centerX+o,y:t.top};case"btt":return{x:t.centerX+o,y:t.top+t.height}}}function E(t,e,n,i,s){switch(n){case"straight":return function(t,e){return{path:`M ${t.x} ${t.y} L ${e.x} ${e.y}`,midpoint:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}(t,e);case"curved":return function(t,e,n){let i,s;if("ltr"===n||"rtl"===n){const n=(t.x+e.x)/2;i={x:n,y:t.y},s={x:n,y:e.y}}else{const n=(t.y+e.y)/2;i={x:t.x,y:n},s={x:e.x,y:n}}return{path:`M ${t.x} ${t.y} C ${i.x} ${i.y}, ${s.x} ${s.y}, ${e.x} ${e.y}`,midpoint:{x:.125*t.x+.375*i.x+.375*s.x+.125*e.x,y:.125*t.y+.375*i.y+.375*s.y+.125*e.y}}}(t,e,i);default:return function(t,e,n,i){let s,o;if("ltr"===n||"rtl"===n){const n=null!=i?i:t.x+.7*(e.x-t.x);s=`M ${t.x} ${t.y} L ${n} ${t.y} L ${n} ${e.y} L ${e.x} ${e.y}`,o={x:n,y:(t.y+e.y)/2}}else{const n=null!=i?i:t.y+.7*(e.y-t.y);s=`M ${t.x} ${t.y} L ${t.x} ${n} L ${e.x} ${n} L ${e.x} ${e.y}`,o={x:(t.x+e.x)/2,y:n}}return{path:s,midpoint:o}}(t,e,i,s)}}function j(t,e,n){let i,s,o;switch(n){case"ltr":i=t.left+t.width,s=e.map((t=>t.left)),o=1;break;case"rtl":i=t.left,s=e.map((t=>t.left+t.width)),o=-1;break;case"ttb":i=t.top+t.height,s=e.map((t=>t.top)),o=1;break;case"btt":i=t.top,s=e.map((t=>t.top+t.height)),o=-1}const r=s.map((t=>(t-i)*o)).filter((t=>t>=0));if(0!==r.length)return i+Math.min(...r)*o*.7}function A(t,e,n,i){return"ltr"===i||"rtl"===i?{x:t,y:(e.centerY+n.centerY)/2}:{x:(e.centerX+n.centerX)/2,y:t}}function N(t,e,n){var i,s;return Object.assign({stroke:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t,strokeWidth:null!==(s=null==n?void 0:n.width)&&void 0!==s?s:e},(null==n?void 0:n.dasharray)?{strokeDasharray:n.dasharray}:{})}const O=t(class extends e{validateEdgesProp(t){const e="ERR_edges",n=function(t){const e=[];if(!t||""===t.trim())return e.push("edges: value is required"),e;let n;try{n=JSON.parse(t)}catch(t){return e.push("edges: invalid JSON structure"),e}if(!Array.isArray(n))return e.push("edges: must be an array"),e;if(0===n.length)return e.push("edges: array must not be empty"),e;const i=new Set,s=new Set,o=new Map;n.forEach(((t,n)=>{if("object"!=typeof t||null===t)return void e.push(`edges[${n}]: must be an object`);const r=t;if("string"!=typeof r.from||""===r.from.trim()?e.push(`edges[${n}]: 'from' is required and must be a non-empty string`):i.add(r.from),"string"!=typeof r.to||""===r.to.trim()?e.push(`edges[${n}]: 'to' is required and must be a non-empty string`):(i.add(r.to),s.add(r.to),"string"==typeof r.from&&o.set(r.from,[...o.get(r.from)||[],r.to])),void 0!==r.operator&&("string"==typeof r.operator&&b.includes(r.operator)||e.push(`edges[${n}]: 'operator' must be one of: ${b.join(", ")}`)),void 0!==r.label&&"string"!=typeof r.label&&e.push(`edges[${n}]: 'label' must be a string`),void 0!==r.style)if("object"!=typeof r.style||null===r.style)e.push(`edges[${n}]: 'style' must be an object`);else{const t=r.style;void 0!==t.color&&"string"!=typeof t.color&&e.push(`edges[${n}]: 'style.color' must be a string`),void 0!==t.width&&"number"!=typeof t.width&&e.push(`edges[${n}]: 'style.width' must be a number`),void 0!==t.dasharray&&"string"!=typeof t.dasharray&&e.push(`edges[${n}]: 'style.dasharray' must be a string`)}}));const r=Array.from(i).filter((t=>!s.has(t)));return 0===r.length?e.push("edges: tree has no root node (circular reference detected)"):r.length>1?e.push("edges: tree has multiple root nodes: "+r.join(", ")):e.push(...function(t,e,n){const i=[],s=new Set,o=new Set,r=t=>{o.add(t),s.add(t);for(const n of e.get(t)||[])s.has(n)?i.push(`edges: circular reference, the edge from '${t}' to '${n}' leads back`):o.has(n)||r(n);s.delete(t)};r(t);const a=Array.from(n).filter((t=>!o.has(t)));return a.length>0&&i.push(`edges: nodes not connected to the root '${t}': ${a.join(", ")}`),i}(r[0],o,i)),e}(t);n.length>0?(this.errors.addOrReplace({id:e,type:"error",message:"edges: "+n.join("; ")}),this.treeConfig=null):(this.errors.remove(e),this.treeConfig=function(t){if(!t||""===t.trim())return null;try{const e=JSON.parse(t);if(!Array.isArray(e))return null;const n=e,i=function(t){const e=new Map;for(const n of t){const t=e.get(n.from)||[];t.push(n.to),e.set(n.from,t)}return e}(n),s=function(t){const e=new Set;for(const n of t)e.add(n.from),e.add(n.to);return e}(n),o=function(t,e){const n=new Set;for(const e of t)n.add(e.to);const i=Array.from(e).filter((t=>!n.has(t)));return 1===i.length?i[0]:null}(n,s);return{edges:n,adjacencyList:i,rootNode:o,allNodes:s}}catch(t){return console.error("parseTreeConfig: failed to parse tree configuration",t),null}}(t)),this.recalculateLayout()}validateDirection(t){const e="ERR_direction",n=["ltr","rtl","ttb","btt"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`direction: invalid value '${t}', must be one of: ${n.join(", ")}`}),this.recalculateLayout()}validateLevelSpacing(t){const e="ERR_levelSpacing";!o(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`level-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateNodeSpacing(t){const e="ERR_nodeSpacing";!o(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`node-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateEdgeStyle(t){const e="ERR_edgeStyle",n=["straight","orthogonal","curved"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`edge-style: invalid value '${t}', must be one of: ${n.join(", ")}`})}validateShowOperators(t){const e="ERR_showOperators";r(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-operators: invalid value '${t}', must be 'true' or 'false'`})}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.treeConfig=null,this.layout=null,this.nodeRects=new Map,this.svgWidth=0,this.svgHeight=0,this.resizeObserver=null,this.gridContainer=null,this.observed=new Set,this.parentObserver=null,this.direction="ltr",this.levelSpacing=60,this.nodeSpacing=20,this.edgeStyle="orthogonal",this.showOperators="true",f(this),h(this),this.errors=p(this),this.componentStyle=g(this)}async getLayoutState(t){var e,n,i,s,o,r,h,f,g,p,v;const m=null!==(e=null==t?void 0:t.detail)&&void 0!==e?e:"summary",y=l(this.element),b=this.componentStyle((t=>{var e;return(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333})),w={version:a,tag:this.element.localName,id:u(this.element),slot:null!==(n=this.element.getAttribute("slot"))&&void 0!==n?n:void 0,rect:d(this.element,y),em:{fontSizePx:b,appliedScaleFactor:1},regions:[],metadata:{nodeCount:null!==(s=null===(i=this.treeConfig)||void 0===i?void 0:i.allNodes.size)&&void 0!==s?s:0,edgeCount:null!==(r=null===(o=this.treeConfig)||void 0===o?void 0:o.edges.length)&&void 0!==r?r:0},diagnostics:c(this.element)},x=null===(h=this.element.shadowRoot)||void 0===h?void 0:h.querySelector(".tree-grid");if(x&&w.regions.push({id:"grid",rect:d(x,y)}),"full"!==m||!this.treeConfig)return w;const $=[];for(const t of this.treeConfig.allNodes){const e=this.element.querySelector(`[slot="${t}"]`);if(!e)continue;const n={kind:"node",nodeId:t,rect:d(e,y)};$.push(n)}const S=Array.from(null!==(g=null===(f=this.element.shadowRoot)||void 0===f?void 0:f.querySelectorAll("svg.edge-layer path"))&&void 0!==g?g:[]);let k=0;for(const t of this.treeConfig.edges){if(!this.nodeRects.get(t.from)||!this.nodeRects.get(t.to))continue;const e=S[k++];if(!e)break;const n={kind:"edge",from:t.from,to:t.to,operator:t.operator,path:null!==(p=e.getAttribute("d"))&&void 0!==p?p:void 0,rect:d(e,y)};$.push(n)}return null===(v=this.element.shadowRoot)||void 0===v||v.querySelectorAll("svg.edge-layer g.operator-group").forEach((t=>{var e,n;const i=null!==(n=null===(e=t.textContent)||void 0===e?void 0:e.trim())&&void 0!==n?n:"";if(!i)return;const s={kind:"label",role:"operator",text:i,rect:d(t,y)};$.push(s)})),w.elements=$,w}getTreeStyle(){return this.componentStyle((t=>({edgeColor:t["bn-tree"].edgeColor,edgeWidth:t["bn-tree"].edgeWidth,operatorCircleRadius:t["bn-tree"].operatorCircleRadius,operatorFontSize:t.global.fontSizePx*t["bn-tree"].operatorFontSizeScale,operatorColor:t["bn-tree"].operatorColor})))}componentWillLoad(){this.validateEdgesProp(this.edges),this.validateDirection(this.direction),this.validateLevelSpacing(this.levelSpacing),this.validateNodeSpacing(this.nodeSpacing),this.validateEdgeStyle(this.edgeStyle),this.validateShowOperators(this.showOperators)}connectedCallback(){this.observeLayout(),this.updateNodeRects()}componentDidLoad(){var t;null===(t=this.element.shadowRoot)||void 0===t||t.addEventListener("slotchange",(()=>{this.observeLayout(),this.updateNodeRects()})),requestAnimationFrame((()=>{this.updateNodeRects()}))}componentDidRender(){this.observeLayout(),this.updateNodeRects()}disconnectedCallback(){var t;this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.observed.clear(),null===(t=this.parentObserver)||void 0===t||t.disconnect(),this.parentObserver=null}observeLayout(){var t,e,n;const i=null!==(e=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".tree-grid"))&&void 0!==e?e:null;if(i!==this.gridContainer&&(null===(n=this.resizeObserver)||void 0===n||n.disconnect(),this.observed.clear(),this.gridContainer=i),i){this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>{this.updateNodeRects()}))),this.parentObserver||(this.parentObserver=y(this.element,(()=>this.checkOverflow())));for(const t of[i,...Array.from(this.element.querySelectorAll("[slot]"))])this.observed.has(t)||(this.resizeObserver.observe(t),this.observed.add(t))}}recalculateLayout(){this.layout=this.treeConfig?function(t,e,n,i){if(!t.rootNode)return{positions:new Map,gridTemplateColumns:"",gridTemplateRows:"",maxLevel:0,maxIndex:0};const s=function(t){const e=new Map;if(!t.rootNode)return e;const n=[{node:t.rootNode,level:0}],i=new Set;for(;n.length>0;){const{node:s,level:o}=n.shift();if(i.has(s))continue;i.add(s),e.set(s,o);const r=t.adjacencyList.get(s)||[];for(const t of r)i.has(t)||n.push({node:t,level:o+1})}return e}(t),o=function(t){const e=new Map;if(!t.rootNode)return e;let n=0;return function i(s){const o=e.get(s);if(o)return o;const r=t.adjacencyList.get(s)||[];if(e.set(s,{startIndex:n,endIndex:n}),0===r.length){const t={startIndex:n,endIndex:n};return e.set(s,t),n++,t}let a=1/0,l=-1/0;for(const t of r){const e=i(t);a=Math.min(a,e.startIndex),l=Math.max(l,e.endIndex)}const d={startIndex:a,endIndex:l};return e.set(s,d),d}(t.rootNode),e}(t),r=function(t,e,n,i){var s,o;const r=new Map,a=Math.max(...Array.from(e.values()));for(const l of t.allNodes){const d=null!==(s=e.get(l))&&void 0!==s?s:0,c=null!==(o=n.get(l))&&void 0!==o?o:{startIndex:0,endIndex:0};let u,h,f=1,g=1;const p=c.endIndex-c.startIndex+1,v=Array.from(t.allNodes).some((t=>{var i;const s=n.get(t);return t!==l&&void 0!==s&&(null!==(i=e.get(t))&&void 0!==i?i:0)===d&&s.startIndex<=c.endIndex&&c.startIndex<=s.endIndex})),m=v?1:p;switch(i){case"ltr":u=d+1,h=c.startIndex+1,f=p;break;case"rtl":u=a-d+1,h=c.startIndex+1,f=p;break;case"ttb":h=d+1,u=c.startIndex+1,g=m;break;case"btt":h=a-d+1,u=c.startIndex+1,g=m}r.set(l,{nodeId:l,level:d,index:c.startIndex,gridColumn:u,gridRow:h,gridRowSpan:f,gridColumnSpan:g})}return r}(t,s,o,e),a=Math.max(...Array.from(s.values())),l=Math.max(...Array.from(o.values()).map((t=>t.endIndex))),{gridTemplateColumns:d,gridTemplateRows:c}=function(t,e,n,i,s){const o=t+1,r=e+1;if("ltr"===n||"rtl"===n){const t=[];for(let e=0;e<o;e++)t.push("auto"),e<o-1&&t.push(i+"px");const e=[];for(let t=0;t<r;t++)e.push("auto"),t<r-1&&e.push(s+"px");return{gridTemplateColumns:t.join(" "),gridTemplateRows:e.join(" ")}}{const t=[];for(let e=0;e<o;e++)t.push("auto"),e<o-1&&t.push(i+"px");const e=[];for(let t=0;t<r;t++)e.push("auto"),t<r-1&&e.push(s+"px");return{gridTemplateColumns:e.join(" "),gridTemplateRows:t.join(" ")}}}(a,l,e,n,i);return{positions:r,gridTemplateColumns:d,gridTemplateRows:c,maxLevel:a,maxIndex:l}}(this.treeConfig,this.direction,this.levelSpacing,this.nodeSpacing):null}updateNodeRects(){var t;if(!this.treeConfig||!this.gridContainer)return void(null===(t=this.errors)||void 0===t||t.remove("WARN_overflow"));const e=this.gridContainer.getBoundingClientRect(),n=new Map;for(const t of this.treeConfig.allNodes){const i=this.element.querySelector(`[slot="${t}"]`);i&&n.set(t,M(i,e))}(function(t,e){if(t.size!==e.size)return!1;for(const[n,i]of t){const t=e.get(n);if(!t||t.left!==i.left||t.top!==i.top||t.width!==i.width||t.height!==i.height)return!1}return!0})(this.nodeRects,n)||(this.nodeRects=n),this.svgWidth=e.width,this.svgHeight=e.height,this.checkOverflow()}checkOverflow(){var t,e;const n="WARN_overflow",i=v(this.element),s=(null===(t=this.gridContainer)||void 0===t?void 0:t.scrollWidth)||0,o=(null===(e=this.gridContainer)||void 0===e?void 0:e.scrollHeight)||0,r=[];i.width>0&&s>i.width+1&&r.push(`width (${Math.round(s)}px > ${Math.round(i.width)}px)`);const a=m(this.element,o);a>1&&r.push(`height (${Math.round(o)}px > ${Math.round(o-a)}px)`),0!==r.length?this.errors.addOrReplace({id:n,type:"warning",message:`Tree exceeds available ${r.join(" and ")} and will be cut off. Reduce level-spacing, node-spacing or the node content, or enlarge the container.`}):this.errors.remove(n)}getSlotStyle(t){if(!this.layout)return{};const e=this.layout.positions.get(t);return e?"ltr"===this.direction||"rtl"===this.direction?{"grid-column":$(e.gridColumn)+"","grid-row":`${S(e.gridRow)} / span ${k(e.gridRowSpan)}`,"align-self":"center"}:{"grid-row":S(e.gridRow)+"","grid-column":`${$(e.gridColumn)} / span ${R(e.gridColumnSpan)}`,"justify-self":"center"}:{}}renderEdges(){var t;if(!this.treeConfig||0===this.nodeRects.size)return null;const e=this.getTreeStyle(),i=[],s=[],o=new Map;for(const t of this.treeConfig.edges){const e=o.get(t.to)||[];e.push(t.from),o.set(t.to,e)}const r=new Map;for(const[t,e]of this.treeConfig.adjacencyList.entries()){const n=this.nodeRects.get(t),i=e.map((t=>this.nodeRects.get(t))).filter((t=>void 0!==t)),s=n?j(n,i,this.direction):void 0;void 0!==s&&r.set(t,s)}for(const t of this.treeConfig.edges){const s=this.nodeRects.get(t.from),a=this.nodeRects.get(t.to);if(!s||!a)continue;const l=L(s,!0,this.direction),d=o.get(t.to)||[];let c;if(d.length>1){const e=d.indexOf(t.from);c=C(a,this.direction,e,d.length)}else c=L(a,!1,this.direction);const{path:u}=E(l,c,this.edgeStyle,this.direction,r.get(t.from)),h=N(e.edgeColor,e.edgeWidth,t.style);i.push(n("path",{key:`edge-${t.from}-${t.to}`,d:u,fill:"none",stroke:h.stroke,"stroke-width":h.strokeWidth,"stroke-dasharray":h.strokeDasharray}))}if("true"===this.showOperators)for(const[i,o]of this.treeConfig.adjacencyList.entries()){const a=r.get(i);if(void 0!==a)for(let r=0;r<o.length-1;r++){const l=o[r],d=o[r+1],c=x(this.treeConfig.edges,i,l);if(!(null==c?void 0:c.operator)||"none"===c.operator)continue;const u=this.nodeRects.get(l),h=this.nodeRects.get(d);if(!u||!h)continue;const f=null!==(t=c.label)&&void 0!==t?t:w(c.operator),g=A(a,u,h,this.direction);s.push(n("g",{key:`operator-${i}-${l}`,class:"operator-group"},n("circle",{cx:g.x,cy:g.y,r:e.operatorCircleRadius,fill:"white",stroke:e.edgeColor,"stroke-width":e.edgeWidth}),n("text",{x:g.x,y:g.y,"text-anchor":"middle","dominant-baseline":"central",style:{fontSize:e.operatorFontSize+"px",fill:e.operatorColor,fontWeight:"bold"}},f)))}}return n("svg",{class:"edge-layer",width:this.svgWidth,height:this.svgHeight,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none"}},i,s)}renderSlots(){return this.treeConfig&&this.layout?Array.from(this.treeConfig.allNodes).map((t=>n("div",{key:t,class:"tree-node",style:this.getSlotStyle(t)},n("slot",{name:t})))):null}getFontStyles(){return this.componentStyle((t=>{var e,n,i,s;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":((null===(n=t.global)||void 0===n?void 0:n.fontSizePx)||13.3333)+"px","--bn-font-color":(null===(i=t.global)||void 0===i?void 0:i.fontColor)||"#000000","--bn-font-background":(null===(s=t.global)||void 0===s?void 0:s.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return n(i,{style:t},this.treeConfig&&this.layout?n("div",{class:"tree-container"},n("div",{class:"tree-grid",style:{display:"grid","grid-template-columns":this.layout.gridTemplateColumns,"grid-template-rows":this.layout.gridTemplateRows,position:"relative"}},this.renderEdges(),this.renderSlots())):n("div",{class:"tree-container tree-error"},n("slot",null)))}get element(){return this}static get watchers(){return{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}}static get style(){return':host{display:inline-block;position:relative;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.tree-container{position:relative;display:inline-block}.tree-grid{position:relative;display:grid;align-items:center}.tree-node{position:relative;z-index:1;border:1px solid #404040;background:var(--bn-font-background, white)}.edge-layer{position:absolute;top:0;left:0;z-index:0;pointer-events:none;overflow:visible}.tree-error{display:flex;flex-wrap:wrap;gap:20px}'}},[257,"bn-tree",{edges:[1],direction:[1],levelSpacing:[2,"level-spacing"],nodeSpacing:[2,"node-spacing"],edgeStyle:[1,"edge-style"],i18nNamespace:[513,"i18n-namespace"],showOperators:[1,"show-operators"],treeConfig:[32],layout:[32],nodeRects:[32],svgWidth:[32],svgHeight:[32],getLayoutState:[64]},void 0,{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}]),T=O,I=function(){"undefined"!=typeof customElements&&["bn-tree"].forEach((t=>{"bn-tree"===t&&(customElements.get(s(t))||customElements.define(s(t),O))}))};export{T as BnTree,I as defineCustomElement}
@@ -0,0 +1 @@
1
+ import{g as a,a as e}from"./parentDimensions.js";function t(t,o,i){var n,l,s,d,h;const v="WARN_overflow",r=a(t),c=parseFloat(null!==(h=null===(d=null===(s=null===(l=null===(n=t.shadowRoot)||void 0===n?void 0:n.querySelector(o))||void 0===l?void 0:l.shadowRoot)||void 0===s?void 0:s.querySelector("svg#drawCanvas"))||void 0===d?void 0:d.getAttribute("height"))&&void 0!==h?h:""),p=Math.max(Number.isNaN(c)?0:Math.floor(c),t.scrollHeight||0),u=t.scrollWidth||0,g=[];r.width>0&&u>r.width+1&&g.push(`width (${Math.round(u)}px > ${Math.round(r.width)}px)`);const x=e(t,p);x>1&&g.push(`height (${Math.round(p)}px > ${Math.round(p-x)}px)`),0!==g.length?i.addOrReplace({id:v,type:"warning",message:`Chart exceeds available ${g.join(" and ")} and will be cut off. Check the scale and aspect values or enlarge the container.`}):i.remove(v)}export{t as c}