@siliconst/metaui 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -123
- package/package.json +22 -34
- package/src/nz/co/siliconst/ui5/metaui/.library +7 -7
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js +300 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts +130 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.ts +292 -162
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js +52 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts +29 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.ts +49 -40
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +82 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +17 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +82 -56
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus-dbg.js +66 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts +40 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.ts +60 -45
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +73 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts +39 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts +71 -56
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +146 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +25 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts +157 -31
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js +56 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts +37 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +56 -56
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.d.ts +29 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.ts +29 -29
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts +20 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.ts +21 -26
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +15 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +14 -33
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +58 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +70 -70
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js +24 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts +15 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.ts +22 -34
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +99 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts +20 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +97 -60
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +103 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts +16 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +119 -102
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js +44 -0
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js +39 -0
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library.d.ts +10 -0
- package/src/nz/co/siliconst/ui5/metaui/library.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/library.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library.ts +55 -43
- package/src/nz/co/siliconst/ui5/metaui/manifest.json +35 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin-dbg.js +68 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.d.ts +15 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.ts +71 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js +55 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts +24 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.ts +56 -58
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js +42 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.ts +41 -42
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js +69 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.ts +69 -63
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin-dbg.js +68 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.ts +68 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js +67 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.ts +65 -65
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js +56 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.ts +56 -55
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js +57 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.ts +58 -55
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin-dbg.js +43 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.ts +42 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin-dbg.js +58 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.ts +58 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin-dbg.js +74 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.ts +71 -0
- package/ui5.yaml +4 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratorHost-dbg.js","names":["SchemaNormalizer","___core_SchemaNormalizer","Engine","___core_Engine","StateManager","___core_StateManager","BaseLayout","___layouts_BaseLayout","GeneratorHost","Control","extend","constructor","prototype","apply","arguments","stateManager","generatedContent","engine","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","initialData","initialDataJson","outputData","outputDataJson","useMessageManager","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","init","_init","Control.prototype.init.call","exit","_exit","destroy","getModel","onBeforeRendering","_onBeforeRendering","getProperty","generate","triggerSubmit","_triggerSubmit","isPrevented","messageManager","sap","ui","getCore","getMessageManager","removeAllMessages","pushMessage","path","text","require","Message","addMessages","message","target","getId","processor","validateAll","extractPayload","JSON","stringify","fireEvent","propertyPath","errorMessage","Log","warning","setProperty","_generate","rawSchema","parse","e","error","normalizedSchema","normalize","modelName","setModel","layoutFactory","build","setAggregation","errorPage","MessagePage","description","icon","openInDialog","_openInDialog","title","submitButtonText","dialog","Dialog","contentWidth","beginButton","Button","press","success","endButton","afterClose","open"],"sources":["GeneratorHost.ts"],"sourcesContent":["/**\n * @file GeneratorHost.ts\n * @description The core UI5 custom control that exposes the MetaUI engine to host applications.\n */\n\nimport Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport Dialog from \"sap/m/Dialog\";\nimport Button from \"sap/m/Button\";\nimport MessagePage from \"sap/m/MessagePage\";\nimport Log from \"sap/base/Log\";\nimport { SchemaNormalizer } from \"../core/SchemaNormalizer\";\nimport { Engine } from \"../core/Engine\";\nimport { StateManager } from \"../core/StateManager\";\nimport { BaseLayout } from \"../layouts/BaseLayout\";\n\n/**\n * Wrapper element for embedding or popping the dynamic form.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls\n */\nexport default class GeneratorHost extends Control {\n \n private stateManager: StateManager | null = null;\n private generatedContent: Control | null = null;\n private engine: Engine | null = null;\n\n static readonly metadata = {\n properties: {\n /** The raw JSON metadata schema provided by the ABAP backend. */\n schemaDefinition: { type: \"any\", defaultValue: null },\n /** The initial data payload to populate the fields as an object. */\n initialData: { type: \"any\", defaultValue: null },\n /** The initial data payload provided as a raw JSON string. */\n initialDataJson: { type: \"string\", defaultValue: null },\n /** The final payload data object, updated on submit. */\n outputData: { type: \"object\", defaultValue: null },\n /** The final payload JSON string, updated on submit. */\n outputDataJson: { type: \"string\", defaultValue: null },\n /** If true, validation errors will be pushed to the global sap.ui.core.message.MessageManager. */\n useMessageManager: { type: \"boolean\", defaultValue: false }\n },\n aggregations: {\n /** The internal hidden container holding the generated layouts. */\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n /** Triggered before final submission, allowing host apps to run custom validation logic and halt submission if needed. */\n beforeSubmit: {\n parameters: {\n /** The clean extracted JSON payload representing the current state. */\n payload: { type: \"object\" },\n /** Function to add a custom validation error message for a specific field path. */\n addError: { type: \"function\" },\n /** Function to prevent the default submission and dialog closure. */\n preventDefault: { type: \"function\" }\n }\n },\n /** Triggered when the user submits the form via the Dialog modality. */\n submit: {\n parameters: {\n /** The clean extracted JSON payload representing the current state. */\n payload: { type: \"object\" },\n /** The stringified final JSON payload. */\n payloadJson: { type: \"string\" }\n }\n },\n /** Triggered if the dialog is cancelled. */\n cancel: {}\n }\n };\n\n /**\n * Standard UI5 control renderer. Renders the generated internal content.\n */\n static renderer = {\n apiVersion: 2,\n render(rm: RenderManager, control: GeneratorHost) {\n rm.openStart(\"div\", control);\n rm.style(\"width\", \"100%\");\n rm.style(\"height\", \"100%\");\n rm.openEnd();\n \n const content = control.getAggregation(\"_content\") as Control;\n if (content) {\n rm.renderControl(content);\n }\n \n rm.close(\"div\");\n }\n };\n\n /**\n * Initializes the UI5 control.\n */\n public init(): void {\n super.init();\n }\n\n /**\n * Standard UI5 lifecycle hook for destruction.\n * Guaranteed to tear down isolated models and unbind global event listeners.\n */\n public exit(): void {\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n if (this.generatedContent) {\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /**\n * Lifecycle hook to automatically generate the layout if bound declaratively in XML.\n */\n public onBeforeRendering(): void {\n if (!this.generatedContent && this.getProperty(\"schemaDefinition\")) {\n this.generate();\n }\n }\n\n /**\n * Extracts the payload, pushes it to properties, and fires the submit event manually.\n * Returns true if submission was successful, false if validation failed or was prevented.\n */\n public triggerSubmit(): boolean {\n if (this.stateManager && this.engine) {\n let isPrevented = false;\n const useMessageManager = this.getProperty(\"useMessageManager\") as boolean;\n let messageManager: any = null;\n \n if (useMessageManager) {\n messageManager = sap.ui.getCore().getMessageManager();\n messageManager.removeAllMessages();\n }\n\n // Helper to add messages securely via async require so it isn't a hard dependency\n const pushMessage = (path: string, text: string) => {\n if (useMessageManager && messageManager) {\n sap.ui.require([\"sap/ui/core/message/Message\"], (Message: any) => {\n messageManager.addMessages(new Message({\n message: text,\n type: \"Error\" as any,\n target: `${this.stateManager?.getModel().getId()}>/${path}`,\n processor: this.stateManager?.getModel()\n }));\n });\n }\n };\n\n // 1. Run global schema validation\n if (!this.engine.validateAll()) {\n pushMessage(\"\", \"One or more fields failed schema validation. Please review the highlighted fields.\");\n return false; // Schema validation failed, inputs already turned red\n }\n\n const payload = this.stateManager.extractPayload();\n const payloadJson = JSON.stringify(payload);\n \n // 2. Fire beforeSubmit exit\n this.fireEvent(\"beforeSubmit\", {\n payload,\n preventDefault: () => {\n isPrevented = true;\n },\n addError: (propertyPath: string, errorMessage: string) => {\n isPrevented = true;\n if (useMessageManager && messageManager) {\n pushMessage(propertyPath, errorMessage);\n } else {\n Log.warning(`[MetaUI] Validation Error for ${propertyPath}: ${errorMessage}`, \"GeneratorHost\");\n }\n }\n });\n\n if (isPrevented) {\n return false; // Exit validation failed or prevented submission\n }\n \n // Push final values to properties (updating XML bindings)\n this.setProperty(\"outputData\", payload, true);\n this.setProperty(\"outputDataJson\", payloadJson, true);\n \n this.fireEvent(\"submit\", { payload, payloadJson });\n return true;\n }\n return false;\n }\n\n /**\n * Triggers the engine to parse the schema and build the layout.\n * Safely wrapped in a try/catch to prevent Launchpad crashes.\n */\n public generate(): void {\n try {\n const rawSchema = this.getProperty(\"schemaDefinition\");\n \n let initialData = this.getProperty(\"initialData\");\n const initialDataJson = this.getProperty(\"initialDataJson\");\n \n if (initialDataJson) {\n try {\n initialData = JSON.parse(initialDataJson);\n } catch (e) {\n Log.error(\"[MetaUI] Failed to parse initialDataJson string.\", (e as Error).message, \"GeneratorHost\");\n }\n } else if (typeof initialData === \"string\") {\n try {\n initialData = JSON.parse(initialData);\n } catch (e) {\n Log.error(\"[MetaUI] Failed to parse initialData string.\", (e as Error).message, \"GeneratorHost\");\n }\n }\n\n // 1. Normalize schema (allows fallback to data inference)\n const normalizedSchema = SchemaNormalizer.normalize(rawSchema, initialData);\n\n // 2. Bootstrap isolated State Manager\n this.stateManager = new StateManager(initialData || {});\n \n // Dynamically generate a 100% unique model name for isolation\n const modelName = \"metaUI_\" + this.getId();\n this.setModel(this.stateManager.getModel(), modelName);\n\n // 3. Delegate to Layout Engine\n this.engine = new Engine();\n const layoutFactory = new BaseLayout();\n \n this.generatedContent = this.engine.build(normalizedSchema, layoutFactory, modelName);\n\n // 4. Mount into hidden aggregation\n this.setAggregation(\"_content\", this.generatedContent);\n\n } catch (error) {\n Log.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", (error as Error).message, \"GeneratorHost\");\n \n const errorPage = new MessagePage({\n text: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\",\n icon: \"sap-icon://error\"\n });\n\n this.setAggregation(\"_content\", errorPage);\n }\n }\n\n /**\n * Dialog Modality: Opens the generated layout inside a sap.m.Dialog.\n * Automatically wires up 'Save' and 'Cancel' buttons.\n */\n public openInDialog(title: string = \"Dynamic Form\", submitButtonText: string = \"Save\"): void {\n if (!this.generatedContent) {\n this.generate();\n }\n\n const dialog = new Dialog({\n title: title,\n contentWidth: \"800px\",\n content: [this], // Mount self inside the dialog\n beginButton: new Button({\n text: submitButtonText,\n type: \"Emphasized\",\n press: () => {\n const success = this.triggerSubmit();\n if (success) {\n dialog.close();\n }\n }\n }),\n endButton: new Button({\n text: \"Cancel\",\n press: () => {\n this.fireEvent(\"cancel\");\n dialog.close();\n }\n }),\n afterClose: () => {\n dialog.destroy();\n }\n });\n\n dialog.open();\n }\n}\n"],"mappings":";;;QAWSA,gBAAgB,GAAAC,wBAAA;EAAA,MAChBC,MAAM,GAAAC,cAAA;EAAA,MACNC,YAAY,GAAAC,oBAAA;EAAA,MACZC,UAAU,GAAAC,qBAAA;EAEnB;AACA;AACA;AACA;AACA;EAJA,MAKqBC,aAAa,GAASC,OAAO,CAAAC,MAAA;IAAAC,WAAA,WAAAA,YAAA;MAAAF,OAAA,CAAAG,SAAA,CAAAD,WAAA,CAAAE,KAAA,OAAAC,SAAA;MAAA,KAEtCC,YAAY,GAAwB,IAAI;MAAA,KACxCC,gBAAgB,GAAmB,IAAI;MAAA,KACvCC,MAAM,GAAkB,IAAI;IAAA;IA+CpC;AACJ;AACA;IACWC,QAAQ,EAAG;MACdC,UAAU,EAAE,CAAC;MACbC,MAAMA,CAACC,EAAiB,EAAEC,OAAsB,EAAE;QAC9CD,EAAE,CAACE,SAAS,CAAC,KAAK,EAAED,OAAO,CAAC;QAC5BD,EAAE,CAACG,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;QACzBH,EAAE,CAACG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1BH,EAAE,CAACI,OAAO,CAAC,CAAC;QAEZ,MAAMC,OAAO,GAAGJ,OAAO,CAACK,cAAc,CAAC,UAAU,CAAY;QAC7D,I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B0F,WAAW,EAAE,IAAIC,MAAM,CAAC;UACpB1C,IAAI,EAAEqC,gBAAgB;UACtB/E,IAAI,EAAE,YAAY;UAClBqF,KAAK,EAAEA,CAAA,KAAM;YACT,MAAMC,OAAO,GAAG,IAAI,CAACvD,aAAa,CAAC,CAAC;YACpC,IAAIuD,OAAO,EAAE;cACTN,MAAM,CAACpF,KAAK,CAAC,CAAC;YAClB;UACJ;QACJ,CAAC,CAAC;QACF2F,SAAS,EAAE,IAAIH,MAAM,CAAC;UAClB1C,IAAI,EAAE,QAAQ;UACd2C,KAAK,EAAEA,CAAA,KAAM;YACT,IAAI,CAAC/B,SAAS,CAAC,QAAQ,CAAC;YACxB0B,MAAM,CAACpF,KAAK,CAAC,CAAC;UAClB;QACJ,CAAC,CAAC;QACF4F,UAAU,EAAEA,CAAA,KAAM;UACdR,MAAM,CAACvD,OAAO,CAAC,CAAC;QACpB;MACJ,CAAC,CAAC;MAEFuD,MAAM,CAACS,IAAI,CAAC,CAAC;IACjB;EAAC;EAAA,OA7QgBlH,aAAa;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
declare module "nz/co/siliconst/ui5/metaui/controls/GeneratorHost" {
|
|
2
|
+
/**
|
|
3
|
+
* @file GeneratorHost.ts
|
|
4
|
+
* @description The core UI5 custom control that exposes the MetaUI engine to host applications.
|
|
5
|
+
*/
|
|
6
|
+
import Control from "sap/ui/core/Control";
|
|
7
|
+
import RenderManager from "sap/ui/core/RenderManager";
|
|
8
|
+
/**
|
|
9
|
+
* Wrapper element for embedding or popping the dynamic form.
|
|
10
|
+
*
|
|
11
|
+
* @namespace nz.co.siliconst.ui5.metaui.controls
|
|
12
|
+
*/
|
|
13
|
+
export default class GeneratorHost extends Control {
|
|
14
|
+
private stateManager;
|
|
15
|
+
private generatedContent;
|
|
16
|
+
private engine;
|
|
17
|
+
static readonly metadata: {
|
|
18
|
+
properties: {
|
|
19
|
+
/** The raw JSON metadata schema provided by the ABAP backend. */
|
|
20
|
+
schemaDefinition: {
|
|
21
|
+
type: string;
|
|
22
|
+
defaultValue: any;
|
|
23
|
+
};
|
|
24
|
+
/** The initial data payload to populate the fields as an object. */
|
|
25
|
+
initialData: {
|
|
26
|
+
type: string;
|
|
27
|
+
defaultValue: any;
|
|
28
|
+
};
|
|
29
|
+
/** The initial data payload provided as a raw JSON string. */
|
|
30
|
+
initialDataJson: {
|
|
31
|
+
type: string;
|
|
32
|
+
defaultValue: any;
|
|
33
|
+
};
|
|
34
|
+
/** The final payload data object, updated on submit. */
|
|
35
|
+
outputData: {
|
|
36
|
+
type: string;
|
|
37
|
+
defaultValue: any;
|
|
38
|
+
};
|
|
39
|
+
/** The final payload JSON string, updated on submit. */
|
|
40
|
+
outputDataJson: {
|
|
41
|
+
type: string;
|
|
42
|
+
defaultValue: any;
|
|
43
|
+
};
|
|
44
|
+
/** If true, validation errors will be pushed to the global sap.ui.core.message.MessageManager. */
|
|
45
|
+
useMessageManager: {
|
|
46
|
+
type: string;
|
|
47
|
+
defaultValue: boolean;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
aggregations: {
|
|
51
|
+
/** The internal hidden container holding the generated layouts. */
|
|
52
|
+
_content: {
|
|
53
|
+
type: string;
|
|
54
|
+
multiple: boolean;
|
|
55
|
+
visibility: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
events: {
|
|
59
|
+
/** Triggered before final submission, allowing host apps to run custom validation logic and halt submission if needed. */
|
|
60
|
+
beforeSubmit: {
|
|
61
|
+
parameters: {
|
|
62
|
+
/** The clean extracted JSON payload representing the current state. */
|
|
63
|
+
payload: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
/** Function to add a custom validation error message for a specific field path. */
|
|
67
|
+
addError: {
|
|
68
|
+
type: string;
|
|
69
|
+
};
|
|
70
|
+
/** Function to prevent the default submission and dialog closure. */
|
|
71
|
+
preventDefault: {
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/** Triggered when the user submits the form via the Dialog modality. */
|
|
77
|
+
submit: {
|
|
78
|
+
parameters: {
|
|
79
|
+
/** The clean extracted JSON payload representing the current state. */
|
|
80
|
+
payload: {
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
/** The stringified final JSON payload. */
|
|
84
|
+
payloadJson: {
|
|
85
|
+
type: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
/** Triggered if the dialog is cancelled. */
|
|
90
|
+
cancel: {};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Standard UI5 control renderer. Renders the generated internal content.
|
|
95
|
+
*/
|
|
96
|
+
static renderer: {
|
|
97
|
+
apiVersion: number;
|
|
98
|
+
render(rm: RenderManager, control: GeneratorHost): void;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Initializes the UI5 control.
|
|
102
|
+
*/
|
|
103
|
+
init(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Standard UI5 lifecycle hook for destruction.
|
|
106
|
+
* Guaranteed to tear down isolated models and unbind global event listeners.
|
|
107
|
+
*/
|
|
108
|
+
exit(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Lifecycle hook to automatically generate the layout if bound declaratively in XML.
|
|
111
|
+
*/
|
|
112
|
+
onBeforeRendering(): void;
|
|
113
|
+
/**
|
|
114
|
+
* Extracts the payload, pushes it to properties, and fires the submit event manually.
|
|
115
|
+
* Returns true if submission was successful, false if validation failed or was prevented.
|
|
116
|
+
*/
|
|
117
|
+
triggerSubmit(): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Triggers the engine to parse the schema and build the layout.
|
|
120
|
+
* Safely wrapped in a try/catch to prevent Launchpad crashes.
|
|
121
|
+
*/
|
|
122
|
+
generate(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Dialog Modality: Opens the generated layout inside a sap.m.Dialog.
|
|
125
|
+
* Automatically wires up 'Save' and 'Cancel' buttons.
|
|
126
|
+
*/
|
|
127
|
+
openInDialog(title?: string, submitButtonText?: string): void;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=GeneratorHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratorHost.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,mDAAmD,CAAC;IACnE;;;OAGG;IAEH,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,aAAa,MAAM,2BAA2B,CAAC;IAUtD;;;;OAIG;IACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;QAE9C,OAAO,CAAC,YAAY,CAA6B;QACjD,OAAO,CAAC,gBAAgB,CAAwB;QAChD,OAAO,CAAC,MAAM,CAAuB;QAErC,MAAM,CAAC,QAAQ,CAAC,QAAQ;;gBAEhB,iEAAiE;;;;;gBAEjE,oEAAoE;;;;;gBAEpE,8DAA8D;;;;;gBAE9D,wDAAwD;;;;;gBAExD,wDAAwD;;;;;gBAExD,kGAAkG;;;;;;;gBAIlG,mEAAmE;;;;;;;;gBAInE,0HAA0H;;;wBAGlH,uEAAuE;;;;wBAEvE,mFAAmF;;;;wBAEnF,qEAAqE;;;;;;gBAI7E,wEAAwE;;;wBAGhE,uEAAuE;;;;wBAEvE,0CAA0C;;;;;;gBAIlD,4CAA4C;;;UAGlD;QAEF;;WAEG;QACH,MAAM,CAAC,QAAQ;;uBAEA,aAAa,WAAW,aAAa;UAalD;QAEF;;WAEG;QACI,IAAI,IAAI,IAAI;QAInB;;;WAGG;QACI,IAAI,IAAI,IAAI;QAiBnB;;WAEG;QACI,iBAAiB,IAAI,IAAI;QAMhC;;;WAGG;QACI,aAAa,IAAI,OAAO;QAgE/B;;;WAGG;QACI,QAAQ,IAAI,IAAI;QAqDvB;;;WAGG;QACI,YAAY,CAAC,KAAK,GAAE,MAAuB,EAAE,gBAAgB,GAAE,MAAe,GAAG,IAAI;KAiC/F;CAEA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
sap.ui.define(["sap/ui/core/Control","sap/m/Dialog","sap/m/Button","sap/m/MessagePage","sap/base/Log","../core/SchemaNormalizer","../core/Engine","../core/StateManager","../layouts/BaseLayout"],function(e,t,n,a,i,s,r,o,l){"use strict";const g=s["SchemaNormalizer"];const c=r["Engine"];const u=o["StateManager"];const d=l["BaseLayout"];const p=e.extend("nz.co.siliconst.ui5.metaui.controls.GeneratorHost",{constructor:function t(){e.prototype.constructor.apply(this,arguments);this.stateManager=null;this.generatedContent=null;this.engine=null},renderer:{apiVersion:2,render(e,t){e.openStart("div",t);e.style("width","100%");e.style("height","100%");e.openEnd();const n=t.getAggregation("_content");if(n){e.renderControl(n)}e.close("div")}},metadata:{properties:{schemaDefinition:{type:"any",defaultValue:null},initialData:{type:"any",defaultValue:null},initialDataJson:{type:"string",defaultValue:null},outputData:{type:"object",defaultValue:null},outputDataJson:{type:"string",defaultValue:null},useMessageManager:{type:"boolean",defaultValue:false}},aggregations:{_content:{type:"sap.ui.core.Control",multiple:false,visibility:"hidden"}},events:{beforeSubmit:{parameters:{payload:{type:"object"},addError:{type:"function"},preventDefault:{type:"function"}}},submit:{parameters:{payload:{type:"object"},payloadJson:{type:"string"}}},cancel:{}}},init:function t(){e.prototype.init.call(this)},exit:function e(){if(this.engine){this.engine.destroy();this.engine=null}if(this.stateManager){this.stateManager.getModel().destroy();this.stateManager=null}if(this.generatedContent){this.generatedContent.destroy();this.generatedContent=null}},onBeforeRendering:function e(){if(!this.generatedContent&&this.getProperty("schemaDefinition")){this.generate()}},triggerSubmit:function e(){if(this.stateManager&&this.engine){let e=false;const t=this.getProperty("useMessageManager");let n=null;if(t){n=sap.ui.getCore().getMessageManager();n.removeAllMessages()}const a=(e,a)=>{if(t&&n){sap.ui.require(["sap/ui/core/message/Message"],t=>{n.addMessages(new t({message:a,type:"Error",target:`${this.stateManager?.getModel().getId()}>/${e}`,processor:this.stateManager?.getModel()}))})}};if(!this.engine.validateAll()){a("","One or more fields failed schema validation. Please review the highlighted fields.");return false}const s=this.stateManager.extractPayload();const r=JSON.stringify(s);this.fireEvent("beforeSubmit",{payload:s,preventDefault:()=>{e=true},addError:(s,r)=>{e=true;if(t&&n){a(s,r)}else{i.warning(`[MetaUI] Validation Error for ${s}: ${r}`,"GeneratorHost")}}});if(e){return false}this.setProperty("outputData",s,true);this.setProperty("outputDataJson",r,true);this.fireEvent("submit",{payload:s,payloadJson:r});return true}return false},generate:function e(){try{const e=this.getProperty("schemaDefinition");let t=this.getProperty("initialData");const n=this.getProperty("initialDataJson");if(n){try{t=JSON.parse(n)}catch(e){i.error("[MetaUI] Failed to parse initialDataJson string.",e.message,"GeneratorHost")}}else if(typeof t==="string"){try{t=JSON.parse(t)}catch(e){i.error("[MetaUI] Failed to parse initialData string.",e.message,"GeneratorHost")}}const a=g.normalize(e,t);this.stateManager=new u(t||{});const s="metaUI_"+this.getId();this.setModel(this.stateManager.getModel(),s);this.engine=new c;const r=new d;this.generatedContent=this.engine.build(a,r,s);this.setAggregation("_content",this.generatedContent)}catch(e){i.error("[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.",e.message,"GeneratorHost");const t=new a({text:"UI Generation Failed",description:"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.",icon:"sap-icon://error"});this.setAggregation("_content",t)}},openInDialog:function e(a="Dynamic Form",i="Save"){if(!this.generatedContent){this.generate()}const s=new t({title:a,contentWidth:"800px",content:[this],beginButton:new n({text:i,type:"Emphasized",press:()=>{const e=this.triggerSubmit();if(e){s.close()}}}),endButton:new n({text:"Cancel",press:()=>{this.fireEvent("cancel");s.close()}}),afterClose:()=>{s.destroy()}});s.open()}});return p});
|
|
2
|
+
//# sourceMappingURL=GeneratorHost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratorHost.js","names":["SchemaNormalizer","___core_SchemaNormalizer","Engine","___core_Engine","StateManager","___core_StateManager","BaseLayout","___layouts_BaseLayout","GeneratorHost","Control","extend","constructor","prototype","apply","this","arguments","stateManager","generatedContent","engine","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","initialData","initialDataJson","outputData","outputDataJson","useMessageManager","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","init","_init","Control.prototype.init.call","exit","_exit","destroy","getModel","onBeforeRendering","_onBeforeRendering","getProperty","generate","triggerSubmit","_triggerSubmit","isPrevented","messageManager","sap","ui","getCore","getMessageManager","removeAllMessages","pushMessage","path","text","require","Message","addMessages","message","target","getId","processor","validateAll","extractPayload","JSON","stringify","fireEvent","propertyPath","errorMessage","Log","warning","setProperty","_generate","rawSchema","parse","e","error","normalizedSchema","normalize","modelName","setModel","layoutFactory","build","setAggregation","errorPage","MessagePage","description","icon","openInDialog","_openInDialog","title","submitButtonText","dialog","Dialog","contentWidth","beginButton","Button","press","success","endButton","afterClose","open"],"sources":["GeneratorHost.ts"],"sourcesContent":["/**\n * @file GeneratorHost.ts\n * @description The core UI5 custom control that exposes the MetaUI engine to host applications.\n */\n\nimport Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport Dialog from \"sap/m/Dialog\";\nimport Button from \"sap/m/Button\";\nimport MessagePage from \"sap/m/MessagePage\";\nimport Log from \"sap/base/Log\";\nimport { SchemaNormalizer } from \"../core/SchemaNormalizer\";\nimport { Engine } from \"../core/Engine\";\nimport { StateManager } from \"../core/StateManager\";\nimport { BaseLayout } from \"../layouts/BaseLayout\";\n\n/**\n * Wrapper element for embedding or popping the dynamic form.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls\n */\nexport default class GeneratorHost extends Control {\n \n private stateManager: StateManager | null = null;\n private generatedContent: Control | null = null;\n private engine: Engine | null = null;\n\n static readonly metadata = {\n properties: {\n /** The raw JSON metadata schema provided by the ABAP backend. */\n schemaDefinition: { type: \"any\", defaultValue: null },\n /** The initial data payload to populate the fields as an object. */\n initialData: { type: \"any\", defaultValue: null },\n /** The initial data payload provided as a raw JSON string. */\n initialDataJson: { type: \"string\", defaultValue: null },\n /** The final payload data object, updated on submit. */\n outputData: { type: \"object\", defaultValue: null },\n /** The final payload JSON string, updated on submit. */\n outputDataJson: { type: \"string\", defaultValue: null },\n /** If true, validation errors will be pushed to the global sap.ui.core.message.MessageManager. */\n useMessageManager: { type: \"boolean\", defaultValue: false }\n },\n aggregations: {\n /** The internal hidden container holding the generated layouts. */\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n /** Triggered before final submission, allowing host apps to run custom validation logic and halt submission if needed. */\n beforeSubmit: {\n parameters: {\n /** The clean extracted JSON payload representing the current state. */\n payload: { type: \"object\" },\n /** Function to add a custom validation error message for a specific field path. */\n addError: { type: \"function\" },\n /** Function to prevent the default submission and dialog closure. */\n preventDefault: { type: \"function\" }\n }\n },\n /** Triggered when the user submits the form via the Dialog modality. */\n submit: {\n parameters: {\n /** The clean extracted JSON payload representing the current state. */\n payload: { type: \"object\" },\n /** The stringified final JSON payload. */\n payloadJson: { type: \"string\" }\n }\n },\n /** Triggered if the dialog is cancelled. */\n cancel: {}\n }\n };\n\n /**\n * Standard UI5 control renderer. Renders the generated internal content.\n */\n static renderer = {\n apiVersion: 2,\n render(rm: RenderManager, control: GeneratorHost) {\n rm.openStart(\"div\", control);\n rm.style(\"width\", \"100%\");\n rm.style(\"height\", \"100%\");\n rm.openEnd();\n \n const content = control.getAggregation(\"_content\") as Control;\n if (content) {\n rm.renderControl(content);\n }\n \n rm.close(\"div\");\n }\n };\n\n /**\n * Initializes the UI5 control.\n */\n public init(): void {\n super.init();\n }\n\n /**\n * Standard UI5 lifecycle hook for destruction.\n * Guaranteed to tear down isolated models and unbind global event listeners.\n */\n public exit(): void {\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n if (this.generatedContent) {\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /**\n * Lifecycle hook to automatically generate the layout if bound declaratively in XML.\n */\n public onBeforeRendering(): void {\n if (!this.generatedContent && this.getProperty(\"schemaDefinition\")) {\n this.generate();\n }\n }\n\n /**\n * Extracts the payload, pushes it to properties, and fires the submit event manually.\n * Returns true if submission was successful, false if validation failed or was prevented.\n */\n public triggerSubmit(): boolean {\n if (this.stateManager && this.engine) {\n let isPrevented = false;\n const useMessageManager = this.getProperty(\"useMessageManager\") as boolean;\n let messageManager: any = null;\n \n if (useMessageManager) {\n messageManager = sap.ui.getCore().getMessageManager();\n messageManager.removeAllMessages();\n }\n\n // Helper to add messages securely via async require so it isn't a hard dependency\n const pushMessage = (path: string, text: string) => {\n if (useMessageManager && messageManager) {\n sap.ui.require([\"sap/ui/core/message/Message\"], (Message: any) => {\n messageManager.addMessages(new Message({\n message: text,\n type: \"Error\" as any,\n target: `${this.stateManager?.getModel().getId()}>/${path}`,\n processor: this.stateManager?.getModel()\n }));\n });\n }\n };\n\n // 1. Run global schema validation\n if (!this.engine.validateAll()) {\n pushMessage(\"\", \"One or more fields failed schema validation. Please review the highlighted fields.\");\n return false; // Schema validation failed, inputs already turned red\n }\n\n const payload = this.stateManager.extractPayload();\n const payloadJson = JSON.stringify(payload);\n \n // 2. Fire beforeSubmit exit\n this.fireEvent(\"beforeSubmit\", {\n payload,\n preventDefault: () => {\n isPrevented = true;\n },\n addError: (propertyPath: string, errorMessage: string) => {\n isPrevented = true;\n if (useMessageManager && messageManager) {\n pushMessage(propertyPath, errorMessage);\n } else {\n Log.warning(`[MetaUI] Validation Error for ${propertyPath}: ${errorMessage}`, \"GeneratorHost\");\n }\n }\n });\n\n if (isPrevented) {\n return false; // Exit validation failed or prevented submission\n }\n \n // Push final values to properties (updating XML bindings)\n this.setProperty(\"outputData\", payload, true);\n this.setProperty(\"outputDataJson\", payloadJson, true);\n \n this.fireEvent(\"submit\", { payload, payloadJson });\n return true;\n }\n return false;\n }\n\n /**\n * Triggers the engine to parse the schema and build the layout.\n * Safely wrapped in a try/catch to prevent Launchpad crashes.\n */\n public generate(): void {\n try {\n const rawSchema = this.getProperty(\"schemaDefinition\");\n \n let initialData = this.getProperty(\"initialData\");\n const initialDataJson = this.getProperty(\"initialDataJson\");\n \n if (initialDataJson) {\n try {\n initialData = JSON.parse(initialDataJson);\n } catch (e) {\n Log.error(\"[MetaUI] Failed to parse initialDataJson string.\", (e as Error).message, \"GeneratorHost\");\n }\n } else if (typeof initialData === \"string\") {\n try {\n initialData = JSON.parse(initialData);\n } catch (e) {\n Log.error(\"[MetaUI] Failed to parse initialData string.\", (e as Error).message, \"GeneratorHost\");\n }\n }\n\n // 1. Normalize schema (allows fallback to data inference)\n const normalizedSchema = SchemaNormalizer.normalize(rawSchema, initialData);\n\n // 2. Bootstrap isolated State Manager\n this.stateManager = new StateManager(initialData || {});\n \n // Dynamically generate a 100% unique model name for isolation\n const modelName = \"metaUI_\" + this.getId();\n this.setModel(this.stateManager.getModel(), modelName);\n\n // 3. Delegate to Layout Engine\n this.engine = new Engine();\n const layoutFactory = new BaseLayout();\n \n this.generatedContent = this.engine.build(normalizedSchema, layoutFactory, modelName);\n\n // 4. Mount into hidden aggregation\n this.setAggregation(\"_content\", this.generatedContent);\n\n } catch (error) {\n Log.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", (error as Error).message, \"GeneratorHost\");\n \n const errorPage = new MessagePage({\n text: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\",\n icon: \"sap-icon://error\"\n });\n\n this.setAggregation(\"_content\", errorPage);\n }\n }\n\n /**\n * Dialog Modality: Opens the generated layout inside a sap.m.Dialog.\n * Automatically wires up 'Save' and 'Cancel' buttons.\n */\n public openInDialog(title: string = \"Dynamic Form\", submitButtonText: string = \"Save\"): void {\n if (!this.generatedContent) {\n this.generate();\n }\n\n const dialog = new Dialog({\n title: title,\n contentWidth: \"800px\",\n content: [this], // Mount self inside the dialog\n beginButton: new Button({\n text: submitButtonText,\n type: \"Emphasized\",\n press: () => {\n const success = this.triggerSubmit();\n if (success) {\n dialog.close();\n }\n }\n }),\n endButton: new Button({\n text: \"Cancel\",\n press: () => {\n this.fireEvent(\"cancel\");\n dialog.close();\n }\n }),\n afterClose: () => {\n dialog.destroy();\n }\n });\n\n dialog.open();\n }\n}\n"],"mappings":"iPAWSA,EAAgBC,EAAA,0BAChBC,EAAMC,EAAA,gBACNC,EAAYC,EAAA,sBACZC,EAAUC,EAAA,cAEnB,MAKqBC,EAAsBC,EAAOC,OAAA,qDAAAC,YAAA,SAAAA,IAAAF,EAAAG,UAAAD,YAAAE,MAAAC,KAAAC,WAAAD,KAEtCE,aAAoC,KAAIF,KACxCG,iBAAmC,KAAIH,KACvCI,OAAwB,IAAI,EAkD7BC,SAAW,CACdC,WAAY,EACZC,OAAOC,EAAmBC,GACtBD,EAAGE,UAAU,MAAOD,GACpBD,EAAGG,MAAM,QAAS,QAClBH,EAAGG,MAAM,SAAU,QACnBH,EAAGI,UAEH,MAAMC,EAAUJ,EAAQK,eAAe,YACvC,GAAID,EAAS,CACTL,EAAGO,cAAcF,EACrB,CAEAL,EAAGQ,MAAM,MACb,GA9DYC,SAAW,CACvBC,WAAY,CAERC,iBAAkB,CAAEC,KAAM,MAAOC,aAAc,MAE/CC,YAAa,CAAEF,KAAM,MAAOC,aAAc,MAE1CE,gBAAiB,CAAEH,KAAM,SAAUC,aAAc,MAEjDG,WAAY,CAAEJ,KAAM,SAAUC,aAAc,MAE5CI,eAAgB,CAAEL,KAAM,SAAUC,aAAc,MAEhDK,kBAAmB,CAAEN,KAAM,UAAWC,aAAc,QAExDM,aAAc,CAEVC,SAAU,CAAER,KAAM,sBAAuBS,SAAU,MAAO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