@siliconst/metaui 1.4.4 → 1.4.6

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 (204) hide show
  1. package/package.json +1 -1
  2. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +42 -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 +7 -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 +45 -1
  9. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +5 -5
  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 +1 -1
  12. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
  13. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
  14. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +4 -4
  15. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate-dbg.js +122 -0
  16. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate-dbg.js.map +1 -0
  17. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.d.ts +49 -0
  18. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.d.ts.map +1 -0
  19. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.js +2 -0
  20. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.js.map +1 -0
  21. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.ts +118 -0
  22. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator-dbg.js +24 -8
  23. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator-dbg.js.map +1 -1
  24. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.d.ts +1 -0
  25. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.d.ts.map +1 -1
  26. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.js +1 -1
  27. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.js.map +1 -1
  28. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.ts +26 -9
  29. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +5 -5
  30. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
  31. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +3 -3
  32. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
  33. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +1 -1
  34. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
  35. package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +5 -5
  36. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +45 -1
  37. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -1
  38. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +10 -1
  39. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -1
  40. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +1 -1
  41. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -1
  42. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts +45 -2
  43. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -1
  44. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +3 -3
  45. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -1
  46. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +3 -3
  47. package/src/nz/co/siliconst/ui5/metaui/layouts/CompactLayout-dbg.js +10 -6
  48. package/src/nz/co/siliconst/ui5/metaui/layouts/CompactLayout-dbg.js.map +1 -1
  49. package/src/nz/co/siliconst/ui5/metaui/layouts/CompactLayout.d.ts.map +1 -1
  50. package/src/nz/co/siliconst/ui5/metaui/layouts/CompactLayout.js +1 -1
  51. package/src/nz/co/siliconst/ui5/metaui/layouts/CompactLayout.js.map +1 -1
  52. package/src/nz/co/siliconst/ui5/metaui/layouts/CompactLayout.ts +5 -5
  53. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +10 -6
  54. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -1
  55. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -1
  56. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +1 -1
  57. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -1
  58. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +5 -5
  59. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +24 -31
  60. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -1
  61. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -1
  62. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +1 -1
  63. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -1
  64. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +20 -31
  65. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout-dbg.js +8 -4
  66. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout-dbg.js.map +1 -1
  67. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.d.ts.map +1 -1
  68. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.js +1 -1
  69. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.js.map +1 -1
  70. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.ts +3 -3
  71. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +36 -35
  72. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  73. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin-dbg.js +2 -2
  74. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin-dbg.js.map +1 -1
  75. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin.js +1 -1
  76. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin.js.map +1 -1
  77. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin.ts +2 -2
  78. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin-dbg.js +2 -2
  79. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin-dbg.js.map +1 -1
  80. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin.js +1 -1
  81. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin.js.map +1 -1
  82. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin.ts +2 -2
  83. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js +5 -5
  84. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js.map +1 -1
  85. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js +1 -1
  86. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js.map +1 -1
  87. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.ts +5 -5
  88. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js +2 -2
  89. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js.map +1 -1
  90. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js +1 -1
  91. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js.map +1 -1
  92. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.ts +2 -2
  93. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +6 -6
  94. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
  95. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts +5 -5
  96. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
  97. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
  98. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
  99. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +6 -6
  100. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js +2 -2
  101. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js.map +1 -1
  102. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js +1 -1
  103. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js.map +1 -1
  104. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts +2 -2
  105. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js +2 -2
  106. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js.map +1 -1
  107. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js +1 -1
  108. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js.map +1 -1
  109. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.ts +2 -2
  110. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js +2 -2
  111. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js.map +1 -1
  112. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js +1 -1
  113. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js.map +1 -1
  114. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.ts +2 -2
  115. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js +2 -2
  116. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js.map +1 -1
  117. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js +1 -1
  118. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js.map +1 -1
  119. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts +2 -2
  120. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js +2 -2
  121. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js.map +1 -1
  122. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js +1 -1
  123. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js.map +1 -1
  124. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts +2 -2
  125. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js +2 -2
  126. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js.map +1 -1
  127. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js +1 -1
  128. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js.map +1 -1
  129. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.ts +2 -2
  130. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js +2 -2
  131. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js.map +1 -1
  132. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js +1 -1
  133. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js.map +1 -1
  134. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.ts +2 -2
  135. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js +2 -2
  136. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js.map +1 -1
  137. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js +1 -1
  138. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js.map +1 -1
  139. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.ts +2 -2
  140. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js +2 -2
  141. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js.map +1 -1
  142. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js +1 -1
  143. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js.map +1 -1
  144. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.ts +2 -2
  145. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js +2 -2
  146. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js.map +1 -1
  147. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js +1 -1
  148. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js.map +1 -1
  149. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.ts +2 -2
  150. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js +5 -5
  151. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js.map +1 -1
  152. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js +1 -1
  153. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js.map +1 -1
  154. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.ts +5 -5
  155. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js +2 -2
  156. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js.map +1 -1
  157. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js +1 -1
  158. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js.map +1 -1
  159. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.ts +2 -2
  160. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js +2 -2
  161. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js.map +1 -1
  162. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js +1 -1
  163. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js.map +1 -1
  164. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.ts +2 -2
  165. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js +2 -2
  166. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js.map +1 -1
  167. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js +1 -1
  168. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js.map +1 -1
  169. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.ts +2 -2
  170. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js +2 -2
  171. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js.map +1 -1
  172. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js +1 -1
  173. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js.map +1 -1
  174. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.ts +2 -2
  175. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js +2 -2
  176. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js.map +1 -1
  177. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js +1 -1
  178. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js.map +1 -1
  179. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.ts +2 -2
  180. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js +2 -2
  181. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js.map +1 -1
  182. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js +1 -1
  183. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js.map +1 -1
  184. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.ts +2 -2
  185. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js +2 -2
  186. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js.map +1 -1
  187. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js +1 -1
  188. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js.map +1 -1
  189. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.ts +2 -2
  190. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js +2 -2
  191. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js.map +1 -1
  192. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js +1 -1
  193. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js.map +1 -1
  194. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.ts +2 -2
  195. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js +2 -2
  196. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js.map +1 -1
  197. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js +1 -1
  198. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js.map +1 -1
  199. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.ts +2 -2
  200. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin-dbg.js +2 -2
  201. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin-dbg.js.map +1 -1
  202. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.js +1 -1
  203. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.js.map +1 -1
  204. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.ts +2 -2
