@siliconst/metaui 1.0.0 → 1.2.0

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 (189) hide show
  1. package/README.md +134 -123
  2. package/package.json +22 -34
  3. package/src/nz/co/siliconst/ui5/metaui/.library +7 -7
  4. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js +300 -0
  5. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js.map +1 -0
  6. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts +130 -0
  7. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts.map +1 -0
  8. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js +2 -0
  9. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js.map +1 -0
  10. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.ts +292 -162
  11. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js +52 -0
  12. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js.map +1 -0
  13. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts +29 -0
  14. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts.map +1 -0
  15. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js +2 -0
  16. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js.map +1 -0
  17. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.ts +49 -40
  18. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +82 -0
  19. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -0
  20. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +17 -0
  21. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -0
  22. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +2 -0
  23. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -0
  24. package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +82 -56
  25. package/src/nz/co/siliconst/ui5/metaui/core/EventBus-dbg.js +66 -0
  26. package/src/nz/co/siliconst/ui5/metaui/core/EventBus-dbg.js.map +1 -0
  27. package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts +40 -0
  28. package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts.map +1 -0
  29. package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js +2 -0
  30. package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js.map +1 -0
  31. package/src/nz/co/siliconst/ui5/metaui/core/EventBus.ts +60 -45
  32. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +73 -0
  33. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -0
  34. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts +39 -0
  35. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -0
  36. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +2 -0
  37. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -0
  38. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts +71 -56
  39. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +146 -0
  40. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -0
  41. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +25 -0
  42. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -0
  43. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +2 -0
  44. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -0
  45. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts +157 -31
  46. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js +56 -0
  47. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -0
  48. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts +37 -0
  49. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts.map +1 -0
  50. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js +2 -0
  51. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -0
  52. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +56 -56
  53. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js +2 -0
  54. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js.map +1 -0
  55. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.d.ts +29 -0
  56. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.d.ts.map +1 -0
  57. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.js +2 -0
  58. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.js.map +1 -0
  59. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.ts +29 -29
  60. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js +2 -0
  61. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js.map +1 -0
  62. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts +20 -0
  63. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts.map +1 -0
  64. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.js +2 -0
  65. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.js.map +1 -0
  66. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.ts +21 -26
  67. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js +2 -0
  68. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -0
  69. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +15 -0
  70. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -0
  71. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.js +2 -0
  72. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.js.map +1 -0
  73. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +14 -33
  74. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js +2 -0
  75. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -0
  76. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +58 -0
  77. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -0
  78. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.js +2 -0
  79. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.js.map +1 -0
  80. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +70 -70
  81. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js +24 -0
  82. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js.map +1 -0
  83. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts +15 -0
  84. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts.map +1 -0
  85. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js +2 -0
  86. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js.map +1 -0
  87. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.ts +22 -34
  88. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +99 -0
  89. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -0
  90. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts +20 -0
  91. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -0
  92. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +2 -0
  93. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -0
  94. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +97 -60
  95. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +103 -0
  96. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -0
  97. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts +16 -0
  98. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -0
  99. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +2 -0
  100. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -0
  101. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +119 -102
  102. package/src/nz/co/siliconst/ui5/metaui/library-dbg.js +44 -0
  103. package/src/nz/co/siliconst/ui5/metaui/library-dbg.js.map +1 -0
  104. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +39 -0
  105. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -0
  106. package/src/nz/co/siliconst/ui5/metaui/library.d.ts +10 -0
  107. package/src/nz/co/siliconst/ui5/metaui/library.d.ts.map +1 -0
  108. package/src/nz/co/siliconst/ui5/metaui/library.js +2 -0
  109. package/src/nz/co/siliconst/ui5/metaui/library.js.map +1 -0
  110. package/src/nz/co/siliconst/ui5/metaui/library.ts +55 -43
  111. package/src/nz/co/siliconst/ui5/metaui/manifest.json +35 -0
  112. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin-dbg.js +68 -0
  113. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin-dbg.js.map +1 -0
  114. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.d.ts +15 -0
  115. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.d.ts.map +1 -0
  116. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.js +2 -0
  117. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.js.map +1 -0
  118. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.ts +71 -0
  119. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js +55 -0
  120. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js.map +1 -0
  121. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts +24 -0
  122. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts.map +1 -0
  123. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js +2 -0
  124. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js.map +1 -0
  125. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.ts +56 -58
  126. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js +42 -0
  127. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js.map +1 -0
  128. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts +18 -0
  129. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts.map +1 -0
  130. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js +2 -0
  131. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js.map +1 -0
  132. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.ts +41 -42
  133. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js +69 -0
  134. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js.map +1 -0
  135. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts +18 -0
  136. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts.map +1 -0
  137. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js +2 -0
  138. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js.map +1 -0
  139. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.ts +69 -63
  140. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin-dbg.js +68 -0
  141. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin-dbg.js.map +1 -0
  142. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.d.ts +18 -0
  143. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.d.ts.map +1 -0
  144. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.js +2 -0
  145. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.js.map +1 -0
  146. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.ts +68 -0
  147. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js +67 -0
  148. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js.map +1 -0
  149. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts +18 -0
  150. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts.map +1 -0
  151. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js +2 -0
  152. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js.map +1 -0
  153. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.ts +65 -65
  154. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js +56 -0
  155. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js.map +1 -0
  156. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts +18 -0
  157. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts.map +1 -0
  158. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js +2 -0
  159. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js.map +1 -0
  160. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.ts +56 -55
  161. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js +57 -0
  162. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js.map +1 -0
  163. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts +18 -0
  164. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts.map +1 -0
  165. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js +2 -0
  166. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js.map +1 -0
  167. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.ts +58 -55
  168. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin-dbg.js +43 -0
  169. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin-dbg.js.map +1 -0
  170. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.d.ts +18 -0
  171. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.d.ts.map +1 -0
  172. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.js +2 -0
  173. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.js.map +1 -0
  174. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.ts +42 -0
  175. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin-dbg.js +58 -0
  176. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin-dbg.js.map +1 -0
  177. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.d.ts +18 -0
  178. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.d.ts.map +1 -0
  179. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.js +2 -0
  180. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.js.map +1 -0
  181. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.ts +58 -0
  182. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin-dbg.js +74 -0
  183. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin-dbg.js.map +1 -0
  184. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.d.ts +18 -0
  185. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.d.ts.map +1 -0
  186. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.js +2 -0
  187. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.js.map +1 -0
  188. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.ts +71 -0
  189. package/ui5.yaml +4 -12
