@bino-bi/bn-template-engine 1.0.0-alpha.5 → 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 (157) 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-layout-card/bn-layout-card.css +1 -0
  47. package/dist/collection/components/bn-layout-card/bn-layout-card.js +162 -27
  48. package/dist/collection/components/bn-layout-page/bn-layout-page.css +1 -0
  49. package/dist/collection/components/bn-layout-page/bn-layout-page.js +151 -33
  50. package/dist/collection/utils/parentDimensions.js +38 -6
  51. package/dist/components/bn-layout-card.js +1 -1
  52. package/dist/components/bn-layout-page.js +1 -1
  53. package/dist/components/scaling.js +1 -1
  54. package/dist/esm/{Order-Bnhh02CF.js → Order-sRO-lj7X.js} +448 -1
  55. package/dist/esm/{alasql.min-CWu4NkIt.js → SVGVariancesStyleGroup-DOIT-zvI.js} +8212 -2
  56. package/dist/esm/bn-asset_16.entry.js +9001 -0
  57. package/dist/esm/bn-card.entry.js +4 -5
  58. package/dist/esm/bn-chart-time.entry.js +8 -13
  59. package/dist/esm/bn-grid.entry.js +6 -9
  60. package/dist/esm/bn-image.entry.js +6 -9
  61. package/dist/esm/bn-internationalization.entry.js +4 -5
  62. package/dist/esm/bn-layout-card.entry.js +126 -7
  63. package/dist/esm/bn-template-engine.js +1 -1
  64. package/dist/esm/bn-template.entry.js +2 -3
  65. package/dist/esm/bn-text.entry.js +7 -11
  66. package/dist/esm/bn-tree.entry.js +6 -9
  67. package/dist/esm/{context-protocol-BHnQsVsr.js → context-protocol-2peaD4y8.js} +1 -1
  68. package/dist/esm/editor-companion.entry.js +1 -1
  69. package/dist/esm/{formatter-DTMEZ6d8.js → formatter-BDh7GfC5.js} +6 -2
  70. package/dist/esm/ibcs-chart-time.entry.js +3 -8
  71. package/dist/esm/loader.js +1 -1
  72. package/dist/esm/{scaling-Cehc74IE.js → scaling-BOcjT8M0.js} +112 -10
  73. package/dist/esm/{withBodyObserver-FQ8NwCIz.js → withBodyObserver-DczL5ia8.js} +1 -1
  74. package/dist/esm/{withComponentStatus-DWjDYtZ7.js → withComponentStatus-DodoSXe-.js} +1 -1
  75. package/dist/esm/{withComponentStyle-9uP_hcDq.js → withComponentStyle-D3VWOsto.js} +2 -2
  76. package/dist/esm/{utils-DvvwfRQG.js → withHasError-B3QX2emi.js} +69 -1
  77. package/dist/esm/{withStyled--qQWquTH.js → withStyled-CE3_3taP.js} +57 -5
  78. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +139 -0
  79. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +154 -0
  80. package/dist/types/components.d.ts +168 -0
  81. package/dist/types/utils/parentDimensions.d.ts +6 -1
  82. package/package.json +1 -1
  83. package/dist/bn-template-engine/p-1265d8d3.entry.js +0 -1
  84. package/dist/bn-template-engine/p-15516dac.entry.js +0 -1
  85. package/dist/bn-template-engine/p-1c716641.entry.js +0 -1
  86. package/dist/bn-template-engine/p-1jFf17Vj.js +0 -1
  87. package/dist/bn-template-engine/p-27cc8dc0.entry.js +0 -1
  88. package/dist/bn-template-engine/p-3b4c7425.entry.js +0 -1
  89. package/dist/bn-template-engine/p-4426d484.entry.js +0 -1
  90. package/dist/bn-template-engine/p-51f8dc9e.entry.js +0 -1
  91. package/dist/bn-template-engine/p-53d4e690.entry.js +0 -1
  92. package/dist/bn-template-engine/p-5KQYRQLK.js +0 -1
  93. package/dist/bn-template-engine/p-7337e03d.entry.js +0 -1
  94. package/dist/bn-template-engine/p-75e97c87.entry.js +0 -1
  95. package/dist/bn-template-engine/p-7a560278.entry.js +0 -1
  96. package/dist/bn-template-engine/p-BFTU3MAI.js +0 -1
  97. package/dist/bn-template-engine/p-BYBpC0EO.js +0 -1
  98. package/dist/bn-template-engine/p-BYmPQYxx.js +0 -1
  99. package/dist/bn-template-engine/p-BfXY5dsy.js +0 -1
  100. package/dist/bn-template-engine/p-BgnHJQ9Q.js +0 -1
  101. package/dist/bn-template-engine/p-Bhd_WSML.js +0 -1
  102. package/dist/bn-template-engine/p-Bka-Z6jo.js +0 -1
  103. package/dist/bn-template-engine/p-C7dQL8CS.js +0 -1
  104. package/dist/bn-template-engine/p-CYwd_ZNM.js +0 -1
  105. package/dist/bn-template-engine/p-ChlK-T9I.js +0 -1
  106. package/dist/bn-template-engine/p-DHezf8pZ.js +0 -1
  107. package/dist/bn-template-engine/p-DlppAFq9.js +0 -1
  108. package/dist/bn-template-engine/p-DvDDgmcV.js +0 -1
  109. package/dist/bn-template-engine/p-DvvwfRQG.js +0 -1
  110. package/dist/bn-template-engine/p-abc0067c.entry.js +0 -1
  111. package/dist/bn-template-engine/p-b34eaf86.entry.js +0 -1
  112. package/dist/bn-template-engine/p-bdb8b44c.entry.js +0 -1
  113. package/dist/bn-template-engine/p-c44fcb8e.entry.js +0 -1
  114. package/dist/bn-template-engine/p-c7e1a49b.entry.js +0 -1
  115. package/dist/bn-template-engine/p-d9003041.entry.js +0 -1
  116. package/dist/bn-template-engine/p-daa7ffa3.entry.js +0 -1
  117. package/dist/bn-template-engine/p-e084f50a.entry.js +0 -1
  118. package/dist/bn-template-engine/p-eaba6658.entry.js +0 -1
  119. package/dist/bn-template-engine/p-u8igQLRZ.js +0 -1
  120. package/dist/cjs/DataFormatDigits-DKcOeLNK.js +0 -142
  121. package/dist/cjs/DateStringFactory-CSKvbS8K.js +0 -452
  122. package/dist/cjs/SVGVariancesStyleGroup-K-Tw6lOD.js +0 -7960
  123. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +0 -10
  124. package/dist/cjs/bn-asset.cjs.entry.js +0 -42
  125. package/dist/cjs/bn-body_4.cjs.entry.js +0 -748
  126. package/dist/cjs/bn-chart-structure_5.cjs.entry.js +0 -3948
  127. package/dist/cjs/bn-component-style.cjs.entry.js +0 -44
  128. package/dist/cjs/bn-dataset.cjs.entry.js +0 -306
  129. package/dist/cjs/bn-layout-page.cjs.entry.js +0 -143
  130. package/dist/cjs/bn-message.cjs.entry.js +0 -52
  131. package/dist/cjs/bn-table.cjs.entry.js +0 -981
  132. package/dist/cjs/contentDecoder-JxOldq1e.js +0 -419
  133. package/dist/cjs/emotion-hash.esm-nbbEQ0Dn.js +0 -57
  134. package/dist/cjs/ibcs-table.cjs.entry.js +0 -2276
  135. package/dist/cjs/ibcsRuleSet-DgUoXOfd.js +0 -136
  136. package/dist/cjs/index-Dm85hG6t.js +0 -65
  137. package/dist/cjs/withHasError-D7ue5vAv.js +0 -72
  138. package/dist/cjs/withTranslation-rwgyITqe.js +0 -77
  139. package/dist/esm/DataFormatDigits-oSZ1hBKE.js +0 -137
  140. package/dist/esm/DateStringFactory-CSGz6TDk.js +0 -450
  141. package/dist/esm/SVGVariancesStyleGroup-CqTjrZYg.js +0 -7950
  142. package/dist/esm/_commonjsHelpers-BFTU3MAI.js +0 -7
  143. package/dist/esm/bn-asset.entry.js +0 -40
  144. package/dist/esm/bn-body_4.entry.js +0 -743
  145. package/dist/esm/bn-chart-structure_5.entry.js +0 -3942
  146. package/dist/esm/bn-component-style.entry.js +0 -42
  147. package/dist/esm/bn-dataset.entry.js +0 -304
  148. package/dist/esm/bn-layout-page.entry.js +0 -141
  149. package/dist/esm/bn-message.entry.js +0 -50
  150. package/dist/esm/bn-table.entry.js +0 -979
  151. package/dist/esm/contentDecoder-oMmxz6nJ.js +0 -416
  152. package/dist/esm/emotion-hash.esm-BYBpC0EO.js +0 -55
  153. package/dist/esm/ibcs-table.entry.js +0 -2274
  154. package/dist/esm/ibcsRuleSet-K4ytuA1f.js +0 -133
  155. package/dist/esm/index-DHezf8pZ.js +0 -65
  156. package/dist/esm/withHasError-FyY5mQ_3.js +0 -70
  157. package/dist/esm/withTranslation-BqD0Kp7b.js +0 -75
