@bino-bi/bn-template-engine 1.0.0-alpha.13 → 1.0.0-alpha.15

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.
Files changed (93) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/{p-637e3b8f.entry.js → p-19f49fbc.entry.js} +1 -1
  3. package/dist/bn-template-engine/p-209b3fd9.entry.js +1 -0
  4. package/dist/bn-template-engine/{p-67eae33e.entry.js → p-3465fcdc.entry.js} +1 -1
  5. package/dist/bn-template-engine/{p-82023539.entry.js → p-67746414.entry.js} +1 -1
  6. package/dist/bn-template-engine/p-BPDZcex5.js +1 -0
  7. package/dist/bn-template-engine/{p-DHheVOfP.js → p-Tx6omDWp.js} +1 -1
  8. package/dist/bn-template-engine/{p-52097456.entry.js → p-d724ab88.entry.js} +1 -1
  9. package/dist/bn-template-engine/p-efd3b67a.entry.js +1 -0
  10. package/dist/bn-template-engine/{p-46699464.entry.js → p-ff659485.entry.js} +1 -1
  11. package/dist/bn-template-engine/p-z9bPNFYF.js +1 -0
  12. package/dist/cjs/bn-asset_21.cjs.entry.js +348 -75
  13. package/dist/cjs/bn-grid.cjs.entry.js +2 -2
  14. package/dist/cjs/bn-image.cjs.entry.js +2 -2
  15. package/dist/cjs/bn-internationalization.cjs.entry.js +1 -1
  16. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  17. package/dist/cjs/bn-text.cjs.entry.js +3 -3
  18. package/dist/cjs/bn-tree.cjs.entry.js +2 -2
  19. package/dist/cjs/{context-protocol-Op7uUwN3.js → context-protocol-Cn5PL928.js} +14 -0
  20. package/dist/cjs/editor-companion.cjs.entry.js +1 -1
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/cjs/{scaling-57N4Cxb_.js → scaling-DM2UILdF.js} +58 -17
  23. package/dist/cjs/{withStyled-C2kmGAK3.js → withStyled-Dx3uRw9g.js} +72 -1
  24. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +28 -10
  25. package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
  26. package/dist/collection/components/bn-chart-time/bn-chart-time.js +39 -1
  27. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +40 -10
  28. package/dist/collection/components/bn-dataset/bn-dataset.js +25 -13
  29. package/dist/collection/components/bn-datasource/bn-datasource.js +23 -12
  30. package/dist/collection/components/bn-layout-card/bn-layout-card.css +5 -0
  31. package/dist/collection/components/bn-layout-card/bn-layout-card.js +6 -3
  32. package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -0
  33. package/dist/collection/components/bn-layout-page/bn-layout-page.js +6 -3
  34. package/dist/collection/components/bn-table/bn-table.js +75 -7
  35. package/dist/collection/components/bn-table/ibcs-table.js +27 -0
  36. package/dist/collection/components/bn-table/utils/Table.js +2 -2
  37. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +28 -5
  38. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +46 -6
  39. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
  40. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +5 -0
  41. package/dist/collection/context/scopedDb.js +14 -0
  42. package/dist/collection/utils/parentDimensions.js +57 -16
  43. package/dist/collection/utils/validate.js +23 -0
  44. package/dist/components/DateStringFactory.js +1 -1
  45. package/dist/components/Order.js +1 -1
  46. package/dist/components/bn-chart-structure.js +1 -1
  47. package/dist/components/bn-chart-time.js +1 -1
  48. package/dist/components/bn-dataset.js +1 -1
  49. package/dist/components/bn-datasource.js +1 -1
  50. package/dist/components/bn-layout-card.js +1 -1
  51. package/dist/components/bn-layout-page.js +1 -1
  52. package/dist/components/bn-table.js +1 -1
  53. package/dist/components/bn-title2.js +1 -1
  54. package/dist/components/context-protocol.js +1 -1
  55. package/dist/components/ibcs-chart-structure2.js +1 -1
  56. package/dist/components/ibcs-chart-time2.js +1 -1
  57. package/dist/components/ibcs-table2.js +1 -1
  58. package/dist/components/ibcs-title2.js +1 -1
  59. package/dist/components/scaling.js +1 -1
  60. package/dist/components/validate.js +1 -1
  61. package/dist/esm/bn-asset_21.entry.js +348 -75
  62. package/dist/esm/bn-grid.entry.js +2 -2
  63. package/dist/esm/bn-image.entry.js +2 -2
  64. package/dist/esm/bn-internationalization.entry.js +1 -1
  65. package/dist/esm/bn-template-engine.js +1 -1
  66. package/dist/esm/bn-text.entry.js +3 -3
  67. package/dist/esm/bn-tree.entry.js +2 -2
  68. package/dist/esm/{context-protocol-BDhzNbeD.js → context-protocol-BB-4Onmw.js} +14 -0
  69. package/dist/esm/editor-companion.entry.js +1 -1
  70. package/dist/esm/loader.js +1 -1
  71. package/dist/esm/{scaling-La1Ow72h.js → scaling-h4KcBet3.js} +58 -17
  72. package/dist/esm/{withStyled-Bl9cSoRW.js → withStyled-BBvU2f-A.js} +71 -2
  73. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +4 -0
  74. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  75. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +13 -0
  76. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +4 -0
  77. package/dist/types/components/bn-dataset/bn-dataset.d.ts +15 -7
  78. package/dist/types/components/bn-datasource/bn-datasource.d.ts +13 -6
  79. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +1 -0
  80. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +1 -0
  81. package/dist/types/components/bn-table/bn-table.d.ts +13 -0
  82. package/dist/types/components/bn-table/ibcs-table.d.ts +2 -0
  83. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +3 -1
  84. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +11 -0
  85. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  86. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +3 -0
  87. package/dist/types/components.d.ts +45 -20
  88. package/dist/types/utils/validate.d.ts +6 -0
  89. package/package.json +1 -1
  90. package/dist/bn-template-engine/p-3c827826.entry.js +0 -1
  91. package/dist/bn-template-engine/p-BVFHvEXF.js +0 -1
  92. package/dist/bn-template-engine/p-CQnZV3JG.js +0 -1
  93. package/dist/bn-template-engine/p-ab3ea8cf.entry.js +0 -1
