@bino-bi/bn-template-engine 1.0.0-alpha.8 → 1.0.0-next.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -21
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-19bbac66.entry.js +1 -0
- package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
- package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
- package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
- package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
- package/dist/bn-template-engine/p-74c5a95d.entry.js +1 -0
- package/dist/bn-template-engine/p-7bdc0e28.entry.js +1 -0
- package/dist/bn-template-engine/p-83c71b16.entry.js +1 -0
- package/dist/bn-template-engine/p-90806e7a.entry.js +1 -0
- package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
- package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
- package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
- package/dist/bn-template-engine/p-BZV1b5VH.js +1 -0
- package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
- package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
- package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
- package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
- package/dist/bn-template-engine/p-CiudZRQr.js +1 -0
- package/dist/bn-template-engine/p-DTuaq8Pj.js +1 -0
- package/dist/bn-template-engine/p-DY7YYmpa.js +1 -0
- package/dist/bn-template-engine/p-Dg9OcXAO.js +1 -0
- package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
- package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
- package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
- package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
- package/dist/bn-template-engine/p-b25455a7.entry.js +1 -0
- package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
- package/dist/bn-template-engine/p-eca8e2e2.entry.js +1 -0
- package/dist/bn-template-engine/p-f9dfd120.entry.js +1 -0
- package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
- package/dist/cjs/AxisConfig-VnVelfSV.js +233 -0
- package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
- package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
- package/dist/cjs/Order-DobBozQC.js +87 -0
- package/dist/cjs/SVGStyle-BQOmGWLX.js +8209 -0
- package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
- package/dist/cjs/VarianceMeasure-NY9yhiNV.js +372 -0
- package/dist/cjs/XYChartDataRow-B7OKrAcC.js +829 -0
- package/dist/cjs/bn-asset_21.cjs.entry.js +16047 -0
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
- package/dist/cjs/bn-grid.cjs.entry.js +5 -3
- package/dist/cjs/bn-image.cjs.entry.js +5 -3
- package/dist/cjs/bn-internationalization.cjs.entry.js +10 -8
- package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +8 -79
- package/dist/cjs/bn-tree.cjs.entry.js +9 -3
- package/dist/cjs/context-protocol-BDrMkhc4.js +9499 -0
- package/dist/cjs/editor-companion.cjs.entry.js +13 -6
- package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
- package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
- package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
- package/dist/cjs/layoutObserver-o03YUfn_.js +199 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
- package/dist/cjs/scaling-DKZyjWj5.js +587 -0
- package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
- package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
- package/dist/cjs/withStyled-CRiC9fzc.js +1137 -0
- package/dist/collection/collection-manifest.json +9 -1
- package/dist/collection/components/bn-body/bn-body.css +1 -0
- package/dist/collection/components/bn-card/bn-card.css +2 -0
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
- package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
- package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
- package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +127 -41
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +103 -36
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +82 -58
- package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
- package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
- package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +162 -42
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +94 -31
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +132 -74
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -4
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
- package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
- package/dist/collection/components/bn-context/bn-context.js +1 -1
- package/dist/collection/components/bn-dataset/bn-dataset.js +226 -23
- package/dist/collection/components/bn-datasource/bn-datasource.js +163 -12
- package/dist/collection/components/bn-footer/bn-footer.js +1 -1
- package/dist/collection/components/bn-grid/bn-grid.js +1 -1
- package/dist/collection/components/bn-image/bn-image.js +1 -1
- package/dist/collection/components/bn-internationalization/bn-internationalization.js +10 -7
- package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -3
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +98 -35
- package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -3
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +98 -25
- package/dist/collection/components/bn-message/bn-message.css +6 -2
- package/dist/collection/components/bn-message/bn-message.js +3 -2
- package/dist/collection/components/bn-page/bn-page.js +1 -1
- package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
- package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.css +3 -0
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
- package/dist/collection/components/bn-table/bn-table.js +317 -61
- package/dist/collection/components/bn-table/ibcs-table.css +8 -0
- package/dist/collection/components/bn-table/ibcs-table.js +161 -32
- package/dist/collection/components/bn-table/utils/Table.js +72 -28
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
- package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
- package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
- package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +117 -22
- package/dist/collection/components/bn-table/utils/helper/DataQuery.js +380 -50
- package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
- package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
- package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
- package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
- package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
- package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +20 -4
- package/dist/collection/components/bn-template/bn-template.js +1 -1
- package/dist/collection/components/bn-text/bn-text.js +2 -75
- package/dist/collection/components/bn-title/bn-title.js +27 -3
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +29 -6
- package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -0
- package/dist/collection/components/bn-tree/bn-tree.js +5 -1
- package/dist/collection/components/editor-companion/editor-companion.js +12 -5
- package/dist/collection/context/scopedDb.js +127 -0
- package/dist/collection/stores/componentStyles.js +67 -0
- package/dist/collection/stores/createScopedStores.js +11 -5
- package/dist/collection/stores/internationalization.js +68 -0
- package/dist/collection/stores/ruleSets.js +46 -0
- package/dist/collection/utils/constants.js +5 -0
- package/dist/collection/utils/dataAnalyzer.js +14 -8
- package/dist/collection/utils/ibcsRuleSet.js +14 -26
- package/dist/collection/utils/layoutObserver.js +88 -0
- package/dist/collection/utils/parentDimensions.js +71 -15
- package/dist/collection/utils/sanitizeHtml.js +81 -0
- package/dist/collection/utils/validate.js +47 -0
- package/dist/collection/utils/withBodyObserver.js +12 -7
- package/dist/collection/utils/withComponentStyle.js +3 -5
- package/dist/collection/utils/withDataset.js +43 -39
- package/dist/collection/utils/withDatasource.js +28 -18
- package/dist/collection/utils/withInheritedProps.js +26 -1
- package/dist/collection/utils/withRuleSet.js +105 -0
- package/dist/collection/utils/withScalingGroup.js +69 -0
- package/dist/collection/utils/withTranslation.js +50 -14
- package/dist/collection/utils/xy/FacetGrid.js +36 -0
- package/dist/collection/utils/xy/IsoCurves.js +156 -0
- package/dist/collection/utils/xy/NumericScale.js +103 -0
- package/dist/collection/utils/xy/PointLabeler.js +96 -0
- package/dist/collection/utils/xy/RadiusScale.js +42 -0
- package/dist/collection/utils/xy/SeriesPalette.js +80 -0
- package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
- package/dist/collection/utils/xy/XYFrame.js +120 -0
- package/dist/collection/utils/xy/XYLegend.js +107 -0
- package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
- package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
- package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
- package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
- package/dist/components/AxisConfig.js +1 -0
- package/dist/components/CompareUtil.js +1 -0
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/LabelCollisionManager.js +1 -0
- package/dist/components/NumericScale.js +1 -0
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGVariancesStyleGroup.js +1 -1
- package/dist/components/SiPrefix.js +1 -0
- package/dist/components/StringAdapter.js +1 -0
- package/dist/components/VarianceMeasure.js +1 -0
- package/dist/components/XYChartDataRow.js +1 -0
- package/dist/components/bn-body2.js +1 -1
- package/dist/components/bn-card2.js +1 -1
- package/dist/components/bn-chart-bubble.d.ts +11 -0
- package/dist/components/bn-chart-bubble.js +1 -0
- package/dist/components/bn-chart-bullet.d.ts +11 -0
- package/dist/components/bn-chart-bullet.js +1 -0
- package/dist/components/bn-chart-scatter.d.ts +11 -0
- package/dist/components/bn-chart-scatter.js +1 -0
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-component-style.js +1 -1
- package/dist/components/bn-context.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-footer2.js +1 -1
- package/dist/components/bn-grid.js +1 -1
- package/dist/components/bn-image.js +1 -1
- package/dist/components/bn-internationalization.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-message2.js +1 -1
- package/dist/components/bn-page2.js +1 -1
- package/dist/components/bn-ruleset.d.ts +11 -0
- package/dist/components/bn-ruleset.js +1 -0
- package/dist/components/bn-scaling-group.d.ts +11 -0
- package/dist/components/bn-scaling-group.js +1 -0
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-template.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/formatter.js +1 -0
- package/dist/components/ibcs-chart-bubble.d.ts +11 -0
- package/dist/components/ibcs-chart-bubble.js +1 -0
- package/dist/components/ibcs-chart-bubble2.js +1 -0
- package/dist/components/ibcs-chart-bullet.d.ts +11 -0
- package/dist/components/ibcs-chart-bullet.js +1 -0
- package/dist/components/ibcs-chart-bullet2.js +1 -0
- package/dist/components/ibcs-chart-scatter.d.ts +11 -0
- package/dist/components/ibcs-chart-scatter.js +1 -0
- package/dist/components/ibcs-chart-scatter2.js +1 -0
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/layoutObserver.js +1 -0
- package/dist/components/luxon.js +1 -0
- package/dist/components/main.js +1 -0
- package/dist/components/merge.js +1 -0
- package/dist/components/sanitizeHtml.js +1 -0
- package/dist/components/stackColors.js +1 -0
- package/dist/components/validate.js +1 -1
- package/dist/components/withBodyObserver.js +1 -1
- package/dist/components/withComponentStyle.js +1 -1
- package/dist/components/withDataset.js +1 -0
- package/dist/components/withRuleSet.js +1 -0
- package/dist/components/withScalingGroup.js +1 -0
- package/dist/components/withStyled.js +1 -1
- package/dist/components/withTranslation.js +1 -1
- package/dist/esm/AxisConfig-C_zWCKlL.js +224 -0
- package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
- package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
- package/dist/esm/Order-BPeWfygb.js +83 -0
- package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
- package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
- package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
- package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
- package/dist/esm/bn-asset_21.entry.js +16025 -0
- package/dist/esm/bn-chart-bubble.entry.js +760 -0
- package/dist/esm/bn-chart-bullet.entry.js +783 -0
- package/dist/esm/bn-chart-scatter.entry.js +656 -0
- package/dist/esm/bn-grid.entry.js +5 -3
- package/dist/esm/bn-image.entry.js +5 -3
- package/dist/esm/bn-internationalization.entry.js +10 -8
- package/dist/esm/bn-ruleset.entry.js +39 -0
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +1 -1
- package/dist/esm/bn-text.entry.js +7 -78
- package/dist/esm/bn-tree.entry.js +9 -3
- package/dist/esm/context-protocol-1Yj1uKvh.js +9484 -0
- package/dist/esm/editor-companion.entry.js +13 -6
- package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
- package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
- package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
- package/dist/esm/layoutObserver-BG5dOBYH.js +196 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
- package/dist/esm/scaling-CeSRcRl1.js +579 -0
- package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
- package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
- package/dist/esm/withStyled-Br2DGTPs.js +1104 -0
- package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
- package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
- package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
- package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
- package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
- package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
- package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
- package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
- package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
- package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +16 -12
- package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
- package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
- package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +16 -12
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +35 -8
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +32 -1
- package/dist/types/components/bn-message/bn-message.d.ts +5 -2
- package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
- package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
- package/dist/types/components/bn-table/bn-table.d.ts +74 -12
- package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
- package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
- package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
- package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
- package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
- package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
- package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
- package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
- package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
- package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
- package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
- package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
- package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
- package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
- package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
- package/dist/types/components/bn-title/bn-title.d.ts +11 -1
- package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
- package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
- package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
- package/dist/types/components.d.ts +1691 -120
- package/dist/types/context/context-protocol.d.ts +7 -3
- package/dist/types/context/scopedDb.d.ts +37 -0
- package/dist/types/stores/componentStyles.d.ts +41 -0
- package/dist/types/stores/createScopedStores.d.ts +4 -2
- package/dist/types/stores/ruleSets.d.ts +40 -0
- package/dist/types/utils/DateStringFactory.d.ts +1 -1
- package/dist/types/utils/constants.d.ts +5 -0
- package/dist/types/utils/dataAnalyzer.d.ts +2 -1
- package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
- package/dist/types/utils/layoutObserver.d.ts +27 -0
- package/dist/types/utils/model/ChartStyles.d.ts +2 -1
- package/dist/types/utils/parentDimensions.d.ts +1 -1
- package/dist/types/utils/sanitizeHtml.d.ts +6 -0
- package/dist/types/utils/validate.d.ts +18 -0
- package/dist/types/utils/withDataset.d.ts +6 -2
- package/dist/types/utils/withDatasource.d.ts +3 -3
- package/dist/types/utils/withInheritedProps.d.ts +19 -0
- package/dist/types/utils/withRuleSet.d.ts +24 -0
- package/dist/types/utils/withScalingGroup.d.ts +14 -0
- package/dist/types/utils/withTranslation.d.ts +12 -4
- package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
- package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
- package/dist/types/utils/xy/NumericScale.d.ts +41 -0
- package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
- package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
- package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
- package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
- package/dist/types/utils/xy/XYFrame.d.ts +44 -0
- package/dist/types/utils/xy/XYLegend.d.ts +43 -0
- package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
- package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
- package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
- package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
- package/package.json +5 -4
- package/readme.md +9 -5
- package/dist/bn-template-engine/p-0d41c5d8.entry.js +0 -1
- package/dist/bn-template-engine/p-67538176.entry.js +0 -1
- package/dist/bn-template-engine/p-825a07a8.entry.js +0 -1
- package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
- package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
- package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
- package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
- package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
- package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
- package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
- package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
- package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
- package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23541
- package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
- package/dist/cjs/scaling-CIAClQR5.js +0 -314
- package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
- package/dist/collection/stores/datasets.js +0 -14
- package/dist/collection/stores/datasources.js +0 -14
- package/dist/components/_commonjsHelpers.js +0 -1
- package/dist/components/alasql.min.js +0 -1
- package/dist/components/ibcsRuleSet.js +0 -1
- package/dist/components/scaling.js +0 -1
- package/dist/components/withInheritedProps.js +0 -1
- package/dist/esm/bn-asset_20.entry.js +0 -23520
- package/dist/esm/context-protocol-DdbSplvE.js +0 -656
- package/dist/esm/scaling-DGKKkuL9.js +0 -309
- package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
- package/dist/types/stores/datasets.d.ts +0 -14
- package/dist/types/stores/datasources.d.ts +0 -14
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { DateTime } from "luxon";
|
|
2
|
+
import { DateDistance, DateStringFactory } from "../../../../utils/DateStringFactory";
|
|
3
|
+
/** `interval` value deactivating the feature. */
|
|
4
|
+
export const INTERVAL_NONE = "none";
|
|
5
|
+
/** `interval` value grouping by the dataset's `setname` column. */
|
|
6
|
+
export const INTERVAL_SETNAME = "setname";
|
|
7
|
+
/** Label rendered for the bucket collecting rows with a blank setname. */
|
|
8
|
+
export const BLANK_BUCKET_LABEL = "—";
|
|
9
|
+
/** True for all date-based interval values (everything except none/setname). */
|
|
10
|
+
export function isDateInterval(interval) {
|
|
11
|
+
return interval !== INTERVAL_NONE && interval !== INTERVAL_SETNAME;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* SQL expression computing the bucket value of a source row.
|
|
15
|
+
* Dates are normalized to the start of their bucket via the `normalizeDate`
|
|
16
|
+
* alasql UDF (same mechanism as bn-chart-time); setname tolerates both the
|
|
17
|
+
* documented lowercase `setname` and the `setName` casing used in fixtures.
|
|
18
|
+
*/
|
|
19
|
+
export function intervalBucketSQL(interval) {
|
|
20
|
+
if (interval === INTERVAL_SETNAME) {
|
|
21
|
+
return "COALESCE([setname],[setName])";
|
|
22
|
+
}
|
|
23
|
+
return `normalizeDate([date], '${interval}')`;
|
|
24
|
+
}
|
|
25
|
+
/** Coerces a raw bucket value (luxon DateTime, string, millis) to a stable string key. */
|
|
26
|
+
export function coerceBucketKey(value) {
|
|
27
|
+
if (value == null) {
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
if (typeof value === "string") {
|
|
31
|
+
return value.trim();
|
|
32
|
+
}
|
|
33
|
+
const dt = toDateTime(value);
|
|
34
|
+
if (dt) {
|
|
35
|
+
return dt.toISO();
|
|
36
|
+
}
|
|
37
|
+
return String(value);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Resolves `auto` to a concrete date granularity from the dataset's date span
|
|
41
|
+
* (mirrors TimeChart.findDateInterval). Non-auto values pass through.
|
|
42
|
+
* The min/max is computed in JS because alasql's MIN/MAX only aggregates numbers,
|
|
43
|
+
* while `date` values are usually ISO strings.
|
|
44
|
+
*/
|
|
45
|
+
export function resolveIntervalGranularity(db, fromExpr, interval) {
|
|
46
|
+
var _a;
|
|
47
|
+
if (interval !== DateDistance.AUTO) {
|
|
48
|
+
return interval;
|
|
49
|
+
}
|
|
50
|
+
let rows;
|
|
51
|
+
try {
|
|
52
|
+
rows = db.exec(`SELECT [date] as d FROM ${fromExpr}`);
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
console.error("IntervalColumns: date query failed", e);
|
|
56
|
+
return DateDistance.DAY;
|
|
57
|
+
}
|
|
58
|
+
let min;
|
|
59
|
+
let max;
|
|
60
|
+
for (const row of rows) {
|
|
61
|
+
const millis = (_a = toDateTime(row.d)) === null || _a === void 0 ? void 0 : _a.toMillis();
|
|
62
|
+
if (millis === undefined) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
min = min === undefined ? millis : Math.min(min, millis);
|
|
66
|
+
max = max === undefined ? millis : Math.max(max, millis);
|
|
67
|
+
}
|
|
68
|
+
if (min === undefined || max === undefined) {
|
|
69
|
+
return DateDistance.DAY;
|
|
70
|
+
}
|
|
71
|
+
return new DateStringFactory().calculateDistanceType(DateTime.fromMillis(min), DateTime.fromMillis(max));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Queries the distinct interval buckets of the source data.
|
|
75
|
+
* Date buckets are sorted chronologically ascending and labeled locale-aware;
|
|
76
|
+
* setname buckets keep their order of first appearance in the data, blank
|
|
77
|
+
* setnames are collected in a trailing-position "—" bucket where they occur.
|
|
78
|
+
*/
|
|
79
|
+
export function queryIntervalBuckets(db, fromExpr, interval, locale) {
|
|
80
|
+
let rows;
|
|
81
|
+
try {
|
|
82
|
+
rows = db.exec(`SELECT ${intervalBucketSQL(interval)} as __interval FROM ${fromExpr}`);
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
console.error("IntervalColumns: bucket query failed", e);
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
if (interval === INTERVAL_SETNAME) {
|
|
89
|
+
const seen = new Set();
|
|
90
|
+
const buckets = [];
|
|
91
|
+
for (const row of rows) {
|
|
92
|
+
const key = coerceBucketKey(row.__interval);
|
|
93
|
+
if (seen.has(key)) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
seen.add(key);
|
|
97
|
+
buckets.push({ key, label: key.length === 0 ? BLANK_BUCKET_LABEL : key });
|
|
98
|
+
}
|
|
99
|
+
return buckets;
|
|
100
|
+
}
|
|
101
|
+
const seen = new Set();
|
|
102
|
+
const dates = [];
|
|
103
|
+
for (const row of rows) {
|
|
104
|
+
const dt = toDateTime(row.__interval);
|
|
105
|
+
if (!dt) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const key = dt.toISO();
|
|
109
|
+
if (seen.has(key)) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
seen.add(key);
|
|
113
|
+
dates.push(dt);
|
|
114
|
+
}
|
|
115
|
+
dates.sort((a, b) => a.toMillis() - b.toMillis());
|
|
116
|
+
const dateStringFactory = new DateStringFactory();
|
|
117
|
+
dateStringFactory.setLocale(locale);
|
|
118
|
+
return dates.map((dt) => ({
|
|
119
|
+
key: dt.toISO(),
|
|
120
|
+
label: dateStringFactory.getDateString(dt, interval),
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
function toDateTime(value) {
|
|
124
|
+
if (value == null) {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
if (typeof value === "string") {
|
|
128
|
+
const dt = DateTime.fromISO(value);
|
|
129
|
+
return dt.isValid ? dt : undefined;
|
|
130
|
+
}
|
|
131
|
+
if (typeof value === "number") {
|
|
132
|
+
const dt = DateTime.fromMillis(value);
|
|
133
|
+
return dt.isValid ? dt : undefined;
|
|
134
|
+
}
|
|
135
|
+
if (typeof value.isValid === "boolean") {
|
|
136
|
+
const dt = value;
|
|
137
|
+
return dt.isValid ? dt : undefined;
|
|
138
|
+
}
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import alasql from "alasql";
|
|
2
1
|
import { TableType } from "../model";
|
|
3
2
|
import { QueryColumnNames } from "../../../../utils/model";
|
|
4
3
|
/**
|
|
5
|
-
* Manages the GROUP BY column list for DataQuery's SQL statements
|
|
6
|
-
* the `transformOperator` AlaSQL custom function.
|
|
4
|
+
* Manages the GROUP BY column list for DataQuery's SQL statements.
|
|
7
5
|
*
|
|
8
|
-
* `transformOperator`
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* The `transformOperator` AlaSQL UDF (which maps `"+"`/`"-"` to +1/-1 for
|
|
7
|
+
* sign-aware SUMs) is registered globally by `scopedDb.ts` when the shared
|
|
8
|
+
* database is created — no per-component registration is needed here.
|
|
11
9
|
*
|
|
12
10
|
* The GROUP BY columns are composed dynamically: always category + categoryIndex,
|
|
13
11
|
* plus operation for OPT types, plus rowGroup/rowGroupIndex when grouping is active.
|
|
14
12
|
*/
|
|
15
13
|
export class QueryGroups {
|
|
16
14
|
constructor(config) {
|
|
17
|
-
alasql.fn.transformOperator = function (a) {
|
|
18
|
-
return a === "-" ? -1 : 1;
|
|
19
|
-
};
|
|
20
15
|
this.groups = [QueryColumnNames.CATEGORY, QueryColumnNames.CATEGORYINDEX];
|
|
21
16
|
if (TableType.OPT === config.type || TableType.OPTNOTOTAL === config.type) {
|
|
22
17
|
this.groups.unshift(QueryColumnNames.OPERATION);
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { TableRowType, TableType } from "../model";
|
|
2
|
+
import { QueryColumnNames } from "../../../../utils/model";
|
|
3
|
+
/**
|
|
4
|
+
* Waterfall geometry per raw result row and column, keyed by row identity
|
|
5
|
+
* (the factory iterates the same row objects the calculator walked).
|
|
6
|
+
*/
|
|
7
|
+
export class WaterfallResult {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.geometry = new Map();
|
|
10
|
+
}
|
|
11
|
+
set(row, column, data) {
|
|
12
|
+
let columns = this.geometry.get(row);
|
|
13
|
+
if (!columns) {
|
|
14
|
+
columns = new Map();
|
|
15
|
+
this.geometry.set(row, columns);
|
|
16
|
+
}
|
|
17
|
+
columns.set(column, data);
|
|
18
|
+
}
|
|
19
|
+
get(row, column) {
|
|
20
|
+
var _a;
|
|
21
|
+
return (_a = this.geometry.get(row)) === null || _a === void 0 ? void 0 : _a.get(column);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** True when the result contains grouping structure (sum, subtotal, or drill rows). */
|
|
25
|
+
export function hasGroupingStructure(queryData) {
|
|
26
|
+
for (const groupData of queryData) {
|
|
27
|
+
for (const row of groupData) {
|
|
28
|
+
const type = row[QueryColumnNames.TYPE];
|
|
29
|
+
if (type === TableRowType.SUM ||
|
|
30
|
+
type === TableRowType.GROUPSUM ||
|
|
31
|
+
type === TableRowType.DRILLELEMENT ||
|
|
32
|
+
type === TableRowType.PARTELEMENT) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Signed waterfall contribution of a row for one column.
|
|
41
|
+
*
|
|
42
|
+
* Non-OPT table types aggregate `SUM(scn * transformOperator(operation))`, so ENTRY
|
|
43
|
+
* values arrive already signed. OPT types aggregate plain `SUM(scn)` with the sign
|
|
44
|
+
* carried in the visible operation column, so the sign is applied here. Sum rows are
|
|
45
|
+
* fully signed in both modes.
|
|
46
|
+
*/
|
|
47
|
+
function signedValue(row, column, tableType) {
|
|
48
|
+
const raw = row[column];
|
|
49
|
+
if (raw === null || raw === undefined) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const value = Number(raw);
|
|
53
|
+
if (isNaN(value)) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const isOpt = tableType === TableType.OPT || tableType === TableType.OPTNOTOTAL;
|
|
57
|
+
if (isOpt && row[QueryColumnNames.TYPE] === TableRowType.ENTRY && row[QueryColumnNames.OPERATION] === "-") {
|
|
58
|
+
return -value;
|
|
59
|
+
}
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Computes waterfall bar geometry for the given scenario columns by walking the
|
|
64
|
+
* segmented query result once per column in display order.
|
|
65
|
+
*
|
|
66
|
+
* - ENTRY rows (incl. REST) cascade from the running total by their signed value.
|
|
67
|
+
* - SUM / GROUP_SUM rows anchor at zero and reset the running total to their value.
|
|
68
|
+
* - DRILLELEMENT (thereof) rows form a sub-cascade from their parent bar's start in
|
|
69
|
+
* the parent's direction; the running total is untouched.
|
|
70
|
+
* - PARTELEMENT (partof) rows cascade a `share * parent width` segment the same way.
|
|
71
|
+
* Note: the share denominator is the group sum (or SUM_TOTAL when ungrouped) per
|
|
72
|
+
* `createPartOfDrillRows`, not literally the parent row's value.
|
|
73
|
+
* - GROUPHEAD and NaN rows get no bar; a NaN parent orphans its drill children.
|
|
74
|
+
*
|
|
75
|
+
* @param queryData - Segmented result rows from DataQuery.execute().
|
|
76
|
+
* @param columns - Plain scenario column keys (ac1..pl4); no `##` composite keys.
|
|
77
|
+
* @param tableType - Table aggregation mode, needed for OPT sign handling.
|
|
78
|
+
*/
|
|
79
|
+
export function computeWaterfall(queryData, columns, tableType) {
|
|
80
|
+
const result = new WaterfallResult();
|
|
81
|
+
for (const column of columns) {
|
|
82
|
+
let running = 0;
|
|
83
|
+
let lastParent;
|
|
84
|
+
let subCursor = 0;
|
|
85
|
+
const emitted = [];
|
|
86
|
+
const emit = (row, data) => {
|
|
87
|
+
emitted.push(data);
|
|
88
|
+
result.set(row, column, data);
|
|
89
|
+
};
|
|
90
|
+
for (const groupData of queryData) {
|
|
91
|
+
for (const row of groupData) {
|
|
92
|
+
const type = row[QueryColumnNames.TYPE];
|
|
93
|
+
if (type === TableRowType.GROUPHEAD) {
|
|
94
|
+
lastParent = undefined;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const value = signedValue(row, column, tableType);
|
|
98
|
+
if (type === TableRowType.ENTRY) {
|
|
99
|
+
if (value === null) {
|
|
100
|
+
lastParent = undefined;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
emit(row, { start: running, end: running + value, min: 0, max: 0, kind: "cascade" });
|
|
104
|
+
lastParent = { start: running, end: running + value };
|
|
105
|
+
subCursor = lastParent.start;
|
|
106
|
+
running += value;
|
|
107
|
+
}
|
|
108
|
+
else if (type === TableRowType.SUM || type === TableRowType.GROUPSUM) {
|
|
109
|
+
if (value === null) {
|
|
110
|
+
lastParent = undefined;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
emit(row, { start: 0, end: value, min: 0, max: 0, kind: "anchor" });
|
|
114
|
+
lastParent = { start: 0, end: value };
|
|
115
|
+
subCursor = 0;
|
|
116
|
+
running = value;
|
|
117
|
+
}
|
|
118
|
+
else if (type === TableRowType.DRILLELEMENT) {
|
|
119
|
+
if (value === null || lastParent === undefined) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const direction = Math.sign(lastParent.end - lastParent.start) || 1;
|
|
123
|
+
const end = subCursor + direction * Math.abs(value);
|
|
124
|
+
emit(row, {
|
|
125
|
+
start: subCursor,
|
|
126
|
+
end,
|
|
127
|
+
min: 0,
|
|
128
|
+
max: 0,
|
|
129
|
+
kind: "thereof",
|
|
130
|
+
parentStart: lastParent.start,
|
|
131
|
+
parentEnd: lastParent.end,
|
|
132
|
+
});
|
|
133
|
+
subCursor = end;
|
|
134
|
+
}
|
|
135
|
+
else if (type === TableRowType.PARTELEMENT) {
|
|
136
|
+
if (value === null || lastParent === undefined) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const end = subCursor + value * (lastParent.end - lastParent.start);
|
|
140
|
+
emit(row, {
|
|
141
|
+
start: subCursor,
|
|
142
|
+
end,
|
|
143
|
+
min: 0,
|
|
144
|
+
max: 0,
|
|
145
|
+
kind: "partof",
|
|
146
|
+
parentStart: lastParent.start,
|
|
147
|
+
parentEnd: lastParent.end,
|
|
148
|
+
});
|
|
149
|
+
subCursor = end;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// All rows of a column share one coordinate system including zero
|
|
154
|
+
let min = 0;
|
|
155
|
+
let max = 0;
|
|
156
|
+
for (const data of emitted) {
|
|
157
|
+
min = Math.min(min, data.start, data.end);
|
|
158
|
+
max = Math.max(max, data.start, data.end);
|
|
159
|
+
}
|
|
160
|
+
for (const data of emitted) {
|
|
161
|
+
data.min = min;
|
|
162
|
+
data.max = max;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return result;
|
|
166
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const EXPRESSION_REGEX = /^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/;
|
|
2
|
+
/** Field arguments must be plain identifiers — keeps user input out of SQL syntax. */
|
|
3
|
+
const FIELD_IDENTIFIER_REGEX = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
4
|
+
const NUMERIC_FNS = ["min", "max", "avg", "sum"];
|
|
5
|
+
/**
|
|
6
|
+
* A custom table column computed from dataset fields via an aggregate expression,
|
|
7
|
+
* e.g. `set(_leiter)` or `sum(ac1)` (see the `attributes` prop on bn-table).
|
|
8
|
+
*
|
|
9
|
+
* The {@link label} is the user-facing header text and never enters SQL; queries
|
|
10
|
+
* use the positional {@link alias} (`attr_0`, `attr_1`, ...) instead.
|
|
11
|
+
*/
|
|
12
|
+
export class TableAttribute {
|
|
13
|
+
constructor(label, alias, fn, arg) {
|
|
14
|
+
this.label = label;
|
|
15
|
+
this.alias = alias;
|
|
16
|
+
this.fn = fn;
|
|
17
|
+
this.arg = arg;
|
|
18
|
+
}
|
|
19
|
+
/** Numeric aggregates are formatted like scenario cells (measure scale + decimals). */
|
|
20
|
+
get isNumeric() {
|
|
21
|
+
return NUMERIC_FNS.includes(this.fn);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** Checks a single attribute expression string like "set(_leiter)" or "lit(Fix)". */
|
|
25
|
+
export function isValidAttributeExpression(expression) {
|
|
26
|
+
if (typeof expression !== "string") {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const match = EXPRESSION_REGEX.exec(expression);
|
|
30
|
+
if (!match) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
const [, fn, arg] = match;
|
|
34
|
+
if (fn === "lit") {
|
|
35
|
+
return arg.length > 0;
|
|
36
|
+
}
|
|
37
|
+
return FIELD_IDENTIFIER_REGEX.test(arg);
|
|
38
|
+
}
|
|
39
|
+
/** Parses an attribute expression into a {@link TableAttribute}; null when invalid. */
|
|
40
|
+
export function parseTableAttributeExpression(label, alias, expression) {
|
|
41
|
+
if (!isValidAttributeExpression(expression)) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const [, fn, arg] = EXPRESSION_REGEX.exec(expression);
|
|
45
|
+
return new TableAttribute(label, alias, fn, arg);
|
|
46
|
+
}
|
|
@@ -36,6 +36,8 @@ export class TableComponentConfig {
|
|
|
36
36
|
this.categoryThereOf = new Map();
|
|
37
37
|
/** Percentage-of-total sub-row definitions. */
|
|
38
38
|
this.partOf = [];
|
|
39
|
+
/** Custom columns computed from dataset fields via aggregate expressions (see bn-table `attributes` prop). */
|
|
40
|
+
this.attributes = [];
|
|
39
41
|
this.sortOrder = new OrderAdapter(new StringAdapter()).default();
|
|
40
42
|
/** Table aggregation mode: LIST (flat), SUM (with totals), OPT (with optional totals), etc. */
|
|
41
43
|
this.type = TableType.LIST;
|
|
@@ -55,19 +57,24 @@ export class TableComponentConfig {
|
|
|
55
57
|
this.filter = "";
|
|
56
58
|
/** Scenario columns to render as inline bar charts instead of numbers. */
|
|
57
59
|
this.barColumns = [];
|
|
60
|
+
/** Interval column grouping: "none", "setname" or a DateDistance value (see bn-table `interval` prop). */
|
|
61
|
+
this.interval = "none";
|
|
62
|
+
/** Locale used for interval bucket labels. */
|
|
63
|
+
this.locale = "de";
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
/**
|
|
61
67
|
* Converts untyped JSON into a validated {@link TableComponentConfig}.
|
|
62
68
|
*
|
|
63
|
-
*
|
|
69
|
+
* Reads from the shared alasql database for measure-scale auto-calculation when `measureScale` is set to "auto".
|
|
64
70
|
*/
|
|
65
71
|
export class TableComponentConfigAdapter {
|
|
66
|
-
constructor(tableDrillGroupAdapter, stringAdapter, orderAdapter,
|
|
72
|
+
constructor(tableDrillGroupAdapter, stringAdapter, orderAdapter, db, fromExpr) {
|
|
67
73
|
this.tableDrillGroupAdapter = tableDrillGroupAdapter;
|
|
68
74
|
this.stringAdapter = stringAdapter;
|
|
69
75
|
this.orderAdapter = orderAdapter;
|
|
70
|
-
this.
|
|
76
|
+
this.db = db;
|
|
77
|
+
this.fromExpr = fromExpr;
|
|
71
78
|
}
|
|
72
79
|
adapt(data) {
|
|
73
80
|
const config = new TableComponentConfig();
|
|
@@ -98,6 +105,9 @@ export class TableComponentConfigAdapter {
|
|
|
98
105
|
if (CompareUtil.isArray(data.partOf)) {
|
|
99
106
|
config.partOf = AdapterUtils.adaptArray(data.partOf, this.tableDrillGroupAdapter);
|
|
100
107
|
}
|
|
108
|
+
if (CompareUtil.isArray(data.attributes)) {
|
|
109
|
+
config.attributes = data.attributes;
|
|
110
|
+
}
|
|
101
111
|
if (CompareUtil.isExisting(data.order)) {
|
|
102
112
|
config.sortOrder = this.orderAdapter.adapt(data.order);
|
|
103
113
|
}
|
|
@@ -114,7 +124,7 @@ export class TableComponentConfigAdapter {
|
|
|
114
124
|
config.categoryWidth = data.categoryWidth;
|
|
115
125
|
}
|
|
116
126
|
if (CompareUtil.isExisting(data.measureScale)) {
|
|
117
|
-
config.measureScale = DataAnalyzer.calculateMeasureScale(this.
|
|
127
|
+
config.measureScale = DataAnalyzer.calculateMeasureScale(this.db, this.fromExpr, config.scenarios, data.measureScale);
|
|
118
128
|
}
|
|
119
129
|
if (CompareUtil.isExisting(data.measureType)) {
|
|
120
130
|
config.measureType = data.measureType;
|
|
@@ -128,6 +138,12 @@ export class TableComponentConfigAdapter {
|
|
|
128
138
|
if (CompareUtil.isArray(data.barColumns)) {
|
|
129
139
|
config.barColumns = data.barColumns;
|
|
130
140
|
}
|
|
141
|
+
if (CompareUtil.isString(data.interval)) {
|
|
142
|
+
config.interval = data.interval;
|
|
143
|
+
}
|
|
144
|
+
if (CompareUtil.isString(data.locale)) {
|
|
145
|
+
config.locale = data.locale;
|
|
146
|
+
}
|
|
131
147
|
return config;
|
|
132
148
|
}
|
|
133
149
|
default() {
|
|
@@ -7,7 +7,7 @@ export class Template {
|
|
|
7
7
|
this.errors = withHasError(this);
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: 'd8c7214c5beab0eb52999b596d241ac052bee543' }, h("slot", { key: '41cc485bf9666117d449642d3e7948551b5b0701' })));
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "bn-template"; }
|
|
13
13
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,81 +7,8 @@ import withComponentStyle from "../../utils/withComponentStyle";
|
|
|
7
7
|
import withHasError from "../../utils/withHasError";
|
|
8
8
|
import { getParentDimensions } from "../../utils/parentDimensions";
|
|
9
9
|
import { parseScaling } from "../../utils/scaling";
|
|
10
|
-
|
|
11
|
-
"br",
|
|
12
|
-
"b",
|
|
13
|
-
"i",
|
|
14
|
-
"strong",
|
|
15
|
-
"em",
|
|
16
|
-
"span",
|
|
17
|
-
"p",
|
|
18
|
-
"div",
|
|
19
|
-
"table",
|
|
20
|
-
"tr",
|
|
21
|
-
"td",
|
|
22
|
-
"th",
|
|
23
|
-
"thead",
|
|
24
|
-
"tbody",
|
|
25
|
-
"tfoot",
|
|
26
|
-
"ul",
|
|
27
|
-
"ol",
|
|
28
|
-
"li",
|
|
29
|
-
"h1",
|
|
30
|
-
"h2",
|
|
31
|
-
"h3",
|
|
32
|
-
"h4",
|
|
33
|
-
"h5",
|
|
34
|
-
"h6",
|
|
35
|
-
"sub",
|
|
36
|
-
"sup",
|
|
37
|
-
"small",
|
|
38
|
-
"hr",
|
|
39
|
-
"a",
|
|
40
|
-
"img",
|
|
41
|
-
]);
|
|
42
|
-
const ALLOWED_ATTRS = new Set([
|
|
43
|
-
"class",
|
|
44
|
-
"style",
|
|
45
|
-
"colspan",
|
|
46
|
-
"rowspan",
|
|
47
|
-
"href",
|
|
48
|
-
"title",
|
|
49
|
-
"src",
|
|
50
|
-
"alt",
|
|
51
|
-
"width",
|
|
52
|
-
"height",
|
|
53
|
-
]);
|
|
10
|
+
import { sanitizeHtml } from "../../utils/sanitizeHtml";
|
|
54
11
|
const DANGEROUS_PATTERN = /\b(__proto__|globalThis)\b|\.constructor\b/;
|
|
55
|
-
function sanitizeHtml(html) {
|
|
56
|
-
const container = document.createElement("div");
|
|
57
|
-
container.innerHTML = html;
|
|
58
|
-
sanitizeNode(container);
|
|
59
|
-
return container.innerHTML;
|
|
60
|
-
}
|
|
61
|
-
function sanitizeNode(node) {
|
|
62
|
-
for (const child of Array.from(node.childNodes)) {
|
|
63
|
-
if (child.nodeType !== Node.ELEMENT_NODE)
|
|
64
|
-
continue;
|
|
65
|
-
const el = child;
|
|
66
|
-
if (!ALLOWED_TAGS.has(el.tagName.toLowerCase())) {
|
|
67
|
-
node.replaceChild(document.createTextNode(el.textContent || ""), el);
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
for (const attr of Array.from(el.attributes)) {
|
|
71
|
-
const name = attr.name.toLowerCase();
|
|
72
|
-
if (name.startsWith("on") || !ALLOWED_ATTRS.has(name)) {
|
|
73
|
-
el.removeAttribute(attr.name);
|
|
74
|
-
}
|
|
75
|
-
else if ((name === "href" || name === "src") && /^\s*javascript:/i.test(attr.value)) {
|
|
76
|
-
el.removeAttribute(attr.name);
|
|
77
|
-
}
|
|
78
|
-
else if (name === "style" && /expression|javascript/i.test(attr.value)) {
|
|
79
|
-
el.removeAttribute(attr.name);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
sanitizeNode(el);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
12
|
/**
|
|
86
13
|
* Renders a template-driven text block with dataset interpolation.
|
|
87
14
|
*
|
|
@@ -264,7 +191,7 @@ export class Text {
|
|
|
264
191
|
"--bn-font-color": fontStyles.color,
|
|
265
192
|
"--bn-font-background": fontStyles.background,
|
|
266
193
|
};
|
|
267
|
-
return (h(Host, { key: '
|
|
194
|
+
return (h(Host, { key: 'b5516777bb29ddddf3fb43ff518fdc383c86a812', style: cssVars }, h("div", { key: 'dc325b0679f0a151ac60d32cae70f2a2f14ae205' }, h("span", { key: 'fcdc9c6cb9224428e7b47df3ac10336bcdffb260', class: "container", ref: (el) => {
|
|
268
195
|
this.container = el;
|
|
269
196
|
} }))));
|
|
270
197
|
}
|
|
@@ -6,6 +6,7 @@ import withTranslation from "../../utils/withTranslation";
|
|
|
6
6
|
import { globalLabelKeys } from "../../stores/internationalization";
|
|
7
7
|
import { withStyled } from "../../utils/styled/withStyled";
|
|
8
8
|
import withComponentStyle from "../../utils/withComponentStyle";
|
|
9
|
+
import withRuleSet from "../../utils/withRuleSet";
|
|
9
10
|
import withHasError from "../../utils/withHasError";
|
|
10
11
|
import { I18nMode } from "../../utils/constants";
|
|
11
12
|
import { OrderDirection } from "../../utils/model/Order";
|
|
@@ -19,7 +20,10 @@ import { DateDistance, DateLink } from "../../utils/DateStringFactory";
|
|
|
19
20
|
*/
|
|
20
21
|
export class Title {
|
|
21
22
|
constructor() {
|
|
22
|
-
/** Name of the business unit displayed in card header. If empty string (`''` or `null`) the business unit row is omitted
|
|
23
|
+
/** Name of the business unit displayed in card header. If empty string (`''` or `null`) the business unit row is omitted
|
|
24
|
+
* <br /><br />
|
|
25
|
+
* Rendered as sanitized HTML, so inline markup such as ```<b>```, ```<i>``` and ```<br />``` is supported.
|
|
26
|
+
*/
|
|
23
27
|
this.businessUnit = "";
|
|
24
28
|
/** List of the primary scenarios on which the order direction are applied.
|
|
25
29
|
* <br /><br />
|
|
@@ -75,6 +79,7 @@ export class Title {
|
|
|
75
79
|
this.t = withTranslation(this).t;
|
|
76
80
|
this.errors = withHasError(this);
|
|
77
81
|
this.componentStyle = withComponentStyle(this);
|
|
82
|
+
this.ruleSetConfig = withRuleSet(this);
|
|
78
83
|
}
|
|
79
84
|
validateScenario(newValue) {
|
|
80
85
|
const errId = "ERR_scenarios";
|
|
@@ -286,7 +291,7 @@ export class Title {
|
|
|
286
291
|
}
|
|
287
292
|
render() {
|
|
288
293
|
const fontStyles = this.getFontStyles();
|
|
289
|
-
return (h(Host, { key: '
|
|
294
|
+
return (h(Host, { key: 'de097e2e8afe7fcf3268487b45b380e42448feab', style: fontStyles }, h("ibcs-title", { key: 'af0cb1c88c434e92d3fea1a71bf4d0687158353f', 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() })));
|
|
290
295
|
}
|
|
291
296
|
static get is() { return "bn-title"; }
|
|
292
297
|
static get encapsulation() { return "shadow"; }
|
|
@@ -302,6 +307,25 @@ export class Title {
|
|
|
302
307
|
}
|
|
303
308
|
static get properties() {
|
|
304
309
|
return {
|
|
310
|
+
"ruleset": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"mutable": false,
|
|
313
|
+
"complexType": {
|
|
314
|
+
"original": "string",
|
|
315
|
+
"resolved": "string",
|
|
316
|
+
"references": {}
|
|
317
|
+
},
|
|
318
|
+
"required": false,
|
|
319
|
+
"optional": true,
|
|
320
|
+
"docs": {
|
|
321
|
+
"tags": [],
|
|
322
|
+
"text": "Name of a registered IBCS rule set (see `bn-ruleset`) used for scenario\nordering. Supports `\"inherited-closest\"` / `\"inherited-page\"` to take\nover the value from an ancestor `bn-layout-card` / `bn-layout-page`."
|
|
323
|
+
},
|
|
324
|
+
"getter": false,
|
|
325
|
+
"setter": false,
|
|
326
|
+
"reflect": true,
|
|
327
|
+
"attribute": "ruleset"
|
|
328
|
+
},
|
|
305
329
|
"businessUnit": {
|
|
306
330
|
"type": "string",
|
|
307
331
|
"mutable": false,
|
|
@@ -314,7 +338,7 @@ export class Title {
|
|
|
314
338
|
"optional": false,
|
|
315
339
|
"docs": {
|
|
316
340
|
"tags": [],
|
|
317
|
-
"text": "Name of the business unit displayed in card header. If empty string (`''` or `null`) the business unit row is omitted"
|
|
341
|
+
"text": "Name of the business unit displayed in card header. If empty string (`''` or `null`) the business unit row is omitted\n<br /><br />\nRendered as sanitized HTML, so inline markup such as ```<b>```, ```<i>``` and ```<br />``` is supported."
|
|
318
342
|
},
|
|
319
343
|
"getter": false,
|
|
320
344
|
"setter": false,
|