@@ -1,6 +1,6 @@
1
- import { g as getStores, c as clearStoresCache } from './context-protocol-BHnQsVsr.js';
2
- import { r as runIfExisits } from './utils-DvvwfRQG.js';
3
- import { g as getElement } from './index-JNHhIe7t.js';
1
+ import { a as getStores, c as clearStoresCache } from './context-protocol-2peaD4y8.js';
2
+ import { r as runIfExisits } from './withHasError-B3QX2emi.js';
3
+ import { g as getElement, f as forceUpdate } from './index-JNHhIe7t.js';
4
4
 
5
5
  /**
6
6
  * Splits an array into two groups based on a predicate.
@@ -141,16 +141,91 @@ component, onUpdate, onMetaUpdate) => {
141
141
  };
142
142
  };
143
143
 
144
+ /**
145
+ * Mixin that provides i18n translation support to a Stencil component.
146
+ *
147
+ * Returns an object with a `t(key, data?)` function for looking up translated strings.
148
+ *
149
+ * **Key resolution shortcuts:**
150
+ * - A key starting with `.` (e.g. `.label`) is expanded to `<component-tag>.label`,
151
+ * allowing components to reference their own translations concisely.
152
+ * - If the key is not found in the component's namespace, the `_system` namespace
153
+ * is used as a fallback.
154
+ *
155
+ * **Mustache-style interpolation:** `{{variable}}` placeholders in translation
156
+ * templates are replaced with values from the optional `data` object.
157
+ *
158
+ * The mixin observes the `namespace` attribute on the host element and re-renders
159
+ * the component when the locale store updates for the active namespace.
160
+ *
161
+ * @param component - The Stencil component instance
162
+ * @returns Object containing the `t` translation function
163
+ */
164
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
165
+ const withTranslation = (component) => {
166
+ let subscription;
167
+ let namespace = undefined;
168
+ let stores;
169
+ const observer = new MutationObserver((mutations) => {
170
+ mutations.forEach((mutation) => {
171
+ if (mutation.attributeName === "namespace") {
172
+ namespace = getElement(component).getAttribute("namespace");
173
+ forceUpdate(component);
174
+ }
175
+ });
176
+ });
177
+ const connectedCallback = component["connectedCallback"];
178
+ component["connectedCallback"] = () => {
179
+ const element = getElement(component);
180
+ stores = getStores(element);
181
+ observer.observe(element, { attributes: true, attributeFilter: ["namespace"] });
182
+ namespace = getElement(component).getAttribute("namespace");
183
+ subscription = stores.internationalization.on("set", (key, _value) => {
184
+ if (key === namespace) {
185
+ forceUpdate(component);
186
+ }
187
+ });
188
+ runIfExisits(connectedCallback, component);
189
+ };
190
+ const disconnectedCallback = component["disconnectedCallback"];
191
+ component["disconnectedCallback"] = () => {
192
+ observer.disconnect();
193
+ runIfExisits(subscription);
194
+ clearStoresCache(getElement(component));
195
+ runIfExisits(disconnectedCallback, component);
196
+ };
197
+ const t = (key, data) => {
198
+ var _a, _b;
199
+ if (key.startsWith(".")) {
200
+ key = getElement(component).localName + key;
201
+ }
202
+ const locales = stores.internationalization.state;
203
+ const locale = stores.context.state.locale;
204
+ let currentNamespace = namespace;
205
+ if (((_b = (_a = locales[currentNamespace]) === null || _a === void 0 ? void 0 : _a[locale]) === null || _b === void 0 ? void 0 : _b[key]) == null) {
206
+ currentNamespace = "_system";
207
+ }
208
+ const tpl = locales[currentNamespace][locale][key];
209
+ return tpl.replace(/{{([\s\S]+?)}}/g, (_, k) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data[k.trim()]) !== null && _a !== void 0 ? _a : ""; });
210
+ };
211
+ return { t };
212
+ };
213
+
144
214
  /**
145
215
  * Returns the available dimensions for a component.
146
216
  *
147
- * Width: parent content-box width (excluding padding).
217
+ * Width: visual parent's content-box width (excluding padding).
148
218
  * Height: walks up the DOM to find the nearest ancestor with a constrained
149
219
  * height (overflow !== 'visible' or explicit max-height). Falls back to
150
220
  * the viewport height when every ancestor auto-grows with its content.
221
+ *
222
+ * When the component is slotted into a shadow DOM (e.g. inside
223
+ * bn-layout-page or bn-layout-card), the light DOM parentElement is NOT the
224
+ * visual container. We cross the light→shadow boundary via assignedSlot to
225
+ * find the actual slot wrapper that determines layout.
151
226
  */
