@siliconst/metaui 1.4.21 → 1.4.34

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 (338) hide show
  1. package/package.json +1 -1
  2. package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants-dbg.js +51 -0
  3. package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants-dbg.js.map +1 -0
  4. package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.d.ts +41 -0
  5. package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.d.ts.map +1 -0
  6. package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.js +2 -0
  7. package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.js.map +1 -0
  8. package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.ts +44 -0
  9. package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControl-dbg.js.map +1 -1
  10. package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControl.js.map +1 -1
  11. package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControl.ts +1 -1
  12. package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControlRenderer-dbg.js.map +1 -1
  13. package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControlRenderer.d.ts.map +1 -1
  14. package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControlRenderer.js.map +1 -1
  15. package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControlRenderer.ts +2 -1
  16. package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl-dbg.js +2 -2
  17. package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl-dbg.js.map +1 -1
  18. package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl.js +1 -1
  19. package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl.js.map +1 -1
  20. package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl.ts +3 -3
  21. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +5 -1
  22. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js.map +1 -1
  23. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts +6 -2
  24. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
  25. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
  26. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
  27. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +10 -9
  28. package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl-dbg.js +0 -9
  29. package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl-dbg.js.map +1 -1
  30. package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.d.ts +0 -9
  31. package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.d.ts.map +1 -1
  32. package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.js +1 -1
  33. package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.js.map +1 -1
  34. package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.ts +3 -9
  35. package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl-dbg.js +0 -11
  36. package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl-dbg.js.map +1 -1
  37. package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.d.ts +0 -11
  38. package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.d.ts.map +1 -1
  39. package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.js +1 -1
  40. package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.js.map +1 -1
  41. package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.ts +2 -9
  42. package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl-dbg.js +2 -7
  43. package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl-dbg.js.map +1 -1
  44. package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.d.ts +0 -5
  45. package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.d.ts.map +1 -1
  46. package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.js +1 -1
  47. package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.js.map +1 -1
  48. package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.ts +3 -7
  49. package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl-dbg.js +1 -6
  50. package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl-dbg.js.map +1 -1
  51. package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.d.ts +0 -5
  52. package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.d.ts.map +1 -1
  53. package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.js +1 -1
  54. package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.js.map +1 -1
  55. package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.ts +9 -12
  56. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +51 -12
  57. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js.map +1 -1
  58. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts +13 -0
  59. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts.map +1 -1
  60. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
  61. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
  62. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +53 -14
  63. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate-dbg.js +2 -2
  64. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate-dbg.js.map +1 -1
  65. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.d.ts +1 -1
  66. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.d.ts.map +1 -1
  67. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.js +1 -1
  68. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.js.map +1 -1
  69. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.ts +3 -3
  70. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate-dbg.js.map +1 -1
  71. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.d.ts +1 -1
  72. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.d.ts.map +1 -1
  73. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.js.map +1 -1
  74. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.ts +8 -7
  75. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js.map +1 -1
  76. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.d.ts +1 -1
  77. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.d.ts.map +1 -1
  78. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js.map +1 -1
  79. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts +3 -3
  80. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js.map +1 -1
  81. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js.map +1 -1
  82. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.ts +4 -4
  83. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +3 -4
  84. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
  85. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +1 -1
  86. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
  87. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +1 -1
  88. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
  89. package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +6 -7
  90. package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator-dbg.js +84 -0
  91. package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator-dbg.js.map +1 -0
  92. package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.d.ts +16 -0
  93. package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.d.ts.map +1 -0
  94. package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.js +2 -0
  95. package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.js.map +1 -0
  96. package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.ts +80 -0
  97. package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer-dbg.js +137 -0
  98. package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer-dbg.js.map +1 -0
  99. package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.d.ts +24 -0
  100. package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.d.ts.map +1 -0
  101. package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.js +2 -0
  102. package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.js.map +1 -0
  103. package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.ts +141 -0
  104. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +26 -0
  105. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -1
  106. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts +2 -0
  107. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -1
  108. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +1 -1
  109. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -1
  110. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts +29 -1
  111. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +1 -1
  112. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -1
  113. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +4 -4
  114. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -1
  115. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +1 -1
  116. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -1
  117. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts +11 -11
  118. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -1
  119. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -1
  120. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +1 -1
  121. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
  122. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +4 -1
  123. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
  124. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +5 -1
  125. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +5 -5
  126. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -1
  127. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -1
  128. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +1 -1
  129. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -1
  130. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +4 -4
  131. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +7 -5
  132. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -1
  133. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -1
  134. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +1 -1
  135. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -1
  136. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +11 -7
  137. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +40 -37
  138. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  139. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory-dbg.js.map +1 -1
  140. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory.d.ts +1 -1
  141. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory.d.ts.map +1 -1
  142. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory.js.map +1 -1
  143. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory.ts +1 -1
  144. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver-dbg.js.map +1 -1
  145. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver.d.ts +1 -1
  146. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver.d.ts.map +1 -1
  147. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver.js.map +1 -1
  148. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver.ts +1 -1
  149. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper-dbg.js.map +1 -1
  150. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper.d.ts +1 -1
  151. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper.d.ts.map +1 -1
  152. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper.js.map +1 -1
  153. package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper.ts +1 -1
  154. package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/OpenApiHeuristicEngine-dbg.js +2 -2
  155. package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/OpenApiHeuristicEngine-dbg.js.map +1 -1
  156. package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/OpenApiHeuristicEngine.js.map +1 -1
  157. package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/OpenApiHeuristicEngine.ts +2 -2
  158. package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic-dbg.js.map +1 -1
  159. package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic.d.ts +1 -1
  160. package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic.d.ts.map +1 -1
  161. package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic.js.map +1 -1
  162. package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic.ts +3 -3
  163. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser-dbg.js.map +1 -1
  164. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser.d.ts +1 -1
  165. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser.d.ts.map +1 -1
  166. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser.js.map +1 -1
  167. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser.ts +1 -1
  168. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser-dbg.js.map +1 -1
  169. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser.d.ts +1 -1
  170. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser.d.ts.map +1 -1
  171. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser.js.map +1 -1
  172. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser.ts +1 -1
  173. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper-dbg.js +1 -1
  174. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper-dbg.js.map +1 -1
  175. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper.d.ts +4 -4
  176. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper.d.ts.map +1 -1
  177. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper.js.map +1 -1
  178. package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper.ts +19 -19
  179. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin-dbg.js.map +1 -1
  180. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin.d.ts.map +1 -1
  181. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin.js.map +1 -1
  182. package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin.ts +2 -1
  183. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js +18 -15
  184. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js.map +1 -1
  185. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.d.ts.map +1 -1
  186. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js +1 -1
  187. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js.map +1 -1
  188. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.ts +18 -18
  189. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js +1 -1
  190. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js.map +1 -1
  191. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js +1 -1
  192. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js.map +1 -1
  193. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.ts +2 -2
  194. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
  195. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts +1 -6
  196. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
  197. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
  198. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +2 -2
  199. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js.map +1 -1
  200. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js.map +1 -1
  201. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts +1 -1
  202. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js +2 -2
  203. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js.map +1 -1
  204. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js +1 -1
  205. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js.map +1 -1
  206. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.ts +2 -2
  207. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js +4 -4
  208. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js.map +1 -1
  209. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js +1 -1
  210. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js.map +1 -1
  211. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.ts +4 -4
  212. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js +1 -1
  213. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js.map +1 -1
  214. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js +1 -1
  215. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js.map +1 -1
  216. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts +2 -2
  217. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js +1 -1
  218. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js.map +1 -1
  219. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js +1 -1
  220. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js.map +1 -1
  221. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts +2 -2
  222. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js.map +1 -1
  223. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js.map +1 -1
  224. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.ts +1 -1
  225. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin-dbg.js +1 -1
  226. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin-dbg.js.map +1 -1
  227. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin.js +1 -1
  228. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin.js.map +1 -1
  229. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin.ts +1 -1
  230. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js +1 -1
  231. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js.map +1 -1
  232. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js +1 -1
  233. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js.map +1 -1
  234. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.ts +2 -2
  235. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js +2 -2
  236. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js.map +1 -1
  237. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js +1 -1
  238. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js.map +1 -1
  239. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.ts +2 -2
  240. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin-dbg.js +1 -1
  241. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin-dbg.js.map +1 -1
  242. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin.js +1 -1
  243. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin.js.map +1 -1
  244. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin.ts +1 -1
  245. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js +1 -1
  246. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js.map +1 -1
  247. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js +1 -1
  248. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js.map +1 -1
  249. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.ts +3 -3
  250. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js +3 -3
  251. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js.map +1 -1
  252. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js +1 -1
  253. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js.map +1 -1
  254. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.ts +4 -4
  255. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js +5 -4
  256. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js.map +1 -1
  257. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.d.ts.map +1 -1
  258. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js +1 -1
  259. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js.map +1 -1
  260. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.ts +7 -6
  261. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin-dbg.js +1 -1
  262. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin-dbg.js.map +1 -1
  263. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin.js +1 -1
  264. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin.js.map +1 -1
  265. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin.ts +1 -1
  266. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js +1 -1
  267. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js.map +1 -1
  268. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js +1 -1
  269. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js.map +1 -1
  270. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.ts +2 -2
  271. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin-dbg.js +3 -2
  272. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin-dbg.js.map +1 -1
  273. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin.d.ts.map +1 -1
  274. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin.js +1 -1
  275. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin.js.map +1 -1
  276. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin.ts +3 -2
  277. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js +2 -2
  278. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js.map +1 -1
  279. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js +1 -1
  280. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js.map +1 -1
  281. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.ts +2 -2
  282. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js +2 -2
  283. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js.map +1 -1
  284. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js +1 -1
  285. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js.map +1 -1
  286. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.ts +2 -2
  287. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js +1 -1
  288. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js.map +1 -1
  289. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js +1 -1
  290. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js.map +1 -1
  291. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.ts +1 -1
  292. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js +1 -1
  293. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js.map +1 -1
  294. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js +1 -1
  295. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js.map +1 -1
  296. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.ts +2 -2
  297. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js +1 -1
  298. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js.map +1 -1
  299. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js +1 -1
  300. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js.map +1 -1
  301. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.ts +1 -1
  302. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js +2 -2
  303. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js.map +1 -1
  304. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js +1 -1
  305. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js.map +1 -1
  306. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.ts +2 -2
  307. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js +1 -1
  308. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js.map +1 -1
  309. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js +1 -1
  310. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js.map +1 -1
  311. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.ts +1 -1
  312. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js +2 -2
  313. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js.map +1 -1
  314. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js +1 -1
  315. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js.map +1 -1
  316. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.ts +2 -2
  317. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin-dbg.js.map +1 -1
  318. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin.d.ts.map +1 -1
  319. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin.js.map +1 -1
  320. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin.ts +109 -108
  321. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin-dbg.js.map +1 -1
  322. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin.d.ts.map +1 -1
  323. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin.js.map +1 -1
  324. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin.ts +64 -63
  325. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin-dbg.js +1 -1
  326. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin-dbg.js.map +1 -1
  327. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.d.ts +1 -1
  328. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.d.ts.map +1 -1
  329. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.js.map +1 -1
  330. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.ts +118 -117
  331. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin-dbg.js.map +1 -1
  332. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin.d.ts.map +1 -1
  333. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin.js.map +1 -1
  334. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin.ts +105 -104
  335. package/src/nz/co/siliconst/ui5/metaui/utils/Logger-dbg.js.map +1 -1
  336. package/src/nz/co/siliconst/ui5/metaui/utils/Logger.d.ts.map +1 -1
  337. package/src/nz/co/siliconst/ui5/metaui/utils/Logger.js.map +1 -1
  338. package/src/nz/co/siliconst/ui5/metaui/utils/Logger.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import deepEqual from "sap/base/util/deepEqual";
2
- import extend from "sap/base/util/extend";
2
+ import deepExtend from "sap/base/util/deepExtend";
3
3
  import { Logger } from "../../../utils/Logger";
4
4
  import { SchemaNormalizer } from "../../../core/SchemaNormalizer";
5
5
  import PropertyBinding from "sap/ui/model/PropertyBinding";
@@ -87,7 +87,7 @@ export class DataSyncDelegate {
87
87
  return;
88
88
  }
89
89
 
90
- this._lastReceivedInputObj = extend(true, {}, incomingObj) as Record<string, unknown>;
90
+ this._lastReceivedInputObj = deepExtend({}, incomingObj) as Record<string, unknown>;
91
91
 