@@ -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","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","displayMode","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","stateManager","generatedContent","engine","activeModelName","parsedSchema","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","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","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","errors","validateAll","length","pushMessage","err","JSON","stringify","propertyPath","addCustomError","_addCustomError","clearCustomError","_clearCustomError","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty","propertyName","suppressInvalidate","handleInputDataHotSwap","currentVal","Control.prototype.setProperty.call","setBaseProperty","_setBaseProperty","_generate","internalPayload","rawSchema","inputData","inputDataJson","parse","e","error","finalData","normalizedSchema","normalize","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","getId","setModel","build","setAggregation","registerObject","mountCrashBoundary","openInDialog","_openInDialog","submitButtonText","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\";\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 displayMode: { type: \"boolean\", defaultValue: false }\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 }\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 as any);\n this.validationDelegate = new ValidationDelegate(this as any);\n this.dialogDelegate = new DialogDelegate(this as any);\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 * 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 if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor data was provided.\", \"GeneratorHost\");\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 const errors = this.engine.validateAll();\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 }\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 }\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 }\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 === \"displayMode\" || 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 * The core rendering pipeline.\n * Normalizes the schema, sets up the state manager, orchestrates the engine build,\n * and sets the generated UI components into the internal aggregation tree.\n */\n public generate(): void {\n try {\n this.tearDownGeneratedLayout();\n\n // CRITICAL FIX: Extract the unsaved internal payload BEFORE destroying the state manager\n // Otherwise, toggling displayMode (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 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 Logger.error(\"[MetaUI]\", \"Failed to parse inputDataJson string: \" + (e as Error).message, \"GeneratorHost\");\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Failed to parse inputData string: \" + (e as Error).message, \"GeneratorHost\");\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 const normalizedSchema = SchemaNormalizer.normalize(rawSchema, 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 this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n this.engine = new Engine(this.getProperty(\"displayMode\") as boolean);\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 this.setAggregation(\"_content\", this.generatedContent);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n } catch (error) {\n Logger.error(\"[MetaUI]\", \"Fatal crash during layout generation: \" + (error as Error).message, \"GeneratorHost\");\n this.validationDelegate.mountCrashBoundary(error as Error);\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\"): void {\n const isGenerated = !!this.generatedContent;\n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated);\n }\n}\n"],"mappings":";;;QAESA,MAAM,GAAAC,gBAAA;EAAA,MACNC,gBAAgB,GAAAC,yBAAA;EAAA,MAChBC,eAAe,GAAAC,wBAAA;EAAA,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ACR,KAAa,GAAG,MAAM,EAAES,gBAAwB,GAAG,IAAI,EAAQ;MAC/E,MAAMC,WAAW,GAAG,CAAC,CAAC,IAAI,CAACjG,gBAAgB;MAC3C,IAAI,CAACS,cAAc,CAACqF,YAAY,CAACP,KAAK,EAAES,gBAAgB,EAAEC,WAAW,CAAC;IAC1E;EAAC;EAAA,OA9YgBxJ,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","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","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","stateManager","generatedContent","engine","activeModelName","parsedSchema","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","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","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","errors","validateAll","length","pushMessage","err","JSON","stringify","propertyPath","addCustomError","_addCustomError","clearCustomError","_clearCustomError","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty","propertyName","suppressInvalidate","handleInputDataHotSwap","currentVal","Control.prototype.setProperty.call","setBaseProperty","_setBaseProperty","_generate","internalPayload","rawSchema","inputData","inputDataJson","parse","e","error","finalData","normalizedSchema","normalize","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","getId","setModel","build","setAggregation","registerObject","mountCrashBoundary","openInDialog","_openInDialog","submitButtonText","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\";\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 }\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 as any);\n this.validationDelegate = new ValidationDelegate(this as any);\n this.dialogDelegate = new DialogDelegate(this as any);\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 * 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 if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor data was provided.\", \"GeneratorHost\");\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 const errors = this.engine.validateAll();\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 }\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 }\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 }\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 * The core rendering pipeline.\n * Normalizes the schema, sets up the state manager, orchestrates the engine build,\n * and sets the generated UI components into the internal aggregation tree.\n */\n public generate(): 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 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 Logger.error(\"[MetaUI]\", \"Failed to parse inputDataJson string: \" + (e as Error).message, \"GeneratorHost\");\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Failed to parse inputData string: \" + (e as Error).message, \"GeneratorHost\");\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 const normalizedSchema = SchemaNormalizer.normalize(rawSchema, 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 this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n this.engine = new Engine(this.getProperty(\"editable\") as boolean);\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 this.setAggregation(\"_content\", this.generatedContent);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n } catch (error) {\n Logger.error(\"[MetaUI]\", \"Fatal crash during layout generation: \" + (error as Error).message, \"GeneratorHost\");\n this.validationDelegate.mountCrashBoundary(error as Error);\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\"): void {\n const isGenerated = !!this.generatedContent;\n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated);\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;EAGvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EARA,MASqBC,aAAa,GAASC,OAAO,CAAAC,MAAA;IAuDvCC,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,IAAID,OAAO,EAAE;UACTL,EAAE,CAACO,aAAa,CAACF,OAAO,CAAC;QAC7B;QAEAL,EAAE,CAACQ,KAAK,CAAC,KAAK,CAAC;MACnB;IACJ,CAAC;IA3DeC,QAAQ,EAAG;MACvBC,UAAU,EAAE;QACRC,gBAAgB,EAAE;UAAEC,IAAI,EAAE,KAAK;UAAEC,YAAY,EAAE;QAAK,CAAC;QACrDC,IAAI,EAAE;UAAEF,IAAI,EAAE,QAAQ;UAAEC,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ACnB,gBAAgB,CAACsB,cAAc,CAAChD,OAAO,CAAC;MAEjD,CAAC,CAAC,OAAOiG,KAAK,EAAE;QACZrJ,MAAM,CAACqJ,KAAK,CAAC,UAAU,EAAE,wCAAwC,GAAIA,KAAK,CAAWtF,OAAO,EAAE,eAAe,CAAC;QAC9G,IAAI,CAACgB,kBAAkB,CAACqF,kBAAkB,CAACf,KAAc,CAAC;MAC9D;IACJ,CAAC;IAED;AACJ;AACA;IACWgB,YAAY,WAAAC,cAACR,KAAa,GAAG,MAAM,EAAES,gBAAwB,GAAG,IAAI,EAAQ;MAC/E,MAAMC,WAAW,GAAG,CAAC,CAAC,IAAI,CAACjG,gBAAgB;MAC3C,IAAI,CAACS,cAAc,CAACqF,YAAY,CAACP,KAAK,EAAES,gBAAgB,EAAEC,WAAW,CAAC;IAC1E;EAAC;EAAA,OA9YgBxJ,aAAa;AAAA","ignoreList":[]}
@@ -59,7 +59,7 @@ declare module "nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost" {
59
59
  type: string;
60
60
  defaultValue: boolean;
61
61
  };
