@siliconst/metaui 1.4.10 → 1.4.14

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 (335) hide show
  1. package/README.md +4 -178
  2. package/package.json +1 -1
  3. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +95 -10
  4. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js.map +1 -1
  5. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts +27 -3
  6. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
  7. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
  8. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
  9. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +96 -11
  10. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +174 -18
  11. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js.map +1 -1
  12. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts +18 -9
  13. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts.map +1 -1
  14. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
  15. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
  16. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +164 -18
  17. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate-dbg.js +1 -3
  18. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate-dbg.js.map +1 -1
  19. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.d.ts.map +1 -1
  20. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.js +1 -1
  21. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.js.map +1 -1
  22. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.ts +1 -3
  23. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js +24 -6
  24. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js.map +1 -1
  25. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts +7 -1
  26. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts.map +1 -1
  27. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js +1 -1
  28. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js.map +1 -1
  29. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.ts +24 -6
  30. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js +56 -49
  31. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js.map +1 -1
  32. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.d.ts +9 -4
  33. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.d.ts.map +1 -1
  34. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js +1 -1
  35. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js.map +1 -1
  36. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts +67 -50
  37. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js +0 -2
  38. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js.map +1 -1
  39. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts +0 -2
  40. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts.map +1 -1
  41. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js.map +1 -1
  42. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.ts +0 -3
  43. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator-dbg.js +4 -6
  44. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator-dbg.js.map +1 -1
  45. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.js +1 -1
  46. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.js.map +1 -1
  47. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.ts +4 -4
  48. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +34 -9
  49. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
  50. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +16 -2
  51. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
  52. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +1 -1
  53. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
  54. package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +36 -5
  55. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +19 -2
  56. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -1
  57. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts +9 -0
  58. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -1
  59. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +1 -1
  60. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -1
  61. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts +21 -7
  62. package/src/nz/co/siliconst/ui5/metaui/core/Registry-dbg.js +3 -1
  63. package/src/nz/co/siliconst/ui5/metaui/core/Registry-dbg.js.map +1 -1
  64. package/src/nz/co/siliconst/ui5/metaui/core/Registry.d.ts.map +1 -1
  65. package/src/nz/co/siliconst/ui5/metaui/core/Registry.js +1 -1
  66. package/src/nz/co/siliconst/ui5/metaui/core/Registry.js.map +1 -1
  67. package/src/nz/co/siliconst/ui5/metaui/core/Registry.ts +3 -1
  68. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry-dbg.js +47 -0
  69. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry-dbg.js.map +1 -0
  70. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.d.ts +23 -0
  71. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.d.ts.map +1 -0
  72. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.js +2 -0
  73. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.js.map +1 -0
  74. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.ts +45 -0
  75. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +71 -34
  76. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -1
  77. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +13 -2
  78. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -1
  79. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +1 -1
  80. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -1
  81. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts +74 -35
  82. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator-dbg.js +7 -6
  83. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator-dbg.js.map +1 -1
  84. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.d.ts.map +1 -1
  85. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.js +1 -1
  86. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.js.map +1 -1
  87. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.ts +7 -6
  88. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js +40 -11
  89. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -1
  90. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts +6 -1
  91. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts.map +1 -1
  92. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js +1 -1
  93. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -1
  94. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +39 -13
  95. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -1
  96. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +13 -0
  97. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -1
  98. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +15 -0
  99. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
  100. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +8 -0
  101. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
  102. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +10 -0
  103. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin-dbg.js +2 -0
  104. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin-dbg.js.map +1 -0
  105. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.d.ts +23 -0
  106. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.d.ts.map +1 -0
  107. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.js +2 -0
  108. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.js.map +1 -0
  109. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.ts +23 -0
  110. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +6 -1
  111. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -1
  112. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -1
  113. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +1 -1
  114. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -1
  115. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +6 -1
  116. package/src/nz/co/siliconst/ui5/metaui/library-dbg.js +1 -1
  117. package/src/nz/co/siliconst/ui5/metaui/library-dbg.js.map +1 -1
  118. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +50 -41
  119. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  120. package/src/nz/co/siliconst/ui5/metaui/library.d.ts +1 -0
  121. package/src/nz/co/siliconst/ui5/metaui/library.d.ts.map +1 -1
  122. package/src/nz/co/siliconst/ui5/metaui/library.js +1 -1
  123. package/src/nz/co/siliconst/ui5/metaui/library.js.map +1 -1
  124. package/src/nz/co/siliconst/ui5/metaui/library.ts +1 -0
  125. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js +2 -2
  126. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js.map +1 -1
  127. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js +1 -1
  128. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js.map +1 -1
  129. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.ts +2 -2
  130. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +77 -1
  131. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
  132. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts +17 -0
  133. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
  134. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
  135. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
  136. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +67 -7
  137. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js +1 -1
  138. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js.map +1 -1
  139. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js +1 -1
  140. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js.map +1 -1
  141. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts +1 -1
  142. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js +1 -1
  143. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js.map +1 -1
  144. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js +1 -1
  145. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js.map +1 -1
  146. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.ts +1 -1
  147. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js +5 -1
  148. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js.map +1 -1
  149. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.d.ts.map +1 -1
  150. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js +1 -1
  151. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js.map +1 -1
  152. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.ts +5 -1
  153. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js +1 -1
  154. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js.map +1 -1
  155. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js +1 -1
  156. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js.map +1 -1
  157. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts +1 -1
  158. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js +1 -1
  159. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js.map +1 -1
  160. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js +1 -1
  161. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js.map +1 -1
  162. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts +1 -1
  163. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js +1 -1
  164. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js.map +1 -1
  165. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js +1 -1
  166. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js.map +1 -1
  167. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.ts +1 -1
  168. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js +1 -1
  169. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js.map +1 -1
  170. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js +1 -1
  171. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js.map +1 -1
  172. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.ts +1 -1
  173. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js +1 -1
  174. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js.map +1 -1
  175. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js +1 -1
  176. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js.map +1 -1
  177. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.ts +1 -1
  178. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js +142 -0
  179. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js.map +1 -0
  180. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts +39 -0
  181. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts.map +1 -0
  182. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js +2 -0
  183. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js.map +1 -0
  184. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.ts +144 -0
  185. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js +1 -1
  186. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js.map +1 -1
  187. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js +1 -1
  188. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js.map +1 -1
  189. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.ts +1 -1
  190. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js +2 -2
  191. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js.map +1 -1
  192. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js +1 -1
  193. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js.map +1 -1
  194. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.ts +2 -2
  195. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js +1 -1
  196. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js.map +1 -1
  197. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js +1 -1
  198. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js.map +1 -1
  199. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.ts +1 -1
  200. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js +1 -1
  201. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js.map +1 -1
  202. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js +1 -1
  203. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js.map +1 -1
  204. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.ts +1 -1
  205. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js +1 -1
  206. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js.map +1 -1
  207. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js +1 -1
  208. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js.map +1 -1
  209. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.ts +1 -1
  210. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js +1 -1
  211. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js.map +1 -1
  212. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js +1 -1
  213. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js.map +1 -1
  214. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.ts +1 -1
  215. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js +1 -1
  216. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js.map +1 -1
  217. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js +1 -1
  218. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js.map +1 -1
  219. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.ts +1 -1
  220. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js +1 -1
  221. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js.map +1 -1
  222. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js +1 -1
  223. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js.map +1 -1
  224. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.ts +1 -1
  225. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js +1 -1
  226. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js.map +1 -1
  227. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js +1 -1
  228. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js.map +1 -1
  229. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.ts +1 -1
  230. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js +1 -1
  231. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js.map +1 -1
  232. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js +1 -1
  233. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js.map +1 -1
  234. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.ts +1 -1
  235. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js +1 -1
  236. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js.map +1 -1
  237. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js +1 -1
  238. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js.map +1 -1
  239. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.ts +1 -1
  240. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin-dbg.js.map +1 -1
  241. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin.js.map +1 -1
  242. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin.ts +1 -1
  243. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin-dbg.js.map +1 -1
  244. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin.js.map +1 -1
  245. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin.ts +1 -1
  246. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin-dbg.js.map +1 -1
  247. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.d.ts +1 -1
  248. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.d.ts.map +1 -1
  249. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.js.map +1 -1
  250. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.ts +2 -2
  251. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin-dbg.js.map +1 -1
  252. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.d.ts +1 -1
  253. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.d.ts.map +1 -1
  254. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.js.map +1 -1
  255. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.ts +1 -1
  256. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin-dbg.js +1 -1
  257. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin-dbg.js.map +1 -1
  258. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.d.ts +1 -1
  259. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.d.ts.map +1 -1
  260. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.js +1 -1
  261. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.js.map +1 -1
  262. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.ts +2 -2
  263. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin-dbg.js +1 -1
  264. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin-dbg.js.map +1 -1
  265. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.d.ts +1 -1
  266. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.d.ts.map +1 -1
  267. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.js +1 -1
  268. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.js.map +1 -1
  269. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.ts +2 -2
  270. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin-dbg.js +1 -1
  271. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin-dbg.js.map +1 -1
  272. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.d.ts +1 -1
  273. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.d.ts.map +1 -1
  274. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.js +1 -1
  275. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.js.map +1 -1
  276. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.ts +3 -3
  277. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin-dbg.js.map +1 -1
  278. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.d.ts +1 -1
  279. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.d.ts.map +1 -1
  280. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.js.map +1 -1
  281. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.ts +1 -1
  282. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin-dbg.js.map +1 -1
  283. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.d.ts +1 -1
  284. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.d.ts.map +1 -1
  285. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.js.map +1 -1
  286. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.ts +1 -1
  287. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin-dbg.js +2 -2
  288. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin-dbg.js.map +1 -1
  289. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.d.ts +1 -1
  290. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.d.ts.map +1 -1
  291. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.js +1 -1
  292. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.js.map +1 -1
  293. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.ts +4 -4
  294. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin-dbg.js +3 -2
  295. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin-dbg.js.map +1 -1
  296. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.d.ts +1 -1
  297. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.d.ts.map +1 -1
  298. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.js +1 -1
  299. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.js.map +1 -1
  300. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.ts +4 -3
  301. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin-dbg.js +3 -1
  302. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin-dbg.js.map +1 -1
  303. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.d.ts +1 -1
  304. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.d.ts.map +1 -1
  305. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.js +1 -1
  306. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.js.map +1 -1
  307. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.ts +4 -3
  308. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder-dbg.js +226 -0
  309. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder-dbg.js.map +1 -0
  310. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.d.ts +63 -0
  311. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.d.ts.map +1 -0
  312. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.js +2 -0
  313. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.js.map +1 -0
  314. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.ts +233 -0
  315. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver-dbg.js +43 -0
  316. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver-dbg.js.map +1 -0
  317. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.d.ts +15 -0
  318. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.d.ts.map +1 -0
  319. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.js +2 -0
  320. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.js.map +1 -0
  321. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.ts +37 -0
  322. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper-dbg.js +37 -0
  323. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper-dbg.js.map +1 -0
  324. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.d.ts +18 -0
  325. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.d.ts.map +1 -0
  326. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.js +2 -0
  327. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.js.map +1 -0
  328. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.ts +28 -0
  329. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper-dbg.js +84 -0
  330. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper-dbg.js.map +1 -0
  331. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.d.ts +27 -0
  332. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.d.ts.map +1 -0
  333. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.js +2 -0
  334. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.js.map +1 -0
  335. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.ts +80 -0
