@siliconst/metaui 1.4.13 → 1.4.17

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 (184) hide show
  1. package/package.json +1 -1
  2. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +50 -3
  3. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js.map +1 -1
  4. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts +1 -1
  5. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
  6. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
  7. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
  8. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +57 -4
  9. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +44 -2
  10. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js.map +1 -1
  11. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts +4 -0
  12. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts.map +1 -1
  13. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
  14. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
  15. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +51 -4
  16. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js +42 -5
  17. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js.map +1 -1
  18. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts +9 -2
  19. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts.map +1 -1
  20. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js +1 -1
  21. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js.map +1 -1
  22. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.ts +44 -5
  23. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js.map +1 -1
  24. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js.map +1 -1
  25. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts +2 -2
  26. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +1 -0
  27. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -1
  28. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -1
  29. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +1 -1
  30. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -1
  31. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts +1 -0
  32. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry-dbg.js +47 -0
  33. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry-dbg.js.map +1 -0
  34. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.d.ts +23 -0
  35. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.d.ts.map +1 -0
  36. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.js +2 -0
  37. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.js.map +1 -0
  38. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.ts +45 -0
  39. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +17 -0
  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 +10 -1
  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 +19 -1
  46. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
  47. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +7 -0
  48. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
  49. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +9 -0
  50. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin-dbg.js +2 -0
  51. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin-dbg.js.map +1 -0
  52. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.d.ts +23 -0
  53. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.d.ts.map +1 -0
  54. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.js +2 -0
  55. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.js.map +1 -0
  56. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.ts +23 -0
  57. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +6 -1
  58. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -1
  59. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -1
  60. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +1 -1
  61. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -1
  62. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +6 -1
  63. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +29 -20
  64. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  65. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +3 -20
  66. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
  67. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
  68. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
  69. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
  70. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +3 -3
  71. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js +1 -0
  72. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js.map +1 -1
  73. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.d.ts.map +1 -1
  74. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js +1 -1
  75. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js.map +1 -1
  76. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts +1 -0
  77. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js +1 -0
  78. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js.map +1 -1
  79. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.d.ts.map +1 -1
  80. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js +1 -1
  81. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js.map +1 -1
  82. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts +1 -0
  83. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js +1 -0
  84. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js.map +1 -1
  85. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.d.ts.map +1 -1
  86. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js +1 -1
  87. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js.map +1 -1
  88. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts +1 -0
  89. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js +1 -0
  90. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js.map +1 -1
  91. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.d.ts.map +1 -1
  92. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js +1 -1
  93. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js.map +1 -1
  94. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.ts +1 -0
  95. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js +1 -0
  96. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js.map +1 -1
  97. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.d.ts.map +1 -1
  98. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js +1 -1
  99. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js.map +1 -1
  100. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.ts +1 -0
  101. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin-dbg.js +1 -0
  102. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin-dbg.js.map +1 -1
  103. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.d.ts.map +1 -1
  104. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.js +1 -1
  105. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.js.map +1 -1
  106. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.ts +1 -0
  107. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js +30 -17
  108. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js.map +1 -1
  109. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts.map +1 -1
  110. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js +1 -1
  111. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js.map +1 -1
  112. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.ts +33 -15
  113. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js +1 -0
  114. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js.map +1 -1
  115. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.d.ts.map +1 -1
  116. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js +1 -1
  117. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js.map +1 -1
  118. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.ts +1 -0
  119. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js +35 -11
  120. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js.map +1 -1
  121. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.d.ts +4 -4
  122. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.d.ts.map +1 -1
  123. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js +1 -1
  124. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js.map +1 -1
  125. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.ts +38 -14
  126. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js +1 -0
  127. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js.map +1 -1
  128. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.d.ts.map +1 -1
  129. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js +1 -1
  130. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js.map +1 -1
  131. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.ts +1 -0
  132. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js +1 -0
  133. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js.map +1 -1
  134. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.d.ts.map +1 -1
  135. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js +1 -1
  136. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js.map +1 -1
  137. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.ts +1 -0
  138. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js +79 -0
  139. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js.map +1 -0
  140. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.d.ts +35 -0
  141. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.d.ts.map +1 -0
  142. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js +2 -0
  143. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js.map +1 -0
  144. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.ts +80 -0
  145. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js +1 -0
  146. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js.map +1 -1
  147. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.d.ts.map +1 -1
  148. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js +1 -1
  149. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js.map +1 -1
  150. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.ts +1 -0
  151. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js +1 -0
  152. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js.map +1 -1
  153. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.d.ts.map +1 -1
  154. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js +1 -1
  155. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js.map +1 -1
  156. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.ts +1 -0
  157. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder-dbg.js +226 -0
  158. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder-dbg.js.map +1 -0
  159. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.d.ts +63 -0
  160. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.d.ts.map +1 -0
  161. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.js +2 -0
  162. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.js.map +1 -0
  163. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.ts +233 -0
  164. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver-dbg.js +43 -0
  165. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver-dbg.js.map +1 -0
  166. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.d.ts +15 -0
  167. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.d.ts.map +1 -0
  168. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.js +2 -0
  169. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.js.map +1 -0
  170. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.ts +37 -0
  171. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper-dbg.js +37 -0
  172. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper-dbg.js.map +1 -0
  173. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.d.ts +18 -0
  174. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.d.ts.map +1 -0
  175. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.js +2 -0
  176. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.js.map +1 -0
  177. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.ts +28 -0
  178. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper-dbg.js +84 -0
  179. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper-dbg.js.map +1 -0
  180. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.d.ts +27 -0
  181. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.d.ts.map +1 -0
  182. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.js +2 -0
  183. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.js.map +1 -0
  184. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.ts +80 -0
