@bino-bi/bn-template-engine 1.0.0-alpha.16 → 1.0.0-alpha.17

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 (287) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-172499ac.entry.js +1 -0
  3. package/dist/bn-template-engine/p-19e65c04.entry.js +1 -0
  4. package/dist/bn-template-engine/{p-ff659485.entry.js → p-1a1fd8eb.entry.js} +1 -1
  5. package/dist/bn-template-engine/p-2849c367.entry.js +1 -0
  6. package/dist/bn-template-engine/p-44L8rZSd.js +1 -0
  7. package/dist/bn-template-engine/p-5dd11fcc.entry.js +1 -0
  8. package/dist/bn-template-engine/p-63f891d9.entry.js +1 -0
  9. package/dist/bn-template-engine/p-72f63181.entry.js +1 -0
  10. package/dist/bn-template-engine/p-836ad6f3.entry.js +1 -0
  11. package/dist/bn-template-engine/p-B2KOyHRY.js +1 -0
  12. package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
  13. package/dist/bn-template-engine/p-BnOTt2YD.js +1 -0
  14. package/dist/bn-template-engine/p-CDPTCKVx.js +1 -0
  15. package/dist/bn-template-engine/p-CIXlJoMr.js +1 -0
  16. package/dist/bn-template-engine/{p-BPDZcex5.js → p-COXiPUfj.js} +1 -1
  17. package/dist/bn-template-engine/p-CPZIJpxn.js +1 -0
  18. package/dist/bn-template-engine/p-DHibUOw5.js +1 -0
  19. package/dist/bn-template-engine/p-a50da0f0.entry.js +1 -0
  20. package/dist/bn-template-engine/p-a9a34fb2.entry.js +1 -0
  21. package/dist/bn-template-engine/p-b0369558.entry.js +1 -0
  22. package/dist/bn-template-engine/p-d3fc17ee.entry.js +1 -0
  23. package/dist/bn-template-engine/p-f8c46905.entry.js +1 -0
  24. package/dist/bn-template-engine/p-lIy3SJs2.js +1 -0
  25. package/dist/cjs/AxisConfig-B_GMRfX_.js +233 -0
  26. package/dist/cjs/LabelCollisionManager-8HGn9W0V.js +8616 -0
  27. package/dist/cjs/VarianceMeasure-DEOzP-XZ.js +372 -0
  28. package/dist/cjs/XYChartDataRow-CDl1Ofnv.js +933 -0
  29. package/dist/cjs/bn-asset_21.cjs.entry.js +1586 -9600
  30. package/dist/cjs/bn-chart-bubble.cjs.entry.js +761 -0
  31. package/dist/cjs/bn-chart-scatter.cjs.entry.js +657 -0
  32. package/dist/cjs/bn-grid.cjs.entry.js +4 -3
  33. package/dist/cjs/bn-image.cjs.entry.js +4 -3
  34. package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
  35. package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
  36. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  37. package/dist/cjs/bn-template.cjs.entry.js +1 -1
  38. package/dist/cjs/bn-text.cjs.entry.js +7 -79
  39. package/dist/cjs/bn-tree.cjs.entry.js +3 -2
  40. package/dist/cjs/{context-protocol-Cn5PL928.js → context-protocol-CIuyJKkK.js} +206 -1
  41. package/dist/cjs/editor-companion.cjs.entry.js +2 -2
  42. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +622 -0
  43. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +665 -0
  44. package/dist/cjs/layoutObserver-CJWRV_y6.js +350 -0
  45. package/dist/cjs/loader.cjs.js +1 -1
  46. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
  47. package/dist/cjs/{scaling-DM2UILdF.js → scaling-B4UPXivZ.js} +1 -1
  48. package/dist/cjs/withScalingGroup-D832DQKp.js +73 -0
  49. package/dist/cjs/{withStyled-Dx3uRw9g.js → withStyled-COxuhL-N.js} +43 -301
  50. package/dist/collection/collection-manifest.json +5 -0
  51. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
  52. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
  53. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
  54. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
  55. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
  56. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
  57. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
  58. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
  59. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
  60. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
  61. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +23 -2
  62. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +29 -4
  63. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +3 -0
  64. package/dist/collection/components/bn-chart-time/bn-chart-time.js +27 -4
  65. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +29 -4
  66. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +16 -4
  67. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
  68. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  69. package/dist/collection/components/bn-context/bn-context.js +1 -1
  70. package/dist/collection/components/bn-dataset/bn-dataset.js +1 -1
  71. package/dist/collection/components/bn-datasource/bn-datasource.js +1 -1
  72. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  73. package/dist/collection/components/bn-grid/bn-grid.js +1 -1
  74. package/dist/collection/components/bn-image/bn-image.js +1 -1
  75. package/dist/collection/components/bn-internationalization/bn-internationalization.js +1 -1
  76. package/dist/collection/components/bn-layout-card/bn-layout-card.js +26 -3
  77. package/dist/collection/components/bn-layout-page/bn-layout-page.js +33 -4
  78. package/dist/collection/components/bn-message/bn-message.css +6 -2
  79. package/dist/collection/components/bn-message/bn-message.js +3 -2
  80. package/dist/collection/components/bn-page/bn-page.js +1 -1
  81. package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
  82. package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
  83. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +1 -1
  84. package/dist/collection/components/bn-table/bn-table.js +146 -14
  85. package/dist/collection/components/bn-table/ibcs-table.css +8 -0
  86. package/dist/collection/components/bn-table/ibcs-table.js +64 -8
  87. package/dist/collection/components/bn-table/utils/Table.js +43 -5
  88. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
  89. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
  90. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
  91. package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
  92. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +87 -15
  93. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +284 -3
  94. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
  95. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
  96. package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
  97. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +10 -0
  98. package/dist/collection/components/bn-template/bn-template.js +1 -1
  99. package/dist/collection/components/bn-text/bn-text.js +2 -75
  100. package/dist/collection/components/bn-title/bn-title.js +27 -3
  101. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
  102. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +29 -3
  103. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -0
  104. package/dist/collection/components/editor-companion/editor-companion.js +1 -1
  105. package/dist/collection/stores/componentStyles.js +29 -0
  106. package/dist/collection/stores/createScopedStores.js +6 -1
  107. package/dist/collection/stores/internationalization.js +40 -0
  108. package/dist/collection/stores/ruleSets.js +46 -0
  109. package/dist/collection/utils/constants.js +5 -0
  110. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  111. package/dist/collection/utils/sanitizeHtml.js +81 -0
  112. package/dist/collection/utils/validate.js +24 -0
  113. package/dist/collection/utils/withComponentStyle.js +3 -5
  114. package/dist/collection/utils/withInheritedProps.js +1 -1
  115. package/dist/collection/utils/withRuleSet.js +105 -0
  116. package/dist/collection/utils/withScalingGroup.js +3 -0
  117. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  118. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  119. package/dist/collection/utils/xy/NumericScale.js +103 -0
  120. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  121. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  122. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  123. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  124. package/dist/collection/utils/xy/XYFrame.js +120 -0
  125. package/dist/collection/utils/xy/XYLegend.js +107 -0
  126. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  127. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  128. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  129. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  130. package/dist/components/AxisConfig.js +1 -0
  131. package/dist/components/CompareUtil.js +1 -0
  132. package/dist/components/DataFormatDigits.js +1 -1
  133. package/dist/components/LabelCollisionManager.js +1 -0
  134. package/dist/components/Order.js +1 -1
  135. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  136. package/dist/components/SiPrefix.js +1 -0
  137. package/dist/components/StringAdapter.js +1 -0
  138. package/dist/components/VarianceMeasure.js +1 -0
  139. package/dist/components/XYChartDataRow.js +1 -0
  140. package/dist/components/bn-chart-bubble.d.ts +11 -0
  141. package/dist/components/bn-chart-bubble.js +1 -0
  142. package/dist/components/bn-chart-scatter.d.ts +11 -0
  143. package/dist/components/bn-chart-scatter.js +1 -0
  144. package/dist/components/bn-chart-structure.js +1 -1
  145. package/dist/components/bn-chart-time.js +1 -1
  146. package/dist/components/bn-component-style.js +1 -1
  147. package/dist/components/bn-context.js +1 -1
  148. package/dist/components/bn-dataset.js +1 -1
  149. package/dist/components/bn-datasource.js +1 -1
  150. package/dist/components/bn-footer2.js +1 -1
  151. package/dist/components/bn-grid.js +1 -1
  152. package/dist/components/bn-image.js +1 -1
  153. package/dist/components/bn-internationalization.js +1 -1
  154. package/dist/components/bn-layout-card.js +1 -1
  155. package/dist/components/bn-layout-page.js +1 -1
  156. package/dist/components/bn-message2.js +1 -1
  157. package/dist/components/bn-page2.js +1 -1
  158. package/dist/components/bn-ruleset.d.ts +11 -0
  159. package/dist/components/bn-ruleset.js +1 -0
  160. package/dist/components/bn-scaling-group.js +1 -1
  161. package/dist/components/bn-table.js +1 -1
  162. package/dist/components/bn-template.js +1 -1
  163. package/dist/components/bn-text.js +1 -1
  164. package/dist/components/bn-title2.js +1 -1
  165. package/dist/components/bn-tree.js +1 -1
  166. package/dist/components/context-protocol.js +1 -1
  167. package/dist/components/editor-companion.js +1 -1
  168. package/dist/components/formatter.js +1 -0
  169. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  170. package/dist/components/ibcs-chart-bubble.js +1 -0
  171. package/dist/components/ibcs-chart-bubble2.js +1 -0
  172. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  173. package/dist/components/ibcs-chart-scatter.js +1 -0
  174. package/dist/components/ibcs-chart-scatter2.js +1 -0
  175. package/dist/components/ibcs-chart-structure2.js +1 -1
  176. package/dist/components/ibcs-chart-time2.js +1 -1
  177. package/dist/components/ibcs-table2.js +1 -1
  178. package/dist/components/ibcs-title2.js +1 -1
  179. package/dist/components/layoutObserver.js +1 -1
  180. package/dist/components/luxon.js +1 -1
  181. package/dist/components/merge.js +1 -0
  182. package/dist/components/sanitizeHtml.js +1 -0
  183. package/dist/components/stackColors.js +1 -0
  184. package/dist/components/validate.js +1 -1
  185. package/dist/components/withComponentStyle.js +1 -1
  186. package/dist/components/withDataset.js +1 -0
  187. package/dist/components/withRuleSet.js +1 -0
  188. package/dist/components/withScalingGroup.js +1 -0
  189. package/dist/components/withStyled.js +1 -1
  190. package/dist/esm/AxisConfig-BwUQrme0.js +224 -0
  191. package/dist/esm/LabelCollisionManager-DZP5Vl8T.js +8599 -0
  192. package/dist/esm/VarianceMeasure-Cxshx01h.js +364 -0
  193. package/dist/esm/XYChartDataRow-FF_VxRnF.js +923 -0
  194. package/dist/esm/bn-asset_21.entry.js +1124 -9138
  195. package/dist/esm/bn-chart-bubble.entry.js +759 -0
  196. package/dist/esm/bn-chart-scatter.entry.js +655 -0
  197. package/dist/esm/bn-grid.entry.js +4 -3
  198. package/dist/esm/bn-image.entry.js +4 -3
  199. package/dist/esm/bn-internationalization.entry.js +2 -2
  200. package/dist/esm/bn-ruleset.entry.js +39 -0
  201. package/dist/esm/bn-template-engine.js +1 -1
  202. package/dist/esm/bn-template.entry.js +1 -1
  203. package/dist/esm/bn-text.entry.js +6 -78
  204. package/dist/esm/bn-tree.entry.js +3 -2
  205. package/dist/esm/{context-protocol-BB-4Onmw.js → context-protocol-BNHTlllP.js} +202 -2
  206. package/dist/esm/editor-companion.entry.js +2 -2
  207. package/dist/esm/ibcs-chart-bubble.entry.js +620 -0
  208. package/dist/esm/ibcs-chart-scatter.entry.js +663 -0
  209. package/dist/esm/layoutObserver-D5FY_lQa.js +345 -0
  210. package/dist/esm/loader.js +1 -1
  211. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  212. package/dist/esm/{scaling-h4KcBet3.js → scaling-B7Pa0d_s.js} +2 -2
  213. package/dist/esm/withScalingGroup-DBheBsP4.js +71 -0
  214. package/dist/esm/{withStyled-BBvU2f-A.js → withStyled-DTvj2nar.js} +29 -287
  215. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  216. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  217. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  218. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  219. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  220. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  221. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +7 -0
  222. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +2 -0
  223. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +1 -0
  224. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +10 -1
  225. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +2 -0
  226. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +1 -0
  227. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +10 -0
  228. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +14 -0
  229. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  230. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  231. package/dist/types/components/bn-table/bn-table.d.ts +38 -5
  232. package/dist/types/components/bn-table/ibcs-table.d.ts +8 -1
  233. package/dist/types/components/bn-table/utils/Table.d.ts +8 -0
  234. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  235. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  236. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  237. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  238. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  239. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +13 -7
  240. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +17 -0
  241. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  242. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  243. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  244. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +4 -0
  245. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  246. package/dist/types/components/bn-title/bn-title.d.ts +11 -1
  247. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
  248. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  249. package/dist/types/components.d.ts +943 -37
  250. package/dist/types/context/context-protocol.d.ts +2 -0
  251. package/dist/types/stores/componentStyles.d.ts +21 -0
  252. package/dist/types/stores/createScopedStores.d.ts +2 -0
  253. package/dist/types/stores/ruleSets.d.ts +40 -0
  254. package/dist/types/utils/constants.d.ts +5 -0
  255. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  256. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  257. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  258. package/dist/types/utils/validate.d.ts +12 -0
  259. package/dist/types/utils/withInheritedProps.d.ts +11 -0
  260. package/dist/types/utils/withRuleSet.d.ts +24 -0
  261. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  262. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  263. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  264. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  265. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  266. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  267. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  268. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  269. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  270. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  271. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  272. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  273. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  274. package/package.json +1 -1
  275. package/readme.md +7 -3
  276. package/dist/bn-template-engine/p-19f49fbc.entry.js +0 -1
  277. package/dist/bn-template-engine/p-3465fcdc.entry.js +0 -1
  278. package/dist/bn-template-engine/p-67746414.entry.js +0 -1
  279. package/dist/bn-template-engine/p-6b469808.entry.js +0 -1
  280. package/dist/bn-template-engine/p-86ca2d5e.entry.js +0 -1
  281. package/dist/bn-template-engine/p-Tx6omDWp.js +0 -1
  282. package/dist/bn-template-engine/p-d724ab88.entry.js +0 -1
  283. package/dist/bn-template-engine/p-efd3b67a.entry.js +0 -1
  284. package/dist/bn-template-engine/p-z9bPNFYF.js +0 -1
  285. package/dist/components/ibcsRuleSet.js +0 -1
  286. package/dist/components/scaling.js +0 -1
  287. package/dist/components/withInheritedProps.js +0 -1
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as i,Fragment as r,transformTag as s}from"@stencil/core/internal/client";import{g as a}from"./context-protocol.js";import{a as o}from"./withHasError.js";import{w as n}from"./withInheritedProps.js";import{d as l}from"./bn-body2.js";import{d as c}from"./bn-card2.js";import{d}from"./bn-footer2.js";import{d as h}from"./bn-title2.js";import{d as m}from"./ibcs-title2.js";const b=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.titleImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.titleNamespace="_system",this.footerText="",this.cardLayout="full",this.cardCustomTemplate='"a b" "c d"',this.cardGridGap="0",this.cardFitToContent=!1,this.cardShowBorder=!0,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=o(this),this.resolveInherited=n(this,[{propName:"titleScenarios",ancestorAttr:"title-scenarios"},{propName:"titleVariances",ancestorAttr:"title-variances"},{propName:"titleOrder",ancestorAttr:"title-order"},{propName:"titleOrderDirection",ancestorAttr:"title-order-direction"}])}connectedCallback(){this.stores=a(this.element),this.reflectInheritedAttrs()}getCommonStyles(){let t="100%";return!0===this.cardFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.cardGridGap+"px"}}calculateFractions(t){const e=t.trim().split(/\s+/).length;return 0===e?"minmax(0, 1fr)":Array(e).fill("minmax(0, 1fr)").join(" ")}getGridTemplateColumns(t){const e=this.getTemplatePattern(t).match(/"[\w\d\s.]+"/g);return e&&0!==e.length?this.calculateFractions(e[0]):"minmax(0, 1fr)"}getRowCount(t){const e=this.getTemplatePattern(t).match(/"[\w\d\s.]+"/g);return e?e.length:1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.cardFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplatePattern(this.cardLayout),"grid-template-columns":this.getGridTemplateColumns(this.cardLayout),"grid-template-rows":this.getGridTemplateRows(this.cardLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return i(r,null,e.map(((t,e)=>i("div",{style:t},i("slot",{name:"card-slot-"+e})))))}extractSlotNames(t){if(null==t)return[];const e=t.match(/\b\w+\b/g);return e?Array.from(new Set(e)):[]}getTemplatePattern(t){return!1===this.templateMap.has(t)&&"custom-template"!==t?'"a"':"custom-template"===t?this.cardCustomTemplate:this.templateMap.get(t)}async getNumberOfSlot(t){const e=this.getTemplatePattern(t);return this.extractSlotNames(e).length}componentDidUpdate(){}setCardClass(){return!0===this.cardShowBorder?"card_box border":"card_box"}reflectInheritedAttrs(){const t=[{prop:"titleScenarios",attr:"title-scenarios"},{prop:"titleVariances",attr:"title-variances"},{prop:"titleOrder",attr:"title-order"},{prop:"titleOrderDirection",attr:"title-order-direction"}];for(const{prop:e,attr:i}of t){const t=this.resolveInherited(e,this[e]);void 0!==t&&this.element.setAttribute(i,t)}}prepareTitleImage(t){if(null==t||""===t)return"";const e=this.stores.assets.state;return t.startsWith("asset:")?e[t.substring(6)]:e[t]||t}render(){var t,e,r,s;const a=this.getLayoutStyle(),o=this.extractSlotNames(a["grid-template-areas"]);return i("bn-card",{key:"f94b210638d26436a03daba89d7da43ec4dc6973",styles:this.styles,"selected-style":this.selectedStyle,class:this.setCardClass()},i("div",{key:"b29e3e8a32672278508e13daeb215529d6c4e0fd",class:"cardtitle"},i("bn-title",{key:"988a77ef985bf45326af5fbdd2dd2940e0bd3e2b",namespace:this.titleNamespace,"business-unit":this.titleBusinessUnit,scenarios:null!==(t=this.resolveInherited("titleScenarios",this.titleScenarios))&&void 0!==t?t:this.titleScenarios,variances:null!==(e=this.resolveInherited("titleVariances",this.titleVariances))&&void 0!==e?e:this.titleVariances,order:null!==(r=this.resolveInherited("titleOrder",this.titleOrder))&&void 0!==r?r:this.titleOrder,"order-direction":null!==(s=this.resolveInherited("titleOrderDirection",this.titleOrderDirection))&&void 0!==s?s:this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),null!=this.titleImage&&""!==this.titleImage?i("img",{class:"image",src:this.prepareTitleImage(this.titleImage)}):""),i("bn-body",{key:"2391406ed78728ac6d343ee1ee20500be6f4aef3"},i("div",{key:"97fa4d0c73a0d0b7bc4a9fda83133291d7f875e7",style:a,"data-bn-fit-content":this.cardFitToContent?this.getRowCount(this.cardLayout)+"":null},this.getSlots(o))),i("bn-footer",{key:"2162b61945c8e7c20602ef7e7a50dbb33ee5a6d2",text:this.footerText,"page-number":0,"display-page-number":"false"}))}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:flex;flex-direction:column;width:100%;height:100%;overflow:hidden}.cardtitle{display:inline-flex}::slotted(*){flex:1 1 auto;min-width:0}.image{margin-right:0.5em;margin-top:0.5em;z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:inline}'}},[257,"bn-layout-card",{styles:[1],selectedStyle:[1,"selected-style"],titleImage:[1,"title-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"],footerText:[1,"footer-text"],cardLayout:[1,"card-layout"],cardCustomTemplate:[1,"card-custom-template"],cardGridGap:[1,"card-grid-gap"],cardFitToContent:[4,"card-fit-to-content"],cardShowBorder:[4,"card-show-border"],getNumberOfSlot:[64]}]),u=b,p=function(){"undefined"!=typeof customElements&&["bn-layout-card","bn-body","bn-card","bn-footer","bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-layout-card":customElements.get(s(t))||customElements.define(s(t),b);break;case"bn-body":customElements.get(s(t))||l();break;case"bn-card":customElements.get(s(t))||c();break;case"bn-footer":customElements.get(s(t))||d();break;case"bn-title":customElements.get(s(t))||h();break;case"ibcs-title":customElements.get(s(t))||m()}}))};export{u as BnLayoutCard,p as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as r,Fragment as i,transformTag as s}from"@stencil/core/internal/client";import{g as a}from"./context-protocol.js";import{a as o}from"./withHasError.js";import{a as n}from"./withRuleSet.js";import{d as l}from"./bn-body2.js";import{d as c}from"./bn-card2.js";import{d}from"./bn-footer2.js";import{d as h}from"./bn-title2.js";import{d as m}from"./ibcs-title2.js";const b=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.titleImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.titleNamespace="_system",this.footerText="",this.cardLayout="full",this.cardCustomTemplate='"a b" "c d"',this.cardGridGap="0",this.cardFitToContent=!1,this.cardShowBorder=!0,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=o(this),this.resolveInherited=n(this,[{propName:"titleScenarios",ancestorAttr:"title-scenarios"},{propName:"titleVariances",ancestorAttr:"title-variances"},{propName:"titleOrder",ancestorAttr:"title-order"},{propName:"titleOrderDirection",ancestorAttr:"title-order-direction"},{propName:"ruleset",ancestorAttr:"ruleset"}])}connectedCallback(){this.stores=a(this.element),this.reflectInheritedAttrs()}getCommonStyles(){let t="100%";return!0===this.cardFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.cardGridGap+"px"}}calculateFractions(t){const e=t.trim().split(/\s+/).length;return 0===e?"minmax(0, 1fr)":Array(e).fill("minmax(0, 1fr)").join(" ")}getGridTemplateColumns(t){const e=this.getTemplatePattern(t).match(/"[\w\d\s.]+"/g);return e&&0!==e.length?this.calculateFractions(e[0]):"minmax(0, 1fr)"}getRowCount(t){const e=this.getTemplatePattern(t).match(/"[\w\d\s.]+"/g);return e?e.length:1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.cardFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplatePattern(this.cardLayout),"grid-template-columns":this.getGridTemplateColumns(this.cardLayout),"grid-template-rows":this.getGridTemplateRows(this.cardLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return r(i,null,e.map(((t,e)=>r("div",{style:t},r("slot",{name:"card-slot-"+e})))))}extractSlotNames(t){if(null==t)return[];const e=t.match(/\b\w+\b/g);return e?Array.from(new Set(e)):[]}getTemplatePattern(t){return!1===this.templateMap.has(t)&&"custom-template"!==t?'"a"':"custom-template"===t?this.cardCustomTemplate:this.templateMap.get(t)}async getNumberOfSlot(t){const e=this.getTemplatePattern(t);return this.extractSlotNames(e).length}componentDidUpdate(){}setCardClass(){return!0===this.cardShowBorder?"card_box border":"card_box"}reflectInheritedAttrs(){const t=[{prop:"titleScenarios",attr:"title-scenarios"},{prop:"titleVariances",attr:"title-variances"},{prop:"titleOrder",attr:"title-order"},{prop:"titleOrderDirection",attr:"title-order-direction"},{prop:"ruleset",attr:"ruleset"}];for(const{prop:e,attr:r}of t){const t=this.resolveInherited(e,this[e]);void 0!==t&&this.element.setAttribute(r,t)}}prepareTitleImage(t){if(null==t||""===t)return"";const e=this.stores.assets.state;return t.startsWith("asset:")?e[t.substring(6)]:e[t]||t}render(){var t,e,i,s,a;const o=this.getLayoutStyle(),n=this.extractSlotNames(o["grid-template-areas"]);return r("bn-card",{key:"fd78ac2ccd6742b6be6e726f90aa64ede009cc6f",styles:this.styles,"selected-style":this.selectedStyle,class:this.setCardClass()},r("div",{key:"7089fae2d8cb7f4cc193ded4ab371af706971476",class:"cardtitle"},r("bn-title",{key:"ddafc110dfc6c41995c88e671401c92d6a281beb",namespace:this.titleNamespace,ruleset:null!==(t=this.resolveInherited("ruleset",this.ruleset))&&void 0!==t?t:this.ruleset,"business-unit":this.titleBusinessUnit,scenarios:null!==(e=this.resolveInherited("titleScenarios",this.titleScenarios))&&void 0!==e?e:this.titleScenarios,variances:null!==(i=this.resolveInherited("titleVariances",this.titleVariances))&&void 0!==i?i:this.titleVariances,order:null!==(s=this.resolveInherited("titleOrder",this.titleOrder))&&void 0!==s?s:this.titleOrder,"order-direction":null!==(a=this.resolveInherited("titleOrderDirection",this.titleOrderDirection))&&void 0!==a?a:this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),null!=this.titleImage&&""!==this.titleImage?r("img",{class:"image",src:this.prepareTitleImage(this.titleImage)}):""),r("bn-body",{key:"472abe3e7640d7735d0b15b88ec0c3036d1862a1"},r("div",{key:"e9e1970e093f3f9a00707a5b8bf5e6624b53974a",style:o,"data-bn-fit-content":this.cardFitToContent?this.getRowCount(this.cardLayout)+"":null},this.getSlots(n))),r("bn-footer",{key:"2562532b8916d6316c019d93e2eab6e27fdca031",text:this.footerText,"page-number":0,"display-page-number":"false"}))}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:flex;flex-direction:column;width:100%;height:100%;overflow:hidden}.cardtitle{display:inline-flex}::slotted(*){flex:1 1 auto;min-width:0}.image{margin-right:0.5em;margin-top:0.5em;z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:inline}'}},[257,"bn-layout-card",{styles:[1],selectedStyle:[1,"selected-style"],ruleset:[1],titleImage:[1,"title-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"],footerText:[1,"footer-text"],cardLayout:[1,"card-layout"],cardCustomTemplate:[1,"card-custom-template"],cardGridGap:[1,"card-grid-gap"],cardFitToContent:[4,"card-fit-to-content"],cardShowBorder:[4,"card-show-border"],getNumberOfSlot:[64]}]),u=b,p=function(){"undefined"!=typeof customElements&&["bn-layout-card","bn-body","bn-card","bn-footer","bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-layout-card":customElements.get(s(t))||customElements.define(s(t),b);break;case"bn-body":customElements.get(s(t))||l();break;case"bn-card":customElements.get(s(t))||c();break;case"bn-footer":customElements.get(s(t))||d();break;case"bn-title":customElements.get(s(t))||h();break;case"ibcs-title":customElements.get(s(t))||m()}}))};export{u as BnLayoutCard,p as defineCustomElement}
@@ -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 as b}from"./ibcs-title2.js";const d=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.titleNamespace="_system",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(){const t=this.getLayoutStyle(),e=this.extractSlotNames(t["grid-template-areas"]);return s("bn-page",{key:"ed0804f3f1daf9327903fd61ff633f2857119a31",styles:this.styles,"selected-style":this.selectedStyle,format:this.pageFormat,orientation:this.pageOrientation},s("bn-message",{key:"ccfb6dfa63b001e6fe96612ed3f8635970b6481c",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"223bd6ba689c17796eb165839223164f8bb174e5",namespace:this.titleNamespace,"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:"606f637fb9a48a83062193e7e88733c6b2f092b1"},s("div",{key:"94aebd1b35061ec6e7ccfb4203ea4bc07ea90cbd",style:t,"data-bn-fit-content":this.pageFitToContent?this.getRowCount(this.pageLayout)+"":null},this.getSlots(e))),s("bn-footer",{key:"aa64d4f789c3016289b400a3ea796b1d37f9bcfc",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"],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"],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=d,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),d);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))||b()}}))};export{h as BnLayoutPage,p as defineCustomElement}
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.titleNamespace="_system",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(){const t=this.getLayoutStyle(),e=this.extractSlotNames(t["grid-template-areas"]);return s("bn-page",{key:"c07ff4c3b0d39b1afa36b6bdd015ee4c88c22404",styles:this.styles,"selected-style":this.selectedStyle,format:this.pageFormat,orientation:this.pageOrientation},s("bn-message",{key:"e65c9d9f97f1ce63ebcf5c255b7b1c9457fb72c4",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"c69cf9dce72afe3f23c5642d80287926e443e7e1",namespace: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:"c5ef984f19253a42464e81eb5c70037f3b1ed111"},s("div",{key:"5a54ccdc4d8e221f45cee1a4e43cf0b388818ce3",style:t,"data-bn-fit-content":this.pageFitToContent?this.getRowCount(this.pageLayout)+"":null},this.getSlots(e))),s("bn-footer",{key:"41ad417476586a1f40aa838d96d08a8336d04a93",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"],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 +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}from"./withHasError.js";import{w as r}from"./withComponentStyle.js";import{g as l}from"./context-protocol.js";const c=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),o(this),this.errors=a(this),this.componentStyle=r(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:"bbe7f6098aa6f3a5495b36557b218a82ec2ccbca",id:this.text||this.image?"container-page-message":"container",style:this.getFontStyles()},s("div",{key:"d89297da5605b0ee1cc757b1771b6a48525a24e5",id:"message-text"},null!=this.text&&""!==this.text?s("span",{class:"note"},this.text):""),s("div",{key:"70bc74b0a8a5a39fdd2931cf86faada294142a26",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){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}.image{z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:inline}'}},[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
+ 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}from"./withHasError.js";import{w as r}from"./withComponentStyle.js";import{g as l}from"./context-protocol.js";import{s as c}from"./sanitizeHtml.js";const d=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),o(this),this.errors=a(this),this.componentStyle=r(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:"83f39ae717c41c0861dc593bf732a81a82635ac1",id:this.text||this.image?"container-page-message":"container",style:this.getFontStyles()},s("div",{key:"bd76f6bb557d9312092f116ab0aaaa950e505acf",id:"message-text"},null!=this.text&&""!==this.text?s("span",{class:"note",innerHTML:c(this.text)}):""),s("div",{key:"de1e14e4115f76a00b64994e7b6dbec7c75b4ea5",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),d))}))}export{d as F,m as 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:"b4d682a8f6e83f77c58236265eaf9d1327809c6f",format:this.format,orientation:this.orientation,style:this.prepareStyle()},o("slot",{key:"ef49c43c1f8926c4c968b752608627adbe330d6c"}))}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 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:"7623fe9a67534d467f10d7ad25afb201e895110f",format:this.format,orientation:this.orientation,style:this.prepareStyle()},o("slot",{key:"8a2e3cce4449d2ce5ce898aff45ca8b4b903ab6c"}))}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}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface BnRuleset extends Components.BnRuleset, HTMLElement {}
4
+ export const BnRuleset: {
5
+ prototype: BnRuleset;
6
+ new (): BnRuleset;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +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:"a914ac24571f43967ff34a6d0ea4d4d6a8436310"})}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 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as n,Host as s,transformTag as a}from"@stencil/core/internal/client";import{g as i}from"./context-protocol.js";import{w as r,a as o}from"./withHasError.js";const h=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),r(this),this.errors=o(this)}connectedCallback(){this.stores=i(this.element),this.pushToStore()}onNameChange(e,t){t&&t!==e&&this.stores&&this.stores.scalingGroups.state[t]===this.value&&this.stores.scalingGroups.set(t,void 0),this.pushToStore()}onValueChange(){this.pushToStore()}pushToStore(){var e;if(!this.stores)return;const t=null===(e=this.name)||void 0===e?void 0:(""+e).trim();"auto"!==(null==t?void 0:t.toLowerCase())?(this.errors.remove("ERR_reserved_name"),t?(this.errors.remove("ERR_empty_name"),this.stores.scalingGroups.set(t,this.value)):this.errors.addOrReplace({id:"ERR_empty_name",type:"warning",message:"bn-scaling-group: name is required."})):this.errors.addOrReplace({id:"ERR_reserved_name",type:"warning",message:'bn-scaling-group: name "auto" is reserved and cannot be used.'})}render(){return n(s,{key:"5f38a91595cb1494b275d48345bf821fddb9b904"})}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:[2]},void 0,{name:[{onNameChange:0}],value:[{onValueChange:0}]}]),u=h,l=function(){"undefined"!=typeof customElements&&["bn-scaling-group"].forEach((e=>{"bn-scaling-group"===e&&(customElements.get(a(e))||customElements.define(a(e),h))}))};export{u as BnScalingGroup,l as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,h as n,Host as s,transformTag as a}from"@stencil/core/internal/client";import{g as i}from"./context-protocol.js";import{w as r,a as o}from"./withHasError.js";const h=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),r(this),this.errors=o(this)}connectedCallback(){this.stores=i(this.element),this.pushToStore()}onNameChange(e,t){t&&t!==e&&this.stores&&this.stores.scalingGroups.state[t]===this.value&&this.stores.scalingGroups.set(t,void 0),this.pushToStore()}onValueChange(){this.pushToStore()}pushToStore(){var e;if(!this.stores)return;const t=null===(e=this.name)||void 0===e?void 0:(""+e).trim();"auto"!==(null==t?void 0:t.toLowerCase())?(this.errors.remove("ERR_reserved_name"),t?(this.errors.remove("ERR_empty_name"),this.stores.scalingGroups.set(t,this.value)):this.errors.addOrReplace({id:"ERR_empty_name",type:"warning",message:"bn-scaling-group: name is required."})):this.errors.addOrReplace({id:"ERR_reserved_name",type:"warning",message:'bn-scaling-group: name "auto" is reserved and cannot be used.'})}render(){return n(s,{key:"fe1325e81399fceb3ec75c1289d3479f88045baa"})}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:[2]},void 0,{name:[{onNameChange:0}],value:[{onValueChange:0}]}]),u=h,c=function(){"undefined"!=typeof customElements&&["bn-scaling-group"].forEach((e=>{"bn-scaling-group"===e&&(customElements.get(a(e))||customElements.define(a(e),h))}))};export{u as BnScalingGroup,c 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 d,p as h,h as p,q as u,l as c,r as v,k as m,s as g,t as y,b,c as f,u as w,m as S,w as O,x as T,y as R,z as D}from"./validate.js";import{w as _,g as E,p as M}from"./scaling.js";import{w as C,a as F}from"./withHasError.js";import{w as A,o as N}from"./layoutObserver.js";import{a as G}from"./context-protocol.js";import{w as W}from"./withTranslation.js";import{w as P}from"./withStyled.js";import{w as U}from"./withComponentStyle.js";import{w as j,i as x}from"./withInheritedProps.js";import{D as L,O as I,b as J,I as k,e as B,M as V,B as z,T as $}from"./Order.js";import{T as q,d as H}from"./ibcs-table2.js";const Y=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.tableTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling=.01,this.percentageScaling=.5,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.tableAttributes="",this._autoScaleGuard=!1,P(this),C(this),this.errors=F(this),A(this),this.componentStyle=U(this),_(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,i)=>{this.datasetMeta=i})),this.t=W(this).t,this.resolveInherited=j(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(x(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(x(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(d(t))return void this.errors.remove(i);const e=l(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";h(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";"auto"===(null==t?void 0:(""+t).trim().toLowerCase())||p(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."})}validatePercentageScaling(t){const i="ERR_percentageScaling";"auto"===(null==t?void 0:(""+t).trim().toLowerCase())||p(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."})}validateDataFormat(t){const i="ERR_dataFormat";u(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=y(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(x(t))return void this.errors.remove(i);const e=b(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";x(t)||f(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";w(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";S(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)}validateTableAttributes(t){const i="ERR_attributes",e=R(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.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=N(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=E(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}=M(this.scale);if("auto"!==t&&"empty"!==t)return void(this._autoScaleGuard=!1);if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const i=this.element,{width:a}=E(i);if(a<=0)return;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 void this.errors.remove("AUTO_scale");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})))}prepareDataFormat(){var t;return L[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 q[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=>J[null==t?void 0:t.toUpperCase()])),direction:I[null==s?void 0:s.toUpperCase()]}}prepareI18nMode(){return k.META}prepareI18n(){const t=G,i=new Map(["in","category","operation","there_of","part_of","SUM_TOTAL"].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 h=this.resolveInherited("scenarios",this.scenarios),p=this.resolveInherited("variances",this.variances);if(void 0!==h||void 0!==p){this.errors.remove("AUTO_scenarios");let i=[];return void 0!==h?i=i.concat(h.split(",")):d(this.scenarios)||(i=i.concat(this.scenarios.split(","))),void 0!==p?i=i.concat(p.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 u="auto"===(null===(i=this.scenarios)||void 0===i?void 0:i.trim().toLowerCase());if((d(this.scenarios)||u)&&d(this.variances))return(null===(a=null===(e=this.datasetMeta)||void 0===e?void 0:e.availableScenarios)||void 0===a?void 0:a.length)>0?(u?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 u||d(this.scenarios)?(null===(r=null===(s=this.datasetMeta)||void 0===s?void 0:s.availableScenarios)||void 0===r?void 0:r.length)>0&&(u?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 d(this.categoryWidth)?B.INF:B[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return d(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 d(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}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?D(t,"attr_"+e,i):null)).filter((t=>null!==t))}catch(t){return[]}}prepareTableTitle(){return""===this.tableTitle||null==this.tableTitle?"SUM_TOTAL":this.tableTitle}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=$[i];return e?z[e]:z[$.W10]}prepareBarColumns(){return d(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){var t;return this.pixelPerUnitGroupMap.has(this.unitScaling)?this.pixelPerUnitGroupMap.get(this.unitScaling):"auto"===(null===(t=this.unitScaling)||void 0===t?void 0:(""+t).trim().toLowerCase())?0:Number(this.unitScaling)}preparePercentageScaling(){var t;return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):"auto"===(null===(t=this.percentageScaling)||void 0===t?void 0:(""+t).trim().toLowerCase())?0:Number(this.percentageScaling)}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:""}}}}getEffectiveScaleFactor(){const{mode:t,factor:i}=M(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:"ed9804ea731fbaa0ec730c0392bcd18bb0ac278a",style:t},a("div",{key:"011a543cca60ec8c871db6a6280999047437ce98"},a("ibcs-table",{key:"4b7d717c3a7c9ed4c44b90dc66b4b8e6c9359cb0",tableName:this.datasetName,dataVersion:this.dataVersion,"table-title":this.prepareTableTitle(),scenarios:this.prepareScenarios(),"scenarios-data-format":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(),"category-width":this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),"measure-scale":this.prepareMeasureScale(),"measure-type":this.prepareMeasureType(),"measure-unit":this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),scaleFactor:i})))}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}],tableAttributes:[{validateTableAttributes:0}]}}static get style(){return":host{display:inline-block;position:relative;overflow:hidden}"}},[1,"bn-table",{scale:[1],tableTitle:[1,"table-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],tableAttributes:[1,"attributes"],datasetName:[32],dataVersion:[32],datasetMeta:[32],appliedScaleFactor:[32]},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}],tableAttributes:[{validateTableAttributes:0}]}]),Z=Y,K=function(){"undefined"!=typeof customElements&&["bn-table","ibcs-table"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),Y);break;case"ibcs-table":customElements.get(r(t))||H()}}))};export{Z as BnTable,K 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{v as o,a as l,i as h,q as d,r as u,k as p,s as c,m as v,t as m,h as g,u as y,w as f,b,c as w,x as S,n as O,y as R,z as T,f as D,A as _,B as E}from"./validate.js";import{w as C,g as M,p as F}from"./withDataset.js";import{w as A,a as N}from"./withHasError.js";import{w as G}from"./withScalingGroup.js";import{a as W}from"./context-protocol.js";import{w as U}from"./withTranslation.js";import{w as P}from"./withStyled.js";import{w as j}from"./withComponentStyle.js";import{w as I,a as x,i as L}from"./withRuleSet.js";import{o as k}from"./layoutObserver.js";import{D as B,I as J,d as V,M as z,B as $,T as q}from"./CompareUtil.js";import{a as H,b as Y,T as Z,d as K}from"./ibcs-table2.js";import{O as Q,a as X}from"./Order.js";const tt=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=.01,this.percentageScaling=.5,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,P(this),A(this),this.errors=N(this),G(this),this.componentStyle=j(this),this.ruleSetConfig=I(this),C(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=U(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"}])}validateScenario(t){const i="ERR_scenarios";if(L(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(L(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";"auto"===(null==t?void 0:(""+t).trim().toLowerCase())||p(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."})}validatePercentageScaling(t){const i="ERR_percentageScaling";"auto"===(null==t?void 0:(""+t).trim().toLowerCase())||p(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."})}validateDataFormat(t){const i="ERR_dataFormat";c(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";v(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";v(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";v(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";m(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";g(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=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(L(t))return void this.errors.remove(i);const e=b(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";L(t)||w(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";O(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";g(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";g(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=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===H||e===Y||D(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=_(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}=F(this.scale);if("auto"!==t&&"empty"!==t)return void(this._autoScaleGuard=!1);if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const i=this.element,{width:a}=M(i);if(a<=0)return;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 void this.errors.remove("AUTO_scale");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})))}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 Z[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=>X[null==t?void 0:t.toUpperCase()])),direction:Q[null==s?void 0:s.toUpperCase()]}}prepareI18nMode(){return J.META}prepareI18n(){const t=W,i=new Map(["in","category","operation","there_of","part_of","SUM_TOTAL"].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)?V.INF:V[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)?z.VOLUME:z[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)?H:this.interval.trim().toLowerCase();return s!==H&&s!==Y&&!D(s)||s===H?(this.errors.remove(i),this.errors.remove(e),this.errors.remove(a),H):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),H):(this.errors.remove(i),s===Y?(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),Y):(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."}),H):(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?E(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=q[i];return e?$[e]:$[q.W10]}prepareBarColumns(){return h(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){var t;return this.pixelPerUnitGroupMap.has(this.unitScaling)?this.pixelPerUnitGroupMap.get(this.unitScaling):"auto"===(null===(t=this.unitScaling)||void 0===t?void 0:(""+t).trim().toLowerCase())?0:Number(this.unitScaling)}preparePercentageScaling(){var t;return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):"auto"===(null===(t=this.percentageScaling)||void 0===t?void 0:(""+t).trim().toLowerCase())?0:Number(this.percentageScaling)}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:""}}}}getEffectiveScaleFactor(){const{mode:t,factor:i}=F(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:"c17878caebdbc1921880dfb1f784f553b9522108",style:t},a("div",{key:"58babcce2a4fc3892609e86b8c7ce3b44286311f"},a("ibcs-table",{key:"27cc8a7bef5b641943311af29d819dc7e10089cf",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(),scaleFactor:i,ruleSetConfig:this.ruleSetConfig()})))}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}"}},[1,"bn-table",{scale:[1],ruleset:[513],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]},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}]}]),it=tt,et=function(){"undefined"!=typeof customElements&&["bn-table","ibcs-table"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),tt);break;case"ibcs-table":customElements.get(r(t))||K()}}))};export{it as BnTable,et 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 a,a as m}from"./withHasError.js";const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),a(this),this.errors=m(this)}render(){return s(n,{key:"cd6a2945603feda3610bc9f2678e03b26f54d6dd"},s("slot",{key:"0e2ba3942a4ef74ab334572656383e85be7e1654"}))}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 e,HTMLElement as t,h as s,Host as n,transformTag as r}from"@stencil/core/internal/client";import{w as a,a as m}from"./withHasError.js";const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),a(this),this.errors=m(this)}render(){return s(n,{key:"297aed9fd195f26fa714ee9f616ea6db30c749ce"},s("slot",{key:"3048b6ea5c3770ad7d9149e2be83dc82294107fb"}))}get element(){return this}},[257,"bn-template",{templateId:[1,"template-id"]}]),c=o,i=function(){"undefined"!=typeof customElements&&["bn-template"].forEach((e=>{"bn-template"===e&&(customElements.get(r(e))||customElements.define(r(e),o))}))};export{c as BnTemplate,i 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,p as l}from"./scaling.js";import{w as r}from"./withTranslation.js";import{w as d,a as c}from"./withHasError.js";import{w as h}from"./withStyled.js";import{w as u}from"./withComponentStyle.js";const v=new Set(["br","b","i","strong","em","span","p","div","table","tr","td","th","thead","tbody","tfoot","ul","ol","li","h1","h2","h3","h4","h5","h6","sub","sup","small","hr","a","img"]),f=new Set(["class","style","colspan","rowspan","href","title","src","alt","width","height"]),p=/\b(__proto__|globalThis)\b|\.constructor\b/;function b(t){const e=document.createElement("div");return e.innerHTML=t,m(e),e.innerHTML}function m(t){for(const e of Array.from(t.childNodes)){if(e.nodeType!==Node.ELEMENT_NODE)continue;const i=e;if(v.has(i.tagName.toLowerCase())){for(const t of Array.from(i.attributes)){const e=t.name.toLowerCase();e.startsWith("on")||!f.has(e)?i.removeAttribute(t.name):"href"!==e&&"src"!==e||!/^\s*javascript:/i.test(t.value)?"style"===e&&/expression|javascript/i.test(t.value)&&i.removeAttribute(t.name):i.removeAttribute(t.name)}m(i)}else t.replaceChild(document.createTextNode(i.textContent||""),i)}}const y=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.data={},h(this),d(this),this.errors=c(this),this.t=r(this).t,s(this,((t,e)=>{this.data=Object.assign(Object.assign({},this.data),{[t]:e})})),this.componentStyle=u(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(p.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,h,u,v,f,p,b,m,y,g,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!==(u=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(h=t.global)||void 0===h?void 0:h.fontSizePx)&&void 0!==u?u:13.3333,color:null!==(b=null!==(f=null===(v=t["bn-text"])||void 0===v?void 0:v.fontColor)&&void 0!==f?f:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==b?b:"#000000",background:null!==(w=null!==(y=null===(m=t["bn-text"])||void 0===m?void 0:m.fontBackgroundColor)&&void 0!==y?y:null===(g=t.global)||void 0===g?void 0:g.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}=l(this.scale),{width:n,height:s}=a(e),r=e.scrollHeight>e.clientHeight+1?e.clientHeight:s,d=n,c=d>0&&e.scrollWidth>d+1,h=r>0&&e.scrollHeight>r+1,u=c||h;if(d<=0&&r<=0)return;if("none"===i){if(u){const t=[];c&&t.push(`w:${e.scrollWidth}>${Math.round(d)}`),h&&t.push(`h:${e.scrollHeight}>${Math.round(r)}`),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(u){const t=[];c&&t.push(`w:${e.scrollWidth}>${Math.round(d)}`),h&&t.push(`h:${e.scrollHeight}>${Math.round(r)}`),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 v=e.scrollWidth,f=e.scrollHeight,p=e.clientHeight,b=f>p+1?p:s,m=d<=0||v<=d+1,y=b<=0||f<=b+1;if(m&&y)return void this.errors.remove("AUTO_scale");const g=Math.min(1,!m&&d>0?d/v:1,!y&&b>0?b/f:1);e.style.setProperty("--bn-font-size",t*g+"px"),"empty"===i?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled font by factor "+g.toFixed(3)}):this.errors.remove("AUTO_scale")}componentDidRender(){this.container.innerHTML=b(this.evalTemplate(this.value)),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:e,factor:n}=l(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:"086c3caad1f7c502e26ebbd1bf7d9044782333ab",style:a},i("div",{key:"584938536bedd3de7a6390ce9d57fb568a69191b"},i("span",{key:"b545bd809b32d2d0cac2310bd1003dab39bebc8a",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}]}]),g=y,w=function(){"undefined"!=typeof customElements&&["bn-text"].forEach((t=>{"bn-text"===t&&(customElements.get(n(t))||customElements.define(n(t),y))}))};export{g as BnText,w as defineCustomElement}
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,p as l}from"./withDataset.js";import{w as r}from"./withTranslation.js";import{w as d,a as c}from"./withHasError.js";import{w as f}from"./withStyled.js";import{w as v}from"./withComponentStyle.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={},f(this),d(this),this.errors=c(this),this.t=r(this).t,s(this,((t,e)=>{this.data=Object.assign(Object.assign({},this.data),{[t]:e})})),this.componentStyle=v(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}=l(this.scale),{width:n,height:s}=a(e),r=e.scrollHeight>e.clientHeight+1?e.clientHeight:s,d=n,c=d>0&&e.scrollWidth>d+1,f=r>0&&e.scrollHeight>r+1,v=c||f;if(d<=0&&r<=0)return;if("none"===i){if(v){const t=[];c&&t.push(`w:${e.scrollWidth}>${Math.round(d)}`),f&&t.push(`h:${e.scrollHeight}>${Math.round(r)}`),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(v){const t=[];c&&t.push(`w:${e.scrollWidth}>${Math.round(d)}`),f&&t.push(`h:${e.scrollHeight}>${Math.round(r)}`),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=d<=0||u<=d+1,g=p<=0||h<=p+1;if(b&&g)return void this.errors.remove("AUTO_scale");const y=Math.min(1,!b&&d>0?d/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}=l(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:"07508edce15f5716e05ca9e4644b6f2c8d6efff1",style:a},i("div",{key:"b86016ce2ca4cfa55b6eac62de9a61fa23b83b13"},i("span",{key:"912e9755d52faf58053f9c8e02d44bf43cd5b355",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 +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}from"./context-protocol.js";import{w as E}from"./withStyled.js";import{w}from"./withComponentStyle.js";import{I as y,O as D}from"./Order.js";import{D as S,a as R}from"./DateStringFactory.js";import{d as k}from"./ibcs-title2.js";const O=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=w(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 y.META}prepareTitleOrder(){var t;return v(this.order)||v(this.orderDirection)?null:{hierarchy:this.order.split(",").map((t=>t.trim())),direction:D[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:R[null===(t=this.dateFormat)||void 0===t?void 0:t.toUpperCase()],link:S[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:"e84349bd356bc6ac3a3f3dccad01b0ef7d818077",style:t},e("ibcs-title",{key:"cde3f65fff090e3ade3909a4d3c0b103e5b91ba5",businessUnit:this.prepareBusinessUnit(),scenarios:this.prepareScenarios(),measures:this.prepareMeasures(),timeperiod:this.prepareTitleTimePeriod(),order:this.prepareTitleOrder(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode()}))}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",{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 x(){"undefined"!=typeof customElements&&["bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-title":customElements.get(s(t))||customElements.define(s(t),O);break;case"ibcs-title":customElements.get(s(t))||k()}}))}export{O as T,x 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 v,f as u,g as m}from"./validate.js";import{D as c}from"./luxon.js";import{w as p,a as f}from"./withHasError.js";import{w as g}from"./withTranslation.js";import{a as b}from"./context-protocol.js";import{w}from"./withStyled.js";import{w as E}from"./withComponentStyle.js";import{w as S}from"./withRuleSet.js";import{I as y}from"./CompareUtil.js";import{O as D}from"./Order.js";import{D as R,a as k}from"./DateStringFactory.js";import{d as O}from"./ibcs-title2.js";const j=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=g(this).t,this.errors=f(this),this.componentStyle=E(this),this.ruleSetConfig=S(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";m(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=b,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 y.META}prepareTitleOrder(){var t;return v(this.order)||v(this.orderDirection)?null:{hierarchy:this.order.split(",").map((t=>t.trim())),direction:D[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:c.fromISO(this.dateStart),end:c.fromISO(this.dateEnd),format:k[null===(t=this.dateFormat)||void 0===t?void 0:t.toUpperCase()],link:R[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:"4f64c957500d566f6ff3d3abe88e77d956f997de",style:t},e("ibcs-title",{key:"ee6c785ae9f0d9a703a4a05c063ff02f1595da64",businessUnit:this.prepareBusinessUnit(),scenarios:this.prepareScenarios(),measures:this.prepareMeasures(),timeperiod:this.prepareTitleTimePeriod(),order:this.prepareTitleOrder(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),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 x(){"undefined"!=typeof customElements&&["bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-title":customElements.get(s(t))||customElements.define(s(t),j);break;case"ibcs-title":customElements.get(s(t))||O()}}))}export{j as T,x as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as n,Host as s,transformTag as i}from"@stencil/core/internal/client";import{h as r,l as o}from"./validate.js";import{w as a,a as l}from"./withHasError.js";import{w as c}from"./withStyled.js";import{w as d}from"./withComponentStyle.js";const u=["*","/","+","-","x","÷","none"];function h(t){switch(t){case"*":case"x":return"×";case"/":case"÷":return"÷";case"+":return"+";case"-":return"−";default:return""}}function f(t,e,n){return t.find((t=>t.from===e&&t.to===n))}function g(t){return 2*(t-1)+1}function p(t){return 2*(t-1)+1}function v(t){return t<=1?1:2*(t-1)+1}function y(t,e){const n=t.getBoundingClientRect(),s=n.left-e.left,i=n.top-e.top;return{left:s,top:i,width:n.width,height:n.height,centerX:s+n.width/2,centerY:i+n.height/2}}function m(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 b(t,e,n,s,i=8){const r=-(s-1)*i/2+n*i;switch(e){case"ltr":return{x:t.left,y:t.centerY+r};case"rtl":return{x:t.left+t.width,y:t.centerY+r};case"ttb":return{x:t.centerX+r,y:t.top};case"btt":return{x:t.centerX+r,y:t.top+t.height}}}function w(t,e,n,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 s,i;if("ltr"===n||"rtl"===n){const n=(t.x+e.x)/2;s={x:n,y:t.y},i={x:n,y:e.y}}else{const n=(t.y+e.y)/2;s={x:t.x,y:n},i={x:e.x,y:n}}return{path:`M ${t.x} ${t.y} C ${s.x} ${s.y}, ${i.x} ${i.y}, ${e.x} ${e.y}`,midpoint:{x:.125*t.x+.375*s.x+.375*i.x+.125*e.x,y:.125*t.y+.375*s.y+.375*i.y+.125*e.y}}}(t,e,s);default:return function(t,e,n){let s,i;if("ltr"===n||"rtl"===n){const n=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}`,i={x:n,y:(t.y+e.y)/2}}else{const n=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}`,i={x:(t.x+e.x)/2,y:n}}return{path:s,midpoint:i}}(t,e,s)}}function x(t,e,n,s){const i=.7;switch(s){case"ltr":{const s=t.left+t.width;return{x:s+(Math.min(e.left,n.left)-s)*i,y:t.centerY}}case"rtl":{const s=t.left,r=Math.max(e.left+e.width,n.left+n.width);return{x:r+(s-r)*i,y:t.centerY}}case"ttb":{const s=t.top+t.height;return{x:t.centerX,y:s+(Math.min(e.top,n.top)-s)*i}}case"btt":{const s=t.top,r=Math.max(e.top+e.height,n.top+n.height);return{x:t.centerX,y:r+(s-r)*i}}}}function $(t,e,n){var s,i;return Object.assign({stroke:null!==(s=null==n?void 0:n.color)&&void 0!==s?s:t,strokeWidth:null!==(i=null==n?void 0:n.width)&&void 0!==i?i:e},(null==n?void 0:n.dasharray)?{strokeDasharray:n.dasharray}:{})}const S=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 s=new Set,i=new Set;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`):s.add(r.from),"string"!=typeof r.to||""===r.to.trim()?e.push(`edges[${n}]: 'to' is required and must be a non-empty string`):(s.add(r.to),i.add(r.to)),void 0!==r.operator&&("string"==typeof r.operator&&u.includes(r.operator)||e.push(`edges[${n}]: 'operator' must be one of: ${u.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(s).filter((t=>!i.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}(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,s=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),i=function(t){const e=new Set;for(const n of t)e.add(n.from),e.add(n.to);return e}(n),r=function(t,e){const n=new Set;for(const e of t)n.add(e.to);const s=Array.from(e).filter((t=>!n.has(t)));return 1===s.length?s[0]:null}(n,i);return{edges:n,adjacencyList:s,rootNode:r,allNodes:i}}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";!r(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";!r(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";o(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",c(this),a(this),this.errors=l(this),this.componentStyle=d(this)}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,s){if(!t.rootNode)return{positions:new Map,gridTemplateColumns:"",gridTemplateRows:"",maxLevel:0,maxIndex:0};const i=function(t){const e=new Map;if(!t.rootNode)return e;const n=[{node:t.rootNode,level:0}],s=new Set;for(;n.length>0;){const{node:i,level:r}=n.shift();if(s.has(i))continue;s.add(i),e.set(i,r);const o=t.adjacencyList.get(i)||[];for(const t of o)s.has(t)||n.push({node:t,level:r+1})}return e}(t),r=function(t){const e=new Map;if(!t.rootNode)return e;let n=0;return function s(i){const r=e.get(i);if(r)return r;const o=t.adjacencyList.get(i)||[];if(0===o.length){const t={startIndex:n,endIndex:n};return e.set(i,t),n++,t}let a=1/0,l=-1/0;for(const t of o){const e=s(t);a=Math.min(a,e.startIndex),l=Math.max(l,e.endIndex)}const c={startIndex:a,endIndex:l};return e.set(i,c),c}(t.rootNode),e}(t),o=function(t,e,n,s){var i,r;const o=new Map,a=Math.max(...Array.from(e.values()));for(const l of t.allNodes){const t=null!==(i=e.get(l))&&void 0!==i?i:0,c=null!==(r=n.get(l))&&void 0!==r?r:{startIndex:0,endIndex:0};let d,u,h;switch(s){case"ltr":d=t+1,u=c.startIndex+1,h=c.endIndex-c.startIndex+1;break;case"rtl":d=a-t+1,u=c.startIndex+1,h=c.endIndex-c.startIndex+1;break;case"ttb":u=t+1,d=c.startIndex+1,h=1;break;case"btt":u=a-t+1,d=c.startIndex+1,h=1}o.set(l,{nodeId:l,level:t,index:c.startIndex,gridColumn:d,gridRow:u,gridRowSpan:h})}return o}(t,i,r,e),a=Math.max(...Array.from(i.values())),l=Math.max(...Array.from(r.values()).map((t=>t.endIndex))),{gridTemplateColumns:c,gridTemplateRows:d}=function(t,e,n,s,i){const r=t+1,o=e+1;if("ltr"===n||"rtl"===n){const t=[];for(let e=0;e<r;e++)t.push("auto"),e<r-1&&t.push(s+"px");const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(i+"px");return{gridTemplateColumns:t.join(" "),gridTemplateRows:e.join(" ")}}{const t=[];for(let e=0;e<r;e++)t.push("auto"),e<r-1&&t.push(s+"px");const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(i+"px");return{gridTemplateColumns:e.join(" "),gridTemplateRows:t.join(" ")}}}(a,l,e,n,s);return{positions:o,gridTemplateColumns:c,gridTemplateRows:d,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 s=this.element.querySelector(`[slot="${n}"]`);s&&e.set(n,y(s,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":g(e.gridColumn)+"","grid-row":`${p(e.gridRow)} / span ${v(e.gridRowSpan)}`,"align-self":"center"}:{"grid-row":p(e.gridRow)+"","grid-column":g(e.gridColumn)+"","justify-self":"center"}:{}}renderEdges(){var t;if(!this.treeConfig||0===this.nodeRects.size)return null;const e=this.getTreeStyle(),s=[],i=[],r=new Map;for(const t of this.treeConfig.edges){const e=r.get(t.to)||[];e.push(t.from),r.set(t.to,e)}for(const t of this.treeConfig.edges){const i=this.nodeRects.get(t.from),o=this.nodeRects.get(t.to);if(!i||!o)continue;const a=m(i,!0,this.direction),l=r.get(t.to)||[];let c;if(l.length>1){const e=l.indexOf(t.from);c=b(o,this.direction,e,l.length)}else c=m(o,!1,this.direction);const{path:d}=w(a,c,this.edgeStyle,this.direction),u=$(e.edgeColor,e.edgeWidth,t.style);s.push(n("path",{key:`edge-${t.from}-${t.to}`,d,fill:"none",stroke:u.stroke,"stroke-width":u.strokeWidth,"stroke-dasharray":u.strokeDasharray}))}if("true"===this.showOperators)for(const[s,r]of this.treeConfig.adjacencyList.entries()){const o=this.nodeRects.get(s);if(o)for(let a=0;a<r.length-1;a++){const l=r[a],c=r[a+1],d=f(this.treeConfig.edges,s,l);if(!(null==d?void 0:d.operator)||"none"===d.operator)continue;const u=this.nodeRects.get(l),g=this.nodeRects.get(c);if(!u||!g)continue;const p=null!==(t=d.label)&&void 0!==t?t:h(d.operator),v=x(o,u,g,this.direction);i.push(n("g",{key:`operator-${s}-${l}`,class:"operator-group"},n("circle",{cx:v.x,cy:v.y,r:e.operatorCircleRadius,fill:"white",stroke:e.edgeColor,"stroke-width":e.edgeWidth}),n("text",{x:v.x,y:v.y,"text-anchor":"middle","dominant-baseline":"central",style:{fontSize:e.operatorFontSize+"px",fill:e.operatorColor,fontWeight:"bold"}},p)))}}return n("svg",{class:"edge-layer",width:this.svgWidth,height:this.svgHeight,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none"}},s,i)}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,s,i;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===(s=t.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(i=t.global)||void 0===i?void 0:i.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return n(s,{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"],showOperators:[1,"show-operators"],treeConfig:[32],layout:[32],nodeRects:[32],svgWidth:[32],svgHeight:[32]},void 0,{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}]),R=S,M=function(){"undefined"!=typeof customElements&&["bn-tree"].forEach((t=>{"bn-tree"===t&&(customElements.get(i(t))||customElements.define(i(t),S))}))};export{R as BnTree,M as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as n,Host as s,transformTag as i}from"@stencil/core/internal/client";import{k as r,m as o}from"./validate.js";import{w as a,a as l}from"./withHasError.js";import{w as c}from"./withStyled.js";import{w as d}from"./withComponentStyle.js";const u=["*","/","+","-","x","÷","none"];function h(t){switch(t){case"*":case"x":return"×";case"/":case"÷":return"÷";case"+":return"+";case"-":return"−";default:return""}}function f(t,e,n){return t.find((t=>t.from===e&&t.to===n))}function g(t){return 2*(t-1)+1}function p(t){return 2*(t-1)+1}function v(t){return t<=1?1:2*(t-1)+1}function y(t,e){const n=t.getBoundingClientRect(),s=n.left-e.left,i=n.top-e.top;return{left:s,top:i,width:n.width,height:n.height,centerX:s+n.width/2,centerY:i+n.height/2}}function m(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 b(t,e,n,s,i=8){const r=-(s-1)*i/2+n*i;switch(e){case"ltr":return{x:t.left,y:t.centerY+r};case"rtl":return{x:t.left+t.width,y:t.centerY+r};case"ttb":return{x:t.centerX+r,y:t.top};case"btt":return{x:t.centerX+r,y:t.top+t.height}}}function w(t,e,n,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 s,i;if("ltr"===n||"rtl"===n){const n=(t.x+e.x)/2;s={x:n,y:t.y},i={x:n,y:e.y}}else{const n=(t.y+e.y)/2;s={x:t.x,y:n},i={x:e.x,y:n}}return{path:`M ${t.x} ${t.y} C ${s.x} ${s.y}, ${i.x} ${i.y}, ${e.x} ${e.y}`,midpoint:{x:.125*t.x+.375*s.x+.375*i.x+.125*e.x,y:.125*t.y+.375*s.y+.375*i.y+.125*e.y}}}(t,e,s);default:return function(t,e,n){let s,i;if("ltr"===n||"rtl"===n){const n=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}`,i={x:n,y:(t.y+e.y)/2}}else{const n=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}`,i={x:(t.x+e.x)/2,y:n}}return{path:s,midpoint:i}}(t,e,s)}}function x(t,e,n,s){const i=.7;switch(s){case"ltr":{const s=t.left+t.width;return{x:s+(Math.min(e.left,n.left)-s)*i,y:t.centerY}}case"rtl":{const s=t.left,r=Math.max(e.left+e.width,n.left+n.width);return{x:r+(s-r)*i,y:t.centerY}}case"ttb":{const s=t.top+t.height;return{x:t.centerX,y:s+(Math.min(e.top,n.top)-s)*i}}case"btt":{const s=t.top,r=Math.max(e.top+e.height,n.top+n.height);return{x:t.centerX,y:r+(s-r)*i}}}}function $(t,e,n){var s,i;return Object.assign({stroke:null!==(s=null==n?void 0:n.color)&&void 0!==s?s:t,strokeWidth:null!==(i=null==n?void 0:n.width)&&void 0!==i?i:e},(null==n?void 0:n.dasharray)?{strokeDasharray:n.dasharray}:{})}const S=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 s=new Set,i=new Set;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`):s.add(r.from),"string"!=typeof r.to||""===r.to.trim()?e.push(`edges[${n}]: 'to' is required and must be a non-empty string`):(s.add(r.to),i.add(r.to)),void 0!==r.operator&&("string"==typeof r.operator&&u.includes(r.operator)||e.push(`edges[${n}]: 'operator' must be one of: ${u.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(s).filter((t=>!i.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}(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,s=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),i=function(t){const e=new Set;for(const n of t)e.add(n.from),e.add(n.to);return e}(n),r=function(t,e){const n=new Set;for(const e of t)n.add(e.to);const s=Array.from(e).filter((t=>!n.has(t)));return 1===s.length?s[0]:null}(n,i);return{edges:n,adjacencyList:s,rootNode:r,allNodes:i}}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";!r(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";!r(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";o(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",c(this),a(this),this.errors=l(this),this.componentStyle=d(this)}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,s){if(!t.rootNode)return{positions:new Map,gridTemplateColumns:"",gridTemplateRows:"",maxLevel:0,maxIndex:0};const i=function(t){const e=new Map;if(!t.rootNode)return e;const n=[{node:t.rootNode,level:0}],s=new Set;for(;n.length>0;){const{node:i,level:r}=n.shift();if(s.has(i))continue;s.add(i),e.set(i,r);const o=t.adjacencyList.get(i)||[];for(const t of o)s.has(t)||n.push({node:t,level:r+1})}return e}(t),r=function(t){const e=new Map;if(!t.rootNode)return e;let n=0;return function s(i){const r=e.get(i);if(r)return r;const o=t.adjacencyList.get(i)||[];if(0===o.length){const t={startIndex:n,endIndex:n};return e.set(i,t),n++,t}let a=1/0,l=-1/0;for(const t of o){const e=s(t);a=Math.min(a,e.startIndex),l=Math.max(l,e.endIndex)}const c={startIndex:a,endIndex:l};return e.set(i,c),c}(t.rootNode),e}(t),o=function(t,e,n,s){var i,r;const o=new Map,a=Math.max(...Array.from(e.values()));for(const l of t.allNodes){const t=null!==(i=e.get(l))&&void 0!==i?i:0,c=null!==(r=n.get(l))&&void 0!==r?r:{startIndex:0,endIndex:0};let d,u,h;switch(s){case"ltr":d=t+1,u=c.startIndex+1,h=c.endIndex-c.startIndex+1;break;case"rtl":d=a-t+1,u=c.startIndex+1,h=c.endIndex-c.startIndex+1;break;case"ttb":u=t+1,d=c.startIndex+1,h=1;break;case"btt":u=a-t+1,d=c.startIndex+1,h=1}o.set(l,{nodeId:l,level:t,index:c.startIndex,gridColumn:d,gridRow:u,gridRowSpan:h})}return o}(t,i,r,e),a=Math.max(...Array.from(i.values())),l=Math.max(...Array.from(r.values()).map((t=>t.endIndex))),{gridTemplateColumns:c,gridTemplateRows:d}=function(t,e,n,s,i){const r=t+1,o=e+1;if("ltr"===n||"rtl"===n){const t=[];for(let e=0;e<r;e++)t.push("auto"),e<r-1&&t.push(s+"px");const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(i+"px");return{gridTemplateColumns:t.join(" "),gridTemplateRows:e.join(" ")}}{const t=[];for(let e=0;e<r;e++)t.push("auto"),e<r-1&&t.push(s+"px");const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(i+"px");return{gridTemplateColumns:e.join(" "),gridTemplateRows:t.join(" ")}}}(a,l,e,n,s);return{positions:o,gridTemplateColumns:c,gridTemplateRows:d,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 s=this.element.querySelector(`[slot="${n}"]`);s&&e.set(n,y(s,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":g(e.gridColumn)+"","grid-row":`${p(e.gridRow)} / span ${v(e.gridRowSpan)}`,"align-self":"center"}:{"grid-row":p(e.gridRow)+"","grid-column":g(e.gridColumn)+"","justify-self":"center"}:{}}renderEdges(){var t;if(!this.treeConfig||0===this.nodeRects.size)return null;const e=this.getTreeStyle(),s=[],i=[],r=new Map;for(const t of this.treeConfig.edges){const e=r.get(t.to)||[];e.push(t.from),r.set(t.to,e)}for(const t of this.treeConfig.edges){const i=this.nodeRects.get(t.from),o=this.nodeRects.get(t.to);if(!i||!o)continue;const a=m(i,!0,this.direction),l=r.get(t.to)||[];let c;if(l.length>1){const e=l.indexOf(t.from);c=b(o,this.direction,e,l.length)}else c=m(o,!1,this.direction);const{path:d}=w(a,c,this.edgeStyle,this.direction),u=$(e.edgeColor,e.edgeWidth,t.style);s.push(n("path",{key:`edge-${t.from}-${t.to}`,d,fill:"none",stroke:u.stroke,"stroke-width":u.strokeWidth,"stroke-dasharray":u.strokeDasharray}))}if("true"===this.showOperators)for(const[s,r]of this.treeConfig.adjacencyList.entries()){const o=this.nodeRects.get(s);if(o)for(let a=0;a<r.length-1;a++){const l=r[a],c=r[a+1],d=f(this.treeConfig.edges,s,l);if(!(null==d?void 0:d.operator)||"none"===d.operator)continue;const u=this.nodeRects.get(l),g=this.nodeRects.get(c);if(!u||!g)continue;const p=null!==(t=d.label)&&void 0!==t?t:h(d.operator),v=x(o,u,g,this.direction);i.push(n("g",{key:`operator-${s}-${l}`,class:"operator-group"},n("circle",{cx:v.x,cy:v.y,r:e.operatorCircleRadius,fill:"white",stroke:e.edgeColor,"stroke-width":e.edgeWidth}),n("text",{x:v.x,y:v.y,"text-anchor":"middle","dominant-baseline":"central",style:{fontSize:e.operatorFontSize+"px",fill:e.operatorColor,fontWeight:"bold"}},p)))}}return n("svg",{class:"edge-layer",width:this.svgWidth,height:this.svgHeight,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none"}},s,i)}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,s,i;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===(s=t.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(i=t.global)||void 0===i?void 0:i.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return n(s,{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"],showOperators:[1,"show-operators"],treeConfig:[32],layout:[32],nodeRects:[32],svgWidth:[32],svgHeight:[32]},void 0,{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}]),R=S,k=function(){"undefined"!=typeof customElements&&["bn-tree"].forEach((t=>{"bn-tree"===t&&(customElements.get(i(t))||customElements.define(i(t),S))}))};export{R as BnTree,k as defineCustomElement}