@bino-bi/bn-template-engine 1.0.0-next.26 → 1.0.0-next.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-5075771a.entry.js +1 -0
- package/dist/bn-template-engine/p-5d516435.entry.js +1 -0
- package/dist/bn-template-engine/p-5e90e728.entry.js +1 -0
- package/dist/bn-template-engine/p-9ef7e132.entry.js +1 -0
- package/dist/bn-template-engine/{p-f06c3703.entry.js → p-9f7a1980.entry.js} +1 -1
- package/dist/bn-template-engine/p-BeXgxHkW.js +1 -0
- package/dist/bn-template-engine/p-CH0bpt_k.js +1 -0
- package/dist/bn-template-engine/p-ClruFZD_.js +1 -0
- package/dist/bn-template-engine/{p-CTrNbSXN.js → p-DFmSrSnf.js} +1 -1
- package/dist/bn-template-engine/{p-BcLsoDrW.js → p-DI3efDSV.js} +1 -1
- package/dist/bn-template-engine/p-DXLTTILG.js +1 -0
- package/dist/bn-template-engine/p-DtP4jqG5.js +1 -0
- package/dist/bn-template-engine/p-a8281b71.entry.js +1 -0
- package/dist/bn-template-engine/p-b31277e7.entry.js +1 -0
- package/dist/bn-template-engine/p-b396ac84.entry.js +1 -0
- package/dist/cjs/{bn-asset_21.cjs.entry.js → bn-asset_28.cjs.entry.js} +21358 -6528
- package/dist/cjs/bn-grid.cjs.entry.js +4 -6
- package/dist/cjs/bn-image.cjs.entry.js +3 -5
- package/dist/cjs/bn-internationalization.cjs.entry.js +17 -6
- package/dist/cjs/bn-ruleset.cjs.entry.js +5 -5
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +2 -2
- package/dist/cjs/bn-text.cjs.entry.js +115 -43
- package/dist/cjs/{context-protocol-DcTEh1rq.js → context-protocol-C0rKepqu.js} +108 -22
- package/dist/cjs/{diagnostics-CTgbq_Gc.js → diagnostics-Cq-qDtXq.js} +1 -1
- package/dist/cjs/editor-companion.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/queryError-BZjnIW_w.js +16 -0
- package/dist/cjs/{scaling-Dsb5_NXy.js → sanitizeHtml-Yx1xn6i_.js} +467 -287
- package/dist/cjs/{withBodyObserver-DJO98AJ-.js → withBodyObserver-CaPUjuC5.js} +1 -1
- package/dist/cjs/withHasError-qGW_yqIv.js +426 -0
- package/dist/cjs/{withStyled-D0jLwCib.js → withStyled-vSfogp9J.js} +543 -42
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +37 -0
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +53 -28
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +37 -5
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +16 -7
- package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +67 -30
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +37 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +49 -29
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +37 -5
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +17 -7
- package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +34 -18
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +2 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +1 -1
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +37 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +52 -27
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +37 -5
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +16 -7
- package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +52 -18
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.css +37 -5
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +74 -44
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +60 -19
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +218 -262
- package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +1 -1
- package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +11 -4
- package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +16 -25
- package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +3 -2
- package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +2 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.css +37 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +122 -52
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.css +37 -0
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +60 -19
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +245 -250
- package/dist/collection/components/bn-chart-time/utils/elements/AreaFill.js +1 -1
- package/dist/collection/components/bn-chart-time/utils/elements/Label.js +1 -1
- package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +1 -1
- package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +11 -4
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +22 -34
- package/dist/collection/components/bn-chart-time/utils/helper/LabelCollisionManager.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +4 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -2
- package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +2 -0
- package/dist/collection/components/bn-component-style/bn-component-style.js +14 -2
- package/dist/collection/components/bn-context/bn-context.js +92 -22
- package/dist/collection/components/bn-dataset/bn-dataset.js +246 -90
- package/dist/collection/components/bn-datasource/bn-datasource.js +169 -77
- package/dist/collection/components/bn-footer/bn-footer.js +6 -6
- package/dist/collection/components/bn-internationalization/bn-internationalization.js +14 -3
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +25 -74
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +59 -71
- package/dist/collection/components/bn-message/bn-message.js +2 -2
- package/dist/collection/components/bn-page/bn-page.css +0 -240
- package/dist/collection/components/bn-page/bn-page.js +14 -4
- package/dist/collection/components/bn-page/pageFormats.js +69 -0
- package/dist/collection/components/bn-ruleset/bn-ruleset.js +2 -2
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +7 -7
- package/dist/collection/components/bn-table/bn-table.css +38 -1
- package/dist/collection/components/bn-table/bn-table.js +96 -59
- package/dist/collection/components/bn-table/ibcs-table.css +39 -1
- package/dist/collection/components/bn-table/ibcs-table.js +89 -30
- package/dist/collection/components/bn-table/utils/Table.js +12 -13
- package/dist/collection/components/bn-table/utils/elements/Cell.js +9 -3
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +38 -34
- package/dist/collection/components/bn-table/utils/elements/TableRow.js +2 -1
- package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +4 -4
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +17 -4
- package/dist/collection/components/bn-table/utils/helper/DataQuery.js +128 -98
- package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +6 -20
- package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +9 -2
- package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +2 -2
- package/dist/collection/components/bn-table/utils/model/TableAttribute.js +2 -2
- package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +3 -2
- package/dist/collection/components/bn-template/bn-template.js +1 -1
- package/dist/collection/components/bn-text/bn-text.js +36 -39
- package/dist/collection/components/bn-text/utils/template.js +79 -0
- package/dist/collection/components/bn-title/bn-title.js +10 -4
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +3 -1
- package/dist/collection/components/bn-tree/bn-tree.js +119 -23
- package/dist/collection/components/bn-tree/utils/EdgeRenderer.js +59 -51
- package/dist/collection/components/bn-tree/utils/TreeLayout.js +30 -5
- package/dist/collection/components/bn-tree/utils/TreeParser.js +35 -0
- package/dist/collection/components/editor-companion/editor-companion.js +1 -1
- package/dist/collection/context/context-protocol.js +1 -1
- package/dist/collection/context/scopedDb.js +47 -4
- package/dist/collection/stores/componentStyles.js +39 -0
- package/dist/collection/stores/internationalization.js +15 -13
- package/dist/collection/utils/DateStringFactory.js +17 -15
- package/dist/collection/utils/autoFit.js +2 -2
- package/dist/collection/utils/componentRegister.js +60 -16
- package/dist/collection/utils/constants.js +2 -2
- package/dist/collection/utils/dataAnalyzer.js +9 -12
- package/dist/collection/utils/emptyState.js +21 -0
- package/dist/collection/utils/formatter.js +29 -20
- package/dist/collection/utils/layoutObserver.js +1 -1
- package/dist/collection/utils/layoutState/generic.js +1 -1
- package/dist/collection/utils/layoutState/svgChartElements.js +2 -2
- package/dist/collection/utils/layoutTemplate.js +81 -0
- package/dist/collection/utils/measurementHost.js +2 -2
- package/dist/collection/utils/model/Order.js +1 -1
- package/dist/collection/utils/model/styles/SVGStyle.js +12 -4
- package/dist/collection/utils/parentDimensions.js +35 -3
- package/dist/collection/utils/queryError.js +11 -0
- package/dist/collection/utils/relativeVariance.js +14 -0
- package/dist/collection/utils/sanitizeHtml.js +30 -16
- package/dist/collection/utils/scaling.js +2 -2
- package/dist/collection/utils/stackColors.js +27 -5
- package/dist/collection/utils/stackLayout.js +71 -0
- package/dist/collection/utils/styled/attributes.js +16 -3
- package/dist/collection/utils/styled/style-sheet.js +1 -1
- package/dist/collection/utils/styled/withStyled.js +1 -1
- package/dist/collection/utils/testing/fakeGroup.js +21 -0
- package/dist/collection/utils/testing/mutationObserver.js +44 -0
- package/dist/collection/utils/testing/structureChart.js +26 -0
- package/dist/collection/utils/testing/timeChart.js +28 -0
- package/dist/collection/utils/validate.js +1 -1
- package/dist/collection/utils/withComponentStatus.js +137 -12
- package/dist/collection/utils/withInheritedProps.js +113 -64
- package/dist/collection/utils/withRuleSet.js +10 -7
- package/dist/collection/utils/withTranslation.js +3 -3
- package/dist/collection/utils/xy/FacetGrid.js +1 -1
- package/dist/collection/utils/xy/IsoCurves.js +1 -1
- package/dist/collection/utils/xy/NumericScale.js +46 -15
- package/dist/collection/utils/xy/PointLabeler.js +2 -2
- package/dist/collection/utils/xy/RadiusScale.js +2 -2
- package/dist/collection/utils/xy/SeriesPalette.js +3 -3
- package/dist/collection/utils/xy/VarianceMeasure.js +22 -4
- package/dist/collection/utils/xy/XYFrame.js +4 -4
- package/dist/collection/utils/xy/XYLegend.js +5 -7
- package/dist/collection/utils/xy/checkXYOverflow.js +32 -0
- package/dist/collection/utils/xy/formatXYValue.js +13 -0
- package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
- package/dist/collection/utils/xy/model/XYChartStyle.js +2 -0
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/LabelCollisionManager.js +1 -1
- package/dist/components/NumericScale.js +1 -1
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGStyle.js +1 -0
- package/dist/components/TableAttribute.js +1 -0
- package/dist/components/VarianceMeasure.js +1 -1
- package/dist/components/XYChartDataRow.js +1 -1
- package/dist/components/bn-asset.js +1 -1
- package/dist/components/bn-body2.js +1 -1
- package/dist/components/bn-card2.js +1 -1
- package/dist/components/bn-chart-bubble.js +1 -1
- package/dist/components/bn-chart-bullet.js +1 -1
- package/dist/components/bn-chart-scatter.js +1 -1
- 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.js +1 -1
- package/dist/components/bn-scaling-group.js +1 -1
- 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/checkXYOverflow.js +1 -0
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/emptyState.js +1 -0
- package/dist/components/formatter.js +1 -1
- package/dist/components/ibcs-chart-bubble2.js +1 -1
- package/dist/components/ibcs-chart-bullet2.js +1 -1
- package/dist/components/ibcs-chart-scatter2.js +1 -1
- 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/layoutTemplate.js +1 -0
- package/dist/components/pageFormats.js +1 -0
- package/dist/components/parentDimensions.js +1 -0
- package/dist/components/queryError.js +1 -0
- package/dist/components/relativeVariance.js +1 -0
- package/dist/components/sanitizeHtml.js +1 -1
- package/dist/components/stackColors.js +1 -1
- package/dist/components/stackLayout.js +1 -0
- package/dist/components/svg.esm.js +1 -0
- package/dist/components/validate.js +1 -1
- package/dist/components/withBodyObserver.js +1 -1
- package/dist/components/withComponentStatus.js +1 -0
- package/dist/components/withComponentStyle.js +1 -1
- package/dist/components/withDataset.js +1 -1
- package/dist/components/withHasError.js +1 -1
- package/dist/components/withRuleSet.js +1 -1
- package/dist/components/withScalingGroup.js +1 -1
- package/dist/components/withStyled.js +1 -1
- package/dist/components/withTranslation.js +1 -1
- package/dist/esm/{bn-asset_21.entry.js → bn-asset_28.entry.js} +20948 -6125
- package/dist/esm/bn-grid.entry.js +4 -6
- package/dist/esm/bn-image.entry.js +3 -5
- package/dist/esm/bn-internationalization.entry.js +17 -6
- package/dist/esm/bn-ruleset.entry.js +5 -5
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +2 -2
- package/dist/esm/bn-text.entry.js +111 -39
- package/dist/esm/{context-protocol-B-vdGKeG.js → context-protocol-CdTp19uA.js} +106 -22
- package/dist/esm/{diagnostics-CiquIw8B.js → diagnostics-vw6TKMiT.js} +1 -1
- package/dist/esm/editor-companion.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/queryError-ClruFZD_.js +13 -0
- package/dist/esm/{scaling-Dggyeqts.js → sanitizeHtml-C5bFtARM.js} +464 -287
- package/dist/esm/{withBodyObserver-Cb9ZC5_J.js → withBodyObserver-DD_-r04o.js} +1 -1
- package/dist/esm/withHasError-73WV2SP5.js +422 -0
- package/dist/esm/{withStyled-DoNsbwS3.js → withStyled-BDEyKd_H.js} +513 -27
- package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +8 -4
- package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +2 -1
- package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +14 -2
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +12 -11
- package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +2 -1
- package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +8 -5
- package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +2 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +1 -1
- package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +8 -4
- package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +2 -1
- package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +11 -1
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +13 -12
- package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +8 -1
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +29 -6
- package/dist/types/components/bn-chart-structure/utils/elements/StackedBar.d.ts +4 -3
- package/dist/types/components/bn-chart-structure/utils/model/DataPoint.d.ts +3 -2
- package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +2 -1
- package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +2 -0
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +19 -15
- package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +8 -1
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +63 -5
- package/dist/types/components/bn-chart-time/utils/elements/AreaFill.d.ts +1 -1
- package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +9 -8
- package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +3 -2
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +3 -2
- package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +2 -0
- package/dist/types/components/bn-context/bn-context.d.ts +15 -3
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +41 -20
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +34 -18
- package/dist/types/components/bn-footer/bn-footer.d.ts +2 -2
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +3 -10
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +13 -6
- package/dist/types/components/bn-message/bn-message.d.ts +2 -1
- package/dist/types/components/bn-page/bn-page.d.ts +2 -1
- package/dist/types/components/bn-page/pageFormats.d.ts +40 -0
- package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +2 -2
- package/dist/types/components/bn-table/bn-table.d.ts +11 -10
- package/dist/types/components/bn-table/ibcs-table.d.ts +8 -5
- package/dist/types/components/bn-table/utils/Table.d.ts +3 -1
- package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -2
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +6 -4
- package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +1 -1
- package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +2 -0
- package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +14 -5
- package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +2 -2
- package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +6 -1
- package/dist/types/components/bn-table/utils/helper/barColumnGeometry.d.ts +2 -2
- package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +2 -0
- package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +2 -1
- package/dist/types/components/bn-text/bn-text.d.ts +20 -13
- package/dist/types/components/bn-text/utils/template.d.ts +10 -0
- package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +1 -0
- package/dist/types/components/bn-tree/bn-tree.d.ts +8 -1
- package/dist/types/components/bn-tree/utils/EdgeRenderer.d.ts +18 -5
- package/dist/types/components/bn-tree/utils/TreeLayout.d.ts +5 -0
- package/dist/types/components.d.ts +226 -184
- package/dist/types/context/scopedDb.d.ts +20 -0
- package/dist/types/stores/componentStyles.d.ts +6 -0
- package/dist/types/utils/DateStringFactory.d.ts +3 -2
- package/dist/types/utils/autoFit.d.ts +2 -2
- package/dist/types/utils/componentRegister.d.ts +21 -5
- package/dist/types/utils/constants.d.ts +2 -2
- package/dist/types/utils/dataAnalyzer.d.ts +1 -1
- package/dist/types/utils/emptyState.d.ts +10 -0
- package/dist/types/utils/formatter.d.ts +7 -9
- package/dist/types/utils/layoutState/generic.d.ts +1 -1
- package/dist/types/utils/layoutState/svgChartElements.d.ts +2 -2
- package/dist/types/utils/layoutTemplate.d.ts +16 -0
- package/dist/types/utils/model/ChartStyles.d.ts +1 -1
- package/dist/types/utils/model/DataQueryResultRow.d.ts +2 -2
- package/dist/types/utils/model/Order.d.ts +1 -1
- package/dist/types/utils/model/styles/SVGStyle.d.ts +5 -1
- package/dist/types/utils/parentDimensions.d.ts +9 -0
- package/dist/types/utils/queryError.d.ts +5 -0
- package/dist/types/utils/relativeVariance.d.ts +9 -0
- package/dist/types/utils/sanitizeHtml.d.ts +2 -2
- package/dist/types/utils/scaling.d.ts +1 -1
- package/dist/types/utils/stackColors.d.ts +3 -2
- package/dist/types/utils/stackLayout.d.ts +49 -0
- package/dist/types/utils/testing/fakeGroup.d.ts +8 -0
- package/dist/types/utils/testing/mutationObserver.d.ts +5 -0
- package/dist/types/utils/testing/structureChart.d.ts +5 -0
- package/dist/types/utils/testing/timeChart.d.ts +5 -0
- package/dist/types/utils/validate.d.ts +1 -1
- package/dist/types/utils/withComponentStatus.d.ts +11 -3
- package/dist/types/utils/withInheritedProps.d.ts +42 -15
- package/dist/types/utils/withRuleSet.d.ts +2 -1
- package/dist/types/utils/withTranslation.d.ts +2 -2
- package/dist/types/utils/xy/FacetGrid.d.ts +1 -1
- package/dist/types/utils/xy/IsoCurves.d.ts +1 -1
- package/dist/types/utils/xy/NumericScale.d.ts +9 -4
- package/dist/types/utils/xy/PointLabeler.d.ts +2 -2
- package/dist/types/utils/xy/RadiusScale.d.ts +2 -2
- package/dist/types/utils/xy/SeriesPalette.d.ts +3 -3
- package/dist/types/utils/xy/VarianceMeasure.d.ts +10 -2
- package/dist/types/utils/xy/XYFrame.d.ts +4 -1
- package/dist/types/utils/xy/XYLegend.d.ts +3 -1
- package/dist/types/utils/xy/checkXYOverflow.d.ts +8 -0
- package/dist/types/utils/xy/formatXYValue.d.ts +7 -0
- package/dist/types/utils/xy/model/AxisConfig.d.ts +1 -1
- package/dist/types/utils/xy/model/XYChartStyle.d.ts +2 -0
- package/package.json +4 -2
- package/readme.md +11 -11
- package/dist/bn-template-engine/p-03304284.entry.js +0 -1
- package/dist/bn-template-engine/p-0fb02c57.entry.js +0 -1
- package/dist/bn-template-engine/p-4419db8f.entry.js +0 -1
- package/dist/bn-template-engine/p-45508f1b.entry.js +0 -1
- package/dist/bn-template-engine/p-461fdffa.entry.js +0 -1
- package/dist/bn-template-engine/p-5d7a3a77.entry.js +0 -1
- package/dist/bn-template-engine/p-62cc95b7.entry.js +0 -1
- package/dist/bn-template-engine/p-686d8e44.entry.js +0 -1
- package/dist/bn-template-engine/p-829212c3.entry.js +0 -1
- package/dist/bn-template-engine/p-B5Jd_eCX.js +0 -1
- package/dist/bn-template-engine/p-BA48JiHe.js +0 -1
- package/dist/bn-template-engine/p-BbmobTg0.js +0 -1
- package/dist/bn-template-engine/p-BcaI745G.js +0 -1
- package/dist/bn-template-engine/p-CG_Bcm6V.js +0 -1
- package/dist/bn-template-engine/p-CWWWM-XC.js +0 -1
- package/dist/bn-template-engine/p-CsJ84YRk.js +0 -1
- package/dist/bn-template-engine/p-D5e8I9Qe.js +0 -1
- package/dist/bn-template-engine/p-DVrDYxlh.js +0 -1
- package/dist/bn-template-engine/p-DjPXefnq.js +0 -1
- package/dist/bn-template-engine/p-DsTzlzxQ.js +0 -1
- package/dist/bn-template-engine/p-DtLI_CzV.js +0 -1
- package/dist/bn-template-engine/p-EtT29btN.js +0 -1
- package/dist/bn-template-engine/p-TuLpbB5O.js +0 -1
- package/dist/bn-template-engine/p-a5867a4c.entry.js +0 -1
- package/dist/bn-template-engine/p-b27009eb.entry.js +0 -1
- package/dist/bn-template-engine/p-bfa87b07.entry.js +0 -1
- package/dist/bn-template-engine/p-ceb80db3.entry.js +0 -1
- package/dist/bn-template-engine/p-fcfbb329.entry.js +0 -1
- package/dist/bn-template-engine/p-qRZrT-U3.js +0 -1
- package/dist/cjs/AxisConfig-DwiNUyYG.js +0 -233
- package/dist/cjs/LabelCollisionManager-Bv-xkeXw.js +0 -415
- package/dist/cjs/NumericScale-BAyYXpKL.js +0 -107
- package/dist/cjs/Order-2wRydarc.js +0 -87
- package/dist/cjs/SVGStyle-DoxylrEQ.js +0 -8219
- package/dist/cjs/SVGVariancesStyleGroup-CiI4GeWe.js +0 -50
- package/dist/cjs/VarianceMeasure-CQlSRzlp.js +0 -372
- package/dist/cjs/XYChartDataRow-C2FdL58s.js +0 -829
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +0 -792
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +0 -805
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +0 -678
- package/dist/cjs/bn-tree.cjs.entry.js +0 -1042
- package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +0 -624
- package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +0 -673
- package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +0 -667
- package/dist/cjs/sanitizeHtml-LuZr1IMd.js +0 -85
- package/dist/cjs/svgChartElements-tDA43aYj.js +0 -400
- package/dist/cjs/withHasError-BdDmiOXM.js +0 -258
- package/dist/cjs/withScalingGroup-CFIc5-6s.js +0 -73
- package/dist/components/autoFit.js +0 -1
- package/dist/components/main.js +0 -1
- package/dist/components/utils.js +0 -1
- package/dist/esm/AxisConfig-KqzWQbML.js +0 -224
- package/dist/esm/LabelCollisionManager-585bQMtP.js +0 -407
- package/dist/esm/NumericScale-DsTzlzxQ.js +0 -105
- package/dist/esm/Order-DZVWjEL_.js +0 -83
- package/dist/esm/SVGStyle-OrPkzjcb.js +0 -8209
- package/dist/esm/SVGVariancesStyleGroup-DO5QJfRQ.js +0 -48
- package/dist/esm/VarianceMeasure-DDjChp8C.js +0 -364
- package/dist/esm/XYChartDataRow-Dn83Tqh9.js +0 -820
- package/dist/esm/bn-chart-bubble.entry.js +0 -790
- package/dist/esm/bn-chart-bullet.entry.js +0 -803
- package/dist/esm/bn-chart-scatter.entry.js +0 -676
- package/dist/esm/bn-tree.entry.js +0 -1040
- package/dist/esm/ibcs-chart-bubble.entry.js +0 -622
- package/dist/esm/ibcs-chart-bullet.entry.js +0 -671
- package/dist/esm/ibcs-chart-scatter.entry.js +0 -665
- package/dist/esm/sanitizeHtml-BA48JiHe.js +0 -83
- package/dist/esm/svgChartElements-B3YClivG.js +0 -395
- package/dist/esm/withHasError-Bh1Viz52.js +0 -254
- package/dist/esm/withScalingGroup-DNBSqRC0.js +0 -71
|
@@ -1,803 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, d as writeTask, f as forceUpdate, h, H as Host, g as getElement } from './index-C5UYpZUU.js';
|
|
2
|
-
import { o as originsFor } from './diagnostics-CiquIw8B.js';
|
|
3
|
-
import { w as withRuleSet, o as observeParentResize, c as collectXYFacadeState } from './svgChartElements-B3YClivG.js';
|
|
4
|
-
import { a as globalLabelKeys } from './context-protocol-B-vdGKeG.js';
|
|
5
|
-
import { C as CompareUtil, r as resolveMeasure, A as AggregationLevel } from './VarianceMeasure-DDjChp8C.js';
|
|
6
|
-
import { O as OrderDirection, a as Order, b as OrderColumn } from './Order-DZVWjEL_.js';
|
|
7
|
-
import { w as withDataset, a as withTranslation, g as getParentDimensions, p as parseScaling } from './scaling-Dggyeqts.js';
|
|
8
|
-
import { v as validateOrderList, i as isBlankInput, d as isValidDirection, a as isValidInteger, w as withStyled, b as withComponentStyle } from './withStyled-DoNsbwS3.js';
|
|
9
|
-
import { w as withComponentStatus, a as withHasError } from './withHasError-Bh1Viz52.js';
|
|
10
|
-
import { p as parseSpec } from './AxisConfig-KqzWQbML.js';
|
|
11
|
-
import './index.js';
|
|
12
|
-
|
|
13
|
-
const MEASURE_KEYS = ["measure", "label", "unit"];
|
|
14
|
-
function toBulletMeasureConfig(data) {
|
|
15
|
-
const invalidFields = [];
|
|
16
|
-
const measure = readString(data, "measure", invalidFields);
|
|
17
|
-
if (measure === undefined || measure.trim() === "") {
|
|
18
|
-
invalidFields.push("measure");
|
|
19
|
-
return { config: null, unknownKeys: collectUnknownKeys(data, MEASURE_KEYS), invalidFields };
|
|
20
|
-
}
|
|
21
|
-
const config = { measure: measure.trim() };
|
|
22
|
-
config.label = readString(data, "label", invalidFields);
|
|
23
|
-
config.unit = readString(data, "unit", invalidFields);
|
|
24
|
-
return { config, unknownKeys: collectUnknownKeys(data, MEASURE_KEYS), invalidFields };
|
|
25
|
-
}
|
|
26
|
-
const LABEL_KEYS = ["show", "decimals"];
|
|
27
|
-
function toBulletLabelConfig(data, defaults) {
|
|
28
|
-
const invalidFields = [];
|
|
29
|
-
const config = { show: defaults.show, decimals: defaults.decimals };
|
|
30
|
-
if (CompareUtil.isExisting(data.show)) {
|
|
31
|
-
if (data.show === "auto" || data.show === "none") {
|
|
32
|
-
config.show = data.show;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
invalidFields.push("show");
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (CompareUtil.isExisting(data.decimals)) {
|
|
39
|
-
if (CompareUtil.isNumber(data.decimals) && data.decimals >= 0 && data.decimals <= 4) {
|
|
40
|
-
config.decimals = Math.floor(data.decimals);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
invalidFields.push("decimals");
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return { config, unknownKeys: collectUnknownKeys(data, LABEL_KEYS), invalidFields };
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Parses the raw `ranges` attribute value. A blank value yields no ranges
|
|
50
|
-
* without error. Anything else must be a JSON array of positive numbers —
|
|
51
|
-
* ascending fractions of the target, e.g. `[0.6, 0.9]`. `parseSpec` cannot
|
|
52
|
-
* be used here because it rejects top-level JSON arrays. Unsorted input is
|
|
53
|
-
* sorted and more than two entries are truncated; both repairs are reported
|
|
54
|
-
* as issues.
|
|
55
|
-
*/
|
|
56
|
-
function parseRanges(raw) {
|
|
57
|
-
var _a;
|
|
58
|
-
const trimmed = (_a = raw === null || raw === void 0 ? void 0 : raw.trim()) !== null && _a !== void 0 ? _a : "";
|
|
59
|
-
if (trimmed === "" || trimmed === "null") {
|
|
60
|
-
return { ranges: [], parseError: false, issues: [] };
|
|
61
|
-
}
|
|
62
|
-
let parsed;
|
|
63
|
-
try {
|
|
64
|
-
parsed = JSON.parse(trimmed);
|
|
65
|
-
}
|
|
66
|
-
catch (_b) {
|
|
67
|
-
return { ranges: [], parseError: true, issues: [] };
|
|
68
|
-
}
|
|
69
|
-
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
70
|
-
return { ranges: [], parseError: true, issues: [] };
|
|
71
|
-
}
|
|
72
|
-
if (!parsed.every((entry) => CompareUtil.isNumber(entry) && isFinite(entry) && entry > 0)) {
|
|
73
|
-
return { ranges: [], parseError: true, issues: [] };
|
|
74
|
-
}
|
|
75
|
-
const issues = [];
|
|
76
|
-
let ranges = parsed;
|
|
77
|
-
const sorted = [...ranges].sort((a, b) => a - b);
|
|
78
|
-
if (sorted.some((value, index) => value !== ranges[index])) {
|
|
79
|
-
issues.push("not ascending, sorted");
|
|
80
|
-
}
|
|
81
|
-
ranges = sorted;
|
|
82
|
-
if (ranges.length > 2) {
|
|
83
|
-
issues.push(`${ranges.length} entries, first 2 kept`);
|
|
84
|
-
ranges = ranges.slice(0, 2);
|
|
85
|
-
}
|
|
86
|
-
return { ranges, parseError: false, issues };
|
|
87
|
-
}
|
|
88
|
-
function collectUnknownKeys(data, knownKeys) {
|
|
89
|
-
return Object.keys(data).filter((key) => !knownKeys.includes(key));
|
|
90
|
-
}
|
|
91
|
-
function readString(data, key, invalid) {
|
|
92
|
-
if (!CompareUtil.isExisting(data[key])) {
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
if (CompareUtil.isString(data[key])) {
|
|
96
|
-
return data[key];
|
|
97
|
-
}
|
|
98
|
-
invalid.push(key);
|
|
99
|
-
return undefined;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const bnChartBulletCss = () => `:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.container{display:flex;flex-direction:column}`;
|
|
103
|
-
|
|
104
|
-
/** Auto-detection preference for the target scenario. */
|
|
105
|
-
const TARGET_SLOT_PREFERENCE = ["pl1", "pp1", "fc1"];
|
|
106
|
-
const ChartBullet = class {
|
|
107
|
-
validateActual(newValue) {
|
|
108
|
-
this.validateMeasureSpec("actual", newValue);
|
|
109
|
-
}
|
|
110
|
-
validateTarget(newValue) {
|
|
111
|
-
this.validateMeasureSpec("target", newValue);
|
|
112
|
-
}
|
|
113
|
-
validateRanges(newValue) {
|
|
114
|
-
const errId = "ERR_bullet_json_ranges";
|
|
115
|
-
const warnId = "WARN_bullet_ranges";
|
|
116
|
-
const parsed = parseRanges(newValue);
|
|
117
|
-
if (parsed.parseError) {
|
|
118
|
-
this.setBlockingError(errId, this.t(".bullet-prop-json", { prop: "ranges" }));
|
|
119
|
-
this.errors.remove(warnId);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
this.setBlockingError(errId, null);
|
|
123
|
-
if (parsed.issues.length > 0) {
|
|
124
|
-
this.errors.addOrReplace({
|
|
125
|
-
id: warnId,
|
|
126
|
-
type: "warning",
|
|
127
|
-
message: this.t(".bullet-ranges-invalid", { detail: parsed.issues.join("; ") }),
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
this.errors.remove(warnId);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
validateNormalize(newValue) {
|
|
135
|
-
this.validateEnum("normalize", "ERR_normalize", newValue, ["target", "none"], "target");
|
|
136
|
-
}
|
|
137
|
-
validateVariances(newValue) {
|
|
138
|
-
this.validateEnum("variances", "ERR_variances", newValue, ["auto", "none"], "auto");
|
|
139
|
-
}
|
|
140
|
-
validateLevel(newValue) {
|
|
141
|
-
this.validateEnum("level", "ERR_level", newValue, ["auto", "rowgroup", "category", "subcategory"], "auto");
|
|
142
|
-
}
|
|
143
|
-
validateOrder(newValue) {
|
|
144
|
-
const errId = "ERR_order";
|
|
145
|
-
const invalid = validateOrderList(newValue).filter((entry) => entry !== "");
|
|
146
|
-
if (invalid.length === 0) {
|
|
147
|
-
this.errors.remove(errId);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
this.errors.addOrReplace({
|
|
151
|
-
id: errId,
|
|
152
|
-
type: "warning",
|
|
153
|
-
message: `order: invalid value(s) '${invalid.join(", ")}'; using the dataset order.`,
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
validateOrderDirection(newValue) {
|
|
158
|
-
const errId = "ERR_orderDirection";
|
|
159
|
-
if (isBlankInput(newValue) || isValidDirection(newValue)) {
|
|
160
|
-
this.errors.remove(errId);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
this.errors.addOrReplace({
|
|
164
|
-
id: errId,
|
|
165
|
-
type: "warning",
|
|
166
|
-
message: `order-direction: invalid value '${newValue}' — expected asc/desc; using asc.`,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
validateLimit(newValue) {
|
|
171
|
-
const errId = "ERR_limit";
|
|
172
|
-
if (isValidInteger(newValue) && Number(newValue) >= 0) {
|
|
173
|
-
this.errors.remove(errId);
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
this.errors.addOrReplace({
|
|
177
|
-
id: errId,
|
|
178
|
-
type: "warning",
|
|
179
|
-
message: `limit: invalid value '${newValue}' — expected a non-negative integer; using 0.`,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
validateLabels(newValue) {
|
|
184
|
-
const jsonId = "ERR_bullet_json_labels";
|
|
185
|
-
const fieldsId = "WARN_bullet_fields_labels";
|
|
186
|
-
const { data, parseError } = parseSpec(newValue, null);
|
|
187
|
-
if (parseError) {
|
|
188
|
-
this.setBlockingError(jsonId, this.t(".bullet-prop-json", { prop: "labels" }));
|
|
189
|
-
this.errors.remove(fieldsId);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
this.setBlockingError(jsonId, null);
|
|
193
|
-
if (data === null) {
|
|
194
|
-
this.errors.remove(fieldsId);
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
this.reportSpecIssues(fieldsId, "labels", toBulletLabelConfig(data, this.labelDefaults()));
|
|
198
|
-
}
|
|
199
|
-
validateScale(newValue) {
|
|
200
|
-
const errId = "ERR_scale";
|
|
201
|
-
if (isBlankInput(newValue)) {
|
|
202
|
-
this.errors.remove(errId);
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
const { mode, factor } = parseScaling(newValue);
|
|
206
|
-
if (mode === "factor" && (factor === undefined || factor <= 0)) {
|
|
207
|
-
this.errors.addOrReplace({
|
|
208
|
-
id: errId,
|
|
209
|
-
type: "warning",
|
|
210
|
-
message: `scale: invalid value '${newValue}' — expected none/auto or a positive number.`,
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
this.errors.remove(errId);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
constructor(hostRef) {
|
|
218
|
-
registerInstance(this, hostRef);
|
|
219
|
-
/** Active dataset name (the last subscribed dataset to fire `onUpdate`). */
|
|
220
|
-
this.datasetName = "";
|
|
221
|
-
/** Bumped on every data update so Stencil re-renders even when the name is unchanged. */
|
|
222
|
-
this.dataVersion = 0;
|
|
223
|
-
this.datasetMeta = null;
|
|
224
|
-
this.appliedScaleFactor = 1;
|
|
225
|
-
this.layoutObserver = null;
|
|
226
|
-
/** Ids of currently-active blocking errors — the chart renders empty while any is set. */
|
|
227
|
-
this.activeErrors = new Set();
|
|
228
|
-
/**
|
|
229
|
-
* Custom chart title
|
|
230
|
-
*/
|
|
231
|
-
this.chartTitle = "";
|
|
232
|
-
/**
|
|
233
|
-
* AlaSQL WHERE clause fragment injected into the data query to filter
|
|
234
|
-
* rows before rendering (e.g. `"rowGroup = 'Revenue'"`).
|
|
235
|
-
*/
|
|
236
|
-
this.filter = "";
|
|
237
|
-
/**
|
|
238
|
-
* Actual-value measure. JSON object or a bare scenario slot as shorthand:
|
|
239
|
-
* `{"measure":"ac1","label":"Revenue","unit":"EUR k"}`. Only plain
|
|
240
|
-
* scenario slots (`ac1`…`pl4`) are allowed — variance tokens are not.
|
|
241
|
-
* Empty or `"auto"` auto-detects (`ac1`, else the first available
|
|
242
|
-
* scenario).
|
|
243
|
-
*/
|
|
244
|
-
this.actual = "";
|
|
245
|
-
/**
|
|
246
|
-
* Target measure — same shape as `actual`. Empty or `"auto"` auto-detects
|
|
247
|
-
* (`pl1` > `pp1` > `fc1`); without any target scenario the chart renders
|
|
248
|
-
* actual bars only.
|
|
249
|
-
*/
|
|
250
|
-
this.target = "";
|
|
251
|
-
/**
|
|
252
|
-
* Qualitative range bands as a JSON array of ascending fractions of the
|
|
253
|
-
* target, at most two — e.g. `[0.6, 0.9]` (IBCS rejects a third band of
|
|
254
|
-
* arbitrary length). Classic mode only; ignored while `normalize` is
|
|
255
|
-
* `"target"`.
|
|
256
|
-
*/
|
|
257
|
-
this.ranges = "";
|
|
258
|
-
/**
|
|
259
|
-
* Target normalization: `target` (default — rows share an aligned target
|
|
260
|
-
* position, the IBCS-comparable form) or `none` (classic per-row scales
|
|
261
|
-
* with tick strips).
|
|
262
|
-
*/
|
|
263
|
-
this.normalize = "target";
|
|
264
|
-
/**
|
|
265
|
-
* Variance bars between actual and target: `auto` (default — drawn in
|
|
266
|
-
* normalized mode, favorable/unfavorable in the IBCS variance colors) or
|
|
267
|
-
* `none`.
|
|
268
|
-
*/
|
|
269
|
-
this.variances = "auto";
|
|
270
|
-
/**
|
|
271
|
-
* KPI row level: `auto` (deepest populated level from the dataset meta),
|
|
272
|
-
* `rowgroup`, `category`, or `subcategory`.
|
|
273
|
-
*/
|
|
274
|
-
this.level = "auto";
|
|
275
|
-
/**
|
|
276
|
-
* Sort key(s) of the KPI rows: hierarchy columns or scenario slots (e.g.
|
|
277
|
-
* `"ac1"`), comma-separated for multi-level sorting. Empty or `"auto"`
|
|
278
|
-
* uses the dataset's suggested order.
|
|
279
|
-
*/
|
|
280
|
-
this.order = "";
|
|
281
|
-
/**
|
|
282
|
-
* Sorting direction: `asc` or `desc`.
|
|
283
|
-
*/
|
|
284
|
-
this.orderDirection = "";
|
|
285
|
-
/**
|
|
286
|
-
* Maximum number of KPI rows (0 = unlimited). Truncates — there is no
|
|
287
|
-
* REST aggregate, summing heterogeneous KPIs would be meaningless.
|
|
288
|
-
*/
|
|
289
|
-
this.limit = 0;
|
|
290
|
-
/**
|
|
291
|
-
* Value labels. JSON object: `{"show":"auto"|"none","decimals":1}`.
|
|
292
|
-
*/
|
|
293
|
-
this.labels = "";
|
|
294
|
-
this._autoScaleGuard = false;
|
|
295
|
-
this._lastScaledParentHeight = 0;
|
|
296
|
-
/** Facade-bound translator handed to the inner element for warning messages. */
|
|
297
|
-
this.translateForInner = (key, data) => this.t(key, data);
|
|
298
|
-
withStyled(this);
|
|
299
|
-
withComponentStatus(this);
|
|
300
|
-
withDataset(this, (name, _data) => {
|
|
301
|
-
this.datasetName = (name === null || name === void 0 ? void 0 : name.startsWith("$")) ? name.substring(1) : name || "";
|
|
302
|
-
this.dataVersion = this.dataVersion + 1;
|
|
303
|
-
}, (_name, meta) => {
|
|
304
|
-
this.datasetMeta = meta;
|
|
305
|
-
});
|
|
306
|
-
this.errors = withHasError(this);
|
|
307
|
-
this.componentStyle = withComponentStyle(this);
|
|
308
|
-
this.ruleSetConfig = withRuleSet(this);
|
|
309
|
-
this.t = withTranslation(this).t;
|
|
310
|
-
}
|
|
311
|
-
componentWillLoad() {
|
|
312
|
-
this.validateActual(this.actual);
|
|
313
|
-
this.validateTarget(this.target);
|
|
314
|
-
this.validateRanges(this.ranges);
|
|
315
|
-
this.validateNormalize(this.normalize);
|
|
316
|
-
this.validateVariances(this.variances);
|
|
317
|
-
this.validateLevel(this.level);
|
|
318
|
-
this.validateOrder(this.order);
|
|
319
|
-
this.validateOrderDirection(this.orderDirection);
|
|
320
|
-
this.validateLimit(this.limit);
|
|
321
|
-
this.validateLabels(this.labels);
|
|
322
|
-
this.validateScale(this.scale);
|
|
323
|
-
}
|
|
324
|
-
componentDidRender() {
|
|
325
|
-
// Bullet height is data-driven (rows × rowHeight), so the auto-fit
|
|
326
|
-
// scales against the parent HEIGHT — the structure-chart variant, not
|
|
327
|
-
// the width-based XY one.
|
|
328
|
-
const { mode } = parseScaling(this.scale);
|
|
329
|
-
if (mode !== "auto" && mode !== "empty") {
|
|
330
|
-
this._autoScaleGuard = false;
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
if (this._autoScaleGuard) {
|
|
334
|
-
this._autoScaleGuard = false;
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
const host = this.element;
|
|
338
|
-
const { height: parentHeight } = getParentDimensions(host);
|
|
339
|
-
if (parentHeight <= 0)
|
|
340
|
-
return;
|
|
341
|
-
this._lastScaledParentHeight = parentHeight;
|
|
342
|
-
const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
343
|
-
const currentHeight = host.scrollHeight;
|
|
344
|
-
const currentFactor = this.appliedScaleFactor;
|
|
345
|
-
// Content fits at the current factor — don't reset to 1, it only fits
|
|
346
|
-
// BECAUSE of the current factor (resetting would oscillate).
|
|
347
|
-
if (currentHeight <= parentHeight + 1) {
|
|
348
|
-
this.errors.remove("AUTO_scale");
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
const computedFactor = Math.max(0.3, (currentFactor * (parentHeight - 1)) / currentHeight);
|
|
352
|
-
if (Math.abs(computedFactor - currentFactor) < 0.01) {
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
|
|
356
|
-
if (mode === "empty") {
|
|
357
|
-
this.errors.addOrReplace({
|
|
358
|
-
id: "AUTO_scale",
|
|
359
|
-
type: "warning",
|
|
360
|
-
message: `Auto-scaled chart by factor ${computedFactor.toFixed(3)}`,
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
this.errors.remove("AUTO_scale");
|
|
365
|
-
}
|
|
366
|
-
this._autoScaleGuard = true;
|
|
367
|
-
writeTask(() => {
|
|
368
|
-
this.appliedScaleFactor = computedFactor;
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
componentDidLoad() {
|
|
372
|
-
// Watch for size changes (window resize, card relayout) — height only.
|
|
373
|
-
this.layoutObserver = observeParentResize(this.element, () => {
|
|
374
|
-
if (this._autoScaleGuard)
|
|
375
|
-
return;
|
|
376
|
-
const { height } = getParentDimensions(this.element);
|
|
377
|
-
if (height > 0 && Math.abs(height - this._lastScaledParentHeight) > 2) {
|
|
378
|
-
this._lastScaledParentHeight = height;
|
|
379
|
-
forceUpdate(this);
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
// Double-rAF: guarantees the browser completed at least one full paint
|
|
383
|
-
// cycle so all nested card/body/grid layouts are finalized.
|
|
384
|
-
requestAnimationFrame(() => {
|
|
385
|
-
requestAnimationFrame(() => {
|
|
386
|
-
if (this._autoScaleGuard)
|
|
387
|
-
return;
|
|
388
|
-
const { height } = getParentDimensions(this.element);
|
|
389
|
-
this._lastScaledParentHeight = height;
|
|
390
|
-
forceUpdate(this);
|
|
391
|
-
});
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
disconnectedCallback() {
|
|
395
|
-
var _a;
|
|
396
|
-
(_a = this.layoutObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
397
|
-
this.layoutObserver = null;
|
|
398
|
-
}
|
|
399
|
-
labelDefaults() {
|
|
400
|
-
return { show: "auto", decimals: 1 };
|
|
401
|
-
}
|
|
402
|
-
/** Sets or clears a blocking error (type `error`) with a stable id. */
|
|
403
|
-
setBlockingError(id, message) {
|
|
404
|
-
if (message === null) {
|
|
405
|
-
this.errors.remove(id);
|
|
406
|
-
this.activeErrors.delete(id);
|
|
407
|
-
}
|
|
408
|
-
else {
|
|
409
|
-
this.errors.addOrReplace({ id, type: "error", message });
|
|
410
|
-
this.activeErrors.add(id);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
hasBlockingErrors() {
|
|
414
|
-
return this.activeErrors.size > 0;
|
|
415
|
-
}
|
|
416
|
-
/** Shared validator for the measure-carrying object props (actual/target). */
|
|
417
|
-
validateMeasureSpec(prop, raw) {
|
|
418
|
-
var _a;
|
|
419
|
-
const jsonId = `ERR_bullet_json_${prop}`;
|
|
420
|
-
const measureId = `ERR_bullet_measure_${prop}`;
|
|
421
|
-
const fieldsId = `WARN_bullet_fields_${prop}`;
|
|
422
|
-
const { data, parseError } = parseSpec(raw, "measure");
|
|
423
|
-
if (parseError) {
|
|
424
|
-
this.setBlockingError(jsonId, this.t(".bullet-prop-json", { prop }));
|
|
425
|
-
this.setBlockingError(measureId, null);
|
|
426
|
-
this.errors.remove(fieldsId);
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
this.setBlockingError(jsonId, null);
|
|
430
|
-
if (data === null) {
|
|
431
|
-
// Blank is valid — the measure is auto-detected.
|
|
432
|
-
this.setBlockingError(measureId, null);
|
|
433
|
-
this.errors.remove(fieldsId);
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
const measure = ((_a = data.measure) !== null && _a !== void 0 ? _a : "").trim();
|
|
437
|
-
const ref = resolveMeasure(measure);
|
|
438
|
-
// Plain scenario slots only — the bullet variance is implicit
|
|
439
|
-
// (actual vs target), variance tokens have no meaning here.
|
|
440
|
-
if (measure.toLowerCase() !== "auto" && (ref === null || ref.kind !== "scenario")) {
|
|
441
|
-
this.setBlockingError(measureId, this.t(".bullet-measure-invalid", { prop, measure }));
|
|
442
|
-
}
|
|
443
|
-
else {
|
|
444
|
-
this.setBlockingError(measureId, null);
|
|
445
|
-
}
|
|
446
|
-
this.reportSpecIssues(fieldsId, prop, toBulletMeasureConfig(data));
|
|
447
|
-
}
|
|
448
|
-
validateEnum(prop, errId, raw, valid, fallback) {
|
|
449
|
-
if (isBlankInput(raw) || valid.includes(raw.trim().toLowerCase())) {
|
|
450
|
-
this.errors.remove(errId);
|
|
451
|
-
}
|
|
452
|
-
else {
|
|
453
|
-
this.errors.addOrReplace({
|
|
454
|
-
id: errId,
|
|
455
|
-
type: "warning",
|
|
456
|
-
message: `${prop}: invalid value '${raw}' — expected ${valid.join("/")}; using '${fallback}'.`,
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
/** Unknown sub-fields → warning, never error (forward compatibility). */
|
|
461
|
-
reportSpecIssues(errId, prop, result) {
|
|
462
|
-
const issues = [];
|
|
463
|
-
if (result !== null && result.invalidFields.length > 0) {
|
|
464
|
-
issues.push(`invalid: ${result.invalidFields.join(", ")}`);
|
|
465
|
-
}
|
|
466
|
-
if (result !== null && result.unknownKeys.length > 0) {
|
|
467
|
-
issues.push(`unknown: ${result.unknownKeys.join(", ")}`);
|
|
468
|
-
}
|
|
469
|
-
if (issues.length > 0) {
|
|
470
|
-
this.errors.addOrReplace({
|
|
471
|
-
id: errId,
|
|
472
|
-
type: "warning",
|
|
473
|
-
message: `${prop}: ignored sub-fields (${issues.join("; ")}).`,
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
else {
|
|
477
|
-
this.errors.remove(errId);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
/**
|
|
481
|
-
* Resolved actual measure. Blank/`auto` auto-detects `ac1`, else the
|
|
482
|
-
* first `ac*` slot, else the first available scenario — blank (unlike an
|
|
483
|
-
* explicit `auto`) additionally raises the `AUTO_actual` info warning
|
|
484
|
-
* (structure-chart convention).
|
|
485
|
-
*/
|
|
486
|
-
prepareActual() {
|
|
487
|
-
var _a, _b, _c, _d, _e;
|
|
488
|
-
const { data, parseError } = parseSpec(this.actual, "measure");
|
|
489
|
-
if (parseError) {
|
|
490
|
-
return null;
|
|
491
|
-
}
|
|
492
|
-
const config = data !== null ? toBulletMeasureConfig(data).config : null;
|
|
493
|
-
if (config === null || config.measure.toLowerCase() === "auto") {
|
|
494
|
-
const explicitAuto = config !== null;
|
|
495
|
-
const available = (_b = (_a = this.datasetMeta) === null || _a === void 0 ? void 0 : _a.availableScenarios) !== null && _b !== void 0 ? _b : [];
|
|
496
|
-
const detected = (_d = (available.includes("ac1") ? "ac1" : ((_c = available.find((slot) => slot.startsWith("ac"))) !== null && _c !== void 0 ? _c : available[0]))) !== null && _d !== void 0 ? _d : "ac1";
|
|
497
|
-
if (!explicitAuto && this.datasetMeta !== null) {
|
|
498
|
-
this.errors.addOrReplace({
|
|
499
|
-
id: "AUTO_actual",
|
|
500
|
-
type: "warning",
|
|
501
|
-
message: `actual: not set, auto-detected: ${detected}`,
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
else {
|
|
505
|
-
this.errors.remove("AUTO_actual");
|
|
506
|
-
}
|
|
507
|
-
return config === null ? { measure: detected } : Object.assign(Object.assign({}, config), { measure: detected });
|
|
508
|
-
}
|
|
509
|
-
this.errors.remove("AUTO_actual");
|
|
510
|
-
return ((_e = resolveMeasure(config.measure)) === null || _e === void 0 ? void 0 : _e.kind) === "scenario" ? config : null;
|
|
511
|
-
}
|
|
512
|
-
/**
|
|
513
|
-
* Resolved target measure. Blank/`auto` auto-detects `pl1` > `pp1` >
|
|
514
|
-
* `fc1`; when the dataset offers none the chart renders actual bars only
|
|
515
|
-
* (with a warning) and `null` is returned.
|
|
516
|
-
*/
|
|
517
|
-
prepareTarget() {
|
|
518
|
-
var _a, _b, _c;
|
|
519
|
-
const { data, parseError } = parseSpec(this.target, "measure");
|
|
520
|
-
if (parseError) {
|
|
521
|
-
return null;
|
|
522
|
-
}
|
|
523
|
-
const config = data !== null ? toBulletMeasureConfig(data).config : null;
|
|
524
|
-
if (config === null || config.measure.toLowerCase() === "auto") {
|
|
525
|
-
const explicitAuto = config !== null;
|
|
526
|
-
const available = (_b = (_a = this.datasetMeta) === null || _a === void 0 ? void 0 : _a.availableScenarios) !== null && _b !== void 0 ? _b : [];
|
|
527
|
-
const detected = TARGET_SLOT_PREFERENCE.find((slot) => available.includes(slot));
|
|
528
|
-
if (detected === undefined) {
|
|
529
|
-
this.errors.remove("AUTO_target");
|
|
530
|
-
// Distinct id from the orchestrator-synced WARN_bullet-target-none:
|
|
531
|
-
// the inner element's sync walk would otherwise clear this warning.
|
|
532
|
-
if (this.datasetMeta !== null) {
|
|
533
|
-
this.errors.addOrReplace({
|
|
534
|
-
id: "WARN_bullet_target_unavailable",
|
|
535
|
-
type: "warning",
|
|
536
|
-
message: this.t(".bullet-target-none"),
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
else {
|
|
540
|
-
this.errors.remove("WARN_bullet_target_unavailable");
|
|
541
|
-
}
|
|
542
|
-
return null;
|
|
543
|
-
}
|
|
544
|
-
this.errors.remove("WARN_bullet_target_unavailable");
|
|
545
|
-
if (!explicitAuto && this.datasetMeta !== null) {
|
|
546
|
-
this.errors.addOrReplace({
|
|
547
|
-
id: "AUTO_target",
|
|
548
|
-
type: "warning",
|
|
549
|
-
message: `target: not set, auto-detected: ${detected}`,
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
else {
|
|
553
|
-
this.errors.remove("AUTO_target");
|
|
554
|
-
}
|
|
555
|
-
return config === null ? { measure: detected } : Object.assign(Object.assign({}, config), { measure: detected });
|
|
556
|
-
}
|
|
557
|
-
this.errors.remove("AUTO_target");
|
|
558
|
-
this.errors.remove("WARN_bullet_target_unavailable");
|
|
559
|
-
return ((_c = resolveMeasure(config.measure)) === null || _c === void 0 ? void 0 : _c.kind) === "scenario" ? config : null;
|
|
560
|
-
}
|
|
561
|
-
prepareNormalize() {
|
|
562
|
-
var _a;
|
|
563
|
-
return ((_a = this.normalize) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "none" ? "none" : "target";
|
|
564
|
-
}
|
|
565
|
-
prepareShowVariances() {
|
|
566
|
-
var _a;
|
|
567
|
-
return ((_a = this.variances) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) !== "none";
|
|
568
|
-
}
|
|
569
|
-
/** KPI row level; `auto` resolves to the dataset's deepest populated level. */
|
|
570
|
-
prepareLevel() {
|
|
571
|
-
var _a, _b;
|
|
572
|
-
const value = (_a = this.level) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase();
|
|
573
|
-
if (value === "rowgroup") {
|
|
574
|
-
return AggregationLevel.ROWGROUP;
|
|
575
|
-
}
|
|
576
|
-
if (value === "category") {
|
|
577
|
-
return AggregationLevel.CATEGORY;
|
|
578
|
-
}
|
|
579
|
-
if (value === "subcategory") {
|
|
580
|
-
return AggregationLevel.SUBCATEGORY;
|
|
581
|
-
}
|
|
582
|
-
const suggested = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedLevel;
|
|
583
|
-
if (suggested !== undefined && suggested !== "") {
|
|
584
|
-
const resolved = AggregationLevel[suggested.toUpperCase()];
|
|
585
|
-
if (resolved !== undefined) {
|
|
586
|
-
return resolved;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
return AggregationLevel.CATEGORY;
|
|
590
|
-
}
|
|
591
|
-
/** Sort order; blank/`auto` uses the dataset's suggested order (structure-chart convention). */
|
|
592
|
-
prepareOrder() {
|
|
593
|
-
var _a, _b, _c, _d;
|
|
594
|
-
const isAuto = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
595
|
-
let orderStr;
|
|
596
|
-
if (isBlankInput(this.order) || isAuto) {
|
|
597
|
-
if ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedOrder) {
|
|
598
|
-
if (!isAuto) {
|
|
599
|
-
this.errors.addOrReplace({
|
|
600
|
-
id: "AUTO_order",
|
|
601
|
-
type: "warning",
|
|
602
|
-
message: `order: not set, auto-detected: ${this.datasetMeta.suggestedOrder}`,
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
else {
|
|
606
|
-
this.errors.remove("AUTO_order");
|
|
607
|
-
}
|
|
608
|
-
orderStr = this.datasetMeta.suggestedOrder;
|
|
609
|
-
}
|
|
610
|
-
else {
|
|
611
|
-
this.errors.remove("AUTO_order");
|
|
612
|
-
orderStr = "";
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
else {
|
|
616
|
-
this.errors.remove("AUTO_order");
|
|
617
|
-
orderStr = this.order;
|
|
618
|
-
}
|
|
619
|
-
const direction = (_d = OrderDirection[(_c = this.orderDirection) === null || _c === void 0 ? void 0 : _c.toUpperCase()]) !== null && _d !== void 0 ? _d : OrderDirection.ASC;
|
|
620
|
-
if (isBlankInput(orderStr)) {
|
|
621
|
-
return new Order([OrderColumn.CATEGORYINDEX], direction);
|
|
622
|
-
}
|
|
623
|
-
const hierarchy = orderStr
|
|
624
|
-
.split(",")
|
|
625
|
-
.map((entry) => OrderColumn[entry.trim().toUpperCase()])
|
|
626
|
-
.filter((entry) => entry !== undefined);
|
|
627
|
-
return new Order(hierarchy.length > 0 ? hierarchy : [OrderColumn.CATEGORYINDEX], direction);
|
|
628
|
-
}
|
|
629
|
-
prepareLabels() {
|
|
630
|
-
const defaults = this.labelDefaults();
|
|
631
|
-
const { data, parseError } = parseSpec(this.labels, null);
|
|
632
|
-
if (parseError || data === null) {
|
|
633
|
-
return { show: defaults.show, decimals: defaults.decimals };
|
|
634
|
-
}
|
|
635
|
-
return toBulletLabelConfig(data, defaults).config;
|
|
636
|
-
}
|
|
637
|
-
prepareLimit() {
|
|
638
|
-
const value = Math.floor(Number(this.limit) || 0);
|
|
639
|
-
return value > 0 ? value : 0;
|
|
640
|
-
}
|
|
641
|
-
i18nLocalKeys() {
|
|
642
|
-
return ["no-data", "target", "axis.in"];
|
|
643
|
-
}
|
|
644
|
-
prepareI18n() {
|
|
645
|
-
const i18nMapLocal = new Map(this.i18nLocalKeys().map((key) => [key, this.t(".".concat(key))]));
|
|
646
|
-
const i18nMapGlobal = new Map(globalLabelKeys.map((key) => [key, this.t("global.".concat(key))]));
|
|
647
|
-
return new Map([...i18nMapGlobal.entries(), ...i18nMapLocal.entries()]);
|
|
648
|
-
}
|
|
649
|
-
prepareStyle() {
|
|
650
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
651
|
-
return this.componentStyle(($) => {
|
|
652
|
-
const baseFontSize = $["global"]["fontSizePx"];
|
|
653
|
-
const scaledFontSize = baseFontSize * effectiveFactor;
|
|
654
|
-
return {
|
|
655
|
-
scaleFactors: $["bn-chart-bullet"]["scaleFactors"],
|
|
656
|
-
fontStyles: {
|
|
657
|
-
font: `${scaledFontSize}px ${$["global"]["fontFamily"]}`,
|
|
658
|
-
size: scaledFontSize,
|
|
659
|
-
color: $["global"]["fontColor"],
|
|
660
|
-
background: $["global"]["fontBackgroundColor"],
|
|
661
|
-
leading: 1.8,
|
|
662
|
-
},
|
|
663
|
-
axisStyles: $["bn-chart-bullet"]["axisStyles"],
|
|
664
|
-
barStyles: $["bn-chart-bullet"]["barStyles"],
|
|
665
|
-
varianceStyles: $["bn-chart-bullet"]["varianceStyles"],
|
|
666
|
-
rangeColors: $["bn-chart-bullet"]["rangeColors"],
|
|
667
|
-
padding: $["bn-chart-bullet"]["padding"],
|
|
668
|
-
};
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
/**
|
|
672
|
-
* Lazily generates this chart's layout state: host box (context- and
|
|
673
|
-
* component-relative, CSS px), the canvas region and diagnostics. With
|
|
674
|
-
* `detail: "full"` the rendered marks and labels are listed with their
|
|
675
|
-
* geometry (tag-classified — bullet marks carry no ids).
|
|
676
|
-
*
|
|
677
|
-
* @param options - `{ detail: "summary" | "full" }`, default `"summary"`
|
|
678
|
-
*/
|
|
679
|
-
async getLayoutState(options) {
|
|
680
|
-
var _a;
|
|
681
|
-
const detail = (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : "summary";
|
|
682
|
-
const origins = originsFor(this.element);
|
|
683
|
-
const rawFactor = this.getEffectiveScaleFactor();
|
|
684
|
-
// Auto-scale can be mid-measurement (or unmeasurable in tests) — report a sane factor.
|
|
685
|
-
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
686
|
-
const fontSizePx = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; }) * factor;
|
|
687
|
-
return collectXYFacadeState(this.element, "ibcs-chart-bullet", this.chartTitle || undefined, { fontSizePx, appliedScaleFactor: factor }, origins, detail);
|
|
688
|
-
}
|
|
689
|
-
getEffectiveScaleFactor() {
|
|
690
|
-
const { mode, factor } = parseScaling(this.scale);
|
|
691
|
-
if (mode === "factor")
|
|
692
|
-
return factor;
|
|
693
|
-
if (mode === "auto" || mode === "empty")
|
|
694
|
-
return this.appliedScaleFactor;
|
|
695
|
-
return 1;
|
|
696
|
-
}
|
|
697
|
-
getFontStyles() {
|
|
698
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
699
|
-
return this.componentStyle(($) => {
|
|
700
|
-
var _a, _b, _c, _d;
|
|
701
|
-
const baseFontSize = ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333;
|
|
702
|
-
return {
|
|
703
|
-
"--bn-font-family": ((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
704
|
-
"--bn-font-size": `${baseFontSize * effectiveFactor}px`,
|
|
705
|
-
"--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
|
|
706
|
-
"--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
|
|
707
|
-
};
|
|
708
|
-
});
|
|
709
|
-
}
|
|
710
|
-
/**
|
|
711
|
-
* Dataset field map for the editor-companion: hierarchy fields plus the
|
|
712
|
-
* 16 scenario slots; descriptions of currently-mapped slots reflect the
|
|
713
|
-
* live mapping (e.g. `pl1 → "target: Plan"`).
|
|
714
|
-
*/
|
|
715
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
716
|
-
getDataStructure() {
|
|
717
|
-
const slots = {};
|
|
718
|
-
for (const family of ["ac", "pp", "fc", "pl"]) {
|
|
719
|
-
for (const index of [1, 2, 3, 4]) {
|
|
720
|
-
slots[`${family}${index}`] = { type: "number", isOptional: true, description: "" };
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
const mapped = {
|
|
724
|
-
actual: this.prepareActual(),
|
|
725
|
-
target: this.prepareTarget(),
|
|
726
|
-
};
|
|
727
|
-
for (const [prop, config] of Object.entries(mapped)) {
|
|
728
|
-
if (config === null || slots[config.measure] === undefined) {
|
|
729
|
-
continue;
|
|
730
|
-
}
|
|
731
|
-
const label = config.label !== undefined ? config.label : config.measure;
|
|
732
|
-
slots[config.measure].description = `${prop}: ${label}`;
|
|
733
|
-
}
|
|
734
|
-
return {
|
|
735
|
-
IBulletChartDataRow: Object.assign({ operation: { type: "string", isOptional: false, description: "" }, rowGroup: { type: "string", isOptional: true, description: "" }, rowGroupIndex: { type: "number", isOptional: true, description: "" }, category: { type: "string", isOptional: false, description: "" }, categoryIndex: { type: "number", isOptional: false, description: "" }, subCategory: { type: "string", isOptional: true, description: "" }, subCategoryIndex: { type: "number", isOptional: true, description: "" } }, slots),
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
chartTemplate() {
|
|
739
|
-
const actual = this.prepareActual();
|
|
740
|
-
const target = this.prepareTarget();
|
|
741
|
-
const ranges = parseRanges(this.ranges).ranges;
|
|
742
|
-
const normalize = this.prepareNormalize();
|
|
743
|
-
this.setBlockingError("ERR_bullet_measure_same", actual !== null && target !== null && actual.measure === target.measure
|
|
744
|
-
? this.t(".bullet-measure-same", { measure: actual.measure })
|
|
745
|
-
: null);
|
|
746
|
-
if (ranges.length > 0 && normalize === "target") {
|
|
747
|
-
this.errors.addOrReplace({
|
|
748
|
-
id: "WARN_bullet_ranges_ignored",
|
|
749
|
-
type: "warning",
|
|
750
|
-
message: this.t(".bullet-ranges-ignored"),
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
else {
|
|
754
|
-
this.errors.remove("WARN_bullet_ranges_ignored");
|
|
755
|
-
}
|
|
756
|
-
if (this.hasBlockingErrors() || actual === null) {
|
|
757
|
-
return null;
|
|
758
|
-
}
|
|
759
|
-
return (h("ibcs-chart-bullet", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.chartTitle, actual: actual, target: target, ranges: ranges, normalize: normalize, showVariances: this.prepareShowVariances(), level: this.prepareLevel(), order: this.prepareOrder(), limit: this.prepareLimit(), labels: this.prepareLabels(), filter: this.filter, styles: this.prepareStyle(), i18n: this.prepareI18n(), containerWidth: getParentDimensions(this.element).width, ruleSetConfig: this.ruleSetConfig(), errors: this.errors, translate: this.translateForInner }));
|
|
760
|
-
}
|
|
761
|
-
render() {
|
|
762
|
-
return (h(Host, { key: '31096e122fe62354e4a9ad0a15af5329a72265ba', style: this.getFontStyles() }, h("div", { key: '8288f32a3ac40790136b751a5630787cfd958a9d', class: "container" }, this.chartTemplate())));
|
|
763
|
-
}
|
|
764
|
-
get element() { return getElement(this); }
|
|
765
|
-
static get watchers() { return {
|
|
766
|
-
"actual": [{
|
|
767
|
-
"validateActual": 0
|
|
768
|
-
}],
|
|
769
|
-
"target": [{
|
|
770
|
-
"validateTarget": 0
|
|
771
|
-
}],
|
|
772
|
-
"ranges": [{
|
|
773
|
-
"validateRanges": 0
|
|
774
|
-
}],
|
|
775
|
-
"normalize": [{
|
|
776
|
-
"validateNormalize": 0
|
|
777
|
-
}],
|
|
778
|
-
"variances": [{
|
|
779
|
-
"validateVariances": 0
|
|
780
|
-
}],
|
|
781
|
-
"level": [{
|
|
782
|
-
"validateLevel": 0
|
|
783
|
-
}],
|
|
784
|
-
"order": [{
|
|
785
|
-
"validateOrder": 0
|
|
786
|
-
}],
|
|
787
|
-
"orderDirection": [{
|
|
788
|
-
"validateOrderDirection": 0
|
|
789
|
-
}],
|
|
790
|
-
"limit": [{
|
|
791
|
-
"validateLimit": 0
|
|
792
|
-
}],
|
|
793
|
-
"labels": [{
|
|
794
|
-
"validateLabels": 0
|
|
795
|
-
}],
|
|
796
|
-
"scale": [{
|
|
797
|
-
"validateScale": 0
|
|
798
|
-
}]
|
|
799
|
-
}; }
|
|
800
|
-
};
|
|
801
|
-
ChartBullet.style = bnChartBulletCss();
|
|
802
|
-
|
|
803
|
-
export { ChartBullet as bn_chart_bullet };
|