@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,109 +0,0 @@
1
- 'use strict';
2
-
3
- var withHasError = require('./withHasError-B8gHkfV2.js');
4
-
5
- /** Lifecycle state of a tracked component instance. */
6
- var ComponentStatus;
7
- (function (ComponentStatus) {
8
- ComponentStatus[ComponentStatus["RUNNING"] = 0] = "RUNNING";
9
- ComponentStatus[ComponentStatus["SUCCESSFUL"] = 1] = "SUCCESSFUL";
10
- ComponentStatus[ComponentStatus["ERROR"] = 2] = "ERROR";
11
- })(ComponentStatus || (ComponentStatus = {}));
12
- /**
13
- * Singleton registry that tracks the render status of all bn-* component instances.
14
- *
15
- * Each component registers itself via {@link withComponentStatus} and reports
16
- * `RUNNING` / `SUCCESSFUL` / `ERROR` transitions. After 500 ms of inactivity
17
- * (no status updates), the aggregate result is written to
18
- * `window.componentRegisterIsRenderedResult` as a boolean. External tools
19
- * (e.g. headless screenshot renderers) poll this value to detect when
20
- * the entire page has finished rendering.
21
- *
22
- * The 500 ms debounce prevents premature "rendered" signals during rapid
23
- * successive re-renders.
24
- *
25
- * Status counts are maintained incrementally — `updateStatus` adjusts running
26
- * counters instead of iterating all entries, making it O(1) per update.
27
- */
28
- var ComponentRegister;
29
- (function (ComponentRegister) {
30
- let currentTimeOutId = undefined;
31
- const componentRegister = new Map();
32
- const statusCounts = { running: 0, successful: 0, error: 0 };
33
- const countKey = (status) => {
34
- switch (status) {
35
- case ComponentStatus.RUNNING:
36
- return "running";
37
- case ComponentStatus.SUCCESSFUL:
38
- return "successful";
39
- default:
40
- return "error";
41
- }
42
- };
43
- /**
44
- * Records a status change for the component identified by `uuid` and
45
- * resets the 500 ms debounce timer. When the timer fires, the aggregate
46
- * "all rendered" boolean is published to `window.componentRegisterIsRenderedResult`.
47
- */
48
- ComponentRegister.updateStatus = (uuid, status) => {
49
- if (currentTimeOutId) {
50
- clearTimeout(currentTimeOutId);
51
- }
52
- const prev = componentRegister.get(uuid);
53
- if (prev !== undefined) {
54
- statusCounts[countKey(prev)]--;
55
- }
56
- statusCounts[countKey(status)]++;
57
- componentRegister.set(uuid, status);
58
- currentTimeOutId = setTimeout(() => {
59
- // @ts-ignore
60
- window.componentRegisterIsRenderedResult = ComponentRegister.componentRegisterIsRendered();
61
- // @ts-ignore
62
- // eslint-disable-next-line no-console
63
- console.log("componentRegisterIsRendered:", window.componentRegisterIsRenderedResult);
64
- }, 500);
65
- };
66
- /** Returns `true` when no components are currently in `RUNNING` state. */
67
- ComponentRegister.componentRegisterIsRendered = () => {
68
- return statusCounts.running === 0;
69
- };
70
- /** Returns a summary count of components in each status category. */
71
- ComponentRegister.componentRegisterStatus = () => {
72
- return Object.assign({}, statusCounts);
73
- };
74
- })(ComponentRegister || (ComponentRegister = {}));
75
-
76
- /**
77
- * Mixin that tracks a component's render lifecycle in the global {@link ComponentRegister}.
78
- *
79
- * Assigns a stable UUID to the component instance and reports status transitions:
80
- * - `RUNNING` on `connectedCallback` and `componentWillRender`
81
- * - `SUCCESSFUL` on `componentDidRender`
82
- *
83
- * External tools (e.g. screenshot/PDF renderers) poll
84
- * `window.componentRegisterIsRenderedResult` to determine when all components
85
- * have finished rendering.
86
- *
87
- * @param component - The Stencil component instance
88
- */
89
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
- const withComponentStatus = (component) => {
91
- const uuid = withHasError.generateUUID();
92
- const connectedCallback = component["connectedCallback"];
93
- component["connectedCallback"] = () => {
94
- ComponentRegister.updateStatus(uuid, ComponentStatus.RUNNING);
95
- withHasError.runIfExisits(connectedCallback, component);
96
- };
97
- const componentWillRender = component["componentWillRender"];
98
- component["componentWillRender"] = () => {
99
- ComponentRegister.updateStatus(uuid, ComponentStatus.RUNNING);
100
- withHasError.runIfExisits(componentWillRender, component);
101
- };
102
- const componentDidRender = component["componentDidRender"];
103
- component["componentDidRender"] = () => {
104
- ComponentRegister.updateStatus(uuid, ComponentStatus.SUCCESSFUL);
105
- withHasError.runIfExisits(componentDidRender, component);
106
- };
107
- };
108
-
109
- exports.withComponentStatus = withComponentStatus;
@@ -1,128 +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
-
7
- const isObject = (obj) => {
8
- if (typeof obj === 'object' && obj !== null) {
9
- if (typeof Object.getPrototypeOf === 'function') {
10
- const prototype = Object.getPrototypeOf(obj);
11
- return prototype === Object.prototype || prototype === null;
12
- }
13
- return Object.prototype.toString.call(obj) === '[object Object]';
14
- }
15
- return false;
16
- };
17
- const overwriteMerge = (_, currArr) => currArr;
18
- const combineMerge = (prevArr, currArr) => {
19
- return [...new Set([...prevArr, ...currArr])];
20
- };
21
- const getMergeFn = (type) => {
22
- switch (type) {
23
- case 'overwrite':
24
- return overwriteMerge;
25
- case 'combine':
26
- default:
27
- return combineMerge;
28
- }
29
- };
30
-
31
- const withDefaultOptions = (options) => {
32
- return {
33
- arrayMergeType: 'combine',
34
- arrayMerge: getMergeFn(options ? options.arrayMergeType : 'combine'),
35
- ...options,
36
- };
37
- };
38
- const merge = (objects, options) => {
39
- const opts = withDefaultOptions(options);
40
- return objects.reduce((prev, curr) => {
41
- Object.keys(curr).forEach((key) => {
42
- if (Array.isArray(prev[key]) && Array.isArray(curr[key])) {
43
- if (opts && opts.arrayMerge) {
44
- prev[key] = opts.arrayMerge(prev[key], curr[key]);
45
- }
46
- }
47
- else if (isObject(prev[key]) && isObject(curr[key])) {
48
- prev[key] = merge([prev[key], curr[key]], opts);
49
- }
50
- else {
51
- prev[key] = curr[key];
52
- }
53
- });
54
- return prev;
55
- }, {});
56
- };
57
-
58
- /**
59
- * Mixin that provides themed styling to a Stencil component using a
60
- * three-layer merge strategy.
61
- *
62
- * The effective style is computed by deep-merging three layers in order:
63
- * 1. `_system` -- built-in defaults (lowest priority)
64
- * 2. `_default` -- user-defined global overrides
65
- * 3. The value of the host element's `selected-style` attribute (highest priority)
66
- *
67
- * A MutationObserver watches `selected-style` and the store subscription
68
- * reacts to updates in the componentStyles store, triggering a re-merge
69
- * and forced re-render on changes.
70
- *
71
- * @param component - The Stencil component instance
72
- * @returns A query function `componentStyle(<selector>)` that provides type-safe
73
- * access to the merged style object, e.g. `componentStyle(s => s.table.headerBg)`
74
- */
75
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
- const withComponentStyle = (component) => {
77
- let subscription;
78
- let stores;
79
- let selectedStyle;
80
- let style;
81
- const updateStyle = () => {
82
- const state = stores.componentStyles.state;
83
- style = merge([
84
- state["_system"] || {},
85
- state["_default"] || {},
86
- state[selectedStyle] || {},
87
- ]);
88
- };
89
- const observer = new MutationObserver((mutations) => {
90
- mutations.forEach((mutation) => {
91
- if (mutation.attributeName === "selected-style") {
92
- selectedStyle = index.getElement(component).getAttribute("selected-style");
93
- updateStyle();
94
- index.forceUpdate(component);
95
- }
96
- });
97
- });
98
- const connectedCallback = component["connectedCallback"];
99
- component["connectedCallback"] = () => {
100
- const element = index.getElement(component);
101
- stores = contextProtocol.getStores(element);
102
- style = stores.componentStyles.state["_system"];
103
- observer.observe(element, { attributes: true, attributeFilter: ["selected-style"] });
104
- selectedStyle = index.getElement(component).getAttribute("selected-style");
105
- updateStyle();
106
- subscription = stores.componentStyles.on("set", (key) => {
107
- if (key === selectedStyle) {
108
- selectedStyle = index.getElement(component).getAttribute("selected-style");
109
- updateStyle();
110
- index.forceUpdate(index.getElement(component));
111
- }
112
- });
113
- withHasError.runIfExisits(connectedCallback, component);
114
- };
115
- const disconnectedCallback = component["disconnectedCallback"];
116
- component["disconnectedCallback"] = () => {
117
- observer.disconnect();
118
- withHasError.runIfExisits(subscription);
119
- contextProtocol.clearStoresCache(index.getElement(component));
120
- withHasError.runIfExisits(disconnectedCallback, component);
121
- };
122
- const componentStyle = (q) => {
123
- return q(style);
124
- };
125
- return componentStyle;
126
- };
127
-
128
- exports.withComponentStyle = withComponentStyle;