@bino-bi/bn-template-engine 1.0.0-alpha.4 → 1.0.0-alpha.6

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 (166) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-06946f44.entry.js +1 -0
  3. package/dist/bn-template-engine/p-0fabe296.entry.js +1 -0
  4. package/dist/bn-template-engine/p-1164c0b0.entry.js +1 -0
  5. package/dist/bn-template-engine/p-355abdf0.entry.js +1 -0
  6. package/dist/bn-template-engine/p-79KuA4Ox.js +1 -0
  7. package/dist/bn-template-engine/p-859cc06d.entry.js +1 -0
  8. package/dist/bn-template-engine/p-8acec99e.entry.js +1 -0
  9. package/dist/bn-template-engine/p-8f490c45.entry.js +1 -0
  10. package/dist/bn-template-engine/p-98cf512f.entry.js +1 -0
  11. package/dist/bn-template-engine/p-9a564f8f.entry.js +1 -0
  12. package/dist/bn-template-engine/{p-CL1RYuNU.js → p-B0lsgVuN.js} +1 -1
  13. package/dist/bn-template-engine/p-B7p8beYH.js +1 -0
  14. package/dist/bn-template-engine/p-BDh7GfC5.js +1 -0
  15. package/dist/bn-template-engine/p-BoMtoHJB.js +1 -0
  16. package/dist/bn-template-engine/p-Bs8BqBsb.js +1 -0
  17. package/dist/bn-template-engine/p-CYjZRKdI.js +1 -0
  18. package/dist/bn-template-engine/{p-P7pGJBgc.js → p-DG-1MR_T.js} +1 -1
  19. package/dist/bn-template-engine/p-bdd2b243.entry.js +1 -0
  20. package/dist/bn-template-engine/p-e6b24f15.entry.js +1 -0
  21. package/dist/bn-template-engine/p-f27995c9.entry.js +1 -0
  22. package/dist/bn-template-engine/{p-Bnhh02CF.js → p-sRO-lj7X.js} +1 -1
  23. package/dist/bn-template-engine/p-tzFCK9qn.js +1 -0
  24. package/dist/cjs/{Order-iG11HI4R.js → Order-BGx39pS5.js} +448 -0
  25. package/dist/cjs/{alasql.min-C_nHTuEQ.js → SVGVariancesStyleGroup-BqAdPYtL.js} +8228 -3
  26. package/dist/cjs/bn-asset_16.cjs.entry.js +9018 -0
  27. package/dist/cjs/bn-card.cjs.entry.js +3 -4
  28. package/dist/cjs/bn-chart-time.cjs.entry.js +11 -16
  29. package/dist/cjs/bn-grid.cjs.entry.js +5 -8
  30. package/dist/cjs/bn-image.cjs.entry.js +5 -8
  31. package/dist/cjs/bn-internationalization.cjs.entry.js +3 -4
  32. package/dist/cjs/bn-layout-card.cjs.entry.js +125 -6
  33. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  34. package/dist/cjs/bn-template.cjs.entry.js +2 -3
  35. package/dist/cjs/bn-text.cjs.entry.js +7 -11
  36. package/dist/cjs/bn-tree.cjs.entry.js +5 -8
  37. package/dist/cjs/{formatter-DIJL_crx.js → formatter-4XCS0d2B.js} +8 -2
  38. package/dist/cjs/ibcs-chart-time.cjs.entry.js +37 -42
  39. package/dist/cjs/loader.cjs.js +1 -1
  40. package/dist/cjs/{scaling-9Tz595RQ.js → scaling-BidPsO53.js} +115 -12
  41. package/dist/cjs/{withBodyObserver-CKpSD8UT.js → withBodyObserver-C6gLgq_e.js} +3 -3
  42. package/dist/cjs/{withComponentStatus-Bw70BhO0.js → withComponentStatus-_x4LQZ0N.js} +5 -5
  43. package/dist/cjs/{withComponentStyle-aIbTCtfj.js → withComponentStyle-ClSJfCku.js} +4 -4
  44. package/dist/cjs/{utils-CwHIVbbL.js → withHasError-B8gHkfV2.js} +69 -1
  45. package/dist/cjs/{withStyled-CS1Yp4sv.js → withStyled-9tG024gQ.js} +62 -9
  46. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +11 -0
  47. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +5 -2
  48. package/dist/collection/components/bn-layout-card/bn-layout-card.css +1 -0
  49. package/dist/collection/components/bn-layout-card/bn-layout-card.js +162 -27
  50. package/dist/collection/components/bn-layout-page/bn-layout-page.css +1 -0
  51. package/dist/collection/components/bn-layout-page/bn-layout-page.js +151 -33
  52. package/dist/collection/components/bn-table/bn-table.js +12 -10
  53. package/dist/collection/components/bn-table/ibcs-table.js +2 -2
  54. package/dist/collection/utils/parentDimensions.js +38 -6
  55. package/dist/components/bn-layout-card.js +1 -1
  56. package/dist/components/bn-layout-page.js +1 -1
  57. package/dist/components/bn-table.js +1 -1
  58. package/dist/components/ibcs-chart-structure2.js +1 -1
  59. package/dist/components/ibcs-table2.js +1 -1
  60. package/dist/components/scaling.js +1 -1
  61. package/dist/esm/{Order-Bnhh02CF.js → Order-sRO-lj7X.js} +448 -1
  62. package/dist/esm/{alasql.min-CWu4NkIt.js → SVGVariancesStyleGroup-DOIT-zvI.js} +8212 -2
  63. package/dist/esm/bn-asset_16.entry.js +9001 -0
  64. package/dist/esm/bn-card.entry.js +4 -5
  65. package/dist/esm/bn-chart-time.entry.js +8 -13
  66. package/dist/esm/bn-grid.entry.js +6 -9
  67. package/dist/esm/bn-image.entry.js +6 -9
  68. package/dist/esm/bn-internationalization.entry.js +4 -5
  69. package/dist/esm/bn-layout-card.entry.js +126 -7
  70. package/dist/esm/bn-template-engine.js +1 -1
  71. package/dist/esm/bn-template.entry.js +2 -3
  72. package/dist/esm/bn-text.entry.js +7 -11
  73. package/dist/esm/bn-tree.entry.js +6 -9
  74. package/dist/esm/{context-protocol-BHnQsVsr.js → context-protocol-2peaD4y8.js} +1 -1
  75. package/dist/esm/editor-companion.entry.js +1 -1
  76. package/dist/esm/{formatter-DTMEZ6d8.js → formatter-BDh7GfC5.js} +6 -2
  77. package/dist/esm/ibcs-chart-time.entry.js +3 -8
  78. package/dist/esm/loader.js +1 -1
  79. package/dist/esm/{scaling-Cehc74IE.js → scaling-BOcjT8M0.js} +112 -10
  80. package/dist/esm/{withBodyObserver-FQ8NwCIz.js → withBodyObserver-DczL5ia8.js} +1 -1
  81. package/dist/esm/{withComponentStatus-DWjDYtZ7.js → withComponentStatus-DodoSXe-.js} +1 -1
  82. package/dist/esm/{withComponentStyle-9uP_hcDq.js → withComponentStyle-D3VWOsto.js} +2 -2
  83. package/dist/esm/{utils-DvvwfRQG.js → withHasError-B3QX2emi.js} +69 -1
  84. package/dist/esm/{withStyled--qQWquTH.js → withStyled-CE3_3taP.js} +57 -5
  85. package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +2 -0
  86. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +139 -0
  87. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +154 -0
  88. package/dist/types/components/bn-table/bn-table.d.ts +7 -5
  89. package/dist/types/components.d.ts +170 -2
  90. package/dist/types/utils/parentDimensions.d.ts +6 -1
  91. package/package.json +1 -1
  92. package/dist/bn-template-engine/p-1265d8d3.entry.js +0 -1
  93. package/dist/bn-template-engine/p-15516dac.entry.js +0 -1
  94. package/dist/bn-template-engine/p-1c716641.entry.js +0 -1
  95. package/dist/bn-template-engine/p-1jFf17Vj.js +0 -1
  96. package/dist/bn-template-engine/p-27cc8dc0.entry.js +0 -1
  97. package/dist/bn-template-engine/p-4426d484.entry.js +0 -1
  98. package/dist/bn-template-engine/p-51f8dc9e.entry.js +0 -1
  99. package/dist/bn-template-engine/p-53d4e690.entry.js +0 -1
  100. package/dist/bn-template-engine/p-5KQYRQLK.js +0 -1
  101. package/dist/bn-template-engine/p-745f4596.entry.js +0 -1
  102. package/dist/bn-template-engine/p-75e97c87.entry.js +0 -1
  103. package/dist/bn-template-engine/p-7a560278.entry.js +0 -1
  104. package/dist/bn-template-engine/p-7ea7c325.entry.js +0 -1
  105. package/dist/bn-template-engine/p-945cc95d.entry.js +0 -1
  106. package/dist/bn-template-engine/p-BFTU3MAI.js +0 -1
  107. package/dist/bn-template-engine/p-BYBpC0EO.js +0 -1
  108. package/dist/bn-template-engine/p-BYmPQYxx.js +0 -1
  109. package/dist/bn-template-engine/p-BfXY5dsy.js +0 -1
  110. package/dist/bn-template-engine/p-BgnHJQ9Q.js +0 -1
  111. package/dist/bn-template-engine/p-Bhd_WSML.js +0 -1
  112. package/dist/bn-template-engine/p-Bka-Z6jo.js +0 -1
  113. package/dist/bn-template-engine/p-C7dQL8CS.js +0 -1
  114. package/dist/bn-template-engine/p-CYwd_ZNM.js +0 -1
  115. package/dist/bn-template-engine/p-ChlK-T9I.js +0 -1
  116. package/dist/bn-template-engine/p-DHezf8pZ.js +0 -1
  117. package/dist/bn-template-engine/p-DlppAFq9.js +0 -1
  118. package/dist/bn-template-engine/p-DvDDgmcV.js +0 -1
  119. package/dist/bn-template-engine/p-DvvwfRQG.js +0 -1
  120. package/dist/bn-template-engine/p-b34eaf86.entry.js +0 -1
  121. package/dist/bn-template-engine/p-bdb8b44c.entry.js +0 -1
  122. package/dist/bn-template-engine/p-c44fcb8e.entry.js +0 -1
  123. package/dist/bn-template-engine/p-c7e1a49b.entry.js +0 -1
  124. package/dist/bn-template-engine/p-d9003041.entry.js +0 -1
  125. package/dist/bn-template-engine/p-daa7ffa3.entry.js +0 -1
  126. package/dist/bn-template-engine/p-e084f50a.entry.js +0 -1
  127. package/dist/bn-template-engine/p-eaba6658.entry.js +0 -1
  128. package/dist/bn-template-engine/p-u8igQLRZ.js +0 -1
  129. package/dist/cjs/DataFormatDigits-DKcOeLNK.js +0 -142
  130. package/dist/cjs/DateStringFactory-CSKvbS8K.js +0 -452
  131. package/dist/cjs/SVGVariancesStyleGroup-K-Tw6lOD.js +0 -7960
  132. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +0 -10
  133. package/dist/cjs/bn-asset.cjs.entry.js +0 -42
  134. package/dist/cjs/bn-body_4.cjs.entry.js +0 -748
  135. package/dist/cjs/bn-chart-structure_5.cjs.entry.js +0 -3934
  136. package/dist/cjs/bn-component-style.cjs.entry.js +0 -44
  137. package/dist/cjs/bn-dataset.cjs.entry.js +0 -306
  138. package/dist/cjs/bn-layout-page.cjs.entry.js +0 -143
  139. package/dist/cjs/bn-message.cjs.entry.js +0 -52
  140. package/dist/cjs/bn-table.cjs.entry.js +0 -979
  141. package/dist/cjs/contentDecoder-JxOldq1e.js +0 -419
  142. package/dist/cjs/emotion-hash.esm-nbbEQ0Dn.js +0 -57
  143. package/dist/cjs/ibcs-table.cjs.entry.js +0 -2276
  144. package/dist/cjs/ibcsRuleSet-DgUoXOfd.js +0 -136
  145. package/dist/cjs/index-Dm85hG6t.js +0 -65
  146. package/dist/cjs/withHasError-D7ue5vAv.js +0 -72
  147. package/dist/cjs/withTranslation-rwgyITqe.js +0 -77
  148. package/dist/esm/DataFormatDigits-oSZ1hBKE.js +0 -137
  149. package/dist/esm/DateStringFactory-CSGz6TDk.js +0 -450
  150. package/dist/esm/SVGVariancesStyleGroup-CqTjrZYg.js +0 -7950
  151. package/dist/esm/_commonjsHelpers-BFTU3MAI.js +0 -7
  152. package/dist/esm/bn-asset.entry.js +0 -40
  153. package/dist/esm/bn-body_4.entry.js +0 -743
  154. package/dist/esm/bn-chart-structure_5.entry.js +0 -3928
  155. package/dist/esm/bn-component-style.entry.js +0 -42
  156. package/dist/esm/bn-dataset.entry.js +0 -304
  157. package/dist/esm/bn-layout-page.entry.js +0 -141
  158. package/dist/esm/bn-message.entry.js +0 -50
  159. package/dist/esm/bn-table.entry.js +0 -977
  160. package/dist/esm/contentDecoder-oMmxz6nJ.js +0 -416
  161. package/dist/esm/emotion-hash.esm-BYBpC0EO.js +0 -55
  162. package/dist/esm/ibcs-table.entry.js +0 -2274
  163. package/dist/esm/ibcsRuleSet-K4ytuA1f.js +0 -133
  164. package/dist/esm/index-DHezf8pZ.js +0 -65
  165. package/dist/esm/withHasError-FyY5mQ_3.js +0 -70
  166. package/dist/esm/withTranslation-BqD0Kp7b.js +0 -75
