@bino-bi/bn-template-engine 1.0.0-alpha.9 → 1.0.0-next.20
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-28d5c266.entry.js +1 -0
- package/dist/bn-template-engine/p-2d3ea756.entry.js +1 -0
- package/dist/bn-template-engine/p-2fba7c99.entry.js +1 -0
- package/dist/bn-template-engine/p-6077155f.entry.js +1 -0
- package/dist/bn-template-engine/p-687032d5.entry.js +1 -0
- package/dist/bn-template-engine/p-6c7f0076.entry.js +1 -0
- package/dist/bn-template-engine/p-6lOdN-fB.js +1 -0
- package/dist/bn-template-engine/p-7e9dbc93.entry.js +1 -0
- package/dist/bn-template-engine/p-99477a27.entry.js +1 -0
- package/dist/bn-template-engine/p-A8xyE4b1.js +1 -0
- package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
- package/dist/bn-template-engine/p-BgIpdpfH.js +1 -0
- package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
- package/dist/bn-template-engine/p-BpWWgN6k.js +1 -0
- package/dist/bn-template-engine/p-C5uvAEKI.js +1 -0
- package/dist/bn-template-engine/p-C8Q0lsaU.js +1 -0
- package/dist/bn-template-engine/p-C9i1Xsib.js +1 -0
- package/dist/bn-template-engine/p-CJThzFZm.js +1 -0
- package/dist/bn-template-engine/p-CYE0I1Mx.js +1 -0
- package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
- package/dist/bn-template-engine/p-DwYUTvvI.js +1 -0
- package/dist/bn-template-engine/p-a1380d7c.entry.js +1 -0
- package/dist/bn-template-engine/p-a4ea9a79.entry.js +1 -0
- package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
- package/dist/bn-template-engine/p-b5274369.entry.js +1 -0
- package/dist/bn-template-engine/p-b9e94127.entry.js +1 -0
- package/dist/bn-template-engine/p-ba912130.entry.js +1 -0
- package/dist/bn-template-engine/p-de29986f.entry.js +1 -0
- package/dist/bn-template-engine/p-eEfqksk-.js +1 -0
- package/dist/bn-template-engine/p-fFtEvsY-.js +1 -0
- package/dist/cjs/AxisConfig-D7CAyPLO.js +233 -0
- package/dist/cjs/LabelCollisionManager-DkdQ9Xdg.js +412 -0
- package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
- package/dist/cjs/Order-IPfAP0q8.js +87 -0
- package/dist/cjs/SVGStyle-BD8jApd4.js +8209 -0
- package/dist/cjs/SVGVariancesStyleGroup-BaWzR951.js +50 -0
- package/dist/cjs/VarianceMeasure-BBWTgv2e.js +372 -0
- package/dist/cjs/XYChartDataRow-BoR0CTfl.js +829 -0
- package/dist/cjs/bn-asset_21.cjs.entry.js +16105 -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 +4 -2
- package/dist/cjs/context-protocol-BBhT9B52.js +9505 -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-DUYYkDMQ.js +199 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
- package/dist/cjs/scaling-BIJQ2NV1.js +589 -0
- package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
- package/dist/cjs/withScalingGroup-D5clRvRe.js +73 -0
- package/dist/cjs/withStyled-Cm9dWQhu.js +1168 -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 +126 -43
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +104 -37
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +101 -60
- 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 +161 -44
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +97 -32
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +151 -75
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +10 -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 +20 -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 +20 -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 +318 -62
- package/dist/collection/components/bn-table/ibcs-table.css +8 -0
- package/dist/collection/components/bn-table/ibcs-table.js +162 -33
- package/dist/collection/components/bn-table/utils/Table.js +72 -29
- 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 +120 -23
- 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 +31 -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 +52 -6
- package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +7 -4
- package/dist/collection/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.js +6 -2
- package/dist/collection/components/bn-title/ibcs-title/utils/model/TitleConfig.js +5 -0
- package/dist/collection/components/bn-tree/bn-tree.js +19 -0
- 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 +77 -3
- package/dist/collection/stores/ruleSets.js +46 -0
- package/dist/collection/utils/DateStringFactory.js +31 -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 +53 -15
- 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-ByIP5J-9.js +224 -0
- package/dist/esm/LabelCollisionManager-DaNiDiM9.js +404 -0
- package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
- package/dist/esm/Order-BQeJE_yi.js +83 -0
- package/dist/esm/SVGStyle-BwBlY3Km.js +8199 -0
- package/dist/esm/SVGVariancesStyleGroup-BpGW4CvN.js +48 -0
- package/dist/esm/VarianceMeasure-CE3N8Bea.js +364 -0
- package/dist/esm/XYChartDataRow-DeMI1JKU.js +820 -0
- package/dist/esm/bn-asset_21.entry.js +16083 -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 +4 -2
- package/dist/esm/context-protocol-d8MHrEo8.js +9490 -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-BJBEyhNf.js +196 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
- package/dist/esm/scaling-BGnpSN1j.js +581 -0
- package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
- package/dist/esm/withScalingGroup-CC3UcvC5.js +71 -0
- package/dist/esm/withStyled-2l5Tx3cf.js +1135 -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 +21 -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 +21 -12
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +7 -3
- package/dist/types/components/bn-context/bn-context.d.ts +8 -0
- 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-grid/bn-grid.d.ts +8 -0
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +39 -8
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +36 -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 +12 -1
- package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +4 -0
- package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
- package/dist/types/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.d.ts +3 -1
- package/dist/types/components/bn-title/ibcs-title/utils/model/TitleConfig.d.ts +2 -0
- package/dist/types/components/bn-tree/bn-tree.d.ts +8 -0
- package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
- package/dist/types/components.d.ts +1725 -116
- 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 +20 -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 +15 -5
- 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-3141c4a2.entry.js +0 -1
- package/dist/bn-template-engine/p-67538176.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-c86395b8.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 -23547
- 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 -23526
- 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
|
@@ -74,6 +74,9 @@ export class DateStringFactory {
|
|
|
74
74
|
none: "[DATE]",
|
|
75
75
|
};
|
|
76
76
|
this.locale = "de";
|
|
77
|
+
/** Set once a caller supplies an explicit map, so `setLocale` stops overwriting it. */
|
|
78
|
+
this.dateFormatPinned = false;
|
|
79
|
+
this.dateFormatShortPinned = false;
|
|
77
80
|
this.dateFormat = this._dateFormat;
|
|
78
81
|
this.dateLinkFormat = this._dateLinkFormat;
|
|
79
82
|
this.dateFormatShort = this._dateFormatShort;
|
|
@@ -83,12 +86,25 @@ export class DateStringFactory {
|
|
|
83
86
|
}
|
|
84
87
|
setDateFormat(dateFormat) {
|
|
85
88
|
this.dateFormat = dateFormat;
|
|
89
|
+
this.dateFormatPinned = true;
|
|
86
90
|
}
|
|
87
91
|
setDateFormatShort(dateFormatShort) {
|
|
88
92
|
this.dateFormatShort = dateFormatShort;
|
|
93
|
+
this.dateFormatShortPinned = true;
|
|
89
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Selects the locale used for Luxon's localized tokens and swaps in the
|
|
97
|
+
* locale's pattern overrides. An explicit `setDateFormat` /
|
|
98
|
+
* `setDateFormatShort` always wins, whatever the call order.
|
|
99
|
+
*/
|
|
90
100
|
setLocale(locale) {
|
|
91
101
|
this.locale = locale;
|
|
102
|
+
if (!this.dateFormatPinned) {
|
|
103
|
+
this.dateFormat = Object.assign(Object.assign({}, this._dateFormat), (DateStringFactory.LOCALE_DATE_FORMAT[locale] || {}));
|
|
104
|
+
}
|
|
105
|
+
if (!this.dateFormatShortPinned) {
|
|
106
|
+
this.dateFormatShort = Object.assign(Object.assign({}, this._dateFormatShort), (DateStringFactory.LOCALE_DATE_FORMAT_SHORT[locale] || {}));
|
|
107
|
+
}
|
|
92
108
|
}
|
|
93
109
|
/**
|
|
94
110
|
* Converts date string based on dateFormatMap and the selected Type
|
|
@@ -445,3 +461,18 @@ export class DateStringFactory {
|
|
|
445
461
|
}
|
|
446
462
|
}
|
|
447
463
|
}
|
|
464
|
+
/**
|
|
465
|
+
* Per-locale overrides for the patterns whose literals are language-specific.
|
|
466
|
+
*
|
|
467
|
+
* The base maps above are German (`KW` = Kalenderwoche, `dd.MM.yyyy`); a
|
|
468
|
+
* locale listed here replaces only the entries it names. Locales that are not
|
|
469
|
+
* listed keep the base patterns, so adding a bundle never silently reformats
|
|
470
|
+
* existing reports. Luxon's `LLL` (month) and `q` (quarter) tokens are already
|
|
471
|
+
* locale-aware through `setLocale`, so they need no override.
|
|
472
|
+
*/
|
|
473
|
+
DateStringFactory.LOCALE_DATE_FORMAT = {
|
|
474
|
+
en: { week: "'W'WW yyyy", day: "MM/dd/yyyy", fallback: "MM/dd/yyyy" },
|
|
475
|
+
};
|
|
476
|
+
DateStringFactory.LOCALE_DATE_FORMAT_SHORT = {
|
|
477
|
+
en: { week: "'W'WW", fallback: "MM/dd/yyyy" },
|
|
478
|
+
};
|
|
@@ -177,6 +177,11 @@ export var StackMode;
|
|
|
177
177
|
StackMode["RELATIVE"] = "relative";
|
|
178
178
|
StackMode["ABSOLUTE_RELATIVE"] = "absolute-relative";
|
|
179
179
|
})(StackMode || (StackMode = {}));
|
|
180
|
+
/**
|
|
181
|
+
* Value domain of a RELATIVE (100%) stack: the full stack spans 100 units,
|
|
182
|
+
* so pixelPerUnit is interpreted as pixels per percentage point.
|
|
183
|
+
*/
|
|
184
|
+
export const RELATIVE_STACK_UNITS = 100;
|
|
180
185
|
/** Sort order of segments within a stacked bar. DATASET preserves the original data order. */
|
|
181
186
|
export var StackOrder;
|
|
182
187
|
(function (StackOrder) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import alasql from "alasql";
|
|
2
1
|
import { SiPrefix } from "./model/SiPrefix";
|
|
3
2
|
/**
|
|
4
3
|
* SI prefix lookup table mapping prefix symbols to their numeric multipliers.
|
|
@@ -46,8 +45,8 @@ export class DataAnalyzer {
|
|
|
46
45
|
* are considered; variance columns are excluded.
|
|
47
46
|
* - `null` with data: defaults to GREATEST auto-detection
|
|
48
47
|
*/
|
|
49
|
-
static calculateMeasureScale(
|
|
50
|
-
var _a;
|
|
48
|
+
static calculateMeasureScale(db, fromExpr, scenarios, mode) {
|
|
49
|
+
var _a, _b;
|
|
51
50
|
if (mode === "_") {
|
|
52
51
|
return new SiPrefix();
|
|
53
52
|
}
|
|
@@ -56,7 +55,7 @@ export class DataAnalyzer {
|
|
|
56
55
|
return this.lookupPrefix(mode);
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
if (scenarios.length === 0) {
|
|
58
|
+
if (scenarios.length === 0 || !fromExpr) {
|
|
60
59
|
return new SiPrefix();
|
|
61
60
|
}
|
|
62
61
|
// filtering wordlenght == 3, so variances are not considered
|
|
@@ -64,18 +63,25 @@ export class DataAnalyzer {
|
|
|
64
63
|
.filter((word) => word.length === 3)
|
|
65
64
|
.map((x) => "ABS(" + x + ")")
|
|
66
65
|
.toString()})) as prefixvalue
|
|
67
|
-
FROM
|
|
66
|
+
FROM ${fromExpr}`;
|
|
68
67
|
const queryMin = `SELECT MIN(LEAST(${scenarios
|
|
69
68
|
.filter((word) => word.length === 3)
|
|
70
69
|
.map((x) => "ABS(" + x + ")")
|
|
71
70
|
.toString()})) as prefixvalue
|
|
72
|
-
FROM
|
|
71
|
+
FROM ${fromExpr}`;
|
|
73
72
|
let query = queryMax;
|
|
74
73
|
if ((mode === null || mode === void 0 ? void 0 : mode.toUpperCase()) === "LEAST") {
|
|
75
74
|
query = queryMin;
|
|
76
75
|
}
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
let num;
|
|
77
|
+
try {
|
|
78
|
+
const result = db.exec(query);
|
|
79
|
+
num = (_b = (_a = result[0]) === null || _a === void 0 ? void 0 : _a.prefixvalue) !== null && _b !== void 0 ? _b : 0;
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
console.error("DataAnalyzer: measure-scale query failed", query, e);
|
|
83
|
+
return new SiPrefix();
|
|
84
|
+
}
|
|
79
85
|
return this.determinePrefix(Math.abs(num));
|
|
80
86
|
}
|
|
81
87
|
/** Maps an absolute numeric value to the best-fitting SI prefix based on digit count. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { merge } from "@corex/deepmerge";
|
|
2
|
+
import { SYSTEM_RULESET_DEFAULTS } from "../stores/ruleSets";
|
|
1
3
|
import { VarianceScenario } from "./model/VarianceScenario";
|
|
2
4
|
/**
|
|
3
5
|
* IBCS rule set defining scenario→style mappings per IBCS notation standard v1.2.
|
|
@@ -11,10 +13,13 @@ import { VarianceScenario } from "./model/VarianceScenario";
|
|
|
11
13
|
* Sort indices determine column display order: PP(100s) < PL(200s) < FC(300s) < AC(400s).
|
|
12
14
|
* Variance columns add +1000 (absolute) or +2000 (relative) to the base sort index.
|
|
13
15
|
* Within each group, variant number (1-4) adds multiples of 10.
|
|
16
|
+
*
|
|
17
|
+
* The built-in rules live in `SYSTEM_RULESET_DEFAULTS` (stores/ruleSets); an
|
|
18
|
+
* optional partial {@link RuleSetConfig} passed to the constructor is
|
|
19
|
+
* deep-merged over them, so `new IBCSRuleSet()` keeps the standard behavior.
|
|
14
20
|
*/
|
|
15
21
|
export class IBCSRuleSet {
|
|
16
|
-
constructor() {
|
|
17
|
-
// defines scenario sortIndex an colour PP, PL, FC, AC,
|
|
22
|
+
constructor(config) {
|
|
18
23
|
this._dateFormat = {
|
|
19
24
|
year: "YYYY",
|
|
20
25
|
quarter: "Q[Q] YYYY",
|
|
@@ -34,30 +39,13 @@ export class IBCSRuleSet {
|
|
|
34
39
|
none: "[DATE]",
|
|
35
40
|
};
|
|
36
41
|
this._scenarioMap = new Map();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
sortIndex:
|
|
42
|
-
};
|
|
43
|
-
this.
|
|
44
|
-
this.createScenarioMapEntry("fc", "FC", 30, 300);
|
|
45
|
-
this.createScenarioMapEntry("pl", "PL", 50, 200);
|
|
46
|
-
this.createScenarioMapEntry("bu", "BU", 50, 200);
|
|
47
|
-
this.createScenarioMapEntry("pp", "PP", 20, 100);
|
|
48
|
-
this.createScenarioMapEntry("py", "PY", 20, 100);
|
|
49
|
-
this.createScenarioMapEntry("dac", "dAC", 10, 1400);
|
|
50
|
-
this.createScenarioMapEntry("dfc", "dFC", 30, 1300);
|
|
51
|
-
this.createScenarioMapEntry("dpl", "dPL", 50, 1200);
|
|
52
|
-
this.createScenarioMapEntry("dbu", "dBU", 50, 1200);
|
|
53
|
-
this.createScenarioMapEntry("dpp", "dPP", 20, 1100);
|
|
54
|
-
this.createScenarioMapEntry("dpy", "dPY", 20, 1100);
|
|
55
|
-
this.createScenarioMapEntry("drac", "drAC", 10, 2400);
|
|
56
|
-
this.createScenarioMapEntry("drfc", "drFC", 30, 2300);
|
|
57
|
-
this.createScenarioMapEntry("drpl", "drPL", 50, 2200);
|
|
58
|
-
this.createScenarioMapEntry("drbu", "drBU", 50, 2200);
|
|
59
|
-
this.createScenarioMapEntry("drpp", "drPP", 20, 2100);
|
|
60
|
-
this.createScenarioMapEntry("drpy", "drPY", 20, 2100);
|
|
42
|
+
// defines scenario sortIndex an colour PP, PL, FC, AC,
|
|
43
|
+
const effective = merge([SYSTEM_RULESET_DEFAULTS, config !== null && config !== void 0 ? config : {}]);
|
|
44
|
+
Object.entries(effective.scenarios).forEach(([key, scenario]) => {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
this.createScenarioMapEntry(key, (_a = scenario.name) !== null && _a !== void 0 ? _a : key, (_b = scenario.colorIndex) !== null && _b !== void 0 ? _b : 10, (_c = scenario.sortIndex) !== null && _c !== void 0 ? _c : 0);
|
|
47
|
+
});
|
|
48
|
+
this._fallBackScenario = effective.fallback;
|
|
61
49
|
}
|
|
62
50
|
createScenarioMapEntry(key, name, colorIndex, sortIndex) {
|
|
63
51
|
const range = [1, 2, 3, 4];
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared ResizeObserver utility for visualization components.
|
|
3
|
+
*
|
|
4
|
+
* Wraps ResizeObserver with debouncing and a size-stability check so
|
|
5
|
+
* auto-scaling logic reacts to genuine container size changes (window
|
|
6
|
+
* resizes, card relayouts, async sibling loads) without creating
|
|
7
|
+
* feedback loops when the component's own scaling changes its content
|
|
8
|
+
* dimensions.
|
|
9
|
+
*/
|
|
10
|
+
const DEFAULT_DEBOUNCE_MS = 80;
|
|
11
|
+
const SIZE_THRESHOLD_PX = 2;
|
|
12
|
+
/**
|
|
13
|
+
* Observes the parent container of `element` for size changes.
|
|
14
|
+
*
|
|
15
|
+
* The callback only fires when the observed target's dimensions change
|
|
16
|
+
* by more than {@link SIZE_THRESHOLD_PX} pixels compared to the last
|
|
17
|
+
* time the callback was invoked. This prevents feedback loops where
|
|
18
|
+
* auto-scaling → font-size change → content reflow → ResizeObserver
|
|
19
|
+
* fires again → auto-scaling …
|
|
20
|
+
*
|
|
21
|
+
* @param element The component's host element
|
|
22
|
+
* @param callback Called when the observed parent genuinely resizes
|
|
23
|
+
* @param debounceMs Debounce interval (default 80ms)
|
|
24
|
+
*/
|
|
25
|
+
export function observeParentResize(element, callback, debounceMs = DEFAULT_DEBOUNCE_MS) {
|
|
26
|
+
let timer = null;
|
|
27
|
+
let disconnected = false;
|
|
28
|
+
let lastWidth = -1;
|
|
29
|
+
let lastHeight = -1;
|
|
30
|
+
const target = findObservationTarget(element);
|
|
31
|
+
if (!target) {
|
|
32
|
+
return { disconnect() { } };
|
|
33
|
+
}
|
|
34
|
+
const observer = new ResizeObserver((entries) => {
|
|
35
|
+
var _a;
|
|
36
|
+
if (disconnected)
|
|
37
|
+
return;
|
|
38
|
+
// Use the first entry's contentBoxSize when available, fall back
|
|
39
|
+
// to the target's clientWidth/clientHeight.
|
|
40
|
+
let w;
|
|
41
|
+
let h;
|
|
42
|
+
const entry = entries[0];
|
|
43
|
+
if ((_a = entry === null || entry === void 0 ? void 0 : entry.contentBoxSize) === null || _a === void 0 ? void 0 : _a.length) {
|
|
44
|
+
const box = entry.contentBoxSize[0];
|
|
45
|
+
w = box.inlineSize;
|
|
46
|
+
h = box.blockSize;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
w = target.clientWidth;
|
|
50
|
+
h = target.clientHeight;
|
|
51
|
+
}
|
|
52
|
+
// Only fire when the parent genuinely resized — not when the
|
|
53
|
+
// child's own scaling caused a sub-pixel content reflow.
|
|
54
|
+
if (Math.abs(w - lastWidth) <= SIZE_THRESHOLD_PX && Math.abs(h - lastHeight) <= SIZE_THRESHOLD_PX) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
lastWidth = w;
|
|
58
|
+
lastHeight = h;
|
|
59
|
+
if (timer != null)
|
|
60
|
+
clearTimeout(timer);
|
|
61
|
+
timer = setTimeout(() => {
|
|
62
|
+
if (!disconnected)
|
|
63
|
+
callback();
|
|
64
|
+
}, debounceMs);
|
|
65
|
+
});
|
|
66
|
+
observer.observe(target);
|
|
67
|
+
return {
|
|
68
|
+
disconnect() {
|
|
69
|
+
disconnected = true;
|
|
70
|
+
if (timer != null)
|
|
71
|
+
clearTimeout(timer);
|
|
72
|
+
observer.disconnect();
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Finds the best element to observe for size changes.
|
|
78
|
+
* Prefers the slot wrapper inside the shadow DOM (the actual layout
|
|
79
|
+
* container), falls back to the light DOM parent.
|
|
80
|
+
*/
|
|
81
|
+
function findObservationTarget(element) {
|
|
82
|
+
var _a;
|
|
83
|
+
const lightParent = element.parentElement;
|
|
84
|
+
if ((_a = lightParent === null || lightParent === void 0 ? void 0 : lightParent.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement) {
|
|
85
|
+
return lightParent.assignedSlot.parentElement;
|
|
86
|
+
}
|
|
87
|
+
return lightParent;
|
|
88
|
+
}
|
|
@@ -11,14 +11,19 @@
|
|
|
11
11
|
* visual container. We cross the light→shadow boundary via assignedSlot to
|
|
12
12
|
* find the actual slot wrapper that determines layout.
|
|
13
13
|
*/
|
|
14
|
-
export function getParentDimensions(element) {
|
|
14
|
+
export function getParentDimensions(element, debug = false) {
|
|
15
15
|
const parent = findLayoutParent(element);
|
|
16
16
|
if (!parent) {
|
|
17
|
+
if (debug)
|
|
18
|
+
console.log("[parentDims] no layout parent found for", element.tagName);
|
|
17
19
|
return { width: 0, height: 0 };
|
|
18
20
|
}
|
|
19
21
|
const parentStyle = getComputedStyle(parent);
|
|
20
22
|
const width = parent.clientWidth - parseFloat(parentStyle.paddingLeft) - parseFloat(parentStyle.paddingRight);
|
|
21
|
-
const height = findConstrainedHeight(element);
|
|
23
|
+
const height = findConstrainedHeight(element, debug);
|
|
24
|
+
if (debug) {
|
|
25
|
+
console.log("[parentDims]", element.tagName, "→ layoutParent:", parent.tagName, parent.className || "(no class)", `clientW=${parent.clientWidth} → w=${Math.round(width)}, h=${Math.round(height)}`, "overflow:", parentStyle.overflow);
|
|
26
|
+
}
|
|
22
27
|
return { width: Math.max(0, width), height: Math.max(0, height) };
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
@@ -38,39 +43,90 @@ function findLayoutParent(element) {
|
|
|
38
43
|
return lightParent;
|
|
39
44
|
}
|
|
40
45
|
/**
|
|
41
|
-
* Returns the visual parent, crossing shadow DOM boundaries
|
|
46
|
+
* Returns the visual parent, crossing shadow DOM boundaries in both
|
|
47
|
+
* directions: via assignedSlot for slotted elements (light → shadow) and
|
|
48
|
+
* via the shadow host when the element is a top-level child of a shadow
|
|
49
|
+
* root (shadow → host). Without the host crossing, the ancestor walk dies
|
|
50
|
+
* at the top of a component's shadow tree (e.g. inside bn-layout-card)
|
|
51
|
+
* and never sees outer constraints.
|
|
42
52
|
*/
|
|
43
53
|
function getVisualParent(element) {
|
|
44
54
|
var _a;
|
|
45
55
|
if ((_a = element.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement) {
|
|
46
56
|
return element.assignedSlot.parentElement;
|
|
47
57
|
}
|
|
48
|
-
|
|
58
|
+
if (element.parentElement) {
|
|
59
|
+
return element.parentElement;
|
|
60
|
+
}
|
|
61
|
+
const root = element.getRootNode();
|
|
62
|
+
return root instanceof ShadowRoot ? root.host : null;
|
|
49
63
|
}
|
|
50
64
|
/**
|
|
51
65
|
* Walks up the ancestor chain to find a height that is actually constrained
|
|
52
66
|
* (not just "whatever my content needs"). Crosses shadow DOM boundaries
|
|
53
67
|
* via assignedSlot when encountering slotted elements. Returns viewport
|
|
54
68
|
* height as a last resort.
|
|
69
|
+
*
|
|
70
|
+
* Ancestors inside a fit-content layout region (marked with
|
|
71
|
+
* `data-bn-fit-content` by bn-layout-page / bn-layout-card) are skipped
|
|
72
|
+
* even when they clip overflow: their height is derived from their own
|
|
73
|
+
* content — including the measuring component itself — so using it for
|
|
74
|
+
* auto-scaling creates a feedback loop where the chart inflates the cell
|
|
75
|
+
* and then reads the inflated cell back as "available height". The marker
|
|
76
|
+
* value carries the grid's row count; the constraint found above the
|
|
77
|
+
* fit-content region is divided by it, approximating the equal-share cell
|
|
78
|
+
* height the same layout would produce with fit-to-content disabled.
|
|
55
79
|
*/
|
|
56
|
-
function findConstrainedHeight(element) {
|
|
80
|
+
function findConstrainedHeight(element, debug = false) {
|
|
57
81
|
let current = findLayoutParent(element);
|
|
82
|
+
let depth = 0;
|
|
83
|
+
let candidate = null;
|
|
84
|
+
let rowShareDivisor = 1;
|
|
58
85
|
while (current) {
|
|
86
|
+
// A fit-content region sizes itself from its content — every height
|
|
87
|
+
// measured below this point is circular. Discard inner candidates and
|
|
88
|
+
// keep walking for a content-independent constraint further up.
|
|
89
|
+
if (current.hasAttribute("data-bn-fit-content")) {
|
|
90
|
+
if (debug)
|
|
91
|
+
console.log(`[height:${depth}]`, current.tagName, "fit-content region → discarding inner candidate");
|
|
92
|
+
candidate = null;
|
|
93
|
+
const rows = parseInt(current.getAttribute("data-bn-fit-content"), 10);
|
|
94
|
+
if (!isNaN(rows) && rows > 1) {
|
|
95
|
+
rowShareDivisor *= rows;
|
|
96
|
+
}
|
|
97
|
+
current = getVisualParent(current);
|
|
98
|
+
depth++;
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
59
101
|
const style = getComputedStyle(current);
|
|
60
102
|
const overflow = style.overflowY;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return current.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);
|
|
103
|
+
if (debug) {
|
|
104
|
+
console.log(`[height:${depth}]`, current.tagName, current.className || "(no class)", `overflow=${overflow} clientH=${current.clientHeight} h=${style.height}`);
|
|
64
105
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
106
|
+
if (candidate === null) {
|
|
107
|
+
// An ancestor that clips / scrolls its content has a meaningful height
|
|
108
|
+
if (overflow === "hidden" || overflow === "scroll" || overflow === "auto") {
|
|
109
|
+
candidate = current.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);
|
|
110
|
+
if (debug)
|
|
111
|
+
console.log(`[height] candidate at depth ${depth}: ${Math.round(candidate)}px`);
|
|
112
|
+
}
|
|
113
|
+
else if (style.maxHeight !== "none") {
|
|
114
|
+
// An explicit max-height constrains the available space
|
|
115
|
+
const mh = parseFloat(style.maxHeight);
|
|
116
|
+
if (!isNaN(mh) && mh > 0) {
|
|
117
|
+
candidate = Math.min(mh, current.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom));
|
|
118
|
+
}
|
|
70
119
|
}
|
|
71
120
|
}
|
|
72
121
|
current = getVisualParent(current);
|
|
122
|
+
depth++;
|
|
123
|
+
}
|
|
124
|
+
if (candidate !== null) {
|
|
125
|
+
return candidate / rowShareDivisor;
|
|
73
126
|
}
|
|
74
|
-
|
|
75
|
-
|
|
127
|
+
if (debug)
|
|
128
|
+
console.log("[height] NO constrained ancestor → viewport fallback");
|
|
129
|
+
// No constrained ancestor found — use viewport, applying the same
|
|
130
|
+
// equal-share division a marked fit-content region demands
|
|
131
|
+
return typeof window !== "undefined" ? window.innerHeight / rowShareDivisor : 0;
|
|
76
132
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const ALLOWED_TAGS = new Set([
|
|
2
|
+
"br",
|
|
3
|
+
"b",
|
|
4
|
+
"i",
|
|
5
|
+
"strong",
|
|
6
|
+
"em",
|
|
7
|
+
"span",
|
|
8
|
+
"p",
|
|
9
|
+
"div",
|
|
10
|
+
"table",
|
|
11
|
+
"tr",
|
|
12
|
+
"td",
|
|
13
|
+
"th",
|
|
14
|
+
"thead",
|
|
15
|
+
"tbody",
|
|
16
|
+
"tfoot",
|
|
17
|
+
"ul",
|
|
18
|
+
"ol",
|
|
19
|
+
"li",
|
|
20
|
+
"h1",
|
|
21
|
+
"h2",
|
|
22
|
+
"h3",
|
|
23
|
+
"h4",
|
|
24
|
+
"h5",
|
|
25
|
+
"h6",
|
|
26
|
+
"sub",
|
|
27
|
+
"sup",
|
|
28
|
+
"small",
|
|
29
|
+
"hr",
|
|
30
|
+
"a",
|
|
31
|
+
"img",
|
|
32
|
+
]);
|
|
33
|
+
const ALLOWED_ATTRS = new Set([
|
|
34
|
+
"class",
|
|
35
|
+
"style",
|
|
36
|
+
"colspan",
|
|
37
|
+
"rowspan",
|
|
38
|
+
"href",
|
|
39
|
+
"title",
|
|
40
|
+
"src",
|
|
41
|
+
"alt",
|
|
42
|
+
"width",
|
|
43
|
+
"height",
|
|
44
|
+
]);
|
|
45
|
+
/**
|
|
46
|
+
* Strips everything but the allowed tags and attributes from an HTML string.
|
|
47
|
+
* Disallowed elements are replaced by their text content; event handlers,
|
|
48
|
+
* unknown attributes and `javascript:` URLs are removed.
|
|
49
|
+
*/
|
|
50
|
+
export function sanitizeHtml(html) {
|
|
51
|
+
if (!html)
|
|
52
|
+
return "";
|
|
53
|
+
const container = document.createElement("div");
|
|
54
|
+
container.innerHTML = html;
|
|
55
|
+
sanitizeNode(container);
|
|
56
|
+
return container.innerHTML;
|
|
57
|
+
}
|
|
58
|
+
function sanitizeNode(node) {
|
|
59
|
+
for (const child of Array.from(node.childNodes)) {
|
|
60
|
+
if (child.nodeType !== Node.ELEMENT_NODE)
|
|
61
|
+
continue;
|
|
62
|
+
const el = child;
|
|
63
|
+
if (!ALLOWED_TAGS.has(el.tagName.toLowerCase())) {
|
|
64
|
+
node.replaceChild(document.createTextNode(el.textContent || ""), el);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
for (const attr of Array.from(el.attributes)) {
|
|
68
|
+
const name = attr.name.toLowerCase();
|
|
69
|
+
if (name.startsWith("on") || !ALLOWED_ATTRS.has(name)) {
|
|
70
|
+
el.removeAttribute(attr.name);
|
|
71
|
+
}
|
|
72
|
+
else if ((name === "href" || name === "src") && /^\s*javascript:/i.test(attr.value)) {
|
|
73
|
+
el.removeAttribute(attr.name);
|
|
74
|
+
}
|
|
75
|
+
else if (name === "style" && /expression|javascript/i.test(attr.value)) {
|
|
76
|
+
el.removeAttribute(attr.name);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
sanitizeNode(el);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
* without crashing the component.
|
|
7
7
|
*/
|
|
8
8
|
import { AggregationLevel, AxisLabelsMode, DataFormat, I18nMode, MeasureType, Scenarios, Sentiments, TableBarColumnWidth, TableCategoryWidth, TableType, } from "./constants";
|
|
9
|
+
import { isValidAttributeExpression } from "../components/bn-table/utils/model/TableAttribute";
|
|
9
10
|
import { DateDistance, DateLink } from "./DateStringFactory";
|
|
10
11
|
import { OrderColumn, OrderDirection } from "./model/Order";
|
|
12
|
+
import { resolveMeasure } from "./xy/VarianceMeasure";
|
|
11
13
|
/**
|
|
12
14
|
* Checks whether a value is blank, null, undefined, or the string `"null"`.
|
|
13
15
|
* The string `"null"` check handles serialized null values from HTML attributes,
|
|
@@ -57,6 +59,18 @@ export function validateVariancesList(value) {
|
|
|
57
59
|
});
|
|
58
60
|
return invalidScenarios;
|
|
59
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Validates a comma-separated list of bar column identifiers. Both base scenarios
|
|
64
|
+
* (e.g. `ac1`) and variances (e.g. `dac1_pp1_pos`) are valid entries.
|
|
65
|
+
* Returns items that fail validation.
|
|
66
|
+
*/
|
|
67
|
+
export function validateBarColumnsList(value) {
|
|
68
|
+
if (isBlankInput(value)) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
const invalidScenarios = value.split(",").filter((element) => !(element.toUpperCase().trim() in Scenarios));
|
|
72
|
+
return validateVariancesList(invalidScenarios.toString());
|
|
73
|
+
}
|
|
60
74
|
export function validateOrderList(value) {
|
|
61
75
|
if (isBlankInput(value)) {
|
|
62
76
|
return [];
|
|
@@ -199,6 +213,28 @@ export function validateThereOfJsonStr(value) {
|
|
|
199
213
|
}
|
|
200
214
|
return ["Invalid JSON structure"];
|
|
201
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* Validates the bn-table `attributes` prop: a JSON object mapping column labels
|
|
218
|
+
* to aggregate expressions like `set(_leiter)` or `sum(ac1)`.
|
|
219
|
+
* Returns the offending `label: expression` entries; empty array means valid.
|
|
220
|
+
*/
|
|
221
|
+
export function validateAttributesJsonStr(value) {
|
|
222
|
+
if (isBlankInput(value)) {
|
|
223
|
+
return [];
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
const jsonObject = JSON.parse(value);
|
|
227
|
+
if (jsonObject !== null && typeof jsonObject === "object" && !(jsonObject instanceof Array)) {
|
|
228
|
+
return Object.entries(jsonObject)
|
|
229
|
+
.filter(([, expression]) => typeof expression !== "string" || !isValidAttributeExpression(expression))
|
|
230
|
+
.map(([label, expression]) => `${label}: ${expression}`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
console.error("validateAttributesJsonStr: failed to parse JSON", err);
|
|
235
|
+
}
|
|
236
|
+
return ["Invalid JSON structure"];
|
|
237
|
+
}
|
|
202
238
|
export function validatePartOfJsonStr(value) {
|
|
203
239
|
if (isBlankInput(value)) {
|
|
204
240
|
return [];
|
|
@@ -373,3 +409,14 @@ export function validateTreeEdgesJson(value) {
|
|
|
373
409
|
return ["edges: invalid JSON structure"];
|
|
374
410
|
}
|
|
375
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* Checks whether a value is a valid XY chart measure token: a scenario
|
|
414
|
+
* column (`ac1`…`pl4`) or a variance token (`d…`/`dr…`, sentiment suffix
|
|
415
|
+
* optional — spec §4.4 of the scatter/bubble charts).
|
|
416
|
+
*/
|
|
417
|
+
export function isValidMeasureToken(value) {
|
|
418
|
+
if (isBlankInput(value)) {
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
return resolveMeasure(value) !== null;
|
|
422
|
+
}
|
|
@@ -14,16 +14,21 @@ import { runIfExisits } from "./utils";
|
|
|
14
14
|
*/
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
const withBodyObserver = (component, onUpdate) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
let hostElement;
|
|
18
|
+
// Coalesce bursts of mutations (e.g. devtools "Edit as HTML" fires childList +
|
|
19
|
+
// characterData in quick succession) and always read the *host* textContent so
|
|
20
|
+
// we deliver the complete body, not the individual text node that mutated.
|
|
21
|
+
const observer = new MutationObserver(() => {
|
|
22
|
+
var _a;
|
|
23
|
+
if (hostElement)
|
|
24
|
+
onUpdate((_a = hostElement.textContent) !== null && _a !== void 0 ? _a : "");
|
|
21
25
|
});
|
|
22
26
|
const connectedCallback = component["connectedCallback"];
|
|
23
27
|
component["connectedCallback"] = () => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
var _a;
|
|
29
|
+
hostElement = getElement(component);
|
|
30
|
+
observer.observe(hostElement, { childList: true, subtree: true, characterData: true });
|
|
31
|
+
onUpdate((_a = hostElement.textContent) !== null && _a !== void 0 ? _a : "");
|
|
27
32
|
runIfExisits(connectedCallback, component);
|
|
28
33
|
};
|
|
29
34
|
const disconnectedCallback = component["disconnectedCallback"];
|
|
@@ -27,11 +27,9 @@ const withComponentStyle = (component) => {
|
|
|
27
27
|
let style;
|
|
28
28
|
const updateStyle = () => {
|
|
29
29
|
const state = stores.componentStyles.state;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
state[selectedStyle] || {},
|
|
34
|
-
]);
|
|
30
|
+
// Arrays overwrite instead of concatenating: ordered color lists like
|
|
31
|
+
// seriesColors/stackColors must be replaced wholesale by an override.
|
|
32
|
+
style = merge([state["_system"] || {}, state["_default"] || {}, state[selectedStyle] || {}], { arrayMergeType: "overwrite" });
|
|
35
33
|
};
|
|
36
34
|
const observer = new MutationObserver((mutations) => {
|
|
37
35
|
mutations.forEach((mutation) => {
|