@siliconst/metaui 1.0.2 → 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 (183) hide show
  1. package/README.md +134 -123
  2. package/package.json +3 -2
  3. package/src/nz/co/siliconst/ui5/metaui/.library +7 -7
  4. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js +299 -163
  5. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js.map +1 -1
  6. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts +54 -6
  7. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts.map +1 -1
  8. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js +1 -1
  9. package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js.map +1 -1
  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 +51 -43
  12. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js.map +1 -1
  13. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts +5 -0
  14. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts.map +1 -1
  15. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js +1 -1
  16. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js.map +1 -1
  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 +81 -58
  19. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
  20. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +5 -12
  21. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
  22. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +1 -1
  23. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
  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 +65 -50
  26. package/src/nz/co/siliconst/ui5/metaui/core/EventBus-dbg.js.map +1 -1
  27. package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts +9 -0
  28. package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts.map +1 -1
  29. package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js +1 -1
  30. package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js.map +1 -1
  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 +72 -59
  33. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -1
  34. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts +6 -4
  35. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -1
  36. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +1 -1
  37. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -1
  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 +145 -36
  40. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -1
  41. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +13 -8
  42. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -1
  43. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +1 -1
  44. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -1
  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 +55 -55
  47. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -1
  48. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts.map +1 -1
  49. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -1
  50. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +56 -56
  51. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js +1 -1
  52. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js.map +1 -1
  53. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.d.ts.map +1 -1
  54. package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.ts +29 -29
  55. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js +1 -1
  56. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js.map +1 -1
  57. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts +6 -12
  58. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts.map +1 -1
  59. package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.ts +21 -26
  60. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js +1 -1
  61. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -1
  62. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +3 -20
  63. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -1
  64. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +14 -33
  65. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js +1 -1
  66. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
  67. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +33 -43
  68. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
  69. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +70 -70
  70. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js +23 -38
  71. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js.map +1 -1
  72. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts +4 -17
  73. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts.map +1 -1
  74. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js +1 -1
  75. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js.map +1 -1
  76. package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.ts +22 -34
  77. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +98 -56
  78. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -1
  79. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts +7 -7
  80. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -1
  81. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +1 -1
  82. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -1
  83. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +97 -60
  84. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +102 -90
  85. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -1
  86. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts +4 -8
  87. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -1
  88. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +1 -1
  89. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -1
  90. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +119 -102
  91. package/src/nz/co/siliconst/ui5/metaui/library-dbg.js +43 -32
  92. package/src/nz/co/siliconst/ui5/metaui/library-dbg.js.map +1 -1
  93. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +22 -17
  94. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  95. package/src/nz/co/siliconst/ui5/metaui/library.d.ts.map +1 -1
  96. package/src/nz/co/siliconst/ui5/metaui/library.js +1 -1
  97. package/src/nz/co/siliconst/ui5/metaui/library.js.map +1 -1
  98. package/src/nz/co/siliconst/ui5/metaui/library.ts +55 -43
  99. package/src/nz/co/siliconst/ui5/metaui/manifest.json +1 -0
  100. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin-dbg.js +68 -0
  101. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin-dbg.js.map +1 -0
  102. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.d.ts +15 -0
  103. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.d.ts.map +1 -0
  104. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.js +2 -0
  105. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.js.map +1 -0
  106. package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.ts +71 -0
  107. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js +54 -59
  108. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js.map +1 -1
  109. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts +8 -27
  110. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts.map +1 -1
  111. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js +1 -1
  112. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js.map +1 -1
  113. package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.ts +56 -58
  114. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js +41 -42
  115. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js.map +1 -1
  116. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts +2 -2
  117. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts.map +1 -1
  118. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js +1 -1
  119. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js.map +1 -1
  120. package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.ts +41 -42
  121. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js +68 -60
  122. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js.map +1 -1
  123. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts +2 -2
  124. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts.map +1 -1
  125. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js +1 -1
  126. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js.map +1 -1
  127. package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.ts +69 -63
  128. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin-dbg.js +68 -0
  129. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin-dbg.js.map +1 -0
  130. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.d.ts +18 -0
  131. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.d.ts.map +1 -0
  132. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.js +2 -0
  133. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.js.map +1 -0
  134. package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.ts +68 -0
  135. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js +66 -66
  136. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js.map +1 -1
  137. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts +2 -2
  138. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts.map +1 -1
  139. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js +1 -1
  140. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js.map +1 -1
  141. package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.ts +65 -65
  142. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js +55 -53
  143. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js.map +1 -1
  144. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts +3 -3
  145. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts.map +1 -1
  146. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js +1 -1
  147. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js.map +1 -1
  148. package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.ts +56 -55
  149. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js +56 -53
  150. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js.map +1 -1
  151. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts +2 -2
  152. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts.map +1 -1
  153. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js +1 -1
  154. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js.map +1 -1
  155. package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.ts +58 -55
  156. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin-dbg.js +43 -0
  157. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin-dbg.js.map +1 -0
  158. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.d.ts +18 -0
  159. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.d.ts.map +1 -0
  160. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.js +2 -0
  161. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.js.map +1 -0
  162. package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.ts +42 -0
  163. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin-dbg.js +58 -0
  164. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin-dbg.js.map +1 -0
  165. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.d.ts +18 -0
  166. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.d.ts.map +1 -0
  167. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.js +2 -0
  168. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.js.map +1 -0
  169. package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.ts +58 -0
  170. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin-dbg.js +74 -0
  171. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin-dbg.js.map +1 -0
  172. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.d.ts +18 -0
  173. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.d.ts.map +1 -0
  174. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.js +2 -0
  175. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.js.map +1 -0
  176. package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.ts +71 -0
  177. package/ui5.yaml +3 -3
  178. package/test-resources/App.js +0 -11
  179. package/test-resources/Main.controller.js +0 -73
  180. package/test-resources/Main.view.xml +0 -42
  181. package/test-resources/index.html +0 -21
  182. package/test-resources/mockData.json +0 -27
  183. package/test-resources/mockSchema.json +0 -98