62
- displayMode: {
62
+ editable: {
63
63
  type: string;
64
64
  defaultValue: boolean;
65
65
  };
@@ -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"],function(e,t,a,i,n,s,r,o,l,d){"use strict";const g=t["Logger"];const h=a["SchemaNormalizer"];const u=i["SchemaValidator"];const c=n["Engine"];const p=s["StateManager"];const y=r["DataSyncDelegate"];const f=o["ValidationDelegate"];const M=l["DialogDelegate"];const m=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},displayMode:{type:"boolean",defaultValue:false}},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"}}}}},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},init:function t(){e.prototype.init.call(this);this.dataSyncDelegate=new y(this);this.validationDelegate=new f(this);this.dialogDelegate=new M(this);this.onInternalFieldChange=this.onInternalFieldChange.bind(this)},setDebugMode:function e(t){this.setProperty("debugMode",t,true);g.setDebugMode(t);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")){g.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")){g.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")){g.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 if(this.getProperty("debugMode")){g.debug("[MetaUI]","GeneratorHost skipped rendering. Neither 'schemaDefinition' nor data was provided.","GeneratorHost")}}},triggerSubmit:function e(){if(this.stateManager&&this.engine){let e=false;this.validationDelegate.removeAllMessages();const t=this.engine.validateAll();if(t.length>0){this.validationDelegate.pushMessage("","One or more fields failed schema validation. Please review the highlighted fields.");for(const e of t){if(e.fieldKey&&e.errorMessage){this.validationDelegate.pushMessage(e.fieldKey,e.errorMessage)}}return false}const a=this.stateManager.extractPayload();const i=JSON.stringify(a);this.fireEvent("beforeSubmit",{payload:a,preventDefault:()=>{e=true},addError:(t,a)=>{e=true;this.validationDelegate.pushMessage(t,a)}});if(e){return false}this.dataSyncDelegate.pushToBindings(a);this.fireEvent("submit",{payload:a,payloadJson:i});return true}return false},addCustomError:function e(t,a){this.validationDelegate.addCustomError(t,a)},clearCustomError:function e(t){this.validationDelegate.clearCustomError(t)},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==="displayMode"||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: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");let a=this.getProperty("data");const i=this.getProperty("dataJson");if(i){try{a=JSON.parse(i)}catch(e){g.error("[MetaUI]","Failed to parse inputDataJson string: "+e.message,"GeneratorHost")}}else if(typeof a==="string"){try{a=JSON.parse(a)}catch(e){g.error("[MetaUI]","Failed to parse inputData string: "+e.message,"GeneratorHost")}}const n=e||a||{};const s=h.normalize(t,n);this.parsedSchema=s;if(s){const e=u.validateSchemaStructure(s);if(e.length>0){const t="Schema Structural Errors Found:\n- "+e.join("\n- ");g.error("[MetaUI]",t,"GeneratorHost");if(this.getProperty("debugMode")){d.error(t,{title:"MetaUI Schema Error"});return}}}this.activeModelName="metaUI_"+this.getId();this.stateManager=new p(n,s,this.activeModelName);this.setModel(this.stateManager.getModel(),this.activeModelName);this.engine=new c(this.getProperty("displayMode"));this.generatedContent=this.engine.build(s,this.stateManager.getModel(),this.activeModelName,this.triggerSubmit.bind(this),this.getId(),this.onInternalFieldChange.bind(this));this.setAggregation("_content",this.generatedContent);this.validationDelegate.registerObject(this.generatedContent);const r=this.stateManager.extractPayload();this.dataSyncDelegate.pushToBindings(r)}catch(e){g.error("[MetaUI]","Fatal crash during layout generation: "+e.message,"GeneratorHost");this.validationDelegate.mountCrashBoundary(e)}},openInDialog:function e(t="Form",a="OK"){const i=!!this.generatedContent;this.dialogDelegate.openInDialog(t,a,i)}});return m});
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"],function(e,t,a,i,n,s,r,o,l,d){"use strict";const g=t["Logger"];const h=a["SchemaNormalizer"];const u=i["SchemaValidator"];const c=n["Engine"];const p=s["StateManager"];const f=r["DataSyncDelegate"];const y=o["ValidationDelegate"];const m=l["DialogDelegate"];const M=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"}}}}},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},init:function t(){e.prototype.init.call(this);this.dataSyncDelegate=new f(this);this.validationDelegate=new y(this);this.dialogDelegate=new m(this);this.onInternalFieldChange=this.onInternalFieldChange.bind(this)},setDebugMode:function e(t){this.setProperty("debugMode",t,true);g.setDebugMode(t);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")){g.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")){g.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")){g.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 if(this.getProperty("debugMode")){g.debug("[MetaUI]","GeneratorHost skipped rendering. Neither 'schemaDefinition' nor data was provided.","GeneratorHost")}}},triggerSubmit:function e(){if(this.stateManager&&this.engine){let e=false;this.validationDelegate.removeAllMessages();const t=this.engine.validateAll();if(t.length>0){this.validationDelegate.pushMessage("","One or more fields failed schema validation. Please review the highlighted fields.");for(const e of t){if(e.fieldKey&&e.errorMessage){this.validationDelegate.pushMessage(e.fieldKey,e.errorMessage)}}return false}const a=this.stateManager.extractPayload();const i=JSON.stringify(a);this.fireEvent("beforeSubmit",{payload:a,preventDefault:()=>{e=true},addError:(t,a)=>{e=true;this.validationDelegate.pushMessage(t,a)}});if(e){return false}this.dataSyncDelegate.pushToBindings(a);this.fireEvent("submit",{payload:a,payloadJson:i});return true}return false},addCustomError:function e(t,a){this.validationDelegate.addCustomError(t,a)},clearCustomError:function e(t){this.validationDelegate.clearCustomError(t)},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: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");let a=this.getProperty("data");const i=this.getProperty("dataJson");if(i){try{a=JSON.parse(i)}catch(e){g.error("[MetaUI]","Failed to parse inputDataJson string: "+e.message,"GeneratorHost")}}else if(typeof a==="string"){try{a=JSON.parse(a)}catch(e){g.error("[MetaUI]","Failed to parse inputData string: "+e.message,"GeneratorHost")}}const n=e||a||{};const s=h.normalize(t,n);this.parsedSchema=s;if(s){const e=u.validateSchemaStructure(s);if(e.length>0){const t="Schema Structural Errors Found:\n- "+e.join("\n- ");g.error("[MetaUI]",t,"GeneratorHost");if(this.getProperty("debugMode")){d.error(t,{title:"MetaUI Schema Error"});return}}}this.activeModelName="metaUI_"+this.getId();this.stateManager=new p(n,s,this.activeModelName);this.setModel(this.stateManager.getModel(),this.activeModelName);this.engine=new c(this.getProperty("editable"));this.generatedContent=this.engine.build(s,this.stateManager.getModel(),this.activeModelName,this.triggerSubmit.bind(this),this.getId(),this.onInternalFieldChange.bind(this));this.setAggregation("_content",this.generatedContent);this.validationDelegate.registerObject(this.generatedContent);const r=this.stateManager.extractPayload();this.dataSyncDelegate.pushToBindings(r)}catch(e){g.error("[MetaUI]","Fatal crash during layout generation: "+e.message,"GeneratorHost");this.validationDelegate.mountCrashBoundary(e)}},openInDialog:function e(t="Form",a="OK"){const i=!!this.generatedContent;this.dialogDelegate.openInDialog(t,a,i)}});return M});
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","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","displayMode","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","this","stateManager","generatedContent","engine","activeModelName","parsedSchema","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","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","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","errors","validateAll","length","pushMessage","err","JSON","stringify","propertyPath","addCustomError","_addCustomError","clearCustomError","_clearCustomError","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty","propertyName","suppressInvalidate","handleInputDataHotSwap","currentVal","Control.prototype.setProperty.call","setBaseProperty","_setBaseProperty","_generate","internalPayload","rawSchema","inputData","inputDataJson","parse","e","error","finalData","normalizedSchema","normalize","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","getId","setModel","build","setAggregation","registerObject","mountCrashBoundary","openInDialog","_openInDialog","submitButtonText","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\";\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 displayMode: { type: \"boolean\", defaultValue: false }\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 }\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 as any);\n this.validationDelegate = new ValidationDelegate(this as any);\n this.dialogDelegate = new DialogDelegate(this as any);\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 * 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 if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor data was provided.\", \"GeneratorHost\");\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 const errors = this.engine.validateAll();\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 }\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 }\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 }\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 === \"displayMode\" || 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 * The core rendering pipeline.\n * Normalizes the schema, sets up the state manager, orchestrates the engine build,\n * and sets the generated UI components into the internal aggregation tree.\n */\n public generate(): void {\n try {\n this.tearDownGeneratedLayout();\n\n // CRITICAL FIX: Extract the unsaved internal payload BEFORE destroying the state manager\n // Otherwise, toggling displayMode (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 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 Logger.error(\"[MetaUI]\", \"Failed to parse inputDataJson string: \" + (e as Error).message, \"GeneratorHost\");\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Failed to parse inputData string: \" + (e as Error).message, \"GeneratorHost\");\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 const normalizedSchema = SchemaNormalizer.normalize(rawSchema, 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 this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n this.engine = new Engine(this.getProperty(\"displayMode\") as boolean);\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 this.setAggregation(\"_content\", this.generatedContent);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n } catch (error) {\n Logger.error(\"[MetaUI]\", \"Fatal crash during layout generation: \" + (error as Error).message, \"GeneratorHost\");\n this.validationDelegate.mountCrashBoundary(error as Error);\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\"): void {\n const isGenerated = !!this.generatedContent;\n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated);\n }\n}\n"],"mappings":"qUAESA,EAAMC,EAAA,gBACNC,EAAgBC,EAAA,0BAChBC,EAAeC,EAAA,yBACfC,EAAMC,EAAA,gBACNC,EAAYC,EAAA,sBACZC,EAAgBC,EAAA,0BAChBC,EAAkBC,EAAA,4BAClBC,EAAcC,EAAA,kBAGvB,MASqBC,EAAsBC,EAAOC,OAAA,0DAuDvCC,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,GA1DYC,SAAW,CACvBC,WAAY,CACRC,iBAAkB,CAAEC,KAAM,MAAOC,aAAc,MAC/CC,KAAM,CAAEF,KAAM,SAAUC,aAAc,KAAME,SAAU,YACtDC,SAAU,CAAEJ,KAAM,SAAUC,aAAc,KAAME,SAAU,YAC1DE,WAAY,CAAEL,KAAM,UAAWC,aAAc,OAC7CK,QAAS,CAAEN,KAAM,UAAWC,aAAc,MAC1CM,kBAAmB,CAAEP,KAAM,UAAWC,aAAc,OACpDO,UAAW,CAAER,KAAM,SAAUC,aAAc,QAC3CQ,UAAW,CAAET,KAAM,UAAWC,aAAc,OAC5CS,YAAa,CAAEV,KAAM,UAAWC,aAAc,QAElDU,aAAc,CACVC,SAAU,CAAEZ,KAAM,sBAAuBa,SAAU,MAAOC,WAAY,WAE1EC,OAAQ,CACJC,aAAc,CACVC,WAA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.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","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","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","this","stateManager","generatedContent","engine","activeModelName","parsedSchema","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","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","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","errors","validateAll","length","pushMessage","err","JSON","stringify","propertyPath","addCustomError","_addCustomError","clearCustomError","_clearCustomError","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty","propertyName","suppressInvalidate","handleInputDataHotSwap","currentVal","Control.prototype.setProperty.call","setBaseProperty","_setBaseProperty","_generate","internalPayload","rawSchema","inputData","inputDataJson","parse","e","error","finalData","normalizedSchema","normalize","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","getId","setModel","build","setAggregation","registerObject","mountCrashBoundary","openInDialog","_openInDialog","submitButtonText","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\";\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 }\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 as any);\n this.validationDelegate = new ValidationDelegate(this as any);\n this.dialogDelegate = new DialogDelegate(this as any);\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 * 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 if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor data was provided.\", \"GeneratorHost\");\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 const errors = this.engine.validateAll();\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 }\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 }\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 }\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 * The core rendering pipeline.\n * Normalizes the schema, sets up the state manager, orchestrates the engine build,\n * and sets the generated UI components into the internal aggregation tree.\n */\n public generate(): 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 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 Logger.error(\"[MetaUI]\", \"Failed to parse inputDataJson string: \" + (e as Error).message, \"GeneratorHost\");\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Failed to parse inputData string: \" + (e as Error).message, \"GeneratorHost\");\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 const normalizedSchema = SchemaNormalizer.normalize(rawSchema, 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 this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n this.engine = new Engine(this.getProperty(\"editable\") as boolean);\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 this.setAggregation(\"_content\", this.generatedContent);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n } catch (error) {\n Logger.error(\"[MetaUI]\", \"Fatal crash during layout generation: \" + (error as Error).message, \"GeneratorHost\");\n this.validationDelegate.mountCrashBoundary(error as Error);\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\"): void {\n const isGenerated = !!this.generatedContent;\n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated);\n }\n}\n"],"mappings":"qUAESA,EAAMC,EAAA,gBACNC,EAAgBC,EAAA,0BAChBC,EAAeC,EAAA,yBACfC,EAAMC,EA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AU,CAAEG,MAAO,wBACpC,MACJ,CACJ,CACJ,CAEAzF,KAAKI,gBAAkB,UAAYJ,KAAK0F,QACxC1F,KAAKC,aAAe,IAAI/D,EAAa+I,EAAWC,EAAkBlF,KAAKI,iBACvEJ,KAAK2F,SAAS3F,KAAKC,aAAaoC,WAAYrC,KAAKI,iBAEjDJ,KAAKG,OAAS,IAAInE,EAAOgE,KAAK6B,YAAY,aAE1C7B,KAAKE,iBAAmBF,KAAKG,OAAOyF,MAChCV,EACAlF,KAAKC,aAAaoC,WAClBrC,KAAKI,gBACLJ,KAAK6C,cAAchC,KAAKb,MACxBA,KAAK0F,QACL1F,KAAKY,sBAAsBC,KAAKb,OAGpCA,KAAK6F,eAAe,WAAY7F,KAAKE,kBACrCF,KAAKU,mBAAmBoF,eAAe9F,KAAKE,kBAE5C,MAAMpB,EAAUkB,KAAKC,aAAa2B,iBAClC5B,KAAKS,iBAAiBsB,eAAejD,EAEzC,CAAE,MAAOkG,GACLtJ,EAAOsJ,MAAM,WAAY,yCAA4CA,EAAgBvF,QAAS,iBAC9FO,KAAKU,mBAAmBqF,mBAAmBf,EAC/C,CACJ,EAKOgB,aAAY,SAAAC,EAACR,EAAgB,OAAQS,EAA2B,MACnE,MAAMC,IAAgBnG,KAAKE,iBAC3BF,KAAKW,eAAeqF,aAAaP,EAAOS,EAAkBC,EAC9D,IAAC,OA9YgBzJ,CAAa","ignoreList":[]}
@@ -40,7 +40,7 @@ export default class GeneratorHost extends Control {
40
40
  useMessageManager: { type: "boolean", defaultValue: false },
41
41
  modelName: { type: "string", defaultValue: "meta" },
42
42
  debugMode: { type: "boolean", defaultValue: false },
43
- displayMode: { type: "boolean", defaultValue: false }
43
+ editable: { type: "boolean", defaultValue: true }
44
44
  },
