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

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 (108) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-0d41c5d8.entry.js +1 -0
  3. package/dist/bn-template-engine/p-67538176.entry.js +1 -0
  4. package/dist/bn-template-engine/p-825a07a8.entry.js +1 -0
  5. package/dist/bn-template-engine/p-916296a5.entry.js +1 -0
  6. package/dist/bn-template-engine/{p-1164c0b0.entry.js → p-96006b06.entry.js} +1 -1
  7. package/dist/bn-template-engine/p-B4JfKvVT.js +1 -0
  8. package/dist/bn-template-engine/{p-JNHhIe7t.js → p-B_d-jp99.js} +1 -1
  9. package/dist/bn-template-engine/p-Ck-NYtot.js +1 -0
  10. package/dist/bn-template-engine/p-CnDq0oVa.js +1 -0
  11. package/dist/bn-template-engine/p-DSXNgKLa.js +1 -0
  12. package/dist/bn-template-engine/p-bc711fb0.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} +21948 -6938
  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 +6 -9
  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 +65 -13
  33. package/dist/collection/components/bn-chart-time/bn-chart-time.js +63 -11
  34. package/dist/collection/components/bn-layout-card/bn-layout-card.js +43 -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 +83 -19
  37. package/dist/collection/components/bn-table/ibcs-table.js +68 -3
  38. package/dist/collection/utils/withInheritedProps.js +152 -0
  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/ibcs-table2.js +1 -1
  45. package/dist/components/withInheritedProps.js +1 -0
  46. package/dist/esm/{SVGVariancesStyleGroup-DOIT-zvI.js → bn-asset_20.entry.js} +22048 -7042
  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 +4 -7
  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 +2 -0
  63. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +2 -0
  64. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +16 -2
  65. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +8 -3
  66. package/dist/types/components/bn-table/bn-table.d.ts +1 -0
  67. package/dist/types/components/bn-table/ibcs-table.d.ts +19 -0
  68. package/dist/types/components.d.ts +8 -8
  69. package/dist/types/utils/withInheritedProps.d.ts +38 -0
  70. package/package.json +1 -1
  71. package/dist/bn-template-engine/p-06946f44.entry.js +0 -1
  72. package/dist/bn-template-engine/p-0fabe296.entry.js +0 -1
  73. package/dist/bn-template-engine/p-355abdf0.entry.js +0 -1
  74. package/dist/bn-template-engine/p-79KuA4Ox.js +0 -1
  75. package/dist/bn-template-engine/p-859cc06d.entry.js +0 -1
  76. package/dist/bn-template-engine/p-8acec99e.entry.js +0 -1
  77. package/dist/bn-template-engine/p-8f490c45.entry.js +0 -1
  78. package/dist/bn-template-engine/p-98cf512f.entry.js +0 -1
  79. package/dist/bn-template-engine/p-9a564f8f.entry.js +0 -1
  80. package/dist/bn-template-engine/p-B7p8beYH.js +0 -1
  81. package/dist/bn-template-engine/p-BDh7GfC5.js +0 -1
  82. package/dist/bn-template-engine/p-BoMtoHJB.js +0 -1
  83. package/dist/bn-template-engine/p-Bs8BqBsb.js +0 -1
  84. package/dist/bn-template-engine/p-CYjZRKdI.js +0 -1
  85. package/dist/bn-template-engine/p-DG-1MR_T.js +0 -1
  86. package/dist/bn-template-engine/p-bdd2b243.entry.js +0 -1
  87. package/dist/bn-template-engine/p-e6b24f15.entry.js +0 -1
  88. package/dist/bn-template-engine/p-f27995c9.entry.js +0 -1
  89. package/dist/bn-template-engine/p-sRO-lj7X.js +0 -1
  90. package/dist/bn-template-engine/p-tzFCK9qn.js +0 -1
  91. package/dist/cjs/bn-asset_16.cjs.entry.js +0 -9018
  92. package/dist/cjs/bn-card.cjs.entry.js +0 -36
  93. package/dist/cjs/bn-chart-time.cjs.entry.js +0 -995
  94. package/dist/cjs/bn-layout-card.cjs.entry.js +0 -248
  95. package/dist/cjs/formatter-4XCS0d2B.js +0 -221
  96. package/dist/cjs/ibcs-chart-time.cjs.entry.js +0 -4137
  97. package/dist/cjs/withComponentStatus-_x4LQZ0N.js +0 -109
  98. package/dist/cjs/withComponentStyle-ClSJfCku.js +0 -128
  99. package/dist/cjs/withStyled-9tG024gQ.js +0 -522
  100. package/dist/esm/bn-asset_16.entry.js +0 -9001
  101. package/dist/esm/bn-card.entry.js +0 -34
  102. package/dist/esm/bn-chart-time.entry.js +0 -993
  103. package/dist/esm/bn-layout-card.entry.js +0 -246
  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/withStyled-CE3_3taP.js +0 -495