@@ -1,748 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Cjw0q6gP.js');
4
- var withComponentStatus = require('./withComponentStatus-Bw70BhO0.js');
5
- var withComponentStyle = require('./withComponentStyle-aIbTCtfj.js');
6
- var withHasError = require('./withHasError-D7ue5vAv.js');
7
- var withStyled = require('./withStyled-CS1Yp4sv.js');
8
- var Order = require('./Order-iG11HI4R.js');
9
- var withTranslation = require('./withTranslation-rwgyITqe.js');
10
- var contextProtocol = require('./context-protocol-DRQWrwsA.js');
11
- var DateStringFactory = require('./DateStringFactory-CSKvbS8K.js');
12
- var formatter = require('./formatter-DIJL_crx.js');
13
- var ibcsRuleSet = require('./ibcsRuleSet-DgUoXOfd.js');
14
- require('./utils-CwHIVbbL.js');
15
- require('./emotion-hash.esm-nbbEQ0Dn.js');
16
- require('./_commonjsHelpers-BJu3ubxk.js');
17
-
18
- const bnBodyCss = () => `:host{flex:1;position:relative;overflow:hidden;display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}`;
19
-
20
- const Body = class {
21
- constructor(hostRef) {
22
- index.registerInstance(this, hostRef);
23
- withComponentStatus.withComponentStatus(this);
24
- this.errors = withHasError.withHasError(this);
25
- this.componentStyle = withComponentStyle.withComponentStyle(this);
26
- }
27
- getFontStyles() {
28
- return this.componentStyle(($) => {
29
- var _a, _b, _c, _d;
30
- return ({
31
- "--bn-font-family": ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontFamily"]) || "'Noto Sans', sans-serif",
32
- "--bn-font-size": `${((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontSizePx"]) || 13.3333}px`,
33
- "--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
34
- "--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
35
- });
36
- });
37
- }
38
- render() {
39
- return (index.h(index.Host, { key: 'f43978af1c6658c6fa165093c3ada6b5f3b5986d', style: this.getFontStyles() }, index.h("slot", { key: 'b9c97432089676fc373b1d5ee59573ef5681a5c5' })));
40
- }
41
- get element() { return index.getElement(this); }
42
- };
43
- Body.style = bnBodyCss();
44
-
45
- const bnFooterCss = () => `:host{padding:0.2em 0.5em;display:flex;flex-direction:row;justify-content:space-between;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}:host(#container-page-footer){box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em solid #ddd}div#footer-text{font-size:0.6em;display:inline}div#code{flex:1;display:inline;text-align:right;padding-right:1em}div#page-number{font-size:0.6em;display:inline}.image{z-index:2;background-color:transparent;border:transparent;height:1.2em;width:auto}`;
46
-
47
- const Footer = class {
48
- constructor(hostRef) {
49
- index.registerInstance(this, hostRef);
50
- /**
51
- * Pagenumber value.
52
- * Is displayed if displayPageNumber == true
53
- */
54
- this.pageNumber = null;
55
- /**
56
- * Toggle if pagenumer label is displayed
57
- */
58
- this.displayPageNumber = true;
59
- withComponentStatus.withComponentStatus(this);
60
- this.errors = withHasError.withHasError(this);
61
- this.componentStyle = withComponentStyle.withComponentStyle(this);
62
- }
63
- getFontStyles() {
64
- return this.componentStyle(($) => {
65
- var _a, _b, _c, _d;
66
- return ({
67
- "--bn-font-family": ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontFamily"]) || "'Noto Sans', sans-serif",
68
- "--bn-font-size": `${((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontSizePx"]) || 13.3333}px`,
69
- "--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
70
- "--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
71
- });
72
- });
73
- }
74
- isValidHttpUrl(string) {
75
- let url;
76
- try {
77
- url = new URL(string);
78
- }
79
- catch (_) {
80
- return false;
81
- }
82
- return url.protocol === "http:" || url.protocol === "https:";
83
- }
84
- prepareAssetUrl(imgUrl) {
85
- if (this.isValidHttpUrl(imgUrl)) {
86
- return imgUrl;
87
- }
88
- return `./assets/${imgUrl}.png`;
89
- }
90
- render() {
91
- return (index.h(index.Host, { key: 'c445ca8c8abde56b46564932a6fcd079aa1e640d', id: this.displayPageNumber || this.text || this.code ? "container-page-footer" : "container", style: this.getFontStyles() }, index.h("div", { key: '2e5829597d228c78acbbbf130bfc440092456cb4', id: "footer-text" }, this.text != null ? index.h("span", { class: "note" }, this.text) : ""), index.h("div", { key: 'a2c98bf85fc41fa0aebc35fded0528cd8ba4948f', id: "code" }, this.code != null ? index.h("img", { class: "image", src: index.getAssetPath(`${this.prepareAssetUrl(this.code)}`) }) : ""), index.h("div", { key: 'e879c6ed16996d8b505d64426e2253f3057863f5', id: "page-number" }, this.displayPageNumber ? index.h("span", { class: "page" }, this.pageNumber) : "")));
92
- }
93
- static get assetsDirs() { return ["assets"]; }
94
- get element() { return index.getElement(this); }
95
- };
96
- Footer.style = bnFooterCss();
97
-
98
- const bnTitleCss = () => `:host{padding:0.5em;margin-bottom:0.5em;box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}`;
99
-
100
- const Title$1 = class Title {
101
- constructor(hostRef) {
102
- index.registerInstance(this, hostRef);
103
- /** Name of the business unit displayed in card header. If empty string (`''` or `null`) the business unit row is omitted */
104
- this.businessUnit = "";
105
- /** List of the primary scenarios on which the order direction are applied.
106
- * <br /><br />
107
- * If order is set to a scenario it has also exists in scenariolist.<br />
108
- * If order is empty string (`''` or `null`) the order arrow is omitted
109
- * <br /><br />
110
- * values:<br /> ``` category // categoryindex // rowgroup // rowgroup // rowgroupindex // ac // fc // py // pl // null ```
111
- */
112
- this.order = "category";
113
- /** Sets sorting order directon
114
- * <br /><br />
115
- * values:<br /> ``` asc // desc ```
116
- */
117
- this.orderDirection = "asc";
118
- /** Date format
119
- * <br /><br />
120
- * values:<br /> ``` year // quarter // month // week // day // hour // auto // none ```
121
- * <br /><br />
122
- *
123
- * detail:<br />
124
- * ```year: "YYYY"```<br />
125
- * ```quarter: "Q[Q] YYYY"```<br />
126
- * ```month: "MMM YYYY"```<br />
127
- * ```week: "[KW]WW YYYY"```<br />
128
- * ```day: "DD.MM.YYYY"```<br />
129
- * ```time: "DD.MM.YYYY HH:mm:ss"```<br />
130
- * ```none: "DD.MM.YYYY"```<br />
131
- *
132
- */
133
- this.dateFormat = "none";
134
- /** Format in which the start and end date are linked.
135
- * <br /><br />
136
- * If empty string (`''` or `null`) the date row is omitted
137
- * <br /><br />
138
- * values:<br /> ``` avg // interval // cum // start // end // ytd // ytg // cum // mat // none // null```
139
- * <br /><br />
140
- *
141
- * detail:<br />
142
- * ```avg: "Ø[DATE]"```<br />
143
- * ```interval: "[DATE]..[DATE2]"```<br />
144
- * ```start: ".[DATE]"```<br />
145
- * ```end: "[DATE]."```<br />
146
- * ```ytd: "_[DATE]"```<br />
147
- * ```ytg: "[DATE]_"```<br />
148
- * ```cum: "[DATE]_[DATE2]"```<br />
149
- * ```mat: "~[DATE]"```<br />
150
- * ```none: "[DATE]"```<br />
151
- *
152
- */
153
- this.dateLink = "none";
154
- withStyled.withStyled(this);
155
- withComponentStatus.withComponentStatus(this);
156
- this.t = withTranslation.withTranslation(this).t;
157
- this.errors = withHasError.withHasError(this);
158
- this.componentStyle = withComponentStyle.withComponentStyle(this);
159
- }
160
- validateScenario(newValue) {
161
- const errId = "ERR_scenarios";
162
- const invalidScenarios = withStyled.validateScenarioList(newValue);
163
- if (invalidScenarios.length > 0) {
164
- this.errors.addOrReplace({
165
- id: errId,
166
- type: "warning",
167
- message: "scenarios: invalid value(s) '" + (invalidScenarios === null || invalidScenarios === void 0 ? void 0 : invalidScenarios.toString()) + "' are not supported.",
168
- });
169
- }
170
- else {
171
- this.errors.remove(errId);
172
- }
173
- }
174
- validateVariances(newValue) {
175
- const errId = "ERR_variances";
176
- const invalidVariances = withStyled.validateVariancesList(newValue);
177
- if (invalidVariances.length > 0) {
178
- this.errors.addOrReplace({
179
- id: errId,
180
- type: "warning",
181
- message: "variances: invalid value(s) '" + (invalidVariances === null || invalidVariances === void 0 ? void 0 : invalidVariances.toString()) + "' are not supported.",
182
- });
183
- }
184
- else {
185
- this.errors.remove(errId);
186
- }
187
- }
188
- validateOrder(newValue) {
189
- const invalidElements = withStyled.validateOrderList(newValue);
190
- const errId = "ERR_order";
191
- if (invalidElements.length > 0) {
192
- this.errors.addOrReplace({
193
- id: errId,
194
- type: "warning",
195
- message: "order: invalid value(s) '" + (invalidElements === null || invalidElements === void 0 ? void 0 : invalidElements.toString()) + "' are not supported.",
196
- });
197
- }
198
- else {
199
- this.errors.remove(errId);
200
- }
201
- }
202
- validateOrderDirection(newValue) {
203
- const errId = "ERR_orderDirection";
204
- if (!withStyled.isValidDirection(newValue)) {
205
- this.errors.addOrReplace({
206
- id: errId,
207
- type: "warning",
208
- message: "orderDirection: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
209
- });
210
- }
211
- else {
212
- this.errors.remove(errId);
213
- }
214
- }
215
- validateMeasures(newValue) {
216
- const errId = "ERR_measures";
217
- const invalidMeasures = withStyled.validateMeasureList(newValue);
218
- if (invalidMeasures.length > 0) {
219
- this.errors.addOrReplace({
220
- id: errId,
221
- type: "warning",
222
- message: "measures: invalid value(s) '" +
223
- (invalidMeasures === null || invalidMeasures === void 0 ? void 0 : invalidMeasures.toString()) +
224
- '\' are not supported. Valid format example: [{"name": "Bruttoumsatz", "unit": "mEUR"}]',
225
- });
226
- }
227
- else {
228
- this.errors.remove(errId);
229
- }
230
- }
231
- validateDateStart(newValue) {
232
- const errId = "ERR_dateStart";
233
- if (!withStyled.isValidDate(newValue) && !withStyled.isBlankInput(newValue)) {
234
- this.errors.addOrReplace({
235
- id: errId,
236
- type: "warning",
237
- message: "dateStart: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
238
- });
239
- }
240
- else {
241
- this.errors.remove(errId);
242
- }
243
- }
244
- validateDateEnd(newValue) {
245
- const errId = "ERR_dateEnd";
246
- if (!withStyled.isValidDate(newValue) && !withStyled.isBlankInput(newValue)) {
247
- this.errors.addOrReplace({
248
- id: errId,
249
- type: "warning",
250
- message: "dateStart: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
251
- });
252
- }
253
- else {
254
- this.errors.remove(errId);
255
- }
256
- }
257
- validateDateFormat(newValue) {
258
- const errId = "ERR_dateFormat";
259
- if (!withStyled.isValidDateFormat(newValue) && !withStyled.isBlankInput(newValue)) {
260
- this.errors.addOrReplace({
261
- id: errId,
262
- type: "warning",
263
- message: "dateFormat: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
264
- });
265
- }
266
- else {
267
- this.errors.remove(errId);
268
- }
269
- }
270
- validateDateLink(newValue) {
271
- const errId = "ERR_dateLink";
272
- if (!withStyled.isValidDateLink(newValue) && !withStyled.isBlankInput(newValue)) {
273
- this.errors.addOrReplace({
274
- id: errId,
275
- type: "warning",
276
- message: "dateLink: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
277
- });
278
- }
279
- else {
280
- this.errors.remove(errId);
281
- }
282
- }
283
- componentWillLoad() {
284
- this.validateScenario(this.scenarios);
285
- this.validateVariances(this.variances);
286
- this.validateMeasures(this.measures);
287
- this.validateDateStart(this.dateStart);
288
- this.validateDateEnd(this.dateEnd);
289
- this.validateDateFormat(this.dateFormat);
290
- this.validateDateLink(this.dateLink);
291
- this.validateOrderDirection(this.orderDirection);
292
- this.validateOrder(this.order);
293
- }
294
- prepareI18n() {
295
- const i18nMetaLabelsLocal = ["SEPERATOR_WS", "in", "CONNECTOR_WS"];
296
- const i18nMetaLabelsGlobal = contextProtocol.globalLabelKeys;
297
- // system
298
- const i18nMapSystemLocal = new Map(i18nMetaLabelsLocal.map((key) => [key, this.t(".".concat(key))]));
299
- const i18nMapSystemGlobal = new Map(i18nMetaLabelsGlobal.map((key) => [key, this.t("global.".concat(key))]));
300
- //let i18nMapCustom =
301
- return new Map([...i18nMapSystemGlobal.entries(), ...i18nMapSystemLocal.entries()]);
302
- }
303
- prepareI18nMode() {
304
- return Order.I18nMode.META;
305
- }
306
- prepareTitleOrder() {
307
- var _a;
308
- if (withStyled.isBlankInput(this.order) || withStyled.isBlankInput(this.orderDirection)) {
309
- return null;
310
- }
311
- return {
312
- hierarchy: this.order.split(",").map((entry) => entry.trim()),
313
- direction: Order.OrderDirection[(_a = this.orderDirection) === null || _a === void 0 ? void 0 : _a.toUpperCase()],
314
- };
315
- }
316
- prepareTitleTimePeriod() {
317
- var _a, _b;
318
- if (withStyled.isBlankInput(this.dateStart) && withStyled.isBlankInput(this.dateEnd)) {
319
- return null;
320
- }
321
- if (withStyled.isBlankInput(this.dateLink)) {
322
- return null;
323
- }
324
- return {
325
- start: Order.DateTime.fromISO(this.dateStart),
326
- end: Order.DateTime.fromISO(this.dateEnd),
327
- format: DateStringFactory.DateDistance[(_a = this.dateFormat) === null || _a === void 0 ? void 0 : _a.toUpperCase()],
328
- link: DateStringFactory.DateLink[(_b = this.dateLink) === null || _b === void 0 ? void 0 : _b.toUpperCase()],
329
- };
330
- }
331
- prepareMeasures() {
332
- if (withStyled.isBlankInput(this.measures)) {
333
- return [];
334
- }
335
- return JSON.parse(this.measures);
336
- }
337
- prepareScenarios() {
338
- var _a, _b, _c, _d;
339
- if (withStyled.isBlankInput(this.scenarios) && withStyled.isBlankInput(this.variances)) {
340
- return [];
341
- }
342
- let scenarios = [];
343
- if (((_a = this.scenarios) === null || _a === void 0 ? void 0 : _a.trim().length) > 0) {
344
- scenarios = scenarios.concat((_b = this.scenarios) === null || _b === void 0 ? void 0 : _b.split(","));
345
- }
346
- if (((_c = this.variances) === null || _c === void 0 ? void 0 : _c.trim().length) > 0) {
347
- scenarios = scenarios.concat((_d = this.variances) === null || _d === void 0 ? void 0 : _d.split(","));
348
- }
349
- return scenarios.map((entry) => entry.trim());
350
- }
351
- prepareBusinessUnit() {
352
- if (withStyled.isBlankInput(this.businessUnit) || this.businessUnit === "null") {
353
- return null;
354
- }
355
- return this.businessUnit;
356
- }
357
- getFontStyles() {
358
- return this.componentStyle(($) => {
359
- var _a, _b, _c, _d;
360
- return ({
361
- "--bn-font-family": ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontFamily"]) || "'Noto Sans', sans-serif",
362
- "--bn-font-size": `${((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontSizePx"]) || 13.3333}px`,
363
- "--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
364
- "--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
365
- });
366
- });
367
- }
368
- render() {
369
- const fontStyles = this.getFontStyles();
370
- return (index.h(index.Host, { key: '029abd8096c5274f94123da2dc1c1e88e76be922', style: fontStyles }, index.h("ibcs-title", { key: 'c8b128a6ea36d44d8a0730898b35fa3f944e23ae', businessUnit: this.prepareBusinessUnit(), scenarios: this.prepareScenarios(), measures: this.prepareMeasures(), timeperiod: this.prepareTitleTimePeriod(), order: this.prepareTitleOrder(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode() })));
371
- }
372
- get element() { return index.getElement(this); }
373
- static get watchers() { return {
374
- "scenarios": [{
375
- "validateScenario": 0
376
- }],
377
- "variances": [{
378
- "validateVariances": 0
379
- }],
380
- "order": [{
381
- "validateOrder": 0
382
- }],
383
- "orderDirection": [{
384
- "validateOrderDirection": 0
385
- }],
386
- "measures": [{
387
- "validateMeasures": 0
388
- }],
389
- "dateStart": [{
390
- "validateDateStart": 0
391
- }],
392
- "dateEnd": [{
393
- "validateDateEnd": 0
394
- }],
395
- "dateFormat": [{
396
- "validateDateFormat": 0
397
- }],
398
- "dateLink": [{
399
- "validateDateLink": 0
400
- }]
401
- }; }
402
- };
403
- Title$1.style = bnTitleCss();
404
-
405
- class TitleDataSetFactory {
406
- constructor() { }
407
- /**
408
- * Creates measures, adds i18n to each element
409
- * @param measures
410
- * @param i18n
411
- * @param i18nMode
412
- */
413
- createMeasures(measures, i18n, i18nMode) {
414
- if (this.allMeasuresUseSameUnit(measures)) {
415
- const amountOfMeasures = measures.length;
416
- let measureName = "";
417
- let unit = "";
418
- for (let i = 0; i < amountOfMeasures; i++) {
419
- let separator = "";
420
- if (i > 0) {
421
- separator = i18n.get("SEPERATOR_WS");
422
- }
423
- if (amountOfMeasures > 1 && i === amountOfMeasures - 1) {
424
- separator = i18n.get("CONNECTOR_WS");
425
- }
426
- if (i18nMode === Order.I18nMode.ALL) {
427
- measureName =
428
- (i18n.get(measureName) || measureName) + separator + (i18n.get(measures[i].name) || measures[i].name);
429
- unit = i18n.get(measures[i].unit) || measures[i].unit;
430
- }
431
- else {
432
- measureName = measureName + separator + measures[i].name;
433
- unit = measures[i].unit;
434
- }
435
- }
436
- return [
437
- {
438
- name: measureName,
439
- unit: unit,
440
- },
441
- ];
442
- }
443
- else {
444
- return measures;
445
- }
446
- }
447
- /**
448
- * Creates Dimension String,
449
- * concat of translated scenarios, time and order
450
- *
451
- * @param scenarios
452
- * @param time
453
- * @param order
454
- * @param i18n
455
- */
456
- createDimension(scenarios, time, order, i18n, spanLimit) {
457
- let formatedTime = "";
458
- if (time !== undefined) {
459
- formatedTime = new DateStringFactory.DateStringFactory().getDateLinkString(time.start, time.end, time.link, time.format, spanLimit);
460
- }
461
- const formatedScenarios = scenarios
462
- .map((scenario) => {
463
- let orderString = "";
464
- if (order != null && order.hierarchy != null) {
465
- if (order.hierarchy.find((x) => x === scenario)) {
466
- if (order.direction === "asc") {
467
- orderString = i18n.get("ORDER_asc");
468
- }
469
- else {
470
- orderString = i18n.get("ORDER_desc");
471
- }
472
- }
473
- }
474
- return "".concat(" ", formatter.Formatter.translateScenarioLabel(scenario, i18n), orderString);
475
- })
476
- .toString();
477
- return formatedTime + formatedScenarios;
478
- }
479
- allMeasuresUseSameUnit(measures) {
480
- const units = new Map();
481
- measures.forEach(function (entry) {
482
- units.set(entry.unit, true);
483
- });
484
- const hasOneUnit = units.size === 1;
485
- return hasOneUnit;
486
- }
487
- }
488
-
489
- class TitleConfig {
490
- constructor() {
491
- this.businessunit = "";
492
- this.measures = [];
493
- this.scenarios = [];
494
- this.i18nMode = Order.I18nMode.ALL;
495
- this.intervalSpanLimit = 32;
496
- }
497
- }
498
- class TitleConifgAdapter {
499
- constructor(measureEntryAdapter, timePeriodAdapter, orderAdapter, stringAdapter) {
500
- this.measureEntryAdapter = measureEntryAdapter;
501
- this.timePeriodAdapter = timePeriodAdapter;
502
- this.orderAdapter = orderAdapter;
503
- this.stringAdapter = stringAdapter;
504
- }
505
- adapt(data) {
506
- const config = new TitleConfig();
507
- if (Order.CompareUtil.isString(data.businessunit)) {
508
- config.businessunit = data.businessunit;
509
- }
510
- if (Order.CompareUtil.isArray(data.measures)) {
511
- config.measures = Order.AdapterUtils.adaptArray(data.measures, this.measureEntryAdapter);
512
- }
513
- if (Order.CompareUtil.isArray(data.scenarios)) {
514
- config.scenarios = Order.AdapterUtils.adaptArray(data.scenarios, this.stringAdapter);
515
- }
516
- if (Order.CompareUtil.isExisting(data.timeperiod)) {
517
- config.timeperiod = this.timePeriodAdapter.adapt(data.timeperiod);
518
- }
519
- if (Order.CompareUtil.isNumber(data.intervalSpanLimit)) {
520
- config.intervalSpanLimit = data.intervalSpanLimit;
521
- }
522
- if (Order.CompareUtil.isExisting(data.i18nMode)) {
523
- config.i18nMode = data.i18nMode;
524
- }
525
- if (Order.CompareUtil.isExisting(data.order)) {
526
- config.order = this.orderAdapter.adapt(data.order);
527
- }
528
- return config;
529
- }
530
- default() {
531
- return new TitleConfig();
532
- }
533
- }
534
-
535
- var FactoryState;
536
- (function (FactoryState) {
537
- FactoryState[FactoryState["UP_TO_DATE"] = 0] = "UP_TO_DATE";
538
- FactoryState[FactoryState["DIRTY"] = 1] = "DIRTY";
539
- })(FactoryState || (FactoryState = {}));
540
- class Title {
541
- constructor(ruleSet) {
542
- this.i18n = new Map();
543
- this.unit = "";
544
- this.measures = [];
545
- this.dimension = "";
546
- this.config = new TitleConfig();
547
- this.state = FactoryState.DIRTY;
548
- this.ruleSet = ruleSet || new ibcsRuleSet.IBCSRuleSet();
549
- this.dataSetFactory = new TitleDataSetFactory();
550
- this.state = FactoryState.DIRTY;
551
- this.setI18n(new Map());
552
- }
553
- /**
554
- * Set Localisation Map
555
- * @param i18n
556
- */
557
- setI18n(i18n) {
558
- this.state = FactoryState.DIRTY; // mark dataSet for update
559
- const defaultI18n = new Map([
560
- ["SEPERATOR_WS", ", "],
561
- ["in", "in"],
562
- ["ORDER_asc", "↑"],
563
- ["ORDER_desc", "↓"],
564
- ["ac1", "AC"],
565
- ["pp1", "PY"],
566
- ["fc1", "FC"],
567
- ["pl1", "PL"],
568
- ["ac2", "AC2"],
569
- ["pp2", "PY2"],
570
- ["fc2", "FC2"],
571
- ["pl2", "PL2"],
572
- ["ac3", "AC3"],
573
- ["pp3", "PY3"],
574
- ["fc3", "FC3"],
575
- ["pp3", "PL3"],
576
- ["ac4", "AC4"],
577
- ["py4", "PY4"],
578
- ["fc4", "FC4"],
579
- ["pp4", "PL4"],
580
- ["category", " "],
581
- ["operation", " "],
582
- ["there_of", "davon"],
583
- ["part_of", "in % von"],
584
- ["ibcssymbol_delta_ac", "Δ{%}"],
585
- ["ibcssymbol_delta_generic", "Δ({%})"],
586
- ["ibcssymbol_delta_ac_relative", "Δ{%}%"],
587
- ["ibcssymbol_delta_generic_relative", "Δ({%})%"],
588
- ["SUM_TOTAL", "❖"],
589
- ["CONNECTOR_WS", " und "],
590
- ]);
591
- this.i18n = new Map([...defaultI18n, ...(i18n || new Map())]);
592
- }
593
- /**
594
- * Generates and Returns the DataSet based,
595
- * data and config.
596
- * if data or config have not been changed since last run
597
- * the dataSet will not be regenerated.
598
- */
599
- update() {
600
- if (FactoryState.DIRTY === this.state) {
601
- this.unit = this.config.businessunit;
602
- this.measures = this.dataSetFactory.createMeasures(this.config.measures, this.i18n, this.config.i18nMode);
603
- this.dimension = this.dataSetFactory.createDimension(this.config.scenarios, this.config.timeperiod, this.config.order, this.i18n, this.config.intervalSpanLimit);
604
- this.state = FactoryState.UP_TO_DATE;
605
- }
606
- return this;
607
- }
608
- setConfig(config) {
609
- this.config = this.initConfig(config);
610
- }
611
- initConfig(config) {
612
- this.state = FactoryState.DIRTY;
613
- const tmpConfig = config;
614
- // this.checkConfigIfValidElseSetDefaultOrder(config.order);
615
- // sorting scenario order based on Ruleset
616
- const self = this;
617
- config.scenarios.sort((n1, n2) => {
618
- return self.ruleSet.getScenarioSorIndex(n1) - self.ruleSet.getScenarioSorIndex(n2);
619
- });
620
- return tmpConfig;
621
- }
622
- }
623
-
624
- //import { IAdapter } from "../../../../utils/helper/IAdapter";
625
- // import { CompareUtil } from "../../../../utils/helper/CompareUtil";
626
- class MeasureEntry {
627
- constructor(name = "", unit = "") {
628
- this.name = name;
629
- this.unit = unit;
630
- }
631
- }
632
- class MeasureEntryAdapter {
633
- construnctor() { }
634
- adapt(data) {
635
- const entry = new MeasureEntry();
636
- if (Order.CompareUtil.isString(data.name)) {
637
- entry.name = data.name;
638
- }
639
- if (Order.CompareUtil.isString(data.unit)) {
640
- entry.unit = data.unit;
641
- }
642
- return entry;
643
- }
644
- default() {
645
- return new MeasureEntry("", "");
646
- }
647
- }
648
-
649
- class TimePeriod {
650
- constructor(start = Order.DateTime.now(), end = Order.DateTime.now(), format = DateStringFactory.DateDistance.AUTO, link = DateStringFactory.DateLink.AUTO) {
651
- this.start = start;
652
- this.end = end;
653
- this.format = format;
654
- this.link = link;
655
- }
656
- }
657
- class TimePeriodAdapter {
658
- construnctor() { }
659
- adapt(data) {
660
- const entry = new TimePeriod();
661
- if (Order.CompareUtil.isDate(data.start)) {
662
- entry.start = data.start;
663
- }
664
- if (Order.CompareUtil.isDate(data.end)) {
665
- entry.end = data.end;
666
- }
667
- if (Order.CompareUtil.isExisting(data.format)) {
668
- entry.format = data.format;
669
- }
670
- if (Order.CompareUtil.isExisting(data.link)) {
671
- entry.link = data.link;
672
- }
673
- return entry;
674
- }
675
- default() {
676
- return new TimePeriod();
677
- }
678
- }
679
-
680
- const ibcsTitleCss = () => `:host{display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.measure{font-weight:bold}div{background-color:var(--bn-font-background, white);color:var(--bn-font-color, black)}`;
681
-
682
- const IbcsTitle = class {
683
- constructor(hostRef) {
684
- index.registerInstance(this, hostRef);
685
- // sample fuer die chrome dev console:
686
- // document.querySelector("ibcs-title").setBusinessUnit("Sven")
687
- // document.querySelector("ibcs-title").setProps({businessUnit: "Lalal"})
688
- this.businessUnit = "";
689
- this.scenarios = [];
690
- this.measures = [];
691
- this.intervalSpanLimit = 28;
692
- this.order = {
693
- hierarchy: [],
694
- direction: Order.OrderDirection.ASC,
695
- };
696
- this.i18n = new Map(); // I18nMode;
697
- this.i18nMode = Order.I18nMode.ALL;
698
- this.title = new Title(new ibcsRuleSet.IBCSRuleSet());
699
- }
700
- // so
701
- async setBusinessUnit(businessUnit) {
702
- this.businessUnit = businessUnit;
703
- }
704
- // oder so
705
- async setProps(data) {
706
- Object.keys(data).forEach((key) => {
707
- //@ts-ignore
708
- this[key] = data[key];
709
- });
710
- }
711
- render() {
712
- return (index.h("div", { key: '08439c867ae47a9ee17ef8280801896a823c8826' }, index.h("div", { key: 'bb5b7325de2ae2f2e0bdba8d7f7f36511835efa9' }, this.title.unit), index.h("div", { key: '3edb730c95280ca0c47db70e32dd8e471747d989' }, this.title.measures.map((measure, index$1) => (index.h("span", null, this.isFirstElement(index$1) ? this.title.i18n.get("SEPERATOR_WS") : "", index.h("span", { class: "measure" }, measure.name), " ", measure.unit ? this.title.i18n.get("in") : "", " ", measure.unit)))), index.h("div", { key: '3bae51f2fddef6b2195d1c24915512b6255c9a75' }, this.title.dimension)));
713
- }
714
- componentWillLoad() {
715
- const config = this.prepareConfig();
716
- this.title = new Title(new ibcsRuleSet.IBCSRuleSet());
717
- this.title.setI18n(this.i18n);
718
- this.title.setConfig(config);
719
- }
720
- componentWillUpdate() {
721
- const config = this.prepareConfig();
722
- this.title.setI18n(this.i18n);
723
- this.title.setConfig(config);
724
- }
725
- componentWillRender() {
726
- this.title.update();
727
- }
728
- isFirstElement(index) {
729
- return index !== 0;
730
- }
731
- prepareConfig() {
732
- return new TitleConifgAdapter(new MeasureEntryAdapter(), new TimePeriodAdapter(), new Order.OrderAdapter(new ibcsRuleSet.StringAdapter()), new ibcsRuleSet.StringAdapter()).adapt({
733
- businessunit: this.businessUnit,
734
- measures: this.measures,
735
- scenarios: this.scenarios,
736
- timeperiod: this.timeperiod,
737
- intervalSpanLimit: this.intervalSpanLimit,
738
- i18nMode: this.i18nMode,
739
- order: this.order,
740
- });
741
- }
742
- };
743
- IbcsTitle.style = ibcsTitleCss();
744
-
745
- exports.bn_body = Body;
746
- exports.bn_footer = Footer;
747
- exports.bn_title = Title$1;
748
- exports.ibcs_title = IbcsTitle;