@bino-bi/bn-template-engine 1.0.0-alpha.11 → 1.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-3c827826.entry.js +1 -0
- package/dist/bn-template-engine/p-46699464.entry.js +1 -0
- package/dist/bn-template-engine/{p-e783733e.entry.js → p-52097456.entry.js} +1 -1
- package/dist/bn-template-engine/p-637e3b8f.entry.js +1 -0
- package/dist/bn-template-engine/{p-c2cbb8ea.entry.js → p-67eae33e.entry.js} +1 -1
- package/dist/bn-template-engine/{p-fdb3e99a.entry.js → p-82023539.entry.js} +1 -1
- package/dist/bn-template-engine/p-BVFHvEXF.js +1 -0
- package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
- package/dist/bn-template-engine/p-CQnZV3JG.js +1 -0
- package/dist/bn-template-engine/p-DHheVOfP.js +1 -0
- package/dist/bn-template-engine/{p-e94b4e31.entry.js → p-ab3ea8cf.entry.js} +1 -1
- package/dist/cjs/bn-asset_21.cjs.entry.js +576 -730
- package/dist/cjs/bn-grid.cjs.entry.js +2 -2
- package/dist/cjs/bn-image.cjs.entry.js +2 -2
- package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +3 -3
- package/dist/cjs/bn-tree.cjs.entry.js +2 -2
- package/dist/cjs/context-protocol-Op7uUwN3.js +9214 -0
- package/dist/cjs/editor-companion.cjs.entry.js +13 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-eyzCrFB8.js → scaling-57N4Cxb_.js} +44 -40
- package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
- package/dist/cjs/withStyled-C2kmGAK3.js +1405 -0
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +11 -6
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +50 -22
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +51 -48
- package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +11 -6
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +47 -22
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +76 -60
- 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-dataset/bn-dataset.js +214 -23
- package/dist/collection/components/bn-datasource/bn-datasource.js +27 -9
- package/dist/collection/components/bn-table/bn-table.js +13 -5
- package/dist/collection/components/bn-table/ibcs-table.js +52 -25
- package/dist/collection/components/bn-table/utils/Table.js +27 -21
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +2 -2
- package/dist/collection/components/bn-table/utils/helper/DataQuery.js +52 -43
- package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
- package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +5 -4
- package/dist/collection/components/editor-companion/editor-companion.js +12 -5
- package/dist/collection/context/scopedDb.js +113 -0
- package/dist/collection/stores/createScopedStores.js +3 -4
- package/dist/collection/utils/dataAnalyzer.js +14 -8
- package/dist/collection/utils/withBodyObserver.js +12 -7
- package/dist/collection/utils/withDataset.js +43 -39
- package/dist/collection/utils/withDatasource.js +28 -18
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGVariancesStyleGroup.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/ibcsRuleSet.js +1 -1
- package/dist/components/luxon.js +1 -0
- package/dist/components/scaling.js +1 -1
- package/dist/components/withBodyObserver.js +1 -1
- package/dist/esm/bn-asset_21.entry.js +571 -725
- package/dist/esm/bn-grid.entry.js +2 -2
- package/dist/esm/bn-image.entry.js +2 -2
- package/dist/esm/bn-internationalization.entry.js +2 -2
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-text.entry.js +3 -3
- package/dist/esm/bn-tree.entry.js +2 -2
- package/dist/esm/context-protocol-BDhzNbeD.js +9204 -0
- package/dist/esm/editor-companion.entry.js +13 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-BzbiBnuN.js → scaling-La1Ow72h.js} +44 -40
- package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
- package/dist/esm/withStyled-Bl9cSoRW.js +1372 -0
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +4 -2
- package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +7 -3
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +11 -12
- 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 +4 -2
- package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +7 -3
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +11 -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 +39 -5
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +5 -0
- package/dist/types/components/bn-table/bn-table.d.ts +4 -2
- package/dist/types/components/bn-table/ibcs-table.d.ts +11 -3
- package/dist/types/components/bn-table/utils/Table.d.ts +8 -6
- package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +2 -2
- package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +7 -3
- package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
- package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +5 -3
- package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
- package/dist/types/components.d.ts +105 -46
- package/dist/types/context/context-protocol.d.ts +4 -3
- package/dist/types/context/scopedDb.d.ts +37 -0
- package/dist/types/stores/createScopedStores.d.ts +1 -2
- package/dist/types/utils/DateStringFactory.d.ts +1 -1
- package/dist/types/utils/dataAnalyzer.d.ts +2 -1
- package/dist/types/utils/withDataset.d.ts +6 -2
- package/dist/types/utils/withDatasource.d.ts +3 -3
- package/package.json +2 -1
- package/dist/bn-template-engine/p-095f74d7.entry.js +0 -1
- package/dist/bn-template-engine/p-14318b0d.entry.js +0 -1
- package/dist/bn-template-engine/p-2133e02b.entry.js +0 -1
- package/dist/bn-template-engine/p-7HSTE79g.js +0 -1
- package/dist/bn-template-engine/p-Bi2wx-el.js +0 -1
- package/dist/bn-template-engine/p-CWiZks2h.js +0 -1
- package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
- package/dist/cjs/context-protocol-B_jipZpJ.js +0 -665
- package/dist/cjs/withStyled-V7xz_x1c.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/esm/context-protocol-D-o_UZ33.js +0 -658
- package/dist/esm/withStyled-5RqF8WBL.js +0 -9501
- package/dist/types/stores/datasets.d.ts +0 -14
- package/dist/types/stores/datasources.d.ts +0 -14
|
@@ -7,36 +7,30 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { LayoutDirection } from "./components/bn-tree/utils/TreeLayout";
|
|
9
9
|
import { EdgeStyleType } from "./components/bn-tree/utils/EdgeRenderer";
|
|
10
|
-
import { StructureChartDataRow } from "./components/bn-chart-structure/utils/model";
|
|
11
10
|
import { StructureChartStyle } from "./components/bn-chart-structure/utils/model/styles/StructureChartStyle";
|
|
12
11
|
import { Order } from "./utils/model/Order";
|
|
13
12
|
import { AggregationLevel, AxisLabelsMode, ChartMode, DataFormat, I18nMode, MeasureType, TableCategoryWidth } from "./utils/constants";
|
|
14
13
|
import { DataFormatDigits } from "./utils/model/DataFormatDigits";
|
|
15
14
|
import { StackConfigParsed } from "./components/bn-chart-structure/utils/model/StructureChartComponentConfig";
|
|
16
15
|
import { ParentDimensions } from "./utils/parentDimensions";
|
|
17
|
-
import { TimeChartDataRow } from "./components/bn-chart-time/utils/model/TimeChartDataRow";
|
|
18
16
|
import { TimeChartStyle } from "./components/bn-chart-time/utils/model/styles/TimeChartStyle";
|
|
19
17
|
import { DateDistance } from "./utils/DateStringFactory";
|
|
20
18
|
import { StackConfigParsed as StackConfigParsed1 } from "./components/bn-chart-time/utils/model/TimeChartComponentConfig";
|
|
21
|
-
import { TableDataRow } from "./components/bn-table/utils/model/TableDataRow";
|
|
22
19
|
import { TableDrillGroup } from "./components/bn-table/utils/model/TableDrillGroup";
|
|
23
20
|
import { TableType } from "./components/bn-table/utils/model";
|
|
24
21
|
import { MeasureEntry } from "./components/bn-title/ibcs-title/utils/model/MeasureEntriy";
|
|
25
22
|
import { TimePeriod } from "./components/bn-title/ibcs-title/utils/model/TimePeriod";
|
|
26
23
|
export { LayoutDirection } from "./components/bn-tree/utils/TreeLayout";
|
|
27
24
|
export { EdgeStyleType } from "./components/bn-tree/utils/EdgeRenderer";
|
|
28
|
-
export { StructureChartDataRow } from "./components/bn-chart-structure/utils/model";
|
|
29
25
|
export { StructureChartStyle } from "./components/bn-chart-structure/utils/model/styles/StructureChartStyle";
|
|
30
26
|
export { Order } from "./utils/model/Order";
|
|
31
27
|
export { AggregationLevel, AxisLabelsMode, ChartMode, DataFormat, I18nMode, MeasureType, TableCategoryWidth } from "./utils/constants";
|
|
32
28
|
export { DataFormatDigits } from "./utils/model/DataFormatDigits";
|
|
33
29
|
export { StackConfigParsed } from "./components/bn-chart-structure/utils/model/StructureChartComponentConfig";
|
|
34
30
|
export { ParentDimensions } from "./utils/parentDimensions";
|
|
35
|
-
export { TimeChartDataRow } from "./components/bn-chart-time/utils/model/TimeChartDataRow";
|
|
36
31
|
export { TimeChartStyle } from "./components/bn-chart-time/utils/model/styles/TimeChartStyle";
|
|
37
32
|
export { DateDistance } from "./utils/DateStringFactory";
|
|
38
33
|
export { StackConfigParsed as StackConfigParsed1 } from "./components/bn-chart-time/utils/model/TimeChartComponentConfig";
|
|
39
|
-
export { TableDataRow } from "./components/bn-table/utils/model/TableDataRow";
|
|
40
34
|
export { TableDrillGroup } from "./components/bn-table/utils/model/TableDrillGroup";
|
|
41
35
|
export { TableType } from "./components/bn-table/utils/model";
|
|
42
36
|
export { MeasureEntry } from "./components/bn-title/ibcs-title/utils/model/MeasureEntriy";
|
|
@@ -297,10 +291,13 @@ export namespace Components {
|
|
|
297
291
|
/**
|
|
298
292
|
* Queries data from one or more `bn-datasource` entries via AlaSQL and
|
|
299
293
|
* writes the result to the `datasets` store (+ computed `DatasetMeta`).
|
|
300
|
-
* The
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
294
|
+
* The body content is observed via `withBodyObserver` and may be:
|
|
295
|
+
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
296
|
+
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
297
|
+
* parsed body directly to the `datasets` store.
|
|
298
|
+
* 3. **URL** — place an `http://` or `https://` URL in the body to fetch
|
|
299
|
+
* JSON from a remote endpoint and write it to the `datasets` store.
|
|
300
|
+
* Set the `interval` prop (in seconds) to enable periodic re-fetching.
|
|
304
301
|
*/
|
|
305
302
|
interface BnDataset {
|
|
306
303
|
/**
|
|
@@ -308,6 +305,11 @@ export namespace Components {
|
|
|
308
305
|
* @default ""
|
|
309
306
|
*/
|
|
310
307
|
"datasources": string;
|
|
308
|
+
/**
|
|
309
|
+
* Polling interval in **seconds** for URL mode. When set and the body content is a URL, the component re-fetches data at this interval. Has no effect for SQL, inline JSON or compressed content. Set to `0` or leave unset to disable polling.
|
|
310
|
+
* @default 0
|
|
311
|
+
*/
|
|
312
|
+
"interval": number;
|
|
311
313
|
/**
|
|
312
314
|
* Unique (template scope) name of the datasource
|
|
313
315
|
*/
|
|
@@ -969,14 +971,15 @@ export namespace Components {
|
|
|
969
971
|
* @default ""
|
|
970
972
|
*/
|
|
971
973
|
"chartTitle": string;
|
|
972
|
-
/**
|
|
973
|
-
* @default []
|
|
974
|
-
*/
|
|
975
|
-
"data": StructureChartDataRow[];
|
|
976
974
|
/**
|
|
977
975
|
* @default { percent: 2, decimal: 1 }
|
|
978
976
|
*/
|
|
979
977
|
"dataFormatDigits": DataFormatDigits;
|
|
978
|
+
/**
|
|
979
|
+
* Bumped by `bn-chart-structure` when the dataset changes; triggers re-render.
|
|
980
|
+
* @default 0
|
|
981
|
+
*/
|
|
982
|
+
"dataVersion": number;
|
|
980
983
|
/**
|
|
981
984
|
* @default ""
|
|
982
985
|
*/
|
|
@@ -1034,6 +1037,11 @@ export namespace Components {
|
|
|
1034
1037
|
*/
|
|
1035
1038
|
"stackConfig": StackConfigParsed | null;
|
|
1036
1039
|
"styles": StructureChartStyle | undefined;
|
|
1040
|
+
/**
|
|
1041
|
+
* Name of the dataset (table or view in the shared alasql database).
|
|
1042
|
+
* @default ""
|
|
1043
|
+
*/
|
|
1044
|
+
"tableName": string;
|
|
1037
1045
|
/**
|
|
1038
1046
|
* @default []
|
|
1039
1047
|
*/
|
|
@@ -1053,14 +1061,15 @@ export namespace Components {
|
|
|
1053
1061
|
* @default 0
|
|
1054
1062
|
*/
|
|
1055
1063
|
"containerWidth": number;
|
|
1056
|
-
/**
|
|
1057
|
-
* @default []
|
|
1058
|
-
*/
|
|
1059
|
-
"data": TimeChartDataRow[];
|
|
1060
1064
|
/**
|
|
1061
1065
|
* @default { percent: 2, decimal: 1 }
|
|
1062
1066
|
*/
|
|
1063
1067
|
"dataFormatDigits": DataFormatDigits;
|
|
1068
|
+
/**
|
|
1069
|
+
* Bumped by `bn-chart-time` when the dataset changes; triggers re-render.
|
|
1070
|
+
* @default 0
|
|
1071
|
+
*/
|
|
1072
|
+
"dataVersion": number;
|
|
1064
1073
|
/**
|
|
1065
1074
|
* @default DateDistance.AUTO
|
|
1066
1075
|
*/
|
|
@@ -1146,6 +1155,11 @@ export namespace Components {
|
|
|
1146
1155
|
*/
|
|
1147
1156
|
"stackConfig": StackConfigParsed1 | null;
|
|
1148
1157
|
"styles": TimeChartStyle | undefined;
|
|
1158
|
+
/**
|
|
1159
|
+
* Name of the dataset (table or view in the shared alasql database).
|
|
1160
|
+
* @default ""
|
|
1161
|
+
*/
|
|
1162
|
+
"tableName": string;
|
|
1149
1163
|
/**
|
|
1150
1164
|
* @default []
|
|
1151
1165
|
*/
|
|
@@ -1176,14 +1190,15 @@ export namespace Components {
|
|
|
1176
1190
|
* @default new Map()
|
|
1177
1191
|
*/
|
|
1178
1192
|
"categorythereof": Map<string, Record<string, unknown>[]>;
|
|
1179
|
-
/**
|
|
1180
|
-
* @default []
|
|
1181
|
-
*/
|
|
1182
|
-
"data": TableDataRow[];
|
|
1183
1193
|
/**
|
|
1184
1194
|
* @default { percent: 2, decimal: 1 }
|
|
1185
1195
|
*/
|
|
1186
1196
|
"dataFormatDigits": DataFormatDigits;
|
|
1197
|
+
/**
|
|
1198
|
+
* Bumped by the outer `bn-table` whenever the dataset's data changes. Triggers a re-render via Stencil's prop-change detection.
|
|
1199
|
+
* @default 0
|
|
1200
|
+
*/
|
|
1201
|
+
"dataVersion": number;
|
|
1187
1202
|
/**
|
|
1188
1203
|
* @default ""
|
|
1189
1204
|
*/
|
|
@@ -1248,6 +1263,11 @@ export namespace Components {
|
|
|
1248
1263
|
* @default true
|
|
1249
1264
|
*/
|
|
1250
1265
|
"showMeasureScale": boolean;
|
|
1266
|
+
/**
|
|
1267
|
+
* Name of the dataset (a table or view in the shared alasql database). The inner `Table` helper queries it directly — no array copy.
|
|
1268
|
+
* @default ""
|
|
1269
|
+
*/
|
|
1270
|
+
"tableName": string;
|
|
1251
1271
|
/**
|
|
1252
1272
|
* @default "SUM_TOTAL"
|
|
1253
1273
|
*/
|
|
@@ -1363,10 +1383,13 @@ declare global {
|
|
|
1363
1383
|
/**
|
|
1364
1384
|
* Queries data from one or more `bn-datasource` entries via AlaSQL and
|
|
1365
1385
|
* writes the result to the `datasets` store (+ computed `DatasetMeta`).
|
|
1366
|
-
* The
|
|
1367
|
-
*
|
|
1368
|
-
*
|
|
1369
|
-
*
|
|
1386
|
+
* The body content is observed via `withBodyObserver` and may be:
|
|
1387
|
+
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
1388
|
+
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
1389
|
+
* parsed body directly to the `datasets` store.
|
|
1390
|
+
* 3. **URL** — place an `http://` or `https://` URL in the body to fetch
|
|
1391
|
+
* JSON from a remote endpoint and write it to the `datasets` store.
|
|
1392
|
+
* Set the `interval` prop (in seconds) to enable periodic re-fetching.
|
|
1370
1393
|
*/
|
|
1371
1394
|
interface HTMLBnDatasetElement extends Components.BnDataset, HTMLStencilElement {
|
|
1372
1395
|
}
|
|
@@ -1851,10 +1874,13 @@ declare namespace LocalJSX {
|
|
|
1851
1874
|
/**
|
|
1852
1875
|
* Queries data from one or more `bn-datasource` entries via AlaSQL and
|
|
1853
1876
|
* writes the result to the `datasets` store (+ computed `DatasetMeta`).
|
|
1854
|
-
* The
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
1857
|
-
*
|
|
1877
|
+
* The body content is observed via `withBodyObserver` and may be:
|
|
1878
|
+
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
1879
|
+
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
1880
|
+
* parsed body directly to the `datasets` store.
|
|
1881
|
+
* 3. **URL** — place an `http://` or `https://` URL in the body to fetch
|
|
1882
|
+
* JSON from a remote endpoint and write it to the `datasets` store.
|
|
1883
|
+
* Set the `interval` prop (in seconds) to enable periodic re-fetching.
|
|
1858
1884
|
*/
|
|
1859
1885
|
interface BnDataset {
|
|
1860
1886
|
/**
|
|
@@ -1862,6 +1888,11 @@ declare namespace LocalJSX {
|
|
|
1862
1888
|
* @default ""
|
|
1863
1889
|
*/
|
|
1864
1890
|
"datasources"?: string;
|
|
1891
|
+
/**
|
|
1892
|
+
* Polling interval in **seconds** for URL mode. When set and the body content is a URL, the component re-fetches data at this interval. Has no effect for SQL, inline JSON or compressed content. Set to `0` or leave unset to disable polling.
|
|
1893
|
+
* @default 0
|
|
1894
|
+
*/
|
|
1895
|
+
"interval"?: number;
|
|
1865
1896
|
/**
|
|
1866
1897
|
* Unique (template scope) name of the datasource
|
|
1867
1898
|
*/
|
|
@@ -2518,14 +2549,15 @@ declare namespace LocalJSX {
|
|
|
2518
2549
|
* @default ""
|
|
2519
2550
|
*/
|
|
2520
2551
|
"chartTitle"?: string;
|
|
2521
|
-
/**
|
|
2522
|
-
* @default []
|
|
2523
|
-
*/
|
|
2524
|
-
"data"?: StructureChartDataRow[];
|
|
2525
2552
|
/**
|
|
2526
2553
|
* @default { percent: 2, decimal: 1 }
|
|
2527
2554
|
*/
|
|
2528
2555
|
"dataFormatDigits"?: DataFormatDigits;
|
|
2556
|
+
/**
|
|
2557
|
+
* Bumped by `bn-chart-structure` when the dataset changes; triggers re-render.
|
|
2558
|
+
* @default 0
|
|
2559
|
+
*/
|
|
2560
|
+
"dataVersion"?: number;
|
|
2529
2561
|
/**
|
|
2530
2562
|
* @default ""
|
|
2531
2563
|
*/
|
|
@@ -2583,6 +2615,11 @@ declare namespace LocalJSX {
|
|
|
2583
2615
|
*/
|
|
2584
2616
|
"stackConfig"?: StackConfigParsed | null;
|
|
2585
2617
|
"styles"?: StructureChartStyle | undefined;
|
|
2618
|
+
/**
|
|
2619
|
+
* Name of the dataset (table or view in the shared alasql database).
|
|
2620
|
+
* @default ""
|
|
2621
|
+
*/
|
|
2622
|
+
"tableName"?: string;
|
|
2586
2623
|
/**
|
|
2587
2624
|
* @default []
|
|
2588
2625
|
*/
|
|
@@ -2602,14 +2639,15 @@ declare namespace LocalJSX {
|
|
|
2602
2639
|
* @default 0
|
|
2603
2640
|
*/
|
|
2604
2641
|
"containerWidth"?: number;
|
|
2605
|
-
/**
|
|
2606
|
-
* @default []
|
|
2607
|
-
*/
|
|
2608
|
-
"data"?: TimeChartDataRow[];
|
|
2609
2642
|
/**
|
|
2610
2643
|
* @default { percent: 2, decimal: 1 }
|
|
2611
2644
|
*/
|
|
2612
2645
|
"dataFormatDigits"?: DataFormatDigits;
|
|
2646
|
+
/**
|
|
2647
|
+
* Bumped by `bn-chart-time` when the dataset changes; triggers re-render.
|
|
2648
|
+
* @default 0
|
|
2649
|
+
*/
|
|
2650
|
+
"dataVersion"?: number;
|
|
2613
2651
|
/**
|
|
2614
2652
|
* @default DateDistance.AUTO
|
|
2615
2653
|
*/
|
|
@@ -2695,6 +2733,11 @@ declare namespace LocalJSX {
|
|
|
2695
2733
|
*/
|
|
2696
2734
|
"stackConfig"?: StackConfigParsed1 | null;
|
|
2697
2735
|
"styles"?: TimeChartStyle | undefined;
|
|
2736
|
+
/**
|
|
2737
|
+
* Name of the dataset (table or view in the shared alasql database).
|
|
2738
|
+
* @default ""
|
|
2739
|
+
*/
|
|
2740
|
+
"tableName"?: string;
|
|
2698
2741
|
/**
|
|
2699
2742
|
* @default []
|
|
2700
2743
|
*/
|
|
@@ -2725,14 +2768,15 @@ declare namespace LocalJSX {
|
|
|
2725
2768
|
* @default new Map()
|
|
2726
2769
|
*/
|
|
2727
2770
|
"categorythereof"?: Map<string, Record<string, unknown>[]>;
|
|
2728
|
-
/**
|
|
2729
|
-
* @default []
|
|
2730
|
-
*/
|
|
2731
|
-
"data"?: TableDataRow[];
|
|
2732
2771
|
/**
|
|
2733
2772
|
* @default { percent: 2, decimal: 1 }
|
|
2734
2773
|
*/
|
|
2735
2774
|
"dataFormatDigits"?: DataFormatDigits;
|
|
2775
|
+
/**
|
|
2776
|
+
* Bumped by the outer `bn-table` whenever the dataset's data changes. Triggers a re-render via Stencil's prop-change detection.
|
|
2777
|
+
* @default 0
|
|
2778
|
+
*/
|
|
2779
|
+
"dataVersion"?: number;
|
|
2736
2780
|
/**
|
|
2737
2781
|
* @default ""
|
|
2738
2782
|
*/
|
|
@@ -2797,6 +2841,11 @@ declare namespace LocalJSX {
|
|
|
2797
2841
|
* @default true
|
|
2798
2842
|
*/
|
|
2799
2843
|
"showMeasureScale"?: boolean;
|
|
2844
|
+
/**
|
|
2845
|
+
* Name of the dataset (a table or view in the shared alasql database). The inner `Table` helper queries it directly — no array copy.
|
|
2846
|
+
* @default ""
|
|
2847
|
+
*/
|
|
2848
|
+
"tableName"?: string;
|
|
2800
2849
|
/**
|
|
2801
2850
|
* @default "SUM_TOTAL"
|
|
2802
2851
|
*/
|
|
@@ -2905,6 +2954,7 @@ declare namespace LocalJSX {
|
|
|
2905
2954
|
"datasources": string;
|
|
2906
2955
|
"static": boolean;
|
|
2907
2956
|
"raw": boolean;
|
|
2957
|
+
"interval": number;
|
|
2908
2958
|
}
|
|
2909
2959
|
interface BnDatasourceAttributes {
|
|
2910
2960
|
"name": string;
|
|
@@ -3068,6 +3118,8 @@ declare namespace LocalJSX {
|
|
|
3068
3118
|
"showOperators": string;
|
|
3069
3119
|
}
|
|
3070
3120
|
interface IbcsChartStructureAttributes {
|
|
3121
|
+
"tableName": string;
|
|
3122
|
+
"dataVersion": number;
|
|
3071
3123
|
"chartTitle": string;
|
|
3072
3124
|
"hideCategories": boolean;
|
|
3073
3125
|
"pixelPerUnit": number;
|
|
@@ -3080,6 +3132,8 @@ declare namespace LocalJSX {
|
|
|
3080
3132
|
"showMeasureScale": boolean;
|
|
3081
3133
|
}
|
|
3082
3134
|
interface IbcsChartTimeAttributes {
|
|
3135
|
+
"tableName": string;
|
|
3136
|
+
"dataVersion": number;
|
|
3083
3137
|
"chartTitle": string;
|
|
3084
3138
|
"hideAxisLabels": boolean;
|
|
3085
3139
|
"pixelPerUnit": number;
|
|
@@ -3102,6 +3156,8 @@ declare namespace LocalJSX {
|
|
|
3102
3156
|
"containerWidth": number;
|
|
3103
3157
|
}
|
|
3104
3158
|
interface IbcsTableAttributes {
|
|
3159
|
+
"tableName": string;
|
|
3160
|
+
"dataVersion": number;
|
|
3105
3161
|
"tableTitle": string;
|
|
3106
3162
|
"scenariosDataFormat": DataFormat;
|
|
3107
3163
|
"grouped": boolean;
|
|
@@ -3189,10 +3245,13 @@ declare module "@stencil/core" {
|
|
|
3189
3245
|
/**
|
|
3190
3246
|
* Queries data from one or more `bn-datasource` entries via AlaSQL and
|
|
3191
3247
|
* writes the result to the `datasets` store (+ computed `DatasetMeta`).
|
|
3192
|
-
* The
|
|
3193
|
-
*
|
|
3194
|
-
*
|
|
3195
|
-
*
|
|
3248
|
+
* The body content is observed via `withBodyObserver` and may be:
|
|
3249
|
+
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
3250
|
+
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
3251
|
+
* parsed body directly to the `datasets` store.
|
|
3252
|
+
* 3. **URL** — place an `http://` or `https://` URL in the body to fetch
|
|
3253
|
+
* JSON from a remote endpoint and write it to the `datasets` store.
|
|
3254
|
+
* Set the `interval` prop (in seconds) to enable periodic re-fetching.
|
|
3196
3255
|
*/
|
|
3197
3256
|
"bn-dataset": LocalJSX.IntrinsicElements["bn-dataset"] & JSXBase.HTMLAttributes<HTMLBnDatasetElement>;
|
|
3198
3257
|
/**
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { Style } from "../stores/componentStyles";
|
|
14
14
|
import { ContextStore } from "../stores/context";
|
|
15
15
|
import { DatasetMeta } from "../utils/model/DatasetMeta";
|
|
16
|
+
import { ScopedDb } from "./scopedDb";
|
|
16
17
|
/** Return type of `createStore()` from `@stencil/store`. */
|
|
17
18
|
export interface StoreInstance<T extends object> {
|
|
18
19
|
state: T;
|
|
@@ -20,10 +21,10 @@ export interface StoreInstance<T extends object> {
|
|
|
20
21
|
get: (key: keyof T) => T[keyof T];
|
|
21
22
|
set: (key: keyof T, value: T[keyof T]) => void;
|
|
22
23
|
}
|
|
23
|
-
/** Typed bag of all
|
|
24
|
+
/** Typed bag of all stores + the shared alasql database owned by a single `<bn-context>`. */
|
|
24
25
|
export interface ScopedStores {
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
/** Shared isolated alasql database. Datasources/datasets register tables/views here. */
|
|
27
|
+
db: ScopedDb;
|
|
27
28
|
datasetsMeta: StoreInstance<Record<string, DatasetMeta>>;
|
|
28
29
|
componentStyles: StoreInstance<Record<string, Style>>;
|
|
29
30
|
internationalization: StoreInstance<Record<string, unknown>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-context isolated AlaSQL database with a tiny pub/sub for table/view
|
|
3
|
+
* data changes.
|
|
4
|
+
*
|
|
5
|
+
* Each `<bn-context>` owns one `ScopedDb`. `<bn-datasource>` and the static/
|
|
6
|
+
* URL branches of `<bn-dataset>` register tables; the SQL branch of
|
|
7
|
+
* `<bn-dataset>` registers views. Consumer components subscribe by name and
|
|
8
|
+
* re-render when the producer calls `notify(name)`.
|
|
9
|
+
*
|
|
10
|
+
* @module context/scopedDb
|
|
11
|
+
*/
|
|
12
|
+
import alasql from "alasql";
|
|
13
|
+
/** Concrete type of an alasql database instance (the `alasql` module exports it as a value, not a named type). */
|
|
14
|
+
export type AlaSQLDatabase = InstanceType<typeof alasql.Database>;
|
|
15
|
+
/**
|
|
16
|
+
* Builds a SQL FROM-clause expression for a dataset, optionally filtered.
|
|
17
|
+
*
|
|
18
|
+
* Helpers (DataQuery, Table, StructureChart, TimeChart, dataAnalyzer) embed
|
|
19
|
+
* this in their queries instead of accepting `[data]` array parameters, so
|
|
20
|
+
* alasql doesn't have to ingest a fresh table on every call.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildFromExpr(tableName: string, filter?: string | null): string;
|
|
23
|
+
/** Pub/sub-enabled wrapper around an isolated alasql database. */
|
|
24
|
+
export interface ScopedDb {
|
|
25
|
+
/** The underlying alasql database. Use it directly for `db.exec(...)` queries. */
|
|
26
|
+
readonly db: AlaSQLDatabase;
|
|
27
|
+
/** Register a callback fired synchronously whenever `notify(name)` is called. Returns the unsubscribe function. */
|
|
28
|
+
subscribe(name: string, cb: () => void): () => void;
|
|
29
|
+
/** Fire all subscribers registered for `name`. Producers call this after writing data. */
|
|
30
|
+
notify(name: string): void;
|
|
31
|
+
/** True if a table with this name exists in the database. */
|
|
32
|
+
hasTable(name: string): boolean;
|
|
33
|
+
/** True if a view with this name exists in the database. */
|
|
34
|
+
hasView(name: string): boolean;
|
|
35
|
+
}
|
|
36
|
+
/** Creates a fresh isolated database with its own subscriber map. */
|
|
37
|
+
export declare function createScopedDb(): ScopedDb;
|
|
@@ -2,8 +2,7 @@ import { Style } from "./componentStyles";
|
|
|
2
2
|
import { ContextStore } from "./context";
|
|
3
3
|
import { DatasetMeta } from "../utils/model/DatasetMeta";
|
|
4
4
|
export declare function createScopedStores(): {
|
|
5
|
-
|
|
6
|
-
datasets: import("@stencil/store").ObservableMap<Record<string, unknown>>;
|
|
5
|
+
db: import("../context/scopedDb").ScopedDb;
|
|
7
6
|
datasetsMeta: import("@stencil/store").ObservableMap<Record<string, DatasetMeta>>;
|
|
8
7
|
componentStyles: import("@stencil/store").ObservableMap<Record<string, Style>>;
|
|
9
8
|
internationalization: import("@stencil/store").ObservableMap<Record<string, unknown>>;
|
|
@@ -101,7 +101,7 @@ export declare class DateStringFactory {
|
|
|
101
101
|
*/
|
|
102
102
|
getDateLinkString(startDateTime: DateTime | null, endDateTime: DateTime | null, mode: DateLink, type: DateDistance, spanLimit: number): string;
|
|
103
103
|
/** Returns an abbreviated date string using the short format map (e.g. "yy" for year, "LLL" for month). */
|
|
104
|
-
getShortDateString(date: DateTime, type: DateDistance):
|
|
104
|
+
getShortDateString(date: DateTime, type: DateDistance): string;
|
|
105
105
|
private getFormatedDayDate;
|
|
106
106
|
private getFormatedMonthDate;
|
|
107
107
|
private getFormatedQuarterDate;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AlaSQLDatabase } from "../context/scopedDb";
|
|
1
2
|
import { SiPrefix } from "./model/SiPrefix";
|
|
2
3
|
/**
|
|
3
4
|
* SI prefix lookup table mapping prefix symbols to their numeric multipliers.
|
|
@@ -48,7 +49,7 @@ export declare class DataAnalyzer {
|
|
|
48
49
|
* are considered; variance columns are excluded.
|
|
49
50
|
* - `null` with data: defaults to GREATEST auto-detection
|
|
50
51
|
*/
|
|
51
|
-
static calculateMeasureScale(
|
|
52
|
+
static calculateMeasureScale(db: AlaSQLDatabase, fromExpr: string, scenarios: string[], mode: string | null): SiPrefix;
|
|
52
53
|
/** Maps an absolute numeric value to the best-fitting SI prefix based on digit count. */
|
|
53
54
|
private static determinePrefix;
|
|
54
55
|
/** Looks up an explicit SI prefix string in the NumeralFigure enum. */
|
|
@@ -3,8 +3,12 @@ import { DatasetMeta } from "./model/DatasetMeta";
|
|
|
3
3
|
* Mixin that subscribes a Stencil component to one or more datasets/datasources.
|
|
4
4
|
*
|
|
5
5
|
* **Naming convention:** The `datasets` HTML attribute accepts a comma-separated list of names.
|
|
6
|
-
* Names prefixed with `$` (e.g. `$revenue`) read directly from the raw
|
|
7
|
-
* unprefixed names read from
|
|
6
|
+
* Names prefixed with `$` (e.g. `$revenue`) read directly from the raw datasource tables;
|
|
7
|
+
* unprefixed names read from datasets (registered as tables/views by `<bn-dataset>`).
|
|
8
|
+
*
|
|
9
|
+
* Data is sourced from the shared per-context alasql database; each subscribed
|
|
10
|
+
* name is registered with `stores.db.subscribe(...)` and the rows are materialized
|
|
11
|
+
* via `db.exec("SELECT * FROM <name>")` whenever the producer fires `notify(name)`.
|
|
8
12
|
*
|
|
9
13
|
* The mixin installs a MutationObserver on the host element's `datasets` attribute so
|
|
10
14
|
* bindings update automatically when the attribute is changed at runtime.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Mixin that subscribes a Stencil component to raw datasources.
|
|
3
3
|
*
|
|
4
4
|
* This is the simpler counterpart of {@link withDataset} -- it reads directly from
|
|
5
|
-
* the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* the shared alasql database via `stores.db.subscribe(name, ...)`. Primarily used
|
|
6
|
+
* by `bn-dataset` itself to react to upstream datasource updates so it can re-fire
|
|
7
|
+
* its own dataset notification.
|
|
8
8
|
*
|
|
9
9
|
* Watches the host element's `datasources` attribute via MutationObserver for
|
|
10
10
|
* dynamic rebinding at runtime.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bino-bi/bn-template-engine",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.13",
|
|
4
4
|
"description": "IBCS-compliant web components for business intelligence tables and charts",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@stencil/sass": "^3.2.3",
|
|
43
43
|
"@stencil/store": "^2.2.2",
|
|
44
44
|
"@types/jest": "^29.5.14",
|
|
45
|
+
"@types/luxon": "^3.7.1",
|
|
45
46
|
"eslint": "^10.0.2",
|
|
46
47
|
"eslint-config-prettier": "^10.1.8",
|
|
47
48
|
"husky": "^9.1.7",
|