@@ -1,107 +0,0 @@
1
- import { g as generateUUID, r as runIfExisits } from './withHasError-B3QX2emi.js';
2
-
3
- /** Lifecycle state of a tracked component instance. */
4
- var ComponentStatus;
5
- (function (ComponentStatus) {
6
- ComponentStatus[ComponentStatus["RUNNING"] = 0] = "RUNNING";
7
- ComponentStatus[ComponentStatus["SUCCESSFUL"] = 1] = "SUCCESSFUL";
8
- ComponentStatus[ComponentStatus["ERROR"] = 2] = "ERROR";
9
- })(ComponentStatus || (ComponentStatus = {}));
10
- /**
11
- * Singleton registry that tracks the render status of all bn-* component instances.
12
- *
13
- * Each component registers itself via {@link withComponentStatus} and reports
14
- * `RUNNING` / `SUCCESSFUL` / `ERROR` transitions. After 500 ms of inactivity
15
- * (no status updates), the aggregate result is written to
16
- * `window.componentRegisterIsRenderedResult` as a boolean. External tools
17
- * (e.g. headless screenshot renderers) poll this value to detect when
18
- * the entire page has finished rendering.
19
- *
20
- * The 500 ms debounce prevents premature "rendered" signals during rapid
21
- * successive re-renders.
22
- *
23
- * Status counts are maintained incrementally — `updateStatus` adjusts running
24
- * counters instead of iterating all entries, making it O(1) per update.
25
- */
26
- var ComponentRegister;
27
- (function (ComponentRegister) {
28
- let currentTimeOutId = undefined;
29
- const componentRegister = new Map();
30
- const statusCounts = { running: 0, successful: 0, error: 0 };
31
- const countKey = (status) => {
32
- switch (status) {
33
- case ComponentStatus.RUNNING:
34
- return "running";
35
- case ComponentStatus.SUCCESSFUL:
36
- return "successful";
37
- default:
38
- return "error";
39
- }
40
- };
41
- /**
42
- * Records a status change for the component identified by `uuid` and
43
- * resets the 500 ms debounce timer. When the timer fires, the aggregate
44
- * "all rendered" boolean is published to `window.componentRegisterIsRenderedResult`.
45
- */
46
- ComponentRegister.updateStatus = (uuid, status) => {
47
- if (currentTimeOutId) {
48
- clearTimeout(currentTimeOutId);
49
- }
50
- const prev = componentRegister.get(uuid);
51
- if (prev !== undefined) {
52
- statusCounts[countKey(prev)]--;
53
- }
54
- statusCounts[countKey(status)]++;
55
- componentRegister.set(uuid, status);
56
- currentTimeOutId = setTimeout(() => {
57
- // @ts-ignore
58
- window.componentRegisterIsRenderedResult = ComponentRegister.componentRegisterIsRendered();
59
- // @ts-ignore
60
- // eslint-disable-next-line no-console
61
- console.log("componentRegisterIsRendered:", window.componentRegisterIsRenderedResult);
62
- }, 500);
63
- };
64
- /** Returns `true` when no components are currently in `RUNNING` state. */
65
- ComponentRegister.componentRegisterIsRendered = () => {
66
- return statusCounts.running === 0;
67
- };
68
- /** Returns a summary count of components in each status category. */
69
- ComponentRegister.componentRegisterStatus = () => {
70
- return Object.assign({}, statusCounts);
71
- };
72
- })(ComponentRegister || (ComponentRegister = {}));
73
-
74
- /**
75
- * Mixin that tracks a component's render lifecycle in the global {@link ComponentRegister}.
76
- *
77
- * Assigns a stable UUID to the component instance and reports status transitions:
78
- * - `RUNNING` on `connectedCallback` and `componentWillRender`
79
- * - `SUCCESSFUL` on `componentDidRender`
80
- *
81
- * External tools (e.g. screenshot/PDF renderers) poll
82
- * `window.componentRegisterIsRenderedResult` to determine when all components
83
- * have finished rendering.
84
- *
85
- * @param component - The Stencil component instance
86
- */
87
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
- const withComponentStatus = (component) => {
89
- const uuid = generateUUID();
90
- const connectedCallback = component["connectedCallback"];
91
- component["connectedCallback"] = () => {
92
- ComponentRegister.updateStatus(uuid, ComponentStatus.RUNNING);
93
- runIfExisits(connectedCallback, component);
94
- };
95
- const componentWillRender = component["componentWillRender"];
96
- component["componentWillRender"] = () => {
97
- ComponentRegister.updateStatus(uuid, ComponentStatus.RUNNING);
98
- runIfExisits(componentWillRender, component);
99
- };
100
- const componentDidRender = component["componentDidRender"];
101
- component["componentDidRender"] = () => {
102
- ComponentRegister.updateStatus(uuid, ComponentStatus.SUCCESSFUL);
103
- runIfExisits(componentDidRender, component);
104
- };
105
- };
106
-
107
- export { withComponentStatus as w };
@@ -1,126 +0,0 @@
1
- import { g as getElement, f as forceUpdate } from './index-JNHhIe7t.js';
2
- import { a as getStores, c as clearStoresCache } from './context-protocol-2peaD4y8.js';
3
- import { r as runIfExisits } from './withHasError-B3QX2emi.js';
4
-
5
- const isObject = (obj) => {
6
- if (typeof obj === 'object' && obj !== null) {
7
- if (typeof Object.getPrototypeOf === 'function') {
8
- const prototype = Object.getPrototypeOf(obj);
9
- return prototype === Object.prototype || prototype === null;
10
- }
11
- return Object.prototype.toString.call(obj) === '[object Object]';
12
- }
13
- return false;
14
- };
15
- const overwriteMerge = (_, currArr) => currArr;
16
- const combineMerge = (prevArr, currArr) => {
17
- return [...new Set([...prevArr, ...currArr])];
18
- };
19
- const getMergeFn = (type) => {
20
- switch (type) {
21
- case 'overwrite':
22
- return overwriteMerge;
23
- case 'combine':
24
- default:
25
- return combineMerge;
26
- }
27
- };
28
-
29
- const withDefaultOptions = (options) => {
30
- return {
31
- arrayMergeType: 'combine',
32
- arrayMerge: getMergeFn(options ? options.arrayMergeType : 'combine'),
33
- ...options,
34
- };
35
- };
36
- const merge = (objects, options) => {
37
- const opts = withDefaultOptions(options);
38
- return objects.reduce((prev, curr) => {
39
- Object.keys(curr).forEach((key) => {
40
- if (Array.isArray(prev[key]) && Array.isArray(curr[key])) {
41
- if (opts && opts.arrayMerge) {
42
- prev[key] = opts.arrayMerge(prev[key], curr[key]);
43
- }
44
- }
45
- else if (isObject(prev[key]) && isObject(curr[key])) {
46
- prev[key] = merge([prev[key], curr[key]], opts);
47
- }
48
- else {
49
- prev[key] = curr[key];
50
- }
51
- });
52
- return prev;
53
- }, {});
54
- };
55
-
56
- /**
57
- * Mixin that provides themed styling to a Stencil component using a
58
- * three-layer merge strategy.
59
- *
60
- * The effective style is computed by deep-merging three layers in order:
61
- * 1. `_system` -- built-in defaults (lowest priority)
62
- * 2. `_default` -- user-defined global overrides
63
- * 3. The value of the host element's `selected-style` attribute (highest priority)
64
- *
65
- * A MutationObserver watches `selected-style` and the store subscription
66
- * reacts to updates in the componentStyles store, triggering a re-merge
67
- * and forced re-render on changes.
68
- *
69
- * @param component - The Stencil component instance
70
- * @returns A query function `componentStyle(<selector>)` that provides type-safe
71
- * access to the merged style object, e.g. `componentStyle(s => s.table.headerBg)`
72
- */
73
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
74
- const withComponentStyle = (component) => {
75
- let subscription;
76
- let stores;
77
- let selectedStyle;
78
- let style;
79
- const updateStyle = () => {
80
- const state = stores.componentStyles.state;
81
- style = merge([
82
- state["_system"] || {},
83
- state["_default"] || {},
84
- state[selectedStyle] || {},
85
- ]);
86
- };
87
- const observer = new MutationObserver((mutations) => {
88
- mutations.forEach((mutation) => {
89
- if (mutation.attributeName === "selected-style") {
90
- selectedStyle = getElement(component).getAttribute("selected-style");
91
- updateStyle();
92
- forceUpdate(component);
93
- }
94
- });
95
- });
96
- const connectedCallback = component["connectedCallback"];
97
- component["connectedCallback"] = () => {
98
- const element = getElement(component);
99
- stores = getStores(element);
100
- style = stores.componentStyles.state["_system"];
101
- observer.observe(element, { attributes: true, attributeFilter: ["selected-style"] });
102
- selectedStyle = getElement(component).getAttribute("selected-style");
103
- updateStyle();
104
- subscription = stores.componentStyles.on("set", (key) => {
105
- if (key === selectedStyle) {
106
- selectedStyle = getElement(component).getAttribute("selected-style");
107
- updateStyle();
108
- forceUpdate(getElement(component));
109
- }
110
- });
111
- runIfExisits(connectedCallback, component);
112
- };
113
- const disconnectedCallback = component["disconnectedCallback"];
114
- component["disconnectedCallback"] = () => {
115
- observer.disconnect();
116
- runIfExisits(subscription);
117
- clearStoresCache(getElement(component));
118
- runIfExisits(disconnectedCallback, component);
119
- };
120
- const componentStyle = (q) => {
121
- return q(style);
122
- };
123
- return componentStyle;
124
- };
125
-
126
- export { withComponentStyle as w };