@@ -1,31 +1,157 @@
1
- /**
2
- * @file SchemaNormalizer.ts
3
- * @description Transforms and validates incoming JSON payloads into the strict ISchema matrix.
4
- */
5
-
6
- import { ISchema } from "../interfaces/ISchema";
7
-
8
- /**
9
- * Utility class ensuring data fidelity before layout construction begins.
10
- */
11
- export class SchemaNormalizer {
12
-
13
- /**
14
- * Validates that the provided raw payload conforms to the required ISchema structures.
15
- * @param rawSchema The heterogeneous JSON object provided to the Engine.
16
- * @returns The strictly cast ISchema matrix.
17
- * @throws Error if the mandatory schema properties are missing.
18
- */
19
- public static normalize(rawSchema: any): ISchema {
20
- if (!rawSchema || typeof rawSchema !== 'object') {
21
- throw new Error("[MetaUI] Invalid Schema Payload: Payload is not an object.");
22
- }
23
-
24
- if (!rawSchema.mode || !rawSchema.rootFields || !rawSchema.tables) {
25
- throw new Error("[MetaUI] Invalid Schema Payload: Missing required structures (mode, rootFields, tables).");
26
- }
27
-
28
- // Return the strongly typed and validated schema block.
29
- return rawSchema as ISchema;
30
- }
31
- }
1
+ /**
2
+ * @file SchemaNormalizer.ts
3
+ * @description Transforms and validates incoming JSON payloads into the strict v2 ISchema dictionary matrix.
4
+ */
5
+
6
+ import { ISchema, IPropertyMetadata, FieldType } from "../interfaces/ISchema";
7
+
8
+ export class SchemaNormalizer {
9
+
10
+ /**
11
+ * Validates that the provided raw payload conforms to the required ISchema structures.
12
+ */
13
+ public static normalize(rawSchema?: any, data?: any): ISchema {
14
+ let schemaObj = rawSchema;
15
+
16
+ if (typeof schemaObj === "string") {
17
+ try {
18
+ schemaObj = JSON.parse(schemaObj);
19
+ } catch (e) {
20
+ console.warn("[MetaUI] Failed to parse schema string, falling back to inference.", e);
21
+ schemaObj = null;
22
+ }
23
+ }
24
+
25
+ if (!schemaObj || typeof schemaObj !== 'object' || Array.isArray(schemaObj)) {
26
+ return this.inferSchemaFromData(data);
27
+ }
28
+
29
+ // It is an object. Ensure it conforms to v2 structure.
30
+ const normalized: ISchema = {
31
+ title: schemaObj.title || "MetaUI Generated Form",
32
+ type: schemaObj.type || (schemaObj.items ? "array" : "object"),
33
+ };
34
+
35
+ if (normalized.type === "object") {
36
+ normalized.properties = this.normalizeProperties(schemaObj.properties || {});
37
+ } else if (normalized.type === "array") {
38
+ normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: "object", properties: {} }, "items");
39
+ }
40
+
41
+ return normalized;
42
+ }
43
+
44
+ private static normalizeProperties(properties: any): Record<string, IPropertyMetadata> {
45
+ const normalizedProps: Record<string, IPropertyMetadata> = {};
46
+ for (const key of Object.keys(properties)) {
47
+ normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key);
48
+ }
49
+ return normalizedProps;
50
+ }
51
+
52
+ private static normalizePropertyMetadata(prop: any, keyName: string): IPropertyMetadata {
53
+ const normalized: IPropertyMetadata = {
54
+ type: prop.type || "string",
55
+ ui: {
56
+ label: prop.ui?.label || this.generateLabel(keyName),
57
+ isKey: !!prop.ui?.isKey,
58
+ readOnly: !!prop.ui?.readOnly,
59
+ widget: prop.ui?.widget,
60
+ group: prop.ui?.group,
61
+ visibleOn: prop.ui?.visibleOn,
62
+ enabledOn: prop.ui?.enabledOn,
63
+ format: prop.ui?.format
64
+ },
65
+ required: !!prop.required,
66
+ maxLength: prop.maxLength,
67
+ minimum: prop.minimum,
68
+ maximum: prop.maximum,
69
+ pattern: prop.pattern,
70
+ precision: prop.precision,
71
+ scale: prop.scale,
72
+ valueHelp: prop.valueHelp
73
+ };
74
+
75
+ if (normalized.type === "object" && prop.properties) {
76
+ normalized.properties = this.normalizeProperties(prop.properties);
77
+ } else if (normalized.type === "array" && prop.items) {
78
+ normalized.items = this.normalizePropertyMetadata(prop.items, "items");
79
+ }
80
+
81
+ return normalized;
82
+ }
83
+
84
+ /**
85
+ * Generates a Title Case label from camelCase or snake_case technical names.
86
+ */
87
+ private static generateLabel(name: string): string {
88
+ if (!name) return "";
89
+ let spaced = name.replace(/([A-Z])/g, " $1").replace(/_/g, " ");
90
+ return spaced.split(' ')
91
+ .filter(w => w.length > 0)
92
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
93
+ .join(' ')
94
+ .trim();
95
+ }
96
+
97
+ /**
98
+ * Infers a v2 ISchema structure dynamically from a plain data payload.
99
+ */
100
+ private static inferSchemaFromData(data: any): ISchema {
101
+ const schema: ISchema = { type: "object", properties: {} };
102
+
103
+ if (!data || typeof data !== "object") {
104
+ return schema;
105
+ }
106
+
107
+ if (Array.isArray(data)) {
108
+ schema.type = "array";
109
+ schema.items = {
110
+ type: "object",
111
+ properties: data.length > 0 ? this.inferPropertiesFromObject(data[0]) : {}
112
+ };
113
+ } else {
114
+ schema.type = "object";
115
+ schema.properties = this.inferPropertiesFromObject(data);
116
+ }
117
+
118
+ return schema;
119
+ }
120
+
121
+ private static inferPropertiesFromObject(obj: any): Record<string, IPropertyMetadata> {
122
+ const properties: Record<string, IPropertyMetadata> = {};
123
+ if (!obj || typeof obj !== "object") return properties;
124
+
125
+ for (const key of Object.keys(obj)) {
126
+ const val = obj[key];
127
+ if (val === null || val === undefined) continue;
128
+
129
+ if (typeof val === "object" && !Array.isArray(val)) continue;
130
+
131
+ let type: FieldType = "string";
132
+ let items: IPropertyMetadata | undefined;
133
+
134
+ if (typeof val === "number") type = "number";
135
+ else if (typeof val === "boolean") type = "boolean";
136
+ else if (Array.isArray(val)) {
137
+ type = "array";
138
+ items = {
139
+ type: "object",
140
+ properties: val.length > 0 ? this.inferPropertiesFromObject(val[0]) : {}
141
+ };
142
+ }
143
+
144
+ properties[key] = {
145
+ type,
146
+ items,
147
+ ui: {
148
+ label: this.generateLabel(key),
149
+ isKey: false,
150
+ readOnly: false
151
+ }
152
+ };
153
+ }
154
+
155
+ return properties;
156
+ }
157
+ }
@@ -0,0 +1,56 @@
1
+ sap.ui.define(["sap/ui/model/json/JSONModel"], function (JSONModel) {
2
+ "use strict";
3
+
4
+ /**
5
+ * Manages the isolated internal data payload for the MetaUI engine.
6
+ */
7
+ class StateManager {
8
+ /**
9
+ * Initializes the state manager with an optional initial payload.
10
+ * @param initialData The initial JSON payload to populate the fields.
11
+ */
12
+ constructor(initialData = {}) {
13
+ // Deep copy to ensure no reference leakage from the host application
14
+ const safeData = JSON.parse(JSON.stringify(initialData));
15
+ this.model = new JSONModel(safeData);
16
+ this.model.setDefaultBindingMode("TwoWay");
17
+ }
18
+
19
+ /**
20
+ * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.
21
+ * @returns The internal JSONModel.
22
+ */
23
+ getModel() {
24
+ return this.model;
25
+ }
26
+
27
+ /**
28
+ * Binds a generated UI control property to a path in the internal model.
29
+ * @param control The target UI5 Control.
30
+ * @param property The UI5 property name (e.g., 'value').
31
+ * @param bindingPath The exact path in the JSON payload.
32
+ */
33
+ bindControl(control, property, bindingPath) {
34
+ control.bindProperty(property, {
35
+ path: bindingPath,
36
+ model: "meta" // Assumes the model is bound to the root container with the name 'meta'
37
+ });
38
+ }
39
+
40
+ /**
41
+ * Extracts the flat JavaScript object representing the current state of the UI.
42
+ * @returns A serialized record of the data payload, free of UI5 wrappers.
43
+ */
44
+ extractPayload() {
45
+ // Create a deep copy to prevent accidental mutations by the host
46
+ const data = this.model.getData();
47
+ return JSON.parse(JSON.stringify(data));
48
+ }
49
+ }
50
+ var __exports = {
51
+ __esModule: true
52
+ };
53
+ __exports.StateManager = StateManager;
54
+ return __exports;
55
+ });
56
+ //# sourceMappingURL=StateManager-dbg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateManager-dbg.js","names":["StateManager","constructor","initialData","safeData","JSON","parse","stringify","model","JSONModel","setDefaultBindingMode","getModel","bindControl","control","property","bindingPath","bindProperty","path","extractPayload","data","getData","__exports","__esModule"],"sources":["StateManager.ts"],"sourcesContent":["/**\n * @file StateManager.ts\n * @description Isolated internal state management. Decouples the MetaUI engine from external host models.\n */\n\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport ManagedObject from \"sap/ui/base/ManagedObject\";\n\n/**\n * Manages the isolated internal data payload for the MetaUI engine.\n */\nexport class StateManager {\n private model: JSONModel;\n\n /**\n * Initializes the state manager with an optional initial payload.\n * @param initialData The initial JSON payload to populate the fields.\n */\n constructor(initialData: Record<string, any> = {}) {\n // Deep copy to ensure no reference leakage from the host application\n const safeData = JSON.parse(JSON.stringify(initialData));\n this.model = new JSONModel(safeData);\n this.model.setDefaultBindingMode(\"TwoWay\");\n }\n\n /**\n * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.\n * @returns The internal JSONModel.\n */\n public getModel(): JSONModel {\n return this.model;\n }\n\n /**\n * Binds a generated UI control property to a path in the internal model.\n * @param control The target UI5 Control.\n * @param property The UI5 property name (e.g., 'value').\n * @param bindingPath The exact path in the JSON payload.\n */\n public bindControl(control: ManagedObject, property: string, bindingPath: string): void {\n control.bindProperty(property, {\n path: bindingPath,\n model: \"meta\" // Assumes the model is bound to the root container with the name 'meta'\n });\n }\n\n /**\n * Extracts the flat JavaScript object representing the current state of the UI.\n * @returns A serialized record of the data payload, free of UI5 wrappers.\n */\n public extractPayload(): Record<string, any> {\n // Create a deep copy to prevent accidental mutations by the host\n const data = this.model.getData();\n return JSON.parse(JSON.stringify(data));\n }\n}\n"],"mappings":";;;EAQA;AACA;AACA;EACO,MAAMA,YAAY,CAAC;IAGtB;AACJ;AACA;AACA;IACIC,WAAWA,CAACC,WAAgC,GAAG,CAAC,CAAC,EAAE;MAC/C;MACA,MAAMC,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACJ,WAAW,CAAC,CAAC;MACxD,IAAI,CAACK,KAAK,GAAG,IAAIC,SAAS,CAACL,QAAQ,CAAC;MACpC,IAAI,CAACI,KAAK,CAACE,qBAAqB,CAAC,QAAQ,CAAC;IAC9C;;IAEA;AACJ;AACA;AACA;IACWC,QAAQA,CAAA,EAAc;MACzB,OAAO,IAAI,CAACH,KAAK;IACrB;;IAEA;AACJ;AACA;AACA;AACA;AACA;IACWI,WAAWA,CAACC,OAAsB,EAAEC,QAAgB,EAAEC,WAAmB,EAAQ;MACpFF,OAAO,CAACG,YAAY,CAACF,QAAQ,EAAE;QAC3BG,IAAI,EAAEF,WAAW;QACjBP,KAAK,EAAE,MAAM,CAAC;MAClB,CAAC,CAAC;IACN;;IAEA;AACJ;AACA;AACA;IACWU,cAAcA,CAAA,EAAwB;MACzC;MACA,MAAMC,IAAI,GAAG,IAAI,CAACX,KAAK,CAACY,OAAO,CAAC,CAAC;MACjC,OAAOf,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACY,IAAI,CAAC,CAAC;IAC3C;EACJ;EAAC,IAAAE,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAApB,YAAA,GAAAA,YAAA;EAAA,OAAAoB,SAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ declare module "nz/co/siliconst/ui5/metaui/core/StateManager" {
2
+ /**
3
+ * @file StateManager.ts
4
+ * @description Isolated internal state management. Decouples the MetaUI engine from external host models.
5
+ */
6
+ import JSONModel from "sap/ui/model/json/JSONModel";
7
+ import ManagedObject from "sap/ui/base/ManagedObject";
8
+ /**
9
+ * Manages the isolated internal data payload for the MetaUI engine.
10
+ */
11
+ export class StateManager {
12
+ private model;
13
+ /**
14
+ * Initializes the state manager with an optional initial payload.
15
+ * @param initialData The initial JSON payload to populate the fields.
16
+ */
17
+ constructor(initialData?: Record<string, any>);
18
+ /**
19
+ * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.
20
+ * @returns The internal JSONModel.
21
+ */
22
+ getModel(): JSONModel;
23
+ /**
24
+ * Binds a generated UI control property to a path in the internal model.
25
+ * @param control The target UI5 Control.
26
+ * @param property The UI5 property name (e.g., 'value').
27
+ * @param bindingPath The exact path in the JSON payload.
28
+ */
29
+ bindControl(control: ManagedObject, property: string, bindingPath: string): void;
30
+ /**
31
+ * Extracts the flat JavaScript object representing the current state of the UI.
32
+ * @returns A serialized record of the data payload, free of UI5 wrappers.
33
+ */
34
+ extractPayload(): Record<string, any>;
35
+ }
36
+ }
37
+ //# sourceMappingURL=StateManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateManager.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/StateManager.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,8CAA8C,CAAC;IAC9D;;;OAGG;IAEH,OAAO,SAAS,MAAM,6BAA6B,CAAC;IACpD,OAAO,aAAa,MAAM,2BAA2B,CAAC;IAEtD;;OAEG;IACH,MAAa,YAAY;QACrB,OAAO,CAAC,KAAK,CAAY;QAEzB;;;WAGG;oBACS,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM;QAOjD;;;WAGG;QACI,QAAQ,IAAI,SAAS;QAI5B;;;;;WAKG;QACI,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;QAOvF;;;WAGG;QACI,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;KAK/C;CAEA"}
@@ -0,0 +1,2 @@
1
+ sap.ui.define(["sap/ui/model/json/JSONModel"],function(e){"use strict";class t{constructor(t={}){const o=JSON.parse(JSON.stringify(t));this.model=new e(o);this.model.setDefaultBindingMode("TwoWay")}getModel(){return this.model}bindControl(e,t,o){e.bindProperty(t,{path:o,model:"meta"})}extractPayload(){const e=this.model.getData();return JSON.parse(JSON.stringify(e))}}var o={__esModule:true};o.StateManager=t;return o});
2
+ //# sourceMappingURL=StateManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateManager.js","names":["StateManager","constructor","initialData","safeData","JSON","parse","stringify","this","model","JSONModel","setDefaultBindingMode","getModel","bindControl","control","property","bindingPath","bindProperty","path","extractPayload","data","getData","__exports","__esModule"],"sources":["StateManager.ts"],"sourcesContent":["/**\n * @file StateManager.ts\n * @description Isolated internal state management. Decouples the MetaUI engine from external host models.\n */\n\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport ManagedObject from \"sap/ui/base/ManagedObject\";\n\n/**\n * Manages the isolated internal data payload for the MetaUI engine.\n */\nexport class StateManager {\n private model: JSONModel;\n\n /**\n * Initializes the state manager with an optional initial payload.\n * @param initialData The initial JSON payload to populate the fields.\n */\n constructor(initialData: Record<string, any> = {}) {\n // Deep copy to ensure no reference leakage from the host application\n const safeData = JSON.parse(JSON.stringify(initialData));\n this.model = new JSONModel(safeData);\n this.model.setDefaultBindingMode(\"TwoWay\");\n }\n\n /**\n * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.\n * @returns The internal JSONModel.\n */\n public getModel(): JSONModel {\n return this.model;\n }\n\n /**\n * Binds a generated UI control property to a path in the internal model.\n * @param control The target UI5 Control.\n * @param property The UI5 property name (e.g., 'value').\n * @param bindingPath The exact path in the JSON payload.\n */\n public bindControl(control: ManagedObject, property: string, bindingPath: string): void {\n control.bindProperty(property, {\n path: bindingPath,\n model: \"meta\" // Assumes the model is bound to the root container with the name 'meta'\n });\n }\n\n /**\n * Extracts the flat JavaScript object representing the current state of the UI.\n * @returns A serialized record of the data payload, free of UI5 wrappers.\n */\n public extractPayload(): Record<string, any> {\n // Create a deep copy to prevent accidental mutations by the host\n const data = this.model.getData();\n return JSON.parse(JSON.stringify(data));\n }\n}\n"],"mappings":"uEAWO,MAAMA,EAOTC,YAAYC,EAAmC,CAAC,GAE5C,MAAMC,EAAWC,KAAKC,MAAMD,KAAKE,UAAUJ,IAC3CK,KAAKC,MAAQ,IAAIC,EAAUN,GAC3BI,KAAKC,MAAME,sBAAsB,SACrC,CAMOC,WACH,OAAOJ,KAAKC,KAChB,CAQOI,YAAYC,EAAwBC,EAAkBC,GACzDF,EAAQG,aAAaF,EAAU,CAC3BG,KAAMF,EACNP,MAAO,QAEf,CAMOU,iBAEH,MAAMC,EAAOZ,KAAKC,MAAMY,UACxB,OAAOhB,KAAKC,MAAMD,KAAKE,UAAUa,GACrC,EACH,IAAAE,EAAA,CAAAC,WAAA,MAAAD,EAAArB,eAAA,OAAAqB,CAAA","ignoreList":[]}
@@ -1,56 +1,56 @@
1
- /**
2
- * @file StateManager.ts
3
- * @description Isolated internal state management. Decouples the MetaUI engine from external host models.
4
- */
5
-
6
- import JSONModel from "sap/ui/model/json/JSONModel";
7
- import ManagedObject from "sap/ui/base/ManagedObject";
8
-
9
- /**
10
- * Manages the isolated internal data payload for the MetaUI engine.
11
- */
12
- export class StateManager {
13
- private model: JSONModel;
14
-
15
- /**
16
- * Initializes the state manager with an optional initial payload.
17
- * @param initialData The initial JSON payload to populate the fields.
18
- */
19
- constructor(initialData: Record<string, any> = {}) {
20
- // Deep copy to ensure no reference leakage from the host application
21
- const safeData = JSON.parse(JSON.stringify(initialData));
22
- this.model = new JSONModel(safeData);
23
- this.model.setDefaultBindingMode("TwoWay");
24
- }
25
-
26
- /**
27
- * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.
28
- * @returns The internal JSONModel.
29
- */
30
- public getModel(): JSONModel {
31
- return this.model;
32
- }
33
-
34
- /**
35
- * Binds a generated UI control property to a path in the internal model.
36
- * @param control The target UI5 Control.
37
- * @param property The UI5 property name (e.g., 'value').
38
- * @param bindingPath The exact path in the JSON payload.
39
- */
40
- public bindControl(control: ManagedObject, property: string, bindingPath: string): void {
41
- control.bindProperty(property, {
42
- path: bindingPath,
43
- model: "meta" // Assumes the model is bound to the root container with the name 'meta'
44
- });
45
- }
46
-
47
- /**
48
- * Extracts the flat JavaScript object representing the current state of the UI.
49
- * @returns A serialized record of the data payload, free of UI5 wrappers.
50
- */
51
- public extractPayload(): Record<string, any> {
52
- // Create a deep copy to prevent accidental mutations by the host
53
- const data = this.model.getData();
54
- return JSON.parse(JSON.stringify(data));
55
- }
56
- }
1
+ /**
2
+ * @file StateManager.ts
3
+ * @description Isolated internal state management. Decouples the MetaUI engine from external host models.
4
+ */
5
+
6
+ import JSONModel from "sap/ui/model/json/JSONModel";
7
+ import ManagedObject from "sap/ui/base/ManagedObject";
8
+
9
+ /**
10
+ * Manages the isolated internal data payload for the MetaUI engine.
11
+ */
12
+ export class StateManager {
13
+ private model: JSONModel;
14
+
15
+ /**
16
+ * Initializes the state manager with an optional initial payload.
17
+ * @param initialData The initial JSON payload to populate the fields.
18
+ */
19
+ constructor(initialData: Record<string, any> = {}) {
20
+ // Deep copy to ensure no reference leakage from the host application
21
+ const safeData = JSON.parse(JSON.stringify(initialData));
22
+ this.model = new JSONModel(safeData);
23
+ this.model.setDefaultBindingMode("TwoWay");
24
+ }
25
+
26
+ /**
27
+ * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.
28
+ * @returns The internal JSONModel.
29
+ */
30
+ public getModel(): JSONModel {
31
+ return this.model;
32
+ }
33
+
34
+ /**
35
+ * Binds a generated UI control property to a path in the internal model.
36
+ * @param control The target UI5 Control.
37
+ * @param property The UI5 property name (e.g., 'value').
38
+ * @param bindingPath The exact path in the JSON payload.
39
+ */
40
+ public bindControl(control: ManagedObject, property: string, bindingPath: string): void {
41
+ control.bindProperty(property, {
42
+ path: bindingPath,
43
+ model: "meta" // Assumes the model is bound to the root container with the name 'meta'
44
+ });
45
+ }
46
+
47
+ /**
48
+ * Extracts the flat JavaScript object representing the current state of the UI.
49
+ * @returns A serialized record of the data payload, free of UI5 wrappers.
50
+ */
51
+ public extractPayload(): Record<string, any> {
52
+ // Create a deep copy to prevent accidental mutations by the host
53
+ const data = this.model.getData();
54
+ return JSON.parse(JSON.stringify(data));
55
+ }
56
+ }
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=IEventBus-dbg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEventBus-dbg.js","names":[],"sources":["IEventBus.ts"],"sourcesContent":["/**\n * @file IEventBus.ts\n * @description Pub/Sub interface for localized cross-field communication and state logic.\n */\n\n/**\n * Describes a state change payload fired by a plugin.\n */\nexport interface IFieldChangeEvent {\n fieldName: string;\n newValue: any;\n}\n\n/**\n * Contract for the internal event orchestrator to manage conditional UI logic.\n */\nexport interface IEventBus {\n /**\n * Publishes a value change event to the internal channel.\n * @param event The structured event detailing which field changed and its new value.\n */\n publishFieldChange(event: IFieldChangeEvent): void;\n\n /**\n * Subscribes a listener to react to field value changes.\n * @param listener The callback function to execute when a change occurs.\n */\n subscribe(listener: (event: IFieldChangeEvent) => void): void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ declare module "nz/co/siliconst/ui5/metaui/interfaces/IEventBus" {
2
+ /**
3
+ * @file IEventBus.ts
4
+ * @description Pub/Sub interface for localized cross-field communication and state logic.
5
+ */
6
+ /**
7
+ * Describes a state change payload fired by a plugin.
8
+ */
9
+ export interface IFieldChangeEvent {
10
+ fieldName: string;
11
+ newValue: any;
12
+ }
13
+ /**
14
+ * Contract for the internal event orchestrator to manage conditional UI logic.
15
+ */
16
+ export interface IEventBus {
17
+ /**
18
+ * Publishes a value change event to the internal channel.
19
+ * @param event The structured event detailing which field changed and its new value.
20
+ */
21
+ publishFieldChange(event: IFieldChangeEvent): void;
22
+ /**
23
+ * Subscribes a listener to react to field value changes.
24
+ * @param listener The callback function to execute when a change occurs.
25
+ */
26
+ subscribe(listener: (event: IFieldChangeEvent) => void): void;
27
+ }
28
+ }
29
+ //# sourceMappingURL=IEventBus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEventBus.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,iDAAiD,CAAC;IACjE;;;OAGG;IAEH;;OAEG;IACH,UAAiB,iBAAiB;QAC9B,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,GAAG,CAAC;KACjB;IAED;;OAEG;IACH,UAAiB,SAAS;QACtB;;;WAGG;QACH,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;QAEnD;;;WAGG;QACH,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI,CAAC;KACjE;CAEA"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=IEventBus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEventBus.js","names":[],"sources":[],"mappings":"","ignoreList":[]}
@@ -1,29 +1,29 @@
1
- /**
2
- * @file IEventBus.ts
3
- * @description Pub/Sub interface for localized cross-field communication and state logic.
4
- */
5
-
6
- /**
7
- * Describes a state change payload fired by a plugin.
8
- */
9
- export interface IFieldChangeEvent {
10
- fieldName: string;
11
- newValue: any;
12
- }
13
-
14
- /**
15
- * Contract for the internal event orchestrator to manage conditional UI logic.
16
- */
17
- export interface IEventBus {
18
- /**
19
- * Publishes a value change event to the internal channel.
20
- * @param event The structured event detailing which field changed and its new value.
21
- */
22
- publishFieldChange(event: IFieldChangeEvent): void;
23
-
24
- /**
25
- * Subscribes a listener to react to field value changes.
26
- * @param listener The callback function to execute when a change occurs.
27
- */
28
- subscribe(listener: (event: IFieldChangeEvent) => void): void;
29
- }
1
+ /**
2
+ * @file IEventBus.ts
3
+ * @description Pub/Sub interface for localized cross-field communication and state logic.
4
+ */
5
+
6
+ /**
7
+ * Describes a state change payload fired by a plugin.
8
+ */
9
+ export interface IFieldChangeEvent {
10
+ fieldName: string;
11
+ newValue: any;
12
+ }
13
+
14
+ /**
15
+ * Contract for the internal event orchestrator to manage conditional UI logic.
16
+ */
17
+ export interface IEventBus {
18
+ /**
19
+ * Publishes a value change event to the internal channel.
20
+ * @param event The structured event detailing which field changed and its new value.
21
+ */
22
+ publishFieldChange(event: IFieldChangeEvent): void;
23
+
24
+ /**
25
+ * Subscribes a listener to react to field value changes.
26
+ * @param listener The callback function to execute when a change occurs.
27
+ */
28
+ subscribe(listener: (event: IFieldChangeEvent) => void): void;
29
+ }
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=ILayoutManager-dbg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILayoutManager-dbg.js","names":[],"sources":["ILayoutManager.ts"],"sourcesContent":["/**\n * @file ILayoutManager.ts\n * @description Factory contract for generating UI5 layout containers (Forms/Tables).\n */\n\nimport Control from \"sap/ui/core/Control\";\nimport { IPropertyMetadata } from \"./ISchema\";\n\nimport { IPlugin } from \"./IPlugin\";\n\nexport interface ILayoutManager {\n /**\n * Renders a form-style layout for the root fields defined in the schema.\n */\n renderForm(properties: Record<string, IPropertyMetadata>, modelName?: string, formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control;\n\n /**\n * Renders a tabular layout for the provided array metadata.\n */\n renderTable(tableMeta: IPropertyMetadata, modelName?: string, tableTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ declare module "nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager" {
2
+ /**
3
+ * @file ILayoutManager.ts
4
+ * @description Factory contract for generating UI5 layout containers (Forms/Tables).
5
+ */
6
+ import Control from "sap/ui/core/Control";
7
+ import { IPropertyMetadata } from "nz/co/siliconst/ui5/metaui/interfaces/ISchema";
8
+ import { IPlugin } from "nz/co/siliconst/ui5/metaui/interfaces/IPlugin";
9
+ export interface ILayoutManager {
10
+ /**
11
+ * Renders a form-style layout for the root fields defined in the schema.
12
+ */
13
+ renderForm(properties: Record<string, IPropertyMetadata>, modelName?: string, formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control;
14
+ /**
15
+ * Renders a tabular layout for the provided array metadata.
16
+ */
17
+ renderTable(tableMeta: IPropertyMetadata, modelName?: string, tableTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control;
18
+ }
19
+ }
20
+ //# sourceMappingURL=ILayoutManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILayoutManager.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,sDAAsD,CAAC;IACtE;;;OAGG;IAEH,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAElF,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;IAExE,UAAiB,cAAc;QAC3B;;WAEG;QACH,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC;QAEpJ;;WAEG;QACH,WAAW,CAAC,SAAS,EAAE,iBAAiB,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC;KACxI;CAEA"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=ILayoutManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILayoutManager.js","names":[],"sources":[],"mappings":"","ignoreList":[]}
@@ -1,26 +1,21 @@
1
- /**
2
- * @file ILayoutManager.ts
3
- * @description Factory contract for generating UI5 layout containers (Forms/Tables).
4
- */
5
-
6
- import Control from "sap/ui/core/Control";
7
- import { ISchema, ITableMetadata } from "./ISchema";
8
-
9
- /**
10
- * The factory interface responsible for structuring the visual grid.
11
- */
12
- export interface ILayoutManager {
13
- /**
14
- * Constructs a responsive form layout container utilizing native UI5 grids.
15
- * @param schema The master schema containing rootFields to be mounted.
16
- * @returns A populated UI5 container (e.g., sap.ui.layout.form.SimpleForm).
17
- */
18
- renderForm(schema: ISchema): Control;
19
-
20
- /**
21
- * Constructs an analytical or responsive table layout.
22
- * @param tableMeta The metadata defining the table columns.
23
- * @returns A UI5 Table control (e.g., sap.m.Table or sap.ui.table.Table).
24
- */
25
- renderTable(tableMeta: ITableMetadata): Control;
26
- }
1
+ /**
2
+ * @file ILayoutManager.ts
3
+ * @description Factory contract for generating UI5 layout containers (Forms/Tables).
4
+ */
5
+
6
+ import Control from "sap/ui/core/Control";
7
+ import { IPropertyMetadata } from "./ISchema";
8
+
9
+ import { IPlugin } from "./IPlugin";
10
+
11
+ export interface ILayoutManager {
12
+ /**
13
+ * Renders a form-style layout for the root fields defined in the schema.
14
+ */
15
+ renderForm(properties: Record<string, IPropertyMetadata>, modelName?: string, formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control;
16
+
17
+ /**
18
+ * Renders a tabular layout for the provided array metadata.
19
+ */
20
+ renderTable(tableMeta: IPropertyMetadata, modelName?: string, tableTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control;
21
+ }
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=IPlugin-dbg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPlugin-dbg.js","names":[],"sources":["IPlugin.ts"],"sourcesContent":["/**\n * @file IPlugin.ts\n * @description Contract for all discrete UI control generation plugins.\n * Enforces a strict lifecycle for rendering, validation, and dynamic state updates.\n */\n\nimport Control from \"sap/ui/core/Control\";\nimport { IPropertyMetadata } from \"./ISchema\";\n\nexport interface IPlugin {\n render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName?: string): Control;\n validate(): boolean;\n onStateChange(newMetadata: IPropertyMetadata): void;\n}\n"],"mappings":"","ignoreList":[]}