@@ -1 +1 @@
1
- {"version":3,"file":"GeneratorHost-dbg.js","names":["Logger","____utils_Logger","SchemaNormalizer","____core_SchemaNormalizer","SchemaValidator","____core_SchemaValidator","Engine","____core_Engine","StateManager","____core_StateManager","DataSyncDelegate","___delegates_DataSyncDelegate","ValidationDelegate","___delegates_ValidationDelegate","DialogDelegate","___delegates_DialogDelegate","PluginRegistry","____core_PluginRegistry","GeneratorHost","Control","extend","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","stateManager","generatedContent","engine","activeModelName","parsedSchema","_generatePromise","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","_setProperty","propertyName","suppressInvalidate","Control.prototype.setProperty.call","setUseMessageManager","getStateManager","_getStateManager","tearDownGeneratedLayout","_tearDownGeneratedLayout","unregisterObject","destroy","_onInternalFieldChange","fieldKey","errorMessage","controlId","extractPayload","getProperty","debug","pushToBindings","currentValidity","fireEvent","undefined","exit","_exit","getModel","getParsedSchema","_getParsedSchema","onBeforeRendering","_onBeforeRendering","hasSchema","hasData","generate","msg","Error","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","applyVisualFallback","errors","validateAll","length","pushMessage","err","JSON","stringify","propertyPath","plugin","getPluginByPath","setVisualValidationState","addCustomError","_addCustomError","clearCustomError","_clearCustomError","schemaValid","validate","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty2","handleInputDataHotSwap","currentVal","setBaseProperty","_setBaseProperty","_generate","Promise","resolve","then","_doGenerate","e","internalPayload","rawSchema","isSchemaEmpty","Object","keys","inputData","inputDataJson","parse","finalData","schemaToNormalize","normalizedSchema","normalize","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","pathsToLoad","getInstance","getPathsToLoad","needsNetworkLoad","Array","from","some","path","sap","ui","require","preloadDependencies","getId","setModel","isEditable","build","contentContainer","hasProperties","strip","MessageStrip","text","showIcon","showCloseButton","addStyleClass","VBox","items","hasPartialRenderingErrors","setAggregation","registerObject","mountCrashBoundary","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","isGenerated"],"sources":["GeneratorHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport { Logger } from \"../../utils/Logger\";\nimport { SchemaNormalizer } from \"../../core/SchemaNormalizer\";\nimport { SchemaValidator } from \"../../core/SchemaValidator\";\nimport { Engine } from \"../../core/Engine\";\nimport { StateManager } from \"../../core/StateManager\";\nimport { DataSyncDelegate } from \"./delegates/DataSyncDelegate\";\nimport { ValidationDelegate } from \"./delegates/ValidationDelegate\";\nimport { DialogDelegate } from \"./delegates/DialogDelegate\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport MessageStrip from \"sap/m/MessageStrip\";\nimport VBox from \"sap/m/VBox\";\nimport { PluginRegistry } from \"../../core/PluginRegistry\";\nimport type { ISchema } from \"../../interfaces/ISchema\";\n\n/**\n * Base wrapper element for embedding the dynamic form natively via Explicit Schemas.\n * \n * This class serves as the core rendering engine for standard MetaUI implementations.\n * It manages the lifecycle of the Engine, StateManager, and the delegation of \n * data synchronization, validation, and dialog interactions.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls.host\n */\nexport default class GeneratorHost extends Control {\n\n protected stateManager: StateManager | null = null;\n protected generatedContent: Control | null = null;\n protected engine: Engine | null = null;\n protected activeModelName: string = \"\";\n\n protected dataSyncDelegate!: DataSyncDelegate;\n protected validationDelegate!: ValidationDelegate;\n protected dialogDelegate!: DialogDelegate;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } },\n error: { parameters: { message: { type: \"string\" }, exception: { type: \"object\" } } }\n }\n };\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 * Standard UI5 Constructor.\n */\n constructor(idOrSettings?: string | object, settings?: object) {\n super(idOrSettings, settings);\n }\n\n /**\n * Initializes the control and instantiates the composition delegates.\n * Delegates must be initialized here rather than in the constructor so they are \n * available before `applySettings` runs during UI5's control lifecycle.\n */\n public init(): void {\n super.init();\n\n // Initialize Composition Delegates\n this.dataSyncDelegate = new DataSyncDelegate(this);\n this.validationDelegate = new ValidationDelegate(this);\n this.dialogDelegate = new DialogDelegate(this);\n\n this.onInternalFieldChange = this.onInternalFieldChange.bind(this);\n }\n\n /**\n * Enables or disables debug mode.\n */\n public setDebugMode(enabled: boolean): this {\n this.setProperty(\"debugMode\", enabled, true);\n Logger.setDebugMode(enabled);\n return this;\n }\n\n /**\n * Intercepts property updates to dynamically forward them to active delegates/managers.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n super.setProperty(propertyName, value, suppressInvalidate);\n if (propertyName === \"useMessageManager\" && this.stateManager) {\n this.stateManager.setUseMessageManager(value === true);\n }\n return this;\n }\n\n /**\n * Returns the active state manager instance managing the JSON payload.\n */\n public getStateManager(): StateManager | null {\n return this.stateManager;\n }\n\n /**\n * Safely destroys the currently generated UI tree and cleans up references.\n * This is called before every regeneration to prevent memory leaks.\n */\n public tearDownGeneratedLayout(): void {\n if (this.generatedContent) {\n this.validationDelegate.unregisterObject(this.generatedContent);\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /**\n * Internal event handler triggered by the Engine when a field value changes.\n * Coordinates LiveUpdate syncs, validation state tracking, and bubbling the change upwards.\n */\n protected onInternalFieldChange(isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string): void {\n const payload = this.stateManager ? this.stateManager.extractPayload() : {};\n\n if (this.getProperty(\"liveUpdate\") === true) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"liveUpdate is enabled, pushing outbound payload.\", \"GeneratorHost\");\n }\n this.dataSyncDelegate.pushToBindings(payload);\n }\n\n const currentValidity = this.getProperty(\"isValid\") as boolean;\n if (isValid !== currentValidity) {\n this.setProperty(\"isValid\", isValid, true);\n this.fireEvent(\"validationStateChanged\", { isValid });\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `Validation state shifted to: ${isValid}`, \"GeneratorHost\");\n }\n }\n\n this.fireEvent(\"fieldChange\", {\n fieldPath: fieldKey || \"\",\n value: undefined,\n payload: payload,\n isValid: isValid\n });\n }\n\n /**\n * Standard UI5 Exit Hook. Ensures complete teardown of the engine and state manager.\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 /** Cached schema for intelligent diffing during inference mode hot-swaps */\n protected parsedSchema: Record<string, unknown> | null = null;\n\n /**\n * Exposes the parsed schema to the DataSyncDelegate for diffing.\n */\n public getParsedSchema(): Record<string, unknown> | null {\n return this.parsedSchema;\n }\n\n /**\n * Standard UI5 Rendering Hook.\n * Evaluates whether it possesses a schema or data. If so, triggers the internal engine generation.\n */\n public onBeforeRendering(): void {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI GeneratorHost]\", `onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty(\"schemaDefinition\")}, data exists = ${!!this.getProperty(\"data\")}, dataJson exists = ${!!this.getProperty(\"dataJson\")}`, \"GeneratorHost\");\n }\n\n if (!this.generatedContent) {\n const hasSchema = !!this.getProperty(\"schemaDefinition\");\n const hasData = !!this.getProperty(\"dataJson\") || !!this.getProperty(\"data\");\n\n if (hasSchema || hasData) {\n this.generate();\n } else {\n const msg = \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg); // Eradicate silent errors\n }\n }\n }\n\n /**\n * Public API method to manually trigger form submission.\n * Executes all structural validations, clears old messages, and pushes payload to bindings.\n * @returns boolean True if submission succeeded, false if validation failed.\n */\n public triggerSubmit(): boolean {\n if (this.stateManager && this.engine) {\n let isPrevented = false;\n\n this.validationDelegate.removeAllMessages();\n\n // Only apply local fallback visual states if the global MessageManager is explicitly disabled\n const applyVisualFallback = this.getProperty(\"useMessageManager\") !== true;\n const errors = this.engine.validateAll(applyVisualFallback);\n if (errors.length > 0) {\n this.validationDelegate.pushMessage(\"\", \"One or more fields failed schema validation. Please review the highlighted fields.\");\n for (const err of errors) {\n if (err.fieldKey && err.errorMessage) {\n this.validationDelegate.pushMessage(err.fieldKey, err.errorMessage);\n }\n }\n return false;\n }\n\n const payload = this.stateManager.extractPayload();\n const payloadJson = JSON.stringify(payload);\n\n this.fireEvent(\"beforeSubmit\", {\n payload,\n preventDefault: () => { isPrevented = true; },\n addError: (propertyPath: string, errorMessage: string) => {\n isPrevented = true;\n this.validationDelegate.pushMessage(propertyPath, errorMessage);\n if (applyVisualFallback && this.engine) {\n const plugin = this.engine.getPluginByPath(propertyPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, errorMessage);\n }\n }\n }\n });\n\n if (isPrevented) {\n return false;\n }\n\n this.dataSyncDelegate.pushToBindings(payload);\n this.fireEvent(\"submit\", { payload, payloadJson });\n return true;\n }\n return false;\n }\n\n /**\n * Injects a custom error message onto a specific field.\n */\n public addCustomError(fieldPath: string, message: string): void {\n this.validationDelegate.addCustomError(fieldPath, message);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, message);\n }\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n */\n public clearCustomError(fieldPath: string): void {\n this.validationDelegate.clearCustomError(fieldPath);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n const schemaValid = plugin.validate();\n plugin.setVisualValidationState(schemaValid.isValid, schemaValid.errorMessage);\n }\n }\n }\n\n /**\n * Toggles busy state on the host control.\n */\n public setBusy(isBusy: boolean): this {\n super.setBusy(isBusy);\n return this;\n }\n\n /**\n * Intercepts property changes. Hot-swaps data gracefully if it's an inputData change,\n * or forces a full UI teardown if it's a structural property change (like schemaDefinition).\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"dataJson\" || propertyName === \"data\") {\n this.dataSyncDelegate.handleInputDataHotSwap(propertyName, value, suppressInvalidate);\n return this;\n }\n\n if (propertyName === \"editable\" || propertyName === \"debugMode\" || propertyName === \"schemaDefinition\") {\n const currentVal = this.getProperty(propertyName);\n if (currentVal !== value) {\n super.setProperty(propertyName, value, suppressInvalidate);\n this.tearDownGeneratedLayout();\n }\n return this;\n }\n\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Bypasses the interceptor to write directly to the base UI5 control.\n */\n public setBaseProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Internal reference to the active generate promise.\n * Prevents concurrent redundant layouts from being generated when properties are set rapidly or DialogDelegate triggers it.\n */\n private _generatePromise: Promise<void> | null = null;\n\n /**\n * The core rendering pipeline entry point.\n * Uses Promise resolution to debounce concurrent or rapid consecutive calls natively without arbitrary timeouts.\n * @returns Promise that resolves when the layout is successfully built and mounted.\n */\n public async generate(): Promise<void> {\n if (this._generatePromise) {\n return this._generatePromise;\n }\n this._generatePromise = Promise.resolve().then(async () => {\n try {\n await this._doGenerate();\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Error in deferred generate: \" + e, \"GeneratorHost\");\n throw e; // Ensure it bubbles up to awaiters\n } finally {\n this._generatePromise = null;\n }\n });\n return this._generatePromise;\n }\n\n /**\n * The underlying synchronous generator orchestration method.\n * Normalizes the schema, sets up the state manager, loads missing plugins over the network,\n * orchestrates the Engine build, and mounts the generated UI components into the internal tree.\n */\n private async _doGenerate(): Promise<void> {\n try {\n this.tearDownGeneratedLayout();\n\n // CRITICAL FIX: Extract the unsaved internal payload BEFORE destroying the state manager\n // Otherwise, toggling editable (or other structural properties) will wipe user inputs!\n let internalPayload = null;\n if (this.stateManager) {\n internalPayload = this.stateManager.extractPayload();\n }\n\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n const rawSchema = this.getProperty(\"schemaDefinition\");\n const isSchemaEmpty = !rawSchema || (typeof rawSchema === \"object\" && Object.keys(rawSchema).length === 0);\n\n let inputData = this.getProperty(\"data\");\n const inputDataJson = this.getProperty(\"dataJson\");\n\n if (inputDataJson) {\n try {\n inputData = JSON.parse(inputDataJson as string);\n } catch (e) {\n const msg = \"Failed to parse inputDataJson string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: e });\n throw new Error(msg); // Critical error instead of silent fallback\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n const msg = \"Failed to parse inputData string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: e });\n throw new Error(msg); // Critical error instead of silent fallback\n }\n }\n\n // The internal payload represents the user's latest un-extracted edits. It must take priority.\n const finalData = internalPayload || inputData;\n\n if (!finalData || Object.keys(finalData).length === 0) {\n if (isSchemaEmpty) {\n const msg = \"No payload provided and no explicit schema defined. Cannot infer UI.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg);\n }\n }\n\n const schemaToNormalize = isSchemaEmpty ? null : rawSchema;\n const normalizedSchema = SchemaNormalizer.normalize(schemaToNormalize, finalData);\n\n // Cache the parsed/inferred schema so DataSyncDelegate can diff against it later\n this.parsedSchema = normalizedSchema as Record<string, unknown>;\n\n if (normalizedSchema) {\n const schemaErrors = SchemaValidator.validateSchemaStructure(normalizedSchema);\n if (schemaErrors.length > 0) {\n const errorMsg = \"Schema Structural Errors Found:\\n- \" + schemaErrors.join(\"\\n- \");\n // Let's log it out loudly regardless of debug mode, so developers can see why it didn't render\n Logger.error(\"[MetaUI]\", errorMsg, \"GeneratorHost\");\n if (this.getProperty(\"debugMode\")) {\n MessageBox.error(errorMsg, { title: \"MetaUI Schema Error\" });\n return;\n }\n }\n }\n\n const pathsToLoad = PluginRegistry.getInstance().getPathsToLoad(normalizedSchema as ISchema);\n const needsNetworkLoad = Array.from(pathsToLoad).some(path => !sap.ui.require(path));\n\n if (needsNetworkLoad) {\n this.setBusy(true);\n await PluginRegistry.getInstance().preloadDependencies(normalizedSchema as ISchema);\n this.setBusy(false);\n }\n\n this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.stateManager.setUseMessageManager(this.getProperty(\"useMessageManager\") === true);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n if (!this.engine) {\n const isEditable = this.getProperty(\"editable\") !== false;\n const useMessageManager = this.getProperty(\"useMessageManager\") === true;\n this.engine = new Engine(isEditable, useMessageManager);\n }\n\n this.generatedContent = this.engine.build(\n normalizedSchema,\n this.stateManager.getModel(),\n this.activeModelName,\n this.triggerSubmit.bind(this),\n this.getId(),\n this.onInternalFieldChange.bind(this)\n );\n\n let contentContainer = this.generatedContent;\n \n const hasProperties = normalizedSchema && Object.keys(normalizedSchema).length > 0;\n \n if (!hasProperties) {\n const strip = new MessageStrip({\n text: \"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: false\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n } else if (this.engine.hasPartialRenderingErrors) {\n const strip = new MessageStrip({\n text: \"Layout partially rendered. Some fields failed to generate due to configuration errors.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n }\n\n this.setAggregation(\"_content\", contentContainer);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n } catch (error) {\n this.setBusy(false);\n const msg = \"Fatal crash during layout generation: \" + (error as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: error });\n this.validationDelegate.mountCrashBoundary(error as Error);\n throw error; // Completely eliminate silent error swallowing\n }\n }\n\n /**\n * Programmatic API. Re-parents the generated content into a dialog and opens it.\n */\n public openInDialog(title: string = \"Form\", submitButtonText: string = \"OK\", cancelButtonText: string = \"Cancel\", dialogWidth: string = \"800px\", parentView?: Control): void {\n const isGenerated = !!this.generatedContent;\n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated, cancelButtonText, dialogWidth, parentView);\n }\n}\n"],"mappings":";;;QAESA,MAAM,GAAAC,gBAAA;EAAA,MACNC,gBAAgB,GAAAC,yBAAA;EAAA,MAChBC,eAAe,GAAAC,wBAAA;EAAA,MACfC,MAAM,GAAAC,eAAA;EAAA,MACNC,YAAY,GAAAC,qBAAA;EAAA,MACZC,gBAAgB,GAAAC,6BAAA;EAAA,MAChBC,kBAAkB,GAAAC,+BAAA;EAAA,MAClBC,cAAc,GAAAC,2BAAA;EAAA,MAIdC,cAAc,GAAAC,uBAAA;EAGvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EARA,MASqBC,aAAa,GAASC,OAAO,CAAAC,MAAA;IAwDvCC,QAAQ,EAAG;MACdC,UAAU,EAAE,CAAC;MACbC,MAAMA,CAACC,EAAiB,EAAEC,OAAsB,EAAE;QAC9CD,EAAE,CAACE,SAAS,CAAC,KAAK,EAAED,OAAO,CAAC;QAC5BD,EAAE,CAACG,KAAK,CAAC,OAAO,EAAE,MAAM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AI,CAAC9I,gBAAgB;MAC3C,IAAI,CAACU,cAAc,CAAC8H,YAAY,CAAC/B,KAAK,EAAEiC,gBAAgB,EAAEI,WAAW,EAAEH,gBAAgB,EAAEC,WAAW,EAAEC,UAAU,CAAC;IACrH;EAAC;EAAA,OA9gBgBtM,aAAa;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"GeneratorHost-dbg.js","names":["Logger","____utils_Logger","SchemaNormalizer","____core_SchemaNormalizer","SchemaValidator","____core_SchemaValidator","Engine","____core_Engine","StateManager","____core_StateManager","DataSyncDelegate","___delegates_DataSyncDelegate","ValidationDelegate","___delegates_ValidationDelegate","DialogDelegate","___delegates_DialogDelegate","PluginRegistry","____core_PluginRegistry","GeneratorHost","Control","extend","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","stateManager","generatedContent","engine","activeModelName","parsedSchema","_generatePromise","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","_setProperty","propertyName","suppressInvalidate","Control.prototype.setProperty.call","setUseMessageManager","getStateManager","_getStateManager","tearDownGeneratedLayout","_tearDownGeneratedLayout","unregisterObject","destroy","_onInternalFieldChange","fieldKey","errorMessage","controlId","extractPayload","getProperty","debug","pushToBindings","currentValidity","fireEvent","undefined","exit","_exit","getModel","getParsedSchema","_getParsedSchema","onBeforeRendering","_onBeforeRendering","hasSchema","hasData","generate","msg","Error","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","applyVisualFallback","errors","validateAll","length","pushMessage","err","JSON","stringify","propertyPath","plugin","getPluginByPath","setVisualValidationState","addCustomError","_addCustomError","clearCustomError","_clearCustomError","schemaValid","validate","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty2","handleInputDataHotSwap","currentVal","setBaseProperty","_setBaseProperty","_generate","Promise","resolve","then","_doGenerate","e","internalPayload","rawSchema","isSchemaEmpty","Object","keys","inputData","inputDataJson","parse","finalData","schemaToNormalize","normalizedSchema","normalize","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","pathsToLoad","getInstance","getPathsToLoad","needsNetworkLoad","Array","from","some","path","sap","ui","require","preloadDependencies","getId","setModel","isEditable","build","contentContainer","hasProperties","strip","MessageStrip","text","showIcon","showCloseButton","addStyleClass","VBox","items","hasPartialRenderingErrors","setAggregation","registerObject","optimalWidth","calculateOptimalDialogWidth","updateDialogWidthDynamically","mountCrashBoundary","_calculateOptimalDialogWidth","schema","requiresWideDialog","scanProperties","props","key","prop","fullWidth","widget","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","isGenerated","finalWidth"],"sources":["GeneratorHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport { Logger } from \"../../utils/Logger\";\nimport { SchemaNormalizer } from \"../../core/SchemaNormalizer\";\nimport { SchemaValidator } from \"../../core/SchemaValidator\";\nimport { Engine } from \"../../core/Engine\";\nimport { StateManager } from \"../../core/StateManager\";\nimport { DataSyncDelegate } from \"./delegates/DataSyncDelegate\";\nimport { ValidationDelegate } from \"./delegates/ValidationDelegate\";\nimport { DialogDelegate } from \"./delegates/DialogDelegate\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport MessageStrip from \"sap/m/MessageStrip\";\nimport VBox from \"sap/m/VBox\";\nimport { PluginRegistry } from \"../../core/PluginRegistry\";\nimport type { ISchema } from \"../../interfaces/ISchema\";\n\n/**\n * Base wrapper element for embedding the dynamic form natively via Explicit Schemas.\n * \n * This class serves as the core rendering engine for standard MetaUI implementations.\n * It manages the lifecycle of the Engine, StateManager, and the delegation of \n * data synchronization, validation, and dialog interactions.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls.host\n */\nexport default class GeneratorHost extends Control {\n\n protected stateManager: StateManager | null = null;\n protected generatedContent: Control | null = null;\n protected engine: Engine | null = null;\n protected activeModelName: string = \"\";\n\n protected dataSyncDelegate!: DataSyncDelegate;\n protected validationDelegate!: ValidationDelegate;\n protected dialogDelegate!: DialogDelegate;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } },\n error: { parameters: { message: { type: \"string\" }, exception: { type: \"object\" } } }\n }\n };\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 * Standard UI5 Constructor.\n */\n constructor(idOrSettings?: string | object, settings?: object) {\n super(idOrSettings, settings);\n }\n\n /**\n * Initializes the control and instantiates the composition delegates.\n * Delegates must be initialized here rather than in the constructor so they are \n * available before `applySettings` runs during UI5's control lifecycle.\n */\n public init(): void {\n super.init();\n\n // Initialize Composition Delegates\n this.dataSyncDelegate = new DataSyncDelegate(this);\n this.validationDelegate = new ValidationDelegate(this);\n this.dialogDelegate = new DialogDelegate(this);\n\n this.onInternalFieldChange = this.onInternalFieldChange.bind(this);\n }\n\n /**\n * Enables or disables debug mode.\n */\n public setDebugMode(enabled: boolean): this {\n this.setProperty(\"debugMode\", enabled, true);\n Logger.setDebugMode(enabled);\n return this;\n }\n\n /**\n * Intercepts property updates to dynamically forward them to active delegates/managers.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n super.setProperty(propertyName, value, suppressInvalidate);\n if (propertyName === \"useMessageManager\" && this.stateManager) {\n this.stateManager.setUseMessageManager(value === true);\n }\n return this;\n }\n\n /**\n * Returns the active state manager instance managing the JSON payload.\n */\n public getStateManager(): StateManager | null {\n return this.stateManager;\n }\n\n /**\n * Safely destroys the currently generated UI tree and cleans up references.\n * This is called before every regeneration to prevent memory leaks.\n */\n public tearDownGeneratedLayout(): void {\n if (this.generatedContent) {\n this.validationDelegate.unregisterObject(this.generatedContent);\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /**\n * Internal event handler triggered by the Engine when a field value changes.\n * Coordinates LiveUpdate syncs, validation state tracking, and bubbling the change upwards.\n */\n protected onInternalFieldChange(isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string): void {\n const payload = this.stateManager ? this.stateManager.extractPayload() : {};\n\n if (this.getProperty(\"liveUpdate\") === true) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"liveUpdate is enabled, pushing outbound payload.\", \"GeneratorHost\");\n }\n this.dataSyncDelegate.pushToBindings(payload);\n }\n\n const currentValidity = this.getProperty(\"isValid\") as boolean;\n if (isValid !== currentValidity) {\n this.setProperty(\"isValid\", isValid, true);\n this.fireEvent(\"validationStateChanged\", { isValid });\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `Validation state shifted to: ${isValid}`, \"GeneratorHost\");\n }\n }\n\n this.fireEvent(\"fieldChange\", {\n fieldPath: fieldKey || \"\",\n value: undefined,\n payload: payload,\n isValid: isValid\n });\n }\n\n /**\n * Standard UI5 Exit Hook. Ensures complete teardown of the engine and state manager.\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 /** Cached schema for intelligent diffing during inference mode hot-swaps */\n protected parsedSchema: Record<string, unknown> | null = null;\n\n /**\n * Exposes the parsed schema to the DataSyncDelegate for diffing.\n */\n public getParsedSchema(): Record<string, unknown> | null {\n return this.parsedSchema;\n }\n\n /**\n * Standard UI5 Rendering Hook.\n * Evaluates whether it possesses a schema or data. If so, triggers the internal engine generation.\n */\n public onBeforeRendering(): void {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI GeneratorHost]\", `onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty(\"schemaDefinition\")}, data exists = ${!!this.getProperty(\"data\")}, dataJson exists = ${!!this.getProperty(\"dataJson\")}`, \"GeneratorHost\");\n }\n\n if (!this.generatedContent) {\n const hasSchema = !!this.getProperty(\"schemaDefinition\");\n const hasData = !!this.getProperty(\"dataJson\") || !!this.getProperty(\"data\");\n\n if (hasSchema || hasData) {\n this.generate();\n } else {\n const msg = \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg); // Eradicate silent errors\n }\n }\n }\n\n /**\n * Public API method to manually trigger form submission.\n * Executes all structural validations, clears old messages, and pushes payload to bindings.\n * @returns boolean True if submission succeeded, false if validation failed.\n */\n public triggerSubmit(): boolean {\n if (this.stateManager && this.engine) {\n let isPrevented = false;\n\n this.validationDelegate.removeAllMessages();\n\n // Only apply local fallback visual states if the global MessageManager is explicitly disabled\n const applyVisualFallback = this.getProperty(\"useMessageManager\") !== true;\n const errors = this.engine.validateAll(applyVisualFallback);\n if (errors.length > 0) {\n this.validationDelegate.pushMessage(\"\", \"One or more fields failed schema validation. Please review the highlighted fields.\");\n for (const err of errors) {\n if (err.fieldKey && err.errorMessage) {\n this.validationDelegate.pushMessage(err.fieldKey, err.errorMessage);\n }\n }\n return false;\n }\n\n const payload = this.stateManager.extractPayload();\n const payloadJson = JSON.stringify(payload);\n\n this.fireEvent(\"beforeSubmit\", {\n payload,\n preventDefault: () => { isPrevented = true; },\n addError: (propertyPath: string, errorMessage: string) => {\n isPrevented = true;\n this.validationDelegate.pushMessage(propertyPath, errorMessage);\n if (applyVisualFallback && this.engine) {\n const plugin = this.engine.getPluginByPath(propertyPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, errorMessage);\n }\n }\n }\n });\n\n if (isPrevented) {\n return false;\n }\n\n this.dataSyncDelegate.pushToBindings(payload);\n this.fireEvent(\"submit\", { payload, payloadJson });\n return true;\n }\n return false;\n }\n\n /**\n * Injects a custom error message onto a specific field.\n */\n public addCustomError(fieldPath: string, message: string): void {\n this.validationDelegate.addCustomError(fieldPath, message);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, message);\n }\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n */\n public clearCustomError(fieldPath: string): void {\n this.validationDelegate.clearCustomError(fieldPath);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n const schemaValid = plugin.validate();\n plugin.setVisualValidationState(schemaValid.isValid, schemaValid.errorMessage);\n }\n }\n }\n\n /**\n * Toggles busy state on the host control.\n */\n public setBusy(isBusy: boolean): this {\n super.setBusy(isBusy);\n return this;\n }\n\n /**\n * Intercepts property changes. Hot-swaps data gracefully if it's an inputData change,\n * or forces a full UI teardown if it's a structural property change (like schemaDefinition).\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"dataJson\" || propertyName === \"data\") {\n this.dataSyncDelegate.handleInputDataHotSwap(propertyName, value, suppressInvalidate);\n return this;\n }\n\n if (propertyName === \"editable\" || propertyName === \"debugMode\" || propertyName === \"schemaDefinition\") {\n const currentVal = this.getProperty(propertyName);\n if (currentVal !== value) {\n super.setProperty(propertyName, value, suppressInvalidate);\n this.tearDownGeneratedLayout();\n }\n return this;\n }\n\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Bypasses the interceptor to write directly to the base UI5 control.\n */\n public setBaseProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Internal reference to the active generate promise.\n * Prevents concurrent redundant layouts from being generated when properties are set rapidly or DialogDelegate triggers it.\n */\n private _generatePromise: Promise<void> | null = null;\n\n /**\n * The core rendering pipeline entry point.\n * Uses Promise resolution to debounce concurrent or rapid consecutive calls natively without arbitrary timeouts.\n * @returns Promise that resolves when the layout is successfully built and mounted.\n */\n public async generate(): Promise<void> {\n if (this._generatePromise) {\n return this._generatePromise;\n }\n this._generatePromise = Promise.resolve().then(async () => {\n try {\n await this._doGenerate();\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Error in deferred generate: \" + e, \"GeneratorHost\");\n throw e; // Ensure it bubbles up to awaiters\n } finally {\n this._generatePromise = null;\n }\n });\n return this._generatePromise;\n }\n\n /**\n * The underlying synchronous generator orchestration method.\n * Normalizes the schema, sets up the state manager, loads missing plugins over the network,\n * orchestrates the Engine build, and mounts the generated UI components into the internal tree.\n */\n private async _doGenerate(): Promise<void> {\n try {\n this.tearDownGeneratedLayout();\n\n // CRITICAL FIX: Extract the unsaved internal payload BEFORE destroying the state manager\n // Otherwise, toggling editable (or other structural properties) will wipe user inputs!\n let internalPayload = null;\n if (this.stateManager) {\n internalPayload = this.stateManager.extractPayload();\n }\n\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n const rawSchema = this.getProperty(\"schemaDefinition\");\n const isSchemaEmpty = !rawSchema || (typeof rawSchema === \"object\" && Object.keys(rawSchema).length === 0);\n\n let inputData = this.getProperty(\"data\");\n const inputDataJson = this.getProperty(\"dataJson\");\n\n if (inputDataJson) {\n try {\n inputData = JSON.parse(inputDataJson as string);\n } catch (e) {\n const msg = \"Failed to parse inputDataJson string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: e });\n throw new Error(msg); // Critical error instead of silent fallback\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n const msg = \"Failed to parse inputData string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: e });\n throw new Error(msg); // Critical error instead of silent fallback\n }\n }\n\n // The internal payload represents the user's latest un-extracted edits. It must take priority.\n const finalData = internalPayload || inputData;\n\n if (!finalData || Object.keys(finalData).length === 0) {\n if (isSchemaEmpty) {\n const msg = \"No payload provided and no explicit schema defined. Cannot infer UI.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg);\n }\n }\n\n const schemaToNormalize = isSchemaEmpty ? null : rawSchema;\n const normalizedSchema = SchemaNormalizer.normalize(schemaToNormalize, finalData);\n\n // Cache the parsed/inferred schema so DataSyncDelegate can diff against it later\n this.parsedSchema = normalizedSchema as Record<string, unknown>;\n\n if (normalizedSchema) {\n const schemaErrors = SchemaValidator.validateSchemaStructure(normalizedSchema);\n if (schemaErrors.length > 0) {\n const errorMsg = \"Schema Structural Errors Found:\\n- \" + schemaErrors.join(\"\\n- \");\n // Let's log it out loudly regardless of debug mode, so developers can see why it didn't render\n Logger.error(\"[MetaUI]\", errorMsg, \"GeneratorHost\");\n if (this.getProperty(\"debugMode\")) {\n MessageBox.error(errorMsg, { title: \"MetaUI Schema Error\" });\n return;\n }\n }\n }\n\n const pathsToLoad = PluginRegistry.getInstance().getPathsToLoad(normalizedSchema as ISchema);\n const needsNetworkLoad = Array.from(pathsToLoad).some(path => !sap.ui.require(path));\n\n if (needsNetworkLoad) {\n this.setBusy(true);\n await PluginRegistry.getInstance().preloadDependencies(normalizedSchema as ISchema);\n this.setBusy(false);\n }\n\n this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.stateManager.setUseMessageManager(this.getProperty(\"useMessageManager\") === true);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n if (!this.engine) {\n const isEditable = this.getProperty(\"editable\") !== false;\n const useMessageManager = this.getProperty(\"useMessageManager\") === true;\n this.engine = new Engine(isEditable, useMessageManager);\n }\n\n this.generatedContent = this.engine.build(\n normalizedSchema,\n this.stateManager.getModel(),\n this.activeModelName,\n this.triggerSubmit.bind(this),\n this.getId(),\n this.onInternalFieldChange.bind(this)\n );\n\n let contentContainer = this.generatedContent;\n\n const hasProperties = normalizedSchema && Object.keys(normalizedSchema).length > 0;\n\n if (!hasProperties) {\n const strip = new MessageStrip({\n text: \"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: false\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n } else if (this.engine.hasPartialRenderingErrors) {\n const strip = new MessageStrip({\n text: \"Layout partially rendered. Some fields failed to generate due to configuration errors.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n }\n\n this.setAggregation(\"_content\", contentContainer);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n // Retroactively expand the dialog if the heuristic determines it needs more space\n const optimalWidth = this.calculateOptimalDialogWidth(this.parsedSchema);\n this.dialogDelegate.updateDialogWidthDynamically(optimalWidth);\n\n } catch (error) {\n this.setBusy(false);\n const msg = \"Fatal crash during layout generation: \" + (error as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: error });\n this.validationDelegate.mountCrashBoundary(error as Error);\n throw error; // Completely eliminate silent error swallowing\n }\n }\n\n /**\n * Helper to heuristically calculate optimal dialog width based on schema content.\n */\n private calculateOptimalDialogWidth(schema: Record<string, any> | null): string {\n if (!schema) return \"auto\";\n let requiresWideDialog = false;\n\n const scanProperties = (props: Record<string, any>) => {\n if (requiresWideDialog) return;\n for (const key in props) {\n const prop = props[key];\n if (prop.type === \"array\") {\n requiresWideDialog = true;\n return;\n }\n if (prop.ui?.fullWidth === true) {\n requiresWideDialog = true;\n return;\n }\n if (prop.ui?.widget === \"codeEditor\" || prop.ui?.widget === \"textArea\" || prop.ui?.widget === \"richText\") {\n requiresWideDialog = true;\n return;\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n }\n };\n\n if (schema.type === \"array\") return \"80vw\";\n if (schema.properties) {\n scanProperties(schema.properties);\n }\n\n return requiresWideDialog ? \"80vw\" : \"auto\";\n }\n\n /**\n * Programmatic API. Re-parents the generated content into a dialog and opens it.\n */\n public openInDialog(title: string = \"Form\", submitButtonText: string = \"OK\", cancelButtonText: string = \"Cancel\", dialogWidth: string = \"auto\", parentView?: Control): void {\n const isGenerated = !!this.generatedContent;\n \n // If we already have the schema parsed, we can calculate it instantly to prevent flicker\n let finalWidth = dialogWidth;\n if (finalWidth === \"auto\" && this.parsedSchema) {\n finalWidth = this.calculateOptimalDialogWidth(this.parsedSchema);\n }\n \n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated, cancelButtonText, finalWidth, parentView);\n }\n}\n"],"mappings":";;;QAESA,MAAM,GAAAC,gBAAA;EAAA,MACNC,gBAAgB,GAAAC,yBAAA;EAAA,MAChBC,eAAe,GAAAC,wBAAA;EAAA,MACfC,MAAM,GAAAC,eAAA;EAAA,MACNC,YAAY,GAAAC,qBAAA;EAAA,MACZC,gBAAgB,GAAAC,6BAAA;EAAA,MAChBC,kBAAkB,GAAAC,+BAAA;EAAA,MAClBC,cAAc,GAAAC,2BAAA;EAAA,MAIdC,cAAc,GAAAC,uBAAA;EAGvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EARA,MASqBC,aAAa,GAASC,OAAO,CAAAC,MAAA;IAwDvCC,QAAQ,EAAG;MACdC,UAAU,EAAE,CAAC;MACbC,MAAMA,CAACC,EAAiB,EAAEC,OAAsB,EAAE;QAC9CD,EAAE,CAACE,SAAS,CAAC,KAAK,EAAED,OAAO,CAAC;QAC5BD,EAAE,CAACG,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;QACzBH,EAAE,CAACG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1BH,EAAE,CAACI,OAAO,CAAC,CAAC;QAEZ,MAAMC,OAAO,GAAGJ,OAAO,CAACK,cAAc,CAAC,UAAU,CAAY;QAC7D,IAA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,EAAE;QAC5CwJ,UAAU,GAAG,IAAI,CAACnB,2BAA2B,CAAC,IAAI,CAACrI,YAAY,CAAC;MACpE;MAEA,IAAI,CAACO,cAAc,CAAC0I,YAAY,CAAC3C,KAAK,EAAE6C,gBAAgB,EAAEI,WAAW,EAAEH,gBAAgB,EAAEI,UAAU,EAAEF,UAAU,CAAC;IACpH;EAAC;EAAA,OA7jBgBlN,aAAa;AAAA","ignoreList":[]}
@@ -234,6 +234,10 @@ declare module "nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost" {
234
234
  * orchestrates the Engine build, and mounts the generated UI components into the internal tree.
235
235
  */
236
236
  private _doGenerate;
237
+ /**
238
+ * Helper to heuristically calculate optimal dialog width based on schema content.
239
+ */
240
+ private calculateOptimalDialogWidth;
237
241
  /**
238
242
  * Programmatic API. Re-parents the generated content into a dialog and opens it.
239
243
  */
@@ -1 +1 @@
1
- {"version":3,"file":"GeneratorHost.d.ts","sourceRoot":"../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,wDAAwD,CAAC;IACxE,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,aAAa,MAAM,2BAA2B,CAAC;IAItD,OAAO,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;IAChE,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;IAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;IACvG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uEAAuE,CAAC;IAC3G,OAAO,EAAE,cAAc,EAAE,MAAM,mEAAmE,CAAC;IAOnG;;;;;;;;OAQG;IACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;QAE9C,SAAS,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAQ;QACnD,SAAS,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAQ;QAClD,S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OAAO,CAAC,GAAG,IAAI;QAIxD;;;WAGG;QACI,iBAAiB,IAAI,IAAI;QAoBhC;;;;WAIG;QACI,aAAa,IAAI,OAAO;QAgD/B;;WAEG;QACI,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;QAU/D;;WAEG;QACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;QAWhD;;WAEG;QACI,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;QA2BrC;;WAEG;QACI,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG,IAAI;QAIhG;;;WAGG;QACH,OAAO,CAAC,gBAAgB,CAA8B;QAEtD;;;;WAIG;QACU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;QAiBtC;;;;WAIG;gBACW,WAAW;QA0JzB;;WAEG;QACH,OAAO,CAAC,2BAA2B;QAiCnC;;WAEG;QACI,YAAY,CAAC,KAAK,GAAE,MAAe,EAAE,gBAAgB,GAAE,MAAa,EAAE,gBAAgB,GAAE,MAAiB,EAAE,WAAW,GAAE,MAAe,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI;KAW9K;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["sap/ui/core/Control","../../utils/Logger","../../core/SchemaNormalizer","../../core/SchemaValidator","../../core/Engine","../../core/StateManager","./delegates/DataSyncDelegate","./delegates/ValidationDelegate","./delegates/DialogDelegate","sap/m/MessageBox","sap/m/MessageStrip","sap/m/VBox","../../core/PluginRegistry"],function(e,t,a,n,i,s,r,o,l,g,d,h,u){"use strict";const c=t["Logger"];const p=a["SchemaNormalizer"];const f=n["SchemaValidator"];const y=i["Engine"];const m=s["StateManager"];const M=r["DataSyncDelegate"];const b=o["ValidationDelegate"];const P=l["DialogDelegate"];const v=u["PluginRegistry"];const D=e.extend("nz.co.siliconst.ui5.metaui.controls.host.GeneratorHost",{renderer:{apiVersion:2,render(e,t){e.openStart("div",t);e.style("width","100%");e.style("height","100%");e.openEnd();const a=t.getAggregation("_content");if(a){e.renderControl(a)}e.close("div")}},metadata:{properties:{schemaDefinition:{type:"any",defaultValue:null},data:{type:"object",defaultValue:null,bindable:"bindable"},dataJson:{type:"string",defaultValue:null,bindable:"bindable"},liveUpdate:{type:"boolean",defaultValue:false},isValid:{type:"boolean",defaultValue:true},useMessageManager:{type:"boolean",defaultValue:false},modelName:{type:"string",defaultValue:"meta"},debugMode:{type:"boolean",defaultValue:false},editable:{type:"boolean",defaultValue:true}},aggregations:{_content:{type:"sap.ui.core.Control",multiple:false,visibility:"hidden"}},events:{beforeSubmit:{parameters:{payload:{type:"object"},addError:{type:"function"},preventDefault:{type:"function"}}},submit:{parameters:{payload:{type:"object"},payloadJson:{type:"string"}}},cancel:{},fieldChange:{parameters:{fieldPath:{type:"string"},value:{type:"any"},payload:{type:"object"},isValid:{type:"boolean"}}},validationStateChanged:{parameters:{isValid:{type:"boolean"}}},validationError:{parameters:{fieldPath:{type:"string"},message:{type:"string"}}},validationSuccess:{parameters:{fieldPath:{type:"string"}}},error:{parameters:{message:{type:"string"},exception:{type:"object"}}}}},constructor:function t(a,n){e.prototype.constructor.call(this,a,n);this.stateManager=null;this.generatedContent=null;this.engine=null;this.activeModelName="";this.parsedSchema=null;this._generatePromise=null},init:function t(){e.prototype.init.call(this);this.dataSyncDelegate=new M(this);this.validationDelegate=new b(this);this.dialogDelegate=new P(this);this.onInternalFieldChange=this.onInternalFieldChange.bind(this)},setDebugMode:function e(t){this.setProperty("debugMode",t,true);c.setDebugMode(t);return this},setProperty:function t(a,n,i){e.prototype.setProperty.call(this,a,n,i);if(a==="useMessageManager"&&this.stateManager){this.stateManager.setUseMessageManager(n===true)}return this},getStateManager:function e(){return this.stateManager},tearDownGeneratedLayout:function e(){if(this.generatedContent){this.validationDelegate.unregisterObject(this.generatedContent);this.generatedContent.destroy();this.generatedContent=null}},onInternalFieldChange:function e(t,a,n,i){const s=this.stateManager?this.stateManager.extractPayload():{};if(this.getProperty("liveUpdate")===true){if(this.getProperty("debugMode")){c.debug("[MetaUI]","liveUpdate is enabled, pushing outbound payload.","GeneratorHost")}this.dataSyncDelegate.pushToBindings(s)}const r=this.getProperty("isValid");if(t!==r){this.setProperty("isValid",t,true);this.fireEvent("validationStateChanged",{isValid:t});if(this.getProperty("debugMode")){c.debug("[MetaUI]",`Validation state shifted to: ${t}`,"GeneratorHost")}}this.fireEvent("fieldChange",{fieldPath:a||"",value:undefined,payload:s,isValid:t})},exit:function e(){if(this.engine){this.engine.destroy();this.engine=null}if(this.stateManager){this.stateManager.getModel().destroy();this.stateManager=null}if(this.generatedContent){this.generatedContent.destroy();this.generatedContent=null}},getParsedSchema:function e(){return this.parsedSchema},onBeforeRendering:function e(){if(this.getProperty("debugMode")){c.debug("[MetaUI GeneratorHost]",`onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty("schemaDefinition")}, data exists = ${!!this.getProperty("data")}, dataJson exists = ${!!this.getProperty("dataJson")}`,"GeneratorHost")}if(!this.generatedContent){const e=!!this.getProperty("schemaDefinition");const t=!!this.getProperty("dataJson")||!!this.getProperty("data");if(e||t){this.generate()}else{const e="GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.";c.error("[MetaUI]",e,"GeneratorHost");this.fireEvent("error",{message:e});throw new Error(e)}}},triggerSubmit:function e(){if(this.stateManager&&this.engine){let e=false;this.validationDelegate.removeAllMessages();const t=this.getProperty("useMessageManager")!==true;const a=this.engine.validateAll(t);if(a.length>0){this.validationDelegate.pushMessage("","One or more fields failed schema validation. Please review the highlighted fields.");for(const e of a){if(e.fieldKey&&e.errorMessage){this.validationDelegate.pushMessage(e.fieldKey,e.errorMessage)}}return false}const n=this.stateManager.extractPayload();const i=JSON.stringify(n);this.fireEvent("beforeSubmit",{payload:n,preventDefault:()=>{e=true},addError:(a,n)=>{e=true;this.validationDelegate.pushMessage(a,n);if(t&&this.engine){const e=this.engine.getPluginByPath(a);if(e&&typeof e.setVisualValidationState==="function"){e.setVisualValidationState(false,n)}}}});if(e){return false}this.dataSyncDelegate.pushToBindings(n);this.fireEvent("submit",{payload:n,payloadJson:i});return true}return false},addCustomError:function e(t,a){this.validationDelegate.addCustomError(t,a);if(this.getProperty("useMessageManager")!==true&&this.engine){const e=this.engine.getPluginByPath(t);if(e&&typeof e.setVisualValidationState==="function"){e.setVisualValidationState(false,a)}}},clearCustomError:function e(t){this.validationDelegate.clearCustomError(t);if(this.getProperty("useMessageManager")!==true&&this.engine){const e=this.engine.getPluginByPath(t);if(e&&typeof e.setVisualValidationState==="function"){const t=e.validate();e.setVisualValidationState(t.isValid,t.errorMessage)}}},setBusy:function t(a){e.prototype.setBusy.call(this,a);return this},setProperty:function t(a,n,i){if(a==="dataJson"||a==="data"){this.dataSyncDelegate.handleInputDataHotSwap(a,n,i);return this}if(a==="editable"||a==="debugMode"||a==="schemaDefinition"){const t=this.getProperty(a);if(t!==n){e.prototype.setProperty.call(this,a,n,i);this.tearDownGeneratedLayout()}return this}return e.prototype.setProperty.call(this,a,n,i)},setBaseProperty:function t(a,n,i){return e.prototype.setProperty.call(this,a,n,i)},generate:async function e(){if(this._generatePromise){return this._generatePromise}this._generatePromise=Promise.resolve().then(async()=>{try{await this._doGenerate()}catch(e){c.error("[MetaUI]","Error in deferred generate: "+e,"GeneratorHost");throw e}finally{this._generatePromise=null}});return this._generatePromise},_doGenerate:async function e(){try{this.tearDownGeneratedLayout();let e=null;if(this.stateManager){e=this.stateManager.extractPayload()}if(this.engine){this.engine.destroy();this.engine=null}if(this.stateManager){this.stateManager.getModel().destroy();this.stateManager=null}const t=this.getProperty("schemaDefinition");const a=!t||typeof t==="object"&&Object.keys(t).length===0;let n=this.getProperty("data");const i=this.getProperty("dataJson");if(i){try{n=JSON.parse(i)}catch(e){const t="Failed to parse inputDataJson string: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});throw new Error(t)}}else if(typeof n==="string"){try{n=JSON.parse(n)}catch(e){const t="Failed to parse inputData string: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});throw new Error(t)}}const s=e||n;if(!s||Object.keys(s).length===0){if(a){const e="No payload provided and no explicit schema defined. Cannot infer UI.";c.error("[MetaUI]",e,"GeneratorHost");this.fireEvent("error",{message:e});throw new Error(e)}}const r=a?null:t;const o=p.normalize(r,s);this.parsedSchema=o;if(o){const e=f.validateSchemaStructure(o);if(e.length>0){const t="Schema Structural Errors Found:\n- "+e.join("\n- ");c.error("[MetaUI]",t,"GeneratorHost");if(this.getProperty("debugMode")){g.error(t,{title:"MetaUI Schema Error"});return}}}const l=v.getInstance().getPathsToLoad(o);const u=Array.from(l).some(e=>!sap.ui.require(e));if(u){this.setBusy(true);await v.getInstance().preloadDependencies(o);this.setBusy(false)}this.activeModelName="metaUI_"+this.getId();this.stateManager=new m(s,o,this.activeModelName);this.stateManager.setUseMessageManager(this.getProperty("useMessageManager")===true);this.setModel(this.stateManager.getModel(),this.activeModelName);if(!this.engine){const e=this.getProperty("editable")!==false;const t=this.getProperty("useMessageManager")===true;this.engine=new y(e,t)}this.generatedContent=this.engine.build(o,this.stateManager.getModel(),this.activeModelName,this.triggerSubmit.bind(this),this.getId(),this.onInternalFieldChange.bind(this));let M=this.generatedContent;const b=o&&Object.keys(o).length>0;if(!b){const e=new d({text:"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.",type:"Warning",showIcon:true,showCloseButton:false});e.addStyleClass("sapUiSmallMarginBottom");M=new h({items:[e,this.generatedContent]})}else if(this.engine.hasPartialRenderingErrors){const e=new d({text:"Layout partially rendered. Some fields failed to generate due to configuration errors.",type:"Warning",showIcon:true,showCloseButton:true});e.addStyleClass("sapUiSmallMarginBottom");M=new h({items:[e,this.generatedContent]})}this.setAggregation("_content",M);this.validationDelegate.registerObject(this.generatedContent);const P=this.stateManager.extractPayload();this.dataSyncDelegate.pushToBindings(P)}catch(e){this.setBusy(false);const t="Fatal crash during layout generation: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});this.validationDelegate.mountCrashBoundary(e);throw e}},openInDialog:function e(t="Form",a="OK",n="Cancel",i="800px",s){const r=!!this.generatedContent;this.dialogDelegate.openInDialog(t,a,r,n,i,s)}});return D});
1
+ sap.ui.define(["sap/ui/core/Control","../../utils/Logger","../../core/SchemaNormalizer","../../core/SchemaValidator","../../core/Engine","../../core/StateManager","./delegates/DataSyncDelegate","./delegates/ValidationDelegate","./delegates/DialogDelegate","sap/m/MessageBox","sap/m/MessageStrip","sap/m/VBox","../../core/PluginRegistry"],function(e,t,a,i,n,s,r,o,l,g,d,h,u){"use strict";const c=t["Logger"];const p=a["SchemaNormalizer"];const f=i["SchemaValidator"];const y=n["Engine"];const m=s["StateManager"];const M=r["DataSyncDelegate"];const b=o["ValidationDelegate"];const P=l["DialogDelegate"];const D=u["PluginRegistry"];const v=e.extend("nz.co.siliconst.ui5.metaui.controls.host.GeneratorHost",{renderer:{apiVersion:2,render(e,t){e.openStart("div",t);e.style("width","100%");e.style("height","100%");e.openEnd();const a=t.getAggregation("_content");if(a){e.renderControl(a)}e.close("div")}},metadata:{properties:{schemaDefinition:{type:"any",defaultValue:null},data:{type:"object",defaultValue:null,bindable:"bindable"},dataJson:{type:"string",defaultValue:null,bindable:"bindable"},liveUpdate:{type:"boolean",defaultValue:false},isValid:{type:"boolean",defaultValue:true},useMessageManager:{type:"boolean",defaultValue:false},modelName:{type:"string",defaultValue:"meta"},debugMode:{type:"boolean",defaultValue:false},editable:{type:"boolean",defaultValue:true}},aggregations:{_content:{type:"sap.ui.core.Control",multiple:false,visibility:"hidden"}},events:{beforeSubmit:{parameters:{payload:{type:"object"},addError:{type:"function"},preventDefault:{type:"function"}}},submit:{parameters:{payload:{type:"object"},payloadJson:{type:"string"}}},cancel:{},fieldChange:{parameters:{fieldPath:{type:"string"},value:{type:"any"},payload:{type:"object"},isValid:{type:"boolean"}}},validationStateChanged:{parameters:{isValid:{type:"boolean"}}},validationError:{parameters:{fieldPath:{type:"string"},message:{type:"string"}}},validationSuccess:{parameters:{fieldPath:{type:"string"}}},error:{parameters:{message:{type:"string"},exception:{type:"object"}}}}},constructor:function t(a,i){e.prototype.constructor.call(this,a,i);this.stateManager=null;this.generatedContent=null;this.engine=null;this.activeModelName="";this.parsedSchema=null;this._generatePromise=null},init:function t(){e.prototype.init.call(this);this.dataSyncDelegate=new M(this);this.validationDelegate=new b(this);this.dialogDelegate=new P(this);this.onInternalFieldChange=this.onInternalFieldChange.bind(this)},setDebugMode:function e(t){this.setProperty("debugMode",t,true);c.setDebugMode(t);return this},setProperty:function t(a,i,n){e.prototype.setProperty.call(this,a,i,n);if(a==="useMessageManager"&&this.stateManager){this.stateManager.setUseMessageManager(i===true)}return this},getStateManager:function e(){return this.stateManager},tearDownGeneratedLayout:function e(){if(this.generatedContent){this.validationDelegate.unregisterObject(this.generatedContent);this.generatedContent.destroy();this.generatedContent=null}},onInternalFieldChange:function e(t,a,i,n){const s=this.stateManager?this.stateManager.extractPayload():{};if(this.getProperty("liveUpdate")===true){if(this.getProperty("debugMode")){c.debug("[MetaUI]","liveUpdate is enabled, pushing outbound payload.","GeneratorHost")}this.dataSyncDelegate.pushToBindings(s)}const r=this.getProperty("isValid");if(t!==r){this.setProperty("isValid",t,true);this.fireEvent("validationStateChanged",{isValid:t});if(this.getProperty("debugMode")){c.debug("[MetaUI]",`Validation state shifted to: ${t}`,"GeneratorHost")}}this.fireEvent("fieldChange",{fieldPath:a||"",value:undefined,payload:s,isValid:t})},exit:function e(){if(this.engine){this.engine.destroy();this.engine=null}if(this.stateManager){this.stateManager.getModel().destroy();this.stateManager=null}if(this.generatedContent){this.generatedContent.destroy();this.generatedContent=null}},getParsedSchema:function e(){return this.parsedSchema},onBeforeRendering:function e(){if(this.getProperty("debugMode")){c.debug("[MetaUI GeneratorHost]",`onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty("schemaDefinition")}, data exists = ${!!this.getProperty("data")}, dataJson exists = ${!!this.getProperty("dataJson")}`,"GeneratorHost")}if(!this.generatedContent){const e=!!this.getProperty("schemaDefinition");const t=!!this.getProperty("dataJson")||!!this.getProperty("data");if(e||t){this.generate()}else{const e="GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.";c.error("[MetaUI]",e,"GeneratorHost");this.fireEvent("error",{message:e});throw new Error(e)}}},triggerSubmit:function e(){if(this.stateManager&&this.engine){let e=false;this.validationDelegate.removeAllMessages();const t=this.getProperty("useMessageManager")!==true;const a=this.engine.validateAll(t);if(a.length>0){this.validationDelegate.pushMessage("","One or more fields failed schema validation. Please review the highlighted fields.");for(const e of a){if(e.fieldKey&&e.errorMessage){this.validationDelegate.pushMessage(e.fieldKey,e.errorMessage)}}return false}const i=this.stateManager.extractPayload();const n=JSON.stringify(i);this.fireEvent("beforeSubmit",{payload:i,preventDefault:()=>{e=true},addError:(a,i)=>{e=true;this.validationDelegate.pushMessage(a,i);if(t&&this.engine){const e=this.engine.getPluginByPath(a);if(e&&typeof e.setVisualValidationState==="function"){e.setVisualValidationState(false,i)}}}});if(e){return false}this.dataSyncDelegate.pushToBindings(i);this.fireEvent("submit",{payload:i,payloadJson:n});return true}return false},addCustomError:function e(t,a){this.validationDelegate.addCustomError(t,a);if(this.getProperty("useMessageManager")!==true&&this.engine){const e=this.engine.getPluginByPath(t);if(e&&typeof e.setVisualValidationState==="function"){e.setVisualValidationState(false,a)}}},clearCustomError:function e(t){this.validationDelegate.clearCustomError(t);if(this.getProperty("useMessageManager")!==true&&this.engine){const e=this.engine.getPluginByPath(t);if(e&&typeof e.setVisualValidationState==="function"){const t=e.validate();e.setVisualValidationState(t.isValid,t.errorMessage)}}},setBusy:function t(a){e.prototype.setBusy.call(this,a);return this},setProperty:function t(a,i,n){if(a==="dataJson"||a==="data"){this.dataSyncDelegate.handleInputDataHotSwap(a,i,n);return this}if(a==="editable"||a==="debugMode"||a==="schemaDefinition"){const t=this.getProperty(a);if(t!==i){e.prototype.setProperty.call(this,a,i,n);this.tearDownGeneratedLayout()}return this}return e.prototype.setProperty.call(this,a,i,n)},setBaseProperty:function t(a,i,n){return e.prototype.setProperty.call(this,a,i,n)},generate:async function e(){if(this._generatePromise){return this._generatePromise}this._generatePromise=Promise.resolve().then(async()=>{try{await this._doGenerate()}catch(e){c.error("[MetaUI]","Error in deferred generate: "+e,"GeneratorHost");throw e}finally{this._generatePromise=null}});return this._generatePromise},_doGenerate:async function e(){try{this.tearDownGeneratedLayout();let e=null;if(this.stateManager){e=this.stateManager.extractPayload()}if(this.engine){this.engine.destroy();this.engine=null}if(this.stateManager){this.stateManager.getModel().destroy();this.stateManager=null}const t=this.getProperty("schemaDefinition");const a=!t||typeof t==="object"&&Object.keys(t).length===0;let i=this.getProperty("data");const n=this.getProperty("dataJson");if(n){try{i=JSON.parse(n)}catch(e){const t="Failed to parse inputDataJson string: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});throw new Error(t)}}else if(typeof i==="string"){try{i=JSON.parse(i)}catch(e){const t="Failed to parse inputData string: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});throw new Error(t)}}const s=e||i;if(!s||Object.keys(s).length===0){if(a){const e="No payload provided and no explicit schema defined. Cannot infer UI.";c.error("[MetaUI]",e,"GeneratorHost");this.fireEvent("error",{message:e});throw new Error(e)}}const r=a?null:t;const o=p.normalize(r,s);this.parsedSchema=o;if(o){const e=f.validateSchemaStructure(o);if(e.length>0){const t="Schema Structural Errors Found:\n- "+e.join("\n- ");c.error("[MetaUI]",t,"GeneratorHost");if(this.getProperty("debugMode")){g.error(t,{title:"MetaUI Schema Error"});return}}}const l=D.getInstance().getPathsToLoad(o);const u=Array.from(l).some(e=>!sap.ui.require(e));if(u){this.setBusy(true);await D.getInstance().preloadDependencies(o);this.setBusy(false)}this.activeModelName="metaUI_"+this.getId();this.stateManager=new m(s,o,this.activeModelName);this.stateManager.setUseMessageManager(this.getProperty("useMessageManager")===true);this.setModel(this.stateManager.getModel(),this.activeModelName);if(!this.engine){const e=this.getProperty("editable")!==false;const t=this.getProperty("useMessageManager")===true;this.engine=new y(e,t)}this.generatedContent=this.engine.build(o,this.stateManager.getModel(),this.activeModelName,this.triggerSubmit.bind(this),this.getId(),this.onInternalFieldChange.bind(this));let M=this.generatedContent;const b=o&&Object.keys(o).length>0;if(!b){const e=new d({text:"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.",type:"Warning",showIcon:true,showCloseButton:false});e.addStyleClass("sapUiSmallMarginBottom");M=new h({items:[e,this.generatedContent]})}else if(this.engine.hasPartialRenderingErrors){const e=new d({text:"Layout partially rendered. Some fields failed to generate due to configuration errors.",type:"Warning",showIcon:true,showCloseButton:true});e.addStyleClass("sapUiSmallMarginBottom");M=new h({items:[e,this.generatedContent]})}this.setAggregation("_content",M);this.validationDelegate.registerObject(this.generatedContent);const P=this.stateManager.extractPayload();this.dataSyncDelegate.pushToBindings(P);const v=this.calculateOptimalDialogWidth(this.parsedSchema);this.dialogDelegate.updateDialogWidthDynamically(v)}catch(e){this.setBusy(false);const t="Fatal crash during layout generation: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});this.validationDelegate.mountCrashBoundary(e);throw e}},calculateOptimalDialogWidth:function e(t){if(!t)return"auto";let a=false;const i=e=>{if(a)return;for(const t in e){const n=e[t];if(n.type==="array"){a=true;return}if(n.ui?.fullWidth===true){a=true;return}if(n.ui?.widget==="codeEditor"||n.ui?.widget==="textArea"||n.ui?.widget==="richText"){a=true;return}if(n.properties)i(n.properties);if(n.items&&n.items.properties)i(n.items.properties)}};if(t.type==="array")return"80vw";if(t.properties){i(t.properties)}return a?"80vw":"auto"},openInDialog:function e(t="Form",a="OK",i="Cancel",n="auto",s){const r=!!this.generatedContent;let o=n;if(o==="auto"&&this.parsedSchema){o=this.calculateOptimalDialogWidth(this.parsedSchema)}this.dialogDelegate.openInDialog(t,a,r,i,o,s)}});return v});
2
2
  //# sourceMappingURL=GeneratorHost.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeneratorHost.js","names":["Logger","____utils_Logger","SchemaNormalizer","____core_SchemaNormalizer","SchemaValidator","____core_SchemaValidator","Engine","____core_Engine","StateManager","____core_StateManager","DataSyncDelegate","___delegates_DataSyncDelegate","ValidationDelegate","___delegates_ValidationDelegate","DialogDelegate","___delegates_DialogDelegate","PluginRegistry","____core_PluginRegistry","GeneratorHost","Control","extend","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","this","stateManager","generatedContent","engine","activeModelName","parsedSchema","_generatePromise","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","_setProperty","propertyName","suppressInvalidate","Control.prototype.setProperty.call","setUseMessageManager","getStateManager","_getStateManager","tearDownGeneratedLayout","_tearDownGeneratedLayout","unregisterObject","destroy","_onInternalFieldChange","fieldKey","errorMessage","controlId","extractPayload","getProperty","debug","pushToBindings","currentValidity","fireEvent","undefined","exit","_exit","getModel","getParsedSchema","_getParsedSchema","onBeforeRendering","_onBeforeRendering","hasSchema","hasData","generate","msg","Error","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","applyVisualFallback","errors","validateAll","length","pushMessage","err","JSON","stringify","propertyPath","plugin","getPluginByPath","setVisualValidationState","addCustomError","_addCustomError","clearCustomError","_clearCustomError","schemaValid","validate","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty2","handleInputDataHotSwap","currentVal","setBaseProperty","_setBaseProperty","async","_generate","Promise","resolve","then","_doGenerate","e","internalPayload","rawSchema","isSchemaEmpty","Object","keys","inputData","inputDataJson","parse","finalData","schemaToNormalize","normalizedSchema","normalize","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","pathsToLoad","getInstance","getPathsToLoad","needsNetworkLoad","Array","from","some","path","sap","ui","require","preloadDependencies","getId","setModel","isEditable","build","contentContainer","hasProperties","strip","MessageStrip","text","showIcon","showCloseButton","addStyleClass","VBox","items","hasPartialRenderingErrors","setAggregation","registerObject","mountCrashBoundary","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","isGenerated"],"sources":["GeneratorHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport { Logger } from \"../../utils/Logger\";\nimport { SchemaNormalizer } from \"../../core/SchemaNormalizer\";\nimport { SchemaValidator } from \"../../core/SchemaValidator\";\nimport { Engine } from \"../../core/Engine\";\nimport { StateManager } from \"../../core/StateManager\";\nimport { DataSyncDelegate } from \"./delegates/DataSyncDelegate\";\nimport { ValidationDelegate } from \"./delegates/ValidationDelegate\";\nimport { DialogDelegate } from \"./delegates/DialogDelegate\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport MessageStrip from \"sap/m/MessageStrip\";\nimport VBox from \"sap/m/VBox\";\nimport { PluginRegistry } from \"../../core/PluginRegistry\";\nimport type { ISchema } from \"../../interfaces/ISchema\";\n\n/**\n * Base wrapper element for embedding the dynamic form natively via Explicit Schemas.\n * \n * This class serves as the core rendering engine for standard MetaUI implementations.\n * It manages the lifecycle of the Engine, StateManager, and the delegation of \n * data synchronization, validation, and dialog interactions.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls.host\n */\nexport default class GeneratorHost extends Control {\n\n protected stateManager: StateManager | null = null;\n protected generatedContent: Control | null = null;\n protected engine: Engine | null = null;\n protected activeModelName: string = \"\";\n\n protected dataSyncDelegate!: DataSyncDelegate;\n protected validationDelegate!: ValidationDelegate;\n protected dialogDelegate!: DialogDelegate;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } },\n error: { parameters: { message: { type: \"string\" }, exception: { type: \"object\" } } }\n }\n };\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 * Standard UI5 Constructor.\n */\n constructor(idOrSettings?: string | object, settings?: object) {\n super(idOrSettings, settings);\n }\n\n /**\n * Initializes the control and instantiates the composition delegates.\n * Delegates must be initialized here rather than in the constructor so they are \n * available before `applySettings` runs during UI5's control lifecycle.\n */\n public init(): void {\n super.init();\n\n // Initialize Composition Delegates\n this.dataSyncDelegate = new DataSyncDelegate(this);\n this.validationDelegate = new ValidationDelegate(this);\n this.dialogDelegate = new DialogDelegate(this);\n\n this.onInternalFieldChange = this.onInternalFieldChange.bind(this);\n }\n\n /**\n * Enables or disables debug mode.\n */\n public setDebugMode(enabled: boolean): this {\n this.setProperty(\"debugMode\", enabled, true);\n Logger.setDebugMode(enabled);\n return this;\n }\n\n /**\n * Intercepts property updates to dynamically forward them to active delegates/managers.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n super.setProperty(propertyName, value, suppressInvalidate);\n if (propertyName === \"useMessageManager\" && this.stateManager) {\n this.stateManager.setUseMessageManager(value === true);\n }\n return this;\n }\n\n /**\n * Returns the active state manager instance managing the JSON payload.\n */\n public getStateManager(): StateManager | null {\n return this.stateManager;\n }\n\n /**\n * Safely destroys the currently generated UI tree and cleans up references.\n * This is called before every regeneration to prevent memory leaks.\n */\n public tearDownGeneratedLayout(): void {\n if (this.generatedContent) {\n this.validationDelegate.unregisterObject(this.generatedContent);\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /**\n * Internal event handler triggered by the Engine when a field value changes.\n * Coordinates LiveUpdate syncs, validation state tracking, and bubbling the change upwards.\n */\n protected onInternalFieldChange(isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string): void {\n const payload = this.stateManager ? this.stateManager.extractPayload() : {};\n\n if (this.getProperty(\"liveUpdate\") === true) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"liveUpdate is enabled, pushing outbound payload.\", \"GeneratorHost\");\n }\n this.dataSyncDelegate.pushToBindings(payload);\n }\n\n const currentValidity = this.getProperty(\"isValid\") as boolean;\n if (isValid !== currentValidity) {\n this.setProperty(\"isValid\", isValid, true);\n this.fireEvent(\"validationStateChanged\", { isValid });\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `Validation state shifted to: ${isValid}`, \"GeneratorHost\");\n }\n }\n\n this.fireEvent(\"fieldChange\", {\n fieldPath: fieldKey || \"\",\n value: undefined,\n payload: payload,\n isValid: isValid\n });\n }\n\n /**\n * Standard UI5 Exit Hook. Ensures complete teardown of the engine and state manager.\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 /** Cached schema for intelligent diffing during inference mode hot-swaps */\n protected parsedSchema: Record<string, unknown> | null = null;\n\n /**\n * Exposes the parsed schema to the DataSyncDelegate for diffing.\n */\n public getParsedSchema(): Record<string, unknown> | null {\n return this.parsedSchema;\n }\n\n /**\n * Standard UI5 Rendering Hook.\n * Evaluates whether it possesses a schema or data. If so, triggers the internal engine generation.\n */\n public onBeforeRendering(): void {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI GeneratorHost]\", `onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty(\"schemaDefinition\")}, data exists = ${!!this.getProperty(\"data\")}, dataJson exists = ${!!this.getProperty(\"dataJson\")}`, \"GeneratorHost\");\n }\n\n if (!this.generatedContent) {\n const hasSchema = !!this.getProperty(\"schemaDefinition\");\n const hasData = !!this.getProperty(\"dataJson\") || !!this.getProperty(\"data\");\n\n if (hasSchema || hasData) {\n this.generate();\n } else {\n const msg = \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg); // Eradicate silent errors\n }\n }\n }\n\n /**\n * Public API method to manually trigger form submission.\n * Executes all structural validations, clears old messages, and pushes payload to bindings.\n * @returns boolean True if submission succeeded, false if validation failed.\n */\n public triggerSubmit(): boolean {\n if (this.stateManager && this.engine) {\n let isPrevented = false;\n\n this.validationDelegate.removeAllMessages();\n\n // Only apply local fallback visual states if the global MessageManager is explicitly disabled\n const applyVisualFallback = this.getProperty(\"useMessageManager\") !== true;\n const errors = this.engine.validateAll(applyVisualFallback);\n if (errors.length > 0) {\n this.validationDelegate.pushMessage(\"\", \"One or more fields failed schema validation. Please review the highlighted fields.\");\n for (const err of errors) {\n if (err.fieldKey && err.errorMessage) {\n this.validationDelegate.pushMessage(err.fieldKey, err.errorMessage);\n }\n }\n return false;\n }\n\n const payload = this.stateManager.extractPayload();\n const payloadJson = JSON.stringify(payload);\n\n this.fireEvent(\"beforeSubmit\", {\n payload,\n preventDefault: () => { isPrevented = true; },\n addError: (propertyPath: string, errorMessage: string) => {\n isPrevented = true;\n this.validationDelegate.pushMessage(propertyPath, errorMessage);\n if (applyVisualFallback && this.engine) {\n const plugin = this.engine.getPluginByPath(propertyPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, errorMessage);\n }\n }\n }\n });\n\n if (isPrevented) {\n return false;\n }\n\n this.dataSyncDelegate.pushToBindings(payload);\n this.fireEvent(\"submit\", { payload, payloadJson });\n return true;\n }\n return false;\n }\n\n /**\n * Injects a custom error message onto a specific field.\n */\n public addCustomError(fieldPath: string, message: string): void {\n this.validationDelegate.addCustomError(fieldPath, message);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, message);\n }\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n */\n public clearCustomError(fieldPath: string): void {\n this.validationDelegate.clearCustomError(fieldPath);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n const schemaValid = plugin.validate();\n plugin.setVisualValidationState(schemaValid.isValid, schemaValid.errorMessage);\n }\n }\n }\n\n /**\n * Toggles busy state on the host control.\n */\n public setBusy(isBusy: boolean): this {\n super.setBusy(isBusy);\n return this;\n }\n\n /**\n * Intercepts property changes. Hot-swaps data gracefully if it's an inputData change,\n * or forces a full UI teardown if it's a structural property change (like schemaDefinition).\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"dataJson\" || propertyName === \"data\") {\n this.dataSyncDelegate.handleInputDataHotSwap(propertyName, value, suppressInvalidate);\n return this;\n }\n\n if (propertyName === \"editable\" || propertyName === \"debugMode\" || propertyName === \"schemaDefinition\") {\n const currentVal = this.getProperty(propertyName);\n if (currentVal !== value) {\n super.setProperty(propertyName, value, suppressInvalidate);\n this.tearDownGeneratedLayout();\n }\n return this;\n }\n\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Bypasses the interceptor to write directly to the base UI5 control.\n */\n public setBaseProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Internal reference to the active generate promise.\n * Prevents concurrent redundant layouts from being generated when properties are set rapidly or DialogDelegate triggers it.\n */\n private _generatePromise: Promise<void> | null = null;\n\n /**\n * The core rendering pipeline entry point.\n * Uses Promise resolution to debounce concurrent or rapid consecutive calls natively without arbitrary timeouts.\n * @returns Promise that resolves when the layout is successfully built and mounted.\n */\n public async generate(): Promise<void> {\n if (this._generatePromise) {\n return this._generatePromise;\n }\n this._generatePromise = Promise.resolve().then(async () => {\n try {\n await this._doGenerate();\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Error in deferred generate: \" + e, \"GeneratorHost\");\n throw e; // Ensure it bubbles up to awaiters\n } finally {\n this._generatePromise = null;\n }\n });\n return this._generatePromise;\n }\n\n /**\n * The underlying synchronous generator orchestration method.\n * Normalizes the schema, sets up the state manager, loads missing plugins over the network,\n * orchestrates the Engine build, and mounts the generated UI components into the internal tree.\n */\n private async _doGenerate(): Promise<void> {\n try {\n this.tearDownGeneratedLayout();\n\n // CRITICAL FIX: Extract the unsaved internal payload BEFORE destroying the state manager\n // Otherwise, toggling editable (or other structural properties) will wipe user inputs!\n let internalPayload = null;\n if (this.stateManager) {\n internalPayload = this.stateManager.extractPayload();\n }\n\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n const rawSchema = this.getProperty(\"schemaDefinition\");\n const isSchemaEmpty = !rawSchema || (typeof rawSchema === \"object\" && Object.keys(rawSchema).length === 0);\n\n let inputData = this.getProperty(\"data\");\n const inputDataJson = this.getProperty(\"dataJson\");\n\n if (inputDataJson) {\n try {\n inputData = JSON.parse(inputDataJson as string);\n } catch (e) {\n const msg = \"Failed to parse inputDataJson string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: e });\n throw new Error(msg); // Critical error instead of silent fallback\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n const msg = \"Failed to parse inputData string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: e });\n throw new Error(msg); // Critical error instead of silent fallback\n }\n }\n\n // The internal payload represents the user's latest un-extracted edits. It must take priority.\n const finalData = internalPayload || inputData;\n\n if (!finalData || Object.keys(finalData).length === 0) {\n if (isSchemaEmpty) {\n const msg = \"No payload provided and no explicit schema defined. Cannot infer UI.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg);\n }\n }\n\n const schemaToNormalize = isSchemaEmpty ? null : rawSchema;\n const normalizedSchema = SchemaNormalizer.normalize(schemaToNormalize, finalData);\n\n // Cache the parsed/inferred schema so DataSyncDelegate can diff against it later\n this.parsedSchema = normalizedSchema as Record<string, unknown>;\n\n if (normalizedSchema) {\n const schemaErrors = SchemaValidator.validateSchemaStructure(normalizedSchema);\n if (schemaErrors.length > 0) {\n const errorMsg = \"Schema Structural Errors Found:\\n- \" + schemaErrors.join(\"\\n- \");\n // Let's log it out loudly regardless of debug mode, so developers can see why it didn't render\n Logger.error(\"[MetaUI]\", errorMsg, \"GeneratorHost\");\n if (this.getProperty(\"debugMode\")) {\n MessageBox.error(errorMsg, { title: \"MetaUI Schema Error\" });\n return;\n }\n }\n }\n\n const pathsToLoad = PluginRegistry.getInstance().getPathsToLoad(normalizedSchema as ISchema);\n const needsNetworkLoad = Array.from(pathsToLoad).some(path => !sap.ui.require(path));\n\n if (needsNetworkLoad) {\n this.setBusy(true);\n await PluginRegistry.getInstance().preloadDependencies(normalizedSchema as ISchema);\n this.setBusy(false);\n }\n\n this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.stateManager.setUseMessageManager(this.getProperty(\"useMessageManager\") === true);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n if (!this.engine) {\n const isEditable = this.getProperty(\"editable\") !== false;\n const useMessageManager = this.getProperty(\"useMessageManager\") === true;\n this.engine = new Engine(isEditable, useMessageManager);\n }\n\n this.generatedContent = this.engine.build(\n normalizedSchema,\n this.stateManager.getModel(),\n this.activeModelName,\n this.triggerSubmit.bind(this),\n this.getId(),\n this.onInternalFieldChange.bind(this)\n );\n\n let contentContainer = this.generatedContent;\n \n const hasProperties = normalizedSchema && Object.keys(normalizedSchema).length > 0;\n \n if (!hasProperties) {\n const strip = new MessageStrip({\n text: \"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: false\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n } else if (this.engine.hasPartialRenderingErrors) {\n const strip = new MessageStrip({\n text: \"Layout partially rendered. Some fields failed to generate due to configuration errors.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n }\n\n this.setAggregation(\"_content\", contentContainer);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n } catch (error) {\n this.setBusy(false);\n const msg = \"Fatal crash during layout generation: \" + (error as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: error });\n this.validationDelegate.mountCrashBoundary(error as Error);\n throw error; // Completely eliminate silent error swallowing\n }\n }\n\n /**\n * Programmatic API. Re-parents the generated content into a dialog and opens it.\n */\n public openInDialog(title: string = \"Form\", submitButtonText: string = \"OK\", cancelButtonText: string = \"Cancel\", dialogWidth: string = \"800px\", parentView?: Control): void {\n const isGenerated = !!this.generatedContent;\n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated, cancelButtonText, dialogWidth, parentView);\n }\n}\n"],"mappings":"yYAESA,EAAMC,EAAA,gBACNC,EAAgBC,EAAA,0BAChBC,EAAeC,EAAA,yBACfC,EAAMC,EAAA,gBACNC,EAAYC,EAAA,sBACZC,EAAgBC,EAAA,0BAChBC,EAAkBC,EAAA,4BAClBC,EAAcC,EAAA,wBAIdC,EAAcC,EAAA,kBAGvB,MASqBC,EAAsBC,EAAOC,OAAA,0DAwDvCC,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,GA3DYC,SAAW,CACv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a,CAC3BC,KAAM,sHACNvK,KAAM,UACNwK,SAAU,KACVC,gBAAiB,QAErBJ,EAAMK,cAAc,0BACpBP,EAAmB,IAAIQ,EAAK,CACxBC,MAAO,CAACP,EAAO/H,KAAKE,mBAE5B,MAAO,GAAIF,KAAKG,OAAOoI,0BAA2B,CAC9C,MAAMR,EAAQ,IAAIC,EAAa,CAC3BC,KAAM,yFACNvK,KAAM,UACNwK,SAAU,KACVC,gBAAiB,OAErBJ,EAAMK,cAAc,0BACpBP,EAAmB,IAAIQ,EAAK,CACxBC,MAAO,CAACP,EAAO/H,KAAKE,mBAE5B,CAEAF,KAAKwI,eAAe,WAAYX,GAChC7H,KAAKW,mBAAmB8H,eAAezI,KAAKE,kBAE5C,MAAMtB,EAAUoB,KAAKC,aAAaiC,iBAClClC,KAAKU,iBAAiB2B,eAAezD,EAEzC,CAAE,MAAOa,GACLO,KAAK2E,QAAQ,OACb,MAAMxB,EAAM,yCAA4C1D,EAAgBF,QACxEjE,EAAOmE,MAAM,WAAY0D,EAAK,iBAC9BnD,KAAKuC,UAAU,QAAS,CAAEhD,QAAS4D,EAAKzD,UAAWD,IACnDO,KAAKW,mBAAmB+H,mBAAmBjJ,GAC3C,MAAMA,CACV,CACJ,EAKOkJ,aAAY,SAAAC,EAAChC,EAAgB,OAAQiC,EAA2B,KAAMC,EAA2B,SAAUC,EAAsB,QAASC,GAC7I,MAAMC,IAAgBjJ,KAAKE,iBAC3BF,KAAKY,eAAe+H,aAAa/B,EAAOiC,EAAkBI,EAAaH,EAAkBC,EAAaC,EAC1G,IAAC,OA9gBgBxM,CAAa","ignoreList":[]}
1
+ {"version":3,"file":"GeneratorHost.js","names":["Logger","____utils_Logger","SchemaNormalizer","____core_SchemaNormalizer","SchemaValidator","____core_SchemaValidator","Engine","____core_Engine","StateManager","____core_StateManager","DataSyncDelegate","___delegates_DataSyncDelegate","ValidationDelegate","___delegates_ValidationDelegate","DialogDelegate","___delegates_DialogDelegate","PluginRegistry","____core_PluginRegistry","GeneratorHost","Control","extend","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","this","stateManager","generatedContent","engine","activeModelName","parsedSchema","_generatePromise","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","_setProperty","propertyName","suppressInvalidate","Control.prototype.setProperty.call","setUseMessageManager","getStateManager","_getStateManager","tearDownGeneratedLayout","_tearDownGeneratedLayout","unregisterObject","destroy","_onInternalFieldChange","fieldKey","errorMessage","controlId","extractPayload","getProperty","debug","pushToBindings","currentValidity","fireEvent","undefined","exit","_exit","getModel","getParsedSchema","_getParsedSchema","onBeforeRendering","_onBeforeRendering","hasSchema","hasData","generate","msg","Error","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","applyVisualFallback","errors","validateAll","length","pushMessage","err","JSON","stringify","propertyPath","plugin","getPluginByPath","setVisualValidationState","addCustomError","_addCustomError","clearCustomError","_clearCustomError","schemaValid","validate","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty2","handleInputDataHotSwap","currentVal","setBaseProperty","_setBaseProperty","async","_generate","Promise","resolve","then","_doGenerate","e","internalPayload","rawSchema","isSchemaEmpty","Object","keys","inputData","inputDataJson","parse","finalData","schemaToNormalize","normalizedSchema","normalize","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","pathsToLoad","getInstance","getPathsToLoad","needsNetworkLoad","Array","from","some","path","sap","ui","require","preloadDependencies","getId","setModel","isEditable","build","contentContainer","hasProperties","strip","MessageStrip","text","showIcon","showCloseButton","addStyleClass","VBox","items","hasPartialRenderingErrors","setAggregation","registerObject","optimalWidth","calculateOptimalDialogWidth","updateDialogWidthDynamically","mountCrashBoundary","_calculateOptimalDialogWidth","schema","requiresWideDialog","scanProperties","props","key","prop","fullWidth","widget","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","isGenerated","finalWidth"],"sources":["GeneratorHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport { Logger } from \"../../utils/Logger\";\nimport { SchemaNormalizer } from \"../../core/SchemaNormalizer\";\nimport { SchemaValidator } from \"../../core/SchemaValidator\";\nimport { Engine } from \"../../core/Engine\";\nimport { StateManager } from \"../../core/StateManager\";\nimport { DataSyncDelegate } from \"./delegates/DataSyncDelegate\";\nimport { ValidationDelegate } from \"./delegates/ValidationDelegate\";\nimport { DialogDelegate } from \"./delegates/DialogDelegate\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport MessageStrip from \"sap/m/MessageStrip\";\nimport VBox from \"sap/m/VBox\";\nimport { PluginRegistry } from \"../../core/PluginRegistry\";\nimport type { ISchema } from \"../../interfaces/ISchema\";\n\n/**\n * Base wrapper element for embedding the dynamic form natively via Explicit Schemas.\n * \n * This class serves as the core rendering engine for standard MetaUI implementations.\n * It manages the lifecycle of the Engine, StateManager, and the delegation of \n * data synchronization, validation, and dialog interactions.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls.host\n */\nexport default class GeneratorHost extends Control {\n\n protected stateManager: StateManager | null = null;\n protected generatedContent: Control | null = null;\n protected engine: Engine | null = null;\n protected activeModelName: string = \"\";\n\n protected dataSyncDelegate!: DataSyncDelegate;\n protected validationDelegate!: ValidationDelegate;\n protected dialogDelegate!: DialogDelegate;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } },\n error: { parameters: { message: { type: \"string\" }, exception: { type: \"object\" } } }\n }\n };\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 * Standard UI5 Constructor.\n */\n constructor(idOrSettings?: string | object, settings?: object) {\n super(idOrSettings, settings);\n }\n\n /**\n * Initializes the control and instantiates the composition delegates.\n * Delegates must be initialized here rather than in the constructor so they are \n * available before `applySettings` runs during UI5's control lifecycle.\n */\n public init(): void {\n super.init();\n\n // Initialize Composition Delegates\n this.dataSyncDelegate = new DataSyncDelegate(this);\n this.validationDelegate = new ValidationDelegate(this);\n this.dialogDelegate = new DialogDelegate(this);\n\n this.onInternalFieldChange = this.onInternalFieldChange.bind(this);\n }\n\n /**\n * Enables or disables debug mode.\n */\n public setDebugMode(enabled: boolean): this {\n this.setProperty(\"debugMode\", enabled, true);\n Logger.setDebugMode(enabled);\n return this;\n }\n\n /**\n * Intercepts property updates to dynamically forward them to active delegates/managers.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n super.setProperty(propertyName, value, suppressInvalidate);\n if (propertyName === \"useMessageManager\" && this.stateManager) {\n this.stateManager.setUseMessageManager(value === true);\n }\n return this;\n }\n\n /**\n * Returns the active state manager instance managing the JSON payload.\n */\n public getStateManager(): StateManager | null {\n return this.stateManager;\n }\n\n /**\n * Safely destroys the currently generated UI tree and cleans up references.\n * This is called before every regeneration to prevent memory leaks.\n */\n public tearDownGeneratedLayout(): void {\n if (this.generatedContent) {\n this.validationDelegate.unregisterObject(this.generatedContent);\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /**\n * Internal event handler triggered by the Engine when a field value changes.\n * Coordinates LiveUpdate syncs, validation state tracking, and bubbling the change upwards.\n */\n protected onInternalFieldChange(isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string): void {\n const payload = this.stateManager ? this.stateManager.extractPayload() : {};\n\n if (this.getProperty(\"liveUpdate\") === true) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"liveUpdate is enabled, pushing outbound payload.\", \"GeneratorHost\");\n }\n this.dataSyncDelegate.pushToBindings(payload);\n }\n\n const currentValidity = this.getProperty(\"isValid\") as boolean;\n if (isValid !== currentValidity) {\n this.setProperty(\"isValid\", isValid, true);\n this.fireEvent(\"validationStateChanged\", { isValid });\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `Validation state shifted to: ${isValid}`, \"GeneratorHost\");\n }\n }\n\n this.fireEvent(\"fieldChange\", {\n fieldPath: fieldKey || \"\",\n value: undefined,\n payload: payload,\n isValid: isValid\n });\n }\n\n /**\n * Standard UI5 Exit Hook. Ensures complete teardown of the engine and state manager.\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 /** Cached schema for intelligent diffing during inference mode hot-swaps */\n protected parsedSchema: Record<string, unknown> | null = null;\n\n /**\n * Exposes the parsed schema to the DataSyncDelegate for diffing.\n */\n public getParsedSchema(): Record<string, unknown> | null {\n return this.parsedSchema;\n }\n\n /**\n * Standard UI5 Rendering Hook.\n * Evaluates whether it possesses a schema or data. If so, triggers the internal engine generation.\n */\n public onBeforeRendering(): void {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI GeneratorHost]\", `onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty(\"schemaDefinition\")}, data exists = ${!!this.getProperty(\"data\")}, dataJson exists = ${!!this.getProperty(\"dataJson\")}`, \"GeneratorHost\");\n }\n\n if (!this.generatedContent) {\n const hasSchema = !!this.getProperty(\"schemaDefinition\");\n const hasData = !!this.getProperty(\"dataJson\") || !!this.getProperty(\"data\");\n\n if (hasSchema || hasData) {\n this.generate();\n } else {\n const msg = \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg); // Eradicate silent errors\n }\n }\n }\n\n /**\n * Public API method to manually trigger form submission.\n * Executes all structural validations, clears old messages, and pushes payload to bindings.\n * @returns boolean True if submission succeeded, false if validation failed.\n */\n public triggerSubmit(): boolean {\n if (this.stateManager && this.engine) {\n let isPrevented = false;\n\n this.validationDelegate.removeAllMessages();\n\n // Only apply local fallback visual states if the global MessageManager is explicitly disabled\n const applyVisualFallback = this.getProperty(\"useMessageManager\") !== true;\n const errors = this.engine.validateAll(applyVisualFallback);\n if (errors.length > 0) {\n this.validationDelegate.pushMessage(\"\", \"One or more fields failed schema validation. Please review the highlighted fields.\");\n for (const err of errors) {\n if (err.fieldKey && err.errorMessage) {\n this.validationDelegate.pushMessage(err.fieldKey, err.errorMessage);\n }\n }\n return false;\n }\n\n const payload = this.stateManager.extractPayload();\n const payloadJson = JSON.stringify(payload);\n\n this.fireEvent(\"beforeSubmit\", {\n payload,\n preventDefault: () => { isPrevented = true; },\n addError: (propertyPath: string, errorMessage: string) => {\n isPrevented = true;\n this.validationDelegate.pushMessage(propertyPath, errorMessage);\n if (applyVisualFallback && this.engine) {\n const plugin = this.engine.getPluginByPath(propertyPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, errorMessage);\n }\n }\n }\n });\n\n if (isPrevented) {\n return false;\n }\n\n this.dataSyncDelegate.pushToBindings(payload);\n this.fireEvent(\"submit\", { payload, payloadJson });\n return true;\n }\n return false;\n }\n\n /**\n * Injects a custom error message onto a specific field.\n */\n public addCustomError(fieldPath: string, message: string): void {\n this.validationDelegate.addCustomError(fieldPath, message);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, message);\n }\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n */\n public clearCustomError(fieldPath: string): void {\n this.validationDelegate.clearCustomError(fieldPath);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n const schemaValid = plugin.validate();\n plugin.setVisualValidationState(schemaValid.isValid, schemaValid.errorMessage);\n }\n }\n }\n\n /**\n * Toggles busy state on the host control.\n */\n public setBusy(isBusy: boolean): this {\n super.setBusy(isBusy);\n return this;\n }\n\n /**\n * Intercepts property changes. Hot-swaps data gracefully if it's an inputData change,\n * or forces a full UI teardown if it's a structural property change (like schemaDefinition).\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"dataJson\" || propertyName === \"data\") {\n this.dataSyncDelegate.handleInputDataHotSwap(propertyName, value, suppressInvalidate);\n return this;\n }\n\n if (propertyName === \"editable\" || propertyName === \"debugMode\" || propertyName === \"schemaDefinition\") {\n const currentVal = this.getProperty(propertyName);\n if (currentVal !== value) {\n super.setProperty(propertyName, value, suppressInvalidate);\n this.tearDownGeneratedLayout();\n }\n return this;\n }\n\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Bypasses the interceptor to write directly to the base UI5 control.\n */\n public setBaseProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Internal reference to the active generate promise.\n * Prevents concurrent redundant layouts from being generated when properties are set rapidly or DialogDelegate triggers it.\n */\n private _generatePromise: Promise<void> | null = null;\n\n /**\n * The core rendering pipeline entry point.\n * Uses Promise resolution to debounce concurrent or rapid consecutive calls natively without arbitrary timeouts.\n * @returns Promise that resolves when the layout is successfully built and mounted.\n */\n public async generate(): Promise<void> {\n if (this._generatePromise) {\n return this._generatePromise;\n }\n this._generatePromise = Promise.resolve().then(async () => {\n try {\n await this._doGenerate();\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Error in deferred generate: \" + e, \"GeneratorHost\");\n throw e; // Ensure it bubbles up to awaiters\n } finally {\n this._generatePromise = null;\n }\n });\n return this._generatePromise;\n }\n\n /**\n * The underlying synchronous generator orchestration method.\n * Normalizes the schema, sets up the state manager, loads missing plugins over the network,\n * orchestrates the Engine build, and mounts the generated UI components into the internal tree.\n */\n private async _doGenerate(): Promise<void> {\n try {\n this.tearDownGeneratedLayout();\n\n // CRITICAL FIX: Extract the unsaved internal payload BEFORE destroying the state manager\n // Otherwise, toggling editable (or other structural properties) will wipe user inputs!\n let internalPayload = null;\n if (this.stateManager) {\n internalPayload = this.stateManager.extractPayload();\n }\n\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n const rawSchema = this.getProperty(\"schemaDefinition\");\n const isSchemaEmpty = !rawSchema || (typeof rawSchema === \"object\" && Object.keys(rawSchema).length === 0);\n\n let inputData = this.getProperty(\"data\");\n const inputDataJson = this.getProperty(\"dataJson\");\n\n if (inputDataJson) {\n try {\n inputData = JSON.parse(inputDataJson as string);\n } catch (e) {\n const msg = \"Failed to parse inputDataJson string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: e });\n throw new Error(msg); // Critical error instead of silent fallback\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n const msg = \"Failed to parse inputData string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: e });\n throw new Error(msg); // Critical error instead of silent fallback\n }\n }\n\n // The internal payload represents the user's latest un-extracted edits. It must take priority.\n const finalData = internalPayload || inputData;\n\n if (!finalData || Object.keys(finalData).length === 0) {\n if (isSchemaEmpty) {\n const msg = \"No payload provided and no explicit schema defined. Cannot infer UI.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg);\n }\n }\n\n const schemaToNormalize = isSchemaEmpty ? null : rawSchema;\n const normalizedSchema = SchemaNormalizer.normalize(schemaToNormalize, finalData);\n\n // Cache the parsed/inferred schema so DataSyncDelegate can diff against it later\n this.parsedSchema = normalizedSchema as Record<string, unknown>;\n\n if (normalizedSchema) {\n const schemaErrors = SchemaValidator.validateSchemaStructure(normalizedSchema);\n if (schemaErrors.length > 0) {\n const errorMsg = \"Schema Structural Errors Found:\\n- \" + schemaErrors.join(\"\\n- \");\n // Let's log it out loudly regardless of debug mode, so developers can see why it didn't render\n Logger.error(\"[MetaUI]\", errorMsg, \"GeneratorHost\");\n if (this.getProperty(\"debugMode\")) {\n MessageBox.error(errorMsg, { title: \"MetaUI Schema Error\" });\n return;\n }\n }\n }\n\n const pathsToLoad = PluginRegistry.getInstance().getPathsToLoad(normalizedSchema as ISchema);\n const needsNetworkLoad = Array.from(pathsToLoad).some(path => !sap.ui.require(path));\n\n if (needsNetworkLoad) {\n this.setBusy(true);\n await PluginRegistry.getInstance().preloadDependencies(normalizedSchema as ISchema);\n this.setBusy(false);\n }\n\n this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.stateManager.setUseMessageManager(this.getProperty(\"useMessageManager\") === true);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n if (!this.engine) {\n const isEditable = this.getProperty(\"editable\") !== false;\n const useMessageManager = this.getProperty(\"useMessageManager\") === true;\n this.engine = new Engine(isEditable, useMessageManager);\n }\n\n this.generatedContent = this.engine.build(\n normalizedSchema,\n this.stateManager.getModel(),\n this.activeModelName,\n this.triggerSubmit.bind(this),\n this.getId(),\n this.onInternalFieldChange.bind(this)\n );\n\n let contentContainer = this.generatedContent;\n\n const hasProperties = normalizedSchema && Object.keys(normalizedSchema).length > 0;\n\n if (!hasProperties) {\n const strip = new MessageStrip({\n text: \"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: false\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n } else if (this.engine.hasPartialRenderingErrors) {\n const strip = new MessageStrip({\n text: \"Layout partially rendered. Some fields failed to generate due to configuration errors.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n }\n\n this.setAggregation(\"_content\", contentContainer);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n // Retroactively expand the dialog if the heuristic determines it needs more space\n const optimalWidth = this.calculateOptimalDialogWidth(this.parsedSchema);\n this.dialogDelegate.updateDialogWidthDynamically(optimalWidth);\n\n } catch (error) {\n this.setBusy(false);\n const msg = \"Fatal crash during layout generation: \" + (error as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: error });\n this.validationDelegate.mountCrashBoundary(error as Error);\n throw error; // Completely eliminate silent error swallowing\n }\n }\n\n /**\n * Helper to heuristically calculate optimal dialog width based on schema content.\n */\n private calculateOptimalDialogWidth(schema: Record<string, any> | null): string {\n if (!schema) return \"auto\";\n let requiresWideDialog = false;\n\n const scanProperties = (props: Record<string, any>) => {\n if (requiresWideDialog) return;\n for (const key in props) {\n const prop = props[key];\n if (prop.type === \"array\") {\n requiresWideDialog = true;\n return;\n }\n if (prop.ui?.fullWidth === true) {\n requiresWideDialog = true;\n return;\n }\n if (prop.ui?.widget === \"codeEditor\" || prop.ui?.widget === \"textArea\" || prop.ui?.widget === \"richText\") {\n requiresWideDialog = true;\n return;\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n }\n };\n\n if (schema.type === \"array\") return \"80vw\";\n if (schema.properties) {\n scanProperties(schema.properties);\n }\n\n return requiresWideDialog ? \"80vw\" : \"auto\";\n }\n\n /**\n * Programmatic API. Re-parents the generated content into a dialog and opens it.\n */\n public openInDialog(title: string = \"Form\", submitButtonText: string = \"OK\", cancelButtonText: string = \"Cancel\", dialogWidth: string = \"auto\", parentView?: Control): void {\n const isGenerated = !!this.generatedContent;\n \n // If we already have the schema parsed, we can calculate it instantly to prevent flicker\n let finalWidth = dialogWidth;\n if (finalWidth === \"auto\" && this.parsedSchema) {\n finalWidth = this.calculateOptimalDialogWidth(this.parsedSchema);\n }\n \n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated, cancelButtonText, fin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500
500
  );
501
501
 
502
502
  let contentContainer = this.generatedContent;
503
-
503
+
504
504
  const hasProperties = normalizedSchema && Object.keys(normalizedSchema).length > 0;
505
-
505
+
506
506
  if (!hasProperties) {
507
507
  const strip = new MessageStrip({
508
508
  text: "Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.",
@@ -533,6 +533,10 @@ export default class GeneratorHost extends Control {
533
533
  const payload = this.stateManager.extractPayload();
534
534
  this.dataSyncDelegate.pushToBindings(payload);
535
535
 
536
+ // Retroactively expand the dialog if the heuristic determines it needs more space
537
+ const optimalWidth = this.calculateOptimalDialogWidth(this.parsedSchema);
538
+ this.dialogDelegate.updateDialogWidthDynamically(optimalWidth);
539
+
536
540
  } catch (error) {
537
541
  this.setBusy(false);
538
542
  const msg = "Fatal crash during layout generation: " + (error as Error).message;
@@ -543,11 +547,54 @@ export default class GeneratorHost extends Control {
543
547
  }
544
548
  }
545
549
 
550
+ /**
551
+ * Helper to heuristically calculate optimal dialog width based on schema content.
552
+ */
553
+ private calculateOptimalDialogWidth(schema: Record<string, any> | null): string {
554
+ if (!schema) return "auto";
555
+ let requiresWideDialog = false;
556
+
557
+ const scanProperties = (props: Record<string, any>) => {
558
+ if (requiresWideDialog) return;
559
+ for (const key in props) {
560
+ const prop = props[key];
561
+ if (prop.type === "array") {
562
+ requiresWideDialog = true;
563
+ return;
564
+ }
565
+ if (prop.ui?.fullWidth === true) {
566
+ requiresWideDialog = true;
567
+ return;
568
+ }
569
+ if (prop.ui?.widget === "codeEditor" || prop.ui?.widget === "textArea" || prop.ui?.widget === "richText") {
570
+ requiresWideDialog = true;
571
+ return;
572
+ }
573
+ if (prop.properties) scanProperties(prop.properties);
574
+ if (prop.items && prop.items.properties) scanProperties(prop.items.properties);
575
+ }
576
+ };
577
+
578
+ if (schema.type === "array") return "80vw";
579
+ if (schema.properties) {
580
+ scanProperties(schema.properties);
581
+ }
582
+
583
+ return requiresWideDialog ? "80vw" : "auto";
584
+ }
585
+
546
586
  /**
547
587
  * Programmatic API. Re-parents the generated content into a dialog and opens it.
548
588
  */
549
- public openInDialog(title: string = "Form", submitButtonText: string = "OK", cancelButtonText: string = "Cancel", dialogWidth: string = "800px", parentView?: Control): void {
589
+ public openInDialog(title: string = "Form", submitButtonText: string = "OK", cancelButtonText: string = "Cancel", dialogWidth: string = "auto", parentView?: Control): void {
550
590
  const isGenerated = !!this.generatedContent;
551
- this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated, cancelButtonText, dialogWidth, parentView);
591
+
592
+ // If we already have the schema parsed, we can calculate it instantly to prevent flicker
593
+ let finalWidth = dialogWidth;
594
+ if (finalWidth === "auto" && this.parsedSchema) {
595
+ finalWidth = this.calculateOptimalDialogWidth(this.parsedSchema);
596
+ }
597
+
598
+ this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated, cancelButtonText, finalWidth, parentView);
552
599
  }
553
600
  }