92
92
  if (this.host.getProperty("debugMode")) {
93
93
  Logger.debug("[MetaUI]", `Accepted external injection for ${propertyName}`, "DataSyncDelegate");
@@ -126,7 +126,7 @@ export class DataSyncDelegate {
126
126
  * @param schema The MetaUI ISchema tree.
127
127
  * @param rootData The data payload to mutate.
128
128
  */
129
- public injectSchemaDefaults(schema: unknown, rootData: unknown, depth: number = 0): void {
129
+ public injectSchemaDefaults(schema: any, rootData: any, depth: number = 0): void {
130
130
  if (!schema || !rootData || typeof rootData !== "object" || depth > 8) return;
131
131
 
132
132
  if (schema.type === "object" && schema.properties) {
@@ -1 +1 @@
1
- {"version":3,"file":"ODataDelegate-dbg.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","detectODataType","attachEvent","onFieldChange","oEvent","params","getParameters","fieldPath","value","undefined","handleFieldChange","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","getProperty","debug","e","__exports","__esModule"],"sources":["ODataDelegate.ts"],"sourcesContent":["import { DynamicHost } from \"../DynamicHost\";\nimport { Logger } from \"../../../utils/Logger\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport Context from \"sap/ui/model/Context\";\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: ODataV4Context | 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: ODataV4Context | Context) {\n this.host = host;\n this.context = context;\n this.detectODataType();\n \n // Natively subscribe to the host's field changes to decouple from DynamicHost internals\n this.host.attachEvent(\"fieldChange\", this.onFieldChange, this);\n }\n\n /**\n * Event listener wrapper for field changes emitted by the host.\n */\n private onFieldChange(oEvent: sap.ui.base.Event): void {\n const params = oEvent.getParameters();\n if (params.fieldPath && params.value !== undefined) {\n this.handleFieldChange(params.fieldPath, params.value);\n }\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.requestObject === \"function\") {\n this.context.requestObject().then((oData: unknown) => {\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 {unknown} oData The raw JSON object extracted from the OData model context.\n * @private\n */\n private pushPayload(oData: unknown): void {\n if (!oData) return;\n \n // Remove OData metadata properties before pushing to MetaUI\n const cleanData = { ...(oData as Record<string, unknown>) };\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: unknown): 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":";;;QACSA,MAAM,GAAAC,iBAAA;EAIf;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,OAAiC,EAAE;MAC9D,IAAI,CAACD,IAAI,GAAGA,IAAI;MAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;MACtB,IAAI,CAACC,eAAe,CAAC,CAAC;;MAEtB;MACA,IAAI,CAACF,IAAI,CAACG,WAAW,CAAC,aAAa,EAAE,IAAI,CAACC,aAAa,EAAE,IAAI,CAAC;IAClE;;IAEA;AACJ;AACA;IACYA,aAAaA,CAACC,MAAyB,EAAQ;MACnD,MAAMC,MAAM,GAAGD,MAAM,CAACE,aAAa,CAAC,CAAC;MACrC,IAAID,MAAM,CAACE,SAAS,IAAIF,MAAM,CAACG,KAAK,KAAKC,SAAS,EAAE;QAChD,IAAI,CAACC,iBAAiB,CAACL,MAAM,CAACE,SAAS,EAAEF,MAAM,CAACG,KAAK,CAAC;MAC1D;IACJ;;IAEA;AACJ;AACA;AACA;AACA;AACA;IACYP,eAAeA,CAAA,EAAS;MAC5B,MAAMU,KAAK,GAAG,IAAI,CAACX,OAAO,CAACY,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,CA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AAA,OAAAyC,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"ODataDelegate-dbg.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","detectODataType","attachEvent","onFieldChange","oEvent","params","getParameters","fieldPath","value","undefined","handleFieldChange","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","getProperty","debug","e","__exports","__esModule"],"sources":["ODataDelegate.ts"],"sourcesContent":["import DynamicHost from \"../../DynamicHost\";\nimport { Logger } from \"../../../utils/Logger\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport Context from \"sap/ui/model/Context\";\n\nimport Event from \"sap/ui/base/Event\";\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: ODataV4Context | 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: ODataV4Context | Context) {\n this.host = host;\n this.context = context;\n this.detectODataType();\n \n // Natively subscribe to the host's field changes to decouple from DynamicHost internals\n this.host.attachEvent(\"fieldChange\", this.onFieldChange, this);\n }\n\n /**\n * Event listener wrapper for field changes emitted by the host.\n */\n private onFieldChange(oEvent: Event): void {\n const params = oEvent.getParameters() as any;\n if (params.fieldPath && params.value !== undefined) {\n this.handleFieldChange(params.fieldPath, params.value);\n }\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: unknown) => {\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 {unknown} oData The raw JSON object extracted from the OData model context.\n * @private\n */\n private pushPayload(oData: unknown): void {\n if (!oData) return;\n \n // Remove OData metadata properties before pushing to MetaUI\n const cleanData = { ...(oData as Record<string, unknown>) };\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: unknown): 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 as any).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 as any).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":";;;QACSA,MAAM,GAAAC,iBAAA;EAKf;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,OAAiC,EAAE;MAC9D,IAAI,CAACD,IAAI,GAAGA,IAAI;MAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;MACtB,IAAI,CAACC,eAAe,CAAC,CAAC;;MAEtB;MACA,IAAI,CAACF,IAAI,CAACG,WAAW,CAAC,aAAa,EAAE,IAAI,CAACC,aAAa,EAAE,IAAI,CAAC;IAClE;;IAEA;AACJ;AACA;IACYA,aAAaA,CAACC,MAAa,EAAQ;MACvC,MAAMC,MAAM,GAAGD,MAAM,CAACE,aAAa,CAAC,CAAQ;MAC5C,IAAID,MAAM,CAACE,SAAS,IAAIF,MAAM,CAACG,KAAK,KAAKC,SAAS,EAAE;QAChD,IAAI,CAACC,iBAAiB,CAACL,MAAM,CAACE,SAAS,EAAEF,MAAM,CAACG,KAAK,CAAC;MAC1D;IACJ;;IAEA;AACJ;AACA;AACA;AACA;AACA;IACYP,eAAeA,CAAA,EAAS;MAC5B,MAAMU,KAAK,GAAG,IAAI,CAACX,OAAO,CAACY,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,CAACpB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":[]}
@@ -1,5 +1,5 @@
1
1
  declare module "nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate" {
2
- import { DynamicHost } from "nz/co/siliconst/ui5/metaui/controls/host/DynamicHost";
2
+ import DynamicHost from "nz/co/siliconst/ui5/metaui/controls/DynamicHost";
3
3
  import ODataV4Context from "sap/ui/model/odata/v4/Context";
4
4
  import Context from "sap/ui/model/Context";
5
5
  /**
@@ -1 +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;IAEnF,OAAO,cAAc,MAAM,+BAA+B,CAAC;IAC3D,OAAO,OAAO,MAAM,sBAAsB,CAAC;IAE3C;;;;OAIG;IACH,MAAa,aAAa;QACtB,OAAO,CAAC,IAAI,CAAc;QAC1B,OAAO,CAAC,OAAO,CAA2B;QAC1C,OAAO,CAAC,SAAS,CAA4B;QAC7C,OAAO,CAAC,SAAS,CAAkB;QAEnC;;;;;WAKG;oBACS,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO;QAShE;;WAEG;QACH,OAAO,CAAC,aAAa;QAOrB;;;;;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,OAAO,GAAG,IAAI;KAmBpE;CAEA"}
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,WAAW,MAAM,iDAAiD,CAAC;IAE1E,OAAO,cAAc,MAAM,+BAA+B,CAAC;IAC3D,OAAO,OAAO,MAAM,sBAAsB,CAAC;IAG3C;;;;OAIG;IACH,MAAa,aAAa;QACtB,OAAO,CAAC,IAAI,CAAc;QAC1B,OAAO,CAAC,OAAO,CAA2B;QAC1C,OAAO,CAAC,SAAS,CAA4B;QAC7C,OAAO,CAAC,SAAS,CAAkB;QAEnC;;;;;WAKG;oBACS,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO;QAShE;;WAEG;QACH,OAAO,CAAC,aAAa;QAOrB;;;;;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,OAAO,GAAG,IAAI;KAmBpE;CAEA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ODataDelegate.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","this","detectODataType","attachEvent","onFieldChange","oEvent","params","getParameters","fieldPath","value","undefined","handleFieldChange","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","getProperty","debug","e","__exports","__esModule"],"sources":["ODataDelegate.ts"],"sourcesContent":["import { DynamicHost } from \"../DynamicHost\";\nimport { Logger } from \"../../../utils/Logger\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport Context from \"sap/ui/model/Context\";\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: ODataV4Context | 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: ODataV4Context | Context) {\n this.host = host;\n this.context = context;\n this.detectODataType();\n \n // Natively subscribe to the host's field changes to decouple from DynamicHost internals\n this.host.attachEvent(\"fieldChange\", this.onFieldChange, this);\n }\n\n /**\n * Event listener wrapper for field changes emitted by the host.\n */\n private onFieldChange(oEvent: sap.ui.base.Event): void {\n const params = oEvent.getParameters();\n if (params.fieldPath && params.value !== undefined) {\n this.handleFieldChange(params.fieldPath, params.value);\n }\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.requestObject === \"function\") {\n this.context.requestObject().then((oData: unknown) => {\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 {unknown} oData The raw JSON object extracted from the OData model context.\n * @private\n */\n private pushPayload(oData: unknown): void {\n if (!oData) return;\n \n // Remove OData metadata properties before pushing to MetaUI\n const cleanData = { ...(oData as Record<string, unknown>) };\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: unknown): 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":"uEACSA,EAAMC,EAAA,UASR,MAAMC,EAGDC,UAAgC,KAChCC,UAAqB,MAQ7BC,YAAYC,EAAmBC,GAC3BC,KAAKF,KAAOA,EACZE,KAAKD,QAAUA,EACfC,KAAKC,kBAGLD,KAAKF,KAAKI,YAAY,cAAeF,KAAKG,cAAeH,KAC7D,CAKQG,cAAcC,GAClB,MAAMC,EAASD,EAAOE,gBACtB,GAAID,EAAOE,WAAaF,EAAOG,QAAUC,UAAW,CAChDT,KAAKU,kBAAkBL,EAAOE,UAAWF,EAAOG,MACpD,CACJ,CAQQP,kBACJ,MAAMU,EAAQX,KAAKD,QAAQa,WAG3B,MAAMC,EAAaF,EAAMG,cAAcC,UACvC,GAAIF,EAAWG,QAAQ,OA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EAAOgC,MAAM,WAAY,kCAAmCW,EAAYV,UAAW,gBACvF,CACJ,EACH,IAAAW,EAAA,CAAAC,WAAA,MAAAD,EAAA1C,gBAAA,OAAA0C,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"ODataDelegate.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","this","detectODataType","attachEvent","onFieldChange","oEvent","params","getParameters","fieldPath","value","undefined","handleFieldChange","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","getProperty","debug","e","__exports","__esModule"],"sources":["ODataDelegate.ts"],"sourcesContent":["import DynamicHost from \"../../DynamicHost\";\nimport { Logger } from \"../../../utils/Logger\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport Context from \"sap/ui/model/Context\";\n\nimport Event from \"sap/ui/base/Event\";\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: ODataV4Context | 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: ODataV4Context | Context) {\n this.host = host;\n this.context = context;\n this.detectODataType();\n \n // Natively subscribe to the host's field changes to decouple from DynamicHost internals\n this.host.attachEvent(\"fieldChange\", this.onFieldChange, this);\n }\n\n /**\n * Event listener wrapper for field changes emitted by the host.\n */\n private onFieldChange(oEvent: Event): void {\n const params = oEvent.getParameters() as any;\n if (params.fieldPath && params.value !== undefined) {\n this.handleFieldChange(params.fieldPath, params.value);\n }\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: unknown) => {\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 {unknown} oData The raw JSON object extracted from the OData model context.\n * @private\n */\n private pushPayload(oData: unknown): void {\n if (!oData) return;\n \n // Remove OData metadata properties before pushing to MetaUI\n const cleanData = { ...(oData as Record<string, unknown>) };\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: unknown): 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 as any).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 as any).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":"uEACSA,EAAMC,EAAA,UAUR,MAAMC,EAGDC,UAAgC,KAChCC,UAAqB,MAQ7BC,YAAYC,EAAmBC,GAC3BC,KAAKF,KAAOA,EACZE,KAAKD,QAAUA,EACfC,KAAKC,kBAGLD,KAAKF,KAAKI,YAAY,cAAeF,KAAKG,cAAeH,KAC7D,CAKQG,cAAcC,GAClB,MAAMC,EAASD,EAAOE,gBACtB,GAAID,EAAOE,WAAaF,EAAOG,QAAUC,UAAW,CAChDT,KAAKU,kBAAkBL,EAAOE,UAAWF,EAAOG,MACpD,CACJ,CAQQP,kBACJ,MAAMU,EAAQX,KAAKD,QAAQa,WAG3B,MAAMC,EAAaF,EAAMG,cAAcC,UACvC,GAAIF,EAAWG,QAAQ,OAAS,EAAG,CAC/BhB,KAAKL,UAAY,IACrB,MAAO,GAAIkB,EAAWG,QAAQ,OAAS,GAAKH,EAAWG,QAAQ,eAAiB,EAAG,CAC/EhB,KAAKL,UAAY,IACrB,CACJ,CAQOsB,eACH,IAAKjB,KAAKL,UAAW,OAErB,GAAIK,KAAKL,YAAc,KAAM,CAEzB,UAAYK,KAAKD,QAAgBmB,gBAAkB,WAAY,CAC1DlB,KAAKD,QAAgBmB,gBAAgBC,KAAMC,IACxCpB,KAAKqB,YAAYD,KAClBE,MAAOC,IACN/B,EAAOgC,MAAM,WAAY,yCAA2CD,EAAIE,QAAS,kBAEzF,CACJ,MAAO,GAAIzB,KAAKL,YAAc,KAAM,CAEhC,MAAMyB,EAAQpB,KAAKD,QAAQ2B,YAC3B,GAAIN,EAAO,CACPpB,KAAKqB,YAAYD,EACrB,CACJ,CACJ,CASQC,YAAYD,GAChB,IAAKA,EAAO,OAGZ,MAAMO,EAAY,IAAMP,GACxB,IAAK,MAAMQ,KAAOC,OAAOC,KAAKH,GAAY,CACtC,GAAIC,EAAIG,WAAW,MAAQH,EAAIG,WAAW,MAAO,QACtCJ,EAAUC,EACrB,CACJ,CAEA5B,KAAKJ,UAAY,KACjBI,KAAKF,KAAKkC,YAAY,OAAQL,GAC9B3B,KAAKJ,UAAY,KACrB,CAKOc,kBAAkBH,EAAmBC,GACxC,GAAIR,KAAKJ,YAAcI,KAAKL,UAAW,OAEvC,IACI,GAAIK,KAAKL,YAAc,KAAM,CAExBK,KAAKD,QAAgBiC,YAAYzB,EAAWC,EACjD,MAAO,GAAIR,KAAKL,YAAc,KAAM,CAEhC,MAAMgB,EAAQX,KAAKD,QAAQa,WAC1BD,EAAcqB,YAAYzB,EAAWC,EAAOR,KAAKD,QACtD,CACA,GAAIC,KAAKF,KAAKmC,YAAY,aAAc,CACpCzC,EAAO0C,MAAM,WAAY,yBAAyB3B,OAAeC,SAAaR,KAAKL,YAAa,gBACpG,CACJ,CAAE,MAAOwC,GACL3C,EAAOgC,MAAM,WAAY,kCAAmCW,EAAYV,UAAW,gBACvF,CACJ,EACH,IAAAW,EAAA,CAAAC,WAAA,MAAAD,EAAA1C,gBAAA,OAAA0C,CAAA","ignoreList":[]}
@@ -1,8 +1,9 @@
1
- import { DynamicHost } from "../DynamicHost";
1
+ import DynamicHost from "../../DynamicHost";
2
2
  import { Logger } from "../../../utils/Logger";
3
3
  import ODataV4Context from "sap/ui/model/odata/v4/Context";
4
4
  import Context from "sap/ui/model/Context";
5
5
 
6
+ import Event from "sap/ui/base/Event";
6
7
  /**
7
8
  * Universal OData Delegate.
8
9
  * Natively detects and manages two-way synchronization for both OData V2 and V4 contexts
@@ -32,8 +33,8 @@ export class ODataDelegate {
32
33
  /**
33
34
  * Event listener wrapper for field changes emitted by the host.
34
35
  */
35
- private onFieldChange(oEvent: sap.ui.base.Event): void {
36
- const params = oEvent.getParameters();
36
+ private onFieldChange(oEvent: Event): void {
37
+ const params = oEvent.getParameters() as any;
37
38
  if (params.fieldPath && params.value !== undefined) {
38
39
  this.handleFieldChange(params.fieldPath, params.value);
39
40
  }
@@ -68,8 +69,8 @@ export class ODataDelegate {
68
69
 
69
70
  if (this.odataType === "V4") {
70
71
  // V4 uses async requestObject()
71
- if (typeof this.context.requestObject === "function") {
72
- this.context.requestObject().then((oData: unknown) => {
72
+ if (typeof (this.context as any).requestObject === "function") {
73
+ (this.context as any).requestObject().then((oData: unknown) => {
73
74
  this.pushPayload(oData);
74
75
  }).catch((err: Error) => {
75
76
  Logger.error("[MetaUI]", "Failed to extract V4 Context payload: " + err.message, "ODataDelegate");
@@ -116,11 +117,11 @@ export class ODataDelegate {
116
117
  try {
117
118
  if (this.odataType === "V4") {
118
119
  // V4 sets property directly on context
119
- this.context.setProperty(fieldPath, value);
120
+ (this.context as any).setProperty(fieldPath, value);
120
121
  } else if (this.odataType === "V2") {
121
122
  // V2 sets property on model, specifying the context path
122
123
  const model = this.context.getModel();
123
- model.setProperty(fieldPath, value, this.context);
124
+ (model as any).setProperty(fieldPath, value, this.context);
124
125
  }
125
126
  if (this.host.getProperty("debugMode")) {
126
127
  Logger.debug("[MetaUI]", `ODataDelegate Patched ${fieldPath} = ${value} via ${this.odataType}`, "ODataDelegate");
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationDelegate-dbg.js","names":["Logger","_____utils_Logger","ValidationDelegate","constructor","host","registerObject","control","unregisterObject","removeAllMessages","stateManager","getStateManager","getProperty","messageManager","Messaging","messages","getMessageModel","getData","messagesToRemove","filter","m","getMessageProcessor","getId","getModel","length","removeMessages","pushMessage","path","text","targetPath","replace","displayText","warn","addMessages","Message","message","type","coreLibrary","MessageType","Error","target","processor","addCustomError","fieldPath","code","clearCustomError","processorId","getTarget","getCode","mountCrashBoundary","error","errorPage","IllustratedMessage","title","description","setAggregation","__exports","__esModule"],"sources":["ValidationDelegate.ts"],"sourcesContent":["import IllustratedMessage from \"sap/m/IllustratedMessage\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport Control from \"sap/ui/core/Control\";\nimport { StateManager } from \"../../../core/StateManager\";\nimport { Logger } from \"../../../utils/Logger\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\n\nexport interface IHostValidation {\n getProperty(name: string): unknown;\n setAggregation(aggregationName: string, object: sap.ui.core.Control, suppressInvalidate?: boolean): this;\n getStateManager(): StateManager | null;\n}\n\n/**\n * Handles Fiori MessageManager integration and provides a standardized Error Boundary UI fallback.\n */\nexport class ValidationDelegate {\n private host: IHostValidation;\n\n /**\n * Initializes the ValidationDelegate for registering controls to the global MessageManager.\n * @param host The parent host interface.\n */\n constructor(host: IHostValidation) {\n this.host = host;\n }\n\n /**\n * Registers a control and all its children with the global MessageManager.\n * (Deprecated: Native registration causes UI5 to aggressively clear custom schema validation messages \n * on every keystroke. MetaUI handles valueState manually via plugins).\n */\n public registerObject(control: Control): void {\n // Do nothing to prevent UI5 from hijacking valueState and clearing our manual messages\n }\n\n /**\n * Unregisters a control from the global MessageManager.\n */\n public unregisterObject(control: Control): void {\n // Do nothing\n }\n\n public removeAllMessages(): void {\n const stateManager = this.host.getStateManager();\n if (stateManager && this.host.getProperty(\"useMessageManager\")) {\n const messageManager = Messaging;\n const messages = messageManager.getMessageModel().getData();\n const messagesToRemove = messages.filter((m: sap.ui.core.message.Message) =>\n m.getMessageProcessor() && m.getMessageProcessor().getId() === stateManager.getModel().getId()\n );\n if (messagesToRemove && messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n }\n }\n\n /**\n * Pushes a validation message to the console, and optionally to the MessageManager.\n */\n public pushMessage(path: string, text: string): void {\n const targetPath = path ? `/${path.replace(/^\\//, \"\")}` : \"\";\n const displayText = path ? `Field '${path}': ${text}` : text;\n\n if (path) {\n Logger.warn(`[MetaUI Validation Error] ${displayText}`);\n } else {\n Logger.warn(`[MetaUI Validation Error] Global - ${text}`);\n }\n\n if (this.host.getProperty(\"useMessageManager\") === true) {\n const messageManager = Messaging;\n const stateManager = this.host.getStateManager();\n messageManager.addMessages(new Message({\n message: displayText,\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: stateManager?.getModel()\n }));\n }\n }\n\n /**\n * Imperatively invalidates a field and highlights it with an error message.\n * Uses a specific 'CustomError' code to distinguish it from internal schema validations.\n * \n * @param fieldPath The internal JSON path of the field to highlight.\n * @param message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n Messaging.addMessages(new Message({\n message: message,\n type: coreLibrary.MessageType.Error,\n target: `/${fieldPath.replace(/^\\//, \"\")}`,\n processor: stateManager.getModel(),\n code: \"CustomError\"\n }));\n }\n\n /**\n * Reverts a custom error state on a field, safely ignoring native schema validations.\n * \n * @param fieldPath The internal JSON path of the field to clear.\n */\n public clearCustomError(fieldPath: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n const target = `/${fieldPath.replace(/^\\//, \"\")}`;\n const processorId = stateManager.getModel().getId();\n const messages = Messaging.getMessageModel().getData() as sap.ui.core.message.Message[];\n\n const messagesToRemove = messages.filter(m =>\n m.getTarget() === target &&\n m.getCode() === \"CustomError\" &&\n m.getMessageProcessor()?.getId() === processorId\n );\n\n if (messagesToRemove.length > 0) {\n Messaging.removeMessages(messagesToRemove);\n }\n }\n\n /**\n * Triggers a visual Error Page (Crash Boundary) when generation catastrophically fails.\n */\n public mountCrashBoundary(error: Error): void {\n Logger.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", error.message, \"ValidationDelegate\");\n\n const errorPage = new IllustratedMessage({\n title: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\"\n });\n\n this.host.setAggregation(\"_content\", errorPage);\n }\n}\n"],"mappings":";;;QAISA,MAAM,GAAAC,iBAAA;EAUf;AACA;AACA;EACO,MAAMC,kBAAkB,CAAC;IAG5B;AACJ;AACA;AACA;IACIC,WAAWA,CAACC,IAAqB,EAAE;MAC/B,IAAI,CAACA,IAAI,GAAGA,IAAI;IACpB;;IAEA;AACJ;AACA;AACA;AACA;IACWC,cAAcA,CAACC,OAAgB,EAAQ;MAC1C;IAAA;;IAGJ;AACJ;AACA;IACWC,gBAAgBA,CAACD,OAAgB,EAAQ;MAC5C;IAAA;IAGGE,iBAAiBA,CAAA,EAAS;MAC7B,MAAMC,YAAY,GAAG,IAAI,CAACL,IAAI,CAACM,eAAe,CAAC,CAAC;MAChD,IAAID,YAAY,IAAI,IAAI,CAACL,IAAI,CAACO,WAAW,CAAC,mBAAmB,CAAC,EAAE;QAC5D,MAAMC,cAAc,GAAGC,SAAS;QAChC,MAAMC,QAAQ,GAAGF,cAAc,CAACG,eAAe,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;QAC3D,MAAMC,gBAAgB,GAAGH,QAAQ,CAACI,MAAM,CAAEC,CAA8B,IACpEA,CAAC,CAACC,mBAAmB,CAAC,CAAC,IAAID,CAAC,CAACC,mBAAmB,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,KAAKZ,YAAY,CAACa,QAAQ,CAAC,CAAC,CAACD,KAAK,CAAC,CACjG,CAAC;QACD,IAAIJ,gBAAgB,IAAIA,gBAAgB,CAACM,MAAM,GAAG,CAAC,EAAE;UACjDX,cAAc,CAACY,cAAc,CAACP,gBAAgB,CAAC;QACnD;MACJ;IACJ;;IAEA;AACJ;AACA;IACWQ,WAAWA,CAACC,IAAY,EAAEC,IAAY,EAAQ;MACjD,MAAMC,UAAU,GAAGF,IAAI,GAAG,IAAIA,IAAI,CA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AW,EAAE;MACjB,CAAC,CAAC;MAEF,IAAI,CAACjD,IAAI,CAACkD,cAAc,CAAC,UAAU,EAAEJ,SAAS,CAAC;IACnD;EACJ;EAAC,IAAAK,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAArD,kBAAA,GAAAA,kBAAA;EAAA,OAAAqD,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"ValidationDelegate-dbg.js","names":["Logger","_____utils_Logger","ValidationDelegate","constructor","host","registerObject","control","unregisterObject","removeAllMessages","stateManager","getStateManager","getProperty","messageManager","Messaging","messages","getMessageModel","getData","messagesToRemove","filter","m","getMessageProcessor","getId","getModel","length","removeMessages","pushMessage","path","text","targetPath","replace","displayText","warn","addMessages","Message","message","type","coreLibrary","MessageType","Error","target","processor","addCustomError","fieldPath","code","clearCustomError","processorId","getTarget","getCode","mountCrashBoundary","error","errorPage","IllustratedMessage","title","description","setAggregation","__exports","__esModule"],"sources":["ValidationDelegate.ts"],"sourcesContent":["import IllustratedMessage from \"sap/m/IllustratedMessage\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport Control from \"sap/ui/core/Control\";\nimport { StateManager } from \"../../../core/StateManager\";\nimport { Logger } from \"../../../utils/Logger\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\n\nexport interface IHostValidation {\n getProperty(name: string): unknown;\n setAggregation(aggregationName: string, object: Control, suppressInvalidate?: boolean): this;\n getStateManager(): StateManager | null;\n}\n\n/**\n * Handles Fiori MessageManager integration and provides a standardized Error Boundary UI fallback.\n */\nexport class ValidationDelegate {\n private host: IHostValidation;\n\n /**\n * Initializes the ValidationDelegate for registering controls to the global MessageManager.\n * @param host The parent host interface.\n */\n constructor(host: IHostValidation) {\n this.host = host;\n }\n\n /**\n * Registers a control and all its children with the global MessageManager.\n * (Deprecated: Native registration causes UI5 to aggressively clear custom schema validation messages \n * on every keystroke. MetaUI handles valueState manually via plugins).\n */\n public registerObject(control: Control): void {\n // Do nothing to prevent UI5 from hijacking valueState and clearing our manual messages\n }\n\n /**\n * Unregisters a control from the global MessageManager.\n */\n public unregisterObject(control: Control): void {\n // Do nothing\n }\n\n public removeAllMessages(): void {\n const stateManager = this.host.getStateManager();\n if (stateManager && this.host.getProperty(\"useMessageManager\")) {\n const messageManager = Messaging;\n const messages = messageManager.getMessageModel().getData();\n const messagesToRemove = messages.filter((m: Message) =>\n m.getMessageProcessor() && m.getMessageProcessor().getId() === stateManager.getModel().getId()\n );\n if (messagesToRemove && messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n }\n }\n\n /**\n * Pushes a validation message to the console, and optionally to the MessageManager.\n */\n public pushMessage(path: string, text: string): void {\n const targetPath = path ? `/${path.replace(/^\\//, \"\")}` : \"\";\n const displayText = path ? `Field '${path}': ${text}` : text;\n\n if (path) {\n Logger.warn(`[MetaUI Validation Error] ${displayText}`);\n } else {\n Logger.warn(`[MetaUI Validation Error] Global - ${text}`);\n }\n\n if (this.host.getProperty(\"useMessageManager\") === true) {\n const messageManager = Messaging;\n const stateManager = this.host.getStateManager();\n messageManager.addMessages(new Message({\n message: displayText,\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: stateManager?.getModel()\n }));\n }\n }\n\n /**\n * Imperatively invalidates a field and highlights it with an error message.\n * Uses a specific 'CustomError' code to distinguish it from internal schema validations.\n * \n * @param fieldPath The internal JSON path of the field to highlight.\n * @param message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n Messaging.addMessages(new Message({\n message: message,\n type: coreLibrary.MessageType.Error,\n target: `/${fieldPath.replace(/^\\//, \"\")}`,\n processor: stateManager.getModel(),\n code: \"CustomError\"\n }));\n }\n\n /**\n * Reverts a custom error state on a field, safely ignoring native schema validations.\n * \n * @param fieldPath The internal JSON path of the field to clear.\n */\n public clearCustomError(fieldPath: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n const target = `/${fieldPath.replace(/^\\//, \"\")}`;\n const processorId = stateManager.getModel().getId();\n const messages = Messaging.getMessageModel().getData() as Message[];\n\n const messagesToRemove = messages.filter(m =>\n m.getTarget() === target &&\n m.getCode() === \"CustomError\" &&\n m.getMessageProcessor()?.getId() === processorId\n );\n\n if (messagesToRemove.length > 0) {\n Messaging.removeMessages(messagesToRemove);\n }\n }\n\n /**\n * Triggers a visual Error Page (Crash Boundary) when generation catastrophically fails.\n */\n public mountCrashBoundary(error: Error): void {\n Logger.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", error.message, \"ValidationDelegate\");\n\n const errorPage = new IllustratedMessage({\n title: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\"\n });\n\n this.host.setAggregation(\"_content\", errorPage);\n }\n}\n"],"mappings":";;;QAISA,MAAM,GAAAC,iBAAA;EAUf;AACA;AACA;EACO,MAAMC,kBAAkB,CAAC;IAG5B;AACJ;AACA;AACA;IACIC,WAAWA,CAACC,IAAqB,EAAE;MAC/B,IAAI,CAACA,IAAI,GAAGA,IAAI;IACpB;;IAEA;AACJ;AACA;AACA;AACA;IACWC,cAAcA,CAACC,OAAgB,EAAQ;MAC1C;IAAA;;IAGJ;AACJ;AACA;IACWC,gBAAgBA,CAACD,OAAgB,EAAQ;MAC5C;IAAA;IAGGE,iBAAiBA,CAAA,EAAS;MAC7B,MAAMC,YAAY,GAAG,IAAI,CAACL,IAAI,CAACM,eAAe,CAAC,CAAC;MAChD,IAAID,YAAY,IAAI,IAAI,CAACL,IAAI,CAACO,WAAW,CAAC,mBAAmB,CAAC,EAAE;QAC5D,MAAMC,cAAc,GAAGC,SAAS;QAChC,MAAMC,QAAQ,GAAGF,cAAc,CAACG,eAAe,CAAC,CAAC,CAACC,OAAO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KAAKP,MAAM,IACxBpB,CAAC,CAAC4B,OAAO,CAAC,CAAC,KAAK,aAAa,IAC7B5B,CAAC,CAACC,mBAAmB,CAAC,CAAC,EAAEC,KAAK,CAAC,CAAC,KAAKwB,WACzC,CAAC;MAED,IAAI5B,gBAAgB,CAACM,MAAM,GAAG,CAAC,EAAE;QAC7BV,SAAS,CAACW,cAAc,CAACP,gBAAgB,CAAC;MAC9C;IACJ;;IAEA;AACJ;AACA;IACW+B,kBAAkBA,CAACC,KAAY,EAAQ;MAC1CjD,MAAM,CAACiD,KAAK,CAAC,wEAAwE,EAAEA,KAAK,CAACf,OAAO,EAAE,oBAAoB,CAAC;MAE3H,MAAMgB,SAAS,GAAG,IAAIC,kBAAkB,CAAC;QACrCC,KAAK,EAAE,sBAAsB;QAC7BC,WAAW,EAAE;MACjB,CAAC,CAAC;MAEF,IAAI,CAACjD,IAAI,CAACkD,cAAc,CAAC,UAAU,EAAEJ,SAAS,CAAC;IACnD;EACJ;EAAC,IAAAK,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAArD,kBAAA,GAAAA,kBAAA;EAAA,OAAAqD,SAAA;AAAA","ignoreList":[]}
@@ -3,7 +3,7 @@ declare module "nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDel
3
3
  import { StateManager } from "nz/co/siliconst/ui5/metaui/core/StateManager";
4
4
  export interface IHostValidation {
5
5
  getProperty(name: string): unknown;
6
- setAggregation(aggregationName: string, object: sap.ui.core.Control, suppressInvalidate?: boolean): this;
6
+ setAggregation(aggregationName: string, object: Control, suppressInvalidate?: boolean): this;
7
7
  getStateManager(): StateManager | null;
8
8
  }
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationDelegate.d.ts","sourceRoot":"../../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,uEAAuE,CAAC;IAGvF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;IAK5E,UAAiB,eAAe;QAC5B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACnC,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QACzG,eAAe,IAAI,YAAY,GAAG,IAAI,CAAC;KAC1C;IAED;;OAEG;IACH,MAAa,kBAAkB;QAC3B,OAAO,CAAC,IAAI,CAAkB;QAE9B;;;WAGG;oBACS,IAAI,EAAE,eAAe;QAIjC;;;;WAIG;QACI,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;QAI7C;;WAEG;QACI,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;QAIxC,iBAAiB,IAAI,IAAI;QAchC;;WAEG;QACI,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;QAsBpD;;;;;;WAMG;QACI,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;QAmB/D;;;;WAIG;QACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;QAyBhD;;WAEG;QACI,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;KAUhD;CAEA"}
1
+ {"version":3,"file":"ValidationDelegate.d.ts","sourceRoot":"../../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,uEAAuE,CAAC;IAGvF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;IAK5E,UAAiB,eAAe;QAC5B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACnC,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAC7F,eAAe,IAAI,YAAY,GAAG,IAAI,CAAC;KAC1C;IAED;;OAEG;IACH,MAAa,kBAAkB;QAC3B,OAAO,CAAC,IAAI,CAAkB;QAE9B;;;WAGG;oBACS,IAAI,EAAE,eAAe;QAIjC;;;;WAIG;QACI,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;QAI7C;;WAEG;QACI,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;QAIxC,iBAAiB,IAAI,IAAI;QAchC;;WAEG;QACI,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;QAsBpD;;;;;;WAMG;QACI,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;QAmB/D;;;;WAIG;QACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;QAyBhD;;WAEG;QACI,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;KAUhD;CAEA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationDelegate.js","names":["Logger","_____utils_Logger","ValidationDelegate","constructor","host","this","registerObject","control","unregisterObject","removeAllMessages","stateManager","getStateManager","getProperty","messageManager","Messaging","messages","getMessageModel","getData","messagesToRemove","filter","m","getMessageProcessor","getId","getModel","length","removeMessages","pushMessage","path","text","targetPath","replace","displayText","warn","addMessages","Message","message","type","coreLibrary","MessageType","Error","target","processor","addCustomError","fieldPath","code","clearCustomError","processorId","getTarget","getCode","mountCrashBoundary","error","errorPage","IllustratedMessage","title","description","setAggregation","__exports","__esModule"],"sources":["ValidationDelegate.ts"],"sourcesContent":["import IllustratedMessage from \"sap/m/IllustratedMessage\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport Control from \"sap/ui/core/Control\";\nimport { StateManager } from \"../../../core/StateManager\";\nimport { Logger } from \"../../../utils/Logger\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\n\nexport interface IHostValidation {\n getProperty(name: string): unknown;\n setAggregation(aggregationName: string, object: sap.ui.core.Control, suppressInvalidate?: boolean): this;\n getStateManager(): StateManager | null;\n}\n\n/**\n * Handles Fiori MessageManager integration and provides a standardized Error Boundary UI fallback.\n */\nexport class ValidationDelegate {\n private host: IHostValidation;\n\n /**\n * Initializes the ValidationDelegate for registering controls to the global MessageManager.\n * @param host The parent host interface.\n */\n constructor(host: IHostValidation) {\n this.host = host;\n }\n\n /**\n * Registers a control and all its children with the global MessageManager.\n * (Deprecated: Native registration causes UI5 to aggressively clear custom schema validation messages \n * on every keystroke. MetaUI handles valueState manually via plugins).\n */\n public registerObject(control: Control): void {\n // Do nothing to prevent UI5 from hijacking valueState and clearing our manual messages\n }\n\n /**\n * Unregisters a control from the global MessageManager.\n */\n public unregisterObject(control: Control): void {\n // Do nothing\n }\n\n public removeAllMessages(): void {\n const stateManager = this.host.getStateManager();\n if (stateManager && this.host.getProperty(\"useMessageManager\")) {\n const messageManager = Messaging;\n const messages = messageManager.getMessageModel().getData();\n const messagesToRemove = messages.filter((m: sap.ui.core.message.Message) =>\n m.getMessageProcessor() && m.getMessageProcessor().getId() === stateManager.getModel().getId()\n );\n if (messagesToRemove && messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n }\n }\n\n /**\n * Pushes a validation message to the console, and optionally to the MessageManager.\n */\n public pushMessage(path: string, text: string): void {\n const targetPath = path ? `/${path.replace(/^\\//, \"\")}` : \"\";\n const displayText = path ? `Field '${path}': ${text}` : text;\n\n if (path) {\n Logger.warn(`[MetaUI Validation Error] ${displayText}`);\n } else {\n Logger.warn(`[MetaUI Validation Error] Global - ${text}`);\n }\n\n if (this.host.getProperty(\"useMessageManager\") === true) {\n const messageManager = Messaging;\n const stateManager = this.host.getStateManager();\n messageManager.addMessages(new Message({\n message: displayText,\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: stateManager?.getModel()\n }));\n }\n }\n\n /**\n * Imperatively invalidates a field and highlights it with an error message.\n * Uses a specific 'CustomError' code to distinguish it from internal schema validations.\n * \n * @param fieldPath The internal JSON path of the field to highlight.\n * @param message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n Messaging.addMessages(new Message({\n message: message,\n type: coreLibrary.MessageType.Error,\n target: `/${fieldPath.replace(/^\\//, \"\")}`,\n processor: stateManager.getModel(),\n code: \"CustomError\"\n }));\n }\n\n /**\n * Reverts a custom error state on a field, safely ignoring native schema validations.\n * \n * @param fieldPath The internal JSON path of the field to clear.\n */\n public clearCustomError(fieldPath: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n const target = `/${fieldPath.replace(/^\\//, \"\")}`;\n const processorId = stateManager.getModel().getId();\n const messages = Messaging.getMessageModel().getData() as sap.ui.core.message.Message[];\n\n const messagesToRemove = messages.filter(m =>\n m.getTarget() === target &&\n m.getCode() === \"CustomError\" &&\n m.getMessageProcessor()?.getId() === processorId\n );\n\n if (messagesToRemove.length > 0) {\n Messaging.removeMessages(messagesToRemove);\n }\n }\n\n /**\n * Triggers a visual Error Page (Crash Boundary) when generation catastrophically fails.\n */\n public mountCrashBoundary(error: Error): void {\n Logger.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", error.message, \"ValidationDelegate\");\n\n const errorPage = new IllustratedMessage({\n title: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\"\n });\n\n this.host.setAggregation(\"_content\", errorPage);\n }\n}\n"],"mappings":"sLAISA,EAAMC,EAAA,UAaR,M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AiBF,GACpB,GAAItC,KAAKD,KAAKQ,YAAY,uBAAyB,KAAM,CACrD,MACJ,CAEA,MAAMF,EAAeL,KAAKD,KAAKO,kBAC/B,IAAKD,EAAc,CACf,MACJ,CAEA,MAAM8B,EAAS,IAAIG,EAAUb,QAAQ,MAAO,MAC5C,MAAMgB,EAAcpC,EAAaa,WAAWD,QAC5C,MAAMP,EAAWD,EAAUE,kBAAkBC,UAE7C,MAAMC,EAAmBH,EAASI,OAAOC,GACrCA,EAAE2B,cAAgBP,GAClBpB,EAAE4B,YAAc,eAChB5B,EAAEC,uBAAuBC,UAAYwB,GAGzC,GAAI5B,EAAiBM,OAAS,EAAG,CAC7BV,EAAUW,eAAeP,EAC7B,CACJ,CAKO+B,mBAAmBC,GACtBlD,EAAOkD,MAAM,yEAA0EA,EAAMf,QAAS,sBAEtG,MAAMgB,EAAY,IAAIC,EAAmB,CACrCC,MAAO,uBACPC,YAAa,kGAGjBjD,KAAKD,KAAKmD,eAAe,WAAYJ,EACzC,EACH,IAAAK,EAAA,CAAAC,WAAA,MAAAD,EAAAtD,qBAAA,OAAAsD,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"ValidationDelegate.js","names":["Logger","_____utils_Logger","ValidationDelegate","constructor","host","this","registerObject","control","unregisterObject","removeAllMessages","stateManager","getStateManager","getProperty","messageManager","Messaging","messages","getMessageModel","getData","messagesToRemove","filter","m","getMessageProcessor","getId","getModel","length","removeMessages","pushMessage","path","text","targetPath","replace","displayText","warn","addMessages","Message","message","type","coreLibrary","MessageType","Error","target","processor","addCustomError","fieldPath","code","clearCustomError","processorId","getTarget","getCode","mountCrashBoundary","error","errorPage","IllustratedMessage","title","description","setAggregation","__exports","__esModule"],"sources":["ValidationDelegate.ts"],"sourcesContent":["import IllustratedMessage from \"sap/m/IllustratedMessage\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport Control from \"sap/ui/core/Control\";\nimport { StateManager } from \"../../../core/StateManager\";\nimport { Logger } from \"../../../utils/Logger\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\n\nexport interface IHostValidation {\n getProperty(name: string): unknown;\n setAggregation(aggregationName: string, object: Control, suppressInvalidate?: boolean): this;\n getStateManager(): StateManager | null;\n}\n\n/**\n * Handles Fiori MessageManager integration and provides a standardized Error Boundary UI fallback.\n */\nexport class ValidationDelegate {\n private host: IHostValidation;\n\n /**\n * Initializes the ValidationDelegate for registering controls to the global MessageManager.\n * @param host The parent host interface.\n */\n constructor(host: IHostValidation) {\n this.host = host;\n }\n\n /**\n * Registers a control and all its children with the global MessageManager.\n * (Deprecated: Native registration causes UI5 to aggressively clear custom schema validation messages \n * on every keystroke. MetaUI handles valueState manually via plugins).\n */\n public registerObject(control: Control): void {\n // Do nothing to prevent UI5 from hijacking valueState and clearing our manual messages\n }\n\n /**\n * Unregisters a control from the global MessageManager.\n */\n public unregisterObject(control: Control): void {\n // Do nothing\n }\n\n public removeAllMessages(): void {\n const stateManager = this.host.getStateManager();\n if (stateManager && this.host.getProperty(\"useMessageManager\")) {\n const messageManager = Messaging;\n const messages = messageManager.getMessageModel().getData();\n const messagesToRemove = messages.filter((m: Message) =>\n m.getMessageProcessor() && m.getMessageProcessor().getId() === stateManager.getModel().getId()\n );\n if (messagesToRemove && messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n }\n }\n\n /**\n * Pushes a validation message to the console, and optionally to the MessageManager.\n */\n public pushMessage(path: string, text: string): void {\n const targetPath = path ? `/${path.replace(/^\\//, \"\")}` : \"\";\n const displayText = path ? `Field '${path}': ${text}` : text;\n\n if (path) {\n Logger.warn(`[MetaUI Validation Error] ${displayText}`);\n } else {\n Logger.warn(`[MetaUI Validation Error] Global - ${text}`);\n }\n\n if (this.host.getProperty(\"useMessageManager\") === true) {\n const messageManager = Messaging;\n const stateManager = this.host.getStateManager();\n messageManager.addMessages(new Message({\n message: displayText,\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: stateManager?.getModel()\n }));\n }\n }\n\n /**\n * Imperatively invalidates a field and highlights it with an error message.\n * Uses a specific 'CustomError' code to distinguish it from internal schema validations.\n * \n * @param fieldPath The internal JSON path of the field to highlight.\n * @param message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n Messaging.addMessages(new Message({\n message: message,\n type: coreLibrary.MessageType.Error,\n target: `/${fieldPath.replace(/^\\//, \"\")}`,\n processor: stateManager.getModel(),\n code: \"CustomError\"\n }));\n }\n\n /**\n * Reverts a custom error state on a field, safely ignoring native schema validations.\n * \n * @param fieldPath The internal JSON path of the field to clear.\n */\n public clearCustomError(fieldPath: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n const target = `/${fieldPath.replace(/^\\//, \"\")}`;\n const processorId = stateManager.getModel().getId();\n const messages = Messaging.getMessageModel().getData() as Message[];\n\n const messagesToRemove = messages.filter(m =>\n m.getTarget() === target &&\n m.getCode() === \"CustomError\" &&\n m.getMessageProcessor()?.getId() === processorId\n );\n\n if (messagesToRemove.length > 0) {\n Messaging.removeMessages(messagesToRemove);\n }\n }\n\n /**\n * Triggers a visual Error Page (Crash Boundary) when generation catastrophically fails.\n */\n public mountCrashBoundary(error: Error): void {\n Logger.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", error.message, \"ValidationDelegate\");\n\n const errorPage = new IllustratedMessage({\n title: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\"\n });\n\n this.host.setAggregation(\"_content\", errorPage);\n }\n}\n"],"mappings":"sLAISA,EAAMC,EAAA,UAaR,MAAMC,EAOTC,YAAYC,GACRC,KAAKD,KAAOA,CAChB,CAOOE,eAAeC,GAClB,CAMGC,iBAAiBD,GACpB,CAGG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KAAKO,kBAC/B,IAAKD,EAAc,CACf,MACJ,CAEA,MAAM8B,EAAS,IAAIG,EAAUb,QAAQ,MAAO,MAC5C,MAAMgB,EAAcpC,EAAaa,WAAWD,QAC5C,MAAMP,EAAWD,EAAUE,kBAAkBC,UAE7C,MAAMC,EAAmBH,EAASI,OAAOC,GACrCA,EAAE2B,cAAgBP,GAClBpB,EAAE4B,YAAc,eAChB5B,EAAEC,uBAAuBC,UAAYwB,GAGzC,GAAI5B,EAAiBM,OAAS,EAAG,CAC7BV,EAAUW,eAAeP,EAC7B,CACJ,CAKO+B,mBAAmBC,GACtBlD,EAAOkD,MAAM,yEAA0EA,EAAMf,QAAS,sBAEtG,MAAMgB,EAAY,IAAIC,EAAmB,CACrCC,MAAO,uBACPC,YAAa,kGAGjBjD,KAAKD,KAAKmD,eAAe,WAAYJ,EACzC,EACH,IAAAK,EAAA,CAAAC,WAAA,MAAAD,EAAAtD,qBAAA,OAAAsD,CAAA","ignoreList":[]}
@@ -8,7 +8,7 @@ import coreLibrary from "sap/ui/core/library";
8
8
 
9
9
  export interface IHostValidation {
10
10
  getProperty(name: string): unknown;
11
- setAggregation(aggregationName: string, object: sap.ui.core.Control, suppressInvalidate?: boolean): this;
11
+ setAggregation(aggregationName: string, object: Control, suppressInvalidate?: boolean): this;
12
12
  getStateManager(): StateManager | null;
13
13
  }
14
14
 
@@ -47,7 +47,7 @@ export class ValidationDelegate {
47
47
  if (stateManager && this.host.getProperty("useMessageManager")) {
48
48
  const messageManager = Messaging;
49
49
  const messages = messageManager.getMessageModel().getData();
50
- const messagesToRemove = messages.filter((m: sap.ui.core.message.Message) =>
50
+ const messagesToRemove = messages.filter((m: Message) =>
51
51
  m.getMessageProcessor() && m.getMessageProcessor().getId() === stateManager.getModel().getId()
52
52
  );
53
53
  if (messagesToRemove && messagesToRemove.length > 0) {
@@ -124,7 +124,7 @@ export class ValidationDelegate {
124
124
 
125
125
  const target = `/${fieldPath.replace(/^\//, "")}`;
126
126
  const processorId = stateManager.getModel().getId();
127
- const messages = Messaging.getMessageModel().getData() as sap.ui.core.message.Message[];
127
+ const messages = Messaging.getMessageModel().getData() as Message[];
128
128
 
129
129
  const messagesToRemove = messages.filter(m =>
130
130
  m.getTarget() === target &&
@@ -1 +1 @@
1
- {"version":3,"file":"ConditionEngine-dbg.js","names":["Registry","___Registry","OperatorRegistry","register","a","b","ConditionEngine","constructor","schema","plugins","Map","handleEvent","fieldKey","isValid","registerPlugin","bindingPath","plugin","set","destroy","clear","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\n * @file ConditionEngine.ts\n * @description Evaluates dynamic rules to alter the schema in real-time.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { ISchema } from \"../interfaces/ISchema\";\nimport { Registry } from \"./Registry\";\n\nexport type ConditionOperator = (a: unknown, b: unknown) => boolean;\n\nexport const OperatorRegistry = new Registry<ConditionOperator>(\"Operators\");\n\n// Register basic default operators\nOperatorRegistry.register(\"==\", (a, b) => a == b);\nOperatorRegistry.register(\"===\", (a, b) => a === b);\nOperatorRegistry.register(\"!=\", (a, b) => a != b);\nOperatorRegistry.register(\"!==\", (a, b) => a !== b);\nOperatorRegistry.register(\">\", (a, b) => a > b);\nOperatorRegistry.register(\"<\", (a, b) => a < b);\nOperatorRegistry.register(\">=\", (a, b) => a >= b);\nOperatorRegistry.register(\"<=\", (a, b) => a <= b);\n\n/**\n * Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).\n * It delegates actual evaluations to the configurable `OperatorRegistry`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class ConditionEngine {\n /** The active form schema being evaluated. */\n private schema: ISchema;\n /**\n * Initializes the ConditionEngine with the active schema.\n * @param schema The current UI layout schema.\n */\n constructor(schema: ISchema) {\n this.schema = schema;\n }\n\n\n\n /** Internal map tracking active plugins against their binding paths for real-time state updates. */\n private plugins: Map<string, IPlugin> = new Map();\n\n /**\n * Internal handler to evaluate business rules when a field is updated.\n * @param fieldKey The key of the field that was changed\n * @param isValid Whether the field is currently valid\n */\n public handleEvent(fieldKey: string, isValid: boolean): void {\n // Evaluate conditions via registered operators if a rule system is added later\n }\n\n /**\n * Registers a rendered plugin so the condition engine can push dynamic state updates to it.\n * \n * @param bindingPath The JSON path representing the field within the payload.\n * @param plugin The instantiated plugin handling the field.\n */\n public registerPlugin(bindingPath: string, plugin: IPlugin): void {\n this.plugins.set(bindingPath, plugin);\n }\n\n /**\n * Cleans up listeners to prevent memory leaks on destruction.\n */\n public destroy(): void {\n this.plugins.clear();\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAOSA,QAAQ,GAAAC,WAAA;EAIV,MAAMC,gBAAgB,GAAG,IAAIF,QAAQ,CAAoB,WAAW,CAAC;;EAE5E;EACAE,gBAAgB,CAACC,QAAQ,CAAC,IAAI,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,IAAIC,CAAC,CAAC;EACjDH,gBAAgB,CAACC,QAAQ,CAAC,KAAK,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,KAAKC,CAAC,CAAC;EACnDH,gBAAgB,CAACC,QAAQ,CAAC,IAAI,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,IAAIC,CAAC,CAAC;EACjDH,gBAAgB,CAACC,QAAQ,CAAC,KAAK,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,KAAKC,CAAC,CAAC;EACnDH,gBAAgB,CAACC,QAAQ,CAAC,GAAG,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;EAC/CH,gBAAgB,CAACC,QAAQ,CAAC,GAAG,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;EAC/CH,gBAAgB,CAACC,QAAQ,CAAC,IAAI,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,IAAIC,CAAC,CAAC;EACjDH,gBAAgB,CAACC,QAAQ,CAAC,IAAI,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,IAAIC,CAAC,CAAC;;EAEjD;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,eAAe,CAAC;IACzB;;IAEA;AACJ;AACA;AACA;IACIC,WAAWA,CAACC,MAAe,EAAE;MACzB,IAAI,CAACA,MAAM,GAAGA,MAAM;IACxB;;IAIA;IACQC,OAAO,GAAyB,IAAIC,GAAG,CAAC,CAAC;;IAEjD;AACJ;AACA;AACA;AACA;IACWC,WAAWA,CAACC,QAAgB,EAAEC,OAAgB,EAAQ;MACzD;IAAA;;IAGJ;AACJ;AACA;AACA;AACA;AACA;IACWC,cAAcA,CAACC,WAAmB,EAAEC,MAAe,EAAQ;MAC9D,IAAI,CAACP,OAAO,CAACQ,GAAG,CAACF,WAAW,EAAEC,MAAM,CAAC;IACzC;;IAEA;AACJ;AACA;IACWE,OAAOA,CAAA,EAAS;MACnB,IAAI,CAACT,OAAO,CAACU,KAAK,CAAC,CAAC;IACxB;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAlB,gBAAA,GAAAA,gBAAA;EAAAkB,SAAA,CAAAd,eAAA,GAAAA,eAAA;EAAA,OAAAc,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"ConditionEngine-dbg.js","names":["Registry","___Registry","OperatorRegistry","register","a","b","ConditionEngine","constructor","schema","plugins","Map","handleEvent","fieldKey","isValid","registerPlugin","bindingPath","plugin","set","destroy","clear","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\n * @file ConditionEngine.ts\n * @description Evaluates dynamic rules to alter the schema in real-time.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { ISchema } from \"../interfaces/ISchema\";\nimport { Registry } from \"./Registry\";\n\nexport type ConditionOperator = (a: unknown, b: unknown) => boolean;\n\nexport const OperatorRegistry = new Registry<ConditionOperator>(\"Operators\");\n\n// Register basic default operators\nOperatorRegistry.register(\"==\", (a, b) => a == b);\nOperatorRegistry.register(\"===\", (a, b) => a === b);\nOperatorRegistry.register(\"!=\", (a, b) => a != b);\nOperatorRegistry.register(\"!==\", (a, b) => a !== b);\nOperatorRegistry.register(\">\", (a, b) => (a as any) > (b as any));\nOperatorRegistry.register(\"<\", (a, b) => (a as any) < (b as any));\nOperatorRegistry.register(\">=\", (a, b) => (a as any) >= (b as any));\nOperatorRegistry.register(\"<=\", (a, b) => (a as any) <= (b as any));\n\n/**\n * Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).\n * It delegates actual evaluations to the configurable `OperatorRegistry`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class ConditionEngine {\n /** The active form schema being evaluated. */\n private schema: ISchema;\n /**\n * Initializes the ConditionEngine with the active schema.\n * @param schema The current UI layout schema.\n */\n constructor(schema: ISchema) {\n this.schema = schema;\n }\n\n\n\n /** Internal map tracking active plugins against their binding paths for real-time state updates. */\n private plugins: Map<string, IPlugin> = new Map();\n\n /**\n * Internal handler to evaluate business rules when a field is updated.\n * @param fieldKey The key of the field that was changed\n * @param isValid Whether the field is currently valid\n */\n public handleEvent(fieldKey: string, isValid: boolean): void {\n // Evaluate conditions via registered operators if a rule system is added later\n }\n\n /**\n * Registers a rendered plugin so the condition engine can push dynamic state updates to it.\n * \n * @param bindingPath The JSON path representing the field within the payload.\n * @param plugin The instantiated plugin handling the field.\n */\n public registerPlugin(bindingPath: string, plugin: IPlugin): void {\n this.plugins.set(bindingPath, plugin);\n }\n\n /**\n * Cleans up listeners to prevent memory leaks on destruction.\n */\n public destroy(): void {\n this.plugins.clear();\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAOSA,QAAQ,GAAAC,WAAA;EAIV,MAAMC,gBAAgB,GAAG,IAAIF,QAAQ,CAAoB,WAAW,CAAC;;EAE5E;EACAE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AACP,OAAO,CAACQ,GAAG,CAACF,WAAW,EAAEC,MAAM,CAAC;IACzC;;IAEA;AACJ;AACA;IACWE,OAAOA,CAAA,EAAS;MACnB,IAAI,CAACT,OAAO,CAACU,KAAK,CAAC,CAAC;IACxB;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAlB,gBAAA,GAAAA,gBAAA;EAAAkB,SAAA,CAAAd,eAAA,GAAAA,eAAA;EAAA,OAAAc,SAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ConditionEngine.js","names":["Registry","___Registry","OperatorRegistry","register","a","b","ConditionEngine","constructor","schema","this","plugins","Map","handleEvent","fieldKey","isValid","registerPlugin","bindingPath","plugin","set","destroy","clear","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\n * @file ConditionEngine.ts\n * @description Evaluates dynamic rules to alter the schema in real-time.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { ISchema } from \"../interfaces/ISchema\";\nimport { Registry } from \"./Registry\";\n\nexport type ConditionOperator = (a: unknown, b: unknown) => boolean;\n\nexport const OperatorRegistry = new Registry<ConditionOperator>(\"Operators\");\n\n// Register basic default operators\nOperatorRegistry.register(\"==\", (a, b) => a == b);\nOperatorRegistry.register(\"===\", (a, b) => a === b);\nOperatorRegistry.register(\"!=\", (a, b) => a != b);\nOperatorRegistry.register(\"!==\", (a, b) => a !== b);\nOperatorRegistry.register(\">\", (a, b) => a > b);\nOperatorRegistry.register(\"<\", (a, b) => a < b);\nOperatorRegistry.register(\">=\", (a, b) => a >= b);\nOperatorRegistry.register(\"<=\", (a, b) => a <= b);\n\n/**\n * Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).\n * It delegates actual evaluations to the configurable `OperatorRegistry`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class ConditionEngine {\n /** The active form schema being evaluated. */\n private schema: ISchema;\n /**\n * Initializes the ConditionEngine with the active schema.\n * @param schema The current UI layout schema.\n */\n constructor(schema: ISchema) {\n this.schema = schema;\n }\n\n\n\n /** Internal map tracking active plugins against their binding paths for real-time state updates. */\n private plugins: Map<string, IPlugin> = new Map();\n\n /**\n * Internal handler to evaluate business rules when a field is updated.\n * @param fieldKey The key of the field that was changed\n * @param isValid Whether the field is currently valid\n */\n public handleEvent(fieldKey: string, isValid: boolean): void {\n // Evaluate conditions via registered operators if a rule system is added later\n }\n\n /**\n * Registers a rendered plugin so the condition engine can push dynamic state updates to it.\n * \n * @param bindingPath The JSON path representing the field within the payload.\n * @param plugin The instantiated plugin handling the field.\n */\n public registerPlugin(bindingPath: string, plugin: IPlugin): void {\n this.plugins.set(bindingPath, plugin);\n }\n\n /**\n * Cleans up listeners to prevent memory leaks on destruction.\n */\n public destroy(): void {\n this.plugins.clear();\n }\n}\n"],"mappings":"sDAAA,MAOSA,EAAQC,EAAA,YAIV,MAAMC,EAAmB,IAAIF,EAA4B,aAGhEE,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GAC/CH,EAAiBC,SAAS,MAAO,CAACC,EAAGC,IAAMD,IAAMC,GACjDH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GAC/CH,EAAiBC,SAAS,MAAO,CAACC,EAAGC,IAAMD,IAAMC,GACjDH,EAAiBC,SAAS,IAAK,CAACC,EAAGC,IAAMD,EAAIC,GAC7CH,EAAiBC,SAAS,IAAK,CAACC,EAAGC,IAAMD,EAAIC,GAC7CH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GAC/CH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GASxC,MAAMC,EAOTC,YAAYC,GACRC,KAAKD,OAASA,CAClB,CAKQE,QAAgC,IAAIC,IAOrCC,YAAYC,EAAkBC,GACjC,CASGC,eAAeC,EAAqBC,GACvCR,KAAKC,QAAQQ,IAAIF,EAAaC,EAClC,CAKOE,UACHV,KAAKC,QAAQU,OACjB,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAAnB,mBAAAmB,EAAAf,kBAAA,OAAAe,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"ConditionEngine.js","names":["Registry","___Registry","OperatorRegistry","register","a","b","ConditionEngine","constructor","schema","this","plugins","Map","handleEvent","fieldKey","isValid","registerPlugin","bindingPath","plugin","set","destroy","clear","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\n * @file ConditionEngine.ts\n * @description Evaluates dynamic rules to alter the schema in real-time.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { ISchema } from \"../interfaces/ISchema\";\nimport { Registry } from \"./Registry\";\n\nexport type ConditionOperator = (a: unknown, b: unknown) => boolean;\n\nexport const OperatorRegistry = new Registry<ConditionOperator>(\"Operators\");\n\n// Register basic default operators\nOperatorRegistry.register(\"==\", (a, b) => a == b);\nOperatorRegistry.register(\"===\", (a, b) => a === b);\nOperatorRegistry.register(\"!=\", (a, b) => a != b);\nOperatorRegistry.register(\"!==\", (a, b) => a !== b);\nOperatorRegistry.register(\">\", (a, b) => (a as any) > (b as any));\nOperatorRegistry.register(\"<\", (a, b) => (a as any) < (b as any));\nOperatorRegistry.register(\">=\", (a, b) => (a as any) >= (b as any));\nOperatorRegistry.register(\"<=\", (a, b) => (a as any) <= (b as any));\n\n/**\n * Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).\n * It delegates actual evaluations to the configurable `OperatorRegistry`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class ConditionEngine {\n /** The active form schema being evaluated. */\n private schema: ISchema;\n /**\n * Initializes the ConditionEngine with the active schema.\n * @param schema The current UI layout schema.\n */\n constructor(schema: ISchema) {\n this.schema = schema;\n }\n\n\n\n /** Internal map tracking active plugins against their binding paths for real-time state updates. */\n private plugins: Map<string, IPlugin> = new Map();\n\n /**\n * Internal handler to evaluate business rules when a field is updated.\n * @param fieldKey The key of the field that was changed\n * @param isValid Whether the field is currently valid\n */\n public handleEvent(fieldKey: string, isValid: boolean): void {\n // Evaluate conditions via registered operators if a rule system is added later\n }\n\n /**\n * Registers a rendered plugin so the condition engine can push dynamic state updates to it.\n * \n * @param bindingPath The JSON path representing the field within the payload.\n * @param plugin The instantiated plugin handling the field.\n */\n public registerPlugin(bindingPath: string, plugin: IPlugin): void {\n this.plugins.set(bindingPath, plugin);\n }\n\n /**\n * Cleans up listeners to prevent memory leaks on destruction.\n */\n public destroy(): void {\n this.plugins.clear();\n }\n}\n"],"mappings":"sDAAA,MAOSA,EAAQC,EAAA,YAIV,MAAMC,EAAmB,IAAIF,EAA4B,aAGhEE,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GAC/CH,EAAiBC,SAAS,MAAO,CAACC,EAAGC,IAAMD,IAAMC,GACjDH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GAC/CH,EAAiBC,SAAS,MAAO,CAACC,EAAGC,IAAMD,IAAMC,GACjDH,EAAiBC,SAAS,IAAK,CAACC,EAAGC,IAAOD,EAAaC,GACvDH,EAAiBC,SAAS,IAAK,CAACC,EAAGC,IAAOD,EAAaC,GACvDH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAOD,GAAcC,GACzDH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAOD,GAAcC,GASlD,MAAMC,EAOTC,YAAYC,GACRC,KAAKD,OAASA,CAClB,CAKQE,QAAgC,IAAIC,IAOrCC,YAAYC,EAAkBC,GACjC,CASGC,eAAeC,EAAqBC,GACvCR,KAAKC,QAAQQ,IAAIF,EAAaC,EAClC,CAKOE,UACHV,KAAKC,QAAQU,OACjB,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAAnB,mBAAAmB,EAAAf,kBAAA,OAAAe,CAAA","ignoreList":[]}
@@ -16,10 +16,10 @@ OperatorRegistry.register("==", (a, b) => a == b);
16
16
  OperatorRegistry.register("===", (a, b) => a === b);
17
17
  OperatorRegistry.register("!=", (a, b) => a != b);
18
18
  OperatorRegistry.register("!==", (a, b) => a !== b);
19
- OperatorRegistry.register(">", (a, b) => a > b);
20
- OperatorRegistry.register("<", (a, b) => a < b);
21
- OperatorRegistry.register(">=", (a, b) => a >= b);
22
- OperatorRegistry.register("<=", (a, b) => a <= b);
19
+ OperatorRegistry.register(">", (a, b) => (a as any) > (b as any));
20
+ OperatorRegistry.register("<", (a, b) => (a as any) < (b as any));
21
+ OperatorRegistry.register(">=", (a, b) => (a as any) >= (b as any));
22
+ OperatorRegistry.register("<=", (a, b) => (a as any) <= (b as any));
23
23
 
24
24
  /**
25
25
  * Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).
@@ -80,10 +80,6 @@ sap.ui.define(["./ConditionEngine", "./PluginRegistry", "sap/m/Text", "../utils/
80
80
  }
81
81
  };
82
82
  try {
83
- // Intercept and synthesize a default layout if the developer/backend failed to provide one
84
- if (DefaultLayoutGenerator.ensureLayout(schema)) {
85
- Logger.warn("[MetaUI Engine] Missing 'uiLayout' array in schema. Synthesized a default layout mapping to prevent a blank render.");
86
- }
87
83
  const layoutStrategy = schema.layoutStrategy || (schema.type === "array" ? "table" : "form");
88
84
  const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);
89
85
  return layoutManager.render(schema, modelName, this, onSubmit);
@@ -150,6 +146,9 @@ sap.ui.define(["./ConditionEngine", "./PluginRegistry", "sap/m/Text", "../utils/
150
146
  */
151
147
  generateLayout(schema, modelName, bindingPath) {
152
148
  try {
149
+ if (DefaultLayoutGenerator.ensureLayout(schema)) {
150
+ Logger.warn(`[MetaUI Engine] Missing 'uiLayout' array in sub-schema for ${bindingPath}. Synthesized a default layout mapping.`);
151
+ }
153
152
  const layoutStrategy = schema.layoutStrategy || (schema.type === "array" ? "table" : "form");
154
153
  const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);
155
154
  return layoutManager.render(schema, modelName, this, undefined, bindingPath);
@@ -1 +1 @@
1
- {"version":3,"file":"Engine-dbg.js","names":["ConditionEngine","___ConditionEngine","PluginRegistry","___PluginRegistry","Logger","___utils_Logger","DefaultLayoutGenerator","___DefaultLayoutGenerator","Engine","conditionEngine","activePlugins","isEditable","hasPartialRenderingErrors","useMessageManager","constructor","editable","pluginRegistry","getInstance","build","schema","model","modelName","onSubmit","engineScopeId","onChange","activeModel","isValid","fieldKey","errorMessage","controlId","handleEvent","ensureLayout","warn","layoutStrategy","type","layoutManager","getLayout","render","error","msg","message","showErrorPopup","Text","text","generateField","fieldMeta","bindingPath","isTemplate","plugin","getPlugin","ui","widget","setEditable","setUseMessageManager","push","path","scopeId","undefined","control","registerPlugin","generateLayout","validateAll","applyVisualState","errors","item","result","validate","setVisualValidationState","replace","name","getPluginByPath","cleanPath","startsWith","match","find","p","destroy","messageManager","Messaging","existingMessages","getMessageModel","getData","messagesToRemove","targetPath","matched","filter","getTarget","getMessageProcessor","getId","length","removeMessages","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\n * @file Engine.ts\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry (v2).\n */\n\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPlugin, IPluginValidationResult } from \"../interfaces/IPlugin\";\nimport { ConditionEngine } from \"./ConditionEngine\";\nimport { PluginRegistry } from \"./PluginRegistry\";\nimport Control from \"sap/ui/core/Control\";\nimport VBox from \"sap/m/VBox\";\nimport Text from \"sap/m/Text\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n/**\n * The Engine is responsible for translating a normalized schema into a physical UI5 layout.\n * It delegates layout generation to the configured `LayoutManager` and field generation to the `PluginRegistry`.\n * It strictly routes execution flow and tracks active plugins for validation.\n * It embodies the \"Plugin-First Philosophy\" by routing all complex field and layout rendering\n * through discrete, decoupled plugins rather than handling native overrides.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Engine {\n /** Handles dynamic conditional logic across the active form. */\n private conditionEngine: ConditionEngine | null = null;\n\n /** Array of all instantiated plugins generated during the current build. */\n private activePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Deterministic scope ID injected by the host control to prevent clone collisions. */\n public engineScopeId?: string;\n\n private activeModel?: sap.ui.model.Model;\n\n /** Reference to the GeneratorHost that instantiated this engine, for retrieving global definitions. */\n public host?: unknown;\n\n /** Callback to notify the host that an internal field changed. */\n public onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** Tracks whether the entire engine is running in Editable mode. */\n public readonly isEditable: boolean = true;\n\n /** Tracks if any fields or sub-layouts failed to render, requiring a warning strip. */\n public hasPartialRenderingErrors: boolean = false;\n\n /** Tracks whether the engine should delegate visual state to the global MessageManager. */\n public readonly useMessageManager: boolean = false;\n\n /** The injected PluginRegistry instance */\n public readonly pluginRegistry: PluginRegistry;\n\n /**\n * Initializes a new Engine instance.\n * @param editable Whether the engine should render form fields as editable or read-only.\n * @param useMessageManager Whether to delegate visual state to UI5 MessageManager.\n * @param pluginRegistry Optional injected plugin registry. Defaults to singleton.\n */\n constructor(editable: boolean = true, useMessageManager: boolean = false, pluginRegistry?: PluginRegistry) {\n this.isEditable = editable;\n this.useMessageManager = useMessageManager;\n this.pluginRegistry = pluginRegistry || PluginRegistry.getInstance();\n }\n\n /**\n * Bootstraps the layout generation process by resolving the correct layout strategy.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param model The active StateManager JSONModel instance.\n * @param modelName The UI5 model alias used for isolation.\n * @param onSubmit Callback fired when form is submitted.\n * @param engineScopeId Deterministic scope ID for this engine instance.\n * @param onChange Callback fired when field values change.\n * @returns The generated root UI5 Control container.\n */\n public build(schema: ISchema, model: sap.ui.model.Model, modelName: string = \"meta\", onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control {\n this.conditionEngine = new ConditionEngine(schema);\n this.activePlugins = [];\n this.activeModel = model;\n this.engineScopeId = engineScopeId;\n this.onChange = (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => {\n if (this.conditionEngine && fieldKey) {\n this.conditionEngine.handleEvent(fieldKey, isValid);\n }\n if (onChange) {\n onChange(isValid, fieldKey, errorMessage, controlId);\n }\n };\n\n try {\n // Intercept and synthesize a default layout if the developer/backend failed to provide one\n if (DefaultLayoutGenerator.ensureLayout(schema)) {\n Logger.warn(\"[MetaUI Engine] Missing 'uiLayout' array in schema. Synthesized a default layout mapping to prevent a blank render.\");\n }\n\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n\n return layoutManager.render(schema, modelName, this, onSubmit);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(\"[MetaUI Engine] Critical error during layout generation\", msg);\n Logger.showErrorPopup(`Engine failed to generate the layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Layout Error\" });\n }\n }\n\n /**\n * Instantiates the correct plugin for a specific field based on type and widget hints,\n * and tracks the plugin for global validation.\n * \n * @param fieldMeta The metadata schema specific to the field.\n * @param bindingPath The JSON path representing the field within the payload.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @returns The generated UI5 Control for the field.\n */\n public generateField(fieldMeta: IPropertyMetadata, bindingPath: string, modelName: string, isTemplate: boolean = false): Control {\n try {\n const plugin = this.pluginRegistry.getPlugin(fieldMeta.type || \"string\", fieldMeta.ui?.widget);\n if (typeof plugin.setEditable === \"function\") {\n plugin.setEditable(this.isEditable);\n }\n\n if (typeof plugin.setUseMessageManager === \"function\") {\n plugin.setUseMessageManager(this.useMessageManager);\n }\n\n if (!isTemplate) {\n this.activePlugins.push({ plugin, path: bindingPath });\n }\n const scopeId = isTemplate ? undefined : this.engineScopeId;\n const control = plugin.render(fieldMeta, bindingPath, modelName, scopeId, this.onChange, this.activeModel);\n\n if (this.conditionEngine) {\n this.conditionEngine.registerPlugin(bindingPath, plugin);\n }\n\n return control;\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Failed to generate field at ${bindingPath}`, msg);\n Logger.showErrorPopup(`Failed to generate field '${bindingPath}'.\\n\\nDetails: ${msg}`);\n return new Text({ text: `[Error generating field ${bindingPath}]` });\n }\n }\n\n /**\n * Generates a sub-layout (like an embedded table or nested form) without \n * destroying the current Engine state or Condition tracking.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param modelName The UI5 JSONModel name used for data binding (defaults to \"meta\").\n * @param bindingPath Optional path to bind the sub-layout to a specific array/object property.\n * @returns The generated root UI5 Control container.\n */\n public generateLayout(schema: ISchema, modelName: string, bindingPath?: string): Control {\n try {\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n return layoutManager.render(schema, modelName, this, undefined, bindingPath);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Critical error generating sub-layout for ${bindingPath}`, msg);\n Logger.showErrorPopup(`Engine failed to generate a sub-layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Sub-Layout Error\" });\n }\n }\n\n /**\n * Iterates through all active plugins and triggers their internal validation pipelines.\n * \n * @param applyVisualState If true, explicitly instructs the plugin to natively paint its own ValueState.\n * @returns {IPluginValidationResult[]} Array of validation error objects. Empty array if valid.\n */\n public validateAll(applyVisualState: boolean = false): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n for (const item of this.activePlugins) {\n try {\n const result = item.plugin.validate();\n if (applyVisualState && typeof item.plugin.setVisualValidationState === \"function\") {\n item.plugin.setVisualValidationState(result.isValid, result.errorMessage);\n }\n\n if (!result.isValid) {\n // Ensure the path is bound to the error so GeneratorHost knows where to target it\n result.fieldKey = result.fieldKey || item.path.replace(/^\\//, \"\");\n errors.push(result);\n // Add console log to find which plugin fails silently\n Logger.error(\"[MetaUI Validation] Plugin failed validation silently:\", item.path || item.plugin.constructor.name);\n }\n } catch (error) {\n Logger.error(`[MetaUI Engine] Error validating plugin at ${item.path}`, (error as Error).message);\n }\n }\n return errors;\n }\n\n /**\n * Retrieves an active plugin instance by its absolute binding path.\n * Useful for programmatic field manipulation (e.g., custom error injection).\n * \n * @param path The binding path (e.g. \"/General/CustomerName\").\n * @returns {IPlugin | undefined} The plugin instance, or undefined if not found.\n */\n public getPluginByPath(path: string): import(\"../interfaces/IPlugin\").IPlugin | undefined {\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n const match = this.activePlugins.find(p => p.path === cleanPath || p.path === `/${cleanPath}`);\n return match ? match.plugin : undefined;\n }\n\n /**\n * Cleans up internal state and destroys the condition engine to prevent memory leaks.\n */\n public destroy(): void {\n if (this.conditionEngine) {\n this.conditionEngine.destroy();\n this.conditionEngine = null;\n }\n\n // ------------------------------------------------------------------------\n // Ghost Error Prevention\n // Flush MessageManager for active plugins before destroying their controls\n // ------------------------------------------------------------------------\n const messageManager = Messaging;\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove: unknown[] = [];\n\n for (const item of this.activePlugins) {\n if (this.activeModel) {\n const targetPath = `/${item.path.replace(/^\\//, \"\")}`;\n const matched = (existingMessages as { getTarget: () => string, getMessageProcessor: () => { getId: () => string } }[]).filter(msg =>\n msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.activeModel!.getId()\n );\n messagesToRemove.push(...matched);\n }\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messag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E;QACnC,IAAI,IAAI,CAACe,WAAW,EAAE;UAClB,MAAM0D,UAAU,GAAG,IAAInB,IAAI,CAACT,IAAI,CAACa,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE;UACrD,MAAMgB,OAAO,GAAIL,gBAAgB,CAAuFM,MAAM,CAAC9C,GAAG,IAC9HA,GAAG,CAAC+C,SAAS,CAAC,CAAC,KAAKH,UAAU,IAAI5C,GAAG,CAACgD,mBAAmB,CAAC,CAAC,IAAIhD,GAAG,CAACgD,mBAAmB,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC/D,WAAW,CAAE+D,KAAK,CAAC,CACjI,CAAC;UACDN,gBAAgB,CAAC5B,IAAI,CAAC,GAAG8B,OAAO,CAAC;QACrC;QACA,IAAI,OAAOpB,IAAI,CAAChB,MAAM,CAAC4B,OAAO,KAAK,UAAU,EAAE;UAC3CZ,IAAI,CAAChB,MAAM,CAAC4B,OAAO,CAAC,CAAC;QACzB;MACJ;MAEA,IAAIM,gBAAgB,CAACO,MAAM,GAAG,CAAC,EAAE;QAC7BZ,cAAc,CAACa,cAAc,CAACR,gBAAgB,CAAC;MACnD;MAEA,IAAI,CAACxE,aAAa,GAAG,EAAE;IAC3B;EACJ;EAAC,IAAAiF,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAnF,MAAA,GAAAA,MAAA;EAAA,OAAAmF,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"Engine-dbg.js","names":["ConditionEngine","___ConditionEngine","PluginRegistry","___PluginRegistry","Logger","___utils_Logger","DefaultLayoutGenerator","___DefaultLayoutGenerator","Engine","conditionEngine","activePlugins","isEditable","hasPartialRenderingErrors","useMessageManager","constructor","editable","pluginRegistry","getInstance","build","schema","model","modelName","onSubmit","engineScopeId","onChange","activeModel","isValid","fieldKey","errorMessage","controlId","handleEvent","layoutStrategy","type","layoutManager","getLayout","render","error","msg","message","showErrorPopup","Text","text","generateField","fieldMeta","bindingPath","isTemplate","plugin","getPlugin","ui","widget","setEditable","setUseMessageManager","push","path","scopeId","undefined","control","registerPlugin","generateLayout","ensureLayout","warn","validateAll","applyVisualState","errors","item","result","validate","setVisualValidationState","replace","name","getPluginByPath","cleanPath","startsWith","match","find","p","destroy","messageManager","Messaging","existingMessages","getMessageModel","getData","messagesToRemove","targetPath","matched","filter","getTarget","getMessageProcessor","getId","length","removeMessages","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\n * @file Engine.ts\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry (v2).\n */\n\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPlugin, IPluginValidationResult } from \"../interfaces/IPlugin\";\nimport { ConditionEngine } from \"./ConditionEngine\";\nimport { PluginRegistry } from \"./PluginRegistry\";\nimport Control from \"sap/ui/core/Control\";\nimport VBox from \"sap/m/VBox\";\nimport Text from \"sap/m/Text\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n/**\n * The Engine is responsible for translating a normalized schema into a physical UI5 layout.\n * It delegates layout generation to the configured `LayoutManager` and field generation to the `PluginRegistry`.\n * It strictly routes execution flow and tracks active plugins for validation.\n * It embodies the \"Plugin-First Philosophy\" by routing all complex field and layout rendering\n * through discrete, decoupled plugins rather than handling native overrides.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Engine {\n /** Handles dynamic conditional logic across the active form. */\n private conditionEngine: ConditionEngine | null = null;\n\n /** Array of all instantiated plugins generated during the current build. */\n private activePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Deterministic scope ID injected by the host control to prevent clone collisions. */\n public engineScopeId?: string;\n\n private activeModel?: any;\n\n /** Reference to the GeneratorHost that instantiated this engine, for retrieving global definitions. */\n public host?: unknown;\n\n /** Callback to notify the host that an internal field changed. */\n public onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** Tracks whether the entire engine is running in Editable mode. */\n public readonly isEditable: boolean = true;\n\n /** Tracks if any fields or sub-layouts failed to render, requiring a warning strip. */\n public hasPartialRenderingErrors: boolean = false;\n\n /** Tracks whether the engine should delegate visual state to the global MessageManager. */\n public readonly useMessageManager: boolean = false;\n\n /** The injected PluginRegistry instance */\n public readonly pluginRegistry: PluginRegistry;\n\n /**\n * Initializes a new Engine instance.\n * @param editable Whether the engine should render form fields as editable or read-only.\n * @param useMessageManager Whether to delegate visual state to UI5 MessageManager.\n * @param pluginRegistry Optional injected plugin registry. Defaults to singleton.\n */\n constructor(editable: boolean = true, useMessageManager: boolean = false, pluginRegistry?: PluginRegistry) {\n this.isEditable = editable;\n this.useMessageManager = useMessageManager;\n this.pluginRegistry = pluginRegistry || PluginRegistry.getInstance();\n }\n\n /**\n * Bootstraps the layout generation process by resolving the correct layout strategy.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param model The active StateManager JSONModel instance.\n * @param modelName The UI5 model alias used for isolation.\n * @param onSubmit Callback fired when form is submitted.\n * @param engineScopeId Deterministic scope ID for this engine instance.\n * @param onChange Callback fired when field values change.\n * @returns The generated root UI5 Control container.\n */\n public build(schema: ISchema, model: any, modelName: string = \"meta\", onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control {\n this.conditionEngine = new ConditionEngine(schema);\n this.activePlugins = [];\n this.activeModel = model;\n this.engineScopeId = engineScopeId;\n this.onChange = (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => {\n if (this.conditionEngine && fieldKey) {\n this.conditionEngine.handleEvent(fieldKey, isValid);\n }\n if (onChange) {\n onChange(isValid, fieldKey, errorMessage, controlId);\n }\n };\n\n try {\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n\n return layoutManager.render(schema, modelName, this, onSubmit);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(\"[MetaUI Engine] Critical error during layout generation\", msg);\n Logger.showErrorPopup(`Engine failed to generate the layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Layout Error\" });\n }\n }\n\n /**\n * Instantiates the correct plugin for a specific field based on type and widget hints,\n * and tracks the plugin for global validation.\n * \n * @param fieldMeta The metadata schema specific to the field.\n * @param bindingPath The JSON path representing the field within the payload.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @returns The generated UI5 Control for the field.\n */\n public generateField(fieldMeta: IPropertyMetadata, bindingPath: string, modelName: string, isTemplate: boolean = false): Control {\n try {\n const plugin = this.pluginRegistry.getPlugin(fieldMeta.type || \"string\", fieldMeta.ui?.widget);\n if (typeof plugin.setEditable === \"function\") {\n plugin.setEditable(this.isEditable);\n }\n\n if (typeof plugin.setUseMessageManager === \"function\") {\n plugin.setUseMessageManager(this.useMessageManager);\n }\n\n if (!isTemplate) {\n this.activePlugins.push({ plugin, path: bindingPath });\n }\n const scopeId = isTemplate ? undefined : this.engineScopeId;\n const control = plugin.render(fieldMeta, bindingPath, modelName, scopeId, this.onChange, this.activeModel);\n\n if (this.conditionEngine) {\n this.conditionEngine.registerPlugin(bindingPath, plugin);\n }\n\n return control;\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Failed to generate field at ${bindingPath}`, msg);\n Logger.showErrorPopup(`Failed to generate field '${bindingPath}'.\\n\\nDetails: ${msg}`);\n return new Text({ text: `[Error generating field ${bindingPath}]` });\n }\n }\n\n /**\n * Generates a sub-layout (like an embedded table or nested form) without \n * destroying the current Engine state or Condition tracking.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param modelName The UI5 JSONModel name used for data binding (defaults to \"meta\").\n * @param bindingPath Optional path to bind the sub-layout to a specific array/object property.\n * @returns The generated root UI5 Control container.\n */\n public generateLayout(schema: ISchema, modelName: string, bindingPath?: string): Control {\n try {\n if (DefaultLayoutGenerator.ensureLayout(schema)) {\n Logger.warn(`[MetaUI Engine] Missing 'uiLayout' array in sub-schema for ${bindingPath}. Synthesized a default layout mapping.`);\n }\n\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n return layoutManager.render(schema, modelName, this, undefined, bindingPath);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Critical error generating sub-layout for ${bindingPath}`, msg);\n Logger.showErrorPopup(`Engine failed to generate a sub-layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Sub-Layout Error\" });\n }\n }\n\n /**\n * Iterates through all active plugins and triggers their internal validation pipelines.\n * \n * @param applyVisualState If true, explicitly instructs the plugin to natively paint its own ValueState.\n * @returns {IPluginValidationResult[]} Array of validation error objects. Empty array if valid.\n */\n public validateAll(applyVisualState: boolean = false): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n for (const item of this.activePlugins) {\n try {\n const result = item.plugin.validate();\n if (applyVisualState && typeof item.plugin.setVisualValidationState === \"function\") {\n item.plugin.setVisualValidationState(result.isValid, result.errorMessage);\n }\n\n if (!result.isValid) {\n // Ensure the path is bound to the error so GeneratorHost knows where to target it\n result.fieldKey = result.fieldKey || item.path.replace(/^\\//, \"\");\n errors.push(result);\n // Add console log to find which plugin fails silently\n Logger.error(\"[MetaUI Validation] Plugin failed validation silently:\", item.path || item.plugin.constructor.name);\n }\n } catch (error) {\n Logger.error(`[MetaUI Engine] Error validating plugin at ${item.path}`, (error as Error).message);\n }\n }\n return errors;\n }\n\n /**\n * Retrieves an active plugin instance by its absolute binding path.\n * Useful for programmatic field manipulation (e.g., custom error injection).\n * \n * @param path The binding path (e.g. \"/General/CustomerName\").\n * @returns {IPlugin | undefined} The plugin instance, or undefined if not found.\n */\n public getPluginByPath(path: string): import(\"../interfaces/IPlugin\").IPlugin | undefined {\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n const match = this.activePlugins.find(p => p.path === cleanPath || p.path === `/${cleanPath}`);\n return match ? match.plugin : undefined;\n }\n\n /**\n * Cleans up internal state and destroys the condition engine to prevent memory leaks.\n */\n public destroy(): void {\n if (this.conditionEngine) {\n this.conditionEngine.destroy();\n this.conditionEngine = null;\n }\n\n // ------------------------------------------------------------------------\n // Ghost Error Prevention\n // Flush MessageManager for active plugins before destroying their controls\n // ------------------------------------------------------------------------\n const messageManager = Messaging;\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove: unknown[] = [];\n\n for (const item of this.activePlugins) {\n if (this.activeModel) {\n const targetPath = `/${item.path.replace(/^\\//, \"\")}`;\n const matched = (existingMessages as { getTarget: () => string, getMessageProcessor: () => { getId: () => string } }[]).filter(msg =>\n msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.activeModel!.getId()\n );\n messagesToRemove.push(...matched);\n }\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n\n this.activePlugins = [];\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAQSA,eAAe,GAAAC,kBAAA;EAAA,MACfC,cAAc,GAAAC,iBAAA;EAAA,MAIdC,MAAM,GAAAC,eAAA;EAAA,MACNC,sBAAsB,GAAAC,yBAAA;EAI/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,MAAM,CAAC;IAChB;IACQC,eAAe,GAA2B,IAAI;;IAEtD;IACQC,aAAa,GAAwC,EAAE;;IAE/D;;IAKA;;IAGA;;IAGA;IACgBC,UAAU,GAAY,IAAI;;IAE1C;IACOC,yBAAyB,GAAY,KAAK;;IA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,gBAAgB,CAAC9B,IAAI,CAAC,GAAGgC,OAAO,CAAC;QACrC;QACA,IAAI,OAAOpB,IAAI,CAAClB,MAAM,CAAC8B,OAAO,KAAK,UAAU,EAAE;UAC3CZ,IAAI,CAAClB,MAAM,CAAC8B,OAAO,CAAC,CAAC;QACzB;MACJ;MAEA,IAAIM,gBAAgB,CAACO,MAAM,GAAG,CAAC,EAAE;QAC7BZ,cAAc,CAACa,cAAc,CAACR,gBAAgB,CAAC;MACnD;MAEA,IAAI,CAACxE,aAAa,GAAG,EAAE;IAC3B;EACJ;EAAC,IAAAiF,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAnF,MAAA,GAAAA,MAAA;EAAA,OAAAmF,SAAA;AAAA","ignoreList":[]}
@@ -55,7 +55,7 @@ declare module "nz/co/siliconst/ui5/metaui/core/Engine" {
55
55
  * @param onChange Callback fired when field values change.
56
56
  * @returns The generated root UI5 Control container.
57
57
  */
58
- build(schema: ISchema, model: sap.ui.model.Model, modelName?: string, onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control;
58
+ build(schema: ISchema, model: any, modelName?: string, onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control;
59
59
  /**
60
60
  * Instantiates the correct plugin for a specific field based on type and widget hints,
61
61
  * and tracks the plugin for global validation.
@@ -1 +1 @@
1
- {"version":3,"file":"Engine.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/Engine.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,wCAAwC,CAAC;IACxD;;;OAGG;IAEH,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAE3F,OAAO,EAAW,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;IAEjG,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;IAChF,O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logger","./DefaultLayoutGenerator","sap/ui/core/Messaging"],function(e,t,i,n,s,a){"use strict";const r=e["ConditionEngine"];const o=t["PluginRegistry"];const g=n["Logger"];const l=s["DefaultLayoutGenerator"];class u{conditionEngine=null;activePlugins=[];isEditable=true;hasPartialRenderingErrors=false;useMessageManager=false;constructor(e=true,t=false,i){this.isEditable=e;this.useMessageManager=t;this.pluginRegistry=i||o.getInstance()}build(e,t,n="meta",s,a,o){this.conditionEngine=new r(e);this.activePlugins=[];this.activeModel=t;this.engineScopeId=a;this.onChange=(e,t,i,n)=>{if(this.conditionEngine&&t){this.conditionEngine.handleEvent(t,e)}if(o){o(e,t,i,n)}};try{if(l.ensureLayout(e)){g.warn("[MetaUI Engine] Missing 'uiLayout' array in schema. Synthesized a default layout mapping to prevent a blank render.")}const t=e.layoutStrategy||(e.type==="array"?"table":"form");const i=this.pluginRegistry.getLayout(t);return i.render(e,n,this,s)}catch(e){this.hasPartialRenderingErrors=true;const t=e.message;g.error("[MetaUI Engine] Critical error during layout generation",t);g.showErrorPopup(`Engine failed to generate the layout.\n\nDetails: ${t}`);return new i({text:"Critical Layout Error"})}}generateField(e,t,n,s=false){try{const i=this.pluginRegistry.getPlugin(e.type||"string",e.ui?.widget);if(typeof i.setEditable==="function"){i.setEditable(this.isEditable)}if(typeof i.setUseMessageManager==="function"){i.setUseMessageManager(this.useMessageManager)}if(!s){this.activePlugins.push({plugin:i,path:t})}const a=s?undefined:this.engineScopeId;const r=i.render(e,t,n,a,this.onChange,this.activeModel);if(this.conditionEngine){this.conditionEngine.registerPlugin(t,i)}return r}catch(e){this.hasPartialRenderingErrors=true;const n=e.message;g.error(`[MetaUI Engine] Failed to generate field at ${t}`,n);g.showErrorPopup(`Failed to generate field '${t}'.\n\nDetails: ${n}`);return new i({text:`[Error generating field ${t}]`})}}generateLayout(e,t,n){try{const i=e.layoutStrategy||(e.type==="array"?"table":"form");const s=this.pluginRegistry.getLayout(i);return s.render(e,t,this,undefined,n)}catch(e){this.hasPartialRenderingErrors=true;const t=e.message;g.error(`[MetaUI Engine] Critical error generating sub-layout for ${n}`,t);g.showErrorPopup(`Engine failed to generate a sub-layout.\n\nDetails: ${t}`);return new i({text:"Critical Sub-Layout Error"})}}validateAll(e=false){const t=[];for(const i of this.activePlugins){try{const n=i.plugin.validate();if(e&&typeof i.plugin.setVisualValidationState==="function"){i.plugin.setVisualValidationState(n.isValid,n.errorMessage)}if(!n.isValid){n.fieldKey=n.fieldKey||i.path.replace(/^\//,"");t.push(n);g.error("[MetaUI Validation] Plugin failed validation silently:",i.path||i.plugin.constructor.name)}}catch(e){g.error(`[MetaUI Engine] Error validating plugin at ${i.path}`,e.message)}}return t}getPluginByPath(e){const t=e.startsWith("/")?e:`/${e}`;const i=this.activePlugins.find(e=>e.path===t||e.path===`/${t}`);return i?i.plugin:undefined}destroy(){if(this.conditionEngine){this.conditionEngine.destroy();this.conditionEngine=null}const e=a;const t=e.getMessageModel().getData();const i=[];for(const e of this.activePlugins){if(this.activeModel){const n=`/${e.path.replace(/^\//,"")}`;const s=t.filter(e=>e.getTarget()===n&&e.getMessageProcessor()&&e.getMessageProcessor().getId()===this.activeModel.getId());i.push(...s)}if(typeof e.plugin.destroy==="function"){e.plugin.destroy()}}if(i.length>0){e.removeMessages(i)}this.activePlugins=[]}}var c={__esModule:true};c.Engine=u;return c});
1
+ sap.ui.define(["./ConditionEngine","./PluginRegistry","sap/m/Text","../utils/Logger","./DefaultLayoutGenerator","sap/ui/core/Messaging"],function(e,t,i,n,s,a){"use strict";const r=e["ConditionEngine"];const o=t["PluginRegistry"];const g=n["Logger"];const l=s["DefaultLayoutGenerator"];class u{conditionEngine=null;activePlugins=[];isEditable=true;hasPartialRenderingErrors=false;useMessageManager=false;constructor(e=true,t=false,i){this.isEditable=e;this.useMessageManager=t;this.pluginRegistry=i||o.getInstance()}build(e,t,n="meta",s,a,o){this.conditionEngine=new r(e);this.activePlugins=[];this.activeModel=t;this.engineScopeId=a;this.onChange=(e,t,i,n)=>{if(this.conditionEngine&&t){this.conditionEngine.handleEvent(t,e)}if(o){o(e,t,i,n)}};try{const t=e.layoutStrategy||(e.type==="array"?"table":"form");const i=this.pluginRegistry.getLayout(t);return i.render(e,n,this,s)}catch(e){this.hasPartialRenderingErrors=true;const t=e.message;g.error("[MetaUI Engine] Critical error during layout generation",t);g.showErrorPopup(`Engine failed to generate the layout.\n\nDetails: ${t}`);return new i({text:"Critical Layout Error"})}}generateField(e,t,n,s=false){try{const i=this.pluginRegistry.getPlugin(e.type||"string",e.ui?.widget);if(typeof i.setEditable==="function"){i.setEditable(this.isEditable)}if(typeof i.setUseMessageManager==="function"){i.setUseMessageManager(this.useMessageManager)}if(!s){this.activePlugins.push({plugin:i,path:t})}const a=s?undefined:this.engineScopeId;const r=i.render(e,t,n,a,this.onChange,this.activeModel);if(this.conditionEngine){this.conditionEngine.registerPlugin(t,i)}return r}catch(e){this.hasPartialRenderingErrors=true;const n=e.message;g.error(`[MetaUI Engine] Failed to generate field at ${t}`,n);g.showErrorPopup(`Failed to generate field '${t}'.\n\nDetails: ${n}`);return new i({text:`[Error generating field ${t}]`})}}generateLayout(e,t,n){try{if(l.ensureLayout(e)){g.warn(`[MetaUI Engine] Missing 'uiLayout' array in sub-schema for ${n}. Synthesized a default layout mapping.`)}const i=e.layoutStrategy||(e.type==="array"?"table":"form");const s=this.pluginRegistry.getLayout(i);return s.render(e,t,this,undefined,n)}catch(e){this.hasPartialRenderingErrors=true;const t=e.message;g.error(`[MetaUI Engine] Critical error generating sub-layout for ${n}`,t);g.showErrorPopup(`Engine failed to generate a sub-layout.\n\nDetails: ${t}`);return new i({text:"Critical Sub-Layout Error"})}}validateAll(e=false){const t=[];for(const i of this.activePlugins){try{const n=i.plugin.validate();if(e&&typeof i.plugin.setVisualValidationState==="function"){i.plugin.setVisualValidationState(n.isValid,n.errorMessage)}if(!n.isValid){n.fieldKey=n.fieldKey||i.path.replace(/^\//,"");t.push(n);g.error("[MetaUI Validation] Plugin failed validation silently:",i.path||i.plugin.constructor.name)}}catch(e){g.error(`[MetaUI Engine] Error validating plugin at ${i.path}`,e.message)}}return t}getPluginByPath(e){const t=e.startsWith("/")?e:`/${e}`;const i=this.activePlugins.find(e=>e.path===t||e.path===`/${t}`);return i?i.plugin:undefined}destroy(){if(this.conditionEngine){this.conditionEngine.destroy();this.conditionEngine=null}const e=a;const t=e.getMessageModel().getData();const i=[];for(const e of this.activePlugins){if(this.activeModel){const n=`/${e.path.replace(/^\//,"")}`;const s=t.filter(e=>e.getTarget()===n&&e.getMessageProcessor()&&e.getMessageProcessor().getId()===this.activeModel.getId());i.push(...s)}if(typeof e.plugin.destroy==="function"){e.plugin.destroy()}}if(i.length>0){e.removeMessages(i)}this.activePlugins=[]}}var c={__esModule:true};c.Engine=u;return c});
2
2
  //# sourceMappingURL=Engine.js.map