@bino-bi/bn-template-engine 1.0.0-alpha.9 → 1.0.0-next.19
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-19bbac66.entry.js +1 -0
- package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
- package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
- package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
- package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
- package/dist/bn-template-engine/p-74c5a95d.entry.js +1 -0
- package/dist/bn-template-engine/p-7bdc0e28.entry.js +1 -0
- package/dist/bn-template-engine/p-83c71b16.entry.js +1 -0
- package/dist/bn-template-engine/p-90806e7a.entry.js +1 -0
- package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
- package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
- package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
- package/dist/bn-template-engine/p-BZV1b5VH.js +1 -0
- package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
- package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
- package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
- package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
- package/dist/bn-template-engine/p-CiudZRQr.js +1 -0
- package/dist/bn-template-engine/p-DTuaq8Pj.js +1 -0
- package/dist/bn-template-engine/p-DY7YYmpa.js +1 -0
- package/dist/bn-template-engine/p-Dg9OcXAO.js +1 -0
- package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
- package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
- package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
- package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
- package/dist/bn-template-engine/p-b25455a7.entry.js +1 -0
- package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
- package/dist/bn-template-engine/p-eca8e2e2.entry.js +1 -0
- package/dist/bn-template-engine/p-f9dfd120.entry.js +1 -0
- package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
- package/dist/cjs/AxisConfig-VnVelfSV.js +233 -0
- package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
- package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
- package/dist/cjs/Order-DobBozQC.js +87 -0
- package/dist/cjs/SVGStyle-BQOmGWLX.js +8209 -0
- package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
- package/dist/cjs/VarianceMeasure-NY9yhiNV.js +372 -0
- package/dist/cjs/XYChartDataRow-B7OKrAcC.js +829 -0
- package/dist/cjs/bn-asset_21.cjs.entry.js +16047 -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-BDrMkhc4.js +9499 -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-o03YUfn_.js +199 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
- package/dist/cjs/scaling-DKZyjWj5.js +587 -0
- package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
- package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
- package/dist/cjs/withStyled-CRiC9fzc.js +1137 -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 +125 -42
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +103 -36
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +82 -58
- 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 +160 -43
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +94 -31
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +132 -74
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -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 +1 -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 +1 -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 +317 -61
- package/dist/collection/components/bn-table/ibcs-table.css +8 -0
- package/dist/collection/components/bn-table/ibcs-table.js +161 -32
- package/dist/collection/components/bn-table/utils/Table.js +72 -28
- 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 +117 -22
- 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 +27 -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 +29 -6
- package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -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 +68 -0
- package/dist/collection/stores/ruleSets.js +46 -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 +50 -14
- 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-C_zWCKlL.js +224 -0
- package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
- package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
- package/dist/esm/Order-BPeWfygb.js +83 -0
- package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
- package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
- package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
- package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
- package/dist/esm/bn-asset_21.entry.js +16025 -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-1Yj1uKvh.js +9484 -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-BG5dOBYH.js +196 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
- package/dist/esm/scaling-CeSRcRl1.js +579 -0
- package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
- package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
- package/dist/esm/withStyled-Br2DGTPs.js +1104 -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 +16 -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 +16 -12
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
- 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-layout-card/bn-layout-card.d.ts +35 -8
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +32 -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 +11 -1
- package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
- package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
- package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
- package/dist/types/components.d.ts +1691 -120
- 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 +1 -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 +12 -4
- 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
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var contextProtocol = require('./context-protocol-BDrMkhc4.js');
|
|
4
|
+
var withHasError = require('./withHasError-Cl2gTQzA.js');
|
|
5
|
+
var index = require('./index-CDKG4xmO.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Splits an array into two groups based on a predicate.
|
|
9
|
+
* Used to separate `$`-prefixed datasource refs from dataset refs.
|
|
10
|
+
* @returns Tuple of [matches, nonMatches]
|
|
11
|
+
*/
|
|
12
|
+
const partition = (predicate, arr) => {
|
|
13
|
+
const matches = [];
|
|
14
|
+
const nonMatches = [];
|
|
15
|
+
for (const item of arr) {
|
|
16
|
+
(predicate(item) ? matches : nonMatches).push(item);
|
|
17
|
+
}
|
|
18
|
+
return [matches, nonMatches];
|
|
19
|
+
};
|
|
20
|
+
const WARN_DATASOURCE_ID = "WARN_use_dataset";
|
|
21
|
+
/**
|
|
22
|
+
* Emits a warning via the component's ErrorDispatcher when datasource refs
|
|
23
|
+
* (`$name`) are used directly, nudging consumers toward bn-dataset wrappers
|
|
24
|
+
* which provide query support and metadata.
|
|
25
|
+
*/
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
const warnIfDatasource = (component, datasources) => {
|
|
28
|
+
const errors = component.errors;
|
|
29
|
+
if (!errors)
|
|
30
|
+
return;
|
|
31
|
+
if (datasources.length > 0) {
|
|
32
|
+
const names = datasources.map((n) => n.substring(1)).join(", ");
|
|
33
|
+
errors.addOrReplace({
|
|
34
|
+
id: WARN_DATASOURCE_ID,
|
|
35
|
+
type: "warning",
|
|
36
|
+
message: `Using datasource(s) "${names}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
errors.remove(WARN_DATASOURCE_ID);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Mixin that subscribes a Stencil component to one or more datasets/datasources.
|
|
45
|
+
*
|
|
46
|
+
* **Naming convention:** The `datasets` HTML attribute accepts a comma-separated list of names.
|
|
47
|
+
* Names prefixed with `$` (e.g. `$revenue`) read directly from the raw datasource tables;
|
|
48
|
+
* unprefixed names read from datasets (registered as tables/views by `<bn-dataset>`).
|
|
49
|
+
*
|
|
50
|
+
* Data is sourced from the shared per-context alasql database; each subscribed
|
|
51
|
+
* name is registered with `stores.db.subscribe(...)` and the rows are materialized
|
|
52
|
+
* via `db.exec("SELECT * FROM <name>")` whenever the producer fires `notify(name)`.
|
|
53
|
+
*
|
|
54
|
+
* The mixin installs a MutationObserver on the host element's `datasets` attribute so
|
|
55
|
+
* bindings update automatically when the attribute is changed at runtime.
|
|
56
|
+
*
|
|
57
|
+
* @param component - The Stencil component instance (must expose a host element via `@Element()`)
|
|
58
|
+
* @param onUpdate - Callback invoked with `(name, data)` whenever a subscribed dataset or datasource changes
|
|
59
|
+
* @param onMetaUpdate - Optional callback invoked with `(name, meta)` when DatasetMeta changes for a subscribed dataset
|
|
60
|
+
* @returns A function to programmatically replace the list of subscribed dataset names
|
|
61
|
+
*/
|
|
62
|
+
const withDataset = (
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
component, onUpdate, onMetaUpdate) => {
|
|
65
|
+
let dbUnsubs = [];
|
|
66
|
+
let subscriptionMeta;
|
|
67
|
+
let datasets = [];
|
|
68
|
+
let datasources = [];
|
|
69
|
+
let stores;
|
|
70
|
+
/** Materialize the current rows for a subscribed name via the shared db, then deliver. */
|
|
71
|
+
const deliver = (name, isDatasource) => {
|
|
72
|
+
const tableName = isDatasource ? name.substring(1) : name;
|
|
73
|
+
let rows;
|
|
74
|
+
try {
|
|
75
|
+
rows = stores.db.db.exec(`SELECT * FROM \`${tableName}\``);
|
|
76
|
+
}
|
|
77
|
+
catch (_e) {
|
|
78
|
+
// Table/view not registered yet (producer hasn't fired). Treat as empty.
|
|
79
|
+
rows = [];
|
|
80
|
+
}
|
|
81
|
+
onUpdate(name, rows);
|
|
82
|
+
};
|
|
83
|
+
const deliverMeta = (name) => {
|
|
84
|
+
if (onMetaUpdate) {
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
const meta = stores.datasetsMeta.get(name);
|
|
87
|
+
if (meta)
|
|
88
|
+
onMetaUpdate(name, meta);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
/** Tear down current db subscriptions and re-subscribe based on `datasets` / `datasources`. */
|
|
92
|
+
const rebind = () => {
|
|
93
|
+
dbUnsubs.forEach((fn) => fn());
|
|
94
|
+
dbUnsubs = [];
|
|
95
|
+
datasets.forEach((name) => {
|
|
96
|
+
if (!name)
|
|
97
|
+
return;
|
|
98
|
+
dbUnsubs.push(stores.db.subscribe(name, () => deliver(name, false)));
|
|
99
|
+
deliver(name, false);
|
|
100
|
+
deliverMeta(name);
|
|
101
|
+
});
|
|
102
|
+
datasources.forEach((ref) => {
|
|
103
|
+
if (!ref)
|
|
104
|
+
return;
|
|
105
|
+
dbUnsubs.push(stores.db.subscribe(ref.substring(1), () => deliver(ref, true)));
|
|
106
|
+
deliver(ref, true);
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
const observer = new MutationObserver((mutations) => {
|
|
110
|
+
mutations.forEach((mutation) => {
|
|
111
|
+
if (mutation.attributeName === "datasets") {
|
|
112
|
+
[datasources, datasets] = partition((s) => s.startsWith("$"), index.getElement(component).getAttribute("datasets").split(","));
|
|
113
|
+
warnIfDatasource(component, datasources);
|
|
114
|
+
rebind();
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
const connectedCallback = component["connectedCallback"];
|
|
119
|
+
component["connectedCallback"] = () => {
|
|
120
|
+
const element = index.getElement(component);
|
|
121
|
+
stores = contextProtocol.getStores(element);
|
|
122
|
+
[datasources, datasets] = partition((s) => s.startsWith("$"), (element.getAttribute("datasets") || "").split(","));
|
|
123
|
+
warnIfDatasource(component, datasources);
|
|
124
|
+
rebind();
|
|
125
|
+
observer.observe(element, { attributes: true, attributeFilter: ["datasets"] });
|
|
126
|
+
if (onMetaUpdate) {
|
|
127
|
+
subscriptionMeta = stores.datasetsMeta.on("set", (key, newValue) => {
|
|
128
|
+
if (datasets.includes(key)) {
|
|
129
|
+
onMetaUpdate(key, newValue);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
withHasError.runIfExisits(connectedCallback, component);
|
|
134
|
+
};
|
|
135
|
+
const disconnectedCallback = component["disconnectedCallback"];
|
|
136
|
+
component["disconnectedCallback"] = () => {
|
|
137
|
+
observer.disconnect();
|
|
138
|
+
dbUnsubs.forEach((fn) => fn());
|
|
139
|
+
dbUnsubs = [];
|
|
140
|
+
withHasError.runIfExisits(subscriptionMeta);
|
|
141
|
+
contextProtocol.clearStoresCache(index.getElement(component));
|
|
142
|
+
withHasError.runIfExisits(disconnectedCallback, component);
|
|
143
|
+
};
|
|
144
|
+
return (names) => {
|
|
145
|
+
datasets = names;
|
|
146
|
+
rebind();
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Reserved prop values that activate inheritance from ancestor layout
|
|
152
|
+
* components (`bn-layout-card` or `bn-layout-page`).
|
|
153
|
+
*/
|
|
154
|
+
const INHERITED_CLOSEST = "inherited-closest";
|
|
155
|
+
const INHERITED_PAGE = "inherited-page";
|
|
156
|
+
/** Tags that qualify as inheritance ancestors. */
|
|
157
|
+
const ANCESTOR_CARD = "bn-layout-card";
|
|
158
|
+
const ANCESTOR_PAGE = "bn-layout-page";
|
|
159
|
+
/**
|
|
160
|
+
* Returns `true` when `value` is one of the recognised inheritance keywords.
|
|
161
|
+
*/
|
|
162
|
+
function isInheritedValue(value) {
|
|
163
|
+
return value === INHERITED_CLOSEST || value === INHERITED_PAGE;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Walks up the DOM tree (crossing shadow boundaries) to find the nearest
|
|
167
|
+
* ancestor layout component.
|
|
168
|
+
*
|
|
169
|
+
* - `"inherited-closest"` matches the first `bn-layout-card` or `bn-layout-page`.
|
|
170
|
+
* - `"inherited-page"` skips cards and matches only `bn-layout-page`.
|
|
171
|
+
*
|
|
172
|
+
* Uses the same traversal pattern as `findContextElement` in
|
|
173
|
+
* `context-protocol.ts`.
|
|
174
|
+
*/
|
|
175
|
+
function findAncestor(element, mode) {
|
|
176
|
+
let current = element.parentNode;
|
|
177
|
+
while (current) {
|
|
178
|
+
if (current instanceof HTMLElement) {
|
|
179
|
+
const tag = current.nodeName.toLowerCase();
|
|
180
|
+
if (mode === INHERITED_PAGE) {
|
|
181
|
+
if (tag === ANCESTOR_PAGE)
|
|
182
|
+
return current;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
if (tag === ANCESTOR_CARD || tag === ANCESTOR_PAGE)
|
|
186
|
+
return current;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (current.parentNode) {
|
|
190
|
+
current = current.parentNode;
|
|
191
|
+
}
|
|
192
|
+
else if (current instanceof ShadowRoot) {
|
|
193
|
+
current = current.host;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Walks up the DOM tree (crossing shadow boundaries) to find the nearest
|
|
203
|
+
* ancestor element that carries the given attribute, whatever its tag.
|
|
204
|
+
* Used for attributes that inherit by default (e.g. `i18n-namespace`), where
|
|
205
|
+
* any container — layout card, layout page, tree, grid, or the `bn-context`
|
|
206
|
+
* itself — can act as the provider.
|
|
207
|
+
*/
|
|
208
|
+
function findAncestorWithAttr(element, attr) {
|
|
209
|
+
let current = element.parentNode;
|
|
210
|
+
while (current) {
|
|
211
|
+
if (current instanceof HTMLElement && current.hasAttribute(attr)) {
|
|
212
|
+
return current;
|
|
213
|
+
}
|
|
214
|
+
if (current.parentNode) {
|
|
215
|
+
current = current.parentNode;
|
|
216
|
+
}
|
|
217
|
+
else if (current instanceof ShadowRoot) {
|
|
218
|
+
current = current.host;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Mixin that enables property inheritance from ancestor layout components.
|
|
228
|
+
*
|
|
229
|
+
* When a component sets a prop to `"inherited-closest"` or `"inherited-page"`,
|
|
230
|
+
* this mixin resolves the actual value by walking up the DOM to find the
|
|
231
|
+
* nearest `bn-layout-card` / `bn-layout-page` and reading the corresponding
|
|
232
|
+
* HTML attribute. A `MutationObserver` watches the ancestor for attribute
|
|
233
|
+
* changes, triggering a re-render when inherited values update.
|
|
234
|
+
*
|
|
235
|
+
* Follows the same decorator-style pattern as `withComponentStyle`.
|
|
236
|
+
*
|
|
237
|
+
* @param component The Stencil component instance
|
|
238
|
+
* @param mappings Array of prop-to-attribute mappings
|
|
239
|
+
* @returns A resolver function used inside `prepare*()` methods
|
|
240
|
+
*/
|
|
241
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
242
|
+
const withInheritedProps = (component, mappings) => {
|
|
243
|
+
/** Resolved values keyed by propName. */
|
|
244
|
+
const resolved = new Map();
|
|
245
|
+
/** Observer watching the ancestor element's attributes. */
|
|
246
|
+
let observer = null;
|
|
247
|
+
/** The ancestor element currently being observed. */
|
|
248
|
+
let ancestorEl;
|
|
249
|
+
/**
|
|
250
|
+
* For each mapping whose prop is an inheritance keyword, walk the DOM once
|
|
251
|
+
* and read the corresponding attribute from the ancestor.
|
|
252
|
+
*/
|
|
253
|
+
const resolveAll = () => {
|
|
254
|
+
const element = index.getElement(component);
|
|
255
|
+
resolved.clear();
|
|
256
|
+
// Determine which attrs to watch on which ancestor
|
|
257
|
+
const attrsToWatch = [];
|
|
258
|
+
for (const mapping of mappings) {
|
|
259
|
+
const value = component[mapping.propName];
|
|
260
|
+
if (typeof value !== "string" || !isInheritedValue(value))
|
|
261
|
+
continue;
|
|
262
|
+
// Find ancestor (re-use the first one found for the same mode)
|
|
263
|
+
if (!ancestorEl) {
|
|
264
|
+
ancestorEl = findAncestor(element, value);
|
|
265
|
+
}
|
|
266
|
+
if (!ancestorEl)
|
|
267
|
+
continue;
|
|
268
|
+
const attrValue = ancestorEl.getAttribute(mapping.ancestorAttr);
|
|
269
|
+
if (attrValue != null) {
|
|
270
|
+
resolved.set(mapping.propName, attrValue);
|
|
271
|
+
}
|
|
272
|
+
attrsToWatch.push(mapping.ancestorAttr);
|
|
273
|
+
}
|
|
274
|
+
// Set up MutationObserver on the ancestor
|
|
275
|
+
if (ancestorEl && attrsToWatch.length > 0) {
|
|
276
|
+
observer = new MutationObserver(() => {
|
|
277
|
+
// Re-read all inherited attributes from the ancestor
|
|
278
|
+
for (const mapping of mappings) {
|
|
279
|
+
if (!isInheritedValue(component[mapping.propName]))
|
|
280
|
+
continue;
|
|
281
|
+
const attrValue = ancestorEl.getAttribute(mapping.ancestorAttr);
|
|
282
|
+
if (attrValue != null) {
|
|
283
|
+
resolved.set(mapping.propName, attrValue);
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
resolved.delete(mapping.propName);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
index.forceUpdate(component);
|
|
290
|
+
});
|
|
291
|
+
observer.observe(ancestorEl, {
|
|
292
|
+
attributes: true,
|
|
293
|
+
attributeFilter: attrsToWatch,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
const connectedCallback = component["connectedCallback"];
|
|
298
|
+
component["connectedCallback"] = () => {
|
|
299
|
+
resolveAll();
|
|
300
|
+
withHasError.runIfExisits(connectedCallback, component);
|
|
301
|
+
};
|
|
302
|
+
const disconnectedCallback = component["disconnectedCallback"];
|
|
303
|
+
component["disconnectedCallback"] = () => {
|
|
304
|
+
if (observer) {
|
|
305
|
+
observer.disconnect();
|
|
306
|
+
observer = null;
|
|
307
|
+
}
|
|
308
|
+
ancestorEl = undefined;
|
|
309
|
+
resolved.clear();
|
|
310
|
+
withHasError.runIfExisits(disconnectedCallback, component);
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* Resolver: returns the inherited value for the given prop, or `undefined`
|
|
314
|
+
* when the prop is not using inheritance (so the caller falls through to
|
|
315
|
+
* its normal logic).
|
|
316
|
+
*/
|
|
317
|
+
const resolve = (propName, currentValue) => {
|
|
318
|
+
if (!isInheritedValue(currentValue))
|
|
319
|
+
return undefined;
|
|
320
|
+
return resolved.get(propName);
|
|
321
|
+
};
|
|
322
|
+
return resolve;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Mixin that provides i18n translation support to a Stencil component.
|
|
327
|
+
*
|
|
328
|
+
* Returns an object with a `t(key, data?)` function for looking up translated strings.
|
|
329
|
+
*
|
|
330
|
+
* **Namespace resolution** (mirrors the ancestor inheritance of `withRuleSet`,
|
|
331
|
+
* but on by default):
|
|
332
|
+
* 1. The host element's own `i18n-namespace` attribute (the deprecated
|
|
333
|
+
* `namespace` attribute is honored as a fallback).
|
|
334
|
+
* 2. Otherwise the `i18n-namespace` attribute of the nearest ancestor that
|
|
335
|
+
* carries one — a layout card, layout page, tree, grid, or the
|
|
336
|
+
* `bn-context` itself — crossing shadow boundaries. The resolved ancestor
|
|
337
|
+
* is observed so attribute changes re-render the component.
|
|
338
|
+
* 3. Otherwise the built-in `_system` namespace.
|
|
339
|
+
*
|
|
340
|
+
* **Key resolution shortcuts:**
|
|
341
|
+
* - A key starting with `.` (e.g. `.label`) is expanded to `<component-tag>.label`,
|
|
342
|
+
* allowing components to reference their own translations concisely.
|
|
343
|
+
* - If the key is not found in the component's namespace, the `_system` namespace
|
|
344
|
+
* is used as a fallback; if it is missing there too (or the locale is unknown),
|
|
345
|
+
* the key itself is returned.
|
|
346
|
+
*
|
|
347
|
+
* **Mustache-style interpolation:** `{{variable}}` placeholders in translation
|
|
348
|
+
* templates are replaced with values from the optional `data` object.
|
|
349
|
+
*
|
|
350
|
+
* @param component - The Stencil component instance
|
|
351
|
+
* @returns Object containing the `t` translation function
|
|
352
|
+
*/
|
|
353
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
354
|
+
const withTranslation = (component) => {
|
|
355
|
+
let subscription;
|
|
356
|
+
let namespace = undefined;
|
|
357
|
+
let stores;
|
|
358
|
+
let ancestorObserver = null;
|
|
359
|
+
const resolveNamespace = () => {
|
|
360
|
+
var _a;
|
|
361
|
+
const element = index.getElement(component);
|
|
362
|
+
if (ancestorObserver) {
|
|
363
|
+
ancestorObserver.disconnect();
|
|
364
|
+
ancestorObserver = null;
|
|
365
|
+
}
|
|
366
|
+
namespace = (_a = element.getAttribute("i18n-namespace")) !== null && _a !== void 0 ? _a : element.getAttribute("namespace");
|
|
367
|
+
if (namespace != null) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
const ancestor = findAncestorWithAttr(element, "i18n-namespace");
|
|
371
|
+
if (ancestor) {
|
|
372
|
+
namespace = ancestor.getAttribute("i18n-namespace");
|
|
373
|
+
ancestorObserver = new MutationObserver(() => {
|
|
374
|
+
resolveNamespace();
|
|
375
|
+
index.forceUpdate(component);
|
|
376
|
+
});
|
|
377
|
+
ancestorObserver.observe(ancestor, { attributes: true, attributeFilter: ["i18n-namespace"] });
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
const observer = new MutationObserver((mutations) => {
|
|
381
|
+
mutations.forEach((mutation) => {
|
|
382
|
+
if (mutation.attributeName === "i18n-namespace" || mutation.attributeName === "namespace") {
|
|
383
|
+
resolveNamespace();
|
|
384
|
+
index.forceUpdate(component);
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
});
|
|
388
|
+
const connectedCallback = component["connectedCallback"];
|
|
389
|
+
component["connectedCallback"] = () => {
|
|
390
|
+
const element = index.getElement(component);
|
|
391
|
+
stores = contextProtocol.getStores(element);
|
|
392
|
+
observer.observe(element, { attributes: true, attributeFilter: ["i18n-namespace", "namespace"] });
|
|
393
|
+
resolveNamespace();
|
|
394
|
+
subscription = stores.internationalization.on("set", (key, _value) => {
|
|
395
|
+
if (key === namespace || key === "_system") {
|
|
396
|
+
index.forceUpdate(component);
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
withHasError.runIfExisits(connectedCallback, component);
|
|
400
|
+
};
|
|
401
|
+
const disconnectedCallback = component["disconnectedCallback"];
|
|
402
|
+
component["disconnectedCallback"] = () => {
|
|
403
|
+
observer.disconnect();
|
|
404
|
+
if (ancestorObserver) {
|
|
405
|
+
ancestorObserver.disconnect();
|
|
406
|
+
ancestorObserver = null;
|
|
407
|
+
}
|
|
408
|
+
withHasError.runIfExisits(subscription);
|
|
409
|
+
contextProtocol.clearStoresCache(index.getElement(component));
|
|
410
|
+
withHasError.runIfExisits(disconnectedCallback, component);
|
|
411
|
+
};
|
|
412
|
+
const t = (key, data) => {
|
|
413
|
+
var _a, _b, _c, _d, _e;
|
|
414
|
+
if (key.startsWith(".")) {
|
|
415
|
+
key = index.getElement(component).localName + key;
|
|
416
|
+
}
|
|
417
|
+
const locales = stores.internationalization.state;
|
|
418
|
+
const locale = stores.context.state.locale;
|
|
419
|
+
// Per-key fallback chain: resolved namespace → _system → the key itself.
|
|
420
|
+
// Never throws — a missing key or unknown locale must not blank the component.
|
|
421
|
+
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];
|
|
422
|
+
if (tpl == null) {
|
|
423
|
+
return key;
|
|
424
|
+
}
|
|
425
|
+
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 : ""; });
|
|
426
|
+
};
|
|
427
|
+
return { t };
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Returns the available dimensions for a component.
|
|
432
|
+
*
|
|
433
|
+
* Width: visual parent's content-box width (excluding padding).
|
|
434
|
+
* Height: walks up the DOM to find the nearest ancestor with a constrained
|
|
435
|
+
* height (overflow !== 'visible' or explicit max-height). Falls back to
|
|
436
|
+
* the viewport height when every ancestor auto-grows with its content.
|
|
437
|
+
*
|
|
438
|
+
* When the component is slotted into a shadow DOM (e.g. inside
|
|
439
|
+
* bn-layout-page or bn-layout-card), the light DOM parentElement is NOT the
|
|
440
|
+
* visual container. We cross the light→shadow boundary via assignedSlot to
|
|
441
|
+
* find the actual slot wrapper that determines layout.
|
|
442
|
+
*/
|
|
443
|
+
function getParentDimensions(element, debug = false) {
|
|
444
|
+
const parent = findLayoutParent(element);
|
|
445
|
+
if (!parent) {
|
|
446
|
+
if (debug)
|
|
447
|
+
console.log("[parentDims] no layout parent found for", element.tagName);
|
|
448
|
+
return { width: 0, height: 0 };
|
|
449
|
+
}
|
|
450
|
+
const parentStyle = getComputedStyle(parent);
|
|
451
|
+
const width = parent.clientWidth - parseFloat(parentStyle.paddingLeft) - parseFloat(parentStyle.paddingRight);
|
|
452
|
+
const height = findConstrainedHeight(element, debug);
|
|
453
|
+
if (debug) {
|
|
454
|
+
console.log("[parentDims]", element.tagName, "→ layoutParent:", parent.tagName, parent.className || "(no class)", `clientW=${parent.clientWidth} → w=${Math.round(width)}, h=${Math.round(height)}`, "overflow:", parentStyle.overflow);
|
|
455
|
+
}
|
|
456
|
+
return { width: Math.max(0, width), height: Math.max(0, height) };
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Returns the visual layout parent of an element, crossing the
|
|
460
|
+
* light→shadow DOM boundary when the element's parent is slotted.
|
|
461
|
+
*
|
|
462
|
+
* For a slotted element, the light DOM parentElement is NOT where
|
|
463
|
+
* the element renders visually. The actual container is the shadow
|
|
464
|
+
* DOM element that wraps the <slot>. We reach it via assignedSlot.
|
|
465
|
+
*/
|
|
466
|
+
function findLayoutParent(element) {
|
|
467
|
+
var _a;
|
|
468
|
+
const lightParent = element.parentElement;
|
|
469
|
+
if ((_a = lightParent === null || lightParent === void 0 ? void 0 : lightParent.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement) {
|
|
470
|
+
return lightParent.assignedSlot.parentElement;
|
|
471
|
+
}
|
|
472
|
+
return lightParent;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Returns the visual parent, crossing shadow DOM boundaries in both
|
|
476
|
+
* directions: via assignedSlot for slotted elements (light → shadow) and
|
|
477
|
+
* via the shadow host when the element is a top-level child of a shadow
|
|
478
|
+
* root (shadow → host). Without the host crossing, the ancestor walk dies
|
|
479
|
+
* at the top of a component's shadow tree (e.g. inside bn-layout-card)
|
|
480
|
+
* and never sees outer constraints.
|
|
481
|
+
*/
|
|
482
|
+
function getVisualParent(element) {
|
|
483
|
+
var _a;
|
|
484
|
+
if ((_a = element.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement) {
|
|
485
|
+
return element.assignedSlot.parentElement;
|
|
486
|
+
}
|
|
487
|
+
if (element.parentElement) {
|
|
488
|
+
return element.parentElement;
|
|
489
|
+
}
|
|
490
|
+
const root = element.getRootNode();
|
|
491
|
+
return root instanceof ShadowRoot ? root.host : null;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Walks up the ancestor chain to find a height that is actually constrained
|
|
495
|
+
* (not just "whatever my content needs"). Crosses shadow DOM boundaries
|
|
496
|
+
* via assignedSlot when encountering slotted elements. Returns viewport
|
|
497
|
+
* height as a last resort.
|
|
498
|
+
*
|
|
499
|
+
* Ancestors inside a fit-content layout region (marked with
|
|
500
|
+
* `data-bn-fit-content` by bn-layout-page / bn-layout-card) are skipped
|
|
501
|
+
* even when they clip overflow: their height is derived from their own
|
|
502
|
+
* content — including the measuring component itself — so using it for
|
|
503
|
+
* auto-scaling creates a feedback loop where the chart inflates the cell
|
|
504
|
+
* and then reads the inflated cell back as "available height". The marker
|
|
505
|
+
* value carries the grid's row count; the constraint found above the
|
|
506
|
+
* fit-content region is divided by it, approximating the equal-share cell
|
|
507
|
+
* height the same layout would produce with fit-to-content disabled.
|
|
508
|
+
*/
|
|
509
|
+
function findConstrainedHeight(element, debug = false) {
|
|
510
|
+
let current = findLayoutParent(element);
|
|
511
|
+
let depth = 0;
|
|
512
|
+
let candidate = null;
|
|
513
|
+
let rowShareDivisor = 1;
|
|
514
|
+
while (current) {
|
|
515
|
+
// A fit-content region sizes itself from its content — every height
|
|
516
|
+
// measured below this point is circular. Discard inner candidates and
|
|
517
|
+
// keep walking for a content-independent constraint further up.
|
|
518
|
+
if (current.hasAttribute("data-bn-fit-content")) {
|
|
519
|
+
if (debug)
|
|
520
|
+
console.log(`[height:${depth}]`, current.tagName, "fit-content region → discarding inner candidate");
|
|
521
|
+
candidate = null;
|
|
522
|
+
const rows = parseInt(current.getAttribute("data-bn-fit-content"), 10);
|
|
523
|
+
if (!isNaN(rows) && rows > 1) {
|
|
524
|
+
rowShareDivisor *= rows;
|
|
525
|
+
}
|
|
526
|
+
current = getVisualParent(current);
|
|
527
|
+
depth++;
|
|
528
|
+
continue;
|
|
529
|
+
}
|
|
530
|
+
const style = getComputedStyle(current);
|
|
531
|
+
const overflow = style.overflowY;
|
|
532
|
+
if (debug) {
|
|
533
|
+
console.log(`[height:${depth}]`, current.tagName, current.className || "(no class)", `overflow=${overflow} clientH=${current.clientHeight} h=${style.height}`);
|
|
534
|
+
}
|
|
535
|
+
if (candidate === null) {
|
|
536
|
+
// An ancestor that clips / scrolls its content has a meaningful height
|
|
537
|
+
if (overflow === "hidden" || overflow === "scroll" || overflow === "auto") {
|
|
538
|
+
candidate = current.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);
|
|
539
|
+
if (debug)
|
|
540
|
+
console.log(`[height] candidate at depth ${depth}: ${Math.round(candidate)}px`);
|
|
541
|
+
}
|
|
542
|
+
else if (style.maxHeight !== "none") {
|
|
543
|
+
// An explicit max-height constrains the available space
|
|
544
|
+
const mh = parseFloat(style.maxHeight);
|
|
545
|
+
if (!isNaN(mh) && mh > 0) {
|
|
546
|
+
candidate = Math.min(mh, current.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom));
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
current = getVisualParent(current);
|
|
551
|
+
depth++;
|
|
552
|
+
}
|
|
553
|
+
if (candidate !== null) {
|
|
554
|
+
return candidate / rowShareDivisor;
|
|
555
|
+
}
|
|
556
|
+
if (debug)
|
|
557
|
+
console.log("[height] NO constrained ancestor → viewport fallback");
|
|
558
|
+
// No constrained ancestor found — use viewport, applying the same
|
|
559
|
+
// equal-share division a marked fit-content region demands
|
|
560
|
+
return typeof window !== "undefined" ? window.innerHeight / rowShareDivisor : 0;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Parses the raw `scale` attribute string into a typed {@link ScalingConfig}.
|
|
565
|
+
* Handles null/empty (-> empty), literal `"none"` / `"auto"`, or a positive
|
|
566
|
+
* numeric string (-> factor mode). Invalid non-numeric strings fall back to empty.
|
|
567
|
+
*/
|
|
568
|
+
function parseScaling(scale) {
|
|
569
|
+
if (scale == null || scale === "")
|
|
570
|
+
return { mode: "empty" };
|
|
571
|
+
if (scale === "none")
|
|
572
|
+
return { mode: "none" };
|
|
573
|
+
if (scale === "auto")
|
|
574
|
+
return { mode: "auto" };
|
|
575
|
+
const num = Number(scale);
|
|
576
|
+
if (!isNaN(num) && num > 0)
|
|
577
|
+
return { mode: "factor", factor: num };
|
|
578
|
+
return { mode: "empty" };
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
exports.findAncestor = findAncestor;
|
|
582
|
+
exports.getParentDimensions = getParentDimensions;
|
|
583
|
+
exports.isInheritedValue = isInheritedValue;
|
|
584
|
+
exports.parseScaling = parseScaling;
|
|
585
|
+
exports.withDataset = withDataset;
|
|
586
|
+
exports.withInheritedProps = withInheritedProps;
|
|
587
|
+
exports.withTranslation = withTranslation;
|
|
@@ -17,16 +17,21 @@ var withHasError = require('./withHasError-Cl2gTQzA.js');
|
|
|
17
17
|
*/
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
19
|
const withBodyObserver = (component, onUpdate) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
let hostElement;
|
|
21
|
+
// Coalesce bursts of mutations (e.g. devtools "Edit as HTML" fires childList +
|
|
22
|
+
// characterData in quick succession) and always read the *host* textContent so
|
|
23
|
+
// we deliver the complete body, not the individual text node that mutated.
|
|
24
|
+
const observer = new MutationObserver(() => {
|
|
25
|
+
var _a;
|
|
26
|
+
if (hostElement)
|
|
27
|
+
onUpdate((_a = hostElement.textContent) !== null && _a !== void 0 ? _a : "");
|
|
24
28
|
});
|
|
25
29
|
const connectedCallback = component["connectedCallback"];
|
|
26
30
|
component["connectedCallback"] = () => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
var _a;
|
|
32
|
+
hostElement = index.getElement(component);
|
|
33
|
+
observer.observe(hostElement, { childList: true, subtree: true, characterData: true });
|
|
34
|
+
onUpdate((_a = hostElement.textContent) !== null && _a !== void 0 ? _a : "");
|
|
30
35
|
withHasError.runIfExisits(connectedCallback, component);
|
|
31
36
|
};
|
|
32
37
|
const disconnectedCallback = component["disconnectedCallback"];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CDKG4xmO.js');
|
|
4
|
+
var contextProtocol = require('./context-protocol-BDrMkhc4.js');
|
|
5
|
+
var withHasError = require('./withHasError-Cl2gTQzA.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Mixin that syncs the scoped `scalingGroups` store into a component's
|
|
9
|
+
* `pixelPerUnitGroupMap` and triggers re-renders on changes.
|
|
10
|
+
*
|
|
11
|
+
* When a scaling group value is added or updated in the store (by a
|
|
12
|
+
* `<bn-scaling-group>` element), this mixin updates the local map,
|
|
13
|
+
* re-runs the component's scaling validators to clear/set error states,
|
|
14
|
+
* and forces a re-render so `preparePixelPerUnit` / `preparePixelPerPercentage`
|
|
15
|
+
* pick up the new value.
|
|
16
|
+
*
|
|
17
|
+
* @param component - Stencil component instance that has a `pixelPerUnitGroupMap` field
|
|
18
|
+
*/
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
const withScalingGroup = (component) => {
|
|
21
|
+
let subscription;
|
|
22
|
+
let stores;
|
|
23
|
+
const syncAllEntries = () => {
|
|
24
|
+
const state = stores.scalingGroups.state;
|
|
25
|
+
for (const key of Object.keys(state)) {
|
|
26
|
+
if (state[key] !== undefined) {
|
|
27
|
+
component.pixelPerUnitGroupMap.set(key, state[key]);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
component.pixelPerUnitGroupMap.delete(key);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const revalidate = () => {
|
|
35
|
+
if (typeof component.validateUnitScaling === "function") {
|
|
36
|
+
component.validateUnitScaling(component.unitScaling);
|
|
37
|
+
}
|
|
38
|
+
if (typeof component.validatePercentageScaling === "function") {
|
|
39
|
+
component.validatePercentageScaling(component.percentageScaling);
|
|
40
|
+
}
|
|
41
|
+
if (typeof component.validateSizeScaling === "function") {
|
|
42
|
+
component.validateSizeScaling();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const connectedCallback = component["connectedCallback"];
|
|
46
|
+
component["connectedCallback"] = () => {
|
|
47
|
+
const element = index.getElement(component);
|
|
48
|
+
stores = contextProtocol.getStores(element);
|
|
49
|
+
// Initial sync of all existing scaling group entries
|
|
50
|
+
syncAllEntries();
|
|
51
|
+
revalidate();
|
|
52
|
+
// Subscribe to future changes
|
|
53
|
+
subscription = stores.scalingGroups.on("set", (key, newValue) => {
|
|
54
|
+
if (newValue !== undefined) {
|
|
55
|
+
component.pixelPerUnitGroupMap.set(key, newValue);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
component.pixelPerUnitGroupMap.delete(key);
|
|
59
|
+
}
|
|
60
|
+
revalidate();
|
|
61
|
+
index.forceUpdate(index.getElement(component));
|
|
62
|
+
});
|
|
63
|
+
withHasError.runIfExisits(connectedCallback, component);
|
|
64
|
+
};
|
|
65
|
+
const disconnectedCallback = component["disconnectedCallback"];
|
|
66
|
+
component["disconnectedCallback"] = () => {
|
|
67
|
+
withHasError.runIfExisits(subscription);
|
|
68
|
+
contextProtocol.clearStoresCache(index.getElement(component));
|
|
69
|
+
withHasError.runIfExisits(disconnectedCallback, component);
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.withScalingGroup = withScalingGroup;
|