152
227
  function getParentDimensions(element) {
153
- const parent = element.parentElement;
228
+ const parent = findLayoutParent(element);
154
229
  if (!parent) {
155
230
  return { width: 0, height: 0 };
156
231
  }
@@ -159,13 +234,40 @@ function getParentDimensions(element) {
159
234
  const height = findConstrainedHeight(element);
160
235
  return { width: Math.max(0, width), height: Math.max(0, height) };
161
236
  }
237
+ /**
238
+ * Returns the visual layout parent of an element, crossing the
239
+ * light→shadow DOM boundary when the element's parent is slotted.
240
+ *
241
+ * For a slotted element, the light DOM parentElement is NOT where
242
+ * the element renders visually. The actual container is the shadow
243
+ * DOM element that wraps the <slot>. We reach it via assignedSlot.
244
+ */
245
+ function findLayoutParent(element) {
246
+ var _a;
247
+ const lightParent = element.parentElement;
248
+ if ((_a = lightParent === null || lightParent === void 0 ? void 0 : lightParent.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement) {
249
+ return lightParent.assignedSlot.parentElement;
250
+ }
251
+ return lightParent;
252
+ }
253
+ /**
254
+ * Returns the visual parent, crossing shadow DOM boundaries via assignedSlot.
255
+ */
256
+ function getVisualParent(element) {
257
+ var _a;
258
+ if ((_a = element.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement) {
259
+ return element.assignedSlot.parentElement;
260
+ }
261
+ return element.parentElement;
262
+ }
162
263
  /**
163
264
  * Walks up the ancestor chain to find a height that is actually constrained
164
- * (not just "whatever my content needs"). Returns viewport height as a
165
- * last resort.
265
+ * (not just "whatever my content needs"). Crosses shadow DOM boundaries
266
+ * via assignedSlot when encountering slotted elements. Returns viewport
267
+ * height as a last resort.
166
268
  */
167
269
  function findConstrainedHeight(element) {
168
- let current = element.parentElement;
270
+ let current = findLayoutParent(element);
169
271
  while (current) {
170
272
  const style = getComputedStyle(current);
171
273
  const overflow = style.overflowY;
@@ -180,7 +282,7 @@ function findConstrainedHeight(element) {
180
282
  return Math.min(mh, current.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom));
181
283
  }
182
284
  }
183
- current = current.parentElement;
285
+ current = getVisualParent(current);
184
286
  }
185
287
  // No constrained ancestor found — use viewport
186
288
  return typeof window !== "undefined" ? window.innerHeight : 0;
@@ -204,4 +306,4 @@ function parseScaling(scale) {
204
306
  return { mode: "empty" };
205
307
  }
206
308
 
207
- export { getParentDimensions as g, parseScaling as p, withDataset as w };
309
+ export { withTranslation as a, getParentDimensions as g, parseScaling as p, withDataset as w };
@@ -1,5 +1,5 @@
1
1
  import { g as getElement } from './index-JNHhIe7t.js';
2
- import { r as runIfExisits } from './utils-DvvwfRQG.js';
2
+ import { r as runIfExisits } from './withHasError-B3QX2emi.js';
3
3
 
4
4
  /**
5
5
  * Mixin that observes changes to a component's text content.
@@ -1,4 +1,4 @@
1
- import { g as generateUUID, r as runIfExisits } from './utils-DvvwfRQG.js';
1
+ import { g as generateUUID, r as runIfExisits } from './withHasError-B3QX2emi.js';
2
2
 
3
3
  /** Lifecycle state of a tracked component instance. */
4
4
  var ComponentStatus;
@@ -1,6 +1,6 @@
1
1
  import { g as getElement, f as forceUpdate } from './index-JNHhIe7t.js';
2
- import { g as getStores, c as clearStoresCache } from './context-protocol-BHnQsVsr.js';
3
- import { r as runIfExisits } from './utils-DvvwfRQG.js';
2
+ import { a as getStores, c as clearStoresCache } from './context-protocol-2peaD4y8.js';
3
+ import { r as runIfExisits } from './withHasError-B3QX2emi.js';
4
4
 
5
5
  const isObject = (obj) => {
6
6
  if (typeof obj === 'object' && obj !== null) {
@@ -1,3 +1,5 @@
1
+ import { g as getElement } from './index-JNHhIe7t.js';
2
+
1
3
  /** Concatenates name parts with spaces, skipping falsy segments. */
2
4
  /**
3
5
  * Safely invokes `fn` if it is a function; otherwise does nothing.
@@ -79,4 +81,70 @@ const ref = (value, onChange) => {
79
81
  };
80
82
  };
81
83
 
82
- export { ref as a, generateUUID as g, runIfExisits as r };
84
+ const urlAlphabet =
85
+ 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
86
+
87
+ /* @ts-self-types="./index.d.ts" */
88
+ let nanoid = (size = 21) => {
89
+ let id = '';
90
+ let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)));
91
+ while (size--) {
92
+ id += urlAlphabet[bytes[size] & 63];
93
+ }
94
+ return id
95
+ };
96
+
97
+ /**
98
+ * Mixin that provides an {@link ErrorDispatcher} for managing validation
99
+ * errors and warnings on a component.
100
+ *
101
+ * Errors are stored internally via a reactive {@link ref}. On every change,
102
+ * the host element's `has-error` attribute is updated with a JSON-serialized
103
+ * array of {@link ErrorItem}s (or removed when empty). This allows external
104
+ * CSS selectors and parent components to detect error states declaratively.
105
+ *
106
+ * @param component - The Stencil component instance
107
+ * @returns An {@link ErrorDispatcher} for adding, replacing, and removing errors
108
+ */
109
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
110
+ const withHasError = (component) => {
111
+ const { set, modify } = ref([], (items) => {
112
+ const elm = getElement(component);
113
+ if (items.length === 0) {
114
+ elm.removeAttribute("has-error");
115
+ }
116
+ else {
117
+ elm.setAttribute("has-error", JSON.stringify(items));
118
+ }
119
+ });
120
+ return {
121
+ clear: () => {
122
+ set([]);
123
+ },
124
+ replace: (errors) => {
125
+ set(errors.map((item) => {
126
+ if (!item.id) {
127
+ item.id = nanoid();
128
+ }
129
+ return item;
130
+ }));
131
+ },
132
+ add: (error) => {
133
+ if (!error.id)
134
+ error.id = nanoid();
135
+ modify((current) => [...current, error]);
136
+ return error.id;
137
+ },
138
+ addOrReplace: (error) => {
139
+ if (error.id === undefined)
140
+ throw "missing";
141
+ modify((current) => [...current.filter((item) => item.id !== error.id), error]);
142
+ return error.id;
143
+ },
144
+ remove: (id) => {
145
+ modify((current) => current.filter((item) => item.id !== id));
146
+ },
147
+ };
148
+ };
149
+
150
+ export { generateUUID as g, runIfExisits as r, withHasError as w };
@@ -1,8 +1,6 @@
1
- import { m as murmur2 } from './emotion-hash.esm-BYBpC0EO.js';
2
- import { h as Scenarios, i as Sentiments, j as AggregationLevel, a as OrderColumn, O as OrderDirection, A as AxisLabelsMode, e as TableBarColumnWidth, d as DataFormat, k as TableType, M as MeasureType, T as TableCategoryWidth } from './Order-Bnhh02CF.js';
3
- import { D as DateDistance, a as DateLink } from './DateStringFactory-CSGz6TDk.js';
1
+ import { d as Scenarios, e as Sentiments, f as AggregationLevel, a as OrderColumn, O as OrderDirection, T as TableBarColumnWidth, g as DataFormat, h as TableType, M as MeasureType, i as TableCategoryWidth, D as DateDistance, j as DateLink, A as AxisLabelsMode } from './Order-sRO-lj7X.js';
4
2
  import { f as forceUpdate, g as getElement } from './index-JNHhIe7t.js';
5
- import { r as runIfExisits } from './utils-DvvwfRQG.js';
3
+ import { r as runIfExisits } from './withHasError-B3QX2emi.js';
6
4
 
7
5
  /**
8
6
  * Prop validators for Stencil @Watch handlers.
@@ -263,6 +261,60 @@ class StyleSheet {
263
261
  }
264
262
  const styleSheet = new StyleSheet();
265
263
 
264
+ /* eslint-disable */
265
+ // Inspired by https://github.com/garycourt/murmurhash-js
266
+ // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
267
+ function murmur2(str) {
268
+ // 'm' and 'r' are mixing constants generated offline.
269
+ // They're not really 'magic', they just happen to work well.
270
+ // const m = 0x5bd1e995;
271
+ // const r = 24;
272
+ // Initialize the hash
273
+ var h = 0; // Mix 4 bytes at a time into the hash
274
+
275
+ var k,
276
+ i = 0,
277
+ len = str.length;
278
+
279
+ for (; len >= 4; ++i, len -= 4) {
280
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
281
+ k =
282
+ /* Math.imul(k, m): */
283
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
284
+ k ^=
285
+ /* k >>> r: */
286
+ k >>> 24;
287
+ h =
288
+ /* Math.imul(k, m): */
289
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
290
+ /* Math.imul(h, m): */
291
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
292
+ } // Handle the last few bytes of the input array
293
+
294
+
295
+ switch (len) {
296
+ case 3:
297
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
298
+
299
+ case 2:
300
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
301
+
302
+ case 1:
303
+ h ^= str.charCodeAt(i) & 0xff;
304
+ h =
305
+ /* Math.imul(h, m): */
306
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
307
+ } // Do a few final mixes of the hash to ensure the last few
308
+ // bytes are well-incorporated.
309
+
310
+
311
+ h ^= h >>> 13;
312
+ h =
313
+ /* Math.imul(h, m): */
314
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
315
+ return ((h ^ h >>> 15) >>> 0).toString(36);
316
+ }
317
+
266
318
  const transofrmToUnitString = (value) => {
267
319
  if (isValidNumber(value)) {
268
320
  return `${value}px`;
@@ -440,4 +492,4 @@ const withStyled = (component) => {
440
492
  };
441
493
  };
442
494
 
443
- export { validateVariancesList as a, isValidInteger as b, isValidLevel as c, validateOrderList as d, isValidDirection as e, isValidDateFormat as f, validateStackConfig as g, isValidAxisLabelsMode as h, isValidNumber as i, isValidBoolean as j, isValidMeasureScale as k, isBlankInput as l, isTableBarColumnWidth as m, isValidDataFormat as n, isValidTableType as o, validateThereOfJsonStr as p, validatePartOfJsonStr as q, isValidMeasureType as r, isTableCategoryWidth as s, validateColumnThereOfJsonStr as t, validateMeasureList as u, validateScenarioList as v, withStyled as w, isValidDate as x, isValidDateLink as y };
495
+ export { validateVariancesList as a, isValidInteger as b, isValidLevel as c, validateOrderList as d, isValidDirection as e, isValidDateFormat as f, validateStackConfig as g, isValidAxisLabelsMode as h, isValidNumber as i, isValidBoolean as j, isValidMeasureScale as k, isBlankInput as l, murmur2 as m, isTableBarColumnWidth as n, isValidDataFormat as o, isValidTableType as p, validateThereOfJsonStr as q, validatePartOfJsonStr as r, isValidMeasureType as s, isTableCategoryWidth as t, validateColumnThereOfJsonStr as u, validateScenarioList as v, withStyled as w, validateMeasureList as x, isValidDate as y, isValidDateLink as z };
@@ -4,27 +4,166 @@ export declare class LayoutCard {
4
4
  private stores;
5
5
  constructor();
6
6
  connectedCallback(): void;
7
+ /**
8
+ * JSON string of component-style overrides passed through to the inner
9
+ * `<bn-card>` element. Typically set via a `ComponentStyle` manifest
10
+ * rather than directly on the component.
11
+ */
7
12
  styles?: string;
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
+ */
8
25
  titleImage: string;
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
+ */
9
33
  titleBusinessUnit: string;
34
+ /**
35
+ * List of scenarios displayed in the title header.
36
+ * <br /><br />
37
+ * Comma-separated string or omitted. If empty, the scenarios row is omitted.
38
+ * <br /><br />
39
+ * values:<br />
40
+ * ```ac // fc // py // pl```
41
+ */
10
42
  titleScenarios?: string;
43
+ /**
44
+ * List of variances calculated from the given scenarios.
45
+ * The scenarios used in the variances must also be defined in
46
+ * the `titleScenarios` property. The variance is defined as
47
+ * (ScenarioA − ScenarioB). The pos/neg/neu postfix defines
48
+ * which direction is considered "good".
49
+ * <br /><br />
50
+ * If empty, variance indicators are hidden.
51
+ * <br /><br />
52
+ * pattern:<br />
53
+ * ```d<scenarioB>_<scenarioA>_[pos/neg/neu]```
54
+ */
11
55
  titleVariances?: string;
56
+ /**
57
+ * Primary column on which the order direction is applied.
58
+ * <br /><br />
59
+ * values:<br />
60
+ * ```category // categoryindex // rowgroup // rowgroupindex // ac // fc // py // pl```
61
+ */
12
62
  titleOrder: string;
63
+ /**
64
+ * Sorting order direction for the column specified by `titleOrder`.
65
+ * <br /><br />
66
+ * values:<br />
67
+ * ```asc // desc```
68
+ */
13
69
  titleOrderDirection: string;
70
+ /**
71
+ * Array of measure objects with `name` and `unit` displayed in the title.
72
+ * Passed as a JSON string. If all units are the same, redundant units are
73
+ * reduced and names concatenated. If empty, the measure row is omitted.
74
+ *
75
+ * @example
76
+ * <bn-layout-card title-measures='[{"name":"Revenue","unit":"mEUR"}]'></bn-layout-card>
77
+ */
14
78
  titleMeasures?: string;
79
+ /**
80
+ * Start date displayed in the title date row.
81
+ * Accepts `yyyy-MM-dd` (e.g. `2024-01-01`) or ISO 8601 datetime
82
+ * (e.g. `2024-01-01T14:30:00Z`).
83
+ */
15
84
  titleDateStart?: string;
85
+ /**
86
+ * End date displayed in the title date row.
87
+ * Accepts `yyyy-MM-dd` (e.g. `2024-12-31`) or ISO 8601 datetime
88
+ * (e.g. `2024-12-31T23:59:59Z`).
89
+ */
16
90
  titleDateEnd?: string;
91
+ /**
92
+ * Date display format used in the title row.
93
+ * <br /><br />
94
+ * values:<br />
95
+ * ```year // quarter // month // week // day // time // auto // none```
96
+ * <br /><br />
97
+ * `year`: YYYY, `quarter`: Q[Q] YYYY, `month`: MMM YYYY,
98
+ * `week`: [KW]WW YYYY, `day`: DD.MM.YYYY, `time`: DD.MM.YYYY HH:mm:ss,
99
+ * `auto`: automatic detection, `none`: DD.MM.YYYY.
100
+ */
17
101
  titleDateFormat: string;
102
+ /**
103
+ * Format in which the start and end dates are linked in the title.
104
+ * If set to `none` a plain date is shown.
105
+ * <br /><br />
106
+ * values:<br />
107
+ * ```avg // interval // cum // start // end // ytd // ytg // mat // none```
108
+ * <br /><br />
109
+ * `avg`: Ø[DATE], `interval`: [DATE]..[DATE2], `start`: .[DATE],
110
+ * `end`: [DATE]., `ytd`: _[DATE], `ytg`: [DATE]_, `cum`: [DATE]_[DATE2],
111
+ * `mat`: ~[DATE], `none`: [DATE].
112
+ */
18
113
  titleDateLink: string;
114
+ /**
115
+ * Namespace used for title translations via the internationalization store.
116
+ */
19
117
  titleNamespace: string;
118
+ /**
119
+ * Text displayed in the card footer. If empty, the footer text is omitted.
120
+ */
20
121
  footerText?: string;
122
+ /**
123
+ * Layout mode that controls how child components are arranged inside
124
+ * the card body using CSS Grid.
125
+ * <br /><br />
126
+ * values:<br />
127
+ * ```full // split-vertical // split-horizontal // 2x2 // 3x3 // 4x4 // 1-over-2 // 1-over-3 // 2-over-1 // 3-over-1 // custom-template```
128
+ * <br /><br />
129
+ * `full`: single slot. `split-vertical`: two side-by-side slots.
130
+ * `split-horizontal`: two stacked slots. `NxN`: equal grid.
131
+ * `1-over-2`: one full-width slot on top, two below. `custom-template`:
132
+ * uses the `cardCustomTemplate` CSS grid-template-areas string.
133
+ *
134
+ * @example
135
+ * <bn-layout-card card-layout="split-horizontal"></bn-layout-card>
136
+ */
21
137
  cardLayout: "full" | "split-vertical" | "split-horizontal" | "2x2" | "3x3" | "4x4" | "1-over-2" | "1-over-3" | "2-over-1" | "3-over-1" | "custom-template";
138
+ /**
139
+ * CSS `grid-template-areas` string used when `cardLayout` is set to
140
+ * `custom-template`. Each quoted row defines a grid row; letters map to
141
+ * slot indices in order of first appearance.
142
+ *
143
+ * @example
144
+ * <bn-layout-card card-layout="custom-template"
145
+ * card-custom-template='"a a" "b c"'></bn-layout-card>
146
+ */
22
147
  cardCustomTemplate: string;
148
+ /**
149
+ * Gap between grid cells in pixels.
150
+ */
23
151
  cardGridGap: string;
152
+ /**
153
+ * When `true`, the card shrinks to fit its content (`fit-content`)
154
+ * for both width and height. When `false`, the card stretches to
155
+ * fill its parent (`100%`).
156
+ */
24
157
  cardFitToContent: boolean;
158
+ /**
159
+ * Whether to display a visible border around the card.
160
+ */
25
161
  cardShowBorder: boolean;
26
162
  private templateMap;
27
163
  private getCommonStyles;
164
+ private calculatePercentages;
165
+ private getGridTemplateColumns;
166
+ private getGridTemplateRows;
28
167
  private getLayoutStyle;
29
168
  private createDivAreaStyles;
30
169
  private getSlots;