45
45
  aggregations: {
46
46
  _content: { type: "sap.ui.core.Control", multiple: false, visibility: "hidden" }
@@ -301,7 +301,7 @@ export default class GeneratorHost extends Control {
301
301
  return this;
302
302
  }
303
303
 
304
- if (propertyName === "displayMode" || propertyName === "debugMode" || propertyName === "schemaDefinition") {
304
+ if (propertyName === "editable" || propertyName === "debugMode" || propertyName === "schemaDefinition") {
305
305
  const currentVal = this.getProperty(propertyName);
306
306
  if (currentVal !== value) {
307
307
  super.setProperty(propertyName, value, suppressInvalidate);
@@ -330,7 +330,7 @@ export default class GeneratorHost extends Control {
330
330
  this.tearDownGeneratedLayout();
331
331
 
332
332
  // CRITICAL FIX: Extract the unsaved internal payload BEFORE destroying the state manager
333
- // Otherwise, toggling displayMode (or other structural properties) will wipe user inputs!
333
+ // Otherwise, toggling editable (or other structural properties) will wipe user inputs!
334
334
  let internalPayload = null;
335
335
  if (this.stateManager) {
336
336
  internalPayload = this.stateManager.extractPayload();
@@ -388,7 +388,7 @@ export default class GeneratorHost extends Control {
388
388
  this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);
389
389
  this.setModel(this.stateManager.getModel(), this.activeModelName);
390
390
 
391
- this.engine = new Engine(this.getProperty("displayMode") as boolean);
391
+ this.engine = new Engine(this.getProperty("editable") as boolean);
392
392
 
393
393
  this.generatedContent = this.engine.build(
394
394
  normalizedSchema,
@@ -0,0 +1,122 @@
1
+ sap.ui.define(["../../../utils/Logger"], function (_____utils_Logger) {
2
+ "use strict";
3
+
4
+ const Logger = _____utils_Logger["Logger"];
5
+ /**
6
+ * Universal OData Delegate.
7
+ * Natively detects and manages two-way synchronization for both OData V2 and V4 contexts
8
+ * without requiring controller-level mappings.
9
+ */
10
+ class ODataDelegate {
11
+ odataType = null;
12
+ isSyncing = false;
13
+
14
+ /**
15
+ * Initializes a new instance of the ODataDelegate.
16
+ *
17
+ * @param {DynamicHost} host The parent MetaUI DynamicHost instance managing the UI generation.
18
+ * @param {Context} context The active UI5 Model Context bound to the host.
19
+ */
20
+ constructor(host, context) {
21
+ this.host = host;
22
+ this.context = context;
23
+ this.detectODataType();
24
+ }
25
+
26
+ /**
27
+ * Evaluates the underlying UI5 Model bound to the context to determine if it is an
28
+ * OData V2 or OData V4 model. This determination drives the synchronization strategy.
29
+ *
30
+ * @private
31
+ */
32
+ detectODataType() {
33
+ const model = this.context.getModel();
34
+ // sap.ui.model.odata.v4.ODataModel
35
+ // sap.ui.model.odata.v2.ODataModel
36
+ const sClassName = model.getMetadata().getName();
37
+ if (sClassName.indexOf("v4") > -1) {
38
+ this.odataType = "V4";
39
+ } else if (sClassName.indexOf("v2") > -1 || sClassName.indexOf("ODataModel") > -1) {
40
+ this.odataType = "V2";
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Extracts the full entity payload from the bound OData context and pushes it to the Engine.
46
+ * V4 uses an asynchronous requestObject(), while V2 retrieves it synchronously.
47
+ *
48
+ * @public
49
+ */
50
+ syncToEngine() {
51
+ if (!this.odataType) return;
52
+ if (this.odataType === "V4") {
53
+ // V4 uses async requestObject()
54
+ if (typeof this.context.requestObject === "function") {
55
+ this.context.requestObject().then(oData => {
56
+ this.pushPayload(oData);
57
+ }).catch(err => {
58
+ Logger.error("[MetaUI]", "Failed to extract V4 Context payload: " + err.message, "ODataDelegate");
59
+ });
60
+ }
61
+ } else if (this.odataType === "V2") {
62
+ // V2 uses sync getObject()
63
+ const oData = this.context.getObject();
64
+ if (oData) {
65
+ this.pushPayload(oData);
66
+ }
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Cleans the raw OData payload by stripping framework metadata properties (keys starting with '@' or '__')
72
+ * and pushes the sanitized business data into the MetaUI DynamicHost state manager.
73
+ *
74
+ * @param {any} oData The raw JSON object extracted from the OData model context.
75
+ * @private
76
+ */
77
+ pushPayload(oData) {
78
+ if (!oData) return;
79
+
80
+ // Remove OData metadata properties before pushing to MetaUI
81
+ const cleanData = {
82
+ ...oData
83
+ };
84
+ for (const key of Object.keys(cleanData)) {
85
+ if (key.startsWith("@") || key.startsWith("__")) {
86
+ delete cleanData[key];
87
+ }
88
+ }
89
+ this.isSyncing = true;
90
+ this.host.setProperty("data", cleanData);
91
+ this.isSyncing = false;
92
+ }
93
+
94
+ /**
95
+ * Intercepts a field change from the MetaUI Engine and translates it into an OData PATCH.
96
+ */
97
+ handleFieldChange(fieldPath, value) {
98
+ if (this.isSyncing || !this.odataType) return;
99
+ try {
100
+ if (this.odataType === "V4") {
101
+ // V4 sets property directly on context
102
+ this.context.setProperty(fieldPath, value);
103
+ } else if (this.odataType === "V2") {
104
+ // V2 sets property on model, specifying the context path
105
+ const model = this.context.getModel();
106
+ model.setProperty(fieldPath, value, this.context);
107
+ }
108
+ if (this.host.getProperty("debugMode")) {
109
+ Logger.debug("[MetaUI]", `ODataDelegate Patched ${fieldPath} = ${value} via ${this.odataType}`, "ODataDelegate");
110
+ }
111
+ } catch (e) {
112
+ Logger.error("[MetaUI]", `Failed to patch OData context: ${e.message}`, "ODataDelegate");
113
+ }
114
+ }
115
+ }
116
+ var __exports = {
117
+ __esModule: true
118
+ };
119
+ __exports.ODataDelegate = ODataDelegate;
120
+ return __exports;
121
+ });
122
+ //# sourceMappingURL=ODataDelegate-dbg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ODataDelegate-dbg.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","detectODataType","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","handleFieldChange","fieldPath","value","getProperty","debug","e","__exports","__esModule"],"sources":["ODataDelegate.ts"],"sourcesContent":["import { DynamicHost } from \"../DynamicHost\";\nimport Context from \"sap/ui/model/Context\";\nimport { Logger } from \"../../../utils/Logger\";\n\n/**\n * Universal OData Delegate.\n * Natively detects and manages two-way synchronization for both OData V2 and V4 contexts\n * without requiring controller-level mappings.\n */\nexport class ODataDelegate {\n private host: DynamicHost;\n private context: Context;\n private odataType: \"V2\" | \"V4\" | null = null;\n private isSyncing: boolean = false;\n\n /**\n * Initializes a new instance of the ODataDelegate.\n * \n * @param {DynamicHost} host The parent MetaUI DynamicHost instance managing the UI generation.\n * @param {Context} context The active UI5 Model Context bound to the host.\n */\n constructor(host: DynamicHost, context: Context) {\n this.host = host;\n this.context = context;\n this.detectODataType();\n }\n\n /**\n * Evaluates the underlying UI5 Model bound to the context to determine if it is an\n * OData V2 or OData V4 model. This determination drives the synchronization strategy.\n * \n * @private\n */\n private detectODataType(): void {\n const model = this.context.getModel();\n // sap.ui.model.odata.v4.ODataModel\n // sap.ui.model.odata.v2.ODataModel\n const sClassName = model.getMetadata().getName();\n if (sClassName.indexOf(\"v4\") > -1) {\n this.odataType = \"V4\";\n } else if (sClassName.indexOf(\"v2\") > -1 || sClassName.indexOf(\"ODataModel\") > -1) {\n this.odataType = \"V2\";\n }\n }\n\n /**\n * Extracts the full entity payload from the bound OData context and pushes it to the Engine.\n * V4 uses an asynchronous requestObject(), while V2 retrieves it synchronously.\n * \n * @public\n */\n public syncToEngine(): void {\n if (!this.odataType) return;\n\n if (this.odataType === \"V4\") {\n // V4 uses async requestObject()\n if (typeof (this.context as any).requestObject === \"function\") {\n (this.context as any).requestObject().then((oData: any) => {\n this.pushPayload(oData);\n }).catch((err: Error) => {\n Logger.error(\"[MetaUI]\", \"Failed to extract V4 Context payload: \" + err.message, \"ODataDelegate\");\n });\n }\n } else if (this.odataType === \"V2\") {\n // V2 uses sync getObject()\n const oData = this.context.getObject();\n if (oData) {\n this.pushPayload(oData);\n }\n }\n }\n\n /**\n * Cleans the raw OData payload by stripping framework metadata properties (keys starting with '@' or '__')\n * and pushes the sanitized business data into the MetaUI DynamicHost state manager.\n * \n * @param {any} oData The raw JSON object extracted from the OData model context.\n * @private\n */\n private pushPayload(oData: any): void {\n if (!oData) return;\n \n // Remove OData metadata properties before pushing to MetaUI\n const cleanData = { ...oData };\n for (const key of Object.keys(cleanData)) {\n if (key.startsWith(\"@\") || key.startsWith(\"__\")) {\n delete cleanData[key];\n }\n }\n\n this.isSyncing = true;\n this.host.setProperty(\"data\", cleanData);\n this.isSyncing = false;\n }\n\n /**\n * Intercepts a field change from the MetaUI Engine and translates it into an OData PATCH.\n */\n public handleFieldChange(fieldPath: string, value: any): void {\n if (this.isSyncing || !this.odataType) return;\n\n try {\n if (this.odataType === \"V4\") {\n // V4 sets property directly on context\n this.context.setProperty(fieldPath, value);\n } else if (this.odataType === \"V2\") {\n // V2 sets property on model, specifying the context path\n const model = this.context.getModel();\n model.setProperty(fieldPath, value, this.context);\n }\n if (this.host.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `ODataDelegate Patched ${fieldPath} = ${value} via ${this.odataType}`, \"ODataDelegate\");\n }\n } catch (e) {\n Logger.error(\"[MetaUI]\", `Failed to patch OData context: ${(e as Error).message}`, \"ODataDelegate\");\n }\n }\n}\n"],"mappings":";;;QAESA,MAAM,GAAAC,iBAAA;EAEf;AACA;AACA;AACA;AACA;EACO,MAAMC,aAAa,CAAC;IAGfC,SAAS,GAAuB,IAAI;IACpCC,SAAS,GAAY,KAAK;;IAElC;AACJ;AACA;AACA;AACA;AACA;IACIC,WAAWA,CAACC,IAAiB,EAAEC,OAAgB,EAAE;MAC7C,IAAI,CAACD,IAAI,GAAGA,IAAI;MAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;MACtB,IAAI,CAACC,eAAe,CAAC,CAAC;IAC1B;;IAEA;AACJ;AACA;AACA;AACA;AACA;IACYA,eAAeA,CAAA,EAAS;MAC5B,MAAMC,KAAK,GAAG,IAAI,CAACF,OAAO,CAACG,QAAQ,CAAC,CAAC;MACrC;MACA;MACA,MAAMC,UAAU,GAAGF,KAAK,CAACG,WAAW,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;MAChD,IAAIF,UAAU,CAACG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;QAC/B,IAAI,CAACX,SAAS,GAAG,IAAI;MACzB,CAAC,MAAM,IAAIQ,UAAU,CAACG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAIH,UAAU,CAACG,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE;Q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ACwB,WAAW,CAAC,MAAM,EAAEL,SAAS,CAAC;MACxC,IAAI,CAACrB,SAAS,GAAG,KAAK;IAC1B;;IAEA;AACJ;AACA;IACW2B,iBAAiBA,CAACC,SAAiB,EAAEC,KAAU,EAAQ;MAC1D,IAAI,IAAI,CAAC7B,SAAS,IAAI,CAAC,IAAI,CAACD,SAAS,EAAE;MAEvC,IAAI;QACA,IAAI,IAAI,CAACA,SAAS,KAAK,IAAI,EAAE;UACzB;UACA,IAAI,CAACI,OAAO,CAACuB,WAAW,CAACE,SAAS,EAAEC,KAAK,CAAC;QAC9C,CAAC,MAAM,IAAI,IAAI,CAAC9B,SAAS,KAAK,IAAI,EAAE;UAChC;UACA,MAAMM,KAAK,GAAG,IAAI,CAACF,OAAO,CAACG,QAAQ,CAAC,CAAC;UACrCD,KAAK,CAACqB,WAAW,CAACE,SAAS,EAAEC,KAAK,EAAE,IAAI,CAAC1B,OAAO,CAAC;QACrD;QACA,IAAI,IAAI,CAACD,IAAI,CAAC4B,WAAW,CAAC,WAAW,CAAC,EAAE;UACpClC,MAAM,CAACmC,KAAK,CAAC,UAAU,EAAE,yBAAyBH,SAAS,MAAMC,KAAK,QAAQ,IAAI,CAAC9B,SAAS,EAAE,EAAE,eAAe,CAAC;QACpH;MACJ,CAAC,CAAC,OAAOiC,CAAC,EAAE;QACRpC,MAAM,CAACsB,KAAK,CAAC,UAAU,EAAE,kCAAmCc,CAAC,CAAWb,OAAO,EAAE,EAAE,eAAe,CAAC;MACvG;IACJ;EACJ;EAAC,IAAAc,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAnC,aAAA,GAAAA,aAAA;EAAA,OAAAmC,SAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,49 @@
1
+ declare module "nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate" {
2
+ import { DynamicHost } from "nz/co/siliconst/ui5/metaui/controls/host/DynamicHost";
3
+ import Context from "sap/ui/model/Context";
4
+ /**
5
+ * Universal OData Delegate.
6
+ * Natively detects and manages two-way synchronization for both OData V2 and V4 contexts
7
+ * without requiring controller-level mappings.
8
+ */
9
+ export class ODataDelegate {
10
+ private host;
11
+ private context;
12
+ private odataType;
13
+ private isSyncing;
14
+ /**
15
+ * Initializes a new instance of the ODataDelegate.
16
+ *
17
+ * @param {DynamicHost} host The parent MetaUI DynamicHost instance managing the UI generation.
18
+ * @param {Context} context The active UI5 Model Context bound to the host.
19
+ */
20
+ constructor(host: DynamicHost, context: Context);
21
+ /**
22
+ * Evaluates the underlying UI5 Model bound to the context to determine if it is an
23
+ * OData V2 or OData V4 model. This determination drives the synchronization strategy.
24
+ *
25
+ * @private
26
+ */
27
+ private detectODataType;
28
+ /**
29
+ * Extracts the full entity payload from the bound OData context and pushes it to the Engine.
30
+ * V4 uses an asynchronous requestObject(), while V2 retrieves it synchronously.
31
+ *
32
+ * @public
33
+ */
34
+ syncToEngine(): void;
35
+ /**
36
+ * Cleans the raw OData payload by stripping framework metadata properties (keys starting with '@' or '__')
37
+ * and pushes the sanitized business data into the MetaUI DynamicHost state manager.
38
+ *
39
+ * @param {any} oData The raw JSON object extracted from the OData model context.
40
+ * @private
41
+ */
42
+ private pushPayload;
43
+ /**
44
+ * Intercepts a field change from the MetaUI Engine and translates it into an OData PATCH.
45
+ */
46
+ handleFieldChange(fieldPath: string, value: any): void;
47
+ }
48
+ }
49
+ //# sourceMappingURL=ODataDelegate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ODataDelegate.d.ts","sourceRoot":"../../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,kEAAkE,CAAC;IAClF,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;IACnF,OAAO,OAAO,MAAM,sBAAsB,CAAC;IAG3C;;;;OAIG;IACH,MAAa,aAAa;QACtB,OAAO,CAAC,IAAI,CAAc;QAC1B,OAAO,CAAC,OAAO,CAAU;QACzB,OAAO,CAAC,SAAS,CAA4B;QAC7C,OAAO,CAAC,SAAS,CAAkB;QAEnC;;;;;WAKG;oBACS,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO;QAM/C;;;;;WAKG;QACH,OAAO,CAAC,eAAe;QAYvB;;;;;WAKG;QACI,YAAY,IAAI,IAAI;QAqB3B;;;;;;WAMG;QACH,OAAO,CAAC,WAAW;QAgBnB;;WAEG;QACI,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;KAmBhE;CAEA"}
@@ -0,0 +1,2 @@
1
+ sap.ui.define(["../../../utils/Logger"],function(t){"use strict";const e=t["Logger"];class a{odataType=null;isSyncing=false;constructor(t,e){this.host=t;this.context=e;this.detectODataType()}detectODataType(){const t=this.context.getModel();const e=t.getMetadata().getName();if(e.indexOf("v4")>-1){this.odataType="V4"}else if(e.indexOf("v2")>-1||e.indexOf("ODataModel")>-1){this.odataType="V2"}}syncToEngine(){if(!this.odataType)return;if(this.odataType==="V4"){if(typeof this.context.requestObject==="function"){this.context.requestObject().then(t=>{this.pushPayload(t)}).catch(t=>{e.error("[MetaUI]","Failed to extract V4 Context payload: "+t.message,"ODataDelegate")})}}else if(this.odataType==="V2"){const t=this.context.getObject();if(t){this.pushPayload(t)}}}pushPayload(t){if(!t)return;const e={...t};for(const t of Object.keys(e)){if(t.startsWith("@")||t.startsWith("__")){delete e[t]}}this.isSyncing=true;this.host.setProperty("data",e);this.isSyncing=false}handleFieldChange(t,a){if(this.isSyncing||!this.odataType)return;try{if(this.odataType==="V4"){this.context.setProperty(t,a)}else if(this.odataType==="V2"){const e=this.context.getModel();e.setProperty(t,a,this.context)}if(this.host.getProperty("debugMode")){e.debug("[MetaUI]",`ODataDelegate Patched ${t} = ${a} via ${this.odataType}`,"ODataDelegate")}}catch(t){e.error("[MetaUI]",`Failed to patch OData context: ${t.message}`,"ODataDelegate")}}}var s={__esModule:true};s.ODataDelegate=a;return s});
2
+ //# sourceMappingURL=ODataDelegate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ODataDelegate.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","this","detectODataType","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","handleFieldChange","fieldPath","value","getProperty","debug","e","__exports","__esModule"],"sources":["ODataDelegate.ts"],"sourcesContent":["import { DynamicHost } from \"../DynamicHost\";\nimport Context from \"sap/ui/model/Context\";\nimport { Logger } from \"../../../utils/Logger\";\n\n/**\n * Universal OData Delegate.\n * Natively detects and manages two-way synchronization for both OData V2 and V4 contexts\n * without requiring controller-level mappings.\n */\nexport class ODataDelegate {\n private host: DynamicHost;\n private context: Context;\n private odataType: \"V2\" | \"V4\" | null = null;\n private isSyncing: boolean = false;\n\n /**\n * Initializes a new instance of the ODataDelegate.\n * \n * @param {DynamicHost} host The parent MetaUI DynamicHost instance managing the UI generation.\n * @param {Context} context The active UI5 Model Context bound to the host.\n */\n constructor(host: DynamicHost, context: Context) {\n this.host = host;\n this.context = context;\n this.detectODataType();\n }\n\n /**\n * Evaluates the underlying UI5 Model bound to the context to determine if it is an\n * OData V2 or OData V4 model. This determination drives the synchronization strategy.\n * \n * @private\n */\n private detectODataType(): void {\n const model = this.context.getModel();\n // sap.ui.model.odata.v4.ODataModel\n // sap.ui.model.odata.v2.ODataModel\n const sClassName = model.getMetadata().getName();\n if (sClassName.indexOf(\"v4\") > -1) {\n this.odataType = \"V4\";\n } else if (sClassName.indexOf(\"v2\") > -1 || sClassName.indexOf(\"ODataModel\") > -1) {\n this.odataType = \"V2\";\n }\n }\n\n /**\n * Extracts the full entity payload from the bound OData context and pushes it to the Engine.\n * V4 uses an asynchronous requestObject(), while V2 retrieves it synchronously.\n * \n * @public\n */\n public syncToEngine(): void {\n if (!this.odataType) return;\n\n if (this.odataType === \"V4\") {\n // V4 uses async requestObject()\n if (typeof (this.context as any).requestObject === \"function\") {\n (this.context as any).requestObject().then((oData: any) => {\n this.pushPayload(oData);\n }).catch((err: Error) => {\n Logger.error(\"[MetaUI]\", \"Failed to extract V4 Context payload: \" + err.message, \"ODataDelegate\");\n });\n }\n } else if (this.odataType === \"V2\") {\n // V2 uses sync getObject()\n const oData = this.context.getObject();\n if (oData) {\n this.pushPayload(oData);\n }\n }\n }\n\n /**\n * Cleans the raw OData payload by stripping framework metadata properties (keys starting with '@' or '__')\n * and pushes the sanitized business data into the MetaUI DynamicHost state manager.\n * \n * @param {any} oData The raw JSON object extracted from the OData model context.\n * @private\n */\n private pushPayload(oData: any): void {\n if (!oData) return;\n \n // Remove OData metadata properties before pushing to MetaUI\n const cleanData = { ...oData };\n for (const key of Object.keys(cleanData)) {\n if (key.startsWith(\"@\") || key.startsWith(\"__\")) {\n delete cleanData[key];\n }\n }\n\n this.isSyncing = true;\n this.host.setProperty(\"data\", cleanData);\n this.isSyncing = false;\n }\n\n /**\n * Intercepts a field change from the MetaUI Engine and translates it into an OData PATCH.\n */\n public handleFieldChange(fieldPath: string, value: any): void {\n if (this.isSyncing || !this.odataType) return;\n\n try {\n if (this.odataType === \"V4\") {\n // V4 sets property directly on context\n this.context.setProperty(fieldPath, value);\n } else if (this.odataType === \"V2\") {\n // V2 sets property on model, specifying the context path\n const model = this.context.getModel();\n model.setProperty(fieldPath, value, this.context);\n }\n if (this.host.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `ODataDelegate Patched ${fieldPath} = ${value} via ${this.odataType}`, \"ODataDelegate\");\n }\n } catch (e) {\n Logger.error(\"[MetaUI]\", `Failed to patch OData context: ${(e as Error).message}`, \"ODataDelegate\");\n }\n }\n}\n"],"mappings":"uEAESA,EAAMC,EAAA,UAOR,MAAMC,EAGDC,UAAgC,KAChCC,UAAqB,MAQ7BC,YAAYC,EAAmBC,GAC3BC,KAAKF,KAAOA,EACZE,KAAKD,QAAUA,EACfC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