@@ -6,9 +6,10 @@
6
6
  * 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
7
7
  * 2. **Static JSON** — set `static="true"` to bypass SQL and write the
8
8
  * parsed body directly to the `datasets` store.
9
- * 3. **URL** — place an `http://` or `https://` URL in the body to fetch
10
- * JSON from a remote endpoint and write it to the `datasets` store.
11
- * Set the `interval` prop (in seconds) to enable periodic re-fetching.
9
+ * 3. **URL** — place an `http://`/`https://` URL or a same-origin path
10
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint and
11
+ * write it to the `datasets` store. Set the `interval` prop (in seconds)
12
+ * to enable periodic re-fetching.
12
13
  */
13
14
  export declare class Dataset {
14
15
  private element;
@@ -62,7 +63,9 @@ export declare class Dataset {
62
63
  onIntervalChange(): void;
63
64
  disconnectedCallback(): void;
64
65
  /**
65
- * Returns `true` if the text starts with `http://` or `https://`.
66
+ * Returns `true` if the text is a fetchable URL: an absolute `http(s)://`
67
+ * URL, or a same-origin path starting with `/` (but not `//`, which is a
68
+ * protocol-relative URL we treat as inline-mode escape).
66
69
  */
67
70
  private isUrl;
68
71
  /**
@@ -70,9 +73,14 @@ export declare class Dataset {
70
73
  * Cancels any in-flight request before starting a new one.
71
74
  */
72
75
  private fetchAndStore;
73
- /** Stops the polling timer and cancels any in-flight fetch. */
74
- private clearPolling;
75
- /** Starts (or restarts) the polling timer if in URL mode with a positive interval. */
76
+ /** Stops the polling timer (does NOT touch any in-flight fetch). */
77
+ private clearPollTimer;
78
+ /** Stops the polling timer AND cancels any in-flight fetch. Use only when
79
+ * leaving URL mode entirely (disconnect or body changed to inline). */
80
+ private cancelInFlight;
81
+ /** Starts (or restarts) the polling timer if in URL mode with a positive
82
+ * interval. Does NOT abort the kick-off fetch issued by the caller — it
83
+ * only resets the interval timer. */
76
84
  private startPolling;
77
85
  render(): any;
78
86
  }
@@ -4,8 +4,8 @@
4
4
  * Data can be provided in three ways:
5
5
  * 1. **Inline JSON** — Place JSON text inside the element body (default).
6
6
  * 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
7
- * 3. **URL** — Place an `http://` or `https://` URL in the body to fetch JSON
8
- * from a remote endpoint.
7
+ * 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
8
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint.
9
9
  *
10
10
  * In URL mode the component fetches JSON from the URL. Set the `interval`
11
11
  * prop (in seconds) to enable periodic re-fetching (polling).
@@ -50,7 +50,9 @@ export declare class Datasource {
50
50
  onIntervalChange(): void;
51
51
  disconnectedCallback(): void;
52
52
  /**
53
- * Returns `true` if the text starts with `http://` or `https://`.
53
+ * Returns `true` if the text is a fetchable URL: an absolute `http(s)://`
54
+ * URL, or a same-origin path starting with `/` (but not `//`, which is a
55
+ * protocol-relative URL we treat as inline-mode escape).
54
56
  */
55
57
  private isUrl;
56
58
  /**
@@ -58,9 +60,14 @@ export declare class Datasource {
58
60
  * Cancels any in-flight request before starting a new one.
59
61
  */
60
62
  private fetchAndStore;
61
- /** Stops the polling timer and cancels any in-flight fetch. */
62
- private clearPolling;
63
- /** Starts (or restarts) the polling timer if in URL mode with a positive interval. */
63
+ /** Stops the polling timer (does NOT touch any in-flight fetch). */
64
+ private clearPollTimer;
65
+ /** Stops the polling timer AND cancels any in-flight fetch. Use only when
66
+ * leaving URL mode entirely (disconnect or body changed to inline). */
67
+ private cancelInFlight;
68
+ /** Starts (or restarts) the polling timer if in URL mode with a positive
69
+ * interval. Does NOT abort the kick-off fetch issued by the caller — it
70
+ * only resets the interval timer. */
64
71
  private startPolling;
65
72
  render(): any;
66
73
  }
@@ -170,6 +170,7 @@ export declare class LayoutCard {
170
170
  private getCommonStyles;
171
171
  private calculateFractions;
172
172
  private getGridTemplateColumns;
173
+ private getRowCount;
173
174
  private getGridTemplateRows;
174
175
  private getLayoutStyle;
175
176
  private createDivAreaStyles;
@@ -185,6 +185,7 @@ export declare class LayoutPage {
185
185
  pageFitToContent: boolean;
186
186
  private templateMap;
187
187
  private getCommonStyles;
188
+ private getRowCount;
188
189
  private getGridTemplateRows;
189
190
  private getLayoutStyle;
190
191
  private createDivAreaStyles;
@@ -354,6 +354,18 @@ export declare class Table {
354
354
  */
355
355
  columnthereof: string | null;
356
356
  validateColumnThereOf(newValue: string | null): void;
357
+ /**
358
+ * Stringified JSON object defining custom columns computed from dataset fields.<br />
359
+ * Keys are column labels, values are aggregate expressions over the rows that
360
+ * make up each table row.<br /><br />
361
+ * Functions: ```set // first // last // min // max // avg // sum // lit```<br />
362
+ * Fields can be standard dataset fields (e.g. ```ac1```) or custom fields
363
+ * prefixed with ```_``` (e.g. ```_leiter```); ```lit``` takes a constant value.<br /><br />
364
+ * example:<br />
365
+ * ```{"Verkaufsleiter": "set(_leiter)", "Umsatz gesamt": "sum(ac1)"}```
366
+ */
367
+ tableAttributes: string;
368
+ validateTableAttributes(newValue: string): void;
357
369
  componentWillLoad(): void;
358
370
  componentDidLoad(): void;
359
371
  disconnectedCallback(): void;
@@ -375,6 +387,7 @@ export declare class Table {
375
387
  private prepareMeasureScale;
376
388
  private prepareMeasureType;
377
389
  private prepareColumnThereOf;
390
+ private prepareAttributes;
378
391
  private prepareTableTitle;
379
392
  prepareShowMeasureScale(): boolean;
380
393
  prepareMeasureUnit(): string;
@@ -1,5 +1,6 @@
1
1
  import { TableType } from "./utils/model";
2
2
  import { TableDrillGroup } from "./utils/model/TableDrillGroup";
3
+ import { TableAttribute } from "./utils/model/TableAttribute";
3
4
  import { DataFormat, I18nMode, MeasureType, TableCategoryWidth } from "../../utils/constants";
4
5
  import { DataFormatDigits } from "../../utils/model/DataFormatDigits";
5
6
  import { Order } from "../../utils/model/Order";
@@ -35,6 +36,7 @@ export declare class IbcsTable {
35
36
  partof: TableDrillGroup[];
36
37
  order: Order;
37
38
  categorythereof: Map<string, Record<string, unknown>[]>;
39
+ attributeColumns: TableAttribute[];
38
40
  type: TableType;
39
41
  categoryWidth: TableCategoryWidth;
40
42
  dataFormatDigits: DataFormatDigits;
@@ -1,5 +1,6 @@
1
1
  import { TableRow } from "../elements";
2
2
  import { TableType } from "../model";
3
+ import { TableAttribute } from "../model/TableAttribute";
3
4
  import { TableComponentConfig } from "../model/TableComponentConfig";
4
5
  import { SiPrefix } from "../../../../utils/model/SiPrefix";
5
6
  import { AlaSQLDatabase } from "../../../../context/scopedDb";
@@ -16,6 +17,7 @@ import { AlaSQLDatabase } from "../../../../context/scopedDb";
16
17
  */
17
18
  export declare class TableDataSetFactory {
18
19
  private normalizedHeader;
20
+ private attributesByAlias;
19
21
  constructor();
20
22
  /**
21
23
  * Creates Tableheader based on the configured scenarios (in config)
@@ -30,7 +32,7 @@ export declare class TableDataSetFactory {
30
32
  group: string;
31
33
  type: string;
32
34
  order: string | undefined;
33
- }[], i18n: Map<string | number, string>, measureScale: SiPrefix, measureUnit: string, showMeasureScale: boolean): TableRow[];
35
+ }[], i18n: Map<string | number, string>, measureScale: SiPrefix, measureUnit: string, showMeasureScale: boolean, attributes?: TableAttribute[]): TableRow[];
34
36
  private setHeaderPrefix;
35
37
  /**
36
38
  * combines the default columnnames (operation and category) with the
@@ -108,6 +108,17 @@ export declare class DataQuery {
108
108
  * - A companion `_cnt` column (COUNT of non-null values) is emitted for NaN detection.
109
109
  */
110
110
  private translateScenarioSQL;
111
+ /**
112
+ * Translates an attribute definition into a SQL aggregate expression aliased
113
+ * to the attribute's safe column alias (`attr_N`).
114
+ *
115
+ * `sum`/`avg` on scenario fields respect the row operation sign via
116
+ * `transformOperator`, consistent with {@link translateScenarioSQL}; for
117
+ * OPT/OPTNOTOTAL types the sign is already baked into the data.
118
+ */
119
+ private translateAttributeSQL;
120
+ /** Emits a raw lit() argument as a SQL literal: numeric when parseable, quoted string otherwise. */
121
+ private sqlLiteral;
111
122
  /**
112
123
  * generates Tuple
113
124
  * [0] orderby string example: category asc
@@ -0,0 +1,22 @@
1
+ /** Aggregate functions supported in attribute expressions. */
2
+ export type TableAttributeFn = "set" | "first" | "last" | "min" | "max" | "avg" | "sum" | "lit";
3
+ /**
4
+ * A custom table column computed from dataset fields via an aggregate expression,
5
+ * e.g. `set(_leiter)` or `sum(ac1)` (see the `attributes` prop on bn-table).
6
+ *
7
+ * The {@link label} is the user-facing header text and never enters SQL; queries
8
+ * use the positional {@link alias} (`attr_0`, `attr_1`, ...) instead.
9
+ */
10
+ export declare class TableAttribute {
11
+ readonly label: string;
12
+ readonly alias: string;
13
+ readonly fn: TableAttributeFn;
14
+ readonly arg: string;
15
+ constructor(label: string, alias: string, fn: TableAttributeFn, arg: string);
16
+ /** Numeric aggregates are formatted like scenario cells (measure scale + decimals). */
17
+ get isNumeric(): boolean;
18
+ }
19
+ /** Checks a single attribute expression string like "set(_leiter)" or "lit(Fix)". */
20
+ export declare function isValidAttributeExpression(expression: string): boolean;
21
+ /** Parses an attribute expression into a {@link TableAttribute}; null when invalid. */
22
+ export declare function parseTableAttributeExpression(label: string, alias: string, expression: string): TableAttribute | null;
@@ -5,6 +5,7 @@ import { StringAdapter } from "../../../../utils/helper/StringAdapter";
5
5
  import { OrderAdapter } from "../../../../utils/model/Order";
6
6
  import { SiPrefix } from "../../../../utils/model/SiPrefix";
7
7
  import { TableType } from "./index";
8
+ import { TableAttribute } from "./TableAttribute";
8
9
  import { TableDrillGroup, TableDrillGroupAdapter } from "./TableDrillGroup";
9
10
  import { AlaSQLDatabase } from "../../../../context/scopedDb";
10
11
  /**
@@ -36,6 +37,8 @@ export declare class TableComponentConfig {
36
37
  categoryThereOf: Map<string, Record<string, unknown>[]>;
37
38
  /** Percentage-of-total sub-row definitions. */
38
39
  partOf: TableDrillGroup[];
40
+ /** Custom columns computed from dataset fields via aggregate expressions (see bn-table `attributes` prop). */
41
+ attributes: TableAttribute[];
39
42
  sortOrder: Order;
40
43
  /** Table aggregation mode: LIST (flat), SUM (with totals), OPT (with optional totals), etc. */
41
44
  type: TableType;
@@ -17,6 +17,7 @@ import { TimeChartStyle } from "./components/bn-chart-time/utils/model/styles/Ti
17
17
  import { DateDistance } from "./utils/DateStringFactory";
18
18
  import { StackConfigParsed as StackConfigParsed1 } from "./components/bn-chart-time/utils/model/TimeChartComponentConfig";
19
19
  import { TableDrillGroup } from "./components/bn-table/utils/model/TableDrillGroup";
20
+ import { TableAttribute } from "./components/bn-table/utils/model/TableAttribute";
20
21
  import { TableType } from "./components/bn-table/utils/model";
21
22
  import { MeasureEntry } from "./components/bn-title/ibcs-title/utils/model/MeasureEntriy";
22
23
  import { TimePeriod } from "./components/bn-title/ibcs-title/utils/model/TimePeriod";
@@ -32,6 +33,7 @@ export { TimeChartStyle } from "./components/bn-chart-time/utils/model/styles/Ti
32
33
  export { DateDistance } from "./utils/DateStringFactory";
33
34
  export { StackConfigParsed as StackConfigParsed1 } from "./components/bn-chart-time/utils/model/TimeChartComponentConfig";
34
35
  export { TableDrillGroup } from "./components/bn-table/utils/model/TableDrillGroup";
36
+ export { TableAttribute } from "./components/bn-table/utils/model/TableAttribute";
35
37
  export { TableType } from "./components/bn-table/utils/model";
36
38
  export { MeasureEntry } from "./components/bn-title/ibcs-title/utils/model/MeasureEntriy";
37
39
  export { TimePeriod } from "./components/bn-title/ibcs-title/utils/model/TimePeriod";
@@ -295,9 +297,10 @@ export namespace Components {
295
297
  * 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
296
298
  * 2. **Static JSON** — set `static="true"` to bypass SQL and write the
297
299
  * 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.
300
+ * 3. **URL** — place an `http://`/`https://` URL or a same-origin path
301
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint and
302
+ * write it to the `datasets` store. Set the `interval` prop (in seconds)
303
+ * to enable periodic re-fetching.
301
304
  */
302
305
  interface BnDataset {
303
306
  /**
@@ -330,8 +333,8 @@ export namespace Components {
330
333
  * Data can be provided in three ways:
331
334
  * 1. **Inline JSON** — Place JSON text inside the element body (default).
332
335
  * 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
333
- * 3. **URL** — Place an `http://` or `https://` URL in the body to fetch JSON
334
- * from a remote endpoint.
336
+ * 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
337
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint.
335
338
  * In URL mode the component fetches JSON from the URL. Set the `interval`
336
339
  * prop (in seconds) to enable periodic re-fetching (polling).
337
340
  * Other components (e.g. `bn-dataset`) reference the stored data by the
@@ -814,6 +817,11 @@ export namespace Components {
814
817
  * @default "false"
815
818
  */
816
819
  "showMeasureScale": string;
820
+ /**
821
+ * Stringified JSON object defining custom columns computed from dataset fields.<br /> Keys are column labels, values are aggregate expressions over the rows that make up each table row.<br /><br /> Functions: ```set // first // last // min // max // avg // sum // lit```<br /> Fields can be standard dataset fields (e.g. ```ac1```) or custom fields prefixed with ```_``` (e.g. ```_leiter```); ```lit``` takes a constant value.<br /><br /> example:<br /> ```{"Verkaufsleiter": "set(_leiter)", "Umsatz gesamt": "sum(ac1)"}```
822
+ * @default ""
823
+ */
824
+ "tableAttributes": string;
817
825
  /**
818
826
  * A not mundane tile which should describes the shown data.
819
827
  * @default ""
@@ -1174,6 +1182,10 @@ export namespace Components {
1174
1182
  * not be used directly; use `bn-table` instead.
1175
1183
  */
1176
1184
  interface IbcsTable {
1185
+ /**
1186
+ * @default []
1187
+ */
1188
+ "attributeColumns": TableAttribute[];
1177
1189
  /**
1178
1190
  * @default 30
1179
1191
  */
@@ -1387,9 +1399,10 @@ declare global {
1387
1399
  * 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
1388
1400
  * 2. **Static JSON** — set `static="true"` to bypass SQL and write the
1389
1401
  * 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.
1402
+ * 3. **URL** — place an `http://`/`https://` URL or a same-origin path
1403
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint and
1404
+ * write it to the `datasets` store. Set the `interval` prop (in seconds)
1405
+ * to enable periodic re-fetching.
1393
1406
  */
1394
1407
  interface HTMLBnDatasetElement extends Components.BnDataset, HTMLStencilElement {
1395
1408
  }
@@ -1402,8 +1415,8 @@ declare global {
1402
1415
  * Data can be provided in three ways:
1403
1416
  * 1. **Inline JSON** — Place JSON text inside the element body (default).
1404
1417
  * 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
1405
- * 3. **URL** — Place an `http://` or `https://` URL in the body to fetch JSON
1406
- * from a remote endpoint.
1418
+ * 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
1419
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint.
1407
1420
  * In URL mode the component fetches JSON from the URL. Set the `interval`
1408
1421
  * prop (in seconds) to enable periodic re-fetching (polling).
1409
1422
  * Other components (e.g. `bn-dataset`) reference the stored data by the
@@ -1878,9 +1891,10 @@ declare namespace LocalJSX {
1878
1891
  * 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
1879
1892
  * 2. **Static JSON** — set `static="true"` to bypass SQL and write the
1880
1893
  * 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.
1894
+ * 3. **URL** — place an `http://`/`https://` URL or a same-origin path
1895
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint and
1896
+ * write it to the `datasets` store. Set the `interval` prop (in seconds)
1897
+ * to enable periodic re-fetching.
1884
1898
  */
1885
1899
  interface BnDataset {
1886
1900
  /**
@@ -1913,8 +1927,8 @@ declare namespace LocalJSX {
1913
1927
  * Data can be provided in three ways:
1914
1928
  * 1. **Inline JSON** — Place JSON text inside the element body (default).
1915
1929
  * 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
1916
- * 3. **URL** — Place an `http://` or `https://` URL in the body to fetch JSON
1917
- * from a remote endpoint.
1930
+ * 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
1931
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint.
1918
1932
  * In URL mode the component fetches JSON from the URL. Set the `interval`
1919
1933
  * prop (in seconds) to enable periodic re-fetching (polling).
1920
1934
  * Other components (e.g. `bn-dataset`) reference the stored data by the
@@ -2395,6 +2409,11 @@ declare namespace LocalJSX {
2395
2409
  * @default "false"
2396
2410
  */
2397
2411
  "showMeasureScale"?: string;
2412
+ /**
2413
+ * Stringified JSON object defining custom columns computed from dataset fields.<br /> Keys are column labels, values are aggregate expressions over the rows that make up each table row.<br /><br /> Functions: ```set // first // last // min // max // avg // sum // lit```<br /> Fields can be standard dataset fields (e.g. ```ac1```) or custom fields prefixed with ```_``` (e.g. ```_leiter```); ```lit``` takes a constant value.<br /><br /> example:<br /> ```{"Verkaufsleiter": "set(_leiter)", "Umsatz gesamt": "sum(ac1)"}```
2414
+ * @default ""
2415
+ */
2416
+ "tableAttributes"?: string;
2398
2417
  /**
2399
2418
  * A not mundane tile which should describes the shown data.
2400
2419
  * @default ""
@@ -2752,6 +2771,10 @@ declare namespace LocalJSX {
2752
2771
  * not be used directly; use `bn-table` instead.
2753
2772
  */
2754
2773
  interface IbcsTable {
2774
+ /**
2775
+ * @default []
2776
+ */
2777
+ "attributeColumns"?: TableAttribute[];
2755
2778
  /**
2756
2779
  * @default 30
2757
2780
  */
@@ -3089,6 +3112,7 @@ declare namespace LocalJSX {
3089
3112
  "dataFormatDigitsPercent": number;
3090
3113
  "categoryWidth": string;
3091
3114
  "columnthereof": string | null;
3115
+ "tableAttributes": string;
3092
3116
  }
3093
3117
  interface BnTemplateAttributes {
3094
3118
  "templateId": string;
@@ -3249,9 +3273,10 @@ declare module "@stencil/core" {
3249
3273
  * 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
3250
3274
  * 2. **Static JSON** — set `static="true"` to bypass SQL and write the
3251
3275
  * 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.
3276
+ * 3. **URL** — place an `http://`/`https://` URL or a same-origin path
3277
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint and
3278
+ * write it to the `datasets` store. Set the `interval` prop (in seconds)
3279
+ * to enable periodic re-fetching.
3255
3280
  */
3256
3281
  "bn-dataset": LocalJSX.IntrinsicElements["bn-dataset"] & JSXBase.HTMLAttributes<HTMLBnDatasetElement>;
3257
3282
  /**
@@ -3259,8 +3284,8 @@ declare module "@stencil/core" {
3259
3284
  * Data can be provided in three ways:
3260
3285
  * 1. **Inline JSON** — Place JSON text inside the element body (default).
3261
3286
  * 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
3262
- * 3. **URL** — Place an `http://` or `https://` URL in the body to fetch JSON
3263
- * from a remote endpoint.
3287
+ * 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
3288
+ * starting with `/` in the body to fetch JSON from an HTTP endpoint.
3264
3289
  * In URL mode the component fetches JSON from the URL. Set the `interval`
3265
3290
  * prop (in seconds) to enable periodic re-fetching (polling).
3266
3291
  * Other components (e.g. `bn-dataset`) reference the stored data by the
@@ -34,6 +34,12 @@ export declare function isValidDataFormat(value: string): boolean;
34
34
  export declare function isValidBoolean(value: unknown): boolean;
35
35
  export declare function isValidTableType(value: string): boolean;
36
36
  export declare function validateThereOfJsonStr(value: string): string[];
37
+ /**
38
+ * Validates the bn-table `attributes` prop: a JSON object mapping column labels
39
+ * to aggregate expressions like `set(_leiter)` or `sum(ac1)`.
40
+ * Returns the offending `label: expression` entries; empty array means valid.
41
+ */
42
+ export declare function validateAttributesJsonStr(value: string): string[];
37
43
  export declare function validatePartOfJsonStr(value: string): string[];
38
44
  export declare function isValidi18nMode(value: string): boolean;
39
45
  export declare function isValidMeasureType(value: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bino-bi/bn-template-engine",
3
- "version": "1.0.0-alpha.13",
3
+ "version": "1.0.0-alpha.15",
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",