@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,20 +1,21 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import withBodyObserver from "../../utils/withBodyObserver";
|
|
3
|
-
import { getStores } from "../../context/context-protocol";
|
|
3
|
+
import { getStores, clearStoresCache } from "../../context/context-protocol";
|
|
4
4
|
import withComponentStatus from "../../utils/withComponentStatus";
|
|
5
5
|
import withHasError from "../../utils/withHasError";
|
|
6
6
|
import { computeContentHash, decodeCompressedContent } from "../../utils/contentDecoder";
|
|
7
|
+
import { errorText } from "../../utils/queryError";
|
|
7
8
|
/**
|
|
8
9
|
* Ingests data and writes it to the scoped `datasources` store.
|
|
9
10
|
*
|
|
10
11
|
* Data can be provided in three ways:
|
|
11
|
-
* 1. **Inline JSON**
|
|
12
|
-
* 2. **Compressed payload**
|
|
13
|
-
* 3. **URL**
|
|
14
|
-
*
|
|
12
|
+
* 1. **Inline JSON** - Place JSON text inside the element body (default).
|
|
13
|
+
* 2. **Compressed payload** - Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
|
|
14
|
+
* 3. **URL** - Set the `src` attribute to fetch JSON from an HTTP endpoint.
|
|
15
|
+
* Set the `interval` prop (in seconds) to enable periodic re-fetching
|
|
16
|
+
* (polling).
|
|
15
17
|
*
|
|
16
|
-
*
|
|
17
|
-
* prop (in seconds) to enable periodic re-fetching (polling).
|
|
18
|
+
* The body is always inline data and is ignored while `src` is set.
|
|
18
19
|
*
|
|
19
20
|
* Other components (e.g. `bn-dataset`) reference the stored data by the
|
|
20
21
|
* `name` prop to run queries against it.
|
|
@@ -24,68 +25,112 @@ export class Datasource {
|
|
|
24
25
|
/**
|
|
25
26
|
* When true (default), body content is plain JSON text.
|
|
26
27
|
* When false, body content is a compressed payload (`<hash>:<base64_gzip>`).
|
|
27
|
-
* Ignored
|
|
28
|
+
* Ignored when `src` is set.
|
|
28
29
|
*/
|
|
29
30
|
this.raw = true;
|
|
30
31
|
/**
|
|
31
|
-
* Polling interval in **seconds** for
|
|
32
|
-
* When set
|
|
33
|
-
*
|
|
32
|
+
* Polling interval in **seconds** for `src`.
|
|
33
|
+
* When set together with `src`, the component re-fetches data at this
|
|
34
|
+
* interval. Has no effect for inline JSON or compressed content.
|
|
34
35
|
* Set to `0` or leave unset to disable polling.
|
|
35
36
|
*/
|
|
36
37
|
this.interval = 0;
|
|
37
38
|
this.lastHash = null;
|
|
39
|
+
this.nameShared = false;
|
|
38
40
|
/** The currently active URL (`null` when in inline-JSON mode). */
|
|
39
41
|
this.currentUrl = null;
|
|
40
42
|
/** Timer ID for the polling interval. */
|
|
41
43
|
this.pollTimerId = null;
|
|
42
44
|
/** AbortController for cancelling in-flight fetch requests. */
|
|
43
45
|
this.abortController = null;
|
|
44
|
-
|
|
46
|
+
/** True until the first request for the current `src` has delivered. A poll tick is skipped meanwhile: it would cancel that request and release readiness with no data. */
|
|
47
|
+
this.firstLoadPending = false;
|
|
48
|
+
/** Two producers of one name overwrite each other's data. Both report it. */
|
|
49
|
+
this.onNameShared = (shared) => {
|
|
50
|
+
const wasShared = this.nameShared;
|
|
51
|
+
this.nameShared = shared;
|
|
52
|
+
if (shared) {
|
|
53
|
+
this.errors.addOrReplace({
|
|
54
|
+
id: "ERR_name",
|
|
55
|
+
type: "error",
|
|
56
|
+
message: `name: "${this.name}" is used by more than one dataset or datasource.`,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this.errors.remove("ERR_name");
|
|
61
|
+
// the other producer may have written the name last: load the own data again
|
|
62
|
+
if (wasShared)
|
|
63
|
+
this.reload();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
this.holdStatus = withComponentStatus(this);
|
|
45
67
|
this.errors = withHasError(this);
|
|
46
|
-
withBodyObserver(this, (data) =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
68
|
+
withBodyObserver(this, (data) => this.sync(data));
|
|
69
|
+
}
|
|
70
|
+
/** Loads from `src` when it is set, otherwise from the inline body. */
|
|
71
|
+
sync(data) {
|
|
72
|
+
var _a;
|
|
73
|
+
// a re-attached element may sit in another bn-context
|
|
74
|
+
this.stores = getStores(this.element);
|
|
75
|
+
if (!this.releaseName && this.name)
|
|
76
|
+
this.releaseName = this.stores.db.claim(this.name, this.onNameShared);
|
|
77
|
+
// --- URL mode ---
|
|
78
|
+
if (this.src) {
|
|
79
|
+
if (this.src === this.currentUrl)
|
|
58
80
|
return;
|
|
81
|
+
this.currentUrl = this.src;
|
|
82
|
+
this.lastHash = null;
|
|
83
|
+
this.errors.remove("ERR_body");
|
|
84
|
+
this.firstLoadPending = true;
|
|
85
|
+
this.holdStatus(this.fetchAndStore(this.src));
|
|
86
|
+
this.startPolling();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
// --- Leaving URL mode → clean up ---
|
|
90
|
+
if (this.currentUrl !== null) {
|
|
91
|
+
this.cancelInFlight();
|
|
92
|
+
this.currentUrl = null;
|
|
93
|
+
}
|
|
94
|
+
// --- Inline JSON / compressed mode ---
|
|
95
|
+
this.errors.remove("ERR_src");
|
|
96
|
+
try {
|
|
97
|
+
let contentHash;
|
|
98
|
+
let jsonString;
|
|
99
|
+
if (this.raw || data.trim() === "") {
|
|
100
|
+
contentHash = computeContentHash(data);
|
|
101
|
+
jsonString = data;
|
|
59
102
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
103
|
+
else {
|
|
104
|
+
const decoded = decodeCompressedContent(data);
|
|
105
|
+
contentHash = decoded.hash;
|
|
106
|
+
jsonString = decoded.json;
|
|
64
107
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
const decoded = decodeCompressedContent(data);
|
|
75
|
-
contentHash = decoded.hash;
|
|
76
|
-
jsonString = decoded.json;
|
|
77
|
-
}
|
|
78
|
-
if (contentHash === this.lastHash)
|
|
79
|
-
return;
|
|
80
|
-
this.lastHash = contentHash;
|
|
81
|
-
const json = JSON.parse(jsonString);
|
|
82
|
-
this.publish(json);
|
|
108
|
+
if (contentHash === this.lastHash)
|
|
109
|
+
return;
|
|
110
|
+
this.lastHash = contentHash;
|
|
111
|
+
// an empty body is "no data given", not a failure. The JSON value null is a list without rows.
|
|
112
|
+
const json = jsonString.trim() === "" ? [] : ((_a = JSON.parse(jsonString)) !== null && _a !== void 0 ? _a : []);
|
|
113
|
+
if (Array.isArray(json)) {
|
|
114
|
+
this.errors.remove("ERR_body");
|
|
83
115
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.publish([]);
|
|
116
|
+
else {
|
|
117
|
+
this.errors.addOrReplace({ id: "ERR_body", type: "error", message: "Body: not a JSON array." });
|
|
87
118
|
}
|
|
88
|
-
|
|
119
|
+
this.publish(json);
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
// the body that was loaded before must be read again when it comes back
|
|
123
|
+
this.lastHash = null;
|
|
124
|
+
this.errors.addOrReplace({ id: "ERR_body", type: "error", message: `Body: ${errorText(e)}` });
|
|
125
|
+
this.publish([]);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** Forgets what was loaded and loads again from `src` or the body. */
|
|
129
|
+
reload() {
|
|
130
|
+
var _a;
|
|
131
|
+
this.lastHash = null;
|
|
132
|
+
this.currentUrl = null;
|
|
133
|
+
this.sync((_a = this.element.textContent) !== null && _a !== void 0 ? _a : "");
|
|
89
134
|
}
|
|
90
135
|
/**
|
|
91
136
|
* Writes the parsed data into the shared alasql database (as a table named
|
|
@@ -94,6 +139,7 @@ export class Datasource {
|
|
|
94
139
|
publish(json) {
|
|
95
140
|
const db = this.stores.db.db;
|
|
96
141
|
db.tables[this.name] = { data: Array.isArray(json) ? json : [] };
|
|
142
|
+
this.registered = db.tables[this.name];
|
|
97
143
|
this.stores.db.notify(this.name);
|
|
98
144
|
}
|
|
99
145
|
onIntervalChange() {
|
|
@@ -101,53 +147,74 @@ export class Datasource {
|
|
|
101
147
|
this.startPolling();
|
|
102
148
|
}
|
|
103
149
|
}
|
|
150
|
+
onSrcChange() {
|
|
151
|
+
var _a;
|
|
152
|
+
// a detached element must not fetch or poll; the body callback reads src again on connect
|
|
153
|
+
if (this.element.isConnected)
|
|
154
|
+
this.sync((_a = this.element.textContent) !== null && _a !== void 0 ? _a : "");
|
|
155
|
+
}
|
|
156
|
+
nameUpdated(_name, oldName) {
|
|
157
|
+
var _a;
|
|
158
|
+
this.unregister(oldName);
|
|
159
|
+
if (this.name && this.element.isConnected)
|
|
160
|
+
this.sync((_a = this.element.textContent) !== null && _a !== void 0 ? _a : "");
|
|
161
|
+
}
|
|
104
162
|
disconnectedCallback() {
|
|
105
|
-
var _a, _b;
|
|
106
163
|
this.cancelInFlight();
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
164
|
+
this.unregister(this.name);
|
|
165
|
+
clearStoresCache(this.element);
|
|
166
|
+
}
|
|
167
|
+
/** Drops the table registered under `name` and forgets the loaded state, so the next sync loads again. */
|
|
168
|
+
unregister(name) {
|
|
169
|
+
var _a, _b, _c;
|
|
170
|
+
(_a = this.releaseName) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
171
|
+
this.releaseName = undefined;
|
|
172
|
+
this.lastHash = null;
|
|
173
|
+
this.currentUrl = null;
|
|
174
|
+
const db = (_c = (_b = this.stores) === null || _b === void 0 ? void 0 : _b.db) === null || _c === void 0 ? void 0 : _c.db;
|
|
175
|
+
// another element may have taken the name since: its table and consumers stay untouched
|
|
176
|
+
const taken = (db === null || db === void 0 ? void 0 : db.tables[name]) != null && db.tables[name] !== this.registered;
|
|
177
|
+
this.registered = undefined;
|
|
178
|
+
if (db && name && !taken) {
|
|
179
|
+
if (db.tables[name] != null) {
|
|
180
|
+
delete db.tables[name];
|
|
111
181
|
}
|
|
112
182
|
// @ts-ignore - views typing is loose
|
|
113
|
-
if (db.views && db.views[
|
|
183
|
+
if (db.views && db.views[name] != null) {
|
|
114
184
|
// @ts-ignore
|
|
115
|
-
delete db.views[
|
|
185
|
+
delete db.views[name];
|
|
116
186
|
}
|
|
117
|
-
this.stores.db.notify(
|
|
187
|
+
this.stores.db.notify(name);
|
|
118
188
|
}
|
|
119
189
|
}
|
|
120
|
-
/**
|
|
121
|
-
* Returns `true` if the text is a fetchable URL: an absolute `http(s)://`
|
|
122
|
-
* URL, or a same-origin path starting with `/` (but not `//`, which is a
|
|
123
|
-
* protocol-relative URL we treat as inline-mode escape).
|
|
124
|
-
*/
|
|
125
|
-
isUrl(text) {
|
|
126
|
-
if (text.startsWith("http://") || text.startsWith("https://"))
|
|
127
|
-
return true;
|
|
128
|
-
return text.startsWith("/") && !text.startsWith("//");
|
|
129
|
-
}
|
|
130
190
|
/**
|
|
131
191
|
* Fetches JSON from the given URL and stores the result.
|
|
132
192
|
* Cancels any in-flight request before starting a new one.
|
|
133
193
|
*/
|
|
134
194
|
async fetchAndStore(url) {
|
|
135
|
-
var _a;
|
|
195
|
+
var _a, _b;
|
|
136
196
|
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
137
197
|
this.abortController = new AbortController();
|
|
138
198
|
if (!this.stores)
|
|
139
199
|
this.stores = getStores(this.element);
|
|
140
200
|
try {
|
|
141
201
|
const response = await fetch(url, { signal: this.abortController.signal });
|
|
142
|
-
|
|
202
|
+
if (!response.ok)
|
|
203
|
+
throw new Error(`HTTP ${response.status}`);
|
|
204
|
+
// the JSON value null is a response without rows
|
|
205
|
+
const json = (_b = (await response.json())) !== null && _b !== void 0 ? _b : [];
|
|
206
|
+
if (!Array.isArray(json))
|
|
207
|
+
throw new Error("not a JSON array.");
|
|
208
|
+
this.errors.remove("ERR_src");
|
|
143
209
|
this.publish(json);
|
|
144
210
|
}
|
|
145
211
|
catch (e) {
|
|
146
212
|
if (e instanceof DOMException && e.name === "AbortError")
|
|
147
213
|
return;
|
|
148
|
-
|
|
214
|
+
this.errors.addOrReplace({ id: "ERR_src", type: "error", message: `src: ${errorText(e)}` });
|
|
149
215
|
this.publish([]);
|
|
150
216
|
}
|
|
217
|
+
this.firstLoadPending = false;
|
|
151
218
|
}
|
|
152
219
|
/** Stops the polling timer (does NOT touch any in-flight fetch). */
|
|
153
220
|
clearPollTimer() {
|
|
@@ -157,7 +224,7 @@ export class Datasource {
|
|
|
157
224
|
}
|
|
158
225
|
}
|
|
159
226
|
/** Stops the polling timer AND cancels any in-flight fetch. Use only when
|
|
160
|
-
* leaving URL mode entirely (disconnect or
|
|
227
|
+
* leaving URL mode entirely (disconnect or `src` removed). */
|
|
161
228
|
cancelInFlight() {
|
|
162
229
|
var _a;
|
|
163
230
|
this.clearPollTimer();
|
|
@@ -165,20 +232,20 @@ export class Datasource {
|
|
|
165
232
|
this.abortController = null;
|
|
166
233
|
}
|
|
167
234
|
/** Starts (or restarts) the polling timer if in URL mode with a positive
|
|
168
|
-
* interval. Does NOT abort the kick-off fetch issued by the caller
|
|
235
|
+
* interval. Does NOT abort the kick-off fetch issued by the caller - it
|
|
169
236
|
* only resets the interval timer. */
|
|
170
237
|
startPolling() {
|
|
171
238
|
this.clearPollTimer();
|
|
172
239
|
if (this.currentUrl && this.interval > 0) {
|
|
173
240
|
this.pollTimerId = setInterval(() => {
|
|
174
|
-
if (this.currentUrl) {
|
|
241
|
+
if (this.currentUrl && !this.firstLoadPending) {
|
|
175
242
|
this.fetchAndStore(this.currentUrl);
|
|
176
243
|
}
|
|
177
244
|
}, this.interval * 1000);
|
|
178
245
|
}
|
|
179
246
|
}
|
|
180
247
|
render() {
|
|
181
|
-
return h(Host, { key: '
|
|
248
|
+
return h(Host, { key: '4e164358c873601f39332f5d35d14a1ad5f66f73' });
|
|
182
249
|
}
|
|
183
250
|
static get is() { return "bn-datasource"; }
|
|
184
251
|
static get originalStyleUrls() {
|
|
@@ -224,7 +291,7 @@ export class Datasource {
|
|
|
224
291
|
"optional": false,
|
|
225
292
|
"docs": {
|
|
226
293
|
"tags": [],
|
|
227
|
-
"text": "When true (default), body content is plain JSON text.\nWhen false, body content is a compressed payload (`<hash>:<base64_gzip>`).\nIgnored
|
|
294
|
+
"text": "When true (default), body content is plain JSON text.\nWhen false, body content is a compressed payload (`<hash>:<base64_gzip>`).\nIgnored when `src` is set."
|
|
228
295
|
},
|
|
229
296
|
"getter": false,
|
|
230
297
|
"setter": false,
|
|
@@ -244,13 +311,32 @@ export class Datasource {
|
|
|
244
311
|
"optional": false,
|
|
245
312
|
"docs": {
|
|
246
313
|
"tags": [],
|
|
247
|
-
"text": "Polling interval in **seconds** for
|
|
314
|
+
"text": "Polling interval in **seconds** for `src`.\nWhen set together with `src`, the component re-fetches data at this\ninterval. Has no effect for inline JSON or compressed content.\nSet to `0` or leave unset to disable polling."
|
|
248
315
|
},
|
|
249
316
|
"getter": false,
|
|
250
317
|
"setter": false,
|
|
251
318
|
"reflect": false,
|
|
252
319
|
"attribute": "interval",
|
|
253
320
|
"defaultValue": "0"
|
|
321
|
+
},
|
|
322
|
+
"src": {
|
|
323
|
+
"type": "string",
|
|
324
|
+
"mutable": false,
|
|
325
|
+
"complexType": {
|
|
326
|
+
"original": "string",
|
|
327
|
+
"resolved": "string",
|
|
328
|
+
"references": {}
|
|
329
|
+
},
|
|
330
|
+
"required": false,
|
|
331
|
+
"optional": true,
|
|
332
|
+
"docs": {
|
|
333
|
+
"tags": [],
|
|
334
|
+
"text": "URL to fetch the JSON from. When set, the body is ignored."
|
|
335
|
+
},
|
|
336
|
+
"getter": false,
|
|
337
|
+
"setter": false,
|
|
338
|
+
"reflect": false,
|
|
339
|
+
"attribute": "src"
|
|
254
340
|
}
|
|
255
341
|
};
|
|
256
342
|
}
|
|
@@ -259,6 +345,12 @@ export class Datasource {
|
|
|
259
345
|
return [{
|
|
260
346
|
"propName": "interval",
|
|
261
347
|
"methodName": "onIntervalChange"
|
|
348
|
+
}, {
|
|
349
|
+
"propName": "src",
|
|
350
|
+
"methodName": "onSrcChange"
|
|
351
|
+
}, {
|
|
352
|
+
"propName": "name",
|
|
353
|
+
"methodName": "nameUpdated"
|
|
262
354
|
}];
|
|
263
355
|
}
|
|
264
356
|
}
|
|
@@ -5,7 +5,7 @@ import withHasError from "../../utils/withHasError";
|
|
|
5
5
|
export class Footer {
|
|
6
6
|
constructor() {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Page label: a number or any text, e.g. `3` or `A-1`.
|
|
9
9
|
* Is displayed if displayPageNumber == true
|
|
10
10
|
*/
|
|
11
11
|
this.pageNumber = null;
|
|
@@ -45,7 +45,7 @@ export class Footer {
|
|
|
45
45
|
return `./assets/${imgUrl}.png`;
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '8751cf4e338d54605350f06743956689eb4286ce', id: this.displayPageNumber || this.text || this.code ? "container-page-footer" : "container", style: this.getFontStyles() }, h("div", { key: '7a9fb20453df0db4755d90c00043fff4c262eda2', id: "footer-text" }, this.text != null ? h("span", { class: "note" }, this.text) : ""), h("div", { key: '7ef166a4d0d48b1fb5cceb7e79ca678c4c4e0d63', id: "code" }, this.code != null ? h("img", { class: "image", src: getAssetPath(`${this.prepareAssetUrl(this.code)}`) }) : ""), h("div", { key: 'bf74b278f43540612327e03539278f7fa35996f1', id: "page-number" }, this.displayPageNumber ? h("span", { class: "page" }, this.pageNumber) : "")));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "bn-footer"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -63,18 +63,18 @@ export class Footer {
|
|
|
63
63
|
static get properties() {
|
|
64
64
|
return {
|
|
65
65
|
"pageNumber": {
|
|
66
|
-
"type": "
|
|
66
|
+
"type": "string",
|
|
67
67
|
"mutable": true,
|
|
68
68
|
"complexType": {
|
|
69
|
-
"original": "
|
|
70
|
-
"resolved": "
|
|
69
|
+
"original": "string | null",
|
|
70
|
+
"resolved": "string",
|
|
71
71
|
"references": {}
|
|
72
72
|
},
|
|
73
73
|
"required": false,
|
|
74
74
|
"optional": false,
|
|
75
75
|
"docs": {
|
|
76
76
|
"tags": [],
|
|
77
|
-
"text": "
|
|
77
|
+
"text": "Page label: a number or any text, e.g. `3` or `A-1`.\nIs displayed if displayPageNumber == true"
|
|
78
78
|
},
|
|
79
79
|
"getter": false,
|
|
80
80
|
"setter": false,
|
|
@@ -2,6 +2,7 @@ import { h, Host } from "@stencil/core";
|
|
|
2
2
|
import withBodyObserver from "../../utils/withBodyObserver";
|
|
3
3
|
import { getStores } from "../../context/context-protocol";
|
|
4
4
|
import flattenObject from "../../utils/flattenObject";
|
|
5
|
+
import { errorText } from "../../utils/queryError";
|
|
5
6
|
import withComponentStatus from "../../utils/withComponentStatus";
|
|
6
7
|
import withHasError from "../../utils/withHasError";
|
|
7
8
|
export class Internationalization {
|
|
@@ -12,22 +13,32 @@ export class Internationalization {
|
|
|
12
13
|
withBodyObserver(this, (data) => {
|
|
13
14
|
if (!this.stores)
|
|
14
15
|
this.stores = getStores(this.element);
|
|
16
|
+
// an empty body is "nothing to add", not a failure
|
|
17
|
+
if (data.trim() === "") {
|
|
18
|
+
this.errors.remove("ERR_body");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
15
21
|
try {
|
|
16
|
-
const
|
|
22
|
+
const parsed = JSON.parse(data);
|
|
23
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
24
|
+
throw new Error("not a JSON object.");
|
|
25
|
+
}
|
|
26
|
+
const i18n = flattenObject(parsed);
|
|
17
27
|
const ns = this.namespace || "_system";
|
|
18
28
|
const namespace = Object.assign({}, this.stores.internationalization.get(ns));
|
|
19
29
|
// Merge over the existing bundle (built-ins or earlier manifests) so
|
|
20
30
|
// partial overrides don't wipe unrelated keys.
|
|
21
31
|
namespace[this.code] = Object.assign(Object.assign({}, namespace[this.code]), i18n);
|
|
22
32
|
this.stores.internationalization.set(ns, namespace);
|
|
33
|
+
this.errors.remove("ERR_body");
|
|
23
34
|
}
|
|
24
35
|
catch (e) {
|
|
25
|
-
|
|
36
|
+
this.errors.addOrReplace({ id: "ERR_body", type: "error", message: `Body: ${errorText(e)}` });
|
|
26
37
|
}
|
|
27
38
|
});
|
|
28
39
|
}
|
|
29
40
|
render() {
|
|
30
|
-
return h(Host, { key: '
|
|
41
|
+
return h(Host, { key: '9b45d8f87b99238f5a83d9a3c231d10de8e53acf' });
|
|
31
42
|
}
|
|
32
43
|
static get is() { return "bn-internationalization"; }
|
|
33
44
|
static get originalStyleUrls() {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { h, Fragment } from "@stencil/core";
|
|
2
2
|
import { getStores } from "../../context/context-protocol";
|
|
3
|
+
import withComponentStatus from "../../utils/withComponentStatus";
|
|
3
4
|
import withHasError from "../../utils/withHasError";
|
|
4
5
|
import withInheritedProps from "../../utils/withInheritedProps";
|
|
6
|
+
import { CUSTOM_TEMPLATE, templateAreas, templateColumns, templateProblem, templateRows, templateSlotNames, } from "../../utils/layoutTemplate";
|
|
5
7
|
export class LayoutCard {
|
|
6
8
|
constructor() {
|
|
7
9
|
/**
|
|
@@ -114,20 +116,7 @@ export class LayoutCard {
|
|
|
114
116
|
* Whether to display a visible border around the card.
|
|
115
117
|
*/
|
|
116
118
|
this.cardShowBorder = true;
|
|
117
|
-
this
|
|
118
|
-
["split-vertical", '"a b"'],
|
|
119
|
-
["split-horizontal", '"a" "b"'],
|
|
120
|
-
["2x2", '"a b" "c d"'],
|
|
121
|
-
["3x3", '"a b c" "d e f" "g h i"'],
|
|
122
|
-
["4x4", '"a b c d" "e f g h" "i j k l" "m n o p"'],
|
|
123
|
-
["1-over-2", '"a a" "b c"'],
|
|
124
|
-
["2-over-1", '"a b" "c c"'],
|
|
125
|
-
["1-over-3", '"a a a " "b c d"'],
|
|
126
|
-
["3-over-1", '"a b c" "d d d"'],
|
|
127
|
-
["custom-template", '"a b" "c c c"'],
|
|
128
|
-
["gold3", '"a c" "b c"'],
|
|
129
|
-
["gold4", '"a b c c" "d d c c"'],
|
|
130
|
-
]);
|
|
119
|
+
withComponentStatus(this);
|
|
131
120
|
this.errors = withHasError(this);
|
|
132
121
|
this.resolveInherited = withInheritedProps(this, [
|
|
133
122
|
{ propName: "titleScenarios", ancestorAttr: "title-scenarios" },
|
|
@@ -139,16 +128,13 @@ export class LayoutCard {
|
|
|
139
128
|
}
|
|
140
129
|
connectedCallback() {
|
|
141
130
|
this.stores = getStores(this.element);
|
|
142
|
-
// Reflect resolved inherited values to host attributes so child vis
|
|
143
|
-
// components can read them during their own DOM traversal.
|
|
144
|
-
this.reflectInheritedAttrs();
|
|
145
131
|
}
|
|
146
132
|
getCommonStyles() {
|
|
147
133
|
let height = "100%";
|
|
148
134
|
if (this.cardFitToContent === true) {
|
|
149
135
|
height = "fit-content";
|
|
150
136
|
}
|
|
151
|
-
// Width is always 100%
|
|
137
|
+
// Width is always 100% - the card is bounded by its parent grid cell.
|
|
152
138
|
// Using fit-content for width creates a circular dependency where the
|
|
153
139
|
// card width depends on child content but children need the card width
|
|
154
140
|
// for auto-scaling.
|
|
@@ -159,26 +145,11 @@ export class LayoutCard {
|
|
|
159
145
|
gap: this.cardGridGap + "px",
|
|
160
146
|
};
|
|
161
147
|
}
|
|
162
|
-
calculateFractions(input) {
|
|
163
|
-
const items = input.trim().split(/\s+/);
|
|
164
|
-
const count = items.length;
|
|
165
|
-
if (count === 0)
|
|
166
|
-
return "minmax(0, 1fr)";
|
|
167
|
-
return Array(count).fill("minmax(0, 1fr)").join(" ");
|
|
168
|
-
}
|
|
169
148
|
getGridTemplateColumns(name) {
|
|
170
|
-
|
|
171
|
-
const pattern = /"[\w\d\s.]+"/g;
|
|
172
|
-
const matches = template.match(pattern);
|
|
173
|
-
if (!matches || matches.length === 0)
|
|
174
|
-
return "minmax(0, 1fr)";
|
|
175
|
-
return this.calculateFractions(matches[0]);
|
|
149
|
+
return templateColumns(this.getTemplatePattern(name));
|
|
176
150
|
}
|
|
177
151
|
getRowCount(name) {
|
|
178
|
-
|
|
179
|
-
const pattern = /"[\w\d\s.]+"/g;
|
|
180
|
-
const matches = template.match(pattern);
|
|
181
|
-
return matches ? matches.length : 1;
|
|
152
|
+
return templateRows(this.getTemplatePattern(name)).length || 1;
|
|
182
153
|
}
|
|
183
154
|
getGridTemplateRows(name) {
|
|
184
155
|
const rowCount = this.getRowCount(name);
|
|
@@ -207,30 +178,27 @@ export class LayoutCard {
|
|
|
207
178
|
})));
|
|
208
179
|
}
|
|
209
180
|
extractSlotNames(styleElement) {
|
|
210
|
-
|
|
211
|
-
return [];
|
|
212
|
-
}
|
|
213
|
-
const words = styleElement.match(/\b\w+\b/g);
|
|
214
|
-
if (!words) {
|
|
215
|
-
return [];
|
|
216
|
-
}
|
|
217
|
-
return Array.from(new Set(words));
|
|
181
|
+
return templateSlotNames(styleElement);
|
|
218
182
|
}
|
|
219
183
|
getTemplatePattern(name) {
|
|
220
|
-
|
|
221
|
-
return '"a"';
|
|
222
|
-
}
|
|
223
|
-
if (name === "custom-template") {
|
|
224
|
-
return this.cardCustomTemplate;
|
|
225
|
-
}
|
|
226
|
-
return this.templateMap.get(name);
|
|
184
|
+
return templateAreas(name, this.cardCustomTemplate);
|
|
227
185
|
}
|
|
228
186
|
async getNumberOfSlot(name) {
|
|
229
187
|
const template = this.getTemplatePattern(name);
|
|
230
188
|
return this.extractSlotNames(template).length;
|
|
231
189
|
}
|
|
232
|
-
|
|
233
|
-
|
|
190
|
+
componentWillRender() {
|
|
191
|
+
const problem = this.cardLayout === CUSTOM_TEMPLATE ? templateProblem(this.cardCustomTemplate) : undefined;
|
|
192
|
+
if (problem) {
|
|
193
|
+
this.errors.addOrReplace({
|
|
194
|
+
id: "ERR_cardCustomTemplate",
|
|
195
|
+
type: "warning",
|
|
196
|
+
message: `cardCustomTemplate: ${problem}`,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
this.errors.remove("ERR_cardCustomTemplate");
|
|
201
|
+
}
|
|
234
202
|
}
|
|
235
203
|
setCardClass() {
|
|
236
204
|
if (this.cardShowBorder === true) {
|
|
@@ -238,26 +206,9 @@ export class LayoutCard {
|
|
|
238
206
|
}
|
|
239
207
|
return "card_box";
|
|
240
208
|
}
|
|
241
|
-
/**
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
* vis components (bn-table, bn-chart-*) performing their own DOM walk
|
|
245
|
-
* read the actual value instead of the literal "inherited-page" keyword.
|
|
246
|
-
*/
|
|
247
|
-
reflectInheritedAttrs() {
|
|
248
|
-
const mappings = [
|
|
249
|
-
{ prop: "titleScenarios", attr: "title-scenarios" },
|
|
250
|
-
{ prop: "titleVariances", attr: "title-variances" },
|
|
251
|
-
{ prop: "titleOrder", attr: "title-order" },
|
|
252
|
-
{ prop: "titleOrderDirection", attr: "title-order-direction" },
|
|
253
|
-
{ prop: "ruleset", attr: "ruleset" },
|
|
254
|
-
];
|
|
255
|
-
for (const { prop, attr } of mappings) {
|
|
256
|
-
const resolved = this.resolveInherited(prop, this[prop]);
|
|
257
|
-
if (resolved !== undefined) {
|
|
258
|
-
this.element.setAttribute(attr, resolved);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
209
|
+
/** The value of a prop for the inner title. An unresolved keyword reaches it as blank. */
|
|
210
|
+
titleProp(prop) {
|
|
211
|
+
return this.resolveInherited(prop, this[prop], "").value;
|
|
261
212
|
}
|
|
262
213
|
prepareTitleImage(value) {
|
|
263
214
|
if (value == null || value === "") {
|
|
@@ -271,10 +222,10 @@ export class LayoutCard {
|
|
|
271
222
|
return assetsState[value] || value;
|
|
272
223
|
}
|
|
273
224
|
render() {
|
|
274
|
-
var _a
|
|
225
|
+
var _a;
|
|
275
226
|
const style = this.getLayoutStyle();
|
|
276
227
|
const arrOfSlots = this.extractSlotNames(style["grid-template-areas"]);
|
|
277
|
-
return (h("bn-card", { key: '
|
|
228
|
+
return (h("bn-card", { key: '5356123d5ccb6a4d201b19f27b739d2e3738654c', styles: this.styles, "selected-style": this.selectedStyle, class: this.setCardClass() }, h("div", { key: '2847a91836d59929ce6c14d934ec20f408159b0e', class: "cardtitle" }, h("bn-title", { key: '54a7d3136ef39c616319001bf10575be3de787e6', "i18n-namespace": (_a = this.i18nNamespace) !== null && _a !== void 0 ? _a : this.titleNamespace, ruleset: this.titleProp("ruleset"), "business-unit": this.titleBusinessUnit, scenarios: this.titleProp("titleScenarios"), variances: this.titleProp("titleVariances"), order: this.titleProp("titleOrder"), "order-direction": this.titleProp("titleOrderDirection"), measures: this.titleMeasures, "date-start": this.titleDateStart, "date-end": this.titleDateEnd, "date-format": this.titleDateFormat, "date-link": this.titleDateLink }), this.titleImage != null && this.titleImage !== "" ? (h("img", { class: "image", src: this.prepareTitleImage(this.titleImage) })) : ("")), h("bn-body", { key: '6109186cc1d27c73b38a5fd08db72373e0e147c4' }, h("div", { key: '673e56a5d2a313a968c4d4e52e697f1f8590f265', style: style, "data-bn-fit-content": this.cardFitToContent ? String(this.getRowCount(this.cardLayout)) : null }, this.getSlots(arrOfSlots))), h("bn-footer", { key: 'd7788950df85f3babff77294ccadb6ea72490192', text: this.footerText, "page-number": "0", "display-page-number": "false" })));
|
|
278
229
|
}
|
|
279
230
|
static get is() { return "bn-layout-card"; }
|
|
280
231
|
static get encapsulation() { return "shadow"; }
|