@@ -1 +1 @@
1
- {"version":3,"file":"library-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"names":["SchemaNormalizer","___core_SchemaNormalizer","Engine","___core_Engine","StateManager","___core_StateManager","BaseLayout","___layouts_BaseLayout","GeneratorHost","Control","extend","constructor","prototype","apply","this","arguments","stateManager","generatedContent","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","initialData","aggregations","_content","multiple","visibility","events","submit","parameters","payload","cancel","init","_init","Control.prototype.init.call","onBeforeRendering","_onBeforeRendering","getProperty","generate","triggerSubmit","_triggerSubmit","extractPayload","fireEvent","_generate","rawSchema","Error","normalizedSchema","normalize","setModel","getModel","engine","layoutFactory","build","setAggregation","openInDialog","_openInDialog","title","submitButtonText","dialog","Dialog","contentWidth","beginButton","Button","text","press","endButton","afterClose","destroy","open"],"sources":["GeneratorHost.ts"],"sourcesContent":["/**\r\n * @file GeneratorHost.ts\r\n * @description The core UI5 custom control that exposes the MetaUI engine to host applications.\r\n */\r\n\r\nimport Control from \"sap/ui/core/Control\";\r\nimport RenderManager from \"sap/ui/core/RenderManager\";\r\nimport Dialog from \"sap/m/Dialog\";\r\nimport Button from \"sap/m/Button\";\r\nimport { SchemaNormalizer } from \"../core/SchemaNormalizer\";\r\nimport { Engine } from \"../core/Engine\";\r\nimport { StateManager } from \"../core/StateManager\";\r\nimport { BaseLayout } from \"../layouts/BaseLayout\";\r\n\r\n/**\r\n * Enterprise wrapper element for embedding or popping the dynamic form.\r\n * \r\n * @namespace nz.co.siliconst.ui5.metaui.controls\r\n */\r\nexport default class GeneratorHost extends Control {\r\n \r\n private stateManager: StateManager | null = null;\r\n private generatedContent: Control | null = null;\r\n\r\n static readonly metadata = {\r\n properties: {\r\n /** The raw JSON metadata schema provided by the ABAP backend. */\r\n schemaDefinition: { type: \"object\", defaultValue: null },\r\n /** The initial data payload to populate the fields. */\r\n initialData: { type: \"object\", defaultValue: {} }\r\n },\r\n aggregations: {\r\n /** The internal hidden container holding the generated layouts. */\r\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\r\n },\r\n events: {\r\n /** Triggered when the user submits the form via the Dialog modality. */\r\n submit: {\r\n parameters: {\r\n /** The clean extracted JSON payload representing the current state. */\r\n payload: { type: \"object\" }\r\n }\r\n },\r\n /** Triggered if the dialog is cancelled. */\r\n cancel: {}\r\n }\r\n };\r\n\r\n /**\r\n * Standard UI5 control renderer. Renders the generated internal content.\r\n */\r\n static renderer = {\r\n apiVersion: 2,\r\n render(rm: RenderManager, control: GeneratorHost) {\r\n rm.openStart(\"div\", control);\r\n rm.style(\"width\", \"100%\");\r\n rm.style(\"height\", \"100%\");\r\n rm.openEnd();\r\n \r\n const content = control.getAggregation(\"_content\") as Control;\r\n if (content) {\r\n rm.renderControl(content);\r\n }\r\n \r\n rm.close(\"div\");\r\n }\r\n };\r\n\r\n /**\r\n * Initializes the UI5 control.\r\n */\r\n public init(): void {\r\n super.init();\r\n }\r\n\r\n /**\r\n * Lifecycle hook to automatically generate the layout if bound declaratively in XML.\r\n */\r\n public onBeforeRendering(): void {\r\n if (!this.generatedContent && this.getProperty(\"schemaDefinition\")) {\r\n this.generate();\r\n }\r\n }\r\n\r\n /**\r\n * Extracts the payload and fires the submit event manually. Useful for inline XML embedding.\r\n */\r\n public triggerSubmit(): void {\r\n if (this.stateManager) {\r\n const payload = this.stateManager.extractPayload();\r\n this.fireEvent(\"submit\", { payload });\r\n }\r\n }\r\n\r\n /**\r\n * Triggers the engine to parse the schema and build the layout.\r\n * Must be called manually or hooked into onBeforeRendering if properties are bound.\r\n */\r\n public generate(): void {\r\n const rawSchema = this.getProperty(\"schemaDefinition\");\r\n const initialData = this.getProperty(\"initialData\");\r\n\r\n if (!rawSchema) {\r\n throw new Error(\"[MetaUI] Cannot generate layout without a schemaDefinition.\");\r\n }\r\n\r\n // 1. Normalize schema\r\n const normalizedSchema = SchemaNormalizer.normalize(rawSchema);\r\n\r\n // 2. Bootstrap isolated State Manager\r\n this.stateManager = new StateManager(initialData);\r\n this.setModel(this.stateManager.getModel(), \"meta\");\r\n\r\n // 3. Delegate to Layout Engine\r\n const engine = new Engine();\r\n const layoutFactory = new BaseLayout();\r\n \r\n this.generatedContent = engine.build(normalizedSchema, layoutFactory);\r\n\r\n // 4. Mount into hidden aggregation\r\n this.setAggregation(\"_content\", this.generatedContent);\r\n }\r\n\r\n /**\r\n * Dialog Modality: Opens the generated layout inside a sap.m.Dialog.\r\n * Automatically wires up 'Save' and 'Cancel' buttons.\r\n */\r\n public openInDialog(title: string = \"Dynamic Form\", submitButtonText: string = \"Save\"): void {\r\n if (!this.generatedContent) {\r\n this.generate();\r\n }\r\n\r\n const dialog = new Dialog({\r\n title: title,\r\n contentWidth: \"800px\",\r\n content: [this], // Mount self inside the dialog\r\n beginButton: new Button({\r\n text: submitButtonText,\r\n type: \"Emphasized\",\r\n press: () => {\r\n if (this.stateManager) {\r\n const payload = this.stateManager.extractPayload();\r\n this.fireEvent(\"submit\", { payload });\r\n }\r\n dialog.close();\r\n }\r\n }),\r\n endButton: new Button({\r\n text: \"Cancel\",\r\n press: () => {\r\n this.fireEvent(\"cancel\");\r\n dialog.close();\r\n }\r\n }),\r\n afterClose: () => {\r\n dialog.destroy();\r\n }\r\n });\r\n\r\n dialog.open();\r\n }\r\n}\r\n"],"mappings":"AAAA,kQASSA,EAAgBC,EAAA,0BAChBC,EAAMC,EAAA,gBACNC,EAAYC,EAAA,sBACZC,EAAUC,EAAA,cAEnB,MAKqBC,EAAsBC,EAAOC,OAAA,qDAAAC,YAAA,SAAAA,IAAAF,EAAAG,UAAAD,YAAAE,MAAAC,KAAAC,WAAAD,KAEtCE,aAAoC,KAAIF,KACxCG,iBAAmC,IAAI,EA6BxCC,SAAW,CACdC,WAAY,EACZC,OAAOC,EAAmBC,GACtBD,EAAGE,UAAU,MAAOD,GACpBD,EAAGG,MAAM,QAAS,QAClBH,EAAGG,MAAM,SAAU,QACnBH,EAAGI,UAEH,MAAMC,EAAUJ,EAAQK,eAAe,YACvC,GAAID,EAAS,CACTL,EAAGO,cAAcF,EACrB,CAEAL,EAAGQ,MAAM,MACb,GAzCYC,SAAW,CACvBC,WAAY,CAERC,iBAAkB,CAAEC,KAAM,SAAUC,aAAc,MAElDC,YAAa,CAAEF,KAAM,SAAUC,aAAc,CAAC,IAElDE,aAAc,CAEVC,SAAU,CAAEJ,KAAM,sBAAuBK,SAAU,MAAOC,WAAY,WAE1EC,OAAQ,CAEJC,OAAQ,CACJC,WAAY,CAERC,QAAS,CAAEV,KAAM,YAIzBW,OAAQ,CAAC,IA2BVC,KAAI,SAAAC,IACPC,sBAAAjC,KACJ,EAKOkC,kBAAiB,SAAAC,IACpB,IAAKnC,KAAKG,kBAAoBH,KAAKoC,YAAY,oBAAqB,CAChEpC,KAAKqC,UACT,CACJ,EAKOC,cAAa,SAAAC,IAChB,GAAIvC,KAAKE,aAAc,CACnB,MAAM2B,EAAU7B,KAAKE,aAAasC,iBAClCxC,KAAKyC,UAAU,SAAU,CAAEZ,WAC/B,CACJ,EAMOQ,SAAQ,SAAAK,IACX,MAAMC,EAAY3C,KAAKoC,YAAY,oBACnC,MAAMf,EAAcrB,KAAKoC,YAAY,eAErC,IAAKO,EAAW,CACZ,MAAM,IAAIC,MAAM,8DACpB,CAGA,MAAMC,EAAmB3D,EAAiB4D,UAAUH,GAGpD3C,KAAKE,aAAe,IAAIZ,EAAa+B,GACrCrB,KAAK+C,SAAS/C,KAAKE,aAAa8C,WAAY,QAG5C,MAAMC,EAAS,IAAI7D,EACnB,MAAM8D,EAAgB,IAAI1D,EAE1BQ,KAAKG,iBAAmB8C,EAAOE,MAAMN,EAAkBK,GAGvDlD,KAAKoD,eAAe,WAAYpD,KAAKG,iBACzC,EAMOkD,aAAY,SAAAC,EAACC,EAAgB,eAAgBC,EAA2B,QAC3E,IAAKxD,KAAKG,iBAAkB,CACxBH,KAAKqC,UACT,CAEA,MAAMoB,EAAS,IAAIC,EAAO,CACtBH,MAAOA,EACPI,aAAc,QACd/C,QAAS,CAACZ,MACV4D,YAAa,IAAIC,EAAO,CACpBC,KAAMN,EACNrC,KAAM,aACN4C,MAAOA,KACH,GAAI/D,KAAKE,aAAc,CACnB,MAAM2B,EAAU7B,KAAKE,aAAasC,iBAClCxC,KAAKyC,UAAU,SAAU,CAAEZ,WAC/B,CACA4B,EAAO1C,WAGfiD,UAAW,IAAIH,EAAO,CAClBC,KAAM,SACNC,MAAOA,KACH/D,KAAKyC,UAAU,UACfgB,EAAO1C,WAGfkD,WAAYA,KACRR,EAAOS,aAIfT,EAAOU,MACX,IAAC,OA7IgBzE,CAAa","ignoreList":[],"sourceRoot":"controls"}},{"offset":{"line":2,"column":0},"map":{"version":3,"names":["EventBus","___EventBus","ConditionEngine","constructor","schema","this","initializeListeners","getInstance","subscribe","handleEvent","bind","event","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\r\n * @file ConditionEngine.ts\r\n * @description Evaluates dynamic rules to alter the schema in real-time.\r\n */\r\n\r\nimport { EventBus } from \"./EventBus\";\r\nimport { ISchema } from \"../interfaces/ISchema\";\r\nimport { IFieldChangeEvent } from \"../interfaces/IEventBus\";\r\n\r\n/**\r\n * Engine that listens to the EventBus and evaluates cross-field dependencies.\r\n */\r\nexport class ConditionEngine {\r\n private schema: ISchema;\r\n\r\n /**\r\n * Initializes the ConditionEngine with the active schema.\r\n * @param schema The current UI layout schema.\r\n */\r\n constructor(schema: ISchema) {\r\n this.schema = schema;\r\n this.initializeListeners();\r\n }\r\n\r\n /**\r\n * Subscribes to the EventBus for real-time field change interception.\r\n */\r\n private initializeListeners(): void {\r\n EventBus.getInstance().subscribe(this.handleEvent.bind(this));\r\n }\r\n\r\n /**\r\n * Internal handler to evaluate business rules when a field is updated.\r\n * @param event The structured change event.\r\n */\r\n private handleEvent(event: IFieldChangeEvent): void {\r\n // Architecture hook: Logic to evaluate conditions against the schema \r\n // and update plugin properties will be injected here in later phases.\r\n }\r\n}\r\n"],"mappings":"AAAA,4GAAA,MAKSA,EAAQC,EAAA,YAOV,MAAMC,EAOTC,YAAYC,GACRC,KAAKD,OAASA,EACdC,KAAKC,qBACT,CAKQA,sBACJN,EAASO,cAAcC,UAAUH,KAAKI,YAAYC,KAAKL,MAC3D,CAMQI,YAAYE,GAEhB,EAEP,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAAV,kBAAA,OAAAU,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":3,"column":0},"map":{"version":3,"names":["ConditionEngine","___ConditionEngine","Engine","conditionEngine","build","schema","layoutManager","this","mode","renderForm","tables","length","Error","renderTable","container","VBox","renderType","rootFields","addItem","forEach","tableMeta","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\r\n * @file Engine.ts\r\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry.\r\n */\r\n\r\nimport { ISchema } from \"../interfaces/ISchema\";\r\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\r\nimport { ConditionEngine } from \"./ConditionEngine\";\r\nimport Control from \"sap/ui/core/Control\";\r\nimport VBox from \"sap/m/VBox\";\r\n\r\n/**\r\n * The MetaUI Engine. Responsible for bootstrapping the layout generation.\r\n * Follows strict Orchestrator patterns; delegates all actual rendering to LayoutManagers.\r\n */\r\nexport class Engine {\r\n private conditionEngine: ConditionEngine | null = null;\r\n \r\n /**\r\n * Evaluates the schema and delegates generation to the layout factory.\r\n * @param schema The fully normalized schema definition.\r\n * @param layoutManager The injected layout factory class.\r\n * @returns The populated UI5 layout container.\r\n */\r\n public build(schema: ISchema, layoutManager: ILayoutManager): Control {\r\n // Bootstrap the condition engine to start listening for field events in this schema\r\n this.conditionEngine = new ConditionEngine(schema);\r\n \r\n if (schema.mode === \"form\") {\r\n return layoutManager.renderForm(schema);\r\n } else if (schema.mode === \"table\") {\r\n if (!schema.tables || schema.tables.length === 0) {\r\n throw new Error(\"[MetaUI] Table mode requires at least one table definition.\");\r\n }\r\n return layoutManager.renderTable(schema.tables[0]);\r\n } else if (schema.mode === \"mixed\") {\r\n const container = new VBox({ renderType: \"Bare\" });\r\n \r\n // 1. Render the top-level form if there are root fields\r\n if (schema.rootFields && schema.rootFields.length > 0) {\r\n container.addItem(layoutManager.renderForm(schema));\r\n }\r\n \r\n // 2. Render all tables sequentially below the form\r\n if (schema.tables && schema.tables.length > 0) {\r\n schema.tables.forEach(tableMeta => {\r\n container.addItem(layoutManager.renderTable(tableMeta));\r\n });\r\n }\r\n \r\n return container;\r\n }\r\n \r\n throw new Error(`[MetaUI] Mode '${schema.mode}' is not yet implemented or invalid.`);\r\n }\r\n}\r\n"],"mappings":"AAAA,yHAAA,MAOSA,EAAeC,EAAA,mBAQjB,MAAMC,EACDC,gBAA0C,KAQ3CC,MAAMC,EAAiBC,GAE1BC,KAAKJ,gBAAkB,IAAIH,EAAgBK,GAE3C,GAAIA,EAAOG,OAAS,OAAQ,CACxB,OAAOF,EAAcG,WAAWJ,EACpC,MAAO,GAAIA,EAAOG,OAAS,QAAS,CAChC,IAAKH,EAAOK,QAAUL,EAAOK,OAAOC,SAAW,EAAG,CAC9C,MAAM,IAAIC,MAAM,8DACpB,CACA,OAAON,EAAcO,YAAYR,EAAOK,OAAO,GACnD,MAAO,GAAIL,EAAOG,OAAS,QAAS,CAChC,MAAMM,EAAY,IAAIC,EAAK,CAAEC,WAAY,SAGzC,GAAIX,EAAOY,YAAcZ,EAAOY,WAAWN,OAAS,EAAG,CACnDG,EAAUI,QAAQZ,EAAcG,WAAWJ,GAC/C,CAGA,GAAIA,EAAOK,QAAUL,EAAOK,OAAOC,OAAS,EAAG,CAC3CN,EAAOK,OAAOS,QAAQC,IAClBN,EAAUI,QAAQZ,EAAcO,YAAYO,KAEpD,CAEA,OAAON,CACX,CAEA,MAAM,IAAIF,MAAM,kBAAkBP,EAAOG,2CAC7C,EACH,IAAAa,EAAA,CAAAC,WAAA,MAAAD,EAAAnB,SAAA,OAAAmB,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":4,"column":0},"map":{"version":3,"names":["EventBus","listeners","constructor","getInstance","instance","publishFieldChange","event","this","forEach","listener","subscribe","push","__exports","__esModule"],"sources":["EventBus.ts"],"sourcesContent":["/**\r\n * @file EventBus.ts\r\n * @description Internal pub/sub channel for managing cross-field dependencies.\r\n */\r\n\r\nimport { IEventBus, IFieldChangeEvent } from \"../interfaces/IEventBus\";\r\n\r\n/**\r\n * Singleton orchestrator for localized state changes across the generated UI layout.\r\n */\r\nexport class EventBus implements IEventBus {\r\n private static instance: EventBus;\r\n private listeners: Array<(event: IFieldChangeEvent) => void> = [];\r\n\r\n private constructor() {\r\n // Enforce singleton\r\n }\r\n\r\n /**\r\n * Retrieves the singular instance of the EventBus.\r\n * @returns The EventBus singleton.\r\n */\r\n public static getInstance(): EventBus {\r\n if (!EventBus.instance) {\r\n EventBus.instance = new EventBus();\r\n }\r\n return EventBus.instance;\r\n }\r\n\r\n /**\r\n * Publishes a value change event to all internal subscribers.\r\n * @param event The structured payload of the field change.\r\n */\r\n public publishFieldChange(event: IFieldChangeEvent): void {\r\n this.listeners.forEach(listener => listener(event));\r\n }\r\n\r\n /**\r\n * Registers a callback listener to react to field changes.\r\n * @param listener The callback function.\r\n */\r\n public subscribe(listener: (event: IFieldChangeEvent) => void): void {\r\n this.listeners.push(listener);\r\n }\r\n}\r\n"],"mappings":"AAAA,wFAUO,MAAMA,EAEDC,UAAuD,GAEvDC,cACJ,CAOJ,kBAAcC,GACV,IAAKH,EAASI,SAAU,CACpBJ,EAASI,SAAW,IAAIJ,CAC5B,CACA,OAAOA,EAASI,QACpB,CAMOC,mBAAmBC,GACtBC,KAAKN,UAAUO,QAAQC,GAAYA,EAASH,GAChD,CAMOI,UAAUD,GACbF,KAAKN,UAAUU,KAAKF,EACxB,EACH,IAAAG,EAAA,CAAAC,WAAA,MAAAD,EAAAZ,WAAA,OAAAY,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":5,"column":0},"map":{"version":3,"names":["PluginRegistry","plugins","Map","constructor","getInstance","instance","register","type","pluginConstructor","this","set","getPlugin","PluginClass","get","Error","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\r\n * @file PluginRegistry.ts\r\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\r\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\r\n */\r\n\r\nimport { IPlugin } from \"../interfaces/IPlugin\";\r\nimport { FieldType } from \"../interfaces/ISchema\";\r\n\r\n/**\r\n * Singleton registry that manages the lifecycle and lookup of UI5 plugin constructors.\r\n */\r\nexport class PluginRegistry {\r\n private static instance: PluginRegistry;\r\n \r\n /** Internal map linking string types to their respective constructor functions. */\r\n private plugins: Map<FieldType, new () => IPlugin> = new Map();\r\n\r\n private constructor() {\r\n // Enforce singleton\r\n }\r\n\r\n /**\r\n * Retrieves the singular instance of the PluginRegistry.\r\n * @returns The PluginRegistry singleton.\r\n */\r\n public static getInstance(): PluginRegistry {\r\n if (!PluginRegistry.instance) {\r\n PluginRegistry.instance = new PluginRegistry();\r\n }\r\n return PluginRegistry.instance;\r\n }\r\n\r\n /**\r\n * Registers a new UI control plugin against a specific schema primitive type.\r\n * @param type The primitive FieldType (e.g., 'string', 'date').\r\n * @param pluginConstructor The class constructor for the plugin.\r\n */\r\n public register(type: FieldType, pluginConstructor: new () => IPlugin): void {\r\n this.plugins.set(type, pluginConstructor);\r\n }\r\n\r\n /**\r\n * Instantiates and returns a new plugin based on the requested primitive type.\r\n * @param type The primitive FieldType to look up.\r\n * @throws Error if no plugin has been registered for the provided type.\r\n * @returns A newly instantiated plugin ready for rendering.\r\n */\r\n public getPlugin(type: FieldType): IPlugin {\r\n const PluginClass = this.plugins.get(type);\r\n if (!PluginClass) {\r\n throw new Error(`[MetaUI] No plugin registered for FieldType: ${type}`);\r\n }\r\n return new PluginClass();\r\n }\r\n}\r\n"],"mappings":"AAAA,8FAYO,MAAMA,EAIDC,QAA6C,IAAIC,IAEjDC,cACJ,CAOJ,kBAAcC,GACV,IAAKJ,EAAeK,SAAU,CAC1BL,EAAeK,SAAW,IAAIL,CAClC,CACA,OAAOA,EAAeK,QAC1B,CAOOC,SAASC,EAAiBC,GAC7BC,KAAKR,QAAQS,IAAIH,EAAMC,EAC3B,CAQOG,UAAUJ,GACb,MAAMK,EAAcH,KAAKR,QAAQY,IAAIN,GACrC,IAAKK,EAAa,CACd,MAAM,IAAIE,MAAM,gDAAgDP,IACpE,CACA,OAAO,IAAIK,CACf,EACH,IAAAG,EAAA,CAAAC,WAAA,MAAAD,EAAAf,iBAAA,OAAAe,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":6,"column":0},"map":{"version":3,"names":["SchemaNormalizer","normalize","rawSchema","Error","mode","rootFields","tables","__exports","__esModule"],"sources":["SchemaNormalizer.ts"],"sourcesContent":["/**\r\n * @file SchemaNormalizer.ts\r\n * @description Transforms and validates incoming JSON payloads into the strict ISchema matrix.\r\n */\r\n\r\nimport { ISchema } from \"../interfaces/ISchema\";\r\n\r\n/**\r\n * Utility class ensuring data fidelity before layout construction begins.\r\n */\r\nexport class SchemaNormalizer {\r\n \r\n /**\r\n * Validates that the provided raw payload conforms to the required ISchema structures.\r\n * @param rawSchema The heterogeneous JSON object provided to the Engine.\r\n * @returns The strictly cast ISchema matrix.\r\n * @throws Error if the mandatory schema properties are missing.\r\n */\r\n public static normalize(rawSchema: any): ISchema {\r\n if (!rawSchema || typeof rawSchema !== 'object') {\r\n throw new Error(\"[MetaUI] Invalid Schema Payload: Payload is not an object.\");\r\n }\r\n \r\n if (!rawSchema.mode || !rawSchema.rootFields || !rawSchema.tables) {\r\n throw new Error(\"[MetaUI] Invalid Schema Payload: Missing required structures (mode, rootFields, tables).\");\r\n }\r\n\r\n // Return the strongly typed and validated schema block.\r\n return rawSchema as ISchema;\r\n }\r\n}\r\n"],"mappings":"AAAA,gGAUO,MAAMA,EAQT,gBAAcC,CAAUC,GACpB,IAAKA,UAAoBA,IAAc,SAAU,CAC7C,MAAM,IAAIC,MAAM,6DACpB,CAEA,IAAKD,EAAUE,OAASF,EAAUG,aAAeH,EAAUI,OAAQ,CAC/D,MAAM,IAAIH,MAAM,2FACpB,CAGA,OAAOD,CACX,EACH,IAAAK,EAAA,CAAAC,WAAA,MAAAD,EAAAP,mBAAA,OAAAO,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":7,"column":0},"map":{"version":3,"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":["/**\r\n * @file StateManager.ts\r\n * @description Isolated internal state management. Decouples the MetaUI engine from external host models.\r\n */\r\n\r\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\r\nimport ManagedObject from \"sap/ui/base/ManagedObject\";\r\n\r\n/**\r\n * Manages the isolated internal data payload for the MetaUI engine.\r\n */\r\nexport class StateManager {\r\n private model: JSONModel;\r\n\r\n /**\r\n * Initializes the state manager with an optional initial payload.\r\n * @param initialData The initial JSON payload to populate the fields.\r\n */\r\n constructor(initialData: Record<string, any> = {}) {\r\n // Deep copy to ensure no reference leakage from the host application\r\n const safeData = JSON.parse(JSON.stringify(initialData));\r\n this.model = new JSONModel(safeData);\r\n this.model.setDefaultBindingMode(\"TwoWay\");\r\n }\r\n\r\n /**\r\n * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.\r\n * @returns The internal JSONModel.\r\n */\r\n public getModel(): JSONModel {\r\n return this.model;\r\n }\r\n\r\n /**\r\n * Binds a generated UI control property to a path in the internal model.\r\n * @param control The target UI5 Control.\r\n * @param property The UI5 property name (e.g., 'value').\r\n * @param bindingPath The exact path in the JSON payload.\r\n */\r\n public bindControl(control: ManagedObject, property: string, bindingPath: string): void {\r\n control.bindProperty(property, {\r\n path: bindingPath,\r\n model: \"meta\" // Assumes the model is bound to the root container with the name 'meta'\r\n });\r\n }\r\n\r\n /**\r\n * Extracts the flat JavaScript object representing the current state of the UI.\r\n * @returns A serialized record of the data payload, free of UI5 wrappers.\r\n */\r\n public extractPayload(): Record<string, any> {\r\n // Create a deep copy to prevent accidental mutations by the host\r\n const data = this.model.getData();\r\n return JSON.parse(JSON.stringify(data));\r\n }\r\n}\r\n"],"mappings":"AAAA,0HAWO,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":[],"sourceRoot":"core"}},{"offset":{"line":8,"column":0},"map":{"version":3,"names":["FormLayout","___FormLayout","TableLayout","___TableLayout","BaseLayout","renderForm","schema","build","rootFields","renderTable","tableMeta","__exports","__esModule"],"sources":["BaseLayout.ts"],"sourcesContent":["/**\r\n * @file BaseLayout.ts\r\n * @description Central layout factory that delegates to specific form or table layout engines.\r\n * Implements ILayoutManager.\r\n */\r\n\r\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\r\nimport { ISchema, ITableMetadata } from \"../interfaces/ISchema\";\r\nimport Control from \"sap/ui/core/Control\";\r\nimport { FormLayout } from \"./FormLayout\";\r\nimport { TableLayout } from \"./TableLayout\";\r\n\r\n/**\r\n * The core layout manager that delegates structural grid rendering based on schema configurations.\r\n */\r\nexport class BaseLayout implements ILayoutManager {\r\n /**\r\n * Constructs a responsive form layout container.\r\n * @param schema The master schema containing rootFields to be mounted.\r\n * @returns A populated UI5 container (sap.ui.layout.form.SimpleForm).\r\n */\r\n public renderForm(schema: ISchema): Control {\r\n return FormLayout.build(schema.rootFields);\r\n }\r\n\r\n /**\r\n * Constructs a responsive table layout container.\r\n * @param tableMeta The metadata defining the table columns.\r\n * @returns A UI5 Table control (sap.m.Table).\r\n */\r\n public renderTable(tableMeta: ITableMetadata): Control {\r\n return TableLayout.build(tableMeta);\r\n }\r\n}\r\n"],"mappings":"AAAA,8HAAA,MASSA,EAAUC,EAAA,oBACVC,EAAWC,EAAA,eAKb,MAAMC,EAMFC,WAAWC,GACd,OAAON,EAAWO,MAAMD,EAAOE,WACnC,CAOOC,YAAYC,GACf,OAAOR,EAAYK,MAAMG,EAC7B,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAAP,aAAA,OAAAO,CAAA","ignoreList":[],"sourceRoot":"layouts"}},{"offset":{"line":9,"column":0},"map":{"version":3,"names":["PluginRegistry","___core_PluginRegistry","FormLayout","build","fields","form","SimpleForm","editable","layout","labelSpanXL","labelSpanL","labelSpanM","labelSpanS","adjustLabelSpan","emptySpanXL","emptySpanL","emptySpanM","emptySpanS","columnsXL","columnsL","columnsM","singleContainerFullSize","registry","getInstance","forEach","field","label","Label","text","required","isRequired","plugin","getPlugin","type","control","render","fieldName","addContent","__exports","__esModule"],"sources":["FormLayout.ts"],"sourcesContent":["/**\r\n * @file FormLayout.ts\r\n * @description Generates a fully responsive SAP Fiori Form layout (SimpleForm).\r\n */\r\n\r\nimport SimpleForm from \"sap/ui/layout/form/SimpleForm\";\r\nimport Label from \"sap/m/Label\";\r\nimport { IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport { PluginRegistry } from \"../core/PluginRegistry\";\r\n\r\n/**\r\n * Utility class strictly for constructing Form layouts without custom CSS.\r\n */\r\nexport class FormLayout {\r\n /**\r\n * Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.\r\n * @param fields The array of root fields to render as FormElements.\r\n * @returns A fully populated sap.ui.layout.form.SimpleForm.\r\n */\r\n public static build(fields: IFieldMetadata[]): SimpleForm {\r\n const form = new SimpleForm({\r\n editable: true,\r\n layout: \"ResponsiveGridLayout\",\r\n labelSpanXL: 4,\r\n labelSpanL: 4,\r\n labelSpanM: 4,\r\n labelSpanS: 12,\r\n adjustLabelSpan: false,\r\n emptySpanXL: 0,\r\n emptySpanL: 0,\r\n emptySpanM: 0,\r\n emptySpanS: 0,\r\n columnsXL: 1,\r\n columnsL: 1,\r\n columnsM: 1,\r\n singleContainerFullSize: false\r\n });\r\n\r\n const registry = PluginRegistry.getInstance();\r\n\r\n fields.forEach((field) => {\r\n // Respect Fiori accessibility standards by enforcing the required flag on labels\r\n const label = new Label({\r\n text: field.label,\r\n required: field.isRequired\r\n });\r\n\r\n // Instantiate the correct plugin for the data type\r\n const plugin = registry.getPlugin(field.type);\r\n \r\n // In the isolated state manager architecture, the binding path maps exactly to the fieldName.\r\n const control = plugin.render(field, `/${field.fieldName}`);\r\n\r\n form.addContent(label);\r\n form.addContent(control);\r\n });\r\n\r\n return form;\r\n }\r\n}\r\n"],"mappings":"AAAA,8KAQSA,EAAcC,EAAA,kBAKhB,MAAMC,EAMT,YAAcC,CAAMC,GAChB,MAAMC,EAAO,IAAIC,EAAW,CACxBC,SAAU,KACVC,OAAQ,uBACRC,YAAa,EACbC,WAAY,EACZC,WAAY,EACZC,WAAY,GACZC,gBAAiB,MACjBC,YAAa,EACbC,WAAY,EACZC,WAAY,EACZC,WAAY,EACZC,UAAW,EACXC,SAAU,EACVC,SAAU,EACVC,wBAAyB,QAG7B,MAAMC,EAAWtB,EAAeuB,cAEhCnB,EAAOoB,QAASC,IAEZ,MAAMC,EAAQ,IAAIC,EAAM,CACpBC,KAAMH,EAAMC,MACZG,SAAUJ,EAAMK,aAIpB,MAAMC,EAAST,EAASU,UAAUP,EAAMQ,MAGxC,MAAMC,EAAUH,EAAOI,OAAOV,EAAO,IAAIA,EAAMW,aAE/C/B,EAAKgC,WAAWX,GAChBrB,EAAKgC,WAAWH,KAGpB,OAAO7B,CACX,EACH,IAAAiC,EAAA,CAAAC,WAAA,MAAAD,EAAApC,aAAA,OAAAoC,CAAA","ignoreList":[],"sourceRoot":"layouts"}},{"offset":{"line":10,"column":0},"map":{"version":3,"names":["PluginRegistry","___core_PluginRegistry","TableLayout","build","tableMeta","table","Table","headerToolbar","Toolbar","content","Title","text","label","tableName","ToolbarSpacer","Button","icon","press","oEvent","btn","getSource","tbl","getParent","model","getModel","path","data","getProperty","push","setProperty","fixedLayout","mode","delete","item","getParameter","getBindingContext","getPath","parts","split","index","parseInt","pop","arrayPath","join","splice","templateCells","registry","getInstance","fields","forEach","field","column","Column","header","Text","demandPopin","isKey","minScreenWidth","popinDisplay","addColumn","plugin","getPlugin","type","control","render","fieldName","rowTemplate","ColumnListItem","cells","bindItems","template","templateShareable","__exports","__esModule"],"sources":["TableLayout.ts"],"sourcesContent":["/**\r\n * @file TableLayout.ts\r\n * @description Generates a responsive SAP Fiori Table layout.\r\n */\r\n\r\nimport Table from \"sap/m/Table\";\r\nimport Column from \"sap/m/Column\";\r\nimport Text from \"sap/m/Text\";\r\nimport ColumnListItem from \"sap/m/ColumnListItem\";\r\nimport Toolbar from \"sap/m/Toolbar\";\r\nimport Title from \"sap/m/Title\";\r\nimport ToolbarSpacer from \"sap/m/ToolbarSpacer\";\r\nimport Button from \"sap/m/Button\";\r\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\r\nimport { ITableMetadata, IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport { PluginRegistry } from \"../core/PluginRegistry\";\r\nimport Control from \"sap/ui/core/Control\";\r\n\r\n/**\r\n * Utility class strictly for constructing sap.m.Table structures with dynamic pop-in vectors.\r\n */\r\nexport class TableLayout {\r\n /**\r\n * Builds a responsive Table, dynamically calculating column priorities.\r\n * @param tableMeta The metadata defining the table's columns and nested fields.\r\n * @returns A fully constructed sap.m.Table ready to be bound to a list array.\r\n */\r\n public static build(tableMeta: ITableMetadata): Table {\r\n const table = new Table({\r\n headerToolbar: new Toolbar({\r\n content: [\r\n new Title({ text: tableMeta.label || tableMeta.tableName }),\r\n new ToolbarSpacer(),\r\n new Button({\r\n text: \"Add Row\",\r\n icon: \"sap-icon://add\",\r\n press: (oEvent: any) => {\r\n const btn = oEvent.getSource();\r\n const tbl = btn.getParent().getParent() as Table;\r\n const model = tbl.getModel(\"meta\") as JSONModel;\r\n const path = `/${tableMeta.tableName}`;\r\n const data = model.getProperty(path) || [];\r\n data.push({}); // append empty row\r\n model.setProperty(path, data);\r\n }\r\n })\r\n ]\r\n }),\r\n fixedLayout: false, // Allows native UI5 column width calculations\r\n mode: \"Delete\",\r\n delete: (oEvent: any) => {\r\n const item = oEvent.getParameter(\"listItem\");\r\n const path = item.getBindingContext(\"meta\").getPath(); // e.g. \"/Contacts/0\"\r\n const model = item.getModel(\"meta\") as JSONModel;\r\n \r\n const parts = path.split(\"/\");\r\n const index = parseInt(parts.pop() || \"0\", 10);\r\n const arrayPath = parts.join(\"/\");\r\n \r\n const data = model.getProperty(arrayPath);\r\n data.splice(index, 1);\r\n model.setProperty(arrayPath, data);\r\n }\r\n });\r\n\r\n const templateCells: Control[] = [];\r\n const registry = PluginRegistry.getInstance();\r\n\r\n tableMeta.fields.forEach((field: IFieldMetadata) => {\r\n // Build the column header\r\n const column = new Column({\r\n header: new Text({ text: field.label }),\r\n // Fiori UX: High priority for primary keys so they don't pop-in too early\r\n demandPopin: !field.isKey, \r\n minScreenWidth: field.isKey ? \"\" : \"Tablet\",\r\n popinDisplay: \"Inline\"\r\n });\r\n table.addColumn(column);\r\n\r\n // Instantiate the cell template (plugin)\r\n const plugin = registry.getPlugin(field.type);\r\n \r\n // In table lists, the binding path is relative to the row's context context (e.g. \"{fieldName}\")\r\n const control = plugin.render(field, field.fieldName);\r\n templateCells.push(control);\r\n });\r\n\r\n // Create the row template and bind it to the table via the tableName array path\r\n const rowTemplate = new ColumnListItem({\r\n cells: templateCells\r\n });\r\n\r\n // The absolute binding path from the StateManager for this table (using the named model 'meta')\r\n table.bindItems({\r\n path: `meta>/${tableMeta.tableName}`,\r\n template: rowTemplate,\r\n templateShareable: false\r\n });\r\n\r\n return table;\r\n }\r\n}\r\n"],"mappings":"AAAA,iRAeSA,EAAcC,EAAA,kBAMhB,MAAMC,EAMT,YAAcC,CAAMC,GAChB,MAAMC,EAAQ,IAAIC,EAAM,CACpBC,cAAe,IAAIC,EAAQ,CACvBC,QAAS,CACL,IAAIC,EAAM,CAAEC,KAAMP,EAAUQ,OAASR,EAAUS,YAC/C,IAAIC,EACJ,IAAIC,EAAO,CACPJ,KAAM,UACNK,KAAM,iBACNC,MAAQC,IACJ,MAAMC,EAAMD,EAAOE,YACnB,MAAMC,EAAMF,EAAIG,YAAYA,YAC5B,MAAMC,EAAQF,EAAIG,SAAS,QAC3B,MAAMC,EAAO,IAAIrB,EAAUS,YAC3B,MAAMa,EAAOH,EAAMI,YAAYF,IAAS,GACxCC,EAAKE,KAAK,CAAC,GACXL,EAAMM,YAAYJ,EAAMC,SAKxCI,YAAa,MACbC,KAAM,SACNC,OAASd,IACL,MAAMe,EAAOf,EAAOgB,aAAa,YACjC,MAAMT,EAAOQ,EAAKE,kBAAkB,QAAQC,UAC5C,MAAMb,EAAQU,EAAKT,SAAS,QAE5B,MAAMa,EAAQZ,EAAKa,MAAM,KACzB,MAAMC,EAAQC,SAASH,EAAMI,OAAS,IAAK,IAC3C,MAAMC,EAAYL,EAAMM,KAAK,KAE7B,MAAMjB,EAAOH,EAAMI,YAAYe,GAC/BhB,EAAKkB,OAAOL,EAAO,GACnBhB,EAAMM,YAAYa,EAAWhB,MAIrC,MAAMmB,EAA2B,GACjC,MAAMC,EAAW9C,EAAe+C,cAEhC3C,EAAU4C,OAAOC,QAASC,IAEtB,MAAMC,EAAS,IAAIC,EAAO,CACtBC,OAAQ,IAAIC,EAAK,CAAE3C,KAAMuC,EAAMtC,QAE/B2C,aAAcL,EAAMM,MACpBC,eAAgBP,EAAMM,MAAQ,GAAK,SACnCE,aAAc,WAElBrD,EAAMsD,UAAUR,GAGhB,MAAMS,EAASd,EAASe,UAAUX,EAAMY,MAGxC,MAAMC,EAAUH,EAAOI,OAAOd,EAAOA,EAAMe,WAC3CpB,EAAcjB,KAAKmC,KAIvB,MAAMG,EAAc,IAAIC,EAAe,CACnCC,MAAOvB,IAIXxC,EAAMgE,UAAU,CACZ5C,KAAM,SAASrB,EAAUS,YACzByD,SAAUJ,EACVK,kBAAmB,QAGvB,OAAOlE,CACX,EACH,IAAAmE,EAAA,CAAAC,WAAA,MAAAD,EAAAtE,cAAA,OAAAsE,CAAA","ignoreList":[],"sourceRoot":"layouts"}},{"offset":{"line":11,"column":0},"map":{"version":3,"names":["PluginRegistry","___core_PluginRegistry","StringPlugin","___plugins_StringPlugin","NumberPlugin","___plugins_NumberPlugin","BooleanPlugin","___plugins_BooleanPlugin","DropdownPlugin","___plugins_DropdownPlugin","DatePlugin","___plugins_DatePlugin","Core","initLibrary","name","version","dependencies","controls","elements","interfaces","registry","getInstance","register","__exports","window"],"sources":["library.ts"],"sourcesContent":["/**\r\n * @file library.ts\r\n * @description Standard SAP UI5 library registration file. Exposes the MetaUI namespace \r\n * and automatically bootstraps the internal PluginRegistry.\r\n */\r\n\r\nimport Core from \"sap/ui/core/Core\";\r\nimport { PluginRegistry } from \"./core/PluginRegistry\";\r\nimport { StringPlugin } from \"./plugins/StringPlugin\";\r\nimport { NumberPlugin } from \"./plugins/NumberPlugin\";\r\nimport { BooleanPlugin } from \"./plugins/BooleanPlugin\";\r\nimport { DropdownPlugin } from \"./plugins/DropdownPlugin\";\r\nimport { DatePlugin } from \"./plugins/DatePlugin\";\r\n\r\n// Delegate to standard library registration\r\nCore.initLibrary({\r\n name: \"nz.co.siliconst.ui5.metaui\",\r\n version: \"1.0.0\",\r\n dependencies: [\r\n \"sap.ui.core\",\r\n \"sap.m\",\r\n \"sap.ui.layout\",\r\n \"sap.ui.table\"\r\n ],\r\n controls: [\r\n \"nz.co.siliconst.ui5.metaui.controls.GeneratorHost\"\r\n ],\r\n elements: [],\r\n interfaces: []\r\n});\r\n\r\n/**\r\n * Global Bootstrapper: Maps all standard primitive types to their respective plugins.\r\n */\r\nconst registry = PluginRegistry.getInstance();\r\nregistry.register(\"string\", StringPlugin);\r\nregistry.register(\"number\", NumberPlugin);\r\nregistry.register(\"boolean\", BooleanPlugin);\r\nregistry.register(\"dropdown\", DropdownPlugin);\r\nregistry.register(\"date\", DatePlugin);\r\n\r\n// Exporting window object safely for UI5 compatibility if needed\r\nexport default (window as any)[\"nz\"][\"co\"][\"siliconst\"][\"ui5\"][\"metaui\"];\r\n"],"mappings":"AAAA,6QAOSA,EAAcC,EAAA,wBACdC,EAAYC,EAAA,sBACZC,EAAYC,EAAA,sBACZC,EAAaC,EAAA,uBACbC,EAAcC,EAAA,wBACdC,EAAUC,EAAA,cAGnBC,EAAKC,YAAY,CACbC,KAAM,6BACNC,QAAS,QACTC,aAAc,CACV,cACA,QACA,gBACA,gBAEJC,SAAU,CACN,qDAEJC,SAAU,GACVC,WAAY,KAMhB,MAAMC,EAAWpB,EAAeqB,cAChCD,EAASE,SAAS,SAAUpB,GAC5BkB,EAASE,SAAS,SAAUlB,GAC5BgB,EAASE,SAAS,UAAWhB,GAC7Bc,EAASE,SAAS,WAAYd,GAC9BY,EAASE,SAAS,OAAQZ,GAE1B,IAAAa,EACgBC,OAAe,MAAM,MAAM,aAAa,OAAO,UAAS,OAAAD,CAAA","ignoreList":[],"sourceRoot":""}},{"offset":{"line":12,"column":0},"map":{"version":3,"names":["EventBus","___core_EventBus","BasePlugin","control","metadata","onStateChange","newMetadata","this","applyState","publishChange","newValue","getInstance","publishFieldChange","fieldName","__exports","__esModule"],"sources":["BasePlugin.ts"],"sourcesContent":["/**\r\n * @file BasePlugin.ts\r\n * @description Abstract foundation for all MetaUI plugins, enforcing lifecycle hooks.\r\n */\r\n\r\nimport { IPlugin } from \"../interfaces/IPlugin\";\r\nimport { IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport { EventBus } from \"../core/EventBus\";\r\nimport Control from \"sap/ui/core/Control\";\r\n\r\n/**\r\n * Abstract class providing baseline properties and event publishing hooks for all UI5 controls.\r\n */\r\nexport abstract class BasePlugin implements IPlugin {\r\n /** The actual generated UI5 control. */\r\n protected control: Control | null = null;\r\n /** The schema configuration associated with this specific field. */\r\n protected metadata: IFieldMetadata | null = null;\r\n\r\n /**\r\n * Must be implemented by concrete classes to generate the specific control.\r\n * @param fieldMetadata The immutable schema configuration.\r\n * @param bindingPath The exact model path where this field's data is stored.\r\n */\r\n public abstract render(fieldMetadata: IFieldMetadata, bindingPath: string): Control;\r\n\r\n /**\r\n * Must be implemented by concrete classes to run data integrity checks.\r\n */\r\n public abstract validate(): boolean;\r\n\r\n /**\r\n * Triggered by the ConditionEngine when cross-field rules alter this field's metadata.\r\n * @param newMetadata The dynamically updated rules.\r\n */\r\n public onStateChange(newMetadata: IFieldMetadata): void {\r\n this.metadata = newMetadata;\r\n this.applyState();\r\n }\r\n\r\n /**\r\n * Abstract hook for concrete plugins to re-bind their visibility or read-only states natively.\r\n */\r\n protected abstract applyState(): void;\r\n\r\n /**\r\n * Utility method for concrete plugins to easily broadcast changes to the EventBus.\r\n * @param newValue The newly entered/selected value.\r\n */\r\n protected publishChange(newValue: any): void {\r\n if (this.metadata) {\r\n EventBus.getInstance().publishFieldChange({\r\n fieldName: this.metadata.fieldName,\r\n newValue: newValue\r\n });\r\n }\r\n }\r\n}\r\n"],"mappings":"AAAA,gHAAA,MAOSA,EAAQC,EAAA,YAMV,MAAeC,EAERC,QAA0B,KAE1BC,SAAkC,KAkBrCC,cAAcC,GACjBC,KAAKH,SAAWE,EAChBC,KAAKC,YACT,CAWUC,cAAcC,GACpB,GAAIH,KAAKH,SAAU,CACfJ,EAASW,cAAcC,mBAAmB,CACtCC,UAAWN,KAAKH,SAASS,UACzBH,SAAUA,GAElB,CACJ,EACH,IAAAI,EAAA,CAAAC,WAAA,MAAAD,EAAAZ,aAAA,OAAAY,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":13,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","BooleanPlugin","render","fieldMetadata","bindingPath","this","metadata","control","Switch","state","enabled","isReadOnly","change","oEvent","val","getParameter","publishChange","validate","applyState","sw","setEnabled","__exports","__esModule"],"sources":["BooleanPlugin.ts"],"sourcesContent":["/**\r\n * @file BooleanPlugin.ts\r\n * @description Renders a sap.m.Switch for boolean states.\r\n */\r\n\r\nimport { BasePlugin } from \"./BasePlugin\";\r\nimport { IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport Switch from \"sap/m/Switch\";\r\nimport Control from \"sap/ui/core/Control\";\r\n\r\n/**\r\n * Handles rendering logic for toggleable booleans.\r\n */\r\nexport class BooleanPlugin extends BasePlugin {\r\n public render(fieldMetadata: IFieldMetadata, bindingPath: string): Control {\r\n this.metadata = fieldMetadata;\r\n \r\n this.control = new Switch({\r\n state: `{meta>${bindingPath}}`,\r\n enabled: !fieldMetadata.isReadOnly,\r\n change: (oEvent: any) => {\r\n const val = oEvent.getParameter(\"state\");\r\n this.publishChange(val);\r\n this.validate();\r\n }\r\n });\r\n\r\n return this.control;\r\n }\r\n\r\n public validate(): boolean {\r\n // Boolean switches inherently have a state (true/false) so they rarely fail validation.\r\n return true;\r\n }\r\n\r\n protected applyState(): void {\r\n if (this.control && this.metadata) {\r\n const sw = this.control as Switch;\r\n sw.setEnabled(!this.metadata.isReadOnly);\r\n }\r\n }\r\n}\r\n"],"mappings":"AAAA,gIAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAsBF,EACxBG,OAAOC,EAA+BC,GACzCC,KAAKC,SAAWH,EAEhBE,KAAKE,QAAU,IAAIC,EAAO,CACtBC,MAAO,SAASL,KAChBM,SAAUP,EAAcQ,WACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChCV,KAAKW,cAAcF,GACnBT,KAAKY,cAIb,OAAOZ,KAAKE,OAChB,CAEOU,WAEH,OAAO,IACX,CAEUC,aACN,GAAIb,KAAKE,SAAWF,KAAKC,SAAU,CAC/B,MAAMa,EAAKd,KAAKE,QAChBY,EAAGC,YAAYf,KAAKC,SAASK,WACjC,CACJ,EACH,IAAAU,EAAA,CAAAC,WAAA,MAAAD,EAAApB,gBAAA,OAAAoB,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":14,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","DatePlugin","render","fieldMetadata","bindingPath","this","metadata","control","DatePicker","value","valueFormat","displayFormat","editable","isReadOnly","required","isRequired","change","oEvent","val","getParameter","publishChange","validate","dp","isValid","isValidValue","getValue","trim","setValueState","setValueStateText","applyState","setEditable","setRequired","__exports","__esModule"],"sources":["DatePlugin.ts"],"sourcesContent":["/**\r\n * @file DatePlugin.ts\r\n * @description Renders a sap.m.DatePicker natively bound to ISO date strings.\r\n */\r\n\r\nimport { BasePlugin } from \"./BasePlugin\";\r\nimport { IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport DatePicker from \"sap/m/DatePicker\";\r\nimport Control from \"sap/ui/core/Control\";\r\n\r\n/**\r\n * Handles rendering logic for Date strings.\r\n */\r\nexport class DatePlugin extends BasePlugin {\r\n public render(fieldMetadata: IFieldMetadata, bindingPath: string): Control {\r\n this.metadata = fieldMetadata;\r\n \r\n this.control = new DatePicker({\r\n value: `{meta>${bindingPath}}`,\r\n valueFormat: \"yyyy-MM-dd\",\r\n displayFormat: \"long\",\r\n editable: !fieldMetadata.isReadOnly,\r\n required: fieldMetadata.isRequired,\r\n change: (oEvent: any) => {\r\n const val = oEvent.getParameter(\"value\");\r\n this.publishChange(val);\r\n this.validate();\r\n }\r\n });\r\n\r\n return this.control;\r\n }\r\n\r\n public validate(): boolean {\r\n if (!this.control || !this.metadata) return true;\r\n const dp = this.control as DatePicker;\r\n const isValid = dp.isValidValue();\r\n const val = dp.getValue();\r\n\r\n if (this.metadata.isRequired && (!val || val.trim() === \"\")) {\r\n dp.setValueState(\"Error\" as any);\r\n dp.setValueStateText(\"A valid date is required.\");\r\n return false;\r\n }\r\n\r\n if (val && !isValid) {\r\n dp.setValueState(\"Error\" as any);\r\n dp.setValueStateText(\"Invalid date format.\");\r\n return false;\r\n }\r\n\r\n dp.setValueState(\"None\" as any);\r\n return true;\r\n }\r\n\r\n protected applyState(): void {\r\n if (this.control && this.metadata) {\r\n const dp = this.control as DatePicker;\r\n dp.setEditable(!this.metadata.isReadOnly);\r\n dp.setRequired(this.metadata.isRequired);\r\n }\r\n }\r\n}\r\n"],"mappings":"AAAA,iIAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAmBF,EACrBG,OAAOC,EAA+BC,GACzCC,KAAKC,SAAWH,EAEhBE,KAAKE,QAAU,IAAIC,EAAW,CAC1BC,MAAO,SAASL,KAChBM,YAAa,aACbC,cAAe,OACfC,UAAWT,EAAcU,WACzBC,SAAUX,EAAcY,WACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChCd,KAAKe,cAAcF,GACnBb,KAAKgB,cAIb,OAAOhB,KAAKE,OAChB,CAEOc,WACH,IAAKhB,KAAKE,UAAYF,KAAKC,SAAU,OAAO,KAC5C,MAAMgB,EAAKjB,KAAKE,QAChB,MAAMgB,EAAUD,EAAGE,eACnB,MAAMN,EAAMI,EAAGG,WAEf,GAAIpB,KAAKC,SAASS,cAAgBG,GAAOA,EAAIQ,SAAW,IAAK,CACzDJ,EAAGK,cAAc,SACjBL,EAAGM,kBAAkB,6BACrB,OAAO,KACX,CAEA,GAAIV,IAAQK,EAAS,CACjBD,EAAGK,cAAc,SACjBL,EAAGM,kBAAkB,wBACrB,OAAO,KACX,CAEAN,EAAGK,cAAc,QACjB,OAAO,IACX,CAEUE,aACN,GAAIxB,KAAKE,SAAWF,KAAKC,SAAU,CAC/B,MAAMgB,EAAKjB,KAAKE,QAChBe,EAAGQ,aAAazB,KAAKC,SAASO,YAC9BS,EAAGS,YAAY1B,KAAKC,SAASS,WACjC,CACJ,EACH,IAAAiB,EAAA,CAAAC,WAAA,MAAAD,EAAA/B,aAAA,OAAA+B,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":15,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","DropdownPlugin","render","fieldMetadata","bindingPath","this","metadata","select","Select","selectedKey","enabled","isReadOnly","change","oEvent","item","getParameter","val","getKey","publishChange","validate","valueHelp","Array","isArray","isRequired","addItem","Item","key","text","forEach","vh","control","getSelectedKey","trim","setValueState","setValueStateText","applyState","setEnabled","__exports","__esModule"],"sources":["DropdownPlugin.ts"],"sourcesContent":["/**\r\n * @file DropdownPlugin.ts\r\n * @description Renders a sap.m.Select utilizing the schema's valueHelp structure.\r\n */\r\n\r\nimport { BasePlugin } from \"./BasePlugin\";\r\nimport { IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport Select from \"sap/m/Select\";\r\nimport Item from \"sap/ui/core/Item\";\r\nimport Control from \"sap/ui/core/Control\";\r\n\r\n/**\r\n * Handles rendering logic for dropdown inputs.\r\n */\r\nexport class DropdownPlugin extends BasePlugin {\r\n public render(fieldMetadata: IFieldMetadata, bindingPath: string): Control {\r\n this.metadata = fieldMetadata;\r\n \r\n const select = new Select({\r\n selectedKey: `{meta>${bindingPath}}`,\r\n enabled: !fieldMetadata.isReadOnly,\r\n change: (oEvent: any) => {\r\n const item = oEvent.getParameter(\"selectedItem\");\r\n const val = item ? item.getKey() : \"\";\r\n this.publishChange(val);\r\n this.validate();\r\n }\r\n });\r\n\r\n if (fieldMetadata.valueHelp && Array.isArray(fieldMetadata.valueHelp)) {\r\n if (!fieldMetadata.isRequired) {\r\n select.addItem(new Item({ key: \"\", text: \"--- Select ---\" }));\r\n }\r\n \r\n fieldMetadata.valueHelp.forEach(vh => {\r\n select.addItem(new Item({ key: vh.key, text: vh.text }));\r\n });\r\n }\r\n\r\n this.control = select;\r\n return this.control;\r\n }\r\n\r\n public validate(): boolean {\r\n if (!this.control || !this.metadata) return true;\r\n const select = this.control as Select;\r\n const val = select.getSelectedKey();\r\n\r\n if (this.metadata.isRequired && (!val || val.trim() === \"\")) {\r\n select.setValueState(\"Error\" as any);\r\n select.setValueStateText(\"Selection is required.\");\r\n return false;\r\n }\r\n\r\n select.setValueState(\"None\" as any);\r\n return true;\r\n }\r\n\r\n protected applyState(): void {\r\n if (this.control && this.metadata) {\r\n const select = this.control as Select;\r\n select.setEnabled(!this.metadata.isReadOnly);\r\n }\r\n }\r\n}\r\n"],"mappings":"AAAA,sJAAA,MAKSA,EAAUC,EAAA,cASZ,MAAMC,UAAuBF,EACzBG,OAAOC,EAA+BC,GACzCC,KAAKC,SAAWH,EAEhB,MAAMI,EAAS,IAAIC,EAAO,CACtBC,YAAa,SAASL,KACtBM,SAAUP,EAAcQ,WACxBC,OAASC,IACL,MAAMC,EAAOD,EAAOE,aAAa,gBACjC,MAAMC,EAAMF,EAAOA,EAAKG,SAAW,GACnCZ,KAAKa,cAAcF,GACnBX,KAAKc,cAIb,GAAIhB,EAAciB,WAAaC,MAAMC,QAAQnB,EAAciB,WAAY,CACnE,IAAKjB,EAAcoB,WAAY,CAC3BhB,EAAOiB,QAAQ,IAAIC,EAAK,CAAEC,IAAK,GAAIC,KAAM,mBAC7C,CAEAxB,EAAciB,UAAUQ,QAAQC,IAC5BtB,EAAOiB,QAAQ,IAAIC,EAAK,CAAEC,IAAKG,EAAGH,IAAKC,KAAME,EAAGF,SAExD,CAEAtB,KAAKyB,QAAUvB,EACf,OAAOF,KAAKyB,OAChB,CAEOX,WACH,IAAKd,KAAKyB,UAAYzB,KAAKC,SAAU,OAAO,KAC5C,MAAMC,EAASF,KAAKyB,QACpB,MAAMd,EAAMT,EAAOwB,iBAEnB,GAAI1B,KAAKC,SAASiB,cAAgBP,GAAOA,EAAIgB,SAAW,IAAK,CACzDzB,EAAO0B,cAAc,SACrB1B,EAAO2B,kBAAkB,0BACzB,OAAO,KACX,CAEA3B,EAAO0B,cAAc,QACrB,OAAO,IACX,CAEUE,aACN,GAAI9B,KAAKyB,SAAWzB,KAAKC,SAAU,CAC/B,MAAMC,EAASF,KAAKyB,QACpBvB,EAAO6B,YAAY/B,KAAKC,SAASK,WACrC,CACJ,EACH,IAAA0B,EAAA,CAAAC,WAAA,MAAAD,EAAApC,iBAAA,OAAAoC,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":16,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","NumberPlugin","render","fieldMetadata","bindingPath","this","metadata","control","StepInput","value","displayValuePrecision","scale","editable","isReadOnly","required","isRequired","change","oEvent","val","getParameter","publishChange","validate","input","getValue","undefined","setValueState","setValueStateText","applyState","setEditable","setRequired","__exports","__esModule"],"sources":["NumberPlugin.ts"],"sourcesContent":["/**\r\n * @file NumberPlugin.ts\r\n * @description Renders a sap.m.StepInput for numeric data.\r\n */\r\n\r\nimport { BasePlugin } from \"./BasePlugin\";\r\nimport { IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport StepInput from \"sap/m/StepInput\";\r\nimport Control from \"sap/ui/core/Control\";\r\n\r\n/**\r\n * Handles rendering and logic for numeric inputs with precision and scale.\r\n */\r\nexport class NumberPlugin extends BasePlugin {\r\n public render(fieldMetadata: IFieldMetadata, bindingPath: string): Control {\r\n this.metadata = fieldMetadata;\r\n \r\n this.control = new StepInput({\r\n value: `{meta>${bindingPath}}`,\r\n displayValuePrecision: fieldMetadata.scale || 0,\r\n editable: !fieldMetadata.isReadOnly,\r\n required: fieldMetadata.isRequired,\r\n change: (oEvent: any) => {\r\n const val = oEvent.getParameter(\"value\");\r\n this.publishChange(val);\r\n this.validate();\r\n }\r\n });\r\n\r\n return this.control;\r\n }\r\n\r\n public validate(): boolean {\r\n if (!this.control || !this.metadata) return true;\r\n const input = this.control as StepInput;\r\n const val = input.getValue();\r\n\r\n if (this.metadata.isRequired && (val === null || val === undefined)) {\r\n input.setValueState(\"Error\" as any);\r\n input.setValueStateText(\"This field is required.\");\r\n return false;\r\n }\r\n\r\n input.setValueState(\"None\" as any);\r\n return true;\r\n }\r\n\r\n protected applyState(): void {\r\n if (this.control && this.metadata) {\r\n const input = this.control as StepInput;\r\n input.setEditable(!this.metadata.isReadOnly);\r\n input.setRequired(this.metadata.isRequired);\r\n }\r\n }\r\n}\r\n"],"mappings":"AAAA,kIAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAqBF,EACvBG,OAAOC,EAA+BC,GACzCC,KAAKC,SAAWH,EAEhBE,KAAKE,QAAU,IAAIC,EAAU,CACzBC,MAAO,SAASL,KAChBM,sBAAuBP,EAAcQ,OAAS,EAC9CC,UAAWT,EAAcU,WACzBC,SAAUX,EAAcY,WACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChCd,KAAKe,cAAcF,GACnBb,KAAKgB,cAIb,OAAOhB,KAAKE,OAChB,CAEOc,WACH,IAAKhB,KAAKE,UAAYF,KAAKC,SAAU,OAAO,KAC5C,MAAMgB,EAAQjB,KAAKE,QACnB,MAAMW,EAAMI,EAAMC,WAElB,GAAIlB,KAAKC,SAASS,aAAeG,IAAQ,MAAQA,IAAQM,WAAY,CACjEF,EAAMG,cAAc,SACpBH,EAAMI,kBAAkB,2BACxB,OAAO,KACX,CAEAJ,EAAMG,cAAc,QACpB,OAAO,IACX,CAEUE,aACN,GAAItB,KAAKE,SAAWF,KAAKC,SAAU,CAC/B,MAAMgB,EAAQjB,KAAKE,QACnBe,EAAMM,aAAavB,KAAKC,SAASO,YACjCS,EAAMO,YAAYxB,KAAKC,SAASS,WACpC,CACJ,EACH,IAAAe,EAAA,CAAAC,WAAA,MAAAD,EAAA7B,eAAA,OAAA6B,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":17,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","StringPlugin","render","fieldMetadata","bindingPath","this","metadata","control","Input","value","maxLength","editable","isReadOnly","required","isRequired","change","oEvent","val","getParameter","publishChange","validate","input","getValue","trim","setValueState","setValueStateText","applyState","setEditable","setRequired","__exports","__esModule"],"sources":["StringPlugin.ts"],"sourcesContent":["/**\r\n * @file StringPlugin.ts\r\n * @description Renders a sap.m.Input for string data and validates lengths.\r\n */\r\n\r\nimport { BasePlugin } from \"./BasePlugin\";\r\nimport { IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport Input from \"sap/m/Input\";\r\nimport Control from \"sap/ui/core/Control\";\r\n\r\n/**\r\n * Handles rendering and logic for basic text inputs.\r\n */\r\nexport class StringPlugin extends BasePlugin {\r\n public render(fieldMetadata: IFieldMetadata, bindingPath: string): Control {\r\n this.metadata = fieldMetadata;\r\n \r\n this.control = new Input({\r\n value: `{meta>${bindingPath}}`,\r\n maxLength: fieldMetadata.maxLength || 0,\r\n editable: !fieldMetadata.isReadOnly,\r\n required: fieldMetadata.isRequired,\r\n change: (oEvent: any) => {\r\n const val = oEvent.getParameter(\"value\");\r\n this.publishChange(val);\r\n this.validate();\r\n }\r\n });\r\n\r\n return this.control;\r\n }\r\n\r\n public validate(): boolean {\r\n if (!this.control || !this.metadata) return true;\r\n const input = this.control as Input;\r\n const val = input.getValue();\r\n\r\n if (this.metadata.isRequired && (!val || val.trim() === \"\")) {\r\n input.setValueState(\"Error\" as any);\r\n input.setValueStateText(\"This field is required.\");\r\n return false;\r\n }\r\n\r\n input.setValueState(\"None\" as any);\r\n return true;\r\n }\r\n\r\n protected applyState(): void {\r\n if (this.control && this.metadata) {\r\n const input = this.control as Input;\r\n input.setEditable(!this.metadata.isReadOnly);\r\n input.setRequired(this.metadata.isRequired);\r\n }\r\n }\r\n}\r\n"],"mappings":"AAAA,8HAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAqBF,EACvBG,OAAOC,EAA+BC,GACzCC,KAAKC,SAAWH,EAEhBE,KAAKE,QAAU,IAAIC,EAAM,CACrBC,MAAO,SAASL,KAChBM,UAAWP,EAAcO,WAAa,EACtCC,UAAWR,EAAcS,WACzBC,SAAUV,EAAcW,WACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChCb,KAAKc,cAAcF,GACnBZ,KAAKe,cAIb,OAAOf,KAAKE,OAChB,CAEOa,WACH,IAAKf,KAAKE,UAAYF,KAAKC,SAAU,OAAO,KAC5C,MAAMe,EAAQhB,KAAKE,QACnB,MAAMU,EAAMI,EAAMC,WAElB,GAAIjB,KAAKC,SAASQ,cAAgBG,GAAOA,EAAIM,SAAW,IAAK,CACzDF,EAAMG,cAAc,SACpBH,EAAMI,kBAAkB,2BACxB,OAAO,KACX,CAEAJ,EAAMG,cAAc,QACpB,OAAO,IACX,CAEUE,aACN,GAAIrB,KAAKE,SAAWF,KAAKC,SAAU,CAC/B,MAAMe,EAAQhB,KAAKE,QACnBc,EAAMM,aAAatB,KAAKC,SAASM,YACjCS,EAAMO,YAAYvB,KAAKC,SAASQ,WACpC,CACJ,EACH,IAAAe,EAAA,CAAAC,WAAA,MAAAD,EAAA5B,eAAA,OAAA4B,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":18,"column":0},"map":{"version":3,"names":[],"sources":["library-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":20,"column":0},"map":{"version":3,"file":"IEventBus.js","names":[],"sources":[],"mappings":"AAAA","ignoreList":[],"sourceRoot":"interfaces"}},{"offset":{"line":23,"column":0},"map":{"version":3,"file":"ILayoutManager.js","names":[],"sources":[],"mappings":"AAAA","ignoreList":[],"sourceRoot":"interfaces"}},{"offset":{"line":26,"column":0},"map":{"version":3,"file":"IPlugin.js","names":[],"sources":[],"mappings":"AAAA","ignoreList":[],"sourceRoot":"interfaces"}},{"offset":{"line":29,"column":0},"map":{"version":3,"file":"ISchema.js","names":[],"sources":[],"mappings":"AAAA","ignoreList":[],"sourceRoot":"interfaces"}}]}
1
+ {"version":3,"file":"library-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"names":["SchemaNormalizer","___core_SchemaNormalizer","Engine","___core_Engine","StateManager","___core_StateManager","BaseLayout","___layouts_BaseLayout","GeneratorHost","Control","extend","constructor","prototype","apply","this","arguments","stateManager","generatedContent","engine","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","initialData","initialDataJson","outputData","outputDataJson","useMessageManager","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","init","_init","Control.prototype.init.call","exit","_exit","destroy","getModel","onBeforeRendering","_onBeforeRendering","getProperty","generate","triggerSubmit","_triggerSubmit","isPrevented","messageManager","sap","ui","getCore","getMessageManager","removeAllMessages","pushMessage","path","text","require","Message","addMessages","message","target","getId","processor","validateAll","extractPayload","JSON","stringify","fireEvent","propertyPath","errorMessage","Log","warning","setProperty","_generate","rawSchema","parse","e","error","normalizedSchema","normalize","modelName","setModel","layoutFactory","build","setAggregation","errorPage","MessagePage","description","icon","openInDialog","_openInDialog","title","submitButtonText","dialog","Dialog","contentWidth","beginButton","Button","press","success","endButton","afterClose","open"],"sources":["GeneratorHost.ts"],"sourcesContent":["/**\n * @file GeneratorHost.ts\n * @description The core UI5 custom control that exposes the MetaUI engine to host applications.\n */\n\nimport Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport Dialog from \"sap/m/Dialog\";\nimport Button from \"sap/m/Button\";\nimport MessagePage from \"sap/m/MessagePage\";\nimport Log from \"sap/base/Log\";\nimport { SchemaNormalizer } from \"../core/SchemaNormalizer\";\nimport { Engine } from \"../core/Engine\";\nimport { StateManager } from \"../core/StateManager\";\nimport { BaseLayout } from \"../layouts/BaseLayout\";\n\n/**\n * Wrapper element for embedding or popping the dynamic form.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls\n */\nexport default class GeneratorHost extends Control {\n \n private stateManager: StateManager | null = null;\n private generatedContent: Control | null = null;\n private engine: Engine | null = null;\n\n static readonly metadata = {\n properties: {\n /** The raw JSON metadata schema provided by the ABAP backend. */\n schemaDefinition: { type: \"any\", defaultValue: null },\n /** The initial data payload to populate the fields as an object. */\n initialData: { type: \"any\", defaultValue: null },\n /** The initial data payload provided as a raw JSON string. */\n initialDataJson: { type: \"string\", defaultValue: null },\n /** The final payload data object, updated on submit. */\n outputData: { type: \"object\", defaultValue: null },\n /** The final payload JSON string, updated on submit. */\n outputDataJson: { type: \"string\", defaultValue: null },\n /** If true, validation errors will be pushed to the global sap.ui.core.message.MessageManager. */\n useMessageManager: { type: \"boolean\", defaultValue: false }\n },\n aggregations: {\n /** The internal hidden container holding the generated layouts. */\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n /** Triggered before final submission, allowing host apps to run custom validation logic and halt submission if needed. */\n beforeSubmit: {\n parameters: {\n /** The clean extracted JSON payload representing the current state. */\n payload: { type: \"object\" },\n /** Function to add a custom validation error message for a specific field path. */\n addError: { type: \"function\" },\n /** Function to prevent the default submission and dialog closure. */\n preventDefault: { type: \"function\" }\n }\n },\n /** Triggered when the user submits the form via the Dialog modality. */\n submit: {\n parameters: {\n /** The clean extracted JSON payload representing the current state. */\n payload: { type: \"object\" },\n /** The stringified final JSON payload. */\n payloadJson: { type: \"string\" }\n }\n },\n /** Triggered if the dialog is cancelled. */\n cancel: {}\n }\n };\n\n /**\n * Standard UI5 control renderer. Renders the generated internal content.\n */\n static renderer = {\n apiVersion: 2,\n render(rm: RenderManager, control: GeneratorHost) {\n rm.openStart(\"div\", control);\n rm.style(\"width\", \"100%\");\n rm.style(\"height\", \"100%\");\n rm.openEnd();\n \n const content = control.getAggregation(\"_content\") as Control;\n if (content) {\n rm.renderControl(content);\n }\n \n rm.close(\"div\");\n }\n };\n\n /**\n * Initializes the UI5 control.\n */\n public init(): void {\n super.init();\n }\n\n /**\n * Standard UI5 lifecycle hook for destruction.\n * Guaranteed to tear down isolated models and unbind global event listeners.\n */\n public exit(): void {\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n if (this.generatedContent) {\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /**\n * Lifecycle hook to automatically generate the layout if bound declaratively in XML.\n */\n public onBeforeRendering(): void {\n if (!this.generatedContent && this.getProperty(\"schemaDefinition\")) {\n this.generate();\n }\n }\n\n /**\n * Extracts the payload, pushes it to properties, and fires the submit event manually.\n * Returns true if submission was successful, false if validation failed or was prevented.\n */\n public triggerSubmit(): boolean {\n if (this.stateManager && this.engine) {\n let isPrevented = false;\n const useMessageManager = this.getProperty(\"useMessageManager\") as boolean;\n let messageManager: any = null;\n \n if (useMessageManager) {\n messageManager = sap.ui.getCore().getMessageManager();\n messageManager.removeAllMessages();\n }\n\n // Helper to add messages securely via async require so it isn't a hard dependency\n const pushMessage = (path: string, text: string) => {\n if (useMessageManager && messageManager) {\n sap.ui.require([\"sap/ui/core/message/Message\"], (Message: any) => {\n messageManager.addMessages(new Message({\n message: text,\n type: \"Error\" as any,\n target: `${this.stateManager?.getModel().getId()}>/${path}`,\n processor: this.stateManager?.getModel()\n }));\n });\n }\n };\n\n // 1. Run global schema validation\n if (!this.engine.validateAll()) {\n pushMessage(\"\", \"One or more fields failed schema validation. Please review the highlighted fields.\");\n return false; // Schema validation failed, inputs already turned red\n }\n\n const payload = this.stateManager.extractPayload();\n const payloadJson = JSON.stringify(payload);\n \n // 2. Fire beforeSubmit exit\n this.fireEvent(\"beforeSubmit\", {\n payload,\n preventDefault: () => {\n isPrevented = true;\n },\n addError: (propertyPath: string, errorMessage: string) => {\n isPrevented = true;\n if (useMessageManager && messageManager) {\n pushMessage(propertyPath, errorMessage);\n } else {\n Log.warning(`[MetaUI] Validation Error for ${propertyPath}: ${errorMessage}`, \"GeneratorHost\");\n }\n }\n });\n\n if (isPrevented) {\n return false; // Exit validation failed or prevented submission\n }\n \n // Push final values to properties (updating XML bindings)\n this.setProperty(\"outputData\", payload, true);\n this.setProperty(\"outputDataJson\", payloadJson, true);\n \n this.fireEvent(\"submit\", { payload, payloadJson });\n return true;\n }\n return false;\n }\n\n /**\n * Triggers the engine to parse the schema and build the layout.\n * Safely wrapped in a try/catch to prevent Launchpad crashes.\n */\n public generate(): void {\n try {\n const rawSchema = this.getProperty(\"schemaDefinition\");\n \n let initialData = this.getProperty(\"initialData\");\n const initialDataJson = this.getProperty(\"initialDataJson\");\n \n if (initialDataJson) {\n try {\n initialData = JSON.parse(initialDataJson);\n } catch (e) {\n Log.error(\"[MetaUI] Failed to parse initialDataJson string.\", (e as Error).message, \"GeneratorHost\");\n }\n } else if (typeof initialData === \"string\") {\n try {\n initialData = JSON.parse(initialData);\n } catch (e) {\n Log.error(\"[MetaUI] Failed to parse initialData string.\", (e as Error).message, \"GeneratorHost\");\n }\n }\n\n // 1. Normalize schema (allows fallback to data inference)\n const normalizedSchema = SchemaNormalizer.normalize(rawSchema, initialData);\n\n // 2. Bootstrap isolated State Manager\n this.stateManager = new StateManager(initialData || {});\n \n // Dynamically generate a 100% unique model name for isolation\n const modelName = \"metaUI_\" + this.getId();\n this.setModel(this.stateManager.getModel(), modelName);\n\n // 3. Delegate to Layout Engine\n this.engine = new Engine();\n const layoutFactory = new BaseLayout();\n \n this.generatedContent = this.engine.build(normalizedSchema, layoutFactory, modelName);\n\n // 4. Mount into hidden aggregation\n this.setAggregation(\"_content\", this.generatedContent);\n\n } catch (error) {\n Log.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", (error as Error).message, \"GeneratorHost\");\n \n const errorPage = new MessagePage({\n text: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\",\n icon: \"sap-icon://error\"\n });\n\n this.setAggregation(\"_content\", errorPage);\n }\n }\n\n /**\n * Dialog Modality: Opens the generated layout inside a sap.m.Dialog.\n * Automatically wires up 'Save' and 'Cancel' buttons.\n */\n public openInDialog(title: string = \"Dynamic Form\", submitButtonText: string = \"Save\"): void {\n if (!this.generatedContent) {\n this.generate();\n }\n\n const dialog = new Dialog({\n title: title,\n contentWidth: \"800px\",\n content: [this], // Mount self inside the dialog\n beginButton: new Button({\n text: submitButtonText,\n type: \"Emphasized\",\n press: () => {\n const success = this.triggerSubmit();\n if (success) {\n dialog.close();\n }\n }\n }),\n endButton: new Button({\n text: \"Cancel\",\n press: () => {\n this.fireEvent(\"cancel\");\n dialog.close();\n }\n }),\n afterClose: () => {\n dialog.destroy();\n }\n });\n\n dialog.open();\n }\n}\n"],"mappings":"AAAA,ySAWSA,EAAgBC,EAAA,0BAChBC,EAAMC,EAAA,gBACNC,EAAYC,EAAA,sBACZC,EAAUC,EAAA,cAEnB,MAKqBC,EAAsBC,EAAOC,OAAA,qDAAAC,YAAA,SAAAA,IAAAF,EAAAG,UAAAD,YAAAE,MAAAC,KAAAC,WAAAD,KAEtCE,aAAoC,KAAIF,KACxCG,iBAAmC,KAAIH,KACvCI,OAAwB,IAAI,EAkD7BC,SAAW,CACdC,WAAY,EACZC,OAAOC,EAAmBC,GACtBD,EAAGE,UAAU,MAAOD,GACpBD,EAAGG,MAAM,QAAS,QAClBH,EAAGG,MAAM,SAAU,QACnBH,EAAGI,UAEH,MAAMC,EAAUJ,EAAQK,eAAe,YACvC,GAAID,EAAS,CACTL,EAAGO,cAAcF,EACrB,CAEAL,EAAGQ,MAAM,MACb,GA9DYC,SAAW,CACvBC,WAAY,CAERC,iBAAkB,CAAEC,KAAM,MAAOC,aAAc,MAE/CC,YAAa,CAAEF,KAAM,MAAOC,aAAc,MAE1CE,gBAAiB,CAAEH,KAAM,SAAUC,aAAc,MAEjDG,WAAY,CAAEJ,KAAM,SAAUC,aAAc,MAE5CI,eAAgB,CAAEL,KAAM,SAAUC,aAAc,MAEhDK,kBAAmB,CAAEN,KAAM,UAAWC,aAAc,QAExDM,aAAc,CAEVC,SAAU,CAAER,KAAM,sBAAuBS,SAAU,MAAOC,WAAY,WAE1EC,OAAQ,CAEJC,aAAc,CACVC,WAAY,CAERC,QAAS,CAAEd,KAAM,UAEjBe,SAAU,CAAEf,KAAM,YAElBgB,eAAgB,CAAEhB,KAAM,cAIhCiB,OAAQ,CACJJ,WAAY,CAERC,QAAS,CAAEd,KAAM,UAEjBkB,YAAa,CAAElB,KAAM,YAI7BmB,OAAQ,CAAC,IA2BVC,KAAI,SAAAC,IACPC,sBAAA1C,KACJ,EAMO2C,KAAI,SAAAC,IACP,GAAI5C,KAAKI,OAAQ,CACbJ,KAAKI,OAAOyC,UACZ7C,KAAKI,OAAS,IAClB,CAEA,GAAIJ,KAAKE,aAAc,CACnBF,KAAKE,aAAa4C,WAAWD,UAC7B7C,KAAKE,aAAe,IACxB,CAEA,GAAIF,KAAKG,iBAAkB,CACvBH,KAAKG,iBAAiB0C,UACtB7C,KAAKG,iBAAmB,IAC5B,CACJ,EAKO4C,kBAAiB,SAAAC,IACpB,IAAKhD,KAAKG,kBAAoBH,KAAKiD,YAAY,oBAAqB,CAChEjD,KAAKkD,UACT,CACJ,EAMOC,cAAa,SAAAC,IAChB,GAAIpD,KAAKE,cAAgBF,KAAKI,OAAQ,CAClC,IAAIiD,EAAc,MAClB,MAAM3B,EAAoB1B,KAAKiD,YAAY,qBAC3C,IAAIK,EAAsB,KAE1B,GAAI5B,EAAmB,CACnB4B,EAAiBC,IAAIC,GAAGC,UAAUC,oBAClCJ,EAAeK,mBACnB,CAGA,MAAMC,EAAcA,CAACC,EAAcC,KAC/B,GAAIpC,GAAqB4B,EAAgB,CACrCC,IAAIC,GAAGO,QAAQ,CAAC,+BAAiCC,IAC7CV,EAAeW,YAAY,IAAID,EAAQ,CACnCE,QAASJ,EACT1C,KAAM,QACN+C,OAAQ,GAAGnE,KAAKE,cAAc4C,WAAWsB,YAAYP,IACrDQ,UAAWrE,KAAKE,cAAc4C,eAG1C,GAIJ,IAAK9C,KAAKI,OAAOkE,cAAe,CAC5BV,EAAY,GAAI,sFAChB,OAAO,KACX,CAEA,MAAM1B,EAAUlC,KAAKE,aAAaqE,iBAClC,MAAMjC,EAAckC,KAAKC,UAAUvC,GAGnClC,KAAK0E,UAAU,eAAgB,CAC3BxC,UACAE,eAAgBA,KACZiB,EAAc,MAElBlB,SAAUA,CAACwC,EAAsBC,KAC7BvB,EAAc,KACd,GAAI3B,GAAqB4B,EAAgB,CACrCM,EAAYe,EAAcC,EAC9B,KAAO,CACHC,EAAIC,QAAQ,iCAAiCH,MAAiBC,IAAgB,gBAClF,KAIR,GAAIvB,EAAa,CACb,OAAO,KACX,CAGArD,KAAK+E,YAAY,aAAc7C,EAAS,MACxClC,KAAK+E,YAAY,iBAAkBzC,EAAa,MAEhDtC,KAAK0E,UAAU,SAAU,CAAExC,UAASI,gBACpC,OAAO,IACX,CACA,OAAO,KACX,EAMOY,SAAQ,SAAA8B,IACX,IACI,MAAMC,EAAYjF,KAAKiD,YAAY,oBAEnC,IAAI3B,EAActB,KAAKiD,YAAY,eACnC,MAAM1B,EAAkBvB,KAAKiD,YAAY,mBAEzC,GAAI1B,EAAiB,CACjB,IACID,EAAckD,KAAKU,MAAM3D,EAC7B,CAAE,MAAO4D,GACLN,EAAIO,MAAM,mDAAqDD,EAAYjB,QAAS,gBACxF,CACJ,MAAO,UAAW5C,IAAgB,SAAU,CACxC,IACIA,EAAckD,KAAKU,MAAM5D,EAC7B,CAAE,MAAO6D,GACLN,EAAIO,MAAM,+CAAiDD,EAAYjB,QAAS,gBACpF,CACJ,CAGA,MAAMmB,EAAmBnG,EAAiBoG,UAAUL,EAAW3D,GAG/DtB,KAAKE,aAAe,IAAIZ,EAAagC,GAAe,CAAC,GAGrD,MAAMiE,EAAY,UAAYvF,KAAKoE,QACnCpE,KAAKwF,SAASxF,KAAKE,aAAa4C,WAAYyC,GAG5CvF,KAAKI,OAAS,IAAIhB,EAClB,MAAMqG,EAAgB,IAAIjG,EAE1BQ,KAAKG,iBAAmBH,KAAKI,OAAOsF,MAAML,EAAkBI,EAAeF,GAG3EvF,KAAK2F,eAAe,WAAY3F,KAAKG,iBAEzC,CAAE,MAAOiF,GACLP,EAAIO,MAAM,yEAA2EA,EAAgBlB,QAAS,iBAE9G,MAAM0B,EAAY,IAAIC,EAAY,CAC9B/B,KAAM,uBACNgC,YAAa,gGACbC,KAAM,qBAGV/F,KAAK2F,eAAe,WAAYC,EACpC,CACJ,EAMOI,aAAY,SAAAC,EAACC,EAAgB,eAAgBC,EAA2B,QAC3E,IAAKnG,KAAKG,iBAAkB,CACxBH,KAAKkD,UACT,CAEA,MAAMkD,EAAS,IAAIC,EAAO,CACtBH,MAAOA,EACPI,aAAc,QACdzF,QAAS,CAACb,MACVuG,YAAa,IAAIC,EAAO,CACpB1C,KAAMqC,EACN/E,KAAM,aACNqF,MAAOA,KACH,MAAMC,EAAU1G,KAAKmD,gBACrB,GAAIuD,EAAS,CACTN,EAAOpF,OACX,KAGR2F,UAAW,IAAIH,EAAO,CAClB1C,KAAM,SACN2C,MAAOA,KACHzG,KAAK0E,UAAU,UACf0B,EAAOpF,WAGf4F,WAAYA,KACRR,EAAOvD,aAIfuD,EAAOS,MACX,IAAC,OA7QgBnH,CAAa","ignoreList":[],"sourceRoot":"controls"}},{"offset":{"line":2,"column":0},"map":{"version":3,"names":["EventBus","___EventBus","ConditionEngine","constructor","schema","this","boundHandler","handleEvent","bind","initializeListeners","getInstance","subscribe","event","destroy","unsubscribe","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\n * @file ConditionEngine.ts\n * @description Evaluates dynamic rules to alter the schema in real-time.\n */\n\nimport { EventBus } from \"./EventBus\";\nimport { ISchema } from \"../interfaces/ISchema\";\nimport { IFieldChangeEvent } from \"../interfaces/IEventBus\";\n\n/**\n * Engine that listens to the EventBus and evaluates cross-field dependencies.\n */\nexport class ConditionEngine {\n private schema: ISchema;\n private boundHandler: (event: IFieldChangeEvent) => void;\n\n /**\n * Initializes the ConditionEngine with the active schema.\n * @param schema The current UI layout schema.\n */\n constructor(schema: ISchema) {\n this.schema = schema;\n this.boundHandler = this.handleEvent.bind(this);\n this.initializeListeners();\n }\n\n /**\n * Subscribes to the EventBus for real-time field change interception.\n */\n private initializeListeners(): void {\n EventBus.getInstance().subscribe(this.boundHandler);\n }\n\n /**\n * Internal handler to evaluate business rules when a field is updated.\n * @param event The structured change event.\n */\n private handleEvent(event: IFieldChangeEvent): void {\n // Architecture hook: Logic to evaluate conditions against the schema \n // and update plugin properties will be injected here in later phases.\n }\n\n /**\n * Cleans up EventBus listeners to prevent memory leaks on destruction.\n */\n public destroy(): void {\n EventBus.getInstance().unsubscribe(this.boundHandler);\n }\n}\n"],"mappings":"AAAA,4GAAA,MAKSA,EAAQC,EAAA,YAOV,MAAMC,EAQTC,YAAYC,GACRC,KAAKD,OAASA,EACdC,KAAKC,aAAeD,KAAKE,YAAYC,KAAKH,MAC1CA,KAAKI,qBACT,CAKQA,sBACJT,EAASU,cAAcC,UAAUN,KAAKC,aAC1C,CAMQC,YAAYK,GAEhB,CAMGC,UACHb,EAASU,cAAcI,YAAYT,KAAKC,aAC5C,EACH,IAAAS,EAAA,CAAAC,WAAA,MAAAD,EAAAb,kBAAA,OAAAa,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":3,"column":0},"map":{"version":3,"names":["ConditionEngine","___ConditionEngine","Engine","conditionEngine","activePlugins","build","schema","layoutManager","modelName","this","trackPlugin","plugin","push","type","items","Error","renderTable","title","container","VBox","renderType","props","properties","formProps","tableProps","key","Object","keys","meta","length","addItem","renderForm","tableProp","ui","label","validateAll","isValid","validate","destroy","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\n * @file Engine.ts\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry (v2).\n */\n\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { ConditionEngine } from \"./ConditionEngine\";\nimport Control from \"sap/ui/core/Control\";\nimport VBox from \"sap/m/VBox\";\n\nexport class Engine {\n private conditionEngine: ConditionEngine | null = null;\n private activePlugins: IPlugin[] = [];\n \n public build(schema: ISchema, layoutManager: ILayoutManager, modelName: string = \"meta\"): Control {\n this.conditionEngine = new ConditionEngine(schema);\n this.activePlugins = [];\n\n const trackPlugin = (plugin: IPlugin) => this.activePlugins.push(plugin);\n \n // Implicit layout routing based on root type\n if (schema.type === \"array\") {\n if (!schema.items) {\n throw new Error(\"[MetaUI] Array schema must define 'items'.\");\n }\n return layoutManager.renderTable(schema.items, `${modelName}>/`, schema.title);\n }\n \n if (schema.type === \"object\") {\n const container = new VBox({ renderType: \"Bare\" });\n const props = schema.properties || {};\n \n // Separate scalar properties (form fields) from root array properties (inline tables)\n const formProps: Record<string, IPropertyMetadata> = {};\n const tableProps: { key: string; meta: IPropertyMetadata }[] = [];\n \n for (const key of Object.keys(props)) {\n if (props[key].type === \"array\") {\n tableProps.push({ key, meta: props[key] });\n } else {\n formProps[key] = props[key];\n }\n }\n \n // Render the top-level form if there are scalar fields\n if (Object.keys(formProps).length > 0) {\n container.addItem(layoutManager.renderForm(formProps, modelName, schema.title, trackPlugin));\n }\n \n // Render root-level arrays as massive native tables below the form\n for (const tableProp of tableProps) {\n if (tableProp.meta.items) {\n container.addItem(layoutManager.renderTable(tableProp.meta.items, `${modelName}>/${tableProp.key}`, tableProp.meta.ui?.label || tableProp.key));\n }\n }\n \n return container;\n }\n \n throw new Error(`[MetaUI] Unsupported schema type: ${schema.type}`);\n }\n\n public validateAll(): boolean {\n let isValid = true;\n for (const plugin of this.activePlugins) {\n if (!plugin.validate()) {\n isValid = false;\n }\n }\n return isValid;\n }\n\n public destroy(): void {\n if (this.conditionEngine) {\n this.conditionEngine.destroy();\n this.conditionEngine = null;\n }\n this.activePlugins = [];\n }\n}\n"],"mappings":"AAAA,yHAAA,MAQSA,EAAeC,EAAA,mBAIjB,MAAMC,EACDC,gBAA0C,KAC1CC,cAA2B,GAE5BC,MAAMC,EAAiBC,EAA+BC,EAAoB,QAC7EC,KAAKN,gBAAkB,IAAIH,EAAgBM,GAC3CG,KAAKL,cAAgB,GAErB,MAAMM,EAAeC,GAAoBF,KAAKL,cAAcQ,KAAKD,GAGjE,GAAIL,EAAOO,OAAS,QAAS,CACzB,IAAKP,EAAOQ,MAAO,CACf,MAAM,IAAIC,MAAM,6CACpB,CACA,OAAOR,EAAcS,YAAYV,EAAOQ,MAAO,GAAGN,MAAeF,EAAOW,MAC5E,CAEA,GAAIX,EAAOO,OAAS,SAAU,CAC1B,MAAMK,EAAY,IAAIC,EAAK,CAAEC,WAAY,SACzC,MAAMC,EAAQf,EAAOgB,YAAc,CAAC,EAGpC,MAAMC,EAA+C,CAAC,EACtD,MAAMC,EAAyD,GAE/D,IAAK,MAAMC,KAAOC,OAAOC,KAAKN,GAAQ,CAClC,GAAIA,EAAMI,GAAKZ,OAAS,QAAS,CAC7BW,EAAWZ,KAAK,CAAEa,MAAKG,KAAMP,EAAMI,IACvC,KAAO,CACHF,EAAUE,GAAOJ,EAAMI,EAC3B,CACJ,CAGA,GAAIC,OAAOC,KAAKJ,GAAWM,OAAS,EAAG,CACnCX,EAAUY,QAAQvB,EAAcwB,WAAWR,EAAWf,EAAWF,EAAOW,MAAOP,GACnF,CAGA,IAAK,MAAMsB,KAAaR,EAAY,CAChC,GAAIQ,EAAUJ,KAAKd,MAAO,CACtBI,EAAUY,QAAQvB,EAAcS,YAAYgB,EAAUJ,KAAKd,MAAO,GAAGN,MAAcwB,EAAUP,MAAOO,EAAUJ,KAAKK,IAAIC,OAASF,EAAUP,KAC9I,CACJ,CAEA,OAAOP,CACX,CAEA,MAAM,IAAIH,MAAM,qCAAqCT,EAAOO,OAChE,CAEOsB,cACH,IAAIC,EAAU,KACd,IAAK,MAAMzB,KAAUF,KAAKL,cAAe,CACrC,IAAKO,EAAO0B,WAAY,CACpBD,EAAU,KACd,CACJ,CACA,OAAOA,CACX,CAEOE,UACH,GAAI7B,KAAKN,gBAAiB,CACtBM,KAAKN,gBAAgBmC,UACrB7B,KAAKN,gBAAkB,IAC3B,CACAM,KAAKL,cAAgB,EACzB,EACH,IAAAmC,EAAA,CAAAC,WAAA,MAAAD,EAAArC,SAAA,OAAAqC,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":4,"column":0},"map":{"version":3,"names":["EventBus","listeners","constructor","getInstance","instance","publishFieldChange","event","this","forEach","listener","subscribe","push","unsubscribe","filter","l","unsubscribeAll","__exports","__esModule"],"sources":["EventBus.ts"],"sourcesContent":["/**\n * @file EventBus.ts\n * @description Internal pub/sub channel for managing cross-field dependencies.\n */\n\nimport { IEventBus, IFieldChangeEvent } from \"../interfaces/IEventBus\";\n\n/**\n * Singleton orchestrator for localized state changes across the generated UI layout.\n */\nexport class EventBus implements IEventBus {\n private static instance: EventBus;\n private listeners: Array<(event: IFieldChangeEvent) => void> = [];\n\n private constructor() {\n // Enforce singleton\n }\n\n /**\n * Retrieves the singular instance of the EventBus.\n * @returns The EventBus singleton.\n */\n public static getInstance(): EventBus {\n if (!EventBus.instance) {\n EventBus.instance = new EventBus();\n }\n return EventBus.instance;\n }\n\n /**\n * Publishes a value change event to all internal subscribers.\n * @param event The structured payload of the field change.\n */\n public publishFieldChange(event: IFieldChangeEvent): void {\n this.listeners.forEach(listener => listener(event));\n }\n\n /**\n * Registers a callback listener to react to field changes.\n * @param listener The callback function.\n */\n public subscribe(listener: (event: IFieldChangeEvent) => void): void {\n this.listeners.push(listener);\n }\n\n /**\n * Unregisters a callback listener to prevent memory leaks.\n * @param listener The callback function to remove.\n */\n public unsubscribe(listener: (event: IFieldChangeEvent) => void): void {\n this.listeners = this.listeners.filter(l => l !== listener);\n }\n\n /**\n * Unregisters all callback listeners.\n */\n public unsubscribeAll(): void {\n this.listeners = [];\n }\n}\n"],"mappings":"AAAA,wFAUO,MAAMA,EAEDC,UAAuD,GAEvDC,cACJ,CAOJ,kBAAcC,GACV,IAAKH,EAASI,SAAU,CACpBJ,EAASI,SAAW,IAAIJ,CAC5B,CACA,OAAOA,EAASI,QACpB,CAMOC,mBAAmBC,GACtBC,KAAKN,UAAUO,QAAQC,GAAYA,EAASH,GAChD,CAMOI,UAAUD,GACbF,KAAKN,UAAUU,KAAKF,EACxB,CAMOG,YAAYH,GACfF,KAAKN,UAAYM,KAAKN,UAAUY,OAAOC,GAAKA,IAAML,EACtD,CAKOM,iBACHR,KAAKN,UAAY,EACrB,EACH,IAAAe,EAAA,CAAAC,WAAA,MAAAD,EAAAhB,WAAA,OAAAgB,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":5,"column":0},"map":{"version":3,"names":["PluginRegistry","plugins","Map","constructor","getInstance","instance","register","type","pluginConstructor","widgetName","key","this","set","getPlugin","PluginClass","get","Error","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\n * @file PluginRegistry.ts\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { FieldType } from \"../interfaces/ISchema\";\n\n/**\n * Singleton registry that manages the lifecycle and lookup of UI5 plugin constructors.\n */\nexport class PluginRegistry {\n private static instance: PluginRegistry;\n \n /** Internal map linking string types to their respective constructor functions. */\n private plugins: Map<string, new () => IPlugin> = new Map();\n\n private constructor() {\n // Enforce singleton\n }\n\n /**\n * Retrieves the singular instance of the PluginRegistry.\n * @returns The PluginRegistry singleton.\n */\n public static getInstance(): PluginRegistry {\n if (!PluginRegistry.instance) {\n PluginRegistry.instance = new PluginRegistry();\n }\n return PluginRegistry.instance;\n }\n\n /**\n * Registers a new UI control plugin against a specific schema primitive type (and optional widget).\n * @param type The primitive FieldType (e.g., 'string', 'date').\n * @param pluginConstructor The class constructor for the plugin.\n * @param widgetName Optional widget specific override (e.g., 'textArea').\n */\n public register(type: FieldType, pluginConstructor: new () => IPlugin, widgetName?: string): void {\n const key = widgetName ? `${type}:${widgetName}` : type;\n this.plugins.set(key, pluginConstructor);\n }\n\n /**\n * Instantiates and returns a new plugin based on the requested primitive type and widget.\n * @param type The primitive FieldType to look up.\n * @param widgetName Optional widget specific override.\n * @throws Error if no plugin has been registered for the provided type.\n * @returns A newly instantiated plugin ready for rendering.\n */\n public getPlugin(type: FieldType, widgetName?: string): IPlugin {\n let PluginClass;\n \n // 1. Attempt specific widget lookup\n if (widgetName) {\n PluginClass = this.plugins.get(`${type}:${widgetName}`);\n }\n \n // 2. Fallback to primitive type\n if (!PluginClass) {\n PluginClass = this.plugins.get(type);\n }\n\n if (!PluginClass) {\n throw new Error(`[MetaUI] No plugin registered for FieldType: ${type}`);\n }\n \n return new PluginClass();\n }\n}\n"],"mappings":"AAAA,8FAYO,MAAMA,EAIDC,QAA0C,IAAIC,IAE9CC,cACJ,CAOJ,kBAAcC,GACV,IAAKJ,EAAeK,SAAU,CAC1BL,EAAeK,SAAW,IAAIL,CAClC,CACA,OAAOA,EAAeK,QAC1B,CAQOC,SAASC,EAAiBC,EAAsCC,GACnE,MAAMC,EAAMD,EAAa,GAAGF,KAAQE,IAAeF,EACnDI,KAAKV,QAAQW,IAAIF,EAAKF,EAC1B,CASOK,UAAUN,EAAiBE,GAC9B,IAAIK,EAGJ,GAAIL,EAAY,CACZK,EAAcH,KAAKV,QAAQc,IAAI,GAAGR,KAAQE,IAC9C,CAGA,IAAKK,EAAa,CACdA,EAAcH,KAAKV,QAAQc,IAAIR,EACnC,CAEA,IAAKO,EAAa,CACd,MAAM,IAAIE,MAAM,gDAAgDT,IACpE,CAEA,OAAO,IAAIO,CACf,EACH,IAAAG,EAAA,CAAAC,WAAA,MAAAD,EAAAjB,iBAAA,OAAAiB,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":6,"column":0},"map":{"version":3,"names":["SchemaNormalizer","normalize","rawSchema","data","schemaObj","JSON","parse","e","console","warn","Array","isArray","this","inferSchemaFromData","normalized","title","type","items","properties","normalizeProperties","normalizePropertyMetadata","normalizedProps","key","Object","keys","prop","keyName","ui","label","generateLabel","isKey","readOnly","widget","group","visibleOn","enabledOn","format","required","maxLength","minimum","maximum","pattern","precision","scale","valueHelp","name","spaced","replace","split","filter","w","length","map","word","charAt","toUpperCase","slice","toLowerCase","join","trim","schema","inferPropertiesFromObject","obj","val","undefined","__exports","__esModule"],"sources":["SchemaNormalizer.ts"],"sourcesContent":["/**\n * @file SchemaNormalizer.ts\n * @description Transforms and validates incoming JSON payloads into the strict v2 ISchema dictionary matrix.\n */\n\nimport { ISchema, IPropertyMetadata, FieldType } from \"../interfaces/ISchema\";\n\nexport class SchemaNormalizer {\n \n /**\n * Validates that the provided raw payload conforms to the required ISchema structures.\n */\n public static normalize(rawSchema?: any, data?: any): ISchema {\n let schemaObj = rawSchema;\n\n if (typeof schemaObj === \"string\") {\n try {\n schemaObj = JSON.parse(schemaObj);\n } catch (e) {\n console.warn(\"[MetaUI] Failed to parse schema string, falling back to inference.\", e);\n schemaObj = null;\n }\n }\n\n if (!schemaObj || typeof schemaObj !== 'object' || Array.isArray(schemaObj)) {\n return this.inferSchemaFromData(data);\n }\n\n // It is an object. Ensure it conforms to v2 structure.\n const normalized: ISchema = {\n title: schemaObj.title || \"MetaUI Generated Form\",\n type: schemaObj.type || (schemaObj.items ? \"array\" : \"object\"),\n };\n\n if (normalized.type === \"object\") {\n normalized.properties = this.normalizeProperties(schemaObj.properties || {});\n } else if (normalized.type === \"array\") {\n normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: \"object\", properties: {} }, \"items\");\n }\n\n return normalized;\n }\n\n private static normalizeProperties(properties: any): Record<string, IPropertyMetadata> {\n const normalizedProps: Record<string, IPropertyMetadata> = {};\n for (const key of Object.keys(properties)) {\n normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key);\n }\n return normalizedProps;\n }\n\n private static normalizePropertyMetadata(prop: any, keyName: string): IPropertyMetadata {\n const normalized: IPropertyMetadata = {\n type: prop.type || \"string\",\n ui: {\n label: prop.ui?.label || this.generateLabel(keyName),\n isKey: !!prop.ui?.isKey,\n readOnly: !!prop.ui?.readOnly,\n widget: prop.ui?.widget,\n group: prop.ui?.group,\n visibleOn: prop.ui?.visibleOn,\n enabledOn: prop.ui?.enabledOn,\n format: prop.ui?.format\n },\n required: !!prop.required,\n maxLength: prop.maxLength,\n minimum: prop.minimum,\n maximum: prop.maximum,\n pattern: prop.pattern,\n precision: prop.precision,\n scale: prop.scale,\n valueHelp: prop.valueHelp\n };\n\n if (normalized.type === \"object\" && prop.properties) {\n normalized.properties = this.normalizeProperties(prop.properties);\n } else if (normalized.type === \"array\" && prop.items) {\n normalized.items = this.normalizePropertyMetadata(prop.items, \"items\");\n }\n\n return normalized;\n }\n\n /**\n * Generates a Title Case label from camelCase or snake_case technical names.\n */\n private static generateLabel(name: string): string {\n if (!name) return \"\";\n let spaced = name.replace(/([A-Z])/g, \" $1\").replace(/_/g, \" \");\n return spaced.split(' ')\n .filter(w => w.length > 0)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ')\n .trim();\n }\n\n /**\n * Infers a v2 ISchema structure dynamically from a plain data payload.\n */\n private static inferSchemaFromData(data: any): ISchema {\n const schema: ISchema = { type: \"object\", properties: {} };\n \n if (!data || typeof data !== \"object\") {\n return schema;\n }\n\n if (Array.isArray(data)) {\n schema.type = \"array\";\n schema.items = {\n type: \"object\",\n properties: data.length > 0 ? this.inferPropertiesFromObject(data[0]) : {}\n };\n } else {\n schema.type = \"object\";\n schema.properties = this.inferPropertiesFromObject(data);\n }\n\n return schema;\n }\n\n private static inferPropertiesFromObject(obj: any): Record<string, IPropertyMetadata> {\n const properties: Record<string, IPropertyMetadata> = {};\n if (!obj || typeof obj !== \"object\") return properties;\n\n for (const key of Object.keys(obj)) {\n const val = obj[key];\n if (val === null || val === undefined) continue;\n \n if (typeof val === \"object\" && !Array.isArray(val)) continue;\n\n let type: FieldType = \"string\";\n let items: IPropertyMetadata | undefined;\n\n if (typeof val === \"number\") type = \"number\";\n else if (typeof val === \"boolean\") type = \"boolean\";\n else if (Array.isArray(val)) {\n type = \"array\";\n items = {\n type: \"object\",\n properties: val.length > 0 ? this.inferPropertiesFromObject(val[0]) : {}\n };\n }\n \n properties[key] = {\n type,\n items,\n ui: {\n label: this.generateLabel(key),\n isKey: false,\n readOnly: false\n }\n };\n }\n\n return properties;\n }\n}\n"],"mappings":"AAAA,gGAOO,MAAMA,EAKT,gBAAcC,CAAUC,EAAiBC,GACrC,IAAIC,EAAYF,EAEhB,UAAWE,IAAc,SAAU,CAC/B,IACIA,EAAYC,KAAKC,MAAMF,EAC3B,CAAE,MAAOG,GACLC,QAAQC,KAAK,qEAAsEF,GACnFH,EAAY,IAChB,CACJ,CAEA,IAAKA,UAAoBA,IAAc,UAAYM,MAAMC,QAAQP,GAAY,CACzE,OAAOQ,KAAKC,oBAAoBV,EACpC,CAGA,MAAMW,EAAsB,CACxBC,MAAOX,EAAUW,OAAS,wBAC1BC,KAAMZ,EAAUY,OAASZ,EAAUa,MAAQ,QAAU,WAGzD,GAAIH,EAAWE,OAAS,SAAU,CAC9BF,EAAWI,WAAaN,KAAKO,oBAAoBf,EAAUc,YAAc,CAAC,EAC9E,MAAO,GAAIJ,EAAWE,OAAS,QAAS,CACpCF,EAAWG,MAAQL,KAAKQ,0BAA0BhB,EAAUa,OAAS,CAAED,KAAM,SAAUE,WAAY,CAAC,GAAK,QAC7G,CAEA,OAAOJ,CACX,CAEA,0BAAeK,CAAoBD,GAC/B,MAAMG,EAAqD,CAAC,EAC5D,IAAK,MAAMC,KAAOC,OAAOC,KAAKN,GAAa,CACvCG,EAAgBC,GAAOV,KAAKQ,0BAA0BF,EAAWI,GAAMA,EAC3E,CACA,OAAOD,CACX,CAEA,gCAAeD,CAA0BK,EAAWC,GAChD,MAAMZ,EAAgC,CAClCE,KAAMS,EAAKT,MAAQ,SACnBW,GAAI,CACAC,MAAOH,EAAKE,IAAIC,OAAShB,KAAKiB,cAAcH,GAC5CI,QAASL,EAAKE,IAAIG,MAClBC,WAAYN,EAAKE,IAAII,SACrBC,OAAQP,EAAKE,IAAIK,OACjBC,MAAOR,EAAKE,IAAIM,MAChBC,UAAWT,EAAKE,IAAIO,UACpBC,UAAWV,EAAKE,IAAIQ,UACpBC,OAAQX,EAAKE,IAAIS,QAErBC,WAAYZ,EAAKY,SACjBC,UAAWb,EAAKa,UAChBC,QAASd,EAAKc,QACdC,QAASf,EAAKe,QACdC,QAAShB,EAAKgB,QACdC,UAAWjB,EAAKiB,UAChBC,MAAOlB,EAAKkB,MACZC,UAAWnB,EAAKmB,WAGpB,GAAI9B,EAAWE,OAAS,UAAYS,EAAKP,WAAY,CACjDJ,EAAWI,WAAaN,KAAKO,oBAAoBM,EAAKP,WAC1D,MAAO,GAAIJ,EAAWE,OAAS,SAAWS,EAAKR,MAAO,CAClDH,EAAWG,MAAQL,KAAKQ,0BAA0BK,EAAKR,MAAO,QAClE,CAEA,OAAOH,CACX,CAKA,oBAAee,CAAcgB,GACzB,IAAKA,EAAM,MAAO,GAClB,IAAIC,EAASD,EAAKE,QAAQ,WAAY,OAAOA,QAAQ,KAAM,KAC3D,OAAOD,EAAOE,MAAM,KACfC,OAAOC,GAAKA,EAAEC,OAAS,GACvBC,IAAIC,GAAQA,EAAKC,OAAO,GAAGC,cAAgBF,EAAKG,MAAM,GAAGC,eACzDC,KAAK,KACLC,MACT,CAKA,0BAAe9C,CAAoBV,GAC/B,MAAMyD,EAAkB,CAAE5C,KAAM,SAAUE,WAAY,CAAC,GAEvD,IAAKf,UAAeA,IAAS,SAAU,CACnC,OAAOyD,CACX,CAEA,GAAIlD,MAAMC,QAAQR,GAAO,CACrByD,EAAO5C,KAAO,QACd4C,EAAO3C,MAAQ,CACXD,KAAM,SACNE,WAAYf,EAAKgD,OAAS,EAAIvC,KAAKiD,0BAA0B1D,EAAK,IAAM,CAAC,EAEjF,KAAO,CACHyD,EAAO5C,KAAO,SACd4C,EAAO1C,WAAaN,KAAKiD,0BAA0B1D,EACvD,CAEA,OAAOyD,CACX,CAEA,gCAAeC,CAA0BC,GACrC,MAAM5C,EAAgD,CAAC,EACvD,IAAK4C,UAAcA,IAAQ,SAAU,OAAO5C,EAE5C,IAAK,MAAMI,KAAOC,OAAOC,KAAKsC,GAAM,CAChC,MAAMC,EAAMD,EAAIxC,GAChB,GAAIyC,IAAQ,MAAQA,IAAQC,UAAW,SAEvC,UAAWD,IAAQ,WAAarD,MAAMC,QAAQoD,GAAM,SAEpD,IAAI/C,EAAkB,SACtB,IAAIC,EAEJ,UAAW8C,IAAQ,SAAU/C,EAAO,cAC/B,UAAW+C,IAAQ,UAAW/C,EAAO,eACrC,GAAIN,MAAMC,QAAQoD,GAAM,CACzB/C,EAAO,QACPC,EAAQ,CACJD,KAAM,SACNE,WAAY6C,EAAIZ,OAAS,EAAIvC,KAAKiD,0BAA0BE,EAAI,IAAM,CAAC,EAE/E,CAEA7C,EAAWI,GAAO,CACdN,OACAC,QACAU,GAAI,CACAC,MAAOhB,KAAKiB,cAAcP,GAC1BQ,MAAO,MACPC,SAAU,OAGtB,CAEA,OAAOb,CACX,EACH,IAAA+C,EAAA,CAAAC,WAAA,MAAAD,EAAAjE,mBAAA,OAAAiE,CAAA","ignoreList":[],"sourceRoot":"core"}},{"offset":{"line":7,"column":0},"map":{"version":3,"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":"AAAA,0HAWO,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":[],"sourceRoot":"core"}},{"offset":{"line":8,"column":0},"map":{"version":3,"names":["FormLayout","___FormLayout","TableLayout","___TableLayout","BaseLayout","renderForm","properties","modelName","formTitle","trackPlugin","build","renderTable","tableMeta","tableTitle","__exports","__esModule"],"sources":["BaseLayout.ts"],"sourcesContent":["/**\n * @file BaseLayout.ts\n * @description Central layout factory that delegates to specific form or table layout engines.\n */\n\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport Control from \"sap/ui/core/Control\";\nimport { FormLayout } from \"./FormLayout\";\nimport { TableLayout } from \"./TableLayout\";\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\n\nexport class BaseLayout implements ILayoutManager {\n public renderForm(properties: Record<string, IPropertyMetadata>, modelName: string = \"meta\", formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control {\n return FormLayout.build(properties, modelName, formTitle, trackPlugin);\n }\n\n public renderTable(tableMeta: IPropertyMetadata, modelName: string = \"meta\", tableTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control {\n return TableLayout.build(tableMeta, modelName, tableTitle, trackPlugin);\n }\n}\n"],"mappings":"AAAA,8HAAA,MAQSA,EAAUC,EAAA,oBACVC,EAAWC,EAAA,eAIb,MAAMC,EACFC,WAAWC,EAA+CC,EAAoB,OAAQC,EAAoBC,GAC7G,OAAOT,EAAWU,MAAMJ,EAAYC,EAAWC,EAAWC,EAC9D,CAEOE,YAAYC,EAA8BL,EAAoB,OAAQM,EAAqBJ,GAC9F,OAAOP,EAAYQ,MAAME,EAAWL,EAAWM,EAAYJ,EAC/D,EACH,IAAAK,EAAA,CAAAC,WAAA,MAAAD,EAAAV,aAAA,OAAAU,CAAA","ignoreList":[],"sourceRoot":"layouts"}},{"offset":{"line":9,"column":0},"map":{"version":3,"names":["PluginRegistry","___core_PluginRegistry","FormLayout","build","properties","modelName","formTitle","trackPlugin","form","SimpleForm","editable","title","layout","labelSpanXL","labelSpanL","labelSpanM","labelSpanS","adjustLabelSpan","emptySpanXL","emptySpanL","emptySpanM","emptySpanS","columnsXL","columnsL","columnsM","singleContainerFullSize","registry","getInstance","groups","DEFAULT_GROUP","key","Object","keys","meta","groupName","ui","group","push","addContent","Title","text","forEach","field","label","Label","required","visibleOn","expr","replace","bindProperty","parts","path","formatter","plugin","getPlugin","type","widget","control","render","fullWidth","sap","require","GridData","setLayoutData","span","error","Log","message","__exports","__esModule"],"sources":["FormLayout.ts"],"sourcesContent":["/**\n * @file FormLayout.ts\n * @description Generates a fully responsive SAP Fiori Form layout (SimpleForm).\n */\n\nimport SimpleForm from \"sap/ui/layout/form/SimpleForm\";\nimport Label from \"sap/m/Label\";\nimport Title from \"sap/ui/core/Title\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { PluginRegistry } from \"../core/PluginRegistry\";\nimport { IPlugin } from \"../interfaces/IPlugin\";\n\nexport class FormLayout {\n /**\n * Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.\n * @param properties The dictionary of fields to render.\n * @param modelName The dynamic model name.\n * @param formTitle Optional title for the form block.\n * @param trackPlugin Optional callback to track instantiated plugins.\n */\n public static build(properties: Record<string, IPropertyMetadata>, modelName: string = \"meta\", formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): SimpleForm {\n const form = new SimpleForm({\n editable: true,\n title: formTitle,\n layout: \"ResponsiveGridLayout\",\n labelSpanXL: 4,\n labelSpanL: 4,\n labelSpanM: 4,\n labelSpanS: 12,\n adjustLabelSpan: false,\n emptySpanXL: 0,\n emptySpanL: 0,\n emptySpanM: 0,\n emptySpanS: 0,\n columnsXL: 1,\n columnsL: 1,\n columnsM: 1,\n singleContainerFullSize: false\n });\n\n const registry = PluginRegistry.getInstance();\n \n // Group fields by their ui.group directive\n const groups: Record<string, { key: string; meta: IPropertyMetadata }[]> = {};\n const DEFAULT_GROUP = \"__DEFAULT__\";\n \n for (const key of Object.keys(properties)) {\n const meta = properties[key];\n const groupName = meta.ui?.group || DEFAULT_GROUP;\n if (!groups[groupName]) groups[groupName] = [];\n groups[groupName].push({ key, meta });\n }\n\n // Render groups\n for (const groupName of Object.keys(groups)) {\n if (groupName !== DEFAULT_GROUP) {\n form.addContent(new Title({ text: groupName }));\n }\n \n groups[groupName].forEach((field) => {\n try {\n const label = new Label({\n text: field.meta.ui?.label || field.key,\n required: field.meta.required\n });\n\n // Attach visibility condition to label and control container logic\n if (field.meta.ui?.visibleOn) {\n const expr = `{= ${field.meta.ui.visibleOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n label.bindProperty(\"visible\", { parts: [{ path: \"meta>/\" }], formatter: () => false}); // temporary, condition engine does this usually\n }\n\n const plugin = registry.getPlugin(field.meta.type, field.meta.ui?.widget);\n if (trackPlugin) trackPlugin(plugin);\n const control = plugin.render(field.meta, `/${field.key}`, modelName);\n\n if (field.meta.ui?.fullWidth) {\n sap.ui.require([\"sap/ui/layout/GridData\"], (GridData: any) => {\n control.setLayoutData(new GridData({\n span: \"XL12 L12 M12 S12\"\n }));\n });\n }\n\n form.addContent(label);\n form.addContent(control);\n } catch (error) {\n sap.ui.require([\"sap/base/Log\"], (Log: any) => {\n if (Log) Log.error(`[MetaUI] Failed to render field ${field.key}`, (error as Error).message, \"FormLayout\");\n });\n }\n });\n }\n\n return form;\n }\n}\n"],"mappings":"AAAA,oMASSA,EAAcC,EAAA,kBAGhB,MAAMC,EAQT,YAAcC,CAAMC,EAA+CC,EAAoB,OAAQC,EAAoBC,GAC/G,MAAMC,EAAO,IAAIC,EAAW,CACxBC,SAAU,KACVC,MAAOL,EACPM,OAAQ,uBACRC,YAAa,EACbC,WAAY,EACZC,WAAY,EACZC,WAAY,GACZC,gBAAiB,MACjBC,YAAa,EACbC,WAAY,EACZC,WAAY,EACZC,WAAY,EACZC,UAAW,EACXC,SAAU,EACVC,SAAU,EACVC,wBAAyB,QAG7B,MAAMC,EAAW1B,EAAe2B,cAGhC,MAAMC,EAAqE,CAAC,EAC5E,MAAMC,EAAgB,cAEtB,IAAK,MAAMC,KAAOC,OAAOC,KAAK5B,GAAa,CACvC,MAAM6B,EAAO7B,EAAW0B,GACxB,MAAMI,EAAYD,EAAKE,IAAIC,OAASP,EACpC,IAAKD,EAAOM,GAAYN,EAAOM,GAAa,GAC5CN,EAAOM,GAAWG,KAAK,CAAEP,MAAKG,QAClC,CAGA,IAAK,MAAMC,KAAaH,OAAOC,KAAKJ,GAAS,CACzC,GAAIM,IAAcL,EAAe,CAC7BrB,EAAK8B,WAAW,IAAIC,EAAM,CAAEC,KAAMN,IACtC,CAEAN,EAAOM,GAAWO,QAASC,IACvB,IACI,MAAMC,EAAQ,IAAIC,EAAM,CACpBJ,KAAME,EAAMT,KAAKE,IAAIQ,OAASD,EAAMZ,IACpCe,SAAUH,EAAMT,KAAKY,WAIzB,GAAIH,EAAMT,KAAKE,IAAIW,UAAW,CAC1B,MAAMC,EAAO,MAAML,EAAMT,KAAKE,GAAGW,UAAUE,QAAQ,YAAa,GAAG3C,OAAe2C,QAAQ,MAAO,SACjGL,EAAMM,aAAa,UAAW,CAAEC,MAAO,CAAC,CAAEC,KAAM,WAAaC,UAAWA,IAAM,OAClF,CAEA,MAAMC,EAAS3B,EAAS4B,UAAUZ,EAAMT,KAAKsB,KAAMb,EAAMT,KAAKE,IAAIqB,QAClE,GAAIjD,EAAaA,EAAY8C,GAC7B,MAAMI,EAAUJ,EAAOK,OAAOhB,EAAMT,KAAM,IAAIS,EAAMZ,MAAOzB,GAE3D,GAAIqC,EAAMT,KAAKE,IAAIwB,UAAW,CAC1BC,IAAIzB,GAAG0B,QAAQ,CAAC,0BAA4BC,IACxCL,EAAQM,cAAc,IAAID,EAAS,CAC/BE,KAAM,uBAGlB,CAEAxD,EAAK8B,WAAWK,GAChBnC,EAAK8B,WAAWmB,EACpB,CAAE,MAAOQ,GACLL,IAAIzB,GAAG0B,QAAQ,CAAC,gBAAkBK,IAC9B,GAAIA,EAAKA,EAAID,MAAM,mCAAmCvB,EAAMZ,MAAQmC,EAAgBE,QAAS,eAErG,GAER,CAEA,OAAO3D,CACX,EACH,IAAA4D,EAAA,CAAAC,WAAA,MAAAD,EAAAlE,aAAA,OAAAkE,CAAA","ignoreList":[],"sourceRoot":"layouts"}},{"offset":{"line":10,"column":0},"map":{"version":3,"names":["PluginRegistry","___core_PluginRegistry","TableLayout","build","tableMeta","bindingPath","tableTitle","trackPlugin","properties","Error","parts","split","actualModelName","length","undefined","actualPath","table","Table","headerToolbar","Toolbar","content","Title","text","ToolbarSpacer","Button","icon","press","oEvent","btn","getSource","tbl","getParent","model","getModel","info","getBindingInfo","path","data","getProperty","push","setProperty","fixedLayout","mode","delete","item","getParameter","getBindingContext","getPath","splitPaths","index","parseInt","pop","arrayPath","join","splice","templateCells","registry","getInstance","props","Object","keys","forEach","key","fieldMeta","isKey","ui","column","Column","header","Text","label","demandPopin","minScreenWidth","popinDisplay","addColumn","plugin","getPlugin","type","widget","control","render","error","sap","require","Log","message","rowTemplate","ColumnListItem","cells","bindItems","template","templateShareable","__exports","__esModule"],"sources":["TableLayout.ts"],"sourcesContent":["/**\n * @file TableLayout.ts\n * @description Generates a responsive SAP Fiori Table layout for v2 schema.\n */\n\nimport Table from \"sap/m/Table\";\nimport Column from \"sap/m/Column\";\nimport Text from \"sap/m/Text\";\nimport ColumnListItem from \"sap/m/ColumnListItem\";\nimport Toolbar from \"sap/m/Toolbar\";\nimport Title from \"sap/m/Title\";\nimport ToolbarSpacer from \"sap/m/ToolbarSpacer\";\nimport Button from \"sap/m/Button\";\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport { PluginRegistry } from \"../core/PluginRegistry\";\nimport Control from \"sap/ui/core/Control\";\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\n\nexport class TableLayout {\n /**\n * Builds a responsive Table, dynamically calculating column priorities.\n */\n public static build(tableMeta: IPropertyMetadata, bindingPath: string = \"meta>/\", tableTitle: string = \"Table\", trackPlugin?: (plugin: IPlugin) => void): Table {\n if (!tableMeta.properties) {\n throw new Error(\"[MetaUI] Table requires an items schema with properties.\");\n }\n\n const parts = bindingPath.split(\">\");\n const actualModelName = parts.length > 1 ? parts[0] : undefined;\n const actualPath = parts.length > 1 ? parts[1] : bindingPath;\n // e.g. \"meta>/Contacts\" -> actualModelName = \"meta\", actualPath = \"/Contacts\"\n\n const table = new Table({\n headerToolbar: new Toolbar({\n content: [\n new Title({ text: tableTitle }),\n new ToolbarSpacer(),\n new Button({\n text: \"Add Row\",\n icon: \"sap-icon://add\",\n press: (oEvent: any) => {\n const btn = oEvent.getSource();\n const tbl = btn.getParent().getParent() as Table;\n const model = tbl.getModel(actualModelName) as JSONModel;\n const info = tbl.getBindingInfo(\"items\");\n if (!info || !info.path) return;\n \n const data = model.getProperty(info.path) || [];\n data.push({}); // append empty row\n model.setProperty(info.path, data);\n }\n })\n ]\n }),\n fixedLayout: false,\n mode: \"Delete\",\n delete: (oEvent: any) => {\n const item = oEvent.getParameter(\"listItem\");\n const path = item.getBindingContext(actualModelName).getPath(); \n const model = item.getModel(actualModelName) as JSONModel;\n \n const splitPaths = path.split(\"/\");\n const index = parseInt(splitPaths.pop() || \"0\", 10);\n let arrayPath = splitPaths.join(\"/\");\n if (arrayPath === \"\") arrayPath = \"/\";\n \n const data = model.getProperty(arrayPath);\n data.splice(index, 1);\n model.setProperty(arrayPath, data);\n }\n });\n\n const templateCells: Control[] = [];\n const registry = PluginRegistry.getInstance();\n const props = tableMeta.properties;\n\n Object.keys(props).forEach((key) => {\n try {\n const fieldMeta = props[key];\n const isKey = !!fieldMeta.ui?.isKey;\n \n const column = new Column({\n header: new Text({ text: fieldMeta.ui?.label || key }),\n demandPopin: !isKey, \n minScreenWidth: isKey ? \"\" : \"Tablet\",\n popinDisplay: \"Inline\"\n });\n table.addColumn(column);\n\n const plugin = registry.getPlugin(fieldMeta.type, fieldMeta.ui?.widget);\n if (trackPlugin) trackPlugin(plugin);\n const control = plugin.render(fieldMeta, key, actualModelName); // No trailing slash for relative bindings\n templateCells.push(control);\n } catch (error) {\n sap.ui.require([\"sap/base/Log\"], (Log: any) => {\n if (Log) Log.error(`[MetaUI] Failed to render column ${key}`, (error as Error).message, \"TableLayout\");\n });\n \n // Add an empty text control as a fallback so the table columns match the cells array length\n templateCells.push(new Text({ text: \"Error\" }));\n }\n });\n\n const rowTemplate = new ColumnListItem({\n cells: templateCells\n });\n\n // V2 Fix: Actually bind the items to the table!\n table.bindItems({\n path: actualPath,\n model: actualModelName,\n template: rowTemplate,\n templateShareable: false\n });\n\n return table;\n }\n}\n"],"mappings":"AAAA,iRAcSA,EAAcC,EAAA,kBAKhB,MAAMC,EAIT,YAAcC,CAAMC,EAA8BC,EAAsB,SAAUC,EAAqB,QAASC,GAC5G,IAAKH,EAAUI,WAAY,CACvB,MAAM,IAAIC,MAAM,2DACpB,CAEA,MAAMC,EAAQL,EAAYM,MAAM,KAChC,MAAMC,EAAkBF,EAAMG,OAAS,EAAIH,EAAM,GAAKI,UACtD,MAAMC,EAAaL,EAAMG,OAAS,EAAIH,EAAM,GAAKL,EAGjD,MAAMW,EAAQ,IAAIC,EAAM,CACpBC,cAAe,IAAIC,EAAQ,CACvBC,QAAS,CACL,IAAIC,EAAM,CAAEC,KAAMhB,IAClB,IAAIiB,EACJ,IAAIC,EAAO,CACPF,KAAM,UACNG,KAAM,iBACNC,MAAQC,IACJ,MAAMC,EAAMD,EAAOE,YACnB,MAAMC,EAAMF,EAAIG,YAAYA,YAC5B,MAAMC,EAAQF,EAAIG,SAASrB,GAC3B,MAAMsB,EAAOJ,EAAIK,eAAe,SAChC,IAAKD,IAASA,EAAKE,KAAM,OAEzB,MAAMC,EAAOL,EAAMM,YAAYJ,EAAKE,OAAS,GAC7CC,EAAKE,KAAK,CAAC,GACXP,EAAMQ,YAAYN,EAAKE,KAAMC,SAK7CI,YAAa,MACbC,KAAM,SACNC,OAAShB,IACL,MAAMiB,EAAOjB,EAAOkB,aAAa,YACjC,MAAMT,EAAOQ,EAAKE,kBAAkBlC,GAAiBmC,UACrD,MAAMf,EAAQY,EAAKX,SAASrB,GAE5B,MAAMoC,EAAaZ,EAAKzB,MAAM,KAC9B,MAAMsC,EAAQC,SAASF,EAAWG,OAAS,IAAK,IAChD,IAAIC,EAAYJ,EAAWK,KAAK,KAChC,GAAID,IAAc,GAAIA,EAAY,IAElC,MAAMf,EAAOL,EAAMM,YAAYc,GAC/Bf,EAAKiB,OAAOL,EAAO,GACnBjB,EAAMQ,YAAYY,EAAWf,MAIrC,MAAMkB,EAA2B,GACjC,MAAMC,EAAWxD,EAAeyD,cAChC,MAAMC,EAAQtD,EAAUI,WAExBmD,OAAOC,KAAKF,GAAOG,QAASC,IACxB,IACI,MAAMC,EAAYL,EAAMI,GACxB,MAAME,IAAUD,EAAUE,IAAID,MAE9B,MAAME,EAAS,IAAIC,EAAO,CACtBC,OAAQ,IAAIC,EAAK,CAAE/C,KAAMyC,EAAUE,IAAIK,OAASR,IAChDS,aAAcP,EACdQ,eAAgBR,EAAQ,GAAK,SAC7BS,aAAc,WAElBzD,EAAM0D,UAAUR,GAEhB,MAAMS,EAASnB,EAASoB,UAAUb,EAAUc,KAAMd,EAAUE,IAAIa,QAChE,GAAIvE,EAAaA,EAAYoE,GAC7B,MAAMI,EAAUJ,EAAOK,OAAOjB,EAAWD,EAAKlD,GAC9C2C,EAAchB,KAAKwC,EACvB,CAAE,MAAOE,GACLC,IAAIjB,GAAGkB,QAAQ,CAAC,gBAAkBC,IAC9B,GAAIA,EAAKA,EAAIH,MAAM,oCAAoCnB,IAAQmB,EAAgBI,QAAS,iBAI5F9B,EAAchB,KAAK,IAAI8B,EAAK,CAAE/C,KAAM,UACxC,IAGJ,MAAMgE,EAAc,IAAIC,EAAe,CACnCC,MAAOjC,IAIXvC,EAAMyE,UAAU,CACZrD,KAAMrB,EACNiB,MAAOpB,EACP8E,SAAUJ,EACVK,kBAAmB,QAGvB,OAAO3E,CACX,EACH,IAAA4E,EAAA,CAAAC,WAAA,MAAAD,EAAA1F,cAAA,OAAA0F,CAAA","ignoreList":[],"sourceRoot":"layouts"}},{"offset":{"line":11,"column":0},"map":{"version":3,"names":["PluginRegistry","___core_PluginRegistry","StringPlugin","___plugins_StringPlugin","NumberPlugin","___plugins_NumberPlugin","BooleanPlugin","___plugins_BooleanPlugin","DropdownPlugin","___plugins_DropdownPlugin","DatePlugin","___plugins_DatePlugin","TimePlugin","___plugins_TimePlugin","DateTimePlugin","___plugins_DateTimePlugin","ArrayPlugin","___plugins_ArrayPlugin","TextAreaPlugin","___plugins_TextAreaPlugin","SwitchPlugin","___plugins_SwitchPlugin","Core","initLibrary","name","version","dependencies","controls","elements","interfaces","noLibraryCSS","registry","getInstance","register","__exports","window"],"sources":["library.ts"],"sourcesContent":["/**\n * @file library.ts\n * @description Standard SAP UI5 library registration file. Exposes the MetaUI namespace \n * and automatically bootstraps the internal PluginRegistry.\n */\n\nimport Core from \"sap/ui/core/Core\";\nimport { PluginRegistry } from \"./core/PluginRegistry\";\nimport { StringPlugin } from \"./plugins/StringPlugin\";\nimport { NumberPlugin } from \"./plugins/NumberPlugin\";\nimport { BooleanPlugin } from \"./plugins/BooleanPlugin\";\nimport { DropdownPlugin } from \"./plugins/DropdownPlugin\";\nimport { DatePlugin } from \"./plugins/DatePlugin\";\nimport { TimePlugin } from \"./plugins/TimePlugin\";\nimport { DateTimePlugin } from \"./plugins/DateTimePlugin\";\nimport { ArrayPlugin } from \"./plugins/ArrayPlugin\";\n\nimport { TextAreaPlugin } from \"./plugins/TextAreaPlugin\";\nimport { SwitchPlugin } from \"./plugins/SwitchPlugin\";\n\n// Delegate to standard library registration\nCore.initLibrary({\n name: \"nz.co.siliconst.ui5.metaui\",\n version: \"1.0.0\",\n dependencies: [\n \"sap.ui.core\",\n \"sap.m\",\n \"sap.ui.layout\",\n \"sap.ui.table\"\n ],\n controls: [\n \"nz.co.siliconst.ui5.metaui.controls.GeneratorHost\"\n ],\n elements: [],\n interfaces: [],\n noLibraryCSS: true\n});\n\n/**\n * Global Bootstrapper: Maps all standard primitive types to their respective plugins.\n */\nconst registry = PluginRegistry.getInstance();\nregistry.register(\"string\", StringPlugin);\nregistry.register(\"string\", TextAreaPlugin, \"textArea\");\nregistry.register(\"number\", NumberPlugin);\nregistry.register(\"boolean\", BooleanPlugin);\nregistry.register(\"boolean\", SwitchPlugin, \"switch\");\nregistry.register(\"dropdown\", DropdownPlugin);\nregistry.register(\"date\", DatePlugin);\nregistry.register(\"time\", TimePlugin);\nregistry.register(\"datetime\", DateTimePlugin);\nregistry.register(\"array\", ArrayPlugin);\n\n// Exporting window object safely for UI5 compatibility if needed\nexport default (window as any)[\"nz\"][\"co\"][\"siliconst\"][\"ui5\"][\"metaui\"];\n"],"mappings":"AAAA,qZAOSA,EAAcC,EAAA,wBACdC,EAAYC,EAAA,sBACZC,EAAYC,EAAA,sBACZC,EAAaC,EAAA,uBACbC,EAAcC,EAAA,wBACdC,EAAUC,EAAA,oBACVC,EAAUC,EAAA,oBACVC,EAAcC,EAAA,wBACdC,EAAWC,EAAA,qBAEXC,EAAcC,EAAA,wBACdC,EAAYC,EAAA,gBAGrBC,EAAKC,YAAY,CACbC,KAAM,6BACNC,QAAS,QACTC,aAAc,CACV,cACA,QACA,gBACA,gBAEJC,SAAU,CACN,qDAEJC,SAAU,GACVC,WAAY,GACZC,aAAc,OAMlB,MAAMC,EAAW/B,EAAegC,cAChCD,EAASE,SAAS,SAAU/B,GAC5B6B,EAASE,SAAS,SAAUf,EAAgB,YAC5Ca,EAASE,SAAS,SAAU7B,GAC5B2B,EAASE,SAAS,UAAW3B,GAC7ByB,EAASE,SAAS,UAAWb,EAAc,UAC3CW,EAASE,SAAS,WAAYzB,GAC9BuB,EAASE,SAAS,OAAQvB,GAC1BqB,EAASE,SAAS,OAAQrB,GAC1BmB,EAASE,SAAS,WAAYnB,GAC9BiB,EAASE,SAAS,QAASjB,GAE3B,IAAAkB,EACgBC,OAAe,MAAM,MAAM,aAAa,OAAO,UAAS,OAAAD,CAAA","ignoreList":[],"sourceRoot":""}},{"offset":{"line":12,"column":0},"map":{"version":3,"names":["ArrayPlugin","render","field","bindingPath","modelName","propKey","startsWith","substring","Button","text","icon","press","oEvent","btn","getSource","context","getBindingContext","rowData","getObject","nestedData","subSchema","type","properties","ui","label","items","sap","require","GeneratorHost","host","schemaDefinition","initialData","attachSubmit","e","payload","getParameter","updatedArray","parentModel","getModel","contextPath","getPath","setProperty","openInDialog","validate","onStateChange","newMetadata","__exports","__esModule"],"sources":["ArrayPlugin.ts"],"sourcesContent":["/**\n * @file ArrayPlugin.ts\n * @description Renders a button that drills down into a nested table (array) via a recursive Dialog using v2 schema.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport Control from \"sap/ui/core/Control\";\nimport Button from \"sap/m/Button\";\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\n\nexport class ArrayPlugin implements IPlugin {\n public render(field: IPropertyMetadata, bindingPath: string, modelName: string): Control {\n // In tables, bindingPath is usually passed simply as the key (e.g. 'lineItems' or '/lineItems')\n const propKey = bindingPath.startsWith(\"/\") ? bindingPath.substring(1) : bindingPath;\n \n return new Button({\n text: \"View Records\",\n icon: \"sap-icon://list\",\n press: (oEvent: any) => {\n const btn = oEvent.getSource() as Button;\n const context = btn.getBindingContext(modelName);\n if (!context) return;\n \n const rowData = context.getObject();\n const nestedData = rowData[propKey] || [];\n \n // Synthesize a v2 schema for the nested array dialog as an object wrapper\n const subSchema = {\n type: \"object\",\n properties: {\n [propKey]: {\n type: \"array\",\n ui: { label: field.ui?.label || propKey },\n items: field.items || {\n type: \"object\",\n properties: {} // inference will handle it if empty\n }\n }\n }\n };\n\n sap.ui.require([\"nz/co/siliconst/ui5/metaui/controls/GeneratorHost\"], (GeneratorHost: any) => {\n const host = new GeneratorHost({\n schemaDefinition: subSchema,\n initialData: {\n [propKey]: nestedData\n }\n });\n\n // V2 Fix: Capture the nested dialog's save event and update the parent model!\n host.attachSubmit((e: any) => {\n const payload = e.getParameter(\"payload\");\n const updatedArray = payload[propKey];\n \n const parentModel = btn.getModel(modelName) as JSONModel;\n const contextPath = btn.getBindingContext(modelName).getPath();\n \n // Push changes back to parent model to force UI5 bindings to refresh\n parentModel.setProperty(`${contextPath}/${propKey}`, updatedArray);\n });\n\n host.openInDialog(`Nested Records: ${field.ui?.label || propKey}`, \"Close\");\n });\n }\n });\n }\n\n public validate(): boolean { return true; }\n public onStateChange(newMetadata: IPropertyMetadata): void {}\n}\n"],"mappings":"AAAA,6GAWO,MAAMA,EACFC,OAAOC,EAA0BC,EAAqBC,GAEzD,MAAMC,EAAUF,EAAYG,WAAW,KAAOH,EAAYI,UAAU,GAAKJ,EAEzE,OAAO,IAAIK,EAAO,CACdC,KAAM,eACNC,KAAM,kBACNC,MAAQC,IACJ,MAAMC,EAAMD,EAAOE,YACnB,MAAMC,EAAUF,EAAIG,kBAAkBZ,GACtC,IAAKW,EAAS,OAEd,MAAME,EAAUF,EAAQG,YACxB,MAAMC,EAAaF,EAAQZ,IAAY,GAGvC,MAAMe,EAAY,CACdC,KAAM,SACNC,WAAY,CACRjB,CAACA,GAAU,CACPgB,KAAM,QACNE,GAAI,CAAEC,MAAOtB,EAAMqB,IAAIC,OAASnB,GAChCoB,MAAOvB,EAAMuB,OAAS,CAClBJ,KAAM,SACNC,WAAY,CAAC,MAM7BI,IAAIH,GAAGI,QAAQ,CAAC,qDAAuDC,IACnE,MAAMC,EAAO,IAAID,EAAc,CAC3BE,iBAAkBV,EAClBW,YAAa,CACT1B,CAACA,GAAUc,KAKnBU,EAAKG,aAAcC,IACf,MAAMC,EAAUD,EAAEE,aAAa,WAC/B,MAAMC,EAAeF,EAAQ7B,GAE7B,MAAMgC,EAAcxB,EAAIyB,SAASlC,GACjC,MAAMmC,EAAc1B,EAAIG,kBAAkBZ,GAAWoC,UAGrDH,EAAYI,YAAY,GAAGF,KAAelC,IAAW+B,KAGzDP,EAAKa,aAAa,mBAAmBxC,EAAMqB,IAAIC,OAASnB,IAAW,aAInF,CAEOsC,WAAsB,OAAO,IAAM,CACnCC,cAAcC,GAAuC,EAC/D,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAA9C,cAAA,OAAA8C,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":13,"column":0},"map":{"version":3,"names":["EventBus","___core_EventBus","BasePlugin","control","metadata","fieldKey","onStateChange","newMetadata","this","applyState","applyCommonDirectives","modelName","ui","readOnly","undefined","setEditable","visibleOn","expr","replace","bindProperty","parts","path","formatter","enabledOn","setEnabled","publishChange","newValue","getInstance","publishFieldChange","fieldName","__exports","__esModule"],"sources":["BasePlugin.ts"],"sourcesContent":["/**\n * @file BasePlugin.ts\n * @description Abstract foundation for all MetaUI plugins, enforcing lifecycle hooks for v2 Schema.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { EventBus } from \"../core/EventBus\";\nimport Control from \"sap/ui/core/Control\";\n\nexport abstract class BasePlugin implements IPlugin {\n protected control: Control | null = null;\n protected metadata: IPropertyMetadata | null = null;\n protected fieldKey: string = \"\";\n\n public abstract render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName?: string): Control;\n\n public abstract validate(): boolean;\n\n public onStateChange(newMetadata: IPropertyMetadata): void {\n this.metadata = newMetadata;\n this.applyState();\n }\n\n protected abstract applyState(): void;\n\n /**\n * Helper to apply common UI directives (like readOnly, visibleOn) directly to any control.\n */\n protected applyCommonDirectives(control: any, metadata: IPropertyMetadata, modelName: string = \"meta\"): void {\n if (metadata.ui?.readOnly !== undefined && typeof control.setEditable === \"function\") {\n control.setEditable(!metadata.ui.readOnly);\n }\n\n if (metadata.ui?.visibleOn) {\n const expr = `{= ${metadata.ui.visibleOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n control.bindProperty(\"visible\", { parts: [{ path: \"meta>/\" }], formatter: () => false });\n // The ConditionEngine handles actual binding injection, but here we can set a fallback or natively bind if we bypass ConditionEngine.\n control.bindProperty(\"visible\", expr);\n }\n \n if (metadata.ui?.enabledOn && typeof control.setEnabled === \"function\") {\n const expr = `{= ${metadata.ui.enabledOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n control.bindProperty(\"enabled\", expr);\n }\n }\n\n protected publishChange(newValue: any): void {\n if (this.metadata && this.fieldKey) {\n EventBus.getInstance().publishFieldChange({\n fieldName: this.fieldKey,\n newValue: newValue\n });\n }\n }\n}\n"],"mappings":"AAAA,gHAAA,MAOSA,EAAQC,EAAA,YAGV,MAAeC,EACRC,QAA0B,KAC1BC,SAAqC,KACrCC,SAAmB,GAMtBC,cAAcC,GACjBC,KAAKJ,SAAWG,EAChBC,KAAKC,YACT,CAOUC,sBAAsBP,EAAcC,EAA6BO,EAAoB,QAC3F,GAAIP,EAASQ,IAAIC,WAAaC,kBAAoBX,EAAQY,cAAgB,WAAY,CAClFZ,EAAQY,aAAaX,EAASQ,GAAGC,SACrC,CAEA,GAAIT,EAASQ,IAAII,UAAW,CACxB,MAAMC,EAAO,MAAMb,EAASQ,GAAGI,UAAUE,QAAQ,YAAa,GAAGP,OAAeO,QAAQ,MAAO,SAC/Ff,EAAQgB,aAAa,UAAW,CAAEC,MAAO,CAAC,CAAEC,KAAM,WAAaC,UAAWA,IAAM,QAEhFnB,EAAQgB,aAAa,UAAWF,EACpC,CAEA,GAAIb,EAASQ,IAAIW,kBAAoBpB,EAAQqB,aAAe,WAAY,CACpE,MAAMP,EAAO,MAAMb,EAASQ,GAAGW,UAAUL,QAAQ,YAAa,GAAGP,OAAeO,QAAQ,MAAO,SAC/Ff,EAAQgB,aAAa,UAAWF,EACpC,CACJ,CAEUQ,cAAcC,GACpB,GAAIlB,KAAKJ,UAAYI,KAAKH,SAAU,CAChCL,EAAS2B,cAAcC,mBAAmB,CACtCC,UAAWrB,KAAKH,SAChBqB,SAAUA,GAElB,CACJ,EACH,IAAAI,EAAA,CAAAC,WAAA,MAAAD,EAAA5B,aAAA,OAAA4B,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":14,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","BooleanPlugin","render","fieldMetadata","bindingPath","modelName","this","metadata","control","CheckBox","selected","enabled","ui","readOnly","select","oEvent","val","getParameter","publishChange","validate","applyState","setEnabled","__exports","__esModule"],"sources":["BooleanPlugin.ts"],"sourcesContent":["/**\n * @file BooleanPlugin.ts\n * @description Renders a sap.m.Switch for boolean states.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport CheckBox from \"sap/m/CheckBox\";\nimport Control from \"sap/ui/core/Control\";\n\n/**\n * Handles rendering logic for toggleable booleans.\n */\nexport class BooleanPlugin extends BasePlugin {\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\"): Control {\n this.metadata = fieldMetadata;\n \n this.control = new CheckBox({\n selected: `{${modelName}>${bindingPath}}`,\n enabled: !fieldMetadata.ui?.readOnly,\n select: (oEvent: any) => {\n const val = oEvent.getParameter(\"selected\");\n this.publishChange(val);\n this.validate();\n }\n });\n\n return this.control;\n }\n\n public validate(): boolean {\n // Boolean states rarely fail validation.\n return true;\n }\n\n protected applyState(): void {\n if (this.control && this.metadata) {\n (this.control as CheckBox).setEnabled(!this.metadata.ui?.readOnly);\n }\n }\n}\n"],"mappings":"AAAA,kIAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAsBF,EACxBG,OAAOC,EAAkCC,EAAqBC,EAAoB,QACrFC,KAAKC,SAAWJ,EAEhBG,KAAKE,QAAU,IAAIC,EAAS,CACxBC,SAAU,IAAIL,KAAaD,KAC3BO,SAAUR,EAAcS,IAAIC,SAC5BC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,YAChCX,KAAKY,cAAcF,GACnBV,KAAKa,cAIb,OAAOb,KAAKE,OAChB,CAEOW,WAEH,OAAO,IACX,CAEUC,aACN,GAAId,KAAKE,SAAWF,KAAKC,SAAU,CAC9BD,KAAKE,QAAqBa,YAAYf,KAAKC,SAASK,IAAIC,SAC7D,CACJ,EACH,IAAAS,EAAA,CAAAC,WAAA,MAAAD,EAAArB,gBAAA,OAAAqB,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":15,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","DatePlugin","render","fieldMetadata","bindingPath","modelName","this","metadata","control","DatePicker","value","path","type","formatOptions","source","pattern","displayFormat","editable","ui","readOnly","required","change","oEvent","val","getParameter","publishChange","validate","dp","isValid","isValidValue","getValue","trim","setValueState","setValueStateText","applyState","setEditable","setRequired","__exports","__esModule"],"sources":["DatePlugin.ts"],"sourcesContent":["/**\n * @file DatePlugin.ts\n * @description Renders a sap.m.DatePicker natively bound to ISO date strings.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport DatePicker from \"sap/m/DatePicker\";\nimport Control from \"sap/ui/core/Control\";\n\n/**\n * Handles rendering logic for Date strings.\n */\nexport class DatePlugin extends BasePlugin {\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\"): Control {\n this.metadata = fieldMetadata;\n \n this.control = new DatePicker({\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Date\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd\" },\n pattern: \"yyyy-MM-dd\"\n }\n },\n displayFormat: \"long\",\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: any) => {\n const val = oEvent.getParameter(\"value\");\n this.publishChange(val);\n this.validate();\n }\n });\n\n return this.control;\n }\n\n public validate(): boolean {\n if (!this.control || !this.metadata) return true;\n const dp = this.control as DatePicker;\n const isValid = typeof dp.isValidValue === \"function\" ? dp.isValidValue() : true;\n const val = dp.getValue();\n\n if (this.metadata.required && (!val || typeof val !== 'string' || val.trim() === \"\")) {\n dp.setValueState(\"Error\" as any);\n dp.setValueStateText(\"A valid date is required.\");\n return false;\n }\n\n if (val && !isValid) {\n dp.setValueState(\"Error\" as any);\n dp.setValueStateText(\"Invalid date format.\");\n return false;\n }\n\n dp.setValueState(\"None\" as any);\n return true;\n }\n\n protected applyState(): void {\n if (this.control && this.metadata) {\n const dp = this.control as DatePicker;\n dp.setEditable(!this.metadata.ui?.readOnly);\n dp.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":"AAAA,iIAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAmBF,EACrBG,OAAOC,EAAkCC,EAAqBC,EAAoB,QACrFC,KAAKC,SAAWJ,EAEhBG,KAAKE,QAAU,IAAIC,EAAW,CAC1BC,MAAO,CACHC,KAAM,GAAGN,KAAaD,IACtBQ,KAAM,yBACNC,cAAe,CACXC,OAAQ,CAAEC,QAAS,cACnBA,QAAS,eAGjBC,cAAe,OACfC,UAAWd,EAAce,IAAIC,SAC7BC,SAAUjB,EAAciB,SACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChClB,KAAKmB,cAAcF,GACnBjB,KAAKoB,cAIb,OAAOpB,KAAKE,OAChB,CAEOkB,WACH,IAAKpB,KAAKE,UAAYF,KAAKC,SAAU,OAAO,KAC5C,MAAMoB,EAAKrB,KAAKE,QAChB,MAAMoB,SAAiBD,EAAGE,eAAiB,WAAaF,EAAGE,eAAiB,KAC5E,MAAMN,EAAMI,EAAGG,WAEf,GAAIxB,KAAKC,SAASa,YAAcG,UAAcA,IAAQ,UAAYA,EAAIQ,SAAW,IAAK,CAClFJ,EAAGK,cAAc,SACjBL,EAAGM,kBAAkB,6BACrB,OAAO,KACX,CAEA,GAAIV,IAAQK,EAAS,CACjBD,EAAGK,cAAc,SACjBL,EAAGM,kBAAkB,wBACrB,OAAO,KACX,CAEAN,EAAGK,cAAc,QACjB,OAAO,IACX,CAEUE,aACN,GAAI5B,KAAKE,SAAWF,KAAKC,SAAU,CAC/B,MAAMoB,EAAKrB,KAAKE,QAChBmB,EAAGQ,aAAa7B,KAAKC,SAASW,IAAIC,UAClCQ,EAAGS,YAAY9B,KAAKC,SAASa,SACjC,CACJ,EACH,IAAAiB,EAAA,CAAAC,WAAA,MAAAD,EAAApC,aAAA,OAAAoC,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":16,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","DateTimePlugin","render","fieldMetadata","bindingPath","modelName","this","metadata","control","DateTimePicker","value","path","type","formatOptions","source","pattern","editable","ui","readOnly","required","change","oEvent","val","getParameter","publishChange","validate","input","isValid","isValidValue","getValue","trim","setValueState","setValueStateText","applyState","setEditable","setRequired","__exports","__esModule"],"sources":["DateTimePlugin.ts"],"sourcesContent":["/**\n * @file DateTimePlugin.ts\n * @description Handles rendering logic for DateTime strings (timestamps).\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport DateTimePicker from \"sap/m/DateTimePicker\";\nimport Control from \"sap/ui/core/Control\";\n\n/**\n * Handles rendering and logic for timestamps/datetime inputs.\n */\nexport class DateTimePlugin extends BasePlugin {\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\"): Control {\n this.metadata = fieldMetadata;\n \n this.control = new DateTimePicker({\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.DateTime\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\" },\n pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\"\n }\n },\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: any) => {\n const val = oEvent.getParameter(\"value\");\n this.publishChange(val);\n this.validate();\n }\n });\n\n return this.control;\n }\n\n public validate(): boolean {\n if (!this.control || !this.metadata) return true;\n const input = this.control as DateTimePicker;\n const isValid = typeof input.isValidValue === \"function\" ? input.isValidValue() : true;\n const val = input.getValue();\n\n if (this.metadata.required && (!val || typeof val !== 'string' || val.trim() === \"\")) {\n input.setValueState(\"Error\" as any);\n input.setValueStateText(\"This field is required.\");\n return false;\n }\n\n if (val && !isValid) {\n input.setValueState(\"Error\" as any);\n input.setValueStateText(\"Invalid datetime format.\");\n return false;\n }\n\n input.setValueState(\"None\" as any);\n return true;\n }\n\n protected applyState(): void {\n if (this.control && this.metadata) {\n const input = this.control as DateTimePicker;\n input.setEditable(!this.metadata.ui?.readOnly);\n input.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":"AAAA,yIAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAuBF,EACzBG,OAAOC,EAAkCC,EAAqBC,EAAoB,QACrFC,KAAKC,SAAWJ,EAEhBG,KAAKE,QAAU,IAAIC,EAAe,CAC9BC,MAAO,CACHC,KAAM,GAAGN,KAAaD,IACtBQ,KAAM,6BACNC,cAAe,CACXC,OAAQ,CAAEC,QAAS,4BACnBA,QAAS,6BAGjBC,UAAWb,EAAcc,IAAIC,SAC7BC,SAAUhB,EAAcgB,SACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChCjB,KAAKkB,cAAcF,GACnBhB,KAAKmB,cAIb,OAAOnB,KAAKE,OAChB,CAEOiB,WACH,IAAKnB,KAAKE,UAAYF,KAAKC,SAAU,OAAO,KAC5C,MAAMmB,EAAQpB,KAAKE,QACnB,MAAMmB,SAAiBD,EAAME,eAAiB,WAAaF,EAAME,eAAiB,KAClF,MAAMN,EAAMI,EAAMG,WAElB,GAAIvB,KAAKC,SAASY,YAAcG,UAAcA,IAAQ,UAAYA,EAAIQ,SAAW,IAAK,CAClFJ,EAAMK,cAAc,SACpBL,EAAMM,kBAAkB,2BACxB,OAAO,KACX,CAEA,GAAIV,IAAQK,EAAS,CACjBD,EAAMK,cAAc,SACpBL,EAAMM,kBAAkB,4BACxB,OAAO,KACX,CAEAN,EAAMK,cAAc,QACpB,OAAO,IACX,CAEUE,aACN,GAAI3B,KAAKE,SAAWF,KAAKC,SAAU,CAC/B,MAAMmB,EAAQpB,KAAKE,QACnBkB,EAAMQ,aAAa5B,KAAKC,SAASU,IAAIC,UACrCQ,EAAMS,YAAY7B,KAAKC,SAASY,SACpC,CACJ,EACH,IAAAiB,EAAA,CAAAC,WAAA,MAAAD,EAAAnC,iBAAA,OAAAmC,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":17,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","DropdownPlugin","render","fieldMetadata","bindingPath","modelName","this","metadata","select","Select","selectedKey","enabled","ui","readOnly","forceSelection","change","oEvent","item","getParameter","val","getKey","publishChange","validate","valueHelp","Array","isArray","addItem","Item","key","text","forEach","vh","control","getSelectedKey","required","trim","setValueState","setValueStateText","applyState","setEnabled","__exports","__esModule"],"sources":["DropdownPlugin.ts"],"sourcesContent":["/**\n * @file DropdownPlugin.ts\n * @description Renders a sap.m.Select utilizing the schema's valueHelp structure.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport Select from \"sap/m/Select\";\nimport Item from \"sap/ui/core/Item\";\nimport Control from \"sap/ui/core/Control\";\n\n/**\n * Handles rendering logic for dropdown inputs.\n */\nexport class DropdownPlugin extends BasePlugin {\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\"): Control {\n this.metadata = fieldMetadata;\n \n const select = new Select({\n selectedKey: `{${modelName}>${bindingPath}}`,\n enabled: !fieldMetadata.ui?.readOnly,\n forceSelection: false,\n change: (oEvent: any) => {\n const item = oEvent.getParameter(\"selectedItem\");\n const val = item ? item.getKey() : \"\";\n this.publishChange(val);\n this.validate();\n }\n });\n\n if (fieldMetadata.valueHelp && Array.isArray(fieldMetadata.valueHelp)) {\n // Always add the empty placeholder so that 'required' checks can actually fire if the user hasn't made a choice\n select.addItem(new Item({ key: \"\", text: \"--- Select ---\" }));\n \n fieldMetadata.valueHelp.forEach(vh => {\n select.addItem(new Item({ key: vh.key, text: vh.text }));\n });\n }\n\n this.control = select;\n return this.control;\n }\n\n public validate(): boolean {\n if (!this.control || !this.metadata) return true;\n const select = this.control as Select;\n const val = select.getSelectedKey();\n\n if (this.metadata.required && (!val || val.trim() === \"\")) {\n select.setValueState(\"Error\" as any);\n select.setValueStateText(\"Selection is required.\");\n return false;\n }\n\n select.setValueState(\"None\" as any);\n return true;\n }\n\n protected applyState(): void {\n if (this.control && this.metadata) {\n const select = this.control as Select;\n select.setEnabled(!this.metadata.ui?.readOnly);\n }\n }\n}\n"],"mappings":"AAAA,sJAAA,MAKSA,EAAUC,EAAA,cASZ,MAAMC,UAAuBF,EACzBG,OAAOC,EAAkCC,EAAqBC,EAAoB,QACrFC,KAAKC,SAAWJ,EAEhB,MAAMK,EAAS,IAAIC,EAAO,CACtBC,YAAa,IAAIL,KAAaD,KAC9BO,SAAUR,EAAcS,IAAIC,SAC5BC,eAAgB,MAChBC,OAASC,IACL,MAAMC,EAAOD,EAAOE,aAAa,gBACjC,MAAMC,EAAMF,EAAOA,EAAKG,SAAW,GACnCd,KAAKe,cAAcF,GACnBb,KAAKgB,cAIb,GAAInB,EAAcoB,WAAaC,MAAMC,QAAQtB,EAAcoB,WAAY,CAEnEf,EAAOkB,QAAQ,IAAIC,EAAK,CAAEC,IAAK,GAAIC,KAAM,oBAEzC1B,EAAcoB,UAAUO,QAAQC,IAC5BvB,EAAOkB,QAAQ,IAAIC,EAAK,CAAEC,IAAKG,EAAGH,IAAKC,KAAME,EAAGF,SAExD,CAEAvB,KAAK0B,QAAUxB,EACf,OAAOF,KAAK0B,OAChB,CAEOV,WACH,IAAKhB,KAAK0B,UAAY1B,KAAKC,SAAU,OAAO,KAC5C,MAAMC,EAASF,KAAK0B,QACpB,MAAMb,EAAMX,EAAOyB,iBAEnB,GAAI3B,KAAKC,SAAS2B,YAAcf,GAAOA,EAAIgB,SAAW,IAAK,CACvD3B,EAAO4B,cAAc,SACrB5B,EAAO6B,kBAAkB,0BACzB,OAAO,KACX,CAEA7B,EAAO4B,cAAc,QACrB,OAAO,IACX,CAEUE,aACN,GAAIhC,KAAK0B,SAAW1B,KAAKC,SAAU,CAC/B,MAAMC,EAASF,KAAK0B,QACpBxB,EAAO+B,YAAYjC,KAAKC,SAASK,IAAIC,SACzC,CACJ,EACH,IAAA2B,EAAA,CAAAC,WAAA,MAAAD,EAAAvC,iBAAA,OAAAuC,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":18,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","NumberPlugin","render","fieldMetadata","bindingPath","modelName","this","metadata","control","StepInput","value","displayValuePrecision","scale","editable","ui","readOnly","required","change","oEvent","val","getParameter","publishChange","validate","input","getValue","undefined","Number","isNaN","setValueState","setValueStateText","applyState","setEditable","setRequired","__exports","__esModule"],"sources":["NumberPlugin.ts"],"sourcesContent":["/**\n * @file NumberPlugin.ts\n * @description Renders a sap.m.StepInput for numeric data.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport StepInput from \"sap/m/StepInput\";\nimport Control from \"sap/ui/core/Control\";\n\n/**\n * Handles rendering and logic for numeric inputs.\n */\nexport class NumberPlugin extends BasePlugin {\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\"): Control {\n this.metadata = fieldMetadata;\n\n this.control = new StepInput({\n value: `{${modelName}>${bindingPath}}`,\n displayValuePrecision: fieldMetadata.scale || 0,\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: any) => {\n const val = oEvent.getParameter(\"value\");\n this.publishChange(val);\n this.validate();\n }\n });\n\n return this.control;\n }\n\n public validate(): boolean {\n if (!this.control || !this.metadata) return true;\n const input = this.control as StepInput;\n const val = input.getValue();\n\n // StepInput generally defaults to 0 and isn't usually undefined unless unbound or erased\n if (this.metadata.required && (val === null || val === undefined || Number.isNaN(val) || val === \"\")) {\n input.setValueState(\"Error\" as any);\n input.setValueStateText(\"This field is required.\");\n return false;\n }\n\n input.setValueState(\"None\" as any);\n return true;\n }\n\n protected applyState(): void {\n if (this.control && this.metadata) {\n const input = this.control as StepInput;\n input.setEditable(!this.metadata.ui?.readOnly);\n input.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":"AAAA,kIAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAqBF,EACvBG,OAAOC,EAAkCC,EAAqBC,EAAoB,QACrFC,KAAKC,SAAWJ,EAEhBG,KAAKE,QAAU,IAAIC,EAAU,CACzBC,MAAO,IAAIL,KAAaD,KACxBO,sBAAuBR,EAAcS,OAAS,EAC9CC,UAAWV,EAAcW,IAAIC,SAC7BC,SAAUb,EAAca,SACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChCd,KAAKe,cAAcF,GACnBb,KAAKgB,cAIb,OAAOhB,KAAKE,OAChB,CAEOc,WACH,IAAKhB,KAAKE,UAAYF,KAAKC,SAAU,OAAO,KAC5C,MAAMgB,EAAQjB,KAAKE,QACnB,MAAMW,EAAMI,EAAMC,WAGlB,GAAIlB,KAAKC,SAASS,WAAaG,IAAQ,MAAQA,IAAQM,WAAaC,OAAOC,MAAMR,IAAQA,IAAQ,IAAK,CAClGI,EAAMK,cAAc,SACpBL,EAAMM,kBAAkB,2BACxB,OAAO,KACX,CAEAN,EAAMK,cAAc,QACpB,OAAO,IACX,CAEUE,aACN,GAAIxB,KAAKE,SAAWF,KAAKC,SAAU,CAC/B,MAAMgB,EAAQjB,KAAKE,QACnBe,EAAMQ,aAAazB,KAAKC,SAASO,IAAIC,UACrCQ,EAAMS,YAAY1B,KAAKC,SAASS,SACpC,CACJ,EACH,IAAAiB,EAAA,CAAAC,WAAA,MAAAD,EAAAhC,eAAA,OAAAgC,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":19,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","StringPlugin","render","fieldMetadata","bindingPath","modelName","this","metadata","fieldKey","replace","control","Input","value","maxLength","required","showValueHelp","ui","widget","change","oEvent","val","getParameter","publishChange","validate","applyCommonDirectives","input","getValue","trim","setValueState","setValueStateText","applyState","setEditable","readOnly","setRequired","__exports","__esModule"],"sources":["StringPlugin.ts"],"sourcesContent":["/**\n * @file StringPlugin.ts\n * @description Renders a sap.m.Input for string data and validates lengths.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport Input from \"sap/m/Input\";\nimport Control from \"sap/ui/core/Control\";\n\n/**\n * Handles rendering and logic for basic text inputs.\n */\nexport class StringPlugin extends BasePlugin {\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\"): Control {\n this.metadata = fieldMetadata;\n this.fieldKey = bindingPath.replace(\"/\", \"\"); // For EventBus\n \n this.control = new Input({\n value: `{${modelName}>${bindingPath}}`,\n maxLength: fieldMetadata.maxLength || 0,\n required: !!fieldMetadata.required,\n showValueHelp: fieldMetadata.ui?.widget === \"searchHelp\",\n change: (oEvent: any) => {\n const val = oEvent.getParameter(\"value\");\n this.publishChange(val);\n this.validate();\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control;\n }\n\n public validate(): boolean {\n if (!this.control || !this.metadata) return true;\n const input = this.control as Input;\n const val = input.getValue();\n\n if (this.metadata.required && (!val || typeof val !== 'string' || val.trim() === \"\")) {\n input.setValueState(\"Error\" as any);\n input.setValueStateText(\"This field is required.\");\n return false;\n }\n\n input.setValueState(\"None\" as any);\n return true;\n }\n\n protected applyState(): void {\n if (this.control && this.metadata) {\n const input = this.control as Input;\n input.setEditable(!this.metadata.ui?.readOnly);\n input.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":"AAAA,8HAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAqBF,EACvBG,OAAOC,EAAkCC,EAAqBC,EAAoB,QACrFC,KAAKC,SAAWJ,EAChBG,KAAKE,SAAWJ,EAAYK,QAAQ,IAAK,IAEzCH,KAAKI,QAAU,IAAIC,EAAM,CACrBC,MAAO,IAAIP,KAAaD,KACxBS,UAAWV,EAAcU,WAAa,EACtCC,WAAYX,EAAcW,SAC1BC,cAAeZ,EAAca,IAAIC,SAAW,aAC5CC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChCf,KAAKgB,cAAcF,GACnBd,KAAKiB,cAIbjB,KAAKkB,sBAAsBlB,KAAKI,QAASP,EAAeE,GAExD,OAAOC,KAAKI,OAChB,CAEOa,WACH,IAAKjB,KAAKI,UAAYJ,KAAKC,SAAU,OAAO,KAC5C,MAAMkB,EAAQnB,KAAKI,QACnB,MAAMU,EAAMK,EAAMC,WAElB,GAAIpB,KAAKC,SAASO,YAAcM,UAAcA,IAAQ,UAAYA,EAAIO,SAAW,IAAK,CAClFF,EAAMG,cAAc,SACpBH,EAAMI,kBAAkB,2BACxB,OAAO,KACX,CAEAJ,EAAMG,cAAc,QACpB,OAAO,IACX,CAEUE,aACN,GAAIxB,KAAKI,SAAWJ,KAAKC,SAAU,CAC/B,MAAMkB,EAAQnB,KAAKI,QACnBe,EAAMM,aAAazB,KAAKC,SAASS,IAAIgB,UACrCP,EAAMQ,YAAY3B,KAAKC,SAASO,SACpC,CACJ,EACH,IAAAoB,EAAA,CAAAC,WAAA,MAAAD,EAAAjC,eAAA,OAAAiC,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":20,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","SwitchPlugin","render","fieldMetadata","bindingPath","modelName","this","metadata","control","Switch","state","enabled","ui","readOnly","change","oEvent","val","getParameter","publishChange","validate","applyState","sw","setEnabled","__exports","__esModule"],"sources":["SwitchPlugin.ts"],"sourcesContent":["/**\n * @file SwitchPlugin.ts\n * @description Renders a sap.m.Switch for boolean data specifically marked with the switch widget.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport Switch from \"sap/m/Switch\";\nimport Control from \"sap/ui/core/Control\";\n\n/**\n * Handles rendering logic for toggleable boolean switches.\n */\nexport class SwitchPlugin extends BasePlugin {\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\"): Control {\n this.metadata = fieldMetadata;\n\n this.control = new Switch({\n state: `{${modelName}>${bindingPath}}`,\n enabled: !fieldMetadata.ui?.readOnly,\n change: (oEvent: any) => {\n const val = oEvent.getParameter(\"state\");\n this.publishChange(val);\n this.validate();\n }\n });\n\n return this.control;\n }\n\n public validate(): boolean {\n // Boolean states rarely fail validation.\n return true;\n }\n\n protected applyState(): void {\n if (this.control && this.metadata) {\n const sw = this.control as Switch;\n sw.setEnabled(!this.metadata.ui?.readOnly);\n }\n }\n}\n"],"mappings":"AAAA,+HAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAqBF,EACvBG,OAAOC,EAAkCC,EAAqBC,EAAoB,QACrFC,KAAKC,SAAWJ,EAEhBG,KAAKE,QAAU,IAAIC,EAAO,CACtBC,MAAO,IAAIL,KAAaD,KACxBO,SAAUR,EAAcS,IAAIC,SAC5BC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChCX,KAAKY,cAAcF,GACnBV,KAAKa,cAIb,OAAOb,KAAKE,OAChB,CAEOW,WAEH,OAAO,IACX,CAEUC,aACN,GAAId,KAAKE,SAAWF,KAAKC,SAAU,CAC/B,MAAMc,EAAKf,KAAKE,QAChBa,EAAGC,YAAYhB,KAAKC,SAASK,IAAIC,SACrC,CACJ,EACH,IAAAU,EAAA,CAAAC,WAAA,MAAAD,EAAAtB,eAAA,OAAAsB,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":21,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","TextAreaPlugin","render","fieldMetadata","bindingPath","modelName","this","metadata","fieldKey","replace","control","TextArea","value","maxLength","required","rows","ui","change","oEvent","val","getParameter","publishChange","validate","applyCommonDirectives","input","getValue","trim","setValueState","setValueStateText","applyState","setEditable","readOnly","setRequired","__exports","__esModule"],"sources":["TextAreaPlugin.ts"],"sourcesContent":["/**\n * @file TextAreaPlugin.ts\n * @description Renders a sap.m.TextArea for string data specifically marked with the textArea widget.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport TextArea from \"sap/m/TextArea\";\nimport Control from \"sap/ui/core/Control\";\n\n/**\n * Handles rendering and logic for multi-line text areas.\n */\nexport class TextAreaPlugin extends BasePlugin {\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\"): Control {\n this.metadata = fieldMetadata;\n this.fieldKey = bindingPath.replace(\"/\", \"\"); // For EventBus\n \n this.control = new TextArea({\n value: `{${modelName}>${bindingPath}}`,\n maxLength: fieldMetadata.maxLength || 0,\n required: !!fieldMetadata.required,\n rows: fieldMetadata.ui?.rows || 4, // Default to 4 rows for text areas\n change: (oEvent: any) => {\n const val = oEvent.getParameter(\"value\");\n this.publishChange(val);\n this.validate();\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control;\n }\n\n public validate(): boolean {\n if (!this.control || !this.metadata) return true;\n const input = this.control as TextArea;\n const val = input.getValue();\n\n if (this.metadata.required && (!val || typeof val !== 'string' || val.trim() === \"\")) {\n input.setValueState(\"Error\" as any);\n input.setValueStateText(\"This field is required.\");\n return false;\n }\n\n input.setValueState(\"None\" as any);\n return true;\n }\n\n protected applyState(): void {\n if (this.control && this.metadata) {\n const input = this.control as TextArea;\n input.setEditable(!this.metadata.ui?.readOnly);\n input.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":"AAAA,mIAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAuBF,EACzBG,OAAOC,EAAkCC,EAAqBC,EAAoB,QACrFC,KAAKC,SAAWJ,EAChBG,KAAKE,SAAWJ,EAAYK,QAAQ,IAAK,IAEzCH,KAAKI,QAAU,IAAIC,EAAS,CACxBC,MAAO,IAAIP,KAAaD,KACxBS,UAAWV,EAAcU,WAAa,EACtCC,WAAYX,EAAcW,SAC1BC,KAAMZ,EAAca,IAAID,MAAQ,EAChCE,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChCd,KAAKe,cAAcF,GACnBb,KAAKgB,cAIbhB,KAAKiB,sBAAsBjB,KAAKI,QAASP,EAAeE,GAExD,OAAOC,KAAKI,OAChB,CAEOY,WACH,IAAKhB,KAAKI,UAAYJ,KAAKC,SAAU,OAAO,KAC5C,MAAMiB,EAAQlB,KAAKI,QACnB,MAAMS,EAAMK,EAAMC,WAElB,GAAInB,KAAKC,SAASO,YAAcK,UAAcA,IAAQ,UAAYA,EAAIO,SAAW,IAAK,CAClFF,EAAMG,cAAc,SACpBH,EAAMI,kBAAkB,2BACxB,OAAO,KACX,CAEAJ,EAAMG,cAAc,QACpB,OAAO,IACX,CAEUE,aACN,GAAIvB,KAAKI,SAAWJ,KAAKC,SAAU,CAC/B,MAAMiB,EAAQlB,KAAKI,QACnBc,EAAMM,aAAaxB,KAAKC,SAASS,IAAIe,UACrCP,EAAMQ,YAAY1B,KAAKC,SAASO,SACpC,CACJ,EACH,IAAAmB,EAAA,CAAAC,WAAA,MAAAD,EAAAhC,iBAAA,OAAAgC,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":22,"column":0},"map":{"version":3,"names":["BasePlugin","___BasePlugin","TimePlugin","render","fieldMetadata","bindingPath","modelName","this","metadata","control","TimePicker","value","path","type","formatOptions","source","pattern","displayFormat","editable","ui","readOnly","required","change","oEvent","val","getParameter","publishChange","validate","input","isValid","isValidValue","getValue","coreLibrary","sap","require","ValueState","Error","None","trim","setValueState","setValueStateText","applyState","setEditable","setRequired","__exports","__esModule"],"sources":["TimePlugin.ts"],"sourcesContent":["/**\n * @file TimePlugin.ts\n * @description Handles rendering logic for Time strings.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport TimePicker from \"sap/m/TimePicker\";\nimport Control from \"sap/ui/core/Control\";\n\n/**\n * Handles rendering and logic for time inputs.\n */\nexport class TimePlugin extends BasePlugin {\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\"): Control {\n this.metadata = fieldMetadata;\n \n this.control = new TimePicker({\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Time\",\n formatOptions: {\n source: { pattern: \"HH:mm:ss\" },\n pattern: \"HH:mm:ss\"\n }\n },\n displayFormat: \"HH:mm:ss\",\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: any) => {\n const val = oEvent.getParameter(\"value\");\n this.publishChange(val);\n this.validate();\n }\n });\n\n return this.control;\n }\n\n public validate(): boolean {\n if (!this.control || !this.metadata) return true;\n const input = this.control as TimePicker;\n const isValid = typeof input.isValidValue === \"function\" ? input.isValidValue() : true;\n const val = input.getValue();\n const coreLibrary = sap.ui.require(\"sap/ui/core/library\");\n const ValueState = coreLibrary ? coreLibrary.ValueState : { Error: \"Error\", None: \"None\" };\n\n if (this.metadata.required && (!val || typeof val !== 'string' || val.trim() === \"\")) {\n input.setValueState(ValueState.Error);\n input.setValueStateText(\"This field is required.\");\n return false;\n }\n\n if (val && !isValid) {\n input.setValueState(ValueState.Error);\n input.setValueStateText(\"Invalid time format.\");\n return false;\n }\n\n input.setValueState(ValueState.None);\n return true;\n }\n\n protected applyState(): void {\n if (this.control && this.metadata) {\n const input = this.control as TimePicker;\n input.setEditable(!this.metadata.ui?.readOnly);\n input.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":"AAAA,iIAAA,MAKSA,EAAUC,EAAA,cAQZ,MAAMC,UAAmBF,EACrBG,OAAOC,EAAkCC,EAAqBC,EAAoB,QACrFC,KAAKC,SAAWJ,EAEhBG,KAAKE,QAAU,IAAIC,EAAW,CAC1BC,MAAO,CACHC,KAAM,GAAGN,KAAaD,IACtBQ,KAAM,yBACNC,cAAe,CACXC,OAAQ,CAAEC,QAAS,YACnBA,QAAS,aAGjBC,cAAe,WACfC,UAAWd,EAAce,IAAIC,SAC7BC,SAAUjB,EAAciB,SACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChClB,KAAKmB,cAAcF,GACnBjB,KAAKoB,cAIb,OAAOpB,KAAKE,OAChB,CAEOkB,WACH,IAAKpB,KAAKE,UAAYF,KAAKC,SAAU,OAAO,KAC5C,MAAMoB,EAAQrB,KAAKE,QACnB,MAAMoB,SAAiBD,EAAME,eAAiB,WAAaF,EAAME,eAAiB,KAClF,MAAMN,EAAMI,EAAMG,WAClB,MAAMC,EAAcC,IAAId,GAAGe,QAAQ,uBACnC,MAAMC,EAAaH,EAAcA,EAAYG,WAAa,CAAEC,MAAO,QAASC,KAAM,QAElF,GAAI9B,KAAKC,SAASa,YAAcG,UAAcA,IAAQ,UAAYA,EAAIc,SAAW,IAAK,CAClFV,EAAMW,cAAcJ,EAAWC,OAC/BR,EAAMY,kBAAkB,2BACxB,OAAO,KACX,CAEA,GAAIhB,IAAQK,EAAS,CACjBD,EAAMW,cAAcJ,EAAWC,OAC/BR,EAAMY,kBAAkB,wBACxB,OAAO,KACX,CAEAZ,EAAMW,cAAcJ,EAAWE,MAC/B,OAAO,IACX,CAEUI,aACN,GAAIlC,KAAKE,SAAWF,KAAKC,SAAU,CAC/B,MAAMoB,EAAQrB,KAAKE,QACnBmB,EAAMc,aAAanC,KAAKC,SAASW,IAAIC,UACrCQ,EAAMe,YAAYpC,KAAKC,SAASa,SACpC,CACJ,EACH,IAAAuB,EAAA,CAAAC,WAAA,MAAAD,EAAA1C,aAAA,OAAA0C,CAAA","ignoreList":[],"sourceRoot":"plugins"}},{"offset":{"line":23,"column":0},"map":{"version":3,"names":[],"sources":["library-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":25,"column":0},"map":{"version":3,"file":"IEventBus.js","names":[],"sources":[],"mappings":"AAAA","ignoreList":[],"sourceRoot":"interfaces"}},{"offset":{"line":28,"column":0},"map":{"version":3,"file":"ILayoutManager.js","names":[],"sources":[],"mappings":"AAAA","ignoreList":[],"sourceRoot":"interfaces"}},{"offset":{"line":31,"column":0},"map":{"version":3,"file":"IPlugin.js","names":[],"sources":[],"mappings":"AAAA","ignoreList":[],"sourceRoot":"interfaces"}},{"offset":{"line":34,"column":0},"map":{"version":3,"file":"ISchema.js","names":[],"sources":[],"mappings":"AAAA","ignoreList":[],"sourceRoot":"interfaces"}}]}
@@ -1 +1 @@
1
- {"version":3,"file":"library.d.ts","sourceRoot":"..\\..\\..\\..\\..\\..\\..","sources":["src\\nz\\co\\siliconst\\ui5\\metaui\\library.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,oCAAoC,CAAC;IAQpD,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;IAwBhF;;OAEG;IACH,MAAM,QAAQ,gBAA+B,CAAC;;IAQ9C,wBAAyE;CAExE"}
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/library.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,oCAAoC,CAAC;IAQpD,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;IA+BhF;;OAEG;IACH,MAAM,QAAQ,gBAA+B,CAAC;;IAa9C,wBAAyE;CAExE"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["sap/ui/core/Core","./core/PluginRegistry","./plugins/StringPlugin","./plugins/NumberPlugin","./plugins/BooleanPlugin","./plugins/DropdownPlugin","./plugins/DatePlugin"],function(n,i,e,s,t,o,r){"use strict";const u=i["PluginRegistry"];const g=e["StringPlugin"];const l=s["NumberPlugin"];const a=t["BooleanPlugin"];const c=o["DropdownPlugin"];const p=r["DatePlugin"];n.initLibrary({name:"nz.co.siliconst.ui5.metaui",version:"1.0.0",dependencies:["sap.ui.core","sap.m","sap.ui.layout","sap.ui.table"],controls:["nz.co.siliconst.ui5.metaui.controls.GeneratorHost"],elements:[],interfaces:[]});const P=u.getInstance();P.register("string",g);P.register("number",l);P.register("boolean",a);P.register("dropdown",c);P.register("date",p);var d=window["nz"]["co"]["siliconst"]["ui5"]["metaui"];return d});
1
+ sap.ui.define(["sap/ui/core/Core","./core/PluginRegistry","./plugins/StringPlugin","./plugins/NumberPlugin","./plugins/BooleanPlugin","./plugins/DropdownPlugin","./plugins/DatePlugin","./plugins/TimePlugin","./plugins/DateTimePlugin","./plugins/ArrayPlugin","./plugins/TextAreaPlugin","./plugins/SwitchPlugin"],function(i,n,e,t,r,s,u,g,o,l,a,c){"use strict";const P=n["PluginRegistry"];const p=e["StringPlugin"];const m=t["NumberPlugin"];const d=r["BooleanPlugin"];const b=s["DropdownPlugin"];const w=u["DatePlugin"];const y=g["TimePlugin"];const D=o["DateTimePlugin"];const S=l["ArrayPlugin"];const T=a["TextAreaPlugin"];const A=c["SwitchPlugin"];i.initLibrary({name:"nz.co.siliconst.ui5.metaui",version:"1.0.0",dependencies:["sap.ui.core","sap.m","sap.ui.layout","sap.ui.table"],controls:["nz.co.siliconst.ui5.metaui.controls.GeneratorHost"],elements:[],interfaces:[],noLibraryCSS:true});const f=P.getInstance();f.register("string",p);f.register("string",T,"textArea");f.register("number",m);f.register("boolean",d);f.register("boolean",A,"switch");f.register("dropdown",b);f.register("date",w);f.register("time",y);f.register("datetime",D);f.register("array",S);var h=window["nz"]["co"]["siliconst"]["ui5"]["metaui"];return h});
2
2
  //# sourceMappingURL=library.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"library.js","names":["PluginRegistry","___core_PluginRegistry","StringPlugin","___plugins_StringPlugin","NumberPlugin","___plugins_NumberPlugin","BooleanPlugin","___plugins_BooleanPlugin","DropdownPlugin","___plugins_DropdownPlugin","DatePlugin","___plugins_DatePlugin","Core","initLibrary","name","version","dependencies","controls","elements","interfaces","registry","getInstance","register","__exports","window"],"sources":["library.ts"],"sourcesContent":["/**\r\n * @file library.ts\r\n * @description Standard SAP UI5 library registration file. Exposes the MetaUI namespace \r\n * and automatically bootstraps the internal PluginRegistry.\r\n */\r\n\r\nimport Core from \"sap/ui/core/Core\";\r\nimport { PluginRegistry } from \"./core/PluginRegistry\";\r\nimport { StringPlugin } from \"./plugins/StringPlugin\";\r\nimport { NumberPlugin } from \"./plugins/NumberPlugin\";\r\nimport { BooleanPlugin } from \"./plugins/BooleanPlugin\";\r\nimport { DropdownPlugin } from \"./plugins/DropdownPlugin\";\r\nimport { DatePlugin } from \"./plugins/DatePlugin\";\r\n\r\n// Delegate to standard library registration\r\nCore.initLibrary({\r\n name: \"nz.co.siliconst.ui5.metaui\",\r\n version: \"1.0.0\",\r\n dependencies: [\r\n \"sap.ui.core\",\r\n \"sap.m\",\r\n \"sap.ui.layout\",\r\n \"sap.ui.table\"\r\n ],\r\n controls: [\r\n \"nz.co.siliconst.ui5.metaui.controls.GeneratorHost\"\r\n ],\r\n elements: [],\r\n interfaces: []\r\n});\r\n\r\n/**\r\n * Global Bootstrapper: Maps all standard primitive types to their respective plugins.\r\n */\r\nconst registry = PluginRegistry.getInstance();\r\nregistry.register(\"string\", StringPlugin);\r\nregistry.register(\"number\", NumberPlugin);\r\nregistry.register(\"boolean\", BooleanPlugin);\r\nregistry.register(\"dropdown\", DropdownPlugin);\r\nregistry.register(\"date\", DatePlugin);\r\n\r\n// Exporting window object safely for UI5 compatibility if needed\r\nexport default (window as any)[\"nz\"][\"co\"][\"siliconst\"][\"ui5\"][\"metaui\"];\r\n"],"mappings":"oOAOSA,EAAcC,EAAA,wBACdC,EAAYC,EAAA,sBACZC,EAAYC,EAAA,sBACZC,EAAaC,EAAA,uBACbC,EAAcC,EAAA,wBACdC,EAAUC,EAAA,cAGnBC,EAAKC,YAAY,CACbC,KAAM,6BACNC,QAAS,QACTC,aAAc,CACV,cACA,QACA,gBACA,gBAEJC,SAAU,CACN,qDAEJC,SAAU,GACVC,WAAY,KAMhB,MAAMC,EAAWpB,EAAeqB,cAChCD,EAASE,SAAS,SAAUpB,GAC5BkB,EAASE,SAAS,SAAUlB,GAC5BgB,EAASE,SAAS,UAAWhB,GAC7Bc,EAASE,SAAS,WAAYd,GAC9BY,EAASE,SAAS,OAAQZ,GAE1B,IAAAa,EACgBC,OAAe,MAAM,MAAM,aAAa,OAAO,UAAS,OAAAD,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"library.js","names":["PluginRegistry","___core_PluginRegistry","StringPlugin","___plugins_StringPlugin","NumberPlugin","___plugins_NumberPlugin","BooleanPlugin","___plugins_BooleanPlugin","DropdownPlugin","___plugins_DropdownPlugin","DatePlugin","___plugins_DatePlugin","TimePlugin","___plugins_TimePlugin","DateTimePlugin","___plugins_DateTimePlugin","ArrayPlugin","___plugins_ArrayPlugin","TextAreaPlugin","___plugins_TextAreaPlugin","SwitchPlugin","___plugins_SwitchPlugin","Core","initLibrary","name","version","dependencies","controls","elements","interfaces","noLibraryCSS","registry","getInstance","register","__exports","window"],"sources":["library.ts"],"sourcesContent":["/**\n * @file library.ts\n * @description Standard SAP UI5 library registration file. Exposes the MetaUI namespace \n * and automatically bootstraps the internal PluginRegistry.\n */\n\nimport Core from \"sap/ui/core/Core\";\nimport { PluginRegistry } from \"./core/PluginRegistry\";\nimport { StringPlugin } from \"./plugins/StringPlugin\";\nimport { NumberPlugin } from \"./plugins/NumberPlugin\";\nimport { BooleanPlugin } from \"./plugins/BooleanPlugin\";\nimport { DropdownPlugin } from \"./plugins/DropdownPlugin\";\nimport { DatePlugin } from \"./plugins/DatePlugin\";\nimport { TimePlugin } from \"./plugins/TimePlugin\";\nimport { DateTimePlugin } from \"./plugins/DateTimePlugin\";\nimport { ArrayPlugin } from \"./plugins/ArrayPlugin\";\n\nimport { TextAreaPlugin } from \"./plugins/TextAreaPlugin\";\nimport { SwitchPlugin } from \"./plugins/SwitchPlugin\";\n\n// Delegate to standard library registration\nCore.initLibrary({\n name: \"nz.co.siliconst.ui5.metaui\",\n version: \"1.0.0\",\n dependencies: [\n \"sap.ui.core\",\n \"sap.m\",\n \"sap.ui.layout\",\n \"sap.ui.table\"\n ],\n controls: [\n \"nz.co.siliconst.ui5.metaui.controls.GeneratorHost\"\n ],\n elements: [],\n interfaces: [],\n noLibraryCSS: true\n});\n\n/**\n * Global Bootstrapper: Maps all standard primitive types to their respective plugins.\n */\nconst registry = PluginRegistry.getInstance();\nregistry.register(\"string\", StringPlugin);\nregistry.register(\"string\", TextAreaPlugin, \"textArea\");\nregistry.register(\"number\", NumberPlugin);\nregistry.register(\"boolean\", BooleanPlugin);\nregistry.register(\"boolean\", SwitchPlugin, \"switch\");\nregistry.register(\"dropdown\", DropdownPlugin);\nregistry.register(\"date\", DatePlugin);\nregistry.register(\"time\", TimePlugin);\nregistry.register(\"datetime\", DateTimePlugin);\nregistry.register(\"array\", ArrayPlugin);\n\n// Exporting window object safely for UI5 compatibility if needed\nexport default (window as any)[\"nz\"][\"co\"][\"siliconst\"][\"ui5\"][\"metaui\"];\n"],"mappings":"4WAOSA,EAAcC,EAAA,wBACdC,EAAYC,EAAA,sBACZC,EAAYC,EAAA,sBACZC,EAAaC,EAAA,uBACbC,EAAcC,EAAA,wBACdC,EAAUC,EAAA,oBACVC,EAAUC,EAAA,oBACVC,EAAcC,EAAA,wBACdC,EAAWC,EAAA,qBAEXC,EAAcC,EAAA,wBACdC,EAAYC,EAAA,gBAGrBC,EAAKC,YAAY,CACbC,KAAM,6BACNC,QAAS,QACTC,aAAc,CACV,cACA,QACA,gBACA,gBAEJC,SAAU,CACN,qDAEJC,SAAU,GACVC,WAAY,GACZC,aAAc,OAMlB,MAAMC,EAAW/B,EAAegC,cAChCD,EAASE,SAAS,SAAU/B,GAC5B6B,EAASE,SAAS,SAAUf,EAAgB,YAC5Ca,EAASE,SAAS,SAAU7B,GAC5B2B,EAASE,SAAS,UAAW3B,GAC7ByB,EAASE,SAAS,UAAWb,EAAc,UAC3CW,EAASE,SAAS,WAAYzB,GAC9BuB,EAASE,SAAS,OAAQvB,GAC1BqB,EAASE,SAAS,OAAQrB,GAC1BmB,EAASE,SAAS,WAAYnB,GAC9BiB,EAASE,SAAS,QAASjB,GAE3B,IAAAkB,EACgBC,OAAe,MAAM,MAAM,aAAa,OAAO,UAAS,OAAAD,CAAA","ignoreList":[]}
@@ -1,43 +1,55 @@
1
- /**
2
- * @file library.ts
3
- * @description Standard SAP UI5 library registration file. Exposes the MetaUI namespace
4
- * and automatically bootstraps the internal PluginRegistry.
5
- */
6
-
7
- import Core from "sap/ui/core/Core";
8
- import { PluginRegistry } from "./core/PluginRegistry";
9
- import { StringPlugin } from "./plugins/StringPlugin";
10
- import { NumberPlugin } from "./plugins/NumberPlugin";
11
- import { BooleanPlugin } from "./plugins/BooleanPlugin";
12
- import { DropdownPlugin } from "./plugins/DropdownPlugin";
13
- import { DatePlugin } from "./plugins/DatePlugin";
14
-
15
- // Delegate to standard library registration
16
- Core.initLibrary({
17
- name: "nz.co.siliconst.ui5.metaui",
18
- version: "1.0.0",
19
- dependencies: [
20
- "sap.ui.core",
21
- "sap.m",
22
- "sap.ui.layout",
23
- "sap.ui.table"
24
- ],
25
- controls: [
26
- "nz.co.siliconst.ui5.metaui.controls.GeneratorHost"
27
- ],
28
- elements: [],
29
- interfaces: []
30
- });
31
-
32
- /**
33
- * Global Bootstrapper: Maps all standard primitive types to their respective plugins.
34
- */
35
- const registry = PluginRegistry.getInstance();
36
- registry.register("string", StringPlugin);
37
- registry.register("number", NumberPlugin);
38
- registry.register("boolean", BooleanPlugin);
39
- registry.register("dropdown", DropdownPlugin);
40
- registry.register("date", DatePlugin);
41
-
42
- // Exporting window object safely for UI5 compatibility if needed
43
- export default (window as any)["nz"]["co"]["siliconst"]["ui5"]["metaui"];
1
+ /**
2
+ * @file library.ts
3
+ * @description Standard SAP UI5 library registration file. Exposes the MetaUI namespace
4
+ * and automatically bootstraps the internal PluginRegistry.
5
+ */
6
+
7
+ import Core from "sap/ui/core/Core";
8
+ import { PluginRegistry } from "./core/PluginRegistry";
9
+ import { StringPlugin } from "./plugins/StringPlugin";
10
+ import { NumberPlugin } from "./plugins/NumberPlugin";
11
+ import { BooleanPlugin } from "./plugins/BooleanPlugin";
12
+ import { DropdownPlugin } from "./plugins/DropdownPlugin";
13
+ import { DatePlugin } from "./plugins/DatePlugin";
14
+ import { TimePlugin } from "./plugins/TimePlugin";
15
+ import { DateTimePlugin } from "./plugins/DateTimePlugin";
16
+ import { ArrayPlugin } from "./plugins/ArrayPlugin";
17
+
18
+ import { TextAreaPlugin } from "./plugins/TextAreaPlugin";
19
+ import { SwitchPlugin } from "./plugins/SwitchPlugin";
20
+
21
+ // Delegate to standard library registration
22
+ Core.initLibrary({
23
+ name: "nz.co.siliconst.ui5.metaui",
24
+ version: "1.0.0",
25
+ dependencies: [
26
+ "sap.ui.core",
27
+ "sap.m",
28
+ "sap.ui.layout",
29
+ "sap.ui.table"
30
+ ],
31
+ controls: [
32
+ "nz.co.siliconst.ui5.metaui.controls.GeneratorHost"
33
+ ],
34
+ elements: [],
35
+ interfaces: [],
36
+ noLibraryCSS: true
37
+ });
38
+
39
+ /**
40
+ * Global Bootstrapper: Maps all standard primitive types to their respective plugins.
41
+ */
42
+ const registry = PluginRegistry.getInstance();
43
+ registry.register("string", StringPlugin);
44
+ registry.register("string", TextAreaPlugin, "textArea");
45
+ registry.register("number", NumberPlugin);
46
+ registry.register("boolean", BooleanPlugin);
47
+ registry.register("boolean", SwitchPlugin, "switch");
48
+ registry.register("dropdown", DropdownPlugin);
49
+ registry.register("date", DatePlugin);
50
+ registry.register("time", TimePlugin);
51
+ registry.register("datetime", DateTimePlugin);
52
+ registry.register("array", ArrayPlugin);
53
+
54
+ // Exporting window object safely for UI5 compatibility if needed
55
+ export default (window as any)["nz"]["co"]["siliconst"]["ui5"]["metaui"];
@@ -21,6 +21,7 @@
21
21
  },
22
22
  "library": {
23
23
  "i18n": false,
24
+ "css": false,
24
25
  "content": {
25
26
  "controls": [
26
27
  "nz.co.siliconst.ui5.metaui.controls.GeneratorHost"