@bino-bi/bn-template-engine 1.0.0-alpha.7 → 1.0.0-alpha.9

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 (109) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-3141c4a2.entry.js +1 -0
  3. package/dist/bn-template-engine/p-67538176.entry.js +1 -0
  4. package/dist/bn-template-engine/p-916296a5.entry.js +1 -0
  5. package/dist/bn-template-engine/{p-1164c0b0.entry.js → p-96006b06.entry.js} +1 -1
  6. package/dist/bn-template-engine/p-B4JfKvVT.js +1 -0
  7. package/dist/bn-template-engine/{p-JNHhIe7t.js → p-B_d-jp99.js} +1 -1
  8. package/dist/bn-template-engine/p-Ck-NYtot.js +1 -0
  9. package/dist/bn-template-engine/p-CnDq0oVa.js +1 -0
  10. package/dist/bn-template-engine/p-DSXNgKLa.js +1 -0
  11. package/dist/bn-template-engine/p-bc711fb0.entry.js +1 -0
  12. package/dist/bn-template-engine/p-c86395b8.entry.js +1 -0
  13. package/dist/bn-template-engine/p-e6f646b1.entry.js +1 -0
  14. package/dist/bn-template-engine/p-f41d9242.entry.js +1 -0
  15. package/dist/bn-template-engine/{p-B0lsgVuN.js → p-gFbbuhtl.js} +1 -1
  16. package/dist/cjs/{SVGVariancesStyleGroup-BqAdPYtL.js → bn-asset_20.cjs.entry.js} +21955 -6939
  17. package/dist/cjs/bn-grid.cjs.entry.js +6 -9
  18. package/dist/cjs/bn-image.cjs.entry.js +6 -9
  19. package/dist/cjs/bn-internationalization.cjs.entry.js +5 -6
  20. package/dist/cjs/bn-template-engine.cjs.js +2 -2
  21. package/dist/cjs/bn-template.cjs.entry.js +3 -4
  22. package/dist/cjs/bn-text.cjs.entry.js +7 -10
  23. package/dist/cjs/bn-tree.cjs.entry.js +11 -10
  24. package/dist/cjs/{context-protocol-DRQWrwsA.js → context-protocol-ohYzcb5F.js} +1 -1
  25. package/dist/cjs/editor-companion.cjs.entry.js +2 -2
  26. package/dist/cjs/{index-Cjw0q6gP.js → index-CDKG4xmO.js} +1 -0
  27. package/dist/cjs/loader.cjs.js +2 -2
  28. package/dist/cjs/{scaling-BidPsO53.js → scaling-CIAClQR5.js} +3 -3
  29. package/dist/cjs/{withBodyObserver-C6gLgq_e.js → withBodyObserver-D7BKWN2N.js} +2 -2
  30. package/dist/cjs/{withHasError-B8gHkfV2.js → withHasError-Cl2gTQzA.js} +106 -2
  31. package/dist/cjs/{Order-BGx39pS5.js → withStyled-qd94SSb4.js} +648 -6
  32. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +24 -5
  33. package/dist/collection/components/bn-chart-time/bn-chart-time.js +24 -5
  34. package/dist/collection/components/bn-layout-card/bn-layout-card.js +12 -6
  35. package/dist/collection/components/bn-layout-page/bn-layout-page.js +12 -7
  36. package/dist/collection/components/bn-table/bn-table.js +25 -7
  37. package/dist/collection/components/bn-table/ibcs-table.js +68 -3
  38. package/dist/collection/components/bn-tree/bn-tree.js +5 -1
  39. package/dist/components/bn-chart-structure.js +1 -1
  40. package/dist/components/bn-chart-time.js +1 -1
  41. package/dist/components/bn-layout-card.js +1 -1
  42. package/dist/components/bn-layout-page.js +1 -1
  43. package/dist/components/bn-table.js +1 -1
  44. package/dist/components/bn-tree.js +1 -1
  45. package/dist/components/ibcs-table2.js +1 -1
  46. package/dist/esm/{SVGVariancesStyleGroup-DOIT-zvI.js → bn-asset_20.entry.js} +22055 -7043
  47. package/dist/esm/bn-grid.entry.js +4 -7
  48. package/dist/esm/bn-image.entry.js +4 -7
  49. package/dist/esm/bn-internationalization.entry.js +4 -5
  50. package/dist/esm/bn-template-engine.js +3 -3
  51. package/dist/esm/bn-template.entry.js +2 -3
  52. package/dist/esm/bn-text.entry.js +5 -8
  53. package/dist/esm/bn-tree.entry.js +9 -8
  54. package/dist/esm/{context-protocol-2peaD4y8.js → context-protocol-DdbSplvE.js} +2 -2
  55. package/dist/esm/editor-companion.entry.js +2 -2
  56. package/dist/esm/{index-JNHhIe7t.js → index-B_d-jp99.js} +1 -1
  57. package/dist/esm/loader.js +3 -3
  58. package/dist/esm/{scaling-BOcjT8M0.js → scaling-DGKKkuL9.js} +4 -4
  59. package/dist/esm/{withBodyObserver-DczL5ia8.js → withBodyObserver-AFk2wwHT.js} +2 -2
  60. package/dist/esm/{withHasError-B3QX2emi.js → withHasError-DW_vMDUp.js} +106 -2
  61. package/dist/esm/{Order-sRO-lj7X.js → withStyled-BIkqU2w4.js} +616 -1
  62. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +1 -0
  63. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +1 -0
  64. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +8 -2
  65. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +8 -3
  66. package/dist/types/components/bn-table/ibcs-table.d.ts +19 -0
  67. package/dist/types/components.d.ts +8 -8
  68. package/package.json +1 -1
  69. package/dist/bn-template-engine/p-0fabe296.entry.js +0 -1
  70. package/dist/bn-template-engine/p-355abdf0.entry.js +0 -1
  71. package/dist/bn-template-engine/p-79KuA4Ox.js +0 -1
  72. package/dist/bn-template-engine/p-859cc06d.entry.js +0 -1
  73. package/dist/bn-template-engine/p-8acec99e.entry.js +0 -1
  74. package/dist/bn-template-engine/p-8f490c45.entry.js +0 -1
  75. package/dist/bn-template-engine/p-9721a5bb.entry.js +0 -1
  76. package/dist/bn-template-engine/p-9a564f8f.entry.js +0 -1
  77. package/dist/bn-template-engine/p-9cee22fa.entry.js +0 -1
  78. package/dist/bn-template-engine/p-B7p8beYH.js +0 -1
  79. package/dist/bn-template-engine/p-BDh7GfC5.js +0 -1
  80. package/dist/bn-template-engine/p-BoMtoHJB.js +0 -1
  81. package/dist/bn-template-engine/p-Bs8BqBsb.js +0 -1
  82. package/dist/bn-template-engine/p-CYjZRKdI.js +0 -1
  83. package/dist/bn-template-engine/p-DG-1MR_T.js +0 -1
  84. package/dist/bn-template-engine/p-Dnkv5rt8.js +0 -1
  85. package/dist/bn-template-engine/p-bdd2b243.entry.js +0 -1
  86. package/dist/bn-template-engine/p-f27995c9.entry.js +0 -1
  87. package/dist/bn-template-engine/p-f6ecb265.entry.js +0 -1
  88. package/dist/bn-template-engine/p-sRO-lj7X.js +0 -1
  89. package/dist/bn-template-engine/p-tzFCK9qn.js +0 -1
  90. package/dist/cjs/bn-asset_16.cjs.entry.js +0 -9099
  91. package/dist/cjs/bn-card.cjs.entry.js +0 -36
  92. package/dist/cjs/bn-chart-time.cjs.entry.js +0 -1031
  93. package/dist/cjs/bn-layout-card.cjs.entry.js +0 -279
  94. package/dist/cjs/formatter-4XCS0d2B.js +0 -221
  95. package/dist/cjs/ibcs-chart-time.cjs.entry.js +0 -4137
  96. package/dist/cjs/withComponentStatus-_x4LQZ0N.js +0 -109
  97. package/dist/cjs/withComponentStyle-ClSJfCku.js +0 -128
  98. package/dist/cjs/withInheritedProps-BH2KNER3.js +0 -157
  99. package/dist/cjs/withStyled-9tG024gQ.js +0 -522
  100. package/dist/esm/bn-asset_16.entry.js +0 -9082
  101. package/dist/esm/bn-card.entry.js +0 -34
  102. package/dist/esm/bn-chart-time.entry.js +0 -1029
  103. package/dist/esm/bn-layout-card.entry.js +0 -277
  104. package/dist/esm/formatter-BDh7GfC5.js +0 -215
  105. package/dist/esm/ibcs-chart-time.entry.js +0 -4135
  106. package/dist/esm/withComponentStatus-DodoSXe-.js +0 -107
  107. package/dist/esm/withComponentStyle-D3VWOsto.js +0 -126
  108. package/dist/esm/withInheritedProps-BlXDxhHK.js +0 -154
  109. package/dist/esm/withStyled-CE3_3taP.js +0 -495
