@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
|
@@ -41,8 +41,12 @@ const warnIfDatasource = (component, datasources) => {
|
|
|
41
41
|
* Mixin that subscribes a Stencil component to one or more datasets/datasources.
|
|
42
42
|
*
|
|
43
43
|
* **Naming convention:** The `datasets` HTML attribute accepts a comma-separated list of names.
|
|
44
|
-
* Names prefixed with `$` (e.g. `$revenue`) read directly from the raw
|
|
45
|
-
* unprefixed names read from
|
|
44
|
+
* Names prefixed with `$` (e.g. `$revenue`) read directly from the raw datasource tables;
|
|
45
|
+
* unprefixed names read from datasets (registered as tables/views by `<bn-dataset>`).
|
|
46
|
+
*
|
|
47
|
+
* Data is sourced from the shared per-context alasql database; each subscribed
|
|
48
|
+
* name is registered with `stores.db.subscribe(...)` and the rows are materialized
|
|
49
|
+
* via `db.exec("SELECT * FROM <name>")` whenever the producer fires `notify(name)`.
|
|
46
50
|
*
|
|
47
51
|
* The mixin installs a MutationObserver on the host element's `datasets` attribute so
|
|
48
52
|
* bindings update automatically when the attribute is changed at runtime.
|
|
@@ -55,12 +59,24 @@ const warnIfDatasource = (component, datasources) => {
|
|
|
55
59
|
const withDataset = (
|
|
56
60
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
61
|
component, onUpdate, onMetaUpdate) => {
|
|
58
|
-
let
|
|
59
|
-
let subscriptionSource;
|
|
62
|
+
let dbUnsubs = [];
|
|
60
63
|
let subscriptionMeta;
|
|
61
64
|
let datasets = [];
|
|
62
65
|
let datasources = [];
|
|
63
66
|
let stores;
|
|
67
|
+
/** Materialize the current rows for a subscribed name via the shared db, then deliver. */
|
|
68
|
+
const deliver = (name, isDatasource) => {
|
|
69
|
+
const tableName = isDatasource ? name.substring(1) : name;
|
|
70
|
+
let rows;
|
|
71
|
+
try {
|
|
72
|
+
rows = stores.db.db.exec(`SELECT * FROM \`${tableName}\``);
|
|
73
|
+
}
|
|
74
|
+
catch (_e) {
|
|
75
|
+
// Table/view not registered yet (producer hasn't fired). Treat as empty.
|
|
76
|
+
rows = [];
|
|
77
|
+
}
|
|
78
|
+
onUpdate(name, rows);
|
|
79
|
+
};
|
|
64
80
|
const deliverMeta = (name) => {
|
|
65
81
|
if (onMetaUpdate) {
|
|
66
82
|
// @ts-ignore
|
|
@@ -69,20 +85,30 @@ component, onUpdate, onMetaUpdate) => {
|
|
|
69
85
|
onMetaUpdate(name, meta);
|
|
70
86
|
}
|
|
71
87
|
};
|
|
88
|
+
/** Tear down current db subscriptions and re-subscribe based on `datasets` / `datasources`. */
|
|
89
|
+
const rebind = () => {
|
|
90
|
+
dbUnsubs.forEach((fn) => fn());
|
|
91
|
+
dbUnsubs = [];
|
|
92
|
+
datasets.forEach((name) => {
|
|
93
|
+
if (!name)
|
|
94
|
+
return;
|
|
95
|
+
dbUnsubs.push(stores.db.subscribe(name, () => deliver(name, false)));
|
|
96
|
+
deliver(name, false);
|
|
97
|
+
deliverMeta(name);
|
|
98
|
+
});
|
|
99
|
+
datasources.forEach((ref) => {
|
|
100
|
+
if (!ref)
|
|
101
|
+
return;
|
|
102
|
+
dbUnsubs.push(stores.db.subscribe(ref.substring(1), () => deliver(ref, true)));
|
|
103
|
+
deliver(ref, true);
|
|
104
|
+
});
|
|
105
|
+
};
|
|
72
106
|
const observer = new MutationObserver((mutations) => {
|
|
73
107
|
mutations.forEach((mutation) => {
|
|
74
108
|
if (mutation.attributeName === "datasets") {
|
|
75
109
|
[datasources, datasets] = partition((s) => s.startsWith("$"), getElement(component).getAttribute("datasets").split(","));
|
|
76
110
|
warnIfDatasource(component, datasources);
|
|
77
|
-
|
|
78
|
-
// @ts-ignore
|
|
79
|
-
onUpdate(name, stores.datasets.get(name));
|
|
80
|
-
deliverMeta(name);
|
|
81
|
-
});
|
|
82
|
-
datasources.forEach((name) => {
|
|
83
|
-
// @ts-ignore
|
|
84
|
-
onUpdate(name, stores.datasources.get(name.substring(1)));
|
|
85
|
-
});
|
|
111
|
+
rebind();
|
|
86
112
|
}
|
|
87
113
|
});
|
|
88
114
|
});
|
|
@@ -92,26 +118,8 @@ component, onUpdate, onMetaUpdate) => {
|
|
|
92
118
|
stores = getStores(element);
|
|
93
119
|
[datasources, datasets] = partition((s) => s.startsWith("$"), (element.getAttribute("datasets") || "").split(","));
|
|
94
120
|
warnIfDatasource(component, datasources);
|
|
95
|
-
|
|
96
|
-
// @ts-ignore
|
|
97
|
-
onUpdate(name, stores.datasets.get(name));
|
|
98
|
-
deliverMeta(name);
|
|
99
|
-
});
|
|
100
|
-
datasources.forEach((name) => {
|
|
101
|
-
// @ts-ignore
|
|
102
|
-
onUpdate(name, stores.datasources.get(name.substring(1)));
|
|
103
|
-
});
|
|
121
|
+
rebind();
|
|
104
122
|
observer.observe(element, { attributes: true, attributeFilter: ["datasets"] });
|
|
105
|
-
subscriptionSet = stores.datasets.on("set", (key, newVlaue) => {
|
|
106
|
-
if (datasets.includes(key)) {
|
|
107
|
-
onUpdate(key, newVlaue);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
subscriptionSource = stores.datasources.on("set", (key, newVlaue) => {
|
|
111
|
-
if (datasources.includes("$" + key)) {
|
|
112
|
-
onUpdate("$" + key, newVlaue);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
123
|
if (onMetaUpdate) {
|
|
116
124
|
subscriptionMeta = stores.datasetsMeta.on("set", (key, newValue) => {
|
|
117
125
|
if (datasets.includes(key)) {
|
|
@@ -124,19 +132,15 @@ component, onUpdate, onMetaUpdate) => {
|
|
|
124
132
|
const disconnectedCallback = component["disconnectedCallback"];
|
|
125
133
|
component["disconnectedCallback"] = () => {
|
|
126
134
|
observer.disconnect();
|
|
127
|
-
|
|
128
|
-
|
|
135
|
+
dbUnsubs.forEach((fn) => fn());
|
|
136
|
+
dbUnsubs = [];
|
|
129
137
|
runIfExisits(subscriptionMeta);
|
|
130
138
|
clearStoresCache(getElement(component));
|
|
131
139
|
runIfExisits(disconnectedCallback, component);
|
|
132
140
|
};
|
|
133
141
|
return (names) => {
|
|
134
142
|
datasets = names;
|
|
135
|
-
|
|
136
|
-
// @ts-ignore
|
|
137
|
-
onUpdate(name, stores.datasets.get(name));
|
|
138
|
-
deliverMeta(name);
|
|
139
|
-
});
|
|
143
|
+
rebind();
|
|
140
144
|
};
|
|
141
145
|
};
|
|
142
146
|
export default withDataset;
|
|
@@ -5,9 +5,9 @@ import { getElement } from "@stencil/core";
|
|
|
5
5
|
* Mixin that subscribes a Stencil component to raw datasources.
|
|
6
6
|
*
|
|
7
7
|
* This is the simpler counterpart of {@link withDataset} -- it reads directly from
|
|
8
|
-
* the
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* the shared alasql database via `stores.db.subscribe(name, ...)`. Primarily used
|
|
9
|
+
* by `bn-dataset` itself to react to upstream datasource updates so it can re-fire
|
|
10
|
+
* its own dataset notification.
|
|
11
11
|
*
|
|
12
12
|
* Watches the host element's `datasources` attribute via MutationObserver for
|
|
13
13
|
* dynamic rebinding at runtime.
|
|
@@ -17,17 +17,34 @@ import { getElement } from "@stencil/core";
|
|
|
17
17
|
*/
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
19
|
const withDatasource = (component, onUpdate) => {
|
|
20
|
-
let
|
|
20
|
+
let dbUnsubs = [];
|
|
21
21
|
let datasources = [];
|
|
22
22
|
let stores;
|
|
23
|
+
const deliver = (name) => {
|
|
24
|
+
let rows;
|
|
25
|
+
try {
|
|
26
|
+
rows = stores.db.db.exec(`SELECT * FROM \`${name}\``);
|
|
27
|
+
}
|
|
28
|
+
catch (_e) {
|
|
29
|
+
rows = [];
|
|
30
|
+
}
|
|
31
|
+
onUpdate(name, rows);
|
|
32
|
+
};
|
|
33
|
+
const rebind = () => {
|
|
34
|
+
dbUnsubs.forEach((fn) => fn());
|
|
35
|
+
dbUnsubs = [];
|
|
36
|
+
datasources.forEach((name) => {
|
|
37
|
+
if (!name)
|
|
38
|
+
return;
|
|
39
|
+
dbUnsubs.push(stores.db.subscribe(name, () => deliver(name)));
|
|
40
|
+
deliver(name);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
23
43
|
const observer = new MutationObserver((mutations) => {
|
|
24
44
|
mutations.forEach((mutation) => {
|
|
25
45
|
if (mutation.attributeName === "datasources") {
|
|
26
46
|
datasources = (getElement(component).getAttribute("datasources") || "").split(",");
|
|
27
|
-
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
onUpdate(name, stores.datasources.get(name));
|
|
30
|
-
});
|
|
47
|
+
rebind();
|
|
31
48
|
}
|
|
32
49
|
});
|
|
33
50
|
});
|
|
@@ -36,22 +53,15 @@ const withDatasource = (component, onUpdate) => {
|
|
|
36
53
|
const element = getElement(component);
|
|
37
54
|
stores = getStores(element);
|
|
38
55
|
datasources = (element.getAttribute("datasources") || "").split(",");
|
|
39
|
-
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
onUpdate(name, stores.datasources.get(name));
|
|
42
|
-
});
|
|
56
|
+
rebind();
|
|
43
57
|
observer.observe(element, { attributes: true, attributeFilter: ["datasources"] });
|
|
44
|
-
subscription = stores.datasources.on("set", (key, newVlaue) => {
|
|
45
|
-
if (datasources.includes(key)) {
|
|
46
|
-
onUpdate(key, newVlaue);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
58
|
runIfExisits(connectedCallback, component);
|
|
50
59
|
};
|
|
51
60
|
const disconnectedCallback = component["disconnectedCallback"];
|
|
52
61
|
component["disconnectedCallback"] = () => {
|
|
53
62
|
observer.disconnect();
|
|
54
|
-
|
|
63
|
+
dbUnsubs.forEach((fn) => fn());
|
|
64
|
+
dbUnsubs = [];
|
|
55
65
|
clearStoresCache(getElement(component));
|
|
56
66
|
runIfExisits(disconnectedCallback, component);
|
|
57
67
|
};
|
|
@@ -25,7 +25,7 @@ export function isInheritedValue(value) {
|
|
|
25
25
|
* Uses the same traversal pattern as `findContextElement` in
|
|
26
26
|
* `context-protocol.ts`.
|
|
27
27
|
*/
|
|
28
|
-
function findAncestor(element, mode) {
|
|
28
|
+
export function findAncestor(element, mode) {
|
|
29
29
|
let current = element.parentNode;
|
|
30
30
|
while (current) {
|
|
31
31
|
if (current instanceof HTMLElement) {
|
|
@@ -51,6 +51,31 @@ function findAncestor(element, mode) {
|
|
|
51
51
|
}
|
|
52
52
|
return undefined;
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Walks up the DOM tree (crossing shadow boundaries) to find the nearest
|
|
56
|
+
* ancestor element that carries the given attribute, whatever its tag.
|
|
57
|
+
* Used for attributes that inherit by default (e.g. `i18n-namespace`), where
|
|
58
|
+
* any container — layout card, layout page, tree, grid, or the `bn-context`
|
|
59
|
+
* itself — can act as the provider.
|
|
60
|
+
*/
|
|
61
|
+
export function findAncestorWithAttr(element, attr) {
|
|
62
|
+
let current = element.parentNode;
|
|
63
|
+
while (current) {
|
|
64
|
+
if (current instanceof HTMLElement && current.hasAttribute(attr)) {
|
|
65
|
+
return current;
|
|
66
|
+
}
|
|
67
|
+
if (current.parentNode) {
|
|
68
|
+
current = current.parentNode;
|
|
69
|
+
}
|
|
70
|
+
else if (current instanceof ShadowRoot) {
|
|
71
|
+
current = current.host;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
54
79
|
/**
|
|
55
80
|
* Mixin that enables property inheritance from ancestor layout components.
|
|
56
81
|
*
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { forceUpdate, getElement } from "@stencil/core";
|
|
2
|
+
import { getStores, clearStoresCache } from "../context/context-protocol";
|
|
3
|
+
import { runIfExisits } from "./utils";
|
|
4
|
+
import { isInheritedValue, findAncestor } from "./withInheritedProps";
|
|
5
|
+
import { merge } from "@corex/deepmerge";
|
|
6
|
+
/**
|
|
7
|
+
* Mixin that provides the IBCS rule-set configuration to a Stencil component
|
|
8
|
+
* using a three-layer merge strategy.
|
|
9
|
+
*
|
|
10
|
+
* The effective config is computed by deep-merging three layers in order:
|
|
11
|
+
* 1. `_system` -- built-in IBCS defaults (lowest priority)
|
|
12
|
+
* 2. `_default` -- user-defined global overrides (a `<bn-ruleset>` without name)
|
|
13
|
+
* 3. The value of the host element's `ruleset` attribute (highest priority)
|
|
14
|
+
*
|
|
15
|
+
* Unlike `withComponentStyle`, the store subscription also reacts to writes on
|
|
16
|
+
* the `_default` layer, because a nameless `<bn-ruleset>` is the primary way
|
|
17
|
+
* to adjust the rules context-wide.
|
|
18
|
+
*
|
|
19
|
+
* The `ruleset` attribute supports the `"inherited-closest"` /
|
|
20
|
+
* `"inherited-page"` keywords from `withInheritedProps`: the actual name is
|
|
21
|
+
* then read from the `ruleset` attribute of the nearest ancestor
|
|
22
|
+
* `bn-layout-card` / `bn-layout-page`, which is observed for changes.
|
|
23
|
+
*
|
|
24
|
+
* @param component - The Stencil component instance
|
|
25
|
+
* @returns A function returning the merged {@link RuleSetConfig}
|
|
26
|
+
*/
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
const withRuleSet = (component) => {
|
|
29
|
+
let subscription;
|
|
30
|
+
let stores;
|
|
31
|
+
let selectedRuleset;
|
|
32
|
+
let config;
|
|
33
|
+
let ancestorObserver = null;
|
|
34
|
+
const updateConfig = () => {
|
|
35
|
+
const state = stores.ruleSets.state;
|
|
36
|
+
config = merge([
|
|
37
|
+
state["_system"] || {},
|
|
38
|
+
state["_default"] || {},
|
|
39
|
+
state[selectedRuleset] || {},
|
|
40
|
+
]);
|
|
41
|
+
};
|
|
42
|
+
const resolveRulesetName = () => {
|
|
43
|
+
const element = getElement(component);
|
|
44
|
+
const raw = element.getAttribute("ruleset");
|
|
45
|
+
if (ancestorObserver) {
|
|
46
|
+
ancestorObserver.disconnect();
|
|
47
|
+
ancestorObserver = null;
|
|
48
|
+
}
|
|
49
|
+
if (raw && isInheritedValue(raw)) {
|
|
50
|
+
const ancestor = findAncestor(element, raw);
|
|
51
|
+
selectedRuleset = ancestor === null || ancestor === void 0 ? void 0 : ancestor.getAttribute("ruleset");
|
|
52
|
+
if (ancestor) {
|
|
53
|
+
ancestorObserver = new MutationObserver(() => {
|
|
54
|
+
selectedRuleset = ancestor.getAttribute("ruleset");
|
|
55
|
+
updateConfig();
|
|
56
|
+
forceUpdate(component);
|
|
57
|
+
});
|
|
58
|
+
ancestorObserver.observe(ancestor, { attributes: true, attributeFilter: ["ruleset"] });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
selectedRuleset = raw;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const observer = new MutationObserver((mutations) => {
|
|
66
|
+
mutations.forEach((mutation) => {
|
|
67
|
+
if (mutation.attributeName === "ruleset") {
|
|
68
|
+
resolveRulesetName();
|
|
69
|
+
updateConfig();
|
|
70
|
+
forceUpdate(component);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
const connectedCallback = component["connectedCallback"];
|
|
75
|
+
component["connectedCallback"] = () => {
|
|
76
|
+
const element = getElement(component);
|
|
77
|
+
stores = getStores(element);
|
|
78
|
+
config = stores.ruleSets.state["_system"];
|
|
79
|
+
observer.observe(element, { attributes: true, attributeFilter: ["ruleset"] });
|
|
80
|
+
resolveRulesetName();
|
|
81
|
+
updateConfig();
|
|
82
|
+
subscription = stores.ruleSets.on("set", (key) => {
|
|
83
|
+
if (key === selectedRuleset || key === "_default") {
|
|
84
|
+
resolveRulesetName();
|
|
85
|
+
updateConfig();
|
|
86
|
+
forceUpdate(getElement(component));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
runIfExisits(connectedCallback, component);
|
|
90
|
+
};
|
|
91
|
+
const disconnectedCallback = component["disconnectedCallback"];
|
|
92
|
+
component["disconnectedCallback"] = () => {
|
|
93
|
+
observer.disconnect();
|
|
94
|
+
if (ancestorObserver) {
|
|
95
|
+
ancestorObserver.disconnect();
|
|
96
|
+
ancestorObserver = null;
|
|
97
|
+
}
|
|
98
|
+
runIfExisits(subscription);
|
|
99
|
+
clearStoresCache(getElement(component));
|
|
100
|
+
runIfExisits(disconnectedCallback, component);
|
|
101
|
+
};
|
|
102
|
+
const ruleSetConfig = () => config;
|
|
103
|
+
return ruleSetConfig;
|
|
104
|
+
};
|
|
105
|
+
export default withRuleSet;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { forceUpdate, getElement } from "@stencil/core";
|
|
2
|
+
import { getStores, clearStoresCache } from "../context/context-protocol";
|
|
3
|
+
import { runIfExisits } from "./utils";
|
|
4
|
+
/**
|
|
5
|
+
* Mixin that syncs the scoped `scalingGroups` store into a component's
|
|
6
|
+
* `pixelPerUnitGroupMap` and triggers re-renders on changes.
|
|
7
|
+
*
|
|
8
|
+
* When a scaling group value is added or updated in the store (by a
|
|
9
|
+
* `<bn-scaling-group>` element), this mixin updates the local map,
|
|
10
|
+
* re-runs the component's scaling validators to clear/set error states,
|
|
11
|
+
* and forces a re-render so `preparePixelPerUnit` / `preparePixelPerPercentage`
|
|
12
|
+
* pick up the new value.
|
|
13
|
+
*
|
|
14
|
+
* @param component - Stencil component instance that has a `pixelPerUnitGroupMap` field
|
|
15
|
+
*/
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
const withScalingGroup = (component) => {
|
|
18
|
+
let subscription;
|
|
19
|
+
let stores;
|
|
20
|
+
const syncAllEntries = () => {
|
|
21
|
+
const state = stores.scalingGroups.state;
|
|
22
|
+
for (const key of Object.keys(state)) {
|
|
23
|
+
if (state[key] !== undefined) {
|
|
24
|
+
component.pixelPerUnitGroupMap.set(key, state[key]);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
component.pixelPerUnitGroupMap.delete(key);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const revalidate = () => {
|
|
32
|
+
if (typeof component.validateUnitScaling === "function") {
|
|
33
|
+
component.validateUnitScaling(component.unitScaling);
|
|
34
|
+
}
|
|
35
|
+
if (typeof component.validatePercentageScaling === "function") {
|
|
36
|
+
component.validatePercentageScaling(component.percentageScaling);
|
|
37
|
+
}
|
|
38
|
+
if (typeof component.validateSizeScaling === "function") {
|
|
39
|
+
component.validateSizeScaling();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const connectedCallback = component["connectedCallback"];
|
|
43
|
+
component["connectedCallback"] = () => {
|
|
44
|
+
const element = getElement(component);
|
|
45
|
+
stores = getStores(element);
|
|
46
|
+
// Initial sync of all existing scaling group entries
|
|
47
|
+
syncAllEntries();
|
|
48
|
+
revalidate();
|
|
49
|
+
// Subscribe to future changes
|
|
50
|
+
subscription = stores.scalingGroups.on("set", (key, newValue) => {
|
|
51
|
+
if (newValue !== undefined) {
|
|
52
|
+
component.pixelPerUnitGroupMap.set(key, newValue);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
component.pixelPerUnitGroupMap.delete(key);
|
|
56
|
+
}
|
|
57
|
+
revalidate();
|
|
58
|
+
forceUpdate(getElement(component));
|
|
59
|
+
});
|
|
60
|
+
runIfExisits(connectedCallback, component);
|
|
61
|
+
};
|
|
62
|
+
const disconnectedCallback = component["disconnectedCallback"];
|
|
63
|
+
component["disconnectedCallback"] = () => {
|
|
64
|
+
runIfExisits(subscription);
|
|
65
|
+
clearStoresCache(getElement(component));
|
|
66
|
+
runIfExisits(disconnectedCallback, component);
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export default withScalingGroup;
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import { getStores, clearStoresCache } from "../context/context-protocol";
|
|
2
2
|
import { forceUpdate, getElement } from "@stencil/core";
|
|
3
3
|
import { runIfExisits } from "./utils";
|
|
4
|
+
import { findAncestorWithAttr } from "./withInheritedProps";
|
|
4
5
|
/**
|
|
5
6
|
* Mixin that provides i18n translation support to a Stencil component.
|
|
6
7
|
*
|
|
7
8
|
* Returns an object with a `t(key, data?)` function for looking up translated strings.
|
|
8
9
|
*
|
|
10
|
+
* **Namespace resolution** (mirrors the ancestor inheritance of `withRuleSet`,
|
|
11
|
+
* but on by default):
|
|
12
|
+
* 1. The host element's own `i18n-namespace` attribute (the deprecated
|
|
13
|
+
* `namespace` attribute is honored as a fallback).
|
|
14
|
+
* 2. Otherwise the `i18n-namespace` attribute of the nearest ancestor that
|
|
15
|
+
* carries one — a layout card, layout page, tree, grid, or the
|
|
16
|
+
* `bn-context` itself — crossing shadow boundaries. The resolved ancestor
|
|
17
|
+
* is observed so attribute changes re-render the component.
|
|
18
|
+
* 3. Otherwise the built-in `_system` namespace.
|
|
19
|
+
*
|
|
9
20
|
* **Key resolution shortcuts:**
|
|
10
21
|
* - A key starting with `.` (e.g. `.label`) is expanded to `<component-tag>.label`,
|
|
11
22
|
* allowing components to reference their own translations concisely.
|
|
12
23
|
* - If the key is not found in the component's namespace, the `_system` namespace
|
|
13
|
-
* is used as a fallback
|
|
24
|
+
* is used as a fallback; if it is missing there too (or the locale is unknown),
|
|
25
|
+
* the key itself is returned.
|
|
14
26
|
*
|
|
15
27
|
* **Mustache-style interpolation:** `{{variable}}` placeholders in translation
|
|
16
|
-
* templates are replaced with values from the optional `data` object.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* the component when the locale store updates for the active namespace.
|
|
28
|
+
* templates are replaced with values from the optional `data` object. The
|
|
29
|
+
* separate `{%}` scenario token used by the variance symbols is substituted
|
|
30
|
+
* later, by `Formatter.translateScenarioLabel`.
|
|
20
31
|
*
|
|
21
32
|
* @param component - The Stencil component instance
|
|
22
33
|
* @returns Object containing the `t` translation function
|
|
@@ -26,10 +37,32 @@ const withTranslation = (component) => {
|
|
|
26
37
|
let subscription;
|
|
27
38
|
let namespace = undefined;
|
|
28
39
|
let stores;
|
|
40
|
+
let ancestorObserver = null;
|
|
41
|
+
const resolveNamespace = () => {
|
|
42
|
+
var _a;
|
|
43
|
+
const element = getElement(component);
|
|
44
|
+
if (ancestorObserver) {
|
|
45
|
+
ancestorObserver.disconnect();
|
|
46
|
+
ancestorObserver = null;
|
|
47
|
+
}
|
|
48
|
+
namespace = (_a = element.getAttribute("i18n-namespace")) !== null && _a !== void 0 ? _a : element.getAttribute("namespace");
|
|
49
|
+
if (namespace != null) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const ancestor = findAncestorWithAttr(element, "i18n-namespace");
|
|
53
|
+
if (ancestor) {
|
|
54
|
+
namespace = ancestor.getAttribute("i18n-namespace");
|
|
55
|
+
ancestorObserver = new MutationObserver(() => {
|
|
56
|
+
resolveNamespace();
|
|
57
|
+
forceUpdate(component);
|
|
58
|
+
});
|
|
59
|
+
ancestorObserver.observe(ancestor, { attributes: true, attributeFilter: ["i18n-namespace"] });
|
|
60
|
+
}
|
|
61
|
+
};
|
|
29
62
|
const observer = new MutationObserver((mutations) => {
|
|
30
63
|
mutations.forEach((mutation) => {
|
|
31
|
-
if (mutation.attributeName === "namespace") {
|
|
32
|
-
|
|
64
|
+
if (mutation.attributeName === "i18n-namespace" || mutation.attributeName === "namespace") {
|
|
65
|
+
resolveNamespace();
|
|
33
66
|
forceUpdate(component);
|
|
34
67
|
}
|
|
35
68
|
});
|
|
@@ -38,10 +71,10 @@ const withTranslation = (component) => {
|
|
|
38
71
|
component["connectedCallback"] = () => {
|
|
39
72
|
const element = getElement(component);
|
|
40
73
|
stores = getStores(element);
|
|
41
|
-
observer.observe(element, { attributes: true, attributeFilter: ["namespace"] });
|
|
42
|
-
|
|
74
|
+
observer.observe(element, { attributes: true, attributeFilter: ["i18n-namespace", "namespace"] });
|
|
75
|
+
resolveNamespace();
|
|
43
76
|
subscription = stores.internationalization.on("set", (key, _value) => {
|
|
44
|
-
if (key === namespace) {
|
|
77
|
+
if (key === namespace || key === "_system") {
|
|
45
78
|
forceUpdate(component);
|
|
46
79
|
}
|
|
47
80
|
});
|
|
@@ -50,22 +83,27 @@ const withTranslation = (component) => {
|
|
|
50
83
|
const disconnectedCallback = component["disconnectedCallback"];
|
|
51
84
|
component["disconnectedCallback"] = () => {
|
|
52
85
|
observer.disconnect();
|
|
86
|
+
if (ancestorObserver) {
|
|
87
|
+
ancestorObserver.disconnect();
|
|
88
|
+
ancestorObserver = null;
|
|
89
|
+
}
|
|
53
90
|
runIfExisits(subscription);
|
|
54
91
|
clearStoresCache(getElement(component));
|
|
55
92
|
runIfExisits(disconnectedCallback, component);
|
|
56
93
|
};
|
|
57
94
|
const t = (key, data) => {
|
|
58
|
-
var _a, _b;
|
|
95
|
+
var _a, _b, _c, _d, _e;
|
|
59
96
|
if (key.startsWith(".")) {
|
|
60
97
|
key = getElement(component).localName + key;
|
|
61
98
|
}
|
|
62
99
|
const locales = stores.internationalization.state;
|
|
63
100
|
const locale = stores.context.state.locale;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
101
|
+
// Per-key fallback chain: resolved namespace → _system → the key itself.
|
|
102
|
+
// Never throws — a missing key or unknown locale must not blank the component.
|
|
103
|
+
const tpl = (_c = (_b = (_a = locales[namespace]) === null || _a === void 0 ? void 0 : _a[locale]) === null || _b === void 0 ? void 0 : _b[key]) !== null && _c !== void 0 ? _c : (_e = (_d = locales["_system"]) === null || _d === void 0 ? void 0 : _d[locale]) === null || _e === void 0 ? void 0 : _e[key];
|
|
104
|
+
if (tpl == null) {
|
|
105
|
+
return key;
|
|
67
106
|
}
|
|
68
|
-
const tpl = locales[currentNamespace][locale][key];
|
|
69
107
|
return tpl.replace(/{{([\s\S]+?)}}/g, (_, k) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data[k.trim()]) !== null && _a !== void 0 ? _a : ""; });
|
|
70
108
|
};
|
|
71
109
|
return { t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small-multiple panel layout: divides a drawing area into equal panels,
|
|
3
|
+
* wrapping row-major at `columns`. Axis tick labels render on the outer
|
|
4
|
+
* edges only (IBCS 10F/10G style) — the `isOuterLeft`/`isOuterBottom`
|
|
5
|
+
* flags tell the renderer which panels carry them.
|
|
6
|
+
*/
|
|
7
|
+
export class FacetGrid {
|
|
8
|
+
constructor(count, columns, drawingRect, panelGapPx) {
|
|
9
|
+
this.count = count;
|
|
10
|
+
this.drawingRect = drawingRect;
|
|
11
|
+
this.panelGapPx = panelGapPx;
|
|
12
|
+
this.columns = Math.max(1, Math.min(columns !== null && columns !== void 0 ? columns : count, count));
|
|
13
|
+
this.rows = Math.max(1, Math.ceil(count / this.columns));
|
|
14
|
+
}
|
|
15
|
+
/** Rectangle of the i-th panel (row-major order). */
|
|
16
|
+
panelRect(index) {
|
|
17
|
+
const col = index % this.columns;
|
|
18
|
+
const row = Math.floor(index / this.columns);
|
|
19
|
+
const width = (this.drawingRect.width - (this.columns - 1) * this.panelGapPx) / this.columns;
|
|
20
|
+
const height = (this.drawingRect.height - (this.rows - 1) * this.panelGapPx) / this.rows;
|
|
21
|
+
return {
|
|
22
|
+
x: this.drawingRect.x + col * (width + this.panelGapPx),
|
|
23
|
+
y: this.drawingRect.y + row * (height + this.panelGapPx),
|
|
24
|
+
width,
|
|
25
|
+
height,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** True when the panel sits in the leftmost column (carries y tick labels). */
|
|
29
|
+
isOuterLeft(index) {
|
|
30
|
+
return index % this.columns === 0;
|
|
31
|
+
}
|
|
32
|
+
/** True when no panel renders below this one (carries x tick labels). */
|
|
33
|
+
isOuterBottom(index) {
|
|
34
|
+
return index + this.columns >= this.count;
|
|
35
|
+
}
|
|
36
|
+
}
|