@@ -4,9 +4,27 @@
4
4
  */
5
5
 
6
6
  import { ISchema, IPropertyMetadata, FieldType } from "../interfaces/ISchema";
7
+ import { ISchemaBuilderPlugin } from "../interfaces/ISchemaBuilderPlugin";
7
8
  import { Logger } from "../utils/Logger";
8
9
 
9
- export class SchemaNormalizer {
10
+ export class SchemaNormalizer implements ISchemaBuilderPlugin {
11
+
12
+ /**
13
+ * ISchemaBuilderPlugin Contract
14
+ */
15
+ public canHandle(rawSchema: any): boolean {
16
+ // MetaUI native schemas almost always have properties, items, or a layoutStrategy
17
+ // This acts as a fallback for native schemas.
18
+ if (rawSchema.openapi || rawSchema.swagger) return false;
19
+ return true;
20
+ }
21
+
22
+ /**
23
+ * ISchemaBuilderPlugin Contract
24
+ */
25
+ public build(rawSchema: any): ISchema {
26
+ return SchemaNormalizer.normalize(rawSchema);
27
+ }
10
28
 
11
29
  /**
12
30
  * Validates that the provided raw payload conforms to the required ISchema structures.
@@ -15,13 +33,16 @@ export class SchemaNormalizer {
15
33
  let schemaObj = rawSchema;
16
34
 
17
35
  if (typeof schemaObj === "string") {
18
- try {
19
- schemaObj = JSON.parse(schemaObj);
20
- } catch (e) {
21
- const msg = (e as Error).message;
22
- Logger.error("[MetaUI SchemaNormalizer] Failed to parse schema string.", msg);
23
- Logger.showErrorPopup(`Failed to parse the provided JSON schema.\n\nDetails: ${msg}`);
36
+ if (!schemaObj.trim()) {
24
37
  schemaObj = null;
38
+ } else {
39
+ try {
40
+ schemaObj = JSON.parse(schemaObj);
41
+ } catch (e) {
42
+ const msg = "Failed to parse schema string: " + (e as Error).message;
43
+ Logger.error("[MetaUI SchemaNormalizer]", msg);
44
+ throw new Error(msg);
45
+ }
25
46
  }
26
47
  }
27
48
 
@@ -51,19 +72,18 @@ export class SchemaNormalizer {
51
72
  }
52
73
 
53
74
  if (normalized.type === "object") {
54
- normalized.properties = this.normalizeProperties(targetProperties);
75
+ const requiredKeys = Array.isArray(schemaObj.required) ? schemaObj.required : [];
76
+ normalized.properties = this.normalizeProperties(targetProperties, requiredKeys);
55
77
  } else if (normalized.type === "array") {
56
78
  // Future expansion: array deep merge
57
- normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: "object", properties: {} }, "items");
79
+ normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: "object", properties: {} }, "items", false);
58
80
  }
59
81
 
60
82
  return normalized;
61
83
  } catch (error) {
62
- const msg = (error as Error).message;
63
- Logger.error("[MetaUI SchemaNormalizer] Critical error normalizing schema object.", msg);
64
- Logger.showErrorPopup(`Schema Normalization failed.\n\nDetails: ${msg}`);
65
- // Fallback to empty object to prevent hard crash downstream
66
- return { type: "object", properties: {} };
84
+ const msg = "Critical error normalizing schema object: " + (error as Error).message;
85
+ Logger.error("[MetaUI SchemaNormalizer]", msg);
86
+ throw new Error(msg);
67
87
  }
68
88
  }
69
89
 
@@ -92,12 +112,14 @@ export class SchemaNormalizer {
92
112
  /**
93
113
  * Normalizes a collection of properties.
94
114
  * @param properties The raw properties map.
115
+ * @param requiredKeys An optional array of keys that are required by the parent object.
95
116
  * @returns A map of strict IPropertyMetadata objects.
96
117
  */
97
- private static normalizeProperties(properties: Record<string, unknown>): Record<string, IPropertyMetadata> {
118
+ private static normalizeProperties(properties: Record<string, unknown>, requiredKeys: string[] = []): Record<string, IPropertyMetadata> {
98
119
  const normalizedProps: Record<string, IPropertyMetadata> = {};
99
120
  for (const key of Object.keys(properties)) {
100
- normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key);
121
+ const isRequired = requiredKeys.includes(key);
122
+ normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key, isRequired);
101
123
  }
102
124
  return normalizedProps;
103
125
  }
@@ -106,9 +128,10 @@ export class SchemaNormalizer {
106
128
  * Normalizes a single property against the ISchema specification.
107
129
  * @param prop The raw property definition.
108
130
  * @param keyName The string key name for generating default labels.
131
+ * @param isRequired Indicates if the parent object mandated this property as required.
109
132
  * @returns A strict IPropertyMetadata instance.
110
133
  */
111
- private static normalizePropertyMetadata(prop: Record<string, unknown>, keyName: string): IPropertyMetadata {
134
+ private static normalizePropertyMetadata(prop: Record<string, unknown>, keyName: string, isRequired: boolean = false): IPropertyMetadata {
112
135
  const normalized: IPropertyMetadata = {
113
136
  type: prop.type || "string",
114
137
  ui: {
@@ -123,24 +146,28 @@ export class SchemaNormalizer {
123
146
  formatter: prop.ui?.formatter,
124
147
  args: prop.ui?.args,
125
148
  rows: prop.ui?.rows,
126
- fullWidth: prop.ui?.fullWidth
149
+ fullWidth: prop.ui?.fullWidth,
150
+ dialogButtonText: prop.ui?.dialogButtonText
127
151
  },
128
- required: !!prop.required,
129
- maxLength: prop.maxLength,
152
+ required: isRequired || !!prop.required,
153
+ maxLength: prop.maxLength as number,
154
+ minLength: prop.minLength as number,
130
155
  minimum: prop.minimum,
131
156
  maximum: prop.maximum,
132
157
  pattern: prop.pattern,
133
158
  precision: prop.precision,
134
159
  scale: prop.scale,
160
+ multipleOf: prop.multipleOf as number,
135
161
  valueHelp: prop.valueHelp,
136
162
  enum: prop.enum
137
163
  };
138
164
 
139
165
  if (normalized.type === "object" && prop.properties) {
140
- normalized.properties = this.normalizeProperties(prop.properties);
166
+ const requiredKeys = Array.isArray(prop.required) ? prop.required : [];
167
+ normalized.properties = this.normalizeProperties(prop.properties as Record<string, unknown>, requiredKeys);
141
168
  normalized.uiLayout = prop.uiLayout;
142
169
  } else if (normalized.type === "array" && prop.items) {
143
- normalized.items = this.normalizePropertyMetadata(prop.items, "items");
170
+ normalized.items = this.normalizePropertyMetadata(prop.items as Record<string, unknown>, "items", false);
144
171
  normalized.uiLayout = prop.uiLayout;
145
172
  }
146
173
 
@@ -163,7 +190,7 @@ export class SchemaNormalizer {
163
190
  /**
164
191
  * Infers a v2 ISchema structure dynamically from a plain data payload.
165
192
  */
166
- private static inferSchemaFromData(data: unknown): ISchema {
193
+ public static inferSchemaFromData(data: unknown): ISchema {
167
194
  const schema: ISchema = { type: "object", properties: {}, layoutStrategy: "compact", title: "" };
168
195
 
169
196
  if (!data || typeof data !== "object") {
@@ -172,12 +199,17 @@ export class SchemaNormalizer {
172
199
 
173
200
  if (Array.isArray(data)) {
174
201
  schema.type = "array";
175
- schema.layoutStrategy = "table";
176
- schema.items = {
177
- type: "object",
178
- layoutStrategy: "compact",
179
- properties: data.length > 0 ? this.inferPropertiesFromObject(data[0]) : {}
180
- };
202
+ if (data.length > 0 && typeof data[0] !== "object") {
203
+ schema.layoutStrategy = "compact";
204
+ schema.items = { type: typeof data[0] as FieldType };
205
+ } else {
206
+ schema.layoutStrategy = "table";
207
+ schema.items = {
208
+ type: "object",
209
+ layoutStrategy: "compact",
210
+ properties: data.length > 0 ? this.inferPropertiesFromObject(data[0] as Record<string, unknown>) : {}
211
+ };
212
+ }
181
213
  } else {
182
214
  schema.type = "object";
183
215
  schema.properties = this.inferPropertiesFromObject(data);
@@ -207,10 +239,16 @@ export class SchemaNormalizer {
207
239
  else if (typeof val === "boolean") type = "boolean";
208
240
  else if (Array.isArray(val)) {
209
241
  type = "array";
210
- items = {
211
- type: "object",
212
- properties: val.length > 0 ? this.inferPropertiesFromObject(val[0]) : {}
213
- };
242
+ if (val.length > 0 && typeof val[0] !== "object") {
243
+ items = {
244
+ type: typeof val[0] as FieldType
245
+ };
246
+ } else {
247
+ items = {
248
+ type: "object",
249
+ properties: val.length > 0 ? this.inferPropertiesFromObject(val[0] as Record<string, unknown>) : {}
250
+ };
251
+ }
214
252
  } else if (typeof val === "object") {
215
253
  type = "object";
216
254
  nestedProps = this.inferPropertiesFromObject(val);
@@ -223,7 +261,8 @@ export class SchemaNormalizer {
223
261
  ui: {
224
262
  label: this.generateLabel(key),
225
263
  isKey: false,
226
- readOnly: false
264
+ readOnly: false,
265
+ widget: type === "array" && items?.type !== "object" ? "multiInput" : undefined
227
266
  }
228
267
  };
229
268
  }
@@ -241,7 +280,7 @@ export class SchemaNormalizer {
241
280
  }
242
281
 
243
282
  const pathSegments = scope.replace("#/properties/", "").split("/properties/");
244
- let current: Record<string, unknown> = schema.properties;
283
+ let current: Record<string, IPropertyMetadata> | undefined = schema.properties;
245
284
  let meta: IPropertyMetadata | undefined;
246
285
 
247
286
  Logger.debug("[MetaUI SchemaNormalizer]", `Resolving scope '${scope}' with segments: ${JSON.stringify(pathSegments)}`, "SchemaNormalizer");
@@ -17,15 +17,16 @@ sap.ui.define([], function () {
17
17
  if (!schema || typeof schema !== "object") {
18
18
  return ["Root schema must be an object."];
19
19
  }
20
- if (schema.type !== "object" && schema.type !== "array") {
21
- errors.push(`Root schema must have type 'object' or 'array'. Found: '${schema.type}'`);
20
+ const s = schema;
21
+ if (s.type !== "object" && s.type !== "array") {
22
+ errors.push(`Root schema must have type 'object' or 'array'. Found: '${s.type}'`);
22
23
  }
23
- if (schema.type === "object" && !schema.properties) {
24
+ if (s.type === "object" && !s.properties) {
24
25
  errors.push("Object schema is missing the 'properties' node.");
25
26
  }
26
- if (schema.properties) {
27
- for (const key of Object.keys(schema.properties)) {
28
- const prop = schema.properties[key];
27
+ if (s.properties) {
28
+ for (const key of Object.keys(s.properties)) {
29
+ const prop = s.properties[key];
29
30
  if (!prop || typeof prop !== "object") {
30
31
  errors.push(`Property '${key}' must be an object.`);
31
32
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaValidator-dbg.js","names":["SchemaValidator","validateSchemaStructure","schema","errors","type","push","properties","key","Object","keys","prop","allowedTypes","includes","join","__exports","__esModule"],"sources":["SchemaValidator.ts"],"sourcesContent":["/**\n * @file SchemaValidator.ts\n * @description Structural validation utility to catch developer errors in the JSON schema itself.\n */\n\nimport { ISchema, FieldType } from \"../interfaces/ISchema\";\n\nexport class SchemaValidator {\n /**\n * Validates a parsed JSON schema object for structural correctness.\n * @param schema The schema object to validate\n * @returns An array of error strings. Empty if no errors.\n */\n public static validateSchemaStructure(schema: unknown): string[] {\n const errors: string[] = [];\n\n if (!schema || typeof schema !== \"object\") {\n return [\"Root schema must be an object.\"];\n }\n\n if (schema.type !== \"object\" && schema.type !== \"array\") {\n errors.push(`Root schema must have type 'object' or 'array'. Found: '${schema.type}'`);\n }\n\n if (schema.type === \"object\" && !schema.properties) {\n errors.push(\"Object schema is missing the 'properties' node.\");\n }\n\n if (schema.properties) {\n for (const key of Object.keys(schema.properties)) {\n const prop = schema.properties[key];\n if (!prop || typeof prop !== \"object\") {\n errors.push(`Property '${key}' must be an object.`);\n continue;\n }\n\n if (!prop.type) {\n errors.push(`Property '${key}' is missing 'type'.`);\n } else {\n const allowedTypes: FieldType[] = [\"string\", \"number\", \"boolean\", \"date\", \"object\", \"array\"];\n if (!allowedTypes.includes(prop.type)) {\n errors.push(`Property '${key}' has invalid type '${prop.type}'. Allowed: ${allowedTypes.join(\", \")}`);\n }\n }\n\n // Removed strict check for prop.items on array properties because inference handles empty definitions\n\n }\n }\n\n return errors;\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;;EAIO,MAAMA,eAAe,CAAC;IACzB;AACJ;AACA;AACA;AACA;IACI,OAAcC,uBAAuBA,CAACC,MAAe,EAAY;MAC7D,MAAMC,MAAgB,GAAG,EAAE;MAE3B,IAAI,CAACD,MAAM,IAAI,OAAOA,M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,eAAA,GAAAA,eAAA;EAAA,OAAAc,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"SchemaValidator-dbg.js","names":["SchemaValidator","validateSchemaStructure","schema","errors","s","type","push","properties","key","Object","keys","prop","allowedTypes","includes","join","__exports","__esModule"],"sources":["SchemaValidator.ts"],"sourcesContent":["/**\n * @file SchemaValidator.ts\n * @description Structural validation utility to catch developer errors in the JSON schema itself.\n */\n\nimport { ISchema, FieldType } from \"../interfaces/ISchema\";\n\nexport class SchemaValidator {\n /**\n * Validates a parsed JSON schema object for structural correctness.\n * @param schema The schema object to validate\n * @returns An array of error strings. Empty if no errors.\n */\n public static validateSchemaStructure(schema: unknown): string[] {\n const errors: string[] = [];\n\n if (!schema || typeof schema !== \"object\") {\n return [\"Root schema must be an object.\"];\n }\n\n const s = schema as Record<string, any>;\n if (s.type !== \"object\" && s.type !== \"array\") {\n errors.push(`Root schema must have type 'object' or 'array'. Found: '${s.type}'`);\n }\n\n if (s.type === \"object\" && !s.properties) {\n errors.push(\"Object schema is missing the 'properties' node.\");\n }\n\n if (s.properties) {\n for (const key of Object.keys(s.properties)) {\n const prop = s.properties[key];\n if (!prop || typeof prop !== \"object\") {\n errors.push(`Property '${key}' must be an object.`);\n continue;\n }\n\n if (!prop.type) {\n errors.push(`Property '${key}' is missing 'type'.`);\n } else {\n const allowedTypes: FieldType[] = [\"string\", \"number\", \"boolean\", \"date\", \"object\", \"array\"];\n if (!allowedTypes.includes(prop.type)) {\n errors.push(`Property '${key}' has invalid type '${prop.type}'. Allowed: ${allowedTypes.join(\", \")}`);\n }\n }\n\n // Removed strict check for prop.items on array properties because inference handles empty definitions\n\n }\n }\n\n return errors;\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;;EAIO,MAAMA,eAAe,CAAC;IACzB;AACJ;AACA;AACA;AACA;IACI,OAAcC,uBAAuBA,CAACC,MAAe,EAAY;MAC7D,MAAMC,MAAgB,GAAG,EAAE;MAE3B,IAAI,CAACD,MAA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Y,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAf,eAAA,GAAAA,eAAA;EAAA,OAAAe,SAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaValidator.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,iDAAiD,CAAC;IAQjE,MAAa,eAAe;QACxB;;;;WAIG;eACW,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE;KAuCnE;CAEA"}
1
+ {"version":3,"file":"SchemaValidator.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,iDAAiD,CAAC;IAQjE,MAAa,eAAe;QACxB;;;;WAIG;eACW,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE;KAwCnE;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define([],function(){"use strict";class e{static validateSchemaStructure(e){const t=[];if(!e||typeof e!=="object"){return["Root schema must be an object."]}if(e.type!=="object"&&e.type!=="array"){t.push(`Root schema must have type 'object' or 'array'. Found: '${e.type}'`)}if(e.type==="object"&&!e.properties){t.push("Object schema is missing the 'properties' node.")}if(e.properties){for(const o of Object.keys(e.properties)){const r=e.properties[o];if(!r||typeof r!=="object"){t.push(`Property '${o}' must be an object.`);continue}if(!r.type){t.push(`Property '${o}' is missing 'type'.`)}else{const e=["string","number","boolean","date","object","array"];if(!e.includes(r.type)){t.push(`Property '${o}' has invalid type '${r.type}'. Allowed: ${e.join(", ")}`)}}}}return t}}var t={__esModule:true};t.SchemaValidator=e;return t});
1
+ sap.ui.define([],function(){"use strict";class e{static validateSchemaStructure(e){const t=[];if(!e||typeof e!=="object"){return["Root schema must be an object."]}const o=e;if(o.type!=="object"&&o.type!=="array"){t.push(`Root schema must have type 'object' or 'array'. Found: '${o.type}'`)}if(o.type==="object"&&!o.properties){t.push("Object schema is missing the 'properties' node.")}if(o.properties){for(const e of Object.keys(o.properties)){const s=o.properties[e];if(!s||typeof s!=="object"){t.push(`Property '${e}' must be an object.`);continue}if(!s.type){t.push(`Property '${e}' is missing 'type'.`)}else{const o=["string","number","boolean","date","object","array"];if(!o.includes(s.type)){t.push(`Property '${e}' has invalid type '${s.type}'. Allowed: ${o.join(", ")}`)}}}}return t}}var t={__esModule:true};t.SchemaValidator=e;return t});
2
2
  //# sourceMappingURL=SchemaValidator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaValidator.js","names":["SchemaValidator","validateSchemaStructure","schema","errors","type","push","properties","key","Object","keys","prop","allowedTypes","includes","join","__exports","__esModule"],"sources":["SchemaValidator.ts"],"sourcesContent":["/**\n * @file SchemaValidator.ts\n * @description Structural validation utility to catch developer errors in the JSON schema itself.\n */\n\nimport { ISchema, FieldType } from \"../interfaces/ISchema\";\n\nexport class SchemaValidator {\n /**\n * Validates a parsed JSON schema object for structural correctness.\n * @param schema The schema object to validate\n * @returns An array of error strings. Empty if no errors.\n */\n public static validateSchemaStructure(schema: unknown): string[] {\n const errors: string[] = [];\n\n if (!schema || typeof schema !== \"object\") {\n return [\"Root schema must be an object.\"];\n }\n\n if (schema.type !== \"object\" && schema.type !== \"array\") {\n errors.push(`Root schema must have type 'object' or 'array'. Found: '${schema.type}'`);\n }\n\n if (schema.type === \"object\" && !schema.properties) {\n errors.push(\"Object schema is missing the 'properties' node.\");\n }\n\n if (schema.properties) {\n for (const key of Object.keys(schema.properties)) {\n const prop = schema.properties[key];\n if (!prop || typeof prop !== \"object\") {\n errors.push(`Property '${key}' must be an object.`);\n continue;\n }\n\n if (!prop.type) {\n errors.push(`Property '${key}' is missing 'type'.`);\n } else {\n const allowedTypes: FieldType[] = [\"string\", \"number\", \"boolean\", \"date\", \"object\", \"array\"];\n if (!allowedTypes.includes(prop.type)) {\n errors.push(`Property '${key}' has invalid type '${prop.type}'. Allowed: ${allowedTypes.join(\", \")}`);\n }\n }\n\n // Removed strict check for prop.items on array properties because inference handles empty definitions\n\n }\n }\n\n return errors;\n }\n}\n"],"mappings":"yCAOO,MAAMA,EAMT,8BAAcC,CAAwBC,GAClC,MAAMC,EAAmB,GAEzB,IAAKD,UAAiBA,IAAW,SAAU,CACvC,MAAO,CAAC,iCACZ,CAEA,GAAIA,EAAOE,OAAS,UAAYF,EAAOE,OAAS,QAAS,CACrDD,EAAOE,KAAK,2DAA2DH,EAAOE,QAClF,CAEA,GAAIF,EAAOE,OAAS,WAAaF,EAAOI,WAAY,CAChDH,EAAOE,KAAK,kDAChB,CAEA,GAAIH,EAAOI,WAAY,CACnB,IAAK,MAAMC,KAAOC,OAAOC,KAAKP,EAAOI,YAAa,CAC9C,MAAMI,EAAOR,EAAOI,WAAWC,GAC/B,IAAKG,UAAeA,IAAS,SAAU,CACnCP,EAAOE,KAAK,aAAaE,yBACzB,QACJ,CAEA,IAAKG,EAAKN,KAAM,CACZD,EAAOE,KAAK,aAAaE,wBAC7B,KAAO,CACH,MAAMI,EAA4B,CAAC,SAAU,SAAU,UAAW,OAAQ,SAAU,SACpF,IAAKA,EAAaC,SAASF,EAAKN,MAAO,CACnCD,EAAOE,KAAK,aAAaE,wBAA0BG,EAAKN,mBAAmBO,EAAaE,KAAK,QACjG,CACJ,CAIJ,CACJ,CAEA,OAAOV,CACX,EACH,IAAAW,EAAA,CAAAC,WAAA,MAAAD,EAAAd,kBAAA,OAAAc,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"SchemaValidator.js","names":["SchemaValidator","validateSchemaStructure","schema","errors","s","type","push","properties","key","Object","keys","prop","allowedTypes","includes","join","__exports","__esModule"],"sources":["SchemaValidator.ts"],"sourcesContent":["/**\n * @file SchemaValidator.ts\n * @description Structural validation utility to catch developer errors in the JSON schema itself.\n */\n\nimport { ISchema, FieldType } from \"../interfaces/ISchema\";\n\nexport class SchemaValidator {\n /**\n * Validates a parsed JSON schema object for structural correctness.\n * @param schema The schema object to validate\n * @returns An array of error strings. Empty if no errors.\n */\n public static validateSchemaStructure(schema: unknown): string[] {\n const errors: string[] = [];\n\n if (!schema || typeof schema !== \"object\") {\n return [\"Root schema must be an object.\"];\n }\n\n const s = schema as Record<string, any>;\n if (s.type !== \"object\" && s.type !== \"array\") {\n errors.push(`Root schema must have type 'object' or 'array'. Found: '${s.type}'`);\n }\n\n if (s.type === \"object\" && !s.properties) {\n errors.push(\"Object schema is missing the 'properties' node.\");\n }\n\n if (s.properties) {\n for (const key of Object.keys(s.properties)) {\n const prop = s.properties[key];\n if (!prop || typeof prop !== \"object\") {\n errors.push(`Property '${key}' must be an object.`);\n continue;\n }\n\n if (!prop.type) {\n errors.push(`Property '${key}' is missing 'type'.`);\n } else {\n const allowedTypes: FieldType[] = [\"string\", \"number\", \"boolean\", \"date\", \"object\", \"array\"];\n if (!allowedTypes.includes(prop.type)) {\n errors.push(`Property '${key}' has invalid type '${prop.type}'. Allowed: ${allowedTypes.join(\", \")}`);\n }\n }\n\n // Removed strict check for prop.items on array properties because inference handles empty definitions\n\n }\n }\n\n return errors;\n }\n}\n"],"mappings":"yCAOO,MAAMA,EAMT,8BAAcC,CAAwBC,GAClC,MAAMC,EAAmB,GAEzB,IAAKD,UAAiBA,IAAW,SAAU,CACvC,MAAO,CAAC,iCACZ,CAEA,MAAME,EAAIF,EACV,GAAIE,EAAEC,OAAS,UAAYD,EAAEC,OAAS,QAAS,CAC3CF,EAAOG,KAAK,2DAA2DF,EAAEC,QAC7E,CAEA,GAAID,EAAEC,OAAS,WAAaD,EAAEG,WAAY,CACtCJ,EAAOG,KAAK,kDAChB,CAEA,GAAIF,EAAEG,WAAY,CACd,IAAK,MAAMC,KAAOC,OAAOC,KAAKN,EAAEG,YAAa,CACzC,MAAMI,EAAOP,EAAEG,WAAWC,GAC1B,IAAKG,UAAeA,IAAS,SAAU,CACnCR,EAAOG,KAAK,aAAaE,yBACzB,QACJ,CAEA,IAAKG,EAAKN,KAAM,CACZF,EAAOG,KAAK,aAAaE,wBAC7B,KAAO,CACH,MAAMI,EAA4B,CAAC,SAAU,SAAU,UAAW,OAAQ,SAAU,SACpF,IAAKA,EAAaC,SAASF,EAAKN,MAAO,CACnCF,EAAOG,KAAK,aAAaE,wBAA0BG,EAAKN,mBAAmBO,EAAaE,KAAK,QACjG,CACJ,CAIJ,CACJ,CAEA,OAAOX,CACX,EACH,IAAAY,EAAA,CAAAC,WAAA,MAAAD,EAAAf,kBAAA,OAAAe,CAAA","ignoreList":[]}
@@ -18,17 +18,18 @@ export class SchemaValidator {
18
18
  return ["Root schema must be an object."];
19
19
  }
20
20
 
21
- if (schema.type !== "object" && schema.type !== "array") {
22
- errors.push(`Root schema must have type 'object' or 'array'. Found: '${schema.type}'`);
21
+ const s = schema as Record<string, any>;
22
+ if (s.type !== "object" && s.type !== "array") {
23
+ errors.push(`Root schema must have type 'object' or 'array'. Found: '${s.type}'`);
23
24
  }
24
25
 
25
- if (schema.type === "object" && !schema.properties) {
26
+ if (s.type === "object" && !s.properties) {
26
27
  errors.push("Object schema is missing the 'properties' node.");
27
28
  }
28
29
 
29
- if (schema.properties) {
30
- for (const key of Object.keys(schema.properties)) {
31
- const prop = schema.properties[key];
30
+ if (s.properties) {
31
+ for (const key of Object.keys(s.properties)) {
32
+ const prop = s.properties[key];
32
33
  if (!prop || typeof prop !== "object") {
33
34
  errors.push(`Property '${key}' must be an object.`);
34
35
  continue;
@@ -6,8 +6,11 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "./PipelineManager", "sap/ui/core/
6
6
  * Manages the isolated internal data payload for the MetaUI engine.
7
7
  */
8
8
  class StateManager {
9
+ schema = null;
10
+ _useMessageManager = false;
11
+
9
12
  /**
10
- * Initializes the state manager with an optional initial payload.
13
+ * Initializes the state manager with an authentic SAPUI5 JSONModel.
11
14
  * @param initialData The initial JSON payload to populate the fields.
12
15
  * @param schema The normalized schema for live validation.
13
16
  * @param modelName The UI5 model alias used for isolation.
@@ -30,6 +33,13 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "./PipelineManager", "sap/ui/core/
30
33
  };
31
34
  }
32
35
 
36
+ /**
37
+ * Updates the flag indicating whether this manager should push validation errors directly to the global MessageManager.
38
+ */
39
+ setUseMessageManager(use) {
40
+ this._useMessageManager = use;
41
+ }
42
+
33
43
  /**
34
44
  * Validates a specific path against the schema and updates the MessageManager.
35
45
  */
@@ -40,13 +50,15 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "./PipelineManager", "sap/ui/core/
40
50
  const targetPath = sPath.startsWith("/") ? sPath : `/${sPath}`; // Pure UI5: target MUST be absolute path
41
51
 
42
52
  // 1. Remove existing messages (strictly for THIS model instance)
43
- const existingMessages = messageManager.getMessageModel().getData();
44
- const messagesToRemove = existingMessages.filter(msg => {
45
- const isMatch = msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.model.getId();
46
- return isMatch;
47
- });
48
- if (messagesToRemove.length > 0) {
49
- messageManager.removeMessages(messagesToRemove);
53
+ if (this._useMessageManager) {
54
+ const existingMessages = messageManager.getMessageModel().getData();
55
+ const messagesToRemove = existingMessages.filter(msg => {
56
+ const isMatch = msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.model.getId();
57
+ return isMatch;
58
+ });
59
+ if (messagesToRemove.length > 0) {
60
+ messageManager.removeMessages(messagesToRemove);
61
+ }
50
62
  }
51
63
  if (!metadata) return;
52
64
 
@@ -58,10 +70,27 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "./PipelineManager", "sap/ui/core/
58
70
  }
59
71
  if (metadata.type === "string" && metadata.maxLength) {
60
72
  validatorsToRun.push("maxLength");
61
- argsMap["maxLength"] = {
62
- max: metadata.maxLength
73
+ argsMap["maxLength"] = metadata.maxLength;
74
+ }
75
+ if (metadata.minLength) {
76
+ validatorsToRun.push("minLength");
77
+ argsMap["minLength"] = metadata.minLength;
78
+ }
79
+ if (metadata.pattern) {
80
+ validatorsToRun.push("pattern");
81
+ argsMap["pattern"] = metadata.pattern;
82
+ }
83
+ if (metadata.minimum !== undefined || metadata.maximum !== undefined) {
84
+ validatorsToRun.push("range");
85
+ argsMap["range"] = {
86
+ min: metadata.minimum,
87
+ max: metadata.maximum
63
88
  };
64
89
  }
90
+ const format = metadata.ui?.format;
91
+ if (format === "email" || format === "url" || format === "iban") {
92
+ validatorsToRun.push(format);
93
+ }
65
94
  if (metadata.ui?.validators) {
66
95
  for (const v of metadata.ui.validators) {
67
96
  if (typeof v === "string") {
@@ -76,7 +105,7 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "./PipelineManager", "sap/ui/core/
76
105
  }
77
106
  if (validatorsToRun.length > 0) {
78
107
  const validationResult = GlobalPipeline.executeValidation(value, validatorsToRun, argsMap);
79
- if (!validationResult.isValid) {
108
+ if (!validationResult.isValid && this._useMessageManager) {
80
109
  const newMsg = new Message({
81
110
  message: validationResult.errorMessage || "Invalid value.",
82
111
  type: coreLibrary.MessageType.Error,
@@ -1 +1 @@
1
- {"version":3,"file":"StateManager-dbg.js","names":["GlobalPipeline","___PipelineManager","StateManager","constructor","initialData","schema","modelName","activeModelName","safeData","JSON","parse","stringify","model","JSONModel","setDefaultBindingMode","originalSetProperty","setProperty","bind","sPath","oValue","oContext","bAsyncUpdate","result","validatePath","value","fieldKey","replace","metadata","findMetadataForPath","messageManager","Messaging","targetPath","startsWith","existingMessages","getMessageModel","getData","messagesToRemove","filter","msg","isMatch","getTarget","getMessageProcessor","getId","length","removeMessages","validatorsToRun","argsMap","required","push","type","maxLength","max","ui","validators","v","name","args","undefined","validationResult","executeValidation","isValid","newMsg","Message","message","errorMessage","coreLibrary","MessageType","Error","target","processor","addMessages","path","properties","getModel","bindControl","control","property","bindingPath","bindProperty","extractPayload","data","destroy","__exports","__esModule"],"sources":["StateManager.ts"],"sourcesContent":["/**\n * @file StateManager.ts\n * @description Isolated internal state management. Decouples the MetaUI engine from external host models.\n */\n\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport ManagedObject from \"sap/ui/base/ManagedObject\";\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { GlobalPipeline } from \"./PipelineManager\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n\n/**\n * Manages the isolated internal data payload for the MetaUI engine.\n */\nexport class StateManager {\n private model: JSONModel;\n private activeModelName: string;\n private schema: ISchema;\n\n /**\n * Initializes the state manager with an optional initial payload.\n * @param initialData The initial JSON payload to populate the fields.\n * @param schema The normalized schema for live validation.\n * @param modelName The UI5 model alias used for isolation.\n */\n constructor(initialData: Record<string, unknown> = {}, schema: ISchema, modelName: string = \"meta\") {\n this.activeModelName = modelName;\n this.schema = schema;\n \n // Deep copy to ensure no reference leakage from the host application\n const safeData = JSON.parse(JSON.stringify(initialData));\n this.model = new JSONModel(safeData);\n this.model.setDefaultBindingMode(\"TwoWay\");\n\n // Centralized Model-Level Validation Interceptor\n const originalSetProperty = this.model.setProperty.bind(this.model);\n this.model.setProperty = (sPath: string, oValue: unknown, oContext?: unknown, bAsyncUpdate?: boolean) => {\n const result = originalSetProperty(sPath, oValue, oContext, bAsyncUpdate);\n this.validatePath(sPath, oValue);\n return result;\n };\n }\n\n /**\n * Validates a specific path against the schema and updates the MessageManager.\n */\n private validatePath(sPath: string, value: unknown): void {\n const fieldKey = sPath.replace(/^\\//, \"\");\n const metadata = this.findMetadataForPath(fieldKey);\n \n const messageManager = Messaging;\n const targetPath = sPath.startsWith(\"/\") ? sPath : `/${sPath}`; // Pure UI5: target MUST be absolute path\n \n // 1. Remove existing messages (strictly for THIS model instance)\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove = existingMessages.filter((msg: sap.ui.core.message.Message) => {\n const isMatch = msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.model.getId();\n return isMatch;\n });\n \n \n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n\n if (!metadata) return;\n\n // 2. Run GlobalPipeline\n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {};\n\n if (metadata.required) {\n validatorsToRun.push(\"required\");\n }\n if (metadata.type === \"string\" && metadata.maxLength) {\n validatorsToRun.push(\"maxLength\");\n argsMap[\"maxLength\"] = { max: metadata.maxLength };\n }\n if (metadata.ui?.validators) {\n for (const v of metadata.ui.validators) {\n if (typeof v === \"string\") {\n validatorsToRun.push(v);\n } else if (v && v.name) {\n validatorsToRun.push(v.name);\n if (v.args !== undefined) {\n argsMap[v.name] = v.args;\n }\n }\n }\n }\n\n if (validatorsToRun.length > 0) {\n const validationResult = GlobalPipeline.executeValidation(value, validatorsToRun, argsMap);\n if (!validationResult.isValid) {\n const newMsg = new Message({\n message: validationResult.errorMessage || \"Invalid value.\",\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: this.model\n });\n messageManager.addMessages(newMsg);\n }\n }\n }\n\n /**\n * Resolves the schema metadata for a given internal binding path.\n * @param path The flat binding path representing the field.\n * @returns The associated IPropertyMetadata, or undefined if not mapped.\n */\n private findMetadataForPath(path: string): IPropertyMetadata | undefined {\n if (!this.schema || !this.schema.properties) return undefined;\n // Basic single-level support for now. Nested object resolution would split by '.' or '/'\n return this.schema.properties[path];\n }\n\n\n\n /**\n * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.\n * @returns The internal JSONModel.\n */\n public getModel(): JSONModel {\n return this.model;\n }\n\n /**\n * Binds a generated UI control property to a path in the internal model.\n * @param control The target UI5 Control.\n * @param property The UI5 property name (e.g., 'value').\n * @param bindingPath The exact path in the JSON payload.\n */\n public bindControl(control: ManagedObject, property: string, bindingPath: string): void {\n control.bindProperty(property, {\n path: bindingPath,\n model: \"meta\" // Assumes the model is bound to the root container with the name 'meta'\n });\n }\n\n /**\n * Extracts the flat JavaScript object representing the current state of the UI.\n * @returns A serialized record of the data payload, free of UI5 wrappers.\n */\n public extractPayload(): Record<string, unknown> {\n // Create a deep copy to prevent accidental mutations by the host\n const data = this.model.getData();\n return JSON.parse(JSON.stringify(data));\n }\n\n /**\n * Cleans up internal state and natively destroys the UI5 JSONModel to prevent memory leaks.\n */\n public destroy(): void {\n \n if (this.model) {\n this.model.destroy();\n }\n }\n}\n"],"mappings":";;;QAQSA,cAAc,GAAAC,kBAAA;EAOvB;AACA;AACA;EACO,MAAMC,YAAY,CAAC;IAKtB;AACJ;AACA;AACA;AACA;AACA;IACIC,WAAWA,CAACC,WAAoC,GAAG,CAAC,CAAC,EAAEC,MAAe,EAAEC,SAAiB,GAAG,MAAM,EAAE;MAChG,IAAI,CAACC,eAAe,GAAGD,SAAS;MAChC,IAAI,CAACD,MAAM,GAAGA,MAAM;;MAEpB;MACA,MAAMG,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACP,WAAW,CAAC,CAAC;MACxD,IAAI,CAACQ,KAAK,GAAG,IAAIC,SAAS,CAACL,QAAQ,CAAC;MACpC,IAAI,CAACI,KAAK,CAACE,qBAAqB,CAAC,QAAQ,CAAC;;MAE1C;MACA,MAAMC,mBAAmB,GAAG,IAAI,CAACH,KAAK,CAACI,WAAW,CAACC,IAAI,CAAC,IAAI,CAACL,KAAK,CAAC;MACnE,IAAI,CAACA,KAAK,CAACI,WAAW,GAAG,CAACE,KAAa,EAAEC,MAAe,EAAEC,QAAkB,EAAEC,YAAsB,KAAK;QACrG,MAAMC,MAAM,GAAGP,mBAAmB,CAACG,KAAK,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,YAAY,CAAC;QACzE,IAAI,CAACE,YAAY,CAACL,KAAK,EAAEC,MAAM,CAAC;QAChC,OAAOG,MAAM;MACjB,CAAC;IACL;;IAEA;AACJ;AACA;IACYC,YAAYA,CAACL,KAAa,EAAEM,KAAc,EAAQ;MACtD,MAAMC,QAAQ,GAAGP,KAAK,CAACQ,OAAO,CA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AC7D,KAAK;IACrB;;IAEA;AACJ;AACA;AACA;AACA;AACA;IACW8D,WAAWA,CAACC,OAAsB,EAAEC,QAAgB,EAAEC,WAAmB,EAAQ;MACpFF,OAAO,CAACG,YAAY,CAACF,QAAQ,EAAE;QAC3BL,IAAI,EAAEM,WAAW;QACjBjE,KAAK,EAAE,MAAM,CAAC;MAClB,CAAC,CAAC;IACN;;IAEA;AACJ;AACA;AACA;IACWmE,cAAcA,CAAA,EAA4B;MAC7C;MACA,MAAMC,IAAI,GAAG,IAAI,CAACpE,KAAK,CAACuB,OAAO,CAAC,CAAC;MACjC,OAAO1B,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACqE,IAAI,CAAC,CAAC;IAC3C;;IAEA;AACJ;AACA;IACWC,OAAOA,CAAA,EAAS;MAEnB,IAAI,IAAI,CAACrE,KAAK,EAAE;QACZ,IAAI,CAACA,KAAK,CAACqE,OAAO,CAAC,CAAC;MACxB;IACJ;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAhF,YAAA,GAAAA,YAAA;EAAA,OAAAgF,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"StateManager-dbg.js","names":["GlobalPipeline","___PipelineManager","StateManager","schema","_useMessageManager","constructor","initialData","modelName","activeModelName","safeData","JSON","parse","stringify","model","JSONModel","setDefaultBindingMode","originalSetProperty","setProperty","bind","sPath","oValue","oContext","bAsyncUpdate","result","validatePath","setUseMessageManager","use","value","fieldKey","replace","metadata","findMetadataForPath","messageManager","Messaging","targetPath","startsWith","existingMessages","getMessageModel","getData","messagesToRemove","filter","msg","isMatch","getTarget","getMessageProcessor","getId","length","removeMessages","validatorsToRun","argsMap","required","push","type","maxLength","minLength","pattern","minimum","undefined","maximum","min","max","format","ui","validators","v","name","args","validationResult","executeValidation","isValid","newMsg","Message","message","errorMessage","coreLibrary","MessageType","Error","target","processor","addMessages","path","properties","getModel","bindControl","control","property","bindingPath","bindProperty","extractPayload","data","destroy","__exports","__esModule"],"sources":["StateManager.ts"],"sourcesContent":["/**\n * @file StateManager.ts\n * @description Isolated internal state management. Decouples the MetaUI engine from external host models.\n */\n\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport ManagedObject from \"sap/ui/base/ManagedObject\";\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { GlobalPipeline } from \"./PipelineManager\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n\n/**\n * Manages the isolated internal data payload for the MetaUI engine.\n */\nexport class StateManager {\n private model: JSONModel;\n private activeModelName: string;\n private schema: ISchema | null = null;\n private _useMessageManager: boolean = false;\n\n /**\n * Initializes the state manager with an authentic SAPUI5 JSONModel.\n * @param initialData The initial JSON payload to populate the fields.\n * @param schema The normalized schema for live validation.\n * @param modelName The UI5 model alias used for isolation.\n */\n constructor(initialData: Record<string, unknown> = {}, schema: ISchema, modelName: string = \"meta\") {\n this.activeModelName = modelName;\n this.schema = schema;\n \n // Deep copy to ensure no reference leakage from the host application\n const safeData = JSON.parse(JSON.stringify(initialData));\n this.model = new JSONModel(safeData);\n this.model.setDefaultBindingMode(\"TwoWay\");\n\n // Centralized Model-Level Validation Interceptor\n const originalSetProperty = this.model.setProperty.bind(this.model);\n this.model.setProperty = (sPath: string, oValue: unknown, oContext?: unknown, bAsyncUpdate?: boolean) => {\n const result = originalSetProperty(sPath, oValue, oContext, bAsyncUpdate);\n this.validatePath(sPath, oValue);\n return result;\n };\n }\n\n /**\n * Updates the flag indicating whether this manager should push validation errors directly to the global MessageManager.\n */\n public setUseMessageManager(use: boolean): void {\n this._useMessageManager = use;\n }\n\n /**\n * Validates a specific path against the schema and updates the MessageManager.\n */\n private validatePath(sPath: string, value: unknown): void {\n const fieldKey = sPath.replace(/^\\//, \"\");\n const metadata = this.findMetadataForPath(fieldKey);\n \n const messageManager = Messaging;\n const targetPath = sPath.startsWith(\"/\") ? sPath : `/${sPath}`; // Pure UI5: target MUST be absolute path\n \n // 1. Remove existing messages (strictly for THIS model instance)\n if (this._useMessageManager) {\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove = existingMessages.filter((msg: sap.ui.core.message.Message) => {\n const isMatch = msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.model.getId();\n return isMatch;\n });\n \n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n }\n\n if (!metadata) return;\n\n // 2. Run GlobalPipeline\n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {};\n\n if (metadata.required) {\n validatorsToRun.push(\"required\");\n }\n if (metadata.type === \"string\" && metadata.maxLength) {\n validatorsToRun.push(\"maxLength\");\n argsMap[\"maxLength\"] = metadata.maxLength;\n }\n if (metadata.minLength) {\n validatorsToRun.push(\"minLength\");\n argsMap[\"minLength\"] = metadata.minLength;\n }\n if (metadata.pattern) {\n validatorsToRun.push(\"pattern\");\n argsMap[\"pattern\"] = metadata.pattern;\n }\n if (metadata.minimum !== undefined || metadata.maximum !== undefined) {\n validatorsToRun.push(\"range\");\n argsMap[\"range\"] = { min: metadata.minimum, max: metadata.maximum };\n }\n \n const format = metadata.ui?.format;\n if (format === \"email\" || format === \"url\" || format === \"iban\") {\n validatorsToRun.push(format);\n }\n if (metadata.ui?.validators) {\n for (const v of metadata.ui.validators) {\n if (typeof v === \"string\") {\n validatorsToRun.push(v);\n } else if (v && v.name) {\n validatorsToRun.push(v.name);\n if (v.args !== undefined) {\n argsMap[v.name] = v.args;\n }\n }\n }\n }\n\n if (validatorsToRun.length > 0) {\n const validationResult = GlobalPipeline.executeValidation(value, validatorsToRun, argsMap);\n if (!validationResult.isValid && this._useMessageManager) {\n const newMsg = new Message({\n message: validationResult.errorMessage || \"Invalid value.\",\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: this.model\n });\n messageManager.addMessages(newMsg);\n }\n }\n }\n\n /**\n * Resolves the schema metadata for a given internal binding path.\n * @param path The flat binding path representing the field.\n * @returns The associated IPropertyMetadata, or undefined if not mapped.\n */\n private findMetadataForPath(path: string): IPropertyMetadata | undefined {\n if (!this.schema || !this.schema.properties) return undefined;\n // Basic single-level support for now. Nested object resolution would split by '.' or '/'\n return this.schema.properties[path];\n }\n\n\n\n /**\n * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.\n * @returns The internal JSONModel.\n */\n public getModel(): JSONModel {\n return this.model;\n }\n\n /**\n * Binds a generated UI control property to a path in the internal model.\n * @param control The target UI5 Control.\n * @param property The UI5 property name (e.g., 'value').\n * @param bindingPath The exact path in the JSON payload.\n */\n public bindControl(control: ManagedObject, property: string, bindingPath: string): void {\n control.bindProperty(property, {\n path: bindingPath,\n model: \"meta\" // Assumes the model is bound to the root container with the name 'meta'\n });\n }\n\n /**\n * Extracts the flat JavaScript object representing the current state of the UI.\n * @returns A serialized record of the data payload, free of UI5 wrappers.\n */\n public extractPayload(): Record<string, unknown> {\n // Create a deep copy to prevent accidental mutations by the host\n const data = this.model.getData();\n return JSON.parse(JSON.stringify(data));\n }\n\n /**\n * Cleans up internal state and natively destroys the UI5 JSONModel to prevent memory leaks.\n */\n public destroy(): void {\n \n if (this.model) {\n this.model.destroy();\n }\n }\n}\n"],"mappings":";;;QAQSA,cAAc,GAAAC,kBAAA;EAOvB;AACA;AACA;EACO,MAAMC,YAAY,CAAC;IAGdC,MAAM,GAAmB,IAAI;IAC7BC,kBAAkB,GAAY,KAAK;;IAE3C;AACJ;AACA;AACA;AACA;AACA;IACIC,WAAWA,CAACC,WAAoC,GAAG,CAAC,CAAC,EAAEH,MAAe,EAAEI,SAAiB,GAAG,MAAM,EAAE;MAChG,IAAI,CAACC,eAAe,GAAGD,SAAS;MAChC,IAAI,CAACJ,MAAM,GAAGA,MAAM;;MAEpB;MACA,MAAMM,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,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mB,cAAc,CAAC+C,WAAW,CAACT,MAAM,CAAC;QACtC;MACJ;IACJ;;IAEA;AACJ;AACA;AACA;AACA;IACYvC,mBAAmBA,CAACiD,IAAY,EAAiC;MACrE,IAAI,CAAC,IAAI,CAAC7E,MAAM,IAAI,CAAC,IAAI,CAACA,MAAM,CAAC8E,UAAU,EAAE,OAAOxB,SAAS;MAC7D;MACA,OAAO,IAAI,CAACtD,MAAM,CAAC8E,UAAU,CAACD,IAAI,CAAC;IACvC;;IAIA;AACJ;AACA;AACA;IACWE,QAAQA,CAAA,EAAc;MACzB,OAAO,IAAI,CAACrE,KAAK;IACrB;;IAEA;AACJ;AACA;AACA;AACA;AACA;IACWsE,WAAWA,CAACC,OAAsB,EAAEC,QAAgB,EAAEC,WAAmB,EAAQ;MACpFF,OAAO,CAACG,YAAY,CAACF,QAAQ,EAAE;QAC3BL,IAAI,EAAEM,WAAW;QACjBzE,KAAK,EAAE,MAAM,CAAC;MAClB,CAAC,CAAC;IACN;;IAEA;AACJ;AACA;AACA;IACW2E,cAAcA,CAAA,EAA4B;MAC7C;MACA,MAAMC,IAAI,GAAG,IAAI,CAAC5E,KAAK,CAACyB,OAAO,CAAC,CAAC;MACjC,OAAO5B,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAAC6E,IAAI,CAAC,CAAC;IAC3C;;IAEA;AACJ;AACA;IACWC,OAAOA,CAAA,EAAS;MAEnB,IAAI,IAAI,CAAC7E,KAAK,EAAE;QACZ,IAAI,CAACA,KAAK,CAAC6E,OAAO,CAAC,CAAC;MACxB;IACJ;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAzF,YAAA,GAAAA,YAAA;EAAA,OAAAyF,SAAA;AAAA","ignoreList":[]}
@@ -13,13 +13,18 @@ declare module "nz/co/siliconst/ui5/metaui/core/StateManager" {
13
13
  private model;
14
14
  private activeModelName;
15
15
  private schema;
16
+ private _useMessageManager;
16
17
  /**
17
- * Initializes the state manager with an optional initial payload.
18
+ * Initializes the state manager with an authentic SAPUI5 JSONModel.
18
19
  * @param initialData The initial JSON payload to populate the fields.
19
20
  * @param schema The normalized schema for live validation.
20
21
  * @param modelName The UI5 model alias used for isolation.
21
22
  */
22
23
  constructor(initialData: Record<string, unknown>, schema: ISchema, modelName?: string);
24
+ /**
25
+ * Updates the flag indicating whether this manager should push validation errors directly to the global MessageManager.
26
+ */
27
+ setUseMessageManager(use: boolean): void;
23
28
  /**
24
29
  * Validates a specific path against the schema and updates the MessageManager.
25
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"StateManager.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/StateManager.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,8CAA8C,CAAC;IAC9D;;;OAGG;IAEH,OAAO,SAAS,MAAM,6BAA6B,CAAC;IACpD,OAAO,aAAa,MAAM,2BAA2B,CAAC;IACtD,OAAO,EAAE,OAAO,EAAqB,MAAM,+CAA+C,CAAC;IAQ3F;;OAEG;IACH,MAAa,YAAY;QACrB,OAAO,CAAC,KAAK,CAAY;QACzB,OAAO,CAAC,eAAe,CAAS;QAChC,OAAO,CAAC,MAAM,CAAU;QAExB;;;;;WAKG;oBACS,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAE,MAAe;QAkBlG;;WAEG;QACH,OAAO,CAAC,YAAY;QA2DpB;;;;WAIG;QACH,OAAO,CAAC,mBAAmB;QAQ3B;;;WAGG;QACI,QAAQ,IAAI,SAAS;QAI5B;;;;;WAKG;QACI,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;QAOvF;;;WAGG;QACI,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QAMhD;;WAEG;QACI,OAAO,IAAI,IAAI;KAMzB;CAEA"}
1
+ {"version":3,"file":"StateManager.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/StateManager.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,8CAA8C,CAAC;IAC9D;;;OAGG;IAEH,OAAO,SAAS,MAAM,6BAA6B,CAAC;IACpD,OAAO,aAAa,MAAM,2BAA2B,CAAC;IACtD,OAAO,EAAE,OAAO,EAAqB,MAAM,+CAA+C,CAAC;IAQ3F;;OAEG;IACH,MAAa,YAAY;QACrB,OAAO,CAAC,KAAK,CAAY;QACzB,OAAO,CAAC,eAAe,CAAS;QAChC,OAAO,CAAC,MAAM,CAAwB;QACtC,OAAO,CAAC,kBAAkB,CAAkB;QAE5C;;;;;WAKG;oBACS,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAE,MAAe;QAkBlG;;WAEG;QACI,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;QAI/C;;WAEG;QACH,OAAO,CAAC,YAAY;QA6EpB;;;;WAIG;QACH,OAAO,CAAC,mBAAmB;QAQ3B;;;WAGG;QACI,QAAQ,IAAI,SAAS;QAI5B;;;;;WAKG;QACI,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;QAOvF;;;WAGG;QACI,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QAMhD;;WAEG;QACI,OAAO,IAAI,IAAI;KAMzB;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["sap/ui/model/json/JSONModel","./PipelineManager","sap/ui/core/message/Message","sap/ui/core/library","sap/ui/core/Messaging"],function(e,t,s,a,i){"use strict";const r=t["GlobalPipeline"];class o{constructor(t={},s,a="meta"){this.activeModelName=a;this.schema=s;const i=JSON.parse(JSON.stringify(t));this.model=new e(i);this.model.setDefaultBindingMode("TwoWay");const r=this.model.setProperty.bind(this.model);this.model.setProperty=(e,t,s,a)=>{const i=r(e,t,s,a);this.validatePath(e,t);return i}}validatePath(e,t){const o=e.replace(/^\//,"");const n=this.findMetadataForPath(o);const d=i;const l=e.startsWith("/")?e:`/${e}`;const g=d.getMessageModel().getData();const h=g.filter(e=>{const t=e.getTarget()===l&&e.getMessageProcessor()&&e.getMessageProcessor().getId()===this.model.getId();return t});if(h.length>0){d.removeMessages(h)}if(!n)return;const c=[];const m={};if(n.required){c.push("required")}if(n.type==="string"&&n.maxLength){c.push("maxLength");m["maxLength"]={max:n.maxLength}}if(n.ui?.validators){for(const e of n.ui.validators){if(typeof e==="string"){c.push(e)}else if(e&&e.name){c.push(e.name);if(e.args!==undefined){m[e.name]=e.args}}}}if(c.length>0){const e=r.executeValidation(t,c,m);if(!e.isValid){const t=new s({message:e.errorMessage||"Invalid value.",type:a.MessageType.Error,target:l,processor:this.model});d.addMessages(t)}}}findMetadataForPath(e){if(!this.schema||!this.schema.properties)return undefined;return this.schema.properties[e]}getModel(){return this.model}bindControl(e,t,s){e.bindProperty(t,{path:s,model:"meta"})}extractPayload(){const e=this.model.getData();return JSON.parse(JSON.stringify(e))}destroy(){if(this.model){this.model.destroy()}}}var n={__esModule:true};n.StateManager=o;return n});
1
+ sap.ui.define(["sap/ui/model/json/JSONModel","./PipelineManager","sap/ui/core/message/Message","sap/ui/core/library","sap/ui/core/Messaging"],function(e,s,t,a,i){"use strict";const n=s["GlobalPipeline"];class r{schema=null;_useMessageManager=false;constructor(s={},t,a="meta"){this.activeModelName=a;this.schema=t;const i=JSON.parse(JSON.stringify(s));this.model=new e(i);this.model.setDefaultBindingMode("TwoWay");const n=this.model.setProperty.bind(this.model);this.model.setProperty=(e,s,t,a)=>{const i=n(e,s,t,a);this.validatePath(e,s);return i}}setUseMessageManager(e){this._useMessageManager=e}validatePath(e,s){const r=e.replace(/^\//,"");const o=this.findMetadataForPath(r);const g=i;const d=e.startsWith("/")?e:`/${e}`;if(this._useMessageManager){const e=g.getMessageModel().getData();const s=e.filter(e=>{const s=e.getTarget()===d&&e.getMessageProcessor()&&e.getMessageProcessor().getId()===this.model.getId();return s});if(s.length>0){g.removeMessages(s)}}if(!o)return;const m=[];const h={};if(o.required){m.push("required")}if(o.type==="string"&&o.maxLength){m.push("maxLength");h["maxLength"]=o.maxLength}if(o.minLength){m.push("minLength");h["minLength"]=o.minLength}if(o.pattern){m.push("pattern");h["pattern"]=o.pattern}if(o.minimum!==undefined||o.maximum!==undefined){m.push("range");h["range"]={min:o.minimum,max:o.maximum}}const u=o.ui?.format;if(u==="email"||u==="url"||u==="iban"){m.push(u)}if(o.ui?.validators){for(const e of o.ui.validators){if(typeof e==="string"){m.push(e)}else if(e&&e.name){m.push(e.name);if(e.args!==undefined){h[e.name]=e.args}}}}if(m.length>0){const e=n.executeValidation(s,m,h);if(!e.isValid&&this._useMessageManager){const s=new t({message:e.errorMessage||"Invalid value.",type:a.MessageType.Error,target:d,processor:this.model});g.addMessages(s)}}}findMetadataForPath(e){if(!this.schema||!this.schema.properties)return undefined;return this.schema.properties[e]}getModel(){return this.model}bindControl(e,s,t){e.bindProperty(s,{path:t,model:"meta"})}extractPayload(){const e=this.model.getData();return JSON.parse(JSON.stringify(e))}destroy(){if(this.model){this.model.destroy()}}}var o={__esModule:true};o.StateManager=r;return o});
2
2
  //# sourceMappingURL=StateManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateManager.js","names":["GlobalPipeline","___PipelineManager","StateManager","constructor","initialData","schema","modelName","this","activeModelName","safeData","JSON","parse","stringify","model","JSONModel","setDefaultBindingMode","originalSetProperty","setProperty","bind","sPath","oValue","oContext","bAsyncUpdate","result","validatePath","value","fieldKey","replace","metadata","findMetadataForPath","messageManager","Messaging","targetPath","startsWith","existingMessages","getMessageModel","getData","messagesToRemove","filter","msg","isMatch","getTarget","getMessageProcessor","getId","length","removeMessages","validatorsToRun","argsMap","required","push","type","maxLength","max","ui","validators","v","name","args","undefined","validationResult","executeValidation","isValid","newMsg","Message","message","errorMessage","coreLibrary","MessageType","Error","target","processor","addMessages","path","properties","getModel","bindControl","control","property","bindingPath","bindProperty","extractPayload","data","destroy","__exports","__esModule"],"sources":["StateManager.ts"],"sourcesContent":["/**\n * @file StateManager.ts\n * @description Isolated internal state management. Decouples the MetaUI engine from external host models.\n */\n\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport ManagedObject from \"sap/ui/base/ManagedObject\";\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { GlobalPipeline } from \"./PipelineManager\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n\n/**\n * Manages the isolated internal data payload for the MetaUI engine.\n */\nexport class StateManager {\n private model: JSONModel;\n private activeModelName: string;\n private schema: ISchema;\n\n /**\n * Initializes the state manager with an optional initial payload.\n * @param initialData The initial JSON payload to populate the fields.\n * @param schema The normalized schema for live validation.\n * @param modelName The UI5 model alias used for isolation.\n */\n constructor(initialData: Record<string, unknown> = {}, schema: ISchema, modelName: string = \"meta\") {\n this.activeModelName = modelName;\n this.schema = schema;\n \n // Deep copy to ensure no reference leakage from the host application\n const safeData = JSON.parse(JSON.stringify(initialData));\n this.model = new JSONModel(safeData);\n this.model.setDefaultBindingMode(\"TwoWay\");\n\n // Centralized Model-Level Validation Interceptor\n const originalSetProperty = this.model.setProperty.bind(this.model);\n this.model.setProperty = (sPath: string, oValue: unknown, oContext?: unknown, bAsyncUpdate?: boolean) => {\n const result = originalSetProperty(sPath, oValue, oContext, bAsyncUpdate);\n this.validatePath(sPath, oValue);\n return result;\n };\n }\n\n /**\n * Validates a specific path against the schema and updates the MessageManager.\n */\n private validatePath(sPath: string, value: unknown): void {\n const fieldKey = sPath.replace(/^\\//, \"\");\n const metadata = this.findMetadataForPath(fieldKey);\n \n const messageManager = Messaging;\n const targetPath = sPath.startsWith(\"/\") ? sPath : `/${sPath}`; // Pure UI5: target MUST be absolute path\n \n // 1. Remove existing messages (strictly for THIS model instance)\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove = existingMessages.filter((msg: sap.ui.core.message.Message) => {\n const isMatch = msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.model.getId();\n return isMatch;\n });\n \n \n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n\n if (!metadata) return;\n\n // 2. Run GlobalPipeline\n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {};\n\n if (metadata.required) {\n validatorsToRun.push(\"required\");\n }\n if (metadata.type === \"string\" && metadata.maxLength) {\n validatorsToRun.push(\"maxLength\");\n argsMap[\"maxLength\"] = { max: metadata.maxLength };\n }\n if (metadata.ui?.validators) {\n for (const v of metadata.ui.validators) {\n if (typeof v === \"string\") {\n validatorsToRun.push(v);\n } else if (v && v.name) {\n validatorsToRun.push(v.name);\n if (v.args !== undefined) {\n argsMap[v.name] = v.args;\n }\n }\n }\n }\n\n if (validatorsToRun.length > 0) {\n const validationResult = GlobalPipeline.executeValidation(value, validatorsToRun, argsMap);\n if (!validationResult.isValid) {\n const newMsg = new Message({\n message: validationResult.errorMessage || \"Invalid value.\",\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: this.model\n });\n messageManager.addMessages(newMsg);\n }\n }\n }\n\n /**\n * Resolves the schema metadata for a given internal binding path.\n * @param path The flat binding path representing the field.\n * @returns The associated IPropertyMetadata, or undefined if not mapped.\n */\n private findMetadataForPath(path: string): IPropertyMetadata | undefined {\n if (!this.schema || !this.schema.properties) return undefined;\n // Basic single-level support for now. Nested object resolution would split by '.' or '/'\n return this.schema.properties[path];\n }\n\n\n\n /**\n * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.\n * @returns The internal JSONModel.\n */\n public getModel(): JSONModel {\n return this.model;\n }\n\n /**\n * Binds a generated UI control property to a path in the internal model.\n * @param control The target UI5 Control.\n * @param property The UI5 property name (e.g., 'value').\n * @param bindingPath The exact path in the JSON payload.\n */\n public bindControl(control: ManagedObject, property: string, bindingPath: string): void {\n control.bindProperty(property, {\n path: bindingPath,\n model: \"meta\" // Assumes the model is bound to the root container with the name 'meta'\n });\n }\n\n /**\n * Extracts the flat JavaScript object representing the current state of the UI.\n * @returns A serialized record of the data payload, free of UI5 wrappers.\n */\n public extractPayload(): Record<string, unknown> {\n // Create a deep copy to prevent accidental mutations by the host\n const data = this.model.getData();\n return JSON.parse(JSON.stringify(data));\n }\n\n /**\n * Cleans up internal state and natively destroys the UI5 JSONModel to prevent memory leaks.\n */\n public destroy(): void {\n \n if (this.model) {\n this.model.destroy();\n }\n }\n}\n"],"mappings":"qLAQSA,EAAcC,EAAA,kBAUhB,MAAMC,EAWTC,YAAYC,EAAuC,CAAC,EAAGC,EAAiBC,EAAoB,QACxFC,KAAKC,gBAAkBF,EACvBC,KAAKF,OAASA,EAGd,MAAMI,EAAWC,KAAKC,MAAMD,KAAKE,UAAUR,IAC3CG,KAAKM,MAAQ,IAAIC,EAAUL,GAC3BF,KAAKM,MAAME,sBAAsB,UAGjC,MAAMC,EAAsBT,KAAKM,MAAMI,YAAYC,KAAKX,KAAKM,OAC7DN,KAAKM,MAAMI,YAAc,CAACE,EAAeC,EAAiBC,EAAoBC,KAC1E,MAAMC,EAASP,EAAoBG,EAAOC,EAAQC,EAAUC,GAC5Df,KAAKiB,aAAaL,EAAOC,GACzB,OAAOG,EAEf,CAKQC,aAAaL,EAAeM,GAChC,MAAMC,EAAWP,EAAMQ,QAAQ,MAAO,IACtC,MAAMC,EAAWrB,KAAKsB,oBAAoBH,GAE1C,MAAMI,EAAiBC,EACvB,MAAMC,EAAab,EAAMc,WAAW,KAAOd,EAAQ,IAAIA,IAGvD,MAAMe,EAAmBJ,EAAeK,kBAAkBC,UAC1D,MAAMC,EAAmBH,EAAiBI,OAAQC,IAC9C,MAAMC,EAAUD,EAAIE,cAAgBT,GAAc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,iBAEH,MAAMC,EAAO1E,KAAKM,MAAMuB,UACxB,OAAO1B,KAAKC,MAAMD,KAAKE,UAAUqE,GACrC,CAKOC,UAEH,GAAI3E,KAAKM,MAAO,CACZN,KAAKM,MAAMqE,SACf,CACJ,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAAjF,eAAA,OAAAiF,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"StateManager.js","names":["GlobalPipeline","___PipelineManager","StateManager","schema","_useMessageManager","constructor","initialData","modelName","this","activeModelName","safeData","JSON","parse","stringify","model","JSONModel","setDefaultBindingMode","originalSetProperty","setProperty","bind","sPath","oValue","oContext","bAsyncUpdate","result","validatePath","setUseMessageManager","use","value","fieldKey","replace","metadata","findMetadataForPath","messageManager","Messaging","targetPath","startsWith","existingMessages","getMessageModel","getData","messagesToRemove","filter","msg","isMatch","getTarget","getMessageProcessor","getId","length","removeMessages","validatorsToRun","argsMap","required","push","type","maxLength","minLength","pattern","minimum","undefined","maximum","min","max","format","ui","validators","v","name","args","validationResult","executeValidation","isValid","newMsg","Message","message","errorMessage","coreLibrary","MessageType","Error","target","processor","addMessages","path","properties","getModel","bindControl","control","property","bindingPath","bindProperty","extractPayload","data","destroy","__exports","__esModule"],"sources":["StateManager.ts"],"sourcesContent":["/**\n * @file StateManager.ts\n * @description Isolated internal state management. Decouples the MetaUI engine from external host models.\n */\n\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport ManagedObject from \"sap/ui/base/ManagedObject\";\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { GlobalPipeline } from \"./PipelineManager\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n\n/**\n * Manages the isolated internal data payload for the MetaUI engine.\n */\nexport class StateManager {\n private model: JSONModel;\n private activeModelName: string;\n private schema: ISchema | null = null;\n private _useMessageManager: boolean = false;\n\n /**\n * Initializes the state manager with an authentic SAPUI5 JSONModel.\n * @param initialData The initial JSON payload to populate the fields.\n * @param schema The normalized schema for live validation.\n * @param modelName The UI5 model alias used for isolation.\n */\n constructor(initialData: Record<string, unknown> = {}, schema: ISchema, modelName: string = \"meta\") {\n this.activeModelName = modelName;\n this.schema = schema;\n \n // Deep copy to ensure no reference leakage from the host application\n const safeData = JSON.parse(JSON.stringify(initialData));\n this.model = new JSONModel(safeData);\n this.model.setDefaultBindingMode(\"TwoWay\");\n\n // Centralized Model-Level Validation Interceptor\n const originalSetProperty = this.model.setProperty.bind(this.model);\n this.model.setProperty = (sPath: string, oValue: unknown, oContext?: unknown, bAsyncUpdate?: boolean) => {\n const result = originalSetProperty(sPath, oValue, oContext, bAsyncUpdate);\n this.validatePath(sPath, oValue);\n return result;\n };\n }\n\n /**\n * Updates the flag indicating whether this manager should push validation errors directly to the global MessageManager.\n */\n public setUseMessageManager(use: boolean): void {\n this._useMessageManager = use;\n }\n\n /**\n * Validates a specific path against the schema and updates the MessageManager.\n */\n private validatePath(sPath: string, value: unknown): void {\n const fieldKey = sPath.replace(/^\\//, \"\");\n const metadata = this.findMetadataForPath(fieldKey);\n \n const messageManager = Messaging;\n const targetPath = sPath.startsWith(\"/\") ? sPath : `/${sPath}`; // Pure UI5: target MUST be absolute path\n \n // 1. Remove existing messages (strictly for THIS model instance)\n if (this._useMessageManager) {\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove = existingMessages.filter((msg: sap.ui.core.message.Message) => {\n const isMatch = msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.model.getId();\n return isMatch;\n });\n \n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n }\n\n if (!metadata) return;\n\n // 2. Run GlobalPipeline\n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {};\n\n if (metadata.required) {\n validatorsToRun.push(\"required\");\n }\n if (metadata.type === \"string\" && metadata.maxLength) {\n validatorsToRun.push(\"maxLength\");\n argsMap[\"maxLength\"] = metadata.maxLength;\n }\n if (metadata.minLength) {\n validatorsToRun.push(\"minLength\");\n argsMap[\"minLength\"] = metadata.minLength;\n }\n if (metadata.pattern) {\n validatorsToRun.push(\"pattern\");\n argsMap[\"pattern\"] = metadata.pattern;\n }\n if (metadata.minimum !== undefined || metadata.maximum !== undefined) {\n validatorsToRun.push(\"range\");\n argsMap[\"range\"] = { min: metadata.minimum, max: metadata.maximum };\n }\n \n const format = metadata.ui?.format;\n if (format === \"email\" || format === \"url\" || format === \"iban\") {\n validatorsToRun.push(format);\n }\n if (metadata.ui?.validators) {\n for (const v of metadata.ui.validators) {\n if (typeof v === \"string\") {\n validatorsToRun.push(v);\n } else if (v && v.name) {\n validatorsToRun.push(v.name);\n if (v.args !== undefined) {\n argsMap[v.name] = v.args;\n }\n }\n }\n }\n\n if (validatorsToRun.length > 0) {\n const validationResult = GlobalPipeline.executeValidation(value, validatorsToRun, argsMap);\n if (!validationResult.isValid && this._useMessageManager) {\n const newMsg = new Message({\n message: validationResult.errorMessage || \"Invalid value.\",\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: this.model\n });\n messageManager.addMessages(newMsg);\n }\n }\n }\n\n /**\n * Resolves the schema metadata for a given internal binding path.\n * @param path The flat binding path representing the field.\n * @returns The associated IPropertyMetadata, or undefined if not mapped.\n */\n private findMetadataForPath(path: string): IPropertyMetadata | undefined {\n if (!this.schema || !this.schema.properties) return undefined;\n // Basic single-level support for now. Nested object resolution would split by '.' or '/'\n return this.schema.properties[path];\n }\n\n\n\n /**\n * Retrieves the isolated JSONModel instance to attach to the root GeneratorHost control.\n * @returns The internal JSONModel.\n */\n public getModel(): JSONModel {\n return this.model;\n }\n\n /**\n * Binds a generated UI control property to a path in the internal model.\n * @param control The target UI5 Control.\n * @param property The UI5 property name (e.g., 'value').\n * @param bindingPath The exact path in the JSON payload.\n */\n public bindControl(control: ManagedObject, property: string, bindingPath: string): void {\n control.bindProperty(property, {\n path: bindingPath,\n model: \"meta\" // Assumes the model is bound to the root container with the name 'meta'\n });\n }\n\n /**\n * Extracts the flat JavaScript object representing the current state of the UI.\n * @returns A serialized record of the data payload, free of UI5 wrappers.\n */\n public extractPayload(): Record<string, unknown> {\n // Create a deep copy to prevent accidental mutations by the host\n const data = this.model.getData();\n return JSON.parse(JSON.stringify(data));\n }\n\n /**\n * Cleans up internal state and natively destroys the UI5 JSONModel to prevent memory leaks.\n */\n public destroy(): void {\n \n if (this.model) {\n this.model.destroy();\n }\n }\n}\n"],"mappings":"qLAQSA,EAAcC,EAAA,kBAUhB,MAAMC,EAGDC,OAAyB,KACzBC,mBAA8B,MAQtCC,YAAYC,EAAuC,CAAC,EAAGH,EAAiBI,EAAoB,QACxFC,KAAKC,gBAAkBF,EACvBC,KAAKL,OAASA,EAGd,MAAMO,EAAWC,KAAKC,MAAMD,KAAKE,UAAUP,IAC3CE,KAAKM,MAAQ,IAAIC,EAAUL,GAC3BF,KAAKM,MAAME,sBAAsB,UAGjC,MAAMC,EAAsBT,KAAKM,MAAMI,YAAYC,KAAKX,KAAKM,OAC7DN,KAAKM,MAAMI,YAAc,CAACE,EAAeC,EAAiBC,EAAoBC,KAC1E,MAAMC,EAASP,EAAoBG,EAAOC,EAAQC,EAAUC,GAC5Df,KAAKiB,aAAaL,EAAOC,GACzB,OAAOG,EAEf,CAKOE,qBAAqBC,GACxBnB,KAAKJ,mBAAqBuB,CAC9B,CAKQF,aAAaL,EAAeQ,GAChC,MAAMC,EAAWT,EAAMU,QAAQ,MAAO,IACtC,MAAMC,EAAWvB,KAAKwB,oBAAoBH,GAE1C,MAAMI,EAAiBC,EACvB,MAAMC,EAAaf,EAAMgB,WAAW,KAAOhB,EAAQ,IAAIA,IAGvD,GAAIZ,KAAKJ,mBAAoB,CACzB,MAAMiC,EAAmBJ,EAAeK,kBAAkBC,UAC1D,MAAMC,EAAmBH,EAAiBI,OAAQC,IAC9C,MAAMC,EAAUD,EAAIE,cAAg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