@@ -1,279 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Cjw0q6gP.js');
4
- var contextProtocol = require('./context-protocol-DRQWrwsA.js');
5
- var withHasError = require('./withHasError-B8gHkfV2.js');
6
- var withInheritedProps = require('./withInheritedProps-BH2KNER3.js');
7
-
8
- const bnLayoutCardCss = () => `:host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:block;flex-direction:column;overflow:hidden;float:left;clear:left}.cardtitle{display:inline-flex}.image{margin-right:0.5em;margin-top:0.5em;z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:inline}`;
9
-
10
- const LayoutCard = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- /**
14
- * URL or asset name of the image displayed next to the card title.
15
- * The value is resolved via the scoped assets store: if it matches a
16
- * registered asset name, the stored URL is used; otherwise the raw value
17
- * is treated as a URL. The deprecated `asset:` prefix is still supported
18
- * for backward compatibility.
19
- * <br /><br />
20
- * If empty, the title image is omitted.
21
- *
22
- * @example
23
- * <bn-layout-card title-image="company_logo"></bn-layout-card>
24
- */
25
- this.titleImage = "";
26
- /**
27
- * Name of the business unit displayed in the title header row.
28
- * If empty, the business unit row is omitted.
29
- *
30
- * @example
31
- * <bn-layout-card title-business-unit="Sales"></bn-layout-card>
32
- */
33
- this.titleBusinessUnit = "";
34
- /**
35
- * Primary column on which the order direction is applied.
36
- * <br /><br />
37
- * values:<br />
38
- * ```category // categoryindex // rowgroup // rowgroupindex // ac // fc // py // pl```
39
- */
40
- this.titleOrder = "category";
41
- /**
42
- * Sorting order direction for the column specified by `titleOrder`.
43
- * <br /><br />
44
- * values:<br />
45
- * ```asc // desc```
46
- */
47
- this.titleOrderDirection = "asc";
48
- /**
49
- * Date display format used in the title row.
50
- * <br /><br />
51
- * values:<br />
52
- * ```year // quarter // month // week // day // time // auto // none```
53
- * <br /><br />
54
- * `year`: YYYY, `quarter`: Q[Q] YYYY, `month`: MMM YYYY,
55
- * `week`: [KW]WW YYYY, `day`: DD.MM.YYYY, `time`: DD.MM.YYYY HH:mm:ss,
56
- * `auto`: automatic detection, `none`: DD.MM.YYYY.
57
- */
58
- this.titleDateFormat = "none";
59
- /**
60
- * Format in which the start and end dates are linked in the title.
61
- * If set to `none` a plain date is shown.
62
- * <br /><br />
63
- * values:<br />
64
- * ```avg // interval // cum // start // end // ytd // ytg // mat // none```
65
- * <br /><br />
66
- * `avg`: Ø[DATE], `interval`: [DATE]..[DATE2], `start`: .[DATE],
67
- * `end`: [DATE]., `ytd`: _[DATE], `ytg`: [DATE]_, `cum`: [DATE]_[DATE2],
68
- * `mat`: ~[DATE], `none`: [DATE].
69
- */
70
- this.titleDateLink = "none";
71
- /**
72
- * Namespace used for title translations via the internationalization store.
73
- */
74
- this.titleNamespace = "_system";
75
- /**
76
- * Text displayed in the card footer. If empty, the footer text is omitted.
77
- */
78
- this.footerText = "";
79
- /**
80
- * Layout mode that controls how child components are arranged inside
81
- * the card body using CSS Grid.
82
- * <br /><br />
83
- * values:<br />
84
- * ```full // split-vertical // split-horizontal // 2x2 // 3x3 // 4x4 // 1-over-2 // 1-over-3 // 2-over-1 // 3-over-1 // custom-template```
85
- * <br /><br />
86
- * `full`: single slot. `split-vertical`: two side-by-side slots.
87
- * `split-horizontal`: two stacked slots. `NxN`: equal grid.
88
- * `1-over-2`: one full-width slot on top, two below. `custom-template`:
89
- * uses the `cardCustomTemplate` CSS grid-template-areas string.
90
- *
91
- * @example
92
- * <bn-layout-card card-layout="split-horizontal"></bn-layout-card>
93
- */
94
- this.cardLayout = "full";
95
- /**
96
- * CSS `grid-template-areas` string used when `cardLayout` is set to
97
- * `custom-template`. Each quoted row defines a grid row; letters map to
98
- * slot indices in order of first appearance.
99
- *
100
- * @example
101
- * <bn-layout-card card-layout="custom-template"
102
- * card-custom-template='"a a" "b c"'></bn-layout-card>
103
- */
104
- this.cardCustomTemplate = '"a b" "c d"';
105
- /**
106
- * Gap between grid cells in pixels.
107
- */
108
- this.cardGridGap = "0";
109
- /**
110
- * When `true`, the card shrinks to fit its content (`fit-content`)
111
- * for both width and height. When `false`, the card stretches to
112
- * fill its parent (`100%`).
113
- */
114
- this.cardFitToContent = true;
115
- /**
116
- * Whether to display a visible border around the card.
117
- */
118
- this.cardShowBorder = true;
119
- this.templateMap = new Map([
120
- ["split-vertical", '"a b"'],
121
- ["split-horizontal", '"a" "b"'],
122
- ["2x2", '"a b" "c d"'],
123
- ["3x3", '"a b c" "d e f" "g h i"'],
124
- ["4x4", '"a b c d" "e f g h" "i j k l" "m n o p"'],
125
- ["1-over-2", '"a a" "b c"'],
126
- ["2-over-1", '"a b" "c c"'],
127
- ["1-over-3", '"a a a " "b c d"'],
128
- ["3-over-1", '"a b c" "d d d"'],
129
- ["custom-template", '"a b" "c c c"'],
130
- ["gold3", '"a c" "b c"'],
131
- ["gold4", '"a b c c" "d d c c"'],
132
- ]);
133
- this.errors = withHasError.withHasError(this);
134
- this.resolveInherited = withInheritedProps.withInheritedProps(this, [
135
- { propName: "titleScenarios", ancestorAttr: "title-scenarios" },
136
- { propName: "titleVariances", ancestorAttr: "title-variances" },
137
- { propName: "titleOrder", ancestorAttr: "title-order" },
138
- { propName: "titleOrderDirection", ancestorAttr: "title-order-direction" },
139
- ]);
140
- }
141
- connectedCallback() {
142
- this.stores = contextProtocol.getStores(this.element);
143
- // Reflect resolved inherited values to host attributes so child vis
144
- // components can read them during their own DOM traversal.
145
- this.reflectInheritedAttrs();
146
- }
147
- getCommonStyles() {
148
- let height = "100%";
149
- let width = "100%";
150
- if (this.cardFitToContent === true) {
151
- width = "fit-content";
152
- height = "fit-content";
153
- }
154
- return {
155
- display: "grid",
156
- height: height,
157
- width: width,
158
- gap: this.cardGridGap + "px",
159
- };
160
- }
161
- calculatePercentages(input) {
162
- const items = input.trim().split(/\s+/);
163
- const count = items.length;
164
- if (count === 0)
165
- return "100%";
166
- const percentage = (100 / count).toFixed(0) + "%";
167
- return Array(count).fill(percentage).join(" ");
168
- }
169
- getGridTemplateColumns(name) {
170
- const template = this.getTemplatePattern(name);
171
- const pattern = /"[\w\d\s.]+"/g;
172
- const matches = template.match(pattern);
173
- if (!matches || matches.length === 0)
174
- return "100%";
175
- return this.calculatePercentages(matches[0]);
176
- }
177
- getGridTemplateRows(name) {
178
- const template = this.getTemplatePattern(name);
179
- const pattern = /"[\w\d\s.]+"/g;
180
- const matches = template.match(pattern);
181
- const rowCount = matches ? matches.length : 1;
182
- if (this.cardFitToContent) {
183
- return Array(rowCount).fill("auto").join(" ");
184
- }
185
- return Array(rowCount).fill("1fr").join(" ");
186
- }
187
- getLayoutStyle() {
188
- return Object.assign(Object.assign({}, this.getCommonStyles()), { "grid-template-areas": this.getTemplatePattern(this.cardLayout), "grid-template-columns": this.getGridTemplateColumns(this.cardLayout), "grid-template-rows": this.getGridTemplateRows(this.cardLayout) });
189
- }
190
- createDivAreaStyles(elements) {
191
- return elements.map((x) => ({
192
- width: "100%",
193
- overflow: "hidden",
194
- "grid-area": x,
195
- height: "100%",
196
- }));
197
- }
198
- getSlots(slotNames) {
199
- const items = this.createDivAreaStyles(slotNames);
200
- return (index.h(index.Fragment, null, items.map((value, index$1) => {
201
- return (index.h("div", { style: value }, index.h("slot", { name: "card-slot-" + index$1 })));
202
- })));
203
- }
204
- extractSlotNames(styleElement) {
205
- if (styleElement == null) {
206
- return [];
207
- }
208
- const words = styleElement.match(/\b\w+\b/g);
209
- if (!words) {
210
- return [];
211
- }
212
- return Array.from(new Set(words));
213
- }
214
- getTemplatePattern(name) {
215
- if (this.templateMap.has(name) === false && name !== "custom-template") {
216
- return '"a"';
217
- }
218
- if (name === "custom-template") {
219
- return this.cardCustomTemplate;
220
- }
221
- return this.templateMap.get(name);
222
- }
223
- async getNumberOfSlot(name) {
224
- const template = this.getTemplatePattern(name);
225
- return this.extractSlotNames(template).length;
226
- }
227
- componentDidUpdate() {
228
- // workaround for the render rotation issue
229
- }
230
- setCardClass() {
231
- if (this.cardShowBorder === true) {
232
- return "card_box border";
233
- }
234
- return "card_box";
235
- }
236
- /**
237
- * When the card itself inherits a title prop from a page, write the
238
- * resolved value back to the host element's attribute so that child
239
- * vis components (bn-table, bn-chart-*) performing their own DOM walk
240
- * read the actual value instead of the literal "inherited-page" keyword.
241
- */
242
- reflectInheritedAttrs() {
243
- const mappings = [
244
- { prop: "titleScenarios", attr: "title-scenarios" },
245
- { prop: "titleVariances", attr: "title-variances" },
246
- { prop: "titleOrder", attr: "title-order" },
247
- { prop: "titleOrderDirection", attr: "title-order-direction" },
248
- ];
249
- for (const { prop, attr } of mappings) {
250
- const resolved = this.resolveInherited(prop, this[prop]);
251
- if (resolved !== undefined) {
252
- this.element.setAttribute(attr, resolved);
253
- }
254
- }
255
- }
256
- prepareTitleImage(value) {
257
- if (value == null || value === "") {
258
- return "";
259
- }
260
- const assetsState = this.stores.assets.state;
261
- // for backward compatibility deprecated "asset:" prefix
262
- if (value.startsWith("asset:")) {
263
- return assetsState[value.substring(6)];
264
- }
265
- return assetsState[value] || value;
266
- }
267
- render() {
268
- var _a, _b, _c, _d;
269
- const style = this.getLayoutStyle();
270
- const arrOfSlots = this.extractSlotNames(style["grid-template-areas"]);
271
- return (
272
- // @ts-ignore
273
- index.h("bn-card", { key: '1dfcca605e2780bdfbb0108a5f34ff1259ecd666', styles: this.styles, class: this.setCardClass() }, index.h("div", { key: '7bdf2d4d7ddc82af78fe932a2af866b3b17d8b4d', class: "cardtitle" }, index.h("bn-title", { key: '799fa36d7368bbc2bc446f01fa3a46c8e363dcd0', namespace: this.titleNamespace, "business-unit": this.titleBusinessUnit, scenarios: (_a = this.resolveInherited("titleScenarios", this.titleScenarios)) !== null && _a !== void 0 ? _a : this.titleScenarios, variances: (_b = this.resolveInherited("titleVariances", this.titleVariances)) !== null && _b !== void 0 ? _b : this.titleVariances, order: (_c = this.resolveInherited("titleOrder", this.titleOrder)) !== null && _c !== void 0 ? _c : this.titleOrder, "order-direction": (_d = this.resolveInherited("titleOrderDirection", this.titleOrderDirection)) !== null && _d !== void 0 ? _d : this.titleOrderDirection, measures: this.titleMeasures, "date-start": this.titleDateStart, "date-end": this.titleDateEnd, "date-format": this.titleDateFormat, "date-link": this.titleDateLink }), this.titleImage != null && this.titleImage !== "" ? (index.h("img", { class: "image", src: this.prepareTitleImage(this.titleImage) })) : ("")), index.h("bn-body", { key: '9743d34c350907dfe0561444cd548d5884224f3a' }, index.h("div", { key: 'a622ae652dfefaac4a86d1f71a05fe776a811430', style: style }, this.getSlots(arrOfSlots))), index.h("bn-footer", { key: 'ebffcd673c94d7666fe6b46216792784f3dfb988', text: this.footerText, "page-number": 0, "display-page-number": "false" })));
274
- }
275
- get element() { return index.getElement(this); }
276
- };
277
- LayoutCard.style = bnLayoutCardCss();
278
-
279
- exports.bn_layout_card = LayoutCard;
@@ -1,221 +0,0 @@
1
- 'use strict';
2
-
3
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
-
5
- function getDefaultExportFromCjs (x) {
6
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
- }
8
-
9
- /**
10
- * Parses an IBCS variance column name into its constituent parts.
11
- *
12
- * Naming convention: `d{base}_{delta}_{sentiment}` for absolute variance,
13
- * `dr{base}_{delta}_{sentiment}` for relative (%) variance.
14
- *
15
- * Example: `"dac1_pl1_pos"` → type="d", base="ac1" (minuend), delta="pl1" (subtrahend), direction="pos"
16
- */
17
- class VarianceScenario {
18
- constructor(scenario) {
19
- /** `"d"` for absolute variance, `"dr"` for relative (percentage) variance */
20
- this.type = "";
21
- /** Minuend scenario (the value subtracted from), e.g. `"ac1"` */
22
- this.base = "";
23
- /** Subtrahend scenario (the value subtracted), e.g. `"pl1"` */
24
- this.delta = "";
25
- /** Sentiment direction: `"pos"` (favorable), `"neg"` (unfavorable), `"neu"` (neutral) */
26
- this.direction = "";
27
- this.isValid = false;
28
- /** Capture groups: [1]=type (d|dr), [2]=base scenario, [3]=delta scenario, [4]=sentiment */
29
- const scenarioTestRegex = /(d|dr)(pl\d|ac\d|fc\d|pp\d)_(pl\d|ac\d|fc\d|pp\d)_(pos|neg|neu)/;
30
- if (scenarioTestRegex.test(scenario)) {
31
- const tokens = scenarioTestRegex.exec(scenario);
32
- if (tokens != null) {
33
- this.type = String(tokens[1]);
34
- this.base = String(tokens[2]);
35
- this.delta = String(tokens[3]);
36
- this.direction = String(tokens[4]);
37
- this.isValid = true;
38
- }
39
- }
40
- }
41
- }
42
-
43
- exports.QueryColumnNames = void 0;
44
- (function (QueryColumnNames) {
45
- QueryColumnNames["OPERATION"] = "operation";
46
- QueryColumnNames["ROWGROUP"] = "rowGroup";
47
- QueryColumnNames["ROWGROUPINDEX"] = "rowGroupIndex";
48
- QueryColumnNames["CURRENTROW"] = "currentRow";
49
- QueryColumnNames["CATEGORY"] = "category";
50
- QueryColumnNames["CATEGORYINDEX"] = "categoryIndex";
51
- QueryColumnNames["SUBCATEGORY"] = "subCategory";
52
- QueryColumnNames["SUBCATEGORYINDEX"] = "subCategoryIndex";
53
- QueryColumnNames["COLUMNGROUP"] = "columnGroup";
54
- QueryColumnNames["COLUMNGROUPINDEX"] = "columnIndex";
55
- QueryColumnNames["COLUMNSUBGROUP"] = "columnSubGroup";
56
- QueryColumnNames["COLUMNSUBGROUPINDEX"] = "columnSubGroupIndex";
57
- QueryColumnNames["AC1"] = "ac1";
58
- QueryColumnNames["AC2"] = "ac2";
59
- QueryColumnNames["AC3"] = "ac3";
60
- QueryColumnNames["AC4"] = "ac4";
61
- QueryColumnNames["PP1"] = "pp1";
62
- QueryColumnNames["PP2"] = "pp2";
63
- QueryColumnNames["PP3"] = "pp3";
64
- QueryColumnNames["PP4"] = "pp4";
65
- QueryColumnNames["FC1"] = "fc1";
66
- QueryColumnNames["FC2"] = "fc2";
67
- QueryColumnNames["FC3"] = "fc3";
68
- QueryColumnNames["FC4"] = "fc4";
69
- QueryColumnNames["PL1"] = "pl1";
70
- QueryColumnNames["PL2"] = "pl2";
71
- QueryColumnNames["PL3"] = "pl3";
72
- QueryColumnNames["PL4"] = "pl4";
73
- QueryColumnNames["TOTALROWCOUNT"] = "totalRowCnt";
74
- QueryColumnNames["ROWNR"] = "rowNr";
75
- QueryColumnNames["TYPE"] = "type";
76
- })(exports.QueryColumnNames || (exports.QueryColumnNames = {}));
77
-
78
- var lib = {};
79
-
80
- var hasRequiredLib;
81
-
82
- function requireLib () {
83
- if (hasRequiredLib) return lib;
84
- hasRequiredLib = 1;
85
- function createDummyElement(text, options) {
86
- var element = document.createElement('div');
87
- var textNode = document.createTextNode(text);
88
- element.appendChild(textNode);
89
- element.style.fontFamily = options.font;
90
- element.style.fontSize = options.fontSize;
91
- element.style.fontWeight = options.fontWeight;
92
- element.style.position = 'absolute';
93
- element.style.visibility = 'hidden';
94
- element.style.left = '-999px';
95
- element.style.top = '-999px';
96
- element.style.width = options.width;
97
- element.style.height = 'auto';
98
- document.body.appendChild(element);
99
- return element;
100
- }
101
- function destroyElement(element) {
102
- element.parentNode.removeChild(element);
103
- }
104
- var cache = {};
105
- Object.defineProperty(lib, "__esModule", { value: true });
106
- lib.default = function (text, options) {
107
- if (options === void 0) { options = {}; }
108
- var cacheKey = JSON.stringify({ text: text, options: options });
109
- if (cache[cacheKey]) {
110
- return cache[cacheKey];
111
- }
112
- options.font = options.font || 'Times';
113
- options.fontSize = options.fontSize || '16px';
114
- options.fontWeight = options.fontWeight || 'normal';
115
- options.width = options.width || 'auto';
116
- var element = createDummyElement(text, options);
117
- var size = {
118
- width: element.offsetWidth,
119
- height: element.offsetHeight,
120
- };
121
- destroyElement(element);
122
- cache[cacheKey] = size;
123
- return size;
124
- };
125
-
126
- return lib;
127
- }
128
-
129
- var libExports = requireLib();
130
- var CalculateSize = /*@__PURE__*/getDefaultExportFromCjs(libExports);
131
-
132
- /**
133
- * Number and label formatting utilities following ISO 80000-1 conventions.
134
- */
135
- class Formatter {
136
- /**
137
- * Formats a number for display following ISO 80000-1 conventions.
138
- *
139
- * Pipeline: divide by scale factor -> format via de-DE locale -> strip whitespace
140
- * before `%` -> replace group separator with `postfixSeperator` -> replace decimal
141
- * separator with `tsdDelimiter`.
142
- *
143
- * @param scale Divisor applied before formatting (e.g. 1000 for "k" SI prefix).
144
- */
145
- static number(value, type = "decimal", digits = 1, digitsMin = 0, scale = 1) {
146
- const scaledValue = value / scale;
147
- return scaledValue
148
- .toLocaleString("de-DE", {
149
- style: type,
150
- useGrouping: true,
151
- maximumFractionDigits: digits,
152
- minimumFractionDigits: digitsMin,
153
- })
154
- .replace(/\s+(%)/g, "$1")
155
- .replace(/\s/g, this.postfixSeperator)
156
- .replace(/\./g, this.tsdDelimiter);
157
- }
158
- /**
159
- * Translates a technical scenario identifier into a human-readable IBCS label.
160
- *
161
- * Uses IBCS symbol conventions from the i18n map:
162
- * - AC-base absolute variance: `ibcssymbol_delta_ac` -- renders as e.g. `Delta{scenarioName}`
163
- * - AC-base relative variance: `ibcssymbol_delta_ac_relative` -- renders as e.g. `Delta(scenarioName)`
164
- * - Non-AC absolute variance: `ibcssymbol_delta_generic`
165
- * - Non-AC relative variance: `ibcssymbol_delta_generic_relative`
166
- *
167
- * The `{%}` placeholder in the i18n token is replaced with the translated scenario name(s).
168
- * Non-variance scenarios are looked up directly in the i18n map.
169
- */
170
- static translateScenarioLabel(scenario, i18n) {
171
- if (scenario === null || scenario === undefined) {
172
- return "";
173
- }
174
- const scenarios = new VarianceScenario(scenario);
175
- if (!scenarios.isValid) {
176
- return `${i18n.get(scenario) || scenario}`;
177
- }
178
- let token;
179
- let scenarioLabel;
180
- if (exports.QueryColumnNames.AC1 === scenarios.base) {
181
- if (scenarios.type === "dr") {
182
- token = i18n.get("ibcssymbol_delta_ac" + "_relative");
183
- }
184
- else {
185
- token = i18n.get("ibcssymbol_delta_ac" + "");
186
- }
187
- scenarioLabel = i18n.get(scenarios.delta) || scenarios.delta;
188
- }
189
- else {
190
- if (scenarios.type === "dr") {
191
- token = i18n.get("ibcssymbol_delta_generic" + "_relative");
192
- }
193
- else {
194
- token = i18n.get("ibcssymbol_delta_generic" + "");
195
- }
196
- scenarioLabel = `${i18n.get(scenarios.base) || scenarios.base} - ${i18n.get(scenarios.delta) || scenarios.delta}`;
197
- }
198
- if (token === undefined) {
199
- token = "{%}";
200
- }
201
- return `${token.replace("{%}", scenarioLabel)}`;
202
- }
203
- static getMaxWidthOfArrayItems(scenarios, i18n, style) {
204
- return CalculateSize(scenarios
205
- .map((scenario) => Formatter.translateScenarioLabel(scenario, i18n))
206
- .reduce((a, b) => (a.length < b.length ? b : a), ""), {
207
- font: style.fontStyles.font,
208
- fontSize: style.fontStyles.size + "px",
209
- }).width;
210
- }
211
- }
212
- /** Replacement character for the thousands group separator (default de-DE uses period). */
213
- Formatter.tsdDelimiter = ".";
214
- /** Replacement character for the decimal separator (default de-DE uses comma). */
215
- Formatter.postfixSeperator = ",";
216
-
217
- exports.CalculateSize = CalculateSize;
218
- exports.Formatter = Formatter;
219
- exports.VarianceScenario = VarianceScenario;
220
- exports.commonjsGlobal = commonjsGlobal;
221
- exports.getDefaultExportFromCjs = getDefaultExportFromCjs;