@bino-bi/bn-template-engine 1.0.0-alpha.9 → 1.0.0-next.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -21
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-28d5c266.entry.js +1 -0
- package/dist/bn-template-engine/p-2d3ea756.entry.js +1 -0
- package/dist/bn-template-engine/p-2fba7c99.entry.js +1 -0
- package/dist/bn-template-engine/p-6077155f.entry.js +1 -0
- package/dist/bn-template-engine/p-687032d5.entry.js +1 -0
- package/dist/bn-template-engine/p-6c7f0076.entry.js +1 -0
- package/dist/bn-template-engine/p-6lOdN-fB.js +1 -0
- package/dist/bn-template-engine/p-7e9dbc93.entry.js +1 -0
- package/dist/bn-template-engine/p-99477a27.entry.js +1 -0
- package/dist/bn-template-engine/p-A8xyE4b1.js +1 -0
- package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
- package/dist/bn-template-engine/p-BgIpdpfH.js +1 -0
- package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
- package/dist/bn-template-engine/p-BpWWgN6k.js +1 -0
- package/dist/bn-template-engine/p-C5uvAEKI.js +1 -0
- package/dist/bn-template-engine/p-C8Q0lsaU.js +1 -0
- package/dist/bn-template-engine/p-C9i1Xsib.js +1 -0
- package/dist/bn-template-engine/p-CJThzFZm.js +1 -0
- package/dist/bn-template-engine/p-CYE0I1Mx.js +1 -0
- package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
- package/dist/bn-template-engine/p-DwYUTvvI.js +1 -0
- package/dist/bn-template-engine/p-a1380d7c.entry.js +1 -0
- package/dist/bn-template-engine/p-a4ea9a79.entry.js +1 -0
- package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
- package/dist/bn-template-engine/p-b5274369.entry.js +1 -0
- package/dist/bn-template-engine/p-b9e94127.entry.js +1 -0
- package/dist/bn-template-engine/p-ba912130.entry.js +1 -0
- package/dist/bn-template-engine/p-de29986f.entry.js +1 -0
- package/dist/bn-template-engine/p-eEfqksk-.js +1 -0
- package/dist/bn-template-engine/p-fFtEvsY-.js +1 -0
- package/dist/cjs/AxisConfig-D7CAyPLO.js +233 -0
- package/dist/cjs/LabelCollisionManager-DkdQ9Xdg.js +412 -0
- package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
- package/dist/cjs/Order-IPfAP0q8.js +87 -0
- package/dist/cjs/SVGStyle-BD8jApd4.js +8209 -0
- package/dist/cjs/SVGVariancesStyleGroup-BaWzR951.js +50 -0
- package/dist/cjs/VarianceMeasure-BBWTgv2e.js +372 -0
- package/dist/cjs/XYChartDataRow-BoR0CTfl.js +829 -0
- package/dist/cjs/bn-asset_21.cjs.entry.js +16105 -0
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
- package/dist/cjs/bn-grid.cjs.entry.js +5 -3
- package/dist/cjs/bn-image.cjs.entry.js +5 -3
- package/dist/cjs/bn-internationalization.cjs.entry.js +10 -8
- package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +8 -79
- package/dist/cjs/bn-tree.cjs.entry.js +4 -2
- package/dist/cjs/context-protocol-BBhT9B52.js +9505 -0
- package/dist/cjs/editor-companion.cjs.entry.js +13 -6
- package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
- package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
- package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
- package/dist/cjs/layoutObserver-DUYYkDMQ.js +199 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
- package/dist/cjs/scaling-BIJQ2NV1.js +589 -0
- package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
- package/dist/cjs/withScalingGroup-D5clRvRe.js +73 -0
- package/dist/cjs/withStyled-Cm9dWQhu.js +1168 -0
- package/dist/collection/collection-manifest.json +9 -1
- package/dist/collection/components/bn-body/bn-body.css +1 -0
- package/dist/collection/components/bn-card/bn-card.css +2 -0
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
- package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
- package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
- package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +126 -43
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +104 -37
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +101 -60
- package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
- package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
- package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +161 -44
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +97 -32
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +151 -75
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +10 -4
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
- package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
- package/dist/collection/components/bn-context/bn-context.js +20 -1
- package/dist/collection/components/bn-dataset/bn-dataset.js +226 -23
- package/dist/collection/components/bn-datasource/bn-datasource.js +163 -12
- package/dist/collection/components/bn-footer/bn-footer.js +1 -1
- package/dist/collection/components/bn-grid/bn-grid.js +20 -1
- package/dist/collection/components/bn-image/bn-image.js +1 -1
- package/dist/collection/components/bn-internationalization/bn-internationalization.js +10 -7
- package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -3
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +98 -35
- package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -3
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +98 -25
- package/dist/collection/components/bn-message/bn-message.css +6 -2
- package/dist/collection/components/bn-message/bn-message.js +3 -2
- package/dist/collection/components/bn-page/bn-page.js +1 -1
- package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
- package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.css +3 -0
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
- package/dist/collection/components/bn-table/bn-table.js +318 -62
- package/dist/collection/components/bn-table/ibcs-table.css +8 -0
- package/dist/collection/components/bn-table/ibcs-table.js +162 -33
- package/dist/collection/components/bn-table/utils/Table.js +72 -29
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
- package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
- package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
- package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +120 -23
- package/dist/collection/components/bn-table/utils/helper/DataQuery.js +380 -50
- package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
- package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
- package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
- package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
- package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
- package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +20 -4
- package/dist/collection/components/bn-template/bn-template.js +1 -1
- package/dist/collection/components/bn-text/bn-text.js +2 -75
- package/dist/collection/components/bn-title/bn-title.js +31 -3
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +52 -6
- package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +7 -4
- package/dist/collection/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.js +6 -2
- package/dist/collection/components/bn-title/ibcs-title/utils/model/TitleConfig.js +5 -0
- package/dist/collection/components/bn-tree/bn-tree.js +19 -0
- package/dist/collection/components/editor-companion/editor-companion.js +12 -5
- package/dist/collection/context/scopedDb.js +127 -0
- package/dist/collection/stores/componentStyles.js +67 -0
- package/dist/collection/stores/createScopedStores.js +11 -5
- package/dist/collection/stores/internationalization.js +77 -3
- package/dist/collection/stores/ruleSets.js +46 -0
- package/dist/collection/utils/DateStringFactory.js +31 -0
- package/dist/collection/utils/constants.js +5 -0
- package/dist/collection/utils/dataAnalyzer.js +14 -8
- package/dist/collection/utils/ibcsRuleSet.js +14 -26
- package/dist/collection/utils/layoutObserver.js +88 -0
- package/dist/collection/utils/parentDimensions.js +71 -15
- package/dist/collection/utils/sanitizeHtml.js +81 -0
- package/dist/collection/utils/validate.js +47 -0
- package/dist/collection/utils/withBodyObserver.js +12 -7
- package/dist/collection/utils/withComponentStyle.js +3 -5
- package/dist/collection/utils/withDataset.js +43 -39
- package/dist/collection/utils/withDatasource.js +28 -18
- package/dist/collection/utils/withInheritedProps.js +26 -1
- package/dist/collection/utils/withRuleSet.js +105 -0
- package/dist/collection/utils/withScalingGroup.js +69 -0
- package/dist/collection/utils/withTranslation.js +53 -15
- package/dist/collection/utils/xy/FacetGrid.js +36 -0
- package/dist/collection/utils/xy/IsoCurves.js +156 -0
- package/dist/collection/utils/xy/NumericScale.js +103 -0
- package/dist/collection/utils/xy/PointLabeler.js +96 -0
- package/dist/collection/utils/xy/RadiusScale.js +42 -0
- package/dist/collection/utils/xy/SeriesPalette.js +80 -0
- package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
- package/dist/collection/utils/xy/XYFrame.js +120 -0
- package/dist/collection/utils/xy/XYLegend.js +107 -0
- package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
- package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
- package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
- package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
- package/dist/components/AxisConfig.js +1 -0
- package/dist/components/CompareUtil.js +1 -0
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/LabelCollisionManager.js +1 -0
- package/dist/components/NumericScale.js +1 -0
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGVariancesStyleGroup.js +1 -1
- package/dist/components/SiPrefix.js +1 -0
- package/dist/components/StringAdapter.js +1 -0
- package/dist/components/VarianceMeasure.js +1 -0
- package/dist/components/XYChartDataRow.js +1 -0
- package/dist/components/bn-body2.js +1 -1
- package/dist/components/bn-card2.js +1 -1
- package/dist/components/bn-chart-bubble.d.ts +11 -0
- package/dist/components/bn-chart-bubble.js +1 -0
- package/dist/components/bn-chart-bullet.d.ts +11 -0
- package/dist/components/bn-chart-bullet.js +1 -0
- package/dist/components/bn-chart-scatter.d.ts +11 -0
- package/dist/components/bn-chart-scatter.js +1 -0
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-component-style.js +1 -1
- package/dist/components/bn-context.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-footer2.js +1 -1
- package/dist/components/bn-grid.js +1 -1
- package/dist/components/bn-image.js +1 -1
- package/dist/components/bn-internationalization.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-message2.js +1 -1
- package/dist/components/bn-page2.js +1 -1
- package/dist/components/bn-ruleset.d.ts +11 -0
- package/dist/components/bn-ruleset.js +1 -0
- package/dist/components/bn-scaling-group.d.ts +11 -0
- package/dist/components/bn-scaling-group.js +1 -0
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-template.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/formatter.js +1 -0
- package/dist/components/ibcs-chart-bubble.d.ts +11 -0
- package/dist/components/ibcs-chart-bubble.js +1 -0
- package/dist/components/ibcs-chart-bubble2.js +1 -0
- package/dist/components/ibcs-chart-bullet.d.ts +11 -0
- package/dist/components/ibcs-chart-bullet.js +1 -0
- package/dist/components/ibcs-chart-bullet2.js +1 -0
- package/dist/components/ibcs-chart-scatter.d.ts +11 -0
- package/dist/components/ibcs-chart-scatter.js +1 -0
- package/dist/components/ibcs-chart-scatter2.js +1 -0
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/layoutObserver.js +1 -0
- package/dist/components/luxon.js +1 -0
- package/dist/components/main.js +1 -0
- package/dist/components/merge.js +1 -0
- package/dist/components/sanitizeHtml.js +1 -0
- package/dist/components/stackColors.js +1 -0
- package/dist/components/validate.js +1 -1
- package/dist/components/withBodyObserver.js +1 -1
- package/dist/components/withComponentStyle.js +1 -1
- package/dist/components/withDataset.js +1 -0
- package/dist/components/withRuleSet.js +1 -0
- package/dist/components/withScalingGroup.js +1 -0
- package/dist/components/withStyled.js +1 -1
- package/dist/components/withTranslation.js +1 -1
- package/dist/esm/AxisConfig-ByIP5J-9.js +224 -0
- package/dist/esm/LabelCollisionManager-DaNiDiM9.js +404 -0
- package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
- package/dist/esm/Order-BQeJE_yi.js +83 -0
- package/dist/esm/SVGStyle-BwBlY3Km.js +8199 -0
- package/dist/esm/SVGVariancesStyleGroup-BpGW4CvN.js +48 -0
- package/dist/esm/VarianceMeasure-CE3N8Bea.js +364 -0
- package/dist/esm/XYChartDataRow-DeMI1JKU.js +820 -0
- package/dist/esm/bn-asset_21.entry.js +16083 -0
- package/dist/esm/bn-chart-bubble.entry.js +760 -0
- package/dist/esm/bn-chart-bullet.entry.js +783 -0
- package/dist/esm/bn-chart-scatter.entry.js +656 -0
- package/dist/esm/bn-grid.entry.js +5 -3
- package/dist/esm/bn-image.entry.js +5 -3
- package/dist/esm/bn-internationalization.entry.js +10 -8
- package/dist/esm/bn-ruleset.entry.js +39 -0
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +1 -1
- package/dist/esm/bn-text.entry.js +7 -78
- package/dist/esm/bn-tree.entry.js +4 -2
- package/dist/esm/context-protocol-d8MHrEo8.js +9490 -0
- package/dist/esm/editor-companion.entry.js +13 -6
- package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
- package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
- package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
- package/dist/esm/layoutObserver-BJBEyhNf.js +196 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
- package/dist/esm/scaling-BGnpSN1j.js +581 -0
- package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
- package/dist/esm/withScalingGroup-CC3UcvC5.js +71 -0
- package/dist/esm/withStyled-2l5Tx3cf.js +1135 -0
- package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
- package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
- package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
- package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
- package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
- package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
- package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
- package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
- package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
- package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +21 -12
- package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
- package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
- package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +21 -12
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +7 -3
- package/dist/types/components/bn-context/bn-context.d.ts +8 -0
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
- package/dist/types/components/bn-grid/bn-grid.d.ts +8 -0
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +39 -8
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +36 -1
- package/dist/types/components/bn-message/bn-message.d.ts +5 -2
- package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
- package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
- package/dist/types/components/bn-table/bn-table.d.ts +74 -12
- package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
- package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
- package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
- package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
- package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
- package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
- package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
- package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
- package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
- package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
- package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
- package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
- package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
- package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
- package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
- package/dist/types/components/bn-title/bn-title.d.ts +12 -1
- package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +4 -0
- package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
- package/dist/types/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.d.ts +3 -1
- package/dist/types/components/bn-title/ibcs-title/utils/model/TitleConfig.d.ts +2 -0
- package/dist/types/components/bn-tree/bn-tree.d.ts +8 -0
- package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
- package/dist/types/components.d.ts +1725 -116
- package/dist/types/context/context-protocol.d.ts +7 -3
- package/dist/types/context/scopedDb.d.ts +37 -0
- package/dist/types/stores/componentStyles.d.ts +41 -0
- package/dist/types/stores/createScopedStores.d.ts +4 -2
- package/dist/types/stores/ruleSets.d.ts +40 -0
- package/dist/types/utils/DateStringFactory.d.ts +20 -1
- package/dist/types/utils/constants.d.ts +5 -0
- package/dist/types/utils/dataAnalyzer.d.ts +2 -1
- package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
- package/dist/types/utils/layoutObserver.d.ts +27 -0
- package/dist/types/utils/model/ChartStyles.d.ts +2 -1
- package/dist/types/utils/parentDimensions.d.ts +1 -1
- package/dist/types/utils/sanitizeHtml.d.ts +6 -0
- package/dist/types/utils/validate.d.ts +18 -0
- package/dist/types/utils/withDataset.d.ts +6 -2
- package/dist/types/utils/withDatasource.d.ts +3 -3
- package/dist/types/utils/withInheritedProps.d.ts +19 -0
- package/dist/types/utils/withRuleSet.d.ts +24 -0
- package/dist/types/utils/withScalingGroup.d.ts +14 -0
- package/dist/types/utils/withTranslation.d.ts +15 -5
- package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
- package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
- package/dist/types/utils/xy/NumericScale.d.ts +41 -0
- package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
- package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
- package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
- package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
- package/dist/types/utils/xy/XYFrame.d.ts +44 -0
- package/dist/types/utils/xy/XYLegend.d.ts +43 -0
- package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
- package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
- package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
- package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
- package/package.json +5 -4
- package/readme.md +9 -5
- package/dist/bn-template-engine/p-3141c4a2.entry.js +0 -1
- package/dist/bn-template-engine/p-67538176.entry.js +0 -1
- package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
- package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
- package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
- package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
- package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
- package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
- package/dist/bn-template-engine/p-c86395b8.entry.js +0 -1
- package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
- package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
- package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
- package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23547
- package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
- package/dist/cjs/scaling-CIAClQR5.js +0 -314
- package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
- package/dist/collection/stores/datasets.js +0 -14
- package/dist/collection/stores/datasources.js +0 -14
- package/dist/components/_commonjsHelpers.js +0 -1
- package/dist/components/alasql.min.js +0 -1
- package/dist/components/ibcsRuleSet.js +0 -1
- package/dist/components/scaling.js +0 -1
- package/dist/components/withInheritedProps.js +0 -1
- package/dist/esm/bn-asset_20.entry.js +0 -23526
- package/dist/esm/context-protocol-DdbSplvE.js +0 -656
- package/dist/esm/scaling-DGKKkuL9.js +0 -309
- package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
- package/dist/types/stores/datasets.d.ts +0 -14
- package/dist/types/stores/datasources.d.ts +0 -14
|
@@ -3,7 +3,6 @@ import withDatasource from "../../utils/withDatasource";
|
|
|
3
3
|
import withBodyObserver from "../../utils/withBodyObserver";
|
|
4
4
|
import { getStores } from "../../context/context-protocol";
|
|
5
5
|
import { calculateDatasetMeta } from "../../utils/datasetMetaCalculator";
|
|
6
|
-
import alasql from "alasql";
|
|
7
6
|
import withComponentStatus from "../../utils/withComponentStatus";
|
|
8
7
|
import withHasError from "../../utils/withHasError";
|
|
9
8
|
import { computeContentHash, decodeCompressedContent } from "../../utils/contentDecoder";
|
|
@@ -11,10 +10,14 @@ import { computeContentHash, decodeCompressedContent } from "../../utils/content
|
|
|
11
10
|
* Queries data from one or more `bn-datasource` entries via AlaSQL and
|
|
12
11
|
* writes the result to the `datasets` store (+ computed `DatasetMeta`).
|
|
13
12
|
*
|
|
14
|
-
* The
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* The body content is observed via `withBodyObserver` and may be:
|
|
14
|
+
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
15
|
+
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
16
|
+
* parsed body directly to the `datasets` store.
|
|
17
|
+
* 3. **URL** — place an `http://`/`https://` URL or a same-origin path
|
|
18
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint and
|
|
19
|
+
* write it to the `datasets` store. Set the `interval` prop (in seconds)
|
|
20
|
+
* to enable periodic re-fetching.
|
|
18
21
|
*/
|
|
19
22
|
export class Dataset {
|
|
20
23
|
constructor() {
|
|
@@ -36,16 +39,45 @@ export class Dataset {
|
|
|
36
39
|
* When false, body content is a compressed payload (`<hash>:<base64_gzip>`).
|
|
37
40
|
*/
|
|
38
41
|
this.raw = true;
|
|
42
|
+
/**
|
|
43
|
+
* Polling interval in **seconds** for URL mode.
|
|
44
|
+
* When set and the body content is a URL, the component re-fetches
|
|
45
|
+
* data at this interval. Has no effect for SQL, inline JSON or
|
|
46
|
+
* compressed content. Set to `0` or leave unset to disable polling.
|
|
47
|
+
*/
|
|
48
|
+
this.interval = 0;
|
|
39
49
|
this.lastBodyHash = null;
|
|
50
|
+
/** The query text last used to (re)create the SQL view, so we only `CREATE VIEW` when it actually changes. */
|
|
51
|
+
this.lastViewQuery = null;
|
|
52
|
+
/** The currently active URL (`null` when not in URL mode). */
|
|
53
|
+
this.currentUrl = null;
|
|
54
|
+
/** Timer ID for the polling interval. */
|
|
55
|
+
this.pollTimerId = null;
|
|
56
|
+
/** AbortController for cancelling in-flight fetch requests. */
|
|
57
|
+
this.abortController = null;
|
|
40
58
|
withComponentStatus(this);
|
|
41
59
|
this.errors = withHasError(this);
|
|
42
|
-
//
|
|
43
|
-
this
|
|
44
|
-
withDatasource(this, (name, data) => {
|
|
45
|
-
this.database.tables[name] = { data };
|
|
60
|
+
// Datasources already live in the shared db; just re-execute when any upstream notifies.
|
|
61
|
+
withDatasource(this, () => {
|
|
46
62
|
this.executeQuery();
|
|
47
63
|
});
|
|
48
64
|
withBodyObserver(this, (data) => {
|
|
65
|
+
const trimmed = data.trim();
|
|
66
|
+
// --- URL mode ---
|
|
67
|
+
if (this.isUrl(trimmed)) {
|
|
68
|
+
if (trimmed === this.currentUrl)
|
|
69
|
+
return;
|
|
70
|
+
this.currentUrl = trimmed;
|
|
71
|
+
this.lastBodyHash = null;
|
|
72
|
+
this.fetchAndStore(trimmed);
|
|
73
|
+
this.startPolling();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// --- Leaving URL mode → clean up ---
|
|
77
|
+
if (this.currentUrl !== null) {
|
|
78
|
+
this.cancelInFlight();
|
|
79
|
+
this.currentUrl = null;
|
|
80
|
+
}
|
|
49
81
|
let contentHash;
|
|
50
82
|
let body;
|
|
51
83
|
if (!this.raw && this.static) {
|
|
@@ -73,34 +105,182 @@ export class Dataset {
|
|
|
73
105
|
executeQuery() {
|
|
74
106
|
if (!this.stores)
|
|
75
107
|
this.stores = getStores(this.element);
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
108
|
+
if (!this.query || !this.name)
|
|
109
|
+
return;
|
|
110
|
+
const db = this.stores.db.db;
|
|
111
|
+
let result;
|
|
112
|
+
if (this.static) {
|
|
113
|
+
// Static JSON: parse and register as a table in the shared db.
|
|
114
|
+
try {
|
|
115
|
+
result = JSON.parse(this.query);
|
|
116
|
+
}
|
|
117
|
+
catch (e) {
|
|
118
|
+
console.error("Failed to parse static dataset", e);
|
|
119
|
+
result = [];
|
|
120
|
+
}
|
|
121
|
+
db.tables[this.name] = { data: Array.isArray(result) ? result : [] };
|
|
122
|
+
this.lastViewQuery = null;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
// SQL: register the dataset as a view in the shared db. Recreate only when the
|
|
126
|
+
// query text changes; otherwise we just re-materialize so upstream data updates
|
|
127
|
+
// flow through.
|
|
128
|
+
if (this.lastViewQuery !== this.query) {
|
|
129
|
+
// alasql tracks names in BOTH `db.tables` and `db.views`, and its
|
|
130
|
+
// CREATE-conflict check looks at `db.tables`. Clean both locations
|
|
131
|
+
// before creating so devtools "Edit as HTML" (which destroys the old
|
|
132
|
+
// element and creates a new one without giving us a clean slate)
|
|
133
|
+
// doesn't trip the "already exists" guard.
|
|
134
|
+
try {
|
|
135
|
+
db.exec(`DROP VIEW \`${this.name}\``);
|
|
136
|
+
}
|
|
137
|
+
catch (_e) {
|
|
138
|
+
/* not registered as a view — fine */
|
|
139
|
+
}
|
|
140
|
+
if (db.tables[this.name] != null) {
|
|
141
|
+
delete db.tables[this.name];
|
|
142
|
+
}
|
|
143
|
+
// @ts-ignore - views typing is loose
|
|
144
|
+
if (db.views && db.views[this.name] != null) {
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
delete db.views[this.name];
|
|
147
|
+
}
|
|
79
148
|
try {
|
|
80
|
-
|
|
149
|
+
db.exec(`CREATE VIEW \`${this.name}\` AS ${this.query}`);
|
|
150
|
+
this.lastViewQuery = this.query;
|
|
81
151
|
}
|
|
82
152
|
catch (e) {
|
|
83
|
-
console.error("
|
|
153
|
+
console.error("bn-dataset: failed to register SQL view", e, this.query);
|
|
154
|
+
this.lastViewQuery = null;
|
|
84
155
|
result = [];
|
|
156
|
+
this.publish(result);
|
|
157
|
+
return;
|
|
85
158
|
}
|
|
86
159
|
}
|
|
87
|
-
|
|
88
|
-
result =
|
|
160
|
+
try {
|
|
161
|
+
result = db.exec(`SELECT * FROM \`${this.name}\``);
|
|
89
162
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
//
|
|
95
|
-
|
|
163
|
+
catch (_e) {
|
|
164
|
+
// Most common cause: an upstream datasource referenced by the view hasn't
|
|
165
|
+
// been registered yet (HTML parse/connectedCallback race). `withDatasource`
|
|
166
|
+
// re-fires executeQuery on every upstream notify, so we'll retry then.
|
|
167
|
+
// Skip publish so we don't clobber datasetsMeta with empty data.
|
|
168
|
+
return;
|
|
96
169
|
}
|
|
97
170
|
}
|
|
171
|
+
this.publish(result);
|
|
172
|
+
}
|
|
173
|
+
/** Notifies db subscribers and updates the derived `datasetsMeta` store. */
|
|
174
|
+
publish(result) {
|
|
175
|
+
if (this.latestResult === result) {
|
|
176
|
+
// Even if the materialized object reference is unchanged, upstream data may have moved
|
|
177
|
+
// (notably for views) — fire notify so consumers re-render against the fresh table state.
|
|
178
|
+
this.stores.db.notify(this.name);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
this.latestResult = result;
|
|
182
|
+
this.stores.db.notify(this.name);
|
|
183
|
+
// @ts-ignore - DatasetMeta is small derived metadata; kept as a @stencil/store per the plan.
|
|
184
|
+
this.stores.datasetsMeta.set(this.name, calculateDatasetMeta(result));
|
|
98
185
|
}
|
|
99
186
|
nameUpdated() {
|
|
100
187
|
this.executeQuery();
|
|
101
188
|
}
|
|
189
|
+
onIntervalChange() {
|
|
190
|
+
if (this.currentUrl) {
|
|
191
|
+
this.startPolling();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
disconnectedCallback() {
|
|
195
|
+
var _a, _b;
|
|
196
|
+
this.cancelInFlight();
|
|
197
|
+
if (((_b = (_a = this.stores) === null || _a === void 0 ? void 0 : _a.db) === null || _b === void 0 ? void 0 : _b.db) && this.name) {
|
|
198
|
+
const db = this.stores.db.db;
|
|
199
|
+
try {
|
|
200
|
+
db.exec(`DROP VIEW \`${this.name}\``);
|
|
201
|
+
}
|
|
202
|
+
catch (_e) {
|
|
203
|
+
// not registered as a view — fine
|
|
204
|
+
}
|
|
205
|
+
if (db.tables[this.name] != null) {
|
|
206
|
+
delete db.tables[this.name];
|
|
207
|
+
}
|
|
208
|
+
// @ts-ignore - views typing is loose
|
|
209
|
+
if (db.views && db.views[this.name] != null) {
|
|
210
|
+
// @ts-ignore
|
|
211
|
+
delete db.views[this.name];
|
|
212
|
+
}
|
|
213
|
+
this.stores.db.notify(this.name);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Returns `true` if the text is a fetchable URL: an absolute `http(s)://`
|
|
218
|
+
* URL, or a same-origin path starting with `/` (but not `//`, which is a
|
|
219
|
+
* protocol-relative URL we treat as inline-mode escape).
|
|
220
|
+
*/
|
|
221
|
+
isUrl(text) {
|
|
222
|
+
if (text.startsWith("http://") || text.startsWith("https://"))
|
|
223
|
+
return true;
|
|
224
|
+
return text.startsWith("/") && !text.startsWith("//");
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Fetches JSON from the given URL and stores the result as the dataset.
|
|
228
|
+
* Cancels any in-flight request before starting a new one.
|
|
229
|
+
*/
|
|
230
|
+
async fetchAndStore(url) {
|
|
231
|
+
var _a;
|
|
232
|
+
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
233
|
+
this.abortController = new AbortController();
|
|
234
|
+
if (!this.stores)
|
|
235
|
+
this.stores = getStores(this.element);
|
|
236
|
+
try {
|
|
237
|
+
const response = await fetch(url, { signal: this.abortController.signal });
|
|
238
|
+
const json = await response.json();
|
|
239
|
+
const db = this.stores.db.db;
|
|
240
|
+
db.tables[this.name] = { data: Array.isArray(json) ? json : [] };
|
|
241
|
+
this.lastViewQuery = null;
|
|
242
|
+
this.publish(json);
|
|
243
|
+
}
|
|
244
|
+
catch (e) {
|
|
245
|
+
if (e instanceof DOMException && e.name === "AbortError")
|
|
246
|
+
return;
|
|
247
|
+
console.error("bn-dataset: error fetching URL", e, url);
|
|
248
|
+
const db = this.stores.db.db;
|
|
249
|
+
db.tables[this.name] = { data: [] };
|
|
250
|
+
this.lastViewQuery = null;
|
|
251
|
+
this.publish([]);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/** Stops the polling timer (does NOT touch any in-flight fetch). */
|
|
255
|
+
clearPollTimer() {
|
|
256
|
+
if (this.pollTimerId !== null) {
|
|
257
|
+
clearInterval(this.pollTimerId);
|
|
258
|
+
this.pollTimerId = null;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/** Stops the polling timer AND cancels any in-flight fetch. Use only when
|
|
262
|
+
* leaving URL mode entirely (disconnect or body changed to inline). */
|
|
263
|
+
cancelInFlight() {
|
|
264
|
+
var _a;
|
|
265
|
+
this.clearPollTimer();
|
|
266
|
+
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
267
|
+
this.abortController = null;
|
|
268
|
+
}
|
|
269
|
+
/** Starts (or restarts) the polling timer if in URL mode with a positive
|
|
270
|
+
* interval. Does NOT abort the kick-off fetch issued by the caller — it
|
|
271
|
+
* only resets the interval timer. */
|
|
272
|
+
startPolling() {
|
|
273
|
+
this.clearPollTimer();
|
|
274
|
+
if (this.currentUrl && this.interval > 0) {
|
|
275
|
+
this.pollTimerId = setInterval(() => {
|
|
276
|
+
if (this.currentUrl) {
|
|
277
|
+
this.fetchAndStore(this.currentUrl);
|
|
278
|
+
}
|
|
279
|
+
}, this.interval * 1000);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
102
282
|
render() {
|
|
103
|
-
return h(Host, { key: '
|
|
283
|
+
return h(Host, { key: 'bfa62b924abb8097cd9bad75eb71ab38caf02267' });
|
|
104
284
|
}
|
|
105
285
|
static get is() { return "bn-dataset"; }
|
|
106
286
|
static get originalStyleUrls() {
|
|
@@ -193,6 +373,26 @@ export class Dataset {
|
|
|
193
373
|
"reflect": false,
|
|
194
374
|
"attribute": "raw",
|
|
195
375
|
"defaultValue": "true"
|
|
376
|
+
},
|
|
377
|
+
"interval": {
|
|
378
|
+
"type": "number",
|
|
379
|
+
"mutable": false,
|
|
380
|
+
"complexType": {
|
|
381
|
+
"original": "number",
|
|
382
|
+
"resolved": "number",
|
|
383
|
+
"references": {}
|
|
384
|
+
},
|
|
385
|
+
"required": false,
|
|
386
|
+
"optional": false,
|
|
387
|
+
"docs": {
|
|
388
|
+
"tags": [],
|
|
389
|
+
"text": "Polling interval in **seconds** for URL mode.\nWhen set and the body content is a URL, the component re-fetches\ndata at this interval. Has no effect for SQL, inline JSON or\ncompressed content. Set to `0` or leave unset to disable polling."
|
|
390
|
+
},
|
|
391
|
+
"getter": false,
|
|
392
|
+
"setter": false,
|
|
393
|
+
"reflect": false,
|
|
394
|
+
"attribute": "interval",
|
|
395
|
+
"defaultValue": "0"
|
|
196
396
|
}
|
|
197
397
|
};
|
|
198
398
|
}
|
|
@@ -201,6 +401,9 @@ export class Dataset {
|
|
|
201
401
|
return [{
|
|
202
402
|
"propName": "name",
|
|
203
403
|
"methodName": "nameUpdated"
|
|
404
|
+
}, {
|
|
405
|
+
"propName": "interval",
|
|
406
|
+
"methodName": "onIntervalChange"
|
|
204
407
|
}];
|
|
205
408
|
}
|
|
206
409
|
}
|
|
@@ -5,27 +5,64 @@ import withComponentStatus from "../../utils/withComponentStatus";
|
|
|
5
5
|
import withHasError from "../../utils/withHasError";
|
|
6
6
|
import { computeContentHash, decodeCompressedContent } from "../../utils/contentDecoder";
|
|
7
7
|
/**
|
|
8
|
-
* Ingests
|
|
8
|
+
* Ingests data and writes it to the scoped `datasources` store.
|
|
9
9
|
*
|
|
10
|
-
* Data
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Data can be provided in three ways:
|
|
11
|
+
* 1. **Inline JSON** — Place JSON text inside the element body (default).
|
|
12
|
+
* 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
|
|
13
|
+
* 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
|
|
14
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint.
|
|
13
15
|
*
|
|
14
|
-
*
|
|
16
|
+
* In URL mode the component fetches JSON from the URL. Set the `interval`
|
|
17
|
+
* prop (in seconds) to enable periodic re-fetching (polling).
|
|
18
|
+
*
|
|
19
|
+
* Other components (e.g. `bn-dataset`) reference the stored data by the
|
|
20
|
+
* `name` prop to run queries against it.
|
|
15
21
|
*/
|
|
16
22
|
export class Datasource {
|
|
17
23
|
constructor() {
|
|
18
24
|
/**
|
|
19
25
|
* When true (default), body content is plain JSON text.
|
|
20
26
|
* When false, body content is a compressed payload (`<hash>:<base64_gzip>`).
|
|
27
|
+
* Ignored in URL mode.
|
|
21
28
|
*/
|
|
22
29
|
this.raw = true;
|
|
30
|
+
/**
|
|
31
|
+
* Polling interval in **seconds** for URL mode.
|
|
32
|
+
* When set and the body content is a URL, the component re-fetches
|
|
33
|
+
* data at this interval. Has no effect for inline JSON or compressed content.
|
|
34
|
+
* Set to `0` or leave unset to disable polling.
|
|
35
|
+
*/
|
|
36
|
+
this.interval = 0;
|
|
23
37
|
this.lastHash = null;
|
|
38
|
+
/** The currently active URL (`null` when in inline-JSON mode). */
|
|
39
|
+
this.currentUrl = null;
|
|
40
|
+
/** Timer ID for the polling interval. */
|
|
41
|
+
this.pollTimerId = null;
|
|
42
|
+
/** AbortController for cancelling in-flight fetch requests. */
|
|
43
|
+
this.abortController = null;
|
|
24
44
|
withComponentStatus(this);
|
|
25
45
|
this.errors = withHasError(this);
|
|
26
46
|
withBodyObserver(this, (data) => {
|
|
27
47
|
if (!this.stores)
|
|
28
48
|
this.stores = getStores(this.element);
|
|
49
|
+
const trimmed = data.trim();
|
|
50
|
+
// --- URL mode ---
|
|
51
|
+
if (this.isUrl(trimmed)) {
|
|
52
|
+
if (trimmed === this.currentUrl)
|
|
53
|
+
return;
|
|
54
|
+
this.currentUrl = trimmed;
|
|
55
|
+
this.lastHash = null;
|
|
56
|
+
this.fetchAndStore(trimmed);
|
|
57
|
+
this.startPolling();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// --- Leaving URL mode → clean up ---
|
|
61
|
+
if (this.currentUrl !== null) {
|
|
62
|
+
this.cancelInFlight();
|
|
63
|
+
this.currentUrl = null;
|
|
64
|
+
}
|
|
65
|
+
// --- Inline JSON / compressed mode ---
|
|
29
66
|
try {
|
|
30
67
|
let contentHash;
|
|
31
68
|
let jsonString;
|
|
@@ -42,18 +79,106 @@ export class Datasource {
|
|
|
42
79
|
return;
|
|
43
80
|
this.lastHash = contentHash;
|
|
44
81
|
const json = JSON.parse(jsonString);
|
|
45
|
-
|
|
46
|
-
this.stores.datasources.set(this.name, json);
|
|
82
|
+
this.publish(json);
|
|
47
83
|
}
|
|
48
84
|
catch (e) {
|
|
49
85
|
console.error("Error parsing datasource", e, String(data).slice(0, 200));
|
|
50
|
-
|
|
51
|
-
this.stores.datasources.set(this.name, []);
|
|
86
|
+
this.publish([]);
|
|
52
87
|
}
|
|
53
88
|
});
|
|
54
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Writes the parsed data into the shared alasql database (as a table named
|
|
92
|
+
* after this datasource) and notifies subscribers.
|
|
93
|
+
*/
|
|
94
|
+
publish(json) {
|
|
95
|
+
const db = this.stores.db.db;
|
|
96
|
+
db.tables[this.name] = { data: Array.isArray(json) ? json : [] };
|
|
97
|
+
this.stores.db.notify(this.name);
|
|
98
|
+
}
|
|
99
|
+
onIntervalChange() {
|
|
100
|
+
if (this.currentUrl) {
|
|
101
|
+
this.startPolling();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
disconnectedCallback() {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
this.cancelInFlight();
|
|
107
|
+
const db = (_b = (_a = this.stores) === null || _a === void 0 ? void 0 : _a.db) === null || _b === void 0 ? void 0 : _b.db;
|
|
108
|
+
if (db && this.name) {
|
|
109
|
+
if (db.tables[this.name] != null) {
|
|
110
|
+
delete db.tables[this.name];
|
|
111
|
+
}
|
|
112
|
+
// @ts-ignore - views typing is loose
|
|
113
|
+
if (db.views && db.views[this.name] != null) {
|
|
114
|
+
// @ts-ignore
|
|
115
|
+
delete db.views[this.name];
|
|
116
|
+
}
|
|
117
|
+
this.stores.db.notify(this.name);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
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
|
+
/**
|
|
131
|
+
* Fetches JSON from the given URL and stores the result.
|
|
132
|
+
* Cancels any in-flight request before starting a new one.
|
|
133
|
+
*/
|
|
134
|
+
async fetchAndStore(url) {
|
|
135
|
+
var _a;
|
|
136
|
+
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
137
|
+
this.abortController = new AbortController();
|
|
138
|
+
if (!this.stores)
|
|
139
|
+
this.stores = getStores(this.element);
|
|
140
|
+
try {
|
|
141
|
+
const response = await fetch(url, { signal: this.abortController.signal });
|
|
142
|
+
const json = await response.json();
|
|
143
|
+
this.publish(json);
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
if (e instanceof DOMException && e.name === "AbortError")
|
|
147
|
+
return;
|
|
148
|
+
console.error("bn-datasource: error fetching URL", e, url);
|
|
149
|
+
this.publish([]);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/** Stops the polling timer (does NOT touch any in-flight fetch). */
|
|
153
|
+
clearPollTimer() {
|
|
154
|
+
if (this.pollTimerId !== null) {
|
|
155
|
+
clearInterval(this.pollTimerId);
|
|
156
|
+
this.pollTimerId = null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/** Stops the polling timer AND cancels any in-flight fetch. Use only when
|
|
160
|
+
* leaving URL mode entirely (disconnect or body changed to inline). */
|
|
161
|
+
cancelInFlight() {
|
|
162
|
+
var _a;
|
|
163
|
+
this.clearPollTimer();
|
|
164
|
+
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
165
|
+
this.abortController = null;
|
|
166
|
+
}
|
|
167
|
+
/** 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 — it
|
|
169
|
+
* only resets the interval timer. */
|
|
170
|
+
startPolling() {
|
|
171
|
+
this.clearPollTimer();
|
|
172
|
+
if (this.currentUrl && this.interval > 0) {
|
|
173
|
+
this.pollTimerId = setInterval(() => {
|
|
174
|
+
if (this.currentUrl) {
|
|
175
|
+
this.fetchAndStore(this.currentUrl);
|
|
176
|
+
}
|
|
177
|
+
}, this.interval * 1000);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
55
180
|
render() {
|
|
56
|
-
return h(Host, { key: '
|
|
181
|
+
return h(Host, { key: '4beaa62937dea949255669bfd5008a2928e460fc' });
|
|
57
182
|
}
|
|
58
183
|
static get is() { return "bn-datasource"; }
|
|
59
184
|
static get originalStyleUrls() {
|
|
@@ -80,7 +205,7 @@ export class Datasource {
|
|
|
80
205
|
"optional": false,
|
|
81
206
|
"docs": {
|
|
82
207
|
"tags": [],
|
|
83
|
-
"text": "Unique (template scope) name of the datasource"
|
|
208
|
+
"text": "Unique (template scope) name of the datasource."
|
|
84
209
|
},
|
|
85
210
|
"getter": false,
|
|
86
211
|
"setter": false,
|
|
@@ -99,15 +224,41 @@ export class Datasource {
|
|
|
99
224
|
"optional": false,
|
|
100
225
|
"docs": {
|
|
101
226
|
"tags": [],
|
|
102
|
-
"text": "When true (default), body content is plain JSON text.\nWhen false, body content is a compressed payload (`<hash>:<base64_gzip>`)."
|
|
227
|
+
"text": "When true (default), body content is plain JSON text.\nWhen false, body content is a compressed payload (`<hash>:<base64_gzip>`).\nIgnored in URL mode."
|
|
103
228
|
},
|
|
104
229
|
"getter": false,
|
|
105
230
|
"setter": false,
|
|
106
231
|
"reflect": false,
|
|
107
232
|
"attribute": "raw",
|
|
108
233
|
"defaultValue": "true"
|
|
234
|
+
},
|
|
235
|
+
"interval": {
|
|
236
|
+
"type": "number",
|
|
237
|
+
"mutable": false,
|
|
238
|
+
"complexType": {
|
|
239
|
+
"original": "number",
|
|
240
|
+
"resolved": "number",
|
|
241
|
+
"references": {}
|
|
242
|
+
},
|
|
243
|
+
"required": false,
|
|
244
|
+
"optional": false,
|
|
245
|
+
"docs": {
|
|
246
|
+
"tags": [],
|
|
247
|
+
"text": "Polling interval in **seconds** for URL mode.\nWhen set and the body content is a URL, the component re-fetches\ndata at this interval. Has no effect for inline JSON or compressed content.\nSet to `0` or leave unset to disable polling."
|
|
248
|
+
},
|
|
249
|
+
"getter": false,
|
|
250
|
+
"setter": false,
|
|
251
|
+
"reflect": false,
|
|
252
|
+
"attribute": "interval",
|
|
253
|
+
"defaultValue": "0"
|
|
109
254
|
}
|
|
110
255
|
};
|
|
111
256
|
}
|
|
112
257
|
static get elementRef() { return "element"; }
|
|
258
|
+
static get watchers() {
|
|
259
|
+
return [{
|
|
260
|
+
"propName": "interval",
|
|
261
|
+
"methodName": "onIntervalChange"
|
|
262
|
+
}];
|
|
263
|
+
}
|
|
113
264
|
}
|
|
@@ -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: '666fa787056f32825c15427f2a6c15b971fbc25e', id: this.displayPageNumber || this.text || this.code ? "container-page-footer" : "container", style: this.getFontStyles() }, h("div", { key: '691752d51748c4e1eb7ec25d380c00ddf0095c83', id: "footer-text" }, this.text != null ? h("span", { class: "note" }, this.text) : ""), h("div", { key: '561a81e063e110ef6386fb0056a05f1b6a0e0f44', id: "code" }, this.code != null ? h("img", { class: "image", src: getAssetPath(`${this.prepareAssetUrl(this.code)}`) }) : ""), h("div", { key: '963658fcff1a6dd07b448f85e8d170000422e3cc', 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"; }
|
|
@@ -262,7 +262,7 @@ export class Grid {
|
|
|
262
262
|
"grid-template-rows": this.getGridTemplateRows(),
|
|
263
263
|
gap: this.cellGap,
|
|
264
264
|
};
|
|
265
|
-
return (h(Host, { key: '
|
|
265
|
+
return (h(Host, { key: '9522911b83a725994d62b657469bfcdbcae4a795', style: this.getFontStyles() }, h("div", { key: 'c3d4fe8e552c31b0e10ca930a784867e1f711d01', class: "grid-container", style: gridContainerStyle }, this.renderTitle(), this.renderColumnHeaders(), this.renderDataCells()), h("slot", { key: '9772d659471df1d3588a1372fedd09d6b3bb459d' })));
|
|
266
266
|
}
|
|
267
267
|
static get is() { return "bn-grid"; }
|
|
268
268
|
static get encapsulation() { return "shadow"; }
|
|
@@ -378,6 +378,25 @@ export class Grid {
|
|
|
378
378
|
"attribute": "show-column-headers",
|
|
379
379
|
"defaultValue": "\"true\""
|
|
380
380
|
},
|
|
381
|
+
"i18nNamespace": {
|
|
382
|
+
"type": "string",
|
|
383
|
+
"mutable": false,
|
|
384
|
+
"complexType": {
|
|
385
|
+
"original": "string",
|
|
386
|
+
"resolved": "string",
|
|
387
|
+
"references": {}
|
|
388
|
+
},
|
|
389
|
+
"required": false,
|
|
390
|
+
"optional": false,
|
|
391
|
+
"docs": {
|
|
392
|
+
"tags": [],
|
|
393
|
+
"text": "I18n namespace inherited by this grid's children (their own namespace\nwins). Resolved at runtime from the `i18n-namespace` attribute by the\nnearest ancestor lookup in `withTranslation`; the grid renders no\ntranslated text itself. Declared so the attribute is part of the typed\npublic API rather than a bare DOM attribute."
|
|
394
|
+
},
|
|
395
|
+
"getter": false,
|
|
396
|
+
"setter": false,
|
|
397
|
+
"reflect": true,
|
|
398
|
+
"attribute": "i18n-namespace"
|
|
399
|
+
},
|
|
381
400
|
"showBorders": {
|
|
382
401
|
"type": "string",
|
|
383
402
|
"mutable": false,
|
|
@@ -37,7 +37,7 @@ export class Image {
|
|
|
37
37
|
return assetsState[value] || value;
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: 'cfa7e1b2978773f449f6596174edf51e4a61d4d7', style: this.getFontStyles() }, this.source != null && this.source !== "" ? h("img", { src: this.prepareAssetUrl(this.source) }) : ""));
|
|
41
41
|
}
|
|
42
42
|
static get is() { return "bn-image"; }
|
|
43
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -6,6 +6,7 @@ import withComponentStatus from "../../utils/withComponentStatus";
|
|
|
6
6
|
import withHasError from "../../utils/withHasError";
|
|
7
7
|
export class Internationalization {
|
|
8
8
|
constructor() {
|
|
9
|
+
this.namespace = "_system";
|
|
9
10
|
withComponentStatus(this);
|
|
10
11
|
this.errors = withHasError(this);
|
|
11
12
|
withBodyObserver(this, (data) => {
|
|
@@ -13,11 +14,12 @@ export class Internationalization {
|
|
|
13
14
|
this.stores = getStores(this.element);
|
|
14
15
|
try {
|
|
15
16
|
const i18n = flattenObject(JSON.parse(data));
|
|
16
|
-
|
|
17
|
-
const namespace = Object.assign({}, this.stores.internationalization.get(
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
this.
|
|
17
|
+
const ns = this.namespace || "_system";
|
|
18
|
+
const namespace = Object.assign({}, this.stores.internationalization.get(ns));
|
|
19
|
+
// Merge over the existing bundle (built-ins or earlier manifests) so
|
|
20
|
+
// partial overrides don't wipe unrelated keys.
|
|
21
|
+
namespace[this.code] = Object.assign(Object.assign({}, namespace[this.code]), i18n);
|
|
22
|
+
this.stores.internationalization.set(ns, namespace);
|
|
21
23
|
}
|
|
22
24
|
catch (e) {
|
|
23
25
|
console.error(e);
|
|
@@ -25,7 +27,7 @@ export class Internationalization {
|
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
render() {
|
|
28
|
-
return h(Host, { key: '
|
|
30
|
+
return h(Host, { key: '1b5e46fd06494aada4db697402746be6bcf950db' });
|
|
29
31
|
}
|
|
30
32
|
static get is() { return "bn-internationalization"; }
|
|
31
33
|
static get originalStyleUrls() {
|
|
@@ -76,7 +78,8 @@ export class Internationalization {
|
|
|
76
78
|
"getter": false,
|
|
77
79
|
"setter": false,
|
|
78
80
|
"reflect": false,
|
|
79
|
-
"attribute": "namespace"
|
|
81
|
+
"attribute": "namespace",
|
|
82
|
+
"defaultValue": "\"_system\""
|
|
80
83
|
}
|
|
81
84
|
};
|
|
82
85
|
}
|
|
@@ -3,17 +3,22 @@
|
|
|
3
3
|
color: var(--bn-font-color, black);
|
|
4
4
|
font-family: var(--bn-font-family, "Noto Sans", sans-serif);
|
|
5
5
|
font-size: var(--bn-font-size, 13.3333px);
|
|
6
|
-
display:
|
|
6
|
+
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
8
10
|
overflow: hidden;
|
|
9
|
-
float: left;
|
|
10
|
-
clear: left;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.cardtitle {
|
|
14
14
|
display: inline-flex;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
::slotted(*) {
|
|
18
|
+
flex: 1 1 auto;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
.image {
|
|
18
23
|
margin-right: 0.5em;
|
|
19
24
|
margin-top: 0.5em;
|