@siliconst/metaui 1.4.37 → 1.4.51

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 (62) hide show
  1. package/package.json +1 -1
  2. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +24 -0
  3. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js.map +1 -1
  4. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts +24 -0
  5. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
  6. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
  7. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
  8. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +15 -1
  9. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +34 -0
  10. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js.map +1 -1
  11. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts +34 -0
  12. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts.map +1 -1
  13. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
  14. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
  15. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +25 -1
  16. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +31 -1
  17. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
  18. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +2 -0
  19. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
  20. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +1 -1
  21. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
  22. package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +38 -0
  23. package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine-dbg.js +15 -96
  24. package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine-dbg.js.map +1 -1
  25. package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.d.ts +1 -6
  26. package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.d.ts.map +1 -1
  27. package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.js +1 -1
  28. package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.js.map +1 -1
  29. package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.ts +20 -100
  30. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -1
  31. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -1
  32. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +1 -1
  33. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -1
  34. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +1 -0
  35. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -1
  36. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +1 -0
  37. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
  38. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +2 -1
  39. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
  40. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +2 -1
  41. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout-dbg.js +327 -67
  42. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout-dbg.js.map +1 -1
  43. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.d.ts +57 -15
  44. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.d.ts.map +1 -1
  45. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.js +1 -1
  46. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.js.map +1 -1
  47. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.ts +375 -65
  48. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +7 -7
  49. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  50. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +10 -15
  51. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
  52. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts +4 -0
  53. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
  54. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
  55. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
  56. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +10 -15
  57. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js +11 -1
  58. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js.map +1 -1
  59. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.d.ts.map +1 -1
  60. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js +1 -1
  61. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js.map +1 -1
  62. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.ts +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siliconst/metaui",
3
- "version": "1.4.37",
3
+ "version": "1.4.51",
4
4
  "description": "Dynamic Metadata UI5 Engine",
5
5
  "author": "SiliconStreetDev1",
6
6
  "license": "MIT",
@@ -194,6 +194,30 @@ sap.ui.define(["sap/ui/core/Control", "./host/GeneratorHost", "../utils/Logger",
194
194
  type: "object"
195
195
  }
196
196
  }
197
+ },
198
+ /**
199
+ * Forwarded transparently from the inner GeneratorHost via the event proxy loop.
200
+ * Fired by WizardLayout when the user navigates to a new Wizard step.
201
+ * See GeneratorHost.metadata for full parameter documentation.
202
+ */
203
+ beforeLayoutSectionChange: {
204
+ parameters: {
205
+ stepIndex: {
206
+ type: "int"
207
+ },
208
+ payload: {
209
+ type: "object"
210
+ },
211
+ preventDefault: {
212
+ type: "function"
213
+ },
214
+ addError: {
215
+ type: "function"
216
+ },
217
+ resumeNavigation: {
218
+ type: "function"
219
+ }
220
+ }
197
221
  }
198
222
  }
199
223
  },
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicHost-dbg.js","names":["GeneratorHost","_interopRequireDefault","__GeneratorHost","Logger","___utils_Logger","ODataDelegate","___host_delegates_ODataDelegate","SchemaBuilderRegistry","___core_SchemaBuilderRegistry","SchemaProvider","___services_SchemaProvider","AIConfig","___ai_AIConfig","DynamicHost","Control","extend","constructor","prototype","apply","arguments","odataDelegate","_innerHost","_initializedInner","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","schemaDefinitions","schemaTarget","pluginRegistry","schemaBuilderRegistry","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","layoutBudget","inferenceStrategy","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","initODataDelegate","_initODataDelegate","getBindingInfo","dataBinding","path","oContext","getBindingContext","debug","getPath","requestObject","syncToEngine","Object","keys","setBindingContext","_setBindingContext","sModelName","Control.prototype.setBindingContext.call","bindElement","_bindElement","vPath","mParameters","Control.prototype.bindElement.call","model","undefined","oBinding","getElementBinding","attachChange","onBeforeRendering","_onBeforeRendering","schemaRaw","getProperty","startsWith","self","_fetchingSchema","BusyIndicator","show","resolve","then","json","plugin","getBuilderFor","finalSchema","build","Control.prototype.setProperty.call","definitions","hide","invalidate","catch","err","MessageToast","schema","trim","JSON","parse","e","hasSchema","length","hasData","rawDataObj","msg","MessageBox","title","proxy","getProxy","generateSchema","generatedSchema","warn","props","getMetadata","getProperties","propName","val","Control.prototype.getProperty.call","setProperty","setAggregation","getEvents","eventName","attachEvent","oEvent","params","getParameters","isLive","str","stringify","fireEvent","_setProperty","propertyName","suppressInvalidate","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","triggerSubmit","_triggerSubmit","addCustomError","_addCustomError","inner","clearCustomError","_clearCustomError","_getProperty"],"sources":["DynamicHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport GeneratorHost from \"./host/GeneratorHost\";\nimport { Logger } from \"../utils/Logger\";\nimport { ODataDelegate } from \"./host/delegates/ODataDelegate\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport { SchemaBuilderRegistry } from \"../core/SchemaBuilderRegistry\";\nimport BusyIndicator from \"sap/ui/core/BusyIndicator\";\nimport MessageToast from \"sap/m/MessageToast\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport { SchemaProvider } from \"../services/SchemaProvider\";\nimport { AIConfig } from \"../ai/AIConfig\";\n\n/**\n * A transparent wrapper control (Facade) that automatically chooses between Explicit Schema Mode \n * and Inference Mode based on the presence of a 'schemaDefinition'.\n * \n * This maintains total architectural separation of the modes without forcing developers to \n * use different XML tags.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls\n */\nexport default class DynamicHost extends Control {\n private odataDelegate: ODataDelegate | null = null;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n schemaDefinitions: { type: \"object\", defaultValue: null },\n schemaTarget: { type: \"string\", defaultValue: null },\n pluginRegistry: { type: \"object\", defaultValue: null },\n schemaBuilderRegistry: { type: \"object\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true },\n layoutBudget: { type: \"int\", defaultValue: 0 },\n inferenceStrategy: { type: \"string\", defaultValue: \"RuleBased\" }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } },\n error: { parameters: { message: { type: \"string\" }, exception: { type: \"object\" } } }\n }\n };\n\n static renderer = {\n apiVersion: 2,\n render(rm: RenderManager, control: DynamicHost) {\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 * Internal reference to the generated inner host instance.\n * @private\n */\n private _innerHost: GeneratorHost | null = null;\n\n /**\n * Flag indicating if the inner host has been initialized.\n * @private\n */\n private _initializedInner: boolean = false;\n\n /**\n * Initializes the OData Delegate if an OData context is detected.\n * This allows DynamicHost to seamlessly synchronize metadata and properties from an OData model.\n * @private\n */\n private initODataDelegate(): void {\n if (!this.odataDelegate) {\n // Guard: If the user explicitly bound dataJson, do not steal the context.\n if (this.getBindingInfo(\"dataJson\")) {\n return;\n }\n\n // Guard: If the user explicitly bound 'data' to a specific property path, do not steal the context.\n const dataBinding = this.getBindingInfo(\"data\") as Record<string, unknown> | undefined;\n if (dataBinding && dataBinding.path && dataBinding.path !== \"\") {\n return;\n }\n\n const oContext = this.getBindingContext(\"odata\") || this.getBindingContext();\n if (oContext) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context found for delegate initialization: ${oContext.getPath()}`, \"DynamicHost\");\n if (oContext && (oContext as ODataV4Context).requestObject && typeof (oContext as ODataV4Context).requestObject === \"function\") {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context supports requestObject/getObject. Instantiating ODataDelegate.`, \"DynamicHost\");\n this.odataDelegate = new ODataDelegate(this, oContext as ODataV4Context);\n this.odataDelegate.syncToEngine();\n } else {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context does NOT support requestObject/getObject! Keys: ${Object.keys(oContext)}`, \"DynamicHost\");\n }\n }\n }\n }\n\n /**\n * Standard UI5 method override.\n * Sets the binding context for the control and attempts to initialize the OData delegate\n * if the context points to an OData model.\n * \n * @param {sap.ui.model.Context | null | undefined} oContext The binding context object\n * @param {string} [sModelName] Optional model name\n * @returns {this} The control instance for chaining\n */\n public setBindingContext(oContext: unknown, sModelName?: string): this {\n super.setBindingContext(oContext as sap.ui.model.Context, sModelName);\n this.initODataDelegate();\n return this;\n }\n\n /**\n * Standard UI5 method override.\n * Binds the element to the given path and attaches a change listener to re-evaluate\n * the OData delegate when the element binding resolves.\n * \n * @param {string | Record<string, unknown>} vPath The binding path or configuration object\n * @param {object} [mParameters] Optional mapping parameters\n * @returns {this} Reference to this instance for chaining\n */\n public bindElement(vPath: unknown, mParameters?: object): this {\n super.bindElement(vPath as string | { path: string }, mParameters);\n const sModelName = typeof vPath === \"object\" ? vPath.model : undefined;\n const oBinding = this.getElementBinding(sModelName);\n if (oBinding) {\n oBinding.attachChange(() => {\n this.initODataDelegate();\n });\n }\n return this;\n }\n\n /**\n * Standard UI5 Lifecycle Hook.\n * Evaluates the initial properties and spawns the GeneratorHost.\n * It handles the complex lifecycle task of copying all bindings, raw properties, and event listeners \n * down to the inner host perfectly transparently.\n */\n public onBeforeRendering(): void {\n Logger.debug(\"[MetaUI DynamicHost]\", `onBeforeRendering called. _initializedInner: ${this._initializedInner}`, \"DynamicHost\");\n\n this.initODataDelegate();\n\n if (!this._initializedInner) {\n let schemaRaw = this.getProperty(\"schemaDefinition\");\n\n if (typeof schemaRaw === \"string\" && (schemaRaw.startsWith(\"http://\") || schemaRaw.startsWith(\"https://\"))) {\n const self = this as unknown as { _fetchingSchema?: boolean };\n if (self._fetchingSchema) return; // Prevent re-entry\n self._fetchingSchema = true;\n \n BusyIndicator.show(0);\n SchemaProvider.resolve(schemaRaw)\n .then(json => {\n const plugin = SchemaBuilderRegistry.getBuilderFor(json);\n const finalSchema = plugin ? plugin.build(json, this.getProperty(\"schemaTarget\") as string | undefined) : json;\n super.setProperty(\"schemaDefinition\", finalSchema, true);\n if (finalSchema.definitions) {\n super.setProperty(\"schemaDefinitions\", finalSchema.definitions, true);\n }\n const self = this as unknown as { _fetchingSchema?: boolean };\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); // Force re-render with resolved schema\n })\n .catch(err => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n MessageToast.show(\"Failed to fetch remote schema\");\n super.setProperty(\"schemaDefinition\", null, true); // Fallback to full inference\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate();\n });\n return; // Abort this render cycle until fetch completes\n }\n\n // 2. Local Plugin Detection (Stringified JSON or Raw Object)\n let schema = schemaRaw;\n if (schema && typeof schema === \"string\" && (schema as string).trim().startsWith(\"{\")) {\n try {\n schema = JSON.parse(schema);\n } catch (e) {\n // Ignore, let standard validation catch it\n }\n }\n\n if (schema && typeof schema === \"object\") {\n const plugin = SchemaBuilderRegistry.getBuilderFor(schema);\n if (plugin) {\n schema = plugin.build(schema, this.getProperty(\"schemaTarget\") as string | undefined);\n // Silently update the wrapper property so the inner host gets the final parsed MetaUI format\n super.setProperty(\"schemaDefinition\", schema, true);\n if ((schema as Record<string, unknown>).definitions) {\n super.setProperty(\"schemaDefinitions\", (schema as Record<string, unknown>).definitions, true);\n }\n }\n }\n\n const dataJson = this.getProperty(\"dataJson\");\n const data = this.getProperty(\"data\");\n\n let hasSchema = !!schema;\n if (hasSchema && typeof schema === \"object\" && Object.keys(schema as Record<string, unknown>).length === 0) {\n hasSchema = false; // Treat empty object as no schema\n }\n\n const hasData = !!dataJson || !!data;\n\n // 3. AI Schema Inference Detection\n if (hasData && this.getProperty(\"inferenceStrategy\") === \"AI\") {\n const self = this as unknown as { _fetchingSchema?: boolean };\n if (self._fetchingSchema) return; // Prevent re-entry\n self._fetchingSchema = true;\n\n let rawDataObj = data;\n if (!rawDataObj && dataJson) {\n try { rawDataObj = JSON.parse(dataJson as string); } catch(e: unknown) { \n const msg = \"Ignored invalid dataJson parse: \" + (e as Error).message;\n Logger.error(\"[DynamicHost]\", msg, \"DynamicHost\"); \n MessageBox.error(msg, { title: \"Invalid JSON Data\" });\n }\n }\n\n if (rawDataObj) {\n BusyIndicator.show(0);\n const proxy = AIConfig.getProxy();\n \n proxy.generateSchema(rawDataObj, schema || undefined)\n .then((generatedSchema: unknown) => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n super.setProperty(\"schemaDefinition\", generatedSchema, true);\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); // Force re-render with the new schema\n })\n .catch((err: Error) => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n Logger.warn(\"[MetaUI DynamicHost]\", \"AI inference failed, falling back to RuleBased. Error: \" + err.message, \"DynamicHost\");\n MessageToast.show(\"AI Inference failed, using fallback.\");\n super.setProperty(\"inferenceStrategy\", \"RuleBased\", true); // Fallback to normal inference\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); \n });\n return; // Abort render cycle until AI is done\n }\n }\n\n Logger.debug(\"[MetaUI DynamicHost]\", `Evaluating boot. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n\n // Only boot if we have either a schema or some data to infer from\n if (hasSchema || hasData) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Booting inner host. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n }\n // The architectural Facade router logic:\n // We've simplified this! We no longer use HostFactory or separate subclasses.\n // GeneratorHost is fully capable of inferring the schema if none is provided.\n this._innerHost = new GeneratorHost();\n\n // 1. Forward all static values to the spawned host BEFORE mounting.\n // Since we no longer use bindProperty, it's perfectly safe to set raw properties before mounting.\n const props = this.getMetadata().getProperties();\n for (const propName in props) {\n if (propName === \"inferenceStrategy\") continue;\n const val = super.getProperty(propName);\n if (val !== null && val !== undefined) {\n if (propName === \"schemaDefinitions\") {\n Logger.debug(`[MetaUI DynamicHost] Proxying schemaDefinitions: ${Object.keys(val)}`, \"\", \"DynamicHost\");\n }\n this._innerHost.setProperty(propName, val);\n } else if (propName === \"schemaDefinitions\") {\n Logger.warn(`[MetaUI DynamicHost] Warning: schemaDefinitions is null/undefined in Wrapper. Defaulting to empty object in GeneratorHost.`, \"\", \"DynamicHost\");\n }\n }\n\n // 2. Mount so it inherits models and triggers lifecycle.\n this.setAggregation(\"_content\", this._innerHost);\n\n // 3. Forward all event subscriptions.\n // By proxying the events upwards, the developer can subscribe to `<meta:DynamicHost submit=\"...\">` \n // and perfectly receive the inner host's submission event.\n const events = this.getMetadata().getEvents();\n for (const eventName in events) {\n this._innerHost.attachEvent(eventName, (oEvent: sap.ui.base.Event) => {\n // Natively push updated payload out to any bound Fiori Element properties.\n // Using super.setProperty prevents an infinite loop back down to _innerHost.\n if (eventName === \"submit\" || eventName === \"fieldChange\") {\n const params = oEvent.getParameters();\n if (params.payload) {\n const isLive = this.getProperty(\"liveUpdate\") === true;\n if (eventName === \"submit\" || isLive) {\n super.setProperty(\"data\", params.payload, true);\n\n const str = params.payloadJson || JSON.stringify(params.payload, null, 2);\n super.setProperty(\"dataJson\", str, true);\n }\n }\n }\n this.fireEvent(eventName, oEvent.getParameters());\n });\n }\n\n this._initializedInner = true;\n }\n }\n }\n\n /**\n * Overrides standard UI5 setProperty to act as a transparent proxy.\n * When a property is updated on the wrapper (either programmatically or via a binding update),\n * it instantly mirrors that value down to the inner instantiated host.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaDefinitions\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Wrapper received setProperty: ${propertyName}`, \"DynamicHost\");\n }\n }\n super.setProperty(propertyName, value, suppressInvalidate);\n if (this._innerHost && propertyName !== \"inferenceStrategy\") {\n this._innerHost.setProperty(propertyName, value, suppressInvalidate);\n } else if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaDefinitions\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `_innerHost not yet initialized when ${propertyName} was set. Booting will happen on next render.`, \"DynamicHost\");\n }\n }\n return this;\n }\n\n\n\n\n\n /**\n * Programmatic API support. Routes dialog commands down to the spawned inner host.\n * If the inner host has not booted yet, it forces initialization immediately.\n * \n * @param {string} [title=\"Form\"] The title of the dialog\n * @param {string} [submitButtonText=\"OK\"] The text for the primary action button\n * @param {string} [cancelButtonText=\"Cancel\"] The text for the cancel button\n * @param {string} [dialogWidth=\"auto\"] The width of the dialog\n * @param {sap.ui.core.Control} [parentView] The parent view to attach the dialog to for model inheritance.\n */\n public openInDialog(title?: string, submitButtonText?: string, cancelButtonText?: string, dialogWidth?: string, parentView?: Control): void {\n if (!this._innerHost) {\n this.onBeforeRendering(); // Force init if they bypassed UI5 rendering\n }\n this._innerHost?.openInDialog(title, submitButtonText, cancelButtonText, dialogWidth, parentView);\n }\n\n /**\n * Proxies submission triggering down to the instantiated generator host.\n * Evaluates the internal Engine validation suite and returns true if structurally sound.\n * \n * @returns {boolean} True if the internal payload passes schema validation, false otherwise.\n */\n public triggerSubmit(): boolean {\n if (!this._innerHost) {\n return false;\n }\n return this._innerHost.triggerSubmit();\n }\n\n /**\n * Injects a custom error message onto a specific field.\n * Useful for injecting custom backend validation errors.\n * \n * @param {string} fieldPath The schema key path to target.\n * @param {string} message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n const inner = this._innerHost as unknown as { addCustomError?: (p: string, m: string) => void };\n if (inner && typeof inner.addCustomError === \"function\") {\n inner.addCustomError(fieldPath, message);\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n * \n * @param {string} fieldPath The schema key path to target.\n */\n public clearCustomError(fieldPath: string): void {\n const inner = this._innerHost as unknown as { clearCustomError?: (p: string) => void };\n if (inner && typeof inner.clearCustomError === \"function\") {\n inner.clearCustomError(fieldPath);\n }\n }\n\n /**\n * Overrides standard UI5 getProperty to transparently pull extracted data from the inner host.\n * Ensures that querying the DynamicHost facade for `data` always yields the freshest payload.\n * \n * @param {string} propertyName The name of the property to retrieve\n * @returns {unknown} The property value\n */\n public getProperty(propertyName: string): unknown {\n if (propertyName === \"outputData\") {\n propertyName = \"data\"; // Forward deprecated outputData to data\n }\n if (this._innerHost && (propertyName === \"data\" || propertyName === \"dataJson\")) {\n return this._innerHost.getProperty(propertyName);\n }\n return super.getProperty(propertyName);\n }\n}\n"],"mappings":";;;;;;QAEOA,aAAa,GAAAC,sBAAA,CAAAC,eAAA;EAAA,MACXC,MAAM,GAAAC,eAAA;EAAA,MACNC,aAAa,GAAAC,+BAAA;EAAA,MAEbC,qBAAqB,GAAAC,6BAAA;EAAA,MAIrBC,cA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AK,IAAI,OAAOA,KAAK,CAACC,gBAAgB,KAAK,UAAU,EAAE;QACvDD,KAAK,CAACC,gBAAgB,CAAC3G,SAAS,CAAC;MACrC;IACJ,CAAC;IAED;AACJ;AACA;AACA;AACA;AACA;AACA;IACWsC,WAAW,WAAAuE,aAACf,YAAoB,EAAW;MAC9C,IAAIA,YAAY,KAAK,YAAY,EAAE;QAC/BA,YAAY,GAAG,MAAM,CAAC,CAAC;MAC3B;MACA,IAAI,IAAI,CAAC9I,UAAU,KAAK8I,YAAY,KAAK,MAAM,IAAIA,YAAY,KAAK,UAAU,CAAC,EAAE;QAC7E,OAAO,IAAI,CAAC9I,UAAU,CAACsF,WAAW,CAACwD,YAAY,CAAC;MACpD;MACA,OAAAd,kCAAA,OAAyBc,YAAY;IACzC;EAAC;EAAA,OAxagBtJ,WAAW;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"DynamicHost-dbg.js","names":["GeneratorHost","_interopRequireDefault","__GeneratorHost","Logger","___utils_Logger","ODataDelegate","___host_delegates_ODataDelegate","SchemaBuilderRegistry","___core_SchemaBuilderRegistry","SchemaProvider","___services_SchemaProvider","AIConfig","___ai_AIConfig","DynamicHost","Control","extend","constructor","prototype","apply","arguments","odataDelegate","_innerHost","_initializedInner","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","schemaDefinitions","schemaTarget","pluginRegistry","schemaBuilderRegistry","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","layoutBudget","inferenceStrategy","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","beforeLayoutSectionChange","stepIndex","resumeNavigation","initODataDelegate","_initODataDelegate","getBindingInfo","dataBinding","path","oContext","getBindingContext","debug","getPath","requestObject","syncToEngine","Object","keys","setBindingContext","_setBindingContext","sModelName","Control.prototype.setBindingContext.call","bindElement","_bindElement","vPath","mParameters","Control.prototype.bindElement.call","model","undefined","oBinding","getElementBinding","attachChange","onBeforeRendering","_onBeforeRendering","schemaRaw","getProperty","startsWith","self","_fetchingSchema","BusyIndicator","show","resolve","then","json","plugin","getBuilderFor","finalSchema","build","Control.prototype.setProperty.call","definitions","hide","invalidate","catch","err","MessageToast","schema","trim","JSON","parse","e","hasSchema","length","hasData","rawDataObj","msg","MessageBox","title","proxy","getProxy","generateSchema","generatedSchema","warn","props","getMetadata","getProperties","propName","val","Control.prototype.getProperty.call","setProperty","setAggregation","getEvents","eventName","attachEvent","oEvent","params","getParameters","isLive","str","stringify","fireEvent","_setProperty","propertyName","suppressInvalidate","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","triggerSubmit","_triggerSubmit","addCustomError","_addCustomError","inner","clearCustomError","_clearCustomError","_getProperty"],"sources":["DynamicHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport GeneratorHost from \"./host/GeneratorHost\";\nimport { Logger } from \"../utils/Logger\";\nimport { ODataDelegate } from \"./host/delegates/ODataDelegate\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport { SchemaBuilderRegistry } from \"../core/SchemaBuilderRegistry\";\nimport BusyIndicator from \"sap/ui/core/BusyIndicator\";\nimport MessageToast from \"sap/m/MessageToast\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport { SchemaProvider } from \"../services/SchemaProvider\";\nimport { AIConfig } from \"../ai/AIConfig\";\n\n/**\n * A transparent wrapper control (Facade) that automatically chooses between Explicit Schema Mode \n * and Inference Mode based on the presence of a 'schemaDefinition'.\n * \n * This maintains total architectural separation of the modes without forcing developers to \n * use different XML tags.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls\n */\nexport default class DynamicHost extends Control {\n private odataDelegate: ODataDelegate | null = null;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n schemaDefinitions: { type: \"object\", defaultValue: null },\n schemaTarget: { type: \"string\", defaultValue: null },\n pluginRegistry: { type: \"object\", defaultValue: null },\n schemaBuilderRegistry: { type: \"object\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true },\n layoutBudget: { type: \"int\", defaultValue: 0 },\n inferenceStrategy: { type: \"string\", defaultValue: \"RuleBased\" }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } },\n error: { parameters: { message: { type: \"string\" }, exception: { type: \"object\" } } },\n /**\n * Forwarded transparently from the inner GeneratorHost via the event proxy loop.\n * Fired by WizardLayout when the user navigates to a new Wizard step.\n * See GeneratorHost.metadata for full parameter documentation.\n */\n beforeLayoutSectionChange: {\n parameters: {\n stepIndex: { type: \"int\" },\n payload: { type: \"object\" },\n preventDefault: { type: \"function\" },\n addError: { type: \"function\" },\n resumeNavigation: { type: \"function\" }\n }\n }\n }\n };\n\n static renderer = {\n apiVersion: 2,\n render(rm: RenderManager, control: DynamicHost) {\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 * Internal reference to the generated inner host instance.\n * @private\n */\n private _innerHost: GeneratorHost | null = null;\n\n /**\n * Flag indicating if the inner host has been initialized.\n * @private\n */\n private _initializedInner: boolean = false;\n\n /**\n * Initializes the OData Delegate if an OData context is detected.\n * This allows DynamicHost to seamlessly synchronize metadata and properties from an OData model.\n * @private\n */\n private initODataDelegate(): void {\n if (!this.odataDelegate) {\n // Guard: If the user explicitly bound dataJson, do not steal the context.\n if (this.getBindingInfo(\"dataJson\")) {\n return;\n }\n\n // Guard: If the user explicitly bound 'data' to a specific property path, do not steal the context.\n const dataBinding = this.getBindingInfo(\"data\") as Record<string, unknown> | undefined;\n if (dataBinding && dataBinding.path && dataBinding.path !== \"\") {\n return;\n }\n\n const oContext = this.getBindingContext(\"odata\") || this.getBindingContext();\n if (oContext) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context found for delegate initialization: ${oContext.getPath()}`, \"DynamicHost\");\n if (oContext && (oContext as ODataV4Context).requestObject && typeof (oContext as ODataV4Context).requestObject === \"function\") {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context supports requestObject/getObject. Instantiating ODataDelegate.`, \"DynamicHost\");\n this.odataDelegate = new ODataDelegate(this, oContext as ODataV4Context);\n this.odataDelegate.syncToEngine();\n } else {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context does NOT support requestObject/getObject! Keys: ${Object.keys(oContext)}`, \"DynamicHost\");\n }\n }\n }\n }\n\n /**\n * Standard UI5 method override.\n * Sets the binding context for the control and attempts to initialize the OData delegate\n * if the context points to an OData model.\n * \n * @param {sap.ui.model.Context | null | undefined} oContext The binding context object\n * @param {string} [sModelName] Optional model name\n * @returns {this} The control instance for chaining\n */\n public setBindingContext(oContext: unknown, sModelName?: string): this {\n super.setBindingContext(oContext as sap.ui.model.Context, sModelName);\n this.initODataDelegate();\n return this;\n }\n\n /**\n * Standard UI5 method override.\n * Binds the element to the given path and attaches a change listener to re-evaluate\n * the OData delegate when the element binding resolves.\n * \n * @param {string | Record<string, unknown>} vPath The binding path or configuration object\n * @param {object} [mParameters] Optional mapping parameters\n * @returns {this} Reference to this instance for chaining\n */\n public bindElement(vPath: unknown, mParameters?: object): this {\n super.bindElement(vPath as string | { path: string }, mParameters);\n const sModelName = typeof vPath === \"object\" ? vPath.model : undefined;\n const oBinding = this.getElementBinding(sModelName);\n if (oBinding) {\n oBinding.attachChange(() => {\n this.initODataDelegate();\n });\n }\n return this;\n }\n\n /**\n * Standard UI5 Lifecycle Hook.\n * Evaluates the initial properties and spawns the GeneratorHost.\n * It handles the complex lifecycle task of copying all bindings, raw properties, and event listeners \n * down to the inner host perfectly transparently.\n */\n public onBeforeRendering(): void {\n Logger.debug(\"[MetaUI DynamicHost]\", `onBeforeRendering called. _initializedInner: ${this._initializedInner}`, \"DynamicHost\");\n\n this.initODataDelegate();\n\n if (!this._initializedInner) {\n let schemaRaw = this.getProperty(\"schemaDefinition\");\n\n if (typeof schemaRaw === \"string\" && (schemaRaw.startsWith(\"http://\") || schemaRaw.startsWith(\"https://\"))) {\n const self = this as unknown as { _fetchingSchema?: boolean };\n if (self._fetchingSchema) return; // Prevent re-entry\n self._fetchingSchema = true;\n \n BusyIndicator.show(0);\n SchemaProvider.resolve(schemaRaw)\n .then(json => {\n const plugin = SchemaBuilderRegistry.getBuilderFor(json);\n const finalSchema = plugin ? plugin.build(json, this.getProperty(\"schemaTarget\") as string | undefined) : json;\n super.setProperty(\"schemaDefinition\", finalSchema, true);\n if (finalSchema.definitions) {\n super.setProperty(\"schemaDefinitions\", finalSchema.definitions, true);\n }\n const self = this as unknown as { _fetchingSchema?: boolean };\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); // Force re-render with resolved schema\n })\n .catch(err => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n MessageToast.show(\"Failed to fetch remote schema\");\n super.setProperty(\"schemaDefinition\", null, true); // Fallback to full inference\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate();\n });\n return; // Abort this render cycle until fetch completes\n }\n\n // 2. Local Plugin Detection (Stringified JSON or Raw Object)\n let schema = schemaRaw;\n if (schema && typeof schema === \"string\" && (schema as string).trim().startsWith(\"{\")) {\n try {\n schema = JSON.parse(schema);\n } catch (e) {\n // Ignore, let standard validation catch it\n }\n }\n\n if (schema && typeof schema === \"object\") {\n const plugin = SchemaBuilderRegistry.getBuilderFor(schema);\n if (plugin) {\n schema = plugin.build(schema, this.getProperty(\"schemaTarget\") as string | undefined);\n // Silently update the wrapper property so the inner host gets the final parsed MetaUI format\n super.setProperty(\"schemaDefinition\", schema, true);\n if ((schema as Record<string, unknown>).definitions) {\n super.setProperty(\"schemaDefinitions\", (schema as Record<string, unknown>).definitions, true);\n }\n }\n }\n\n const dataJson = this.getProperty(\"dataJson\");\n const data = this.getProperty(\"data\");\n\n let hasSchema = !!schema;\n if (hasSchema && typeof schema === \"object\" && Object.keys(schema as Record<string, unknown>).length === 0) {\n hasSchema = false; // Treat empty object as no schema\n }\n\n const hasData = !!dataJson || !!data;\n\n // 3. AI Schema Inference Detection\n if (hasData && this.getProperty(\"inferenceStrategy\") === \"AI\") {\n const self = this as unknown as { _fetchingSchema?: boolean };\n if (self._fetchingSchema) return; // Prevent re-entry\n self._fetchingSchema = true;\n\n let rawDataObj = data;\n if (!rawDataObj && dataJson) {\n try { rawDataObj = JSON.parse(dataJson as string); } catch(e: unknown) { \n const msg = \"Ignored invalid dataJson parse: \" + (e as Error).message;\n Logger.error(\"[DynamicHost]\", msg, \"DynamicHost\"); \n MessageBox.error(msg, { title: \"Invalid JSON Data\" });\n }\n }\n\n if (rawDataObj) {\n BusyIndicator.show(0);\n const proxy = AIConfig.getProxy();\n \n proxy.generateSchema(rawDataObj, schema || undefined)\n .then((generatedSchema: unknown) => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n super.setProperty(\"schemaDefinition\", generatedSchema, true);\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); // Force re-render with the new schema\n })\n .catch((err: Error) => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n Logger.warn(\"[MetaUI DynamicHost]\", \"AI inference failed, falling back to RuleBased. Error: \" + err.message, \"DynamicHost\");\n MessageToast.show(\"AI Inference failed, using fallback.\");\n super.setProperty(\"inferenceStrategy\", \"RuleBased\", true); // Fallback to normal inference\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); \n });\n return; // Abort render cycle until AI is done\n }\n }\n\n Logger.debug(\"[MetaUI DynamicHost]\", `Evaluating boot. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n\n // Only boot if we have either a schema or some data to infer from\n if (hasSchema || hasData) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Booting inner host. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n }\n // The architectural Facade router logic:\n // We've simplified this! We no longer use HostFactory or separate subclasses.\n // GeneratorHost is fully capable of inferring the schema if none is provided.\n this._innerHost = new GeneratorHost();\n\n // 1. Forward all static values to the spawned host BEFORE mounting.\n // Since we no longer use bindProperty, it's perfectly safe to set raw properties before mounting.\n const props = this.getMetadata().getProperties();\n for (const propName in props) {\n if (propName === \"inferenceStrategy\") continue;\n const val = super.getProperty(propName);\n if (val !== null && val !== undefined) {\n if (propName === \"schemaDefinitions\") {\n Logger.debug(`[MetaUI DynamicHost] Proxying schemaDefinitions: ${Object.keys(val)}`, \"\", \"DynamicHost\");\n }\n this._innerHost.setProperty(propName, val);\n } else if (propName === \"schemaDefinitions\") {\n Logger.warn(`[MetaUI DynamicHost] Warning: schemaDefinitions is null/undefined in Wrapper. Defaulting to empty object in GeneratorHost.`, \"\", \"DynamicHost\");\n }\n }\n\n // 2. Mount so it inherits models and triggers lifecycle.\n this.setAggregation(\"_content\", this._innerHost);\n\n // 3. Forward all event subscriptions.\n // By proxying the events upwards, the developer can subscribe to `<meta:DynamicHost submit=\"...\">` \n // and perfectly receive the inner host's submission event.\n const events = this.getMetadata().getEvents();\n for (const eventName in events) {\n this._innerHost.attachEvent(eventName, (oEvent: sap.ui.base.Event) => {\n // Natively push updated payload out to any bound Fiori Element properties.\n // Using super.setProperty prevents an infinite loop back down to _innerHost.\n if (eventName === \"submit\" || eventName === \"fieldChange\") {\n const params = oEvent.getParameters();\n if (params.payload) {\n const isLive = this.getProperty(\"liveUpdate\") === true;\n if (eventName === \"submit\" || isLive) {\n super.setProperty(\"data\", params.payload, true);\n\n const str = params.payloadJson || JSON.stringify(params.payload, null, 2);\n super.setProperty(\"dataJson\", str, true);\n }\n }\n }\n this.fireEvent(eventName, oEvent.getParameters());\n });\n }\n\n this._initializedInner = true;\n }\n }\n }\n\n /**\n * Overrides standard UI5 setProperty to act as a transparent proxy.\n * When a property is updated on the wrapper (either programmatically or via a binding update),\n * it instantly mirrors that value down to the inner instantiated host.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaDefinitions\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Wrapper received setProperty: ${propertyName}`, \"DynamicHost\");\n }\n }\n super.setProperty(propertyName, value, suppressInvalidate);\n if (this._innerHost && propertyName !== \"inferenceStrategy\") {\n this._innerHost.setProperty(propertyName, value, suppressInvalidate);\n } else if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaDefinitions\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `_innerHost not yet initialized when ${propertyName} was set. Booting will happen on next render.`, \"DynamicHost\");\n }\n }\n return this;\n }\n\n\n\n\n\n /**\n * Programmatic API support. Routes dialog commands down to the spawned inner host.\n * If the inner host has not booted yet, it forces initialization immediately.\n * \n * @param {string} [title=\"Form\"] The title of the dialog\n * @param {string} [submitButtonText=\"OK\"] The text for the primary action button\n * @param {string} [cancelButtonText=\"Cancel\"] The text for the cancel button\n * @param {string} [dialogWidth=\"auto\"] The width of the dialog\n * @param {sap.ui.core.Control} [parentView] The parent view to attach the dialog to for model inheritance.\n */\n public openInDialog(title?: string, submitButtonText?: string, cancelButtonText?: string, dialogWidth?: string, parentView?: Control): void {\n if (!this._innerHost) {\n this.onBeforeRendering(); // Force init if they bypassed UI5 rendering\n }\n this._innerHost?.openInDialog(title, submitButtonText, cancelButtonText, dialogWidth, parentView);\n }\n\n /**\n * Proxies submission triggering down to the instantiated generator host.\n * Evaluates the internal Engine validation suite and returns true if structurally sound.\n * \n * @returns {boolean} True if the internal payload passes schema validation, false otherwise.\n */\n public triggerSubmit(): boolean {\n if (!this._innerHost) {\n return false;\n }\n return this._innerHost.triggerSubmit();\n }\n\n /**\n * Injects a custom error message onto a specific field.\n * Useful for injecting custom backend validation errors.\n * \n * @param {string} fieldPath The schema key path to target.\n * @param {string} message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n const inner = this._innerHost as unknown as { addCustomError?: (p: string, m: string) => void };\n if (inner && typeof inner.addCustomError === \"function\") {\n inner.addCustomError(fieldPath, message);\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n * \n * @param {string} fieldPath The schema key path to target.\n */\n public clearCustomError(fieldPath: string): void {\n const inner = this._innerHost as unknown as { clearCustomError?: (p: string) => void };\n if (inner && typeof inner.clearCustomError === \"function\") {\n inner.clearCustomError(fieldPath);\n }\n }\n\n /**\n * Overrides standard UI5 getProperty to transparently pull extracted data from the inner host.\n * Ensures that querying the DynamicHost facade for `data` always yields the freshest payload.\n * \n * @param {string} propertyName The name of the property to retrieve\n * @returns {unknown} The property value\n */\n public getProperty(propertyName: string): unknown {\n if (propertyName === \"outputData\") {\n propertyName = \"data\"; // Forward deprecated outputData to data\n }\n if (this._innerHost && (propertyName === \"data\" || propertyName === \"dataJson\")) {\n return this._innerHost.getProperty(propertyName);\n }\n return super.getProperty(propertyName);\n }\n}\n"],"mappings":";;;;;;QAEOA,aAAa,GAAAC,sBAAA,CAAAC,eAAA;EAAA,MACXC,MAAM,GAAAC,eAAA;EAAA,MACNC,aAAa,GAAAC,+BAAA;EAAA,MAEbC,qBAAqB,GAAAC,6BAAA;EAAA,MAIrBC,cAAc,GAAAC,0BAAA;EAAA,MACdC,QAAQ,GAAAC,cAAA;EAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EARA,MASqBC,WAAW,GAASC,OAAO,CAAAC,MAAA;IAAAC,WAAA,WAAAA,YAAA;MAAAF,OAAA,CAAAG,SAAA,CAAAD,WAAA,CAAAE,KAAA,OAAAC,SAAA;MAAA,KACpCC,aAAa,GAAyB,IAAI;MAoFlD;AACJ;AACA;AACA;MAHI,KAIQC,UAAU,GAAyB,IAAI;MAE/C;AACJ;AACA;AACA;MAHI,KAIQC,iBAAiB,GAAY,KAAK;IAAA;IA3BnCC,QAAQ,EAAG;MACdC,UAAU,EAAE,CAAC;MACbC,MAAMA,CAACC,EAAiB,EAAEC,OAAoB,EAAE;QAC5CD,EAAE,CAACE,SAAS,CAAC,KAAK,EAAED,OAAO,CAAC;QAC5BD,EAAE,CAACG,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;QACzBH,EAAE,CAACG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1BH,EAAE,CAACI,OAAO,CAAC,CAAC;QAEZ,MAAMC,OAAO,GAAGJ,OAAO,CAACK,cAAc,CAAC,UAAU,CAAY;QAC7D,IAAID,OAAO,EAAE;UACTL,EAAE,CAACO,aAAa,CAACF,OAAO,CAAC;QAC7B;QAEAL,EAAE,CAACQ,KAAK,CAAC,KAAK,CAAC;MACnB;IACJ,CAA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@@ -159,6 +159,30 @@ declare module "nz/co/siliconst/ui5/metaui/controls/DynamicHost" {
159
159
  };
160
160
  };
161
161
  };
162
+ /**
163
+ * Forwarded transparently from the inner GeneratorHost via the event proxy loop.
164
+ * Fired by WizardLayout when the user navigates to a new Wizard step.
165
+ * See GeneratorHost.metadata for full parameter documentation.
166
+ */
167
+ beforeLayoutSectionChange: {
168
+ parameters: {
169
+ stepIndex: {
170
+ type: string;
171
+ };
172
+ payload: {
173
+ type: string;
174
+ };
175
+ preventDefault: {
176
+ type: string;
177
+ };
178
+ addError: {
179
+ type: string;
180
+ };
181
+ resumeNavigation: {
182
+ type: string;
183
+ };
184
+ };
185
+ };
162
186
  };
163
187
  };
164
188
  static renderer: {
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicHost.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,iDAAiD,CAAC;IACjE,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,aAAa,MAAM,2BAA2B,CAAC;IAYtD;;;;;;;;OAQG;IACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;QAC5C,OAAO,CAAC,aAAa,CAA8B;QAEnD,MAAM,CAAC,QAAQ,CAAC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiDtB;QAEF,MAAM,CAAC,QAAQ;;uBAEA,aAAa,WAAW,WAAW;UAahD;QAEF;;;WAGG;QACH,OAAO,CAAC,UAAU,CAA8B;QAEhD;;;WAGG;QACH,OAAO,CAAC,iBAAiB,CAAkB;QAE3C;;;;WAIG;QACH,OAAO,CAAC,iBAAiB;QA2BzB;;;;;;;;WAQG;QACI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@@
1
- sap.ui.define(["sap/ui/core/Control","./host/GeneratorHost","../utils/Logger","./host/delegates/ODataDelegate","../core/SchemaBuilderRegistry","sap/ui/core/BusyIndicator","sap/m/MessageToast","sap/m/MessageBox","../services/SchemaProvider","../ai/AIConfig"],function(t,e,i,n,a,o,s,r,l,c){"use strict";function d(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const h=d(e);const u=i["Logger"];const f=n["ODataDelegate"];const p=a["SchemaBuilderRegistry"];const g=l["SchemaProvider"];const y=c["AIConfig"];const m=t.extend("nz.co.siliconst.ui5.metaui.controls.DynamicHost",{constructor:function e(){t.prototype.constructor.apply(this,arguments);this.odataDelegate=null;this._innerHost=null;this._initializedInner=false},renderer:{apiVersion:2,render(t,e){t.openStart("div",e);t.style("width","100%");t.style("height","100%");t.openEnd();const i=e.getAggregation("_content");if(i){t.renderControl(i)}t.close("div")}},metadata:{properties:{schemaDefinition:{type:"any",defaultValue:null},schemaDefinitions:{type:"object",defaultValue:null},schemaTarget:{type:"string",defaultValue:null},pluginRegistry:{type:"object",defaultValue:null},schemaBuilderRegistry:{type:"object",defaultValue:null},data:{type:"object",defaultValue:null,bindable:"bindable"},dataJson:{type:"string",defaultValue:null,bindable:"bindable"},liveUpdate:{type:"boolean",defaultValue:false},isValid:{type:"boolean",defaultValue:true},useMessageManager:{type:"boolean",defaultValue:false},modelName:{type:"string",defaultValue:"meta"},debugMode:{type:"boolean",defaultValue:false},editable:{type:"boolean",defaultValue:true},layoutBudget:{type:"int",defaultValue:0},inferenceStrategy:{type:"string",defaultValue:"RuleBased"}},aggregations:{_content:{type:"sap.ui.core.Control",multiple:false,visibility:"hidden"}},events:{beforeSubmit:{parameters:{payload:{type:"object"},addError:{type:"function"},preventDefault:{type:"function"}}},submit:{parameters:{payload:{type:"object"},payloadJson:{type:"string"}}},cancel:{},fieldChange:{parameters:{fieldPath:{type:"string"},value:{type:"any"},payload:{type:"object"},isValid:{type:"boolean"}}},validationStateChanged:{parameters:{isValid:{type:"boolean"}}},validationError:{parameters:{fieldPath:{type:"string"},message:{type:"string"}}},validationSuccess:{parameters:{fieldPath:{type:"string"}}},error:{parameters:{message:{type:"string"},exception:{type:"object"}}}}},initODataDelegate:function t(){if(!this.odataDelegate){if(this.getBindingInfo("dataJson")){return}const t=this.getBindingInfo("data");if(t&&t.path&&t.path!==""){return}const e=this.getBindingContext("odata")||this.getBindingContext();if(e){u.debug("[MetaUI DynamicHost]",`Context found for delegate initialization: ${e.getPath()}`,"DynamicHost");if(e&&e.requestObject&&typeof e.requestObject==="function"){u.debug("[MetaUI DynamicHost]",`Context supports requestObject/getObject. Instantiating ODataDelegate.`,"DynamicHost");this.odataDelegate=new f(this,e);this.odataDelegate.syncToEngine()}else{u.debug("[MetaUI DynamicHost]",`Context does NOT support requestObject/getObject! Keys: ${Object.keys(e)}`,"DynamicHost")}}}},setBindingContext:function e(i,n){t.prototype.setBindingContext.call(this,i,n);this.initODataDelegate();return this},bindElement:function e(i,n){t.prototype.bindElement.call(this,i,n);const a=typeof i==="object"?i.model:undefined;const o=this.getElementBinding(a);if(o){o.attachChange(()=>{this.initODataDelegate()})}return this},onBeforeRendering:function e(){u.debug("[MetaUI DynamicHost]",`onBeforeRendering called. _initializedInner: ${this._initializedInner}`,"DynamicHost");this.initODataDelegate();if(!this._initializedInner){let e=this.getProperty("schemaDefinition");if(typeof e==="string"&&(e.startsWith("http://")||e.startsWith("https://"))){const i=this;if(i._fetchingSchema)return;i._fetchingSchema=true;o.show(0);g.resolve(e).then(e=>{const i=p.getBuilderFor(e);const n=i?i.build(e,this.getProperty("schemaTarget")):e;t.prototype.setProperty.call(this,"schemaDefinition",n,true);if(n.definitions){t.prototype.setProperty.call(this,"schemaDefinitions",n.definitions,true)}const a=this;a._fetchingSchema=false;o.hide();this.invalidate()}).catch(e=>{const i=this;s.show("Failed to fetch remote schema");t.prototype.setProperty.call(this,"schemaDefinition",null,true);i._fetchingSchema=false;o.hide();this.invalidate()});return}let i=e;if(i&&typeof i==="string"&&i.trim().startsWith("{")){try{i=JSON.parse(i)}catch(t){}}if(i&&typeof i==="object"){const e=p.getBuilderFor(i);if(e){i=e.build(i,this.getProperty("schemaTarget"));t.prototype.setProperty.call(this,"schemaDefinition",i,true);if(i.definitions){t.prototype.setProperty.call(this,"schemaDefinitions",i.definitions,true)}}}const n=this.getProperty("dataJson");const a=this.getProperty("data");let l=!!i;if(l&&typeof i==="object"&&Object.keys(i).length===0){l=false}const c=!!n||!!a;if(c&&this.getProperty("inferenceStrategy")==="AI"){const e=this;if(e._fetchingSchema)return;e._fetchingSchema=true;let l=a;if(!l&&n){try{l=JSON.parse(n)}catch(t){const e="Ignored invalid dataJson parse: "+t.message;u.error("[DynamicHost]",e,"DynamicHost");r.error(e,{title:"Invalid JSON Data"})}}if(l){o.show(0);const e=y.getProxy();e.generateSchema(l,i||undefined).then(e=>{const i=this;t.prototype.setProperty.call(this,"schemaDefinition",e,true);i._fetchingSchema=false;o.hide();this.invalidate()}).catch(e=>{const i=this;u.warn("[MetaUI DynamicHost]","AI inference failed, falling back to RuleBased. Error: "+e.message,"DynamicHost");s.show("AI Inference failed, using fallback.");t.prototype.setProperty.call(this,"inferenceStrategy","RuleBased",true);i._fetchingSchema=false;o.hide();this.invalidate()});return}}u.debug("[MetaUI DynamicHost]",`Evaluating boot. hasSchema: ${l}, hasData: ${c}`,"DynamicHost");if(l||c){if(this.getProperty("debugMode")){u.debug("[MetaUI DynamicHost]",`Booting inner host. hasSchema: ${l}, hasData: ${c}`,"DynamicHost")}this._innerHost=new h;const e=this.getMetadata().getProperties();for(const i in e){if(i==="inferenceStrategy")continue;const e=t.prototype.getProperty.call(this,i);if(e!==null&&e!==undefined){if(i==="schemaDefinitions"){u.debug(`[MetaUI DynamicHost] Proxying schemaDefinitions: ${Object.keys(e)}`,"","DynamicHost")}this._innerHost.setProperty(i,e)}else if(i==="schemaDefinitions"){u.warn(`[MetaUI DynamicHost] Warning: schemaDefinitions is null/undefined in Wrapper. Defaulting to empty object in GeneratorHost.`,"","DynamicHost")}}this.setAggregation("_content",this._innerHost);const i=this.getMetadata().getEvents();for(const e in i){this._innerHost.attachEvent(e,i=>{if(e==="submit"||e==="fieldChange"){const n=i.getParameters();if(n.payload){const i=this.getProperty("liveUpdate")===true;if(e==="submit"||i){t.prototype.setProperty.call(this,"data",n.payload,true);const e=n.payloadJson||JSON.stringify(n.payload,null,2);t.prototype.setProperty.call(this,"dataJson",e,true)}}}this.fireEvent(e,i.getParameters())})}this._initializedInner=true}}},setProperty:function e(i,n,a){if(i==="data"||i==="dataJson"||i==="schemaDefinition"||i==="schemaDefinitions"){if(this.getProperty("debugMode")){u.debug("[MetaUI DynamicHost]",`Wrapper received setProperty: ${i}`,"DynamicHost")}}t.prototype.setProperty.call(this,i,n,a);if(this._innerHost&&i!=="inferenceStrategy"){this._innerHost.setProperty(i,n,a)}else if(i==="data"||i==="dataJson"||i==="schemaDefinition"||i==="schemaDefinitions"){if(this.getProperty("debugMode")){u.debug("[MetaUI DynamicHost]",`_innerHost not yet initialized when ${i} was set. Booting will happen on next render.`,"DynamicHost")}}return this},openInDialog:function t(e,i,n,a,o){if(!this._innerHost){this.onBeforeRendering()}this._innerHost?.openInDialog(e,i,n,a,o)},triggerSubmit:function t(){if(!this._innerHost){return false}return this._innerHost.triggerSubmit()},addCustomError:function t(e,i){const n=this._innerHost;if(n&&typeof n.addCustomError==="function"){n.addCustomError(e,i)}},clearCustomError:function t(e){const i=this._innerHost;if(i&&typeof i.clearCustomError==="function"){i.clearCustomError(e)}},getProperty:function e(i){if(i==="outputData"){i="data"}if(this._innerHost&&(i==="data"||i==="dataJson")){return this._innerHost.getProperty(i)}return t.prototype.getProperty.call(this,i)}});return m});
1
+ sap.ui.define(["sap/ui/core/Control","./host/GeneratorHost","../utils/Logger","./host/delegates/ODataDelegate","../core/SchemaBuilderRegistry","sap/ui/core/BusyIndicator","sap/m/MessageToast","sap/m/MessageBox","../services/SchemaProvider","../ai/AIConfig"],function(t,e,i,n,a,o,s,r,l,c){"use strict";function d(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const u=d(e);const f=i["Logger"];const h=n["ODataDelegate"];const p=a["SchemaBuilderRegistry"];const g=l["SchemaProvider"];const y=c["AIConfig"];const m=t.extend("nz.co.siliconst.ui5.metaui.controls.DynamicHost",{constructor:function e(){t.prototype.constructor.apply(this,arguments);this.odataDelegate=null;this._innerHost=null;this._initializedInner=false},renderer:{apiVersion:2,render(t,e){t.openStart("div",e);t.style("width","100%");t.style("height","100%");t.openEnd();const i=e.getAggregation("_content");if(i){t.renderControl(i)}t.close("div")}},metadata:{properties:{schemaDefinition:{type:"any",defaultValue:null},schemaDefinitions:{type:"object",defaultValue:null},schemaTarget:{type:"string",defaultValue:null},pluginRegistry:{type:"object",defaultValue:null},schemaBuilderRegistry:{type:"object",defaultValue:null},data:{type:"object",defaultValue:null,bindable:"bindable"},dataJson:{type:"string",defaultValue:null,bindable:"bindable"},liveUpdate:{type:"boolean",defaultValue:false},isValid:{type:"boolean",defaultValue:true},useMessageManager:{type:"boolean",defaultValue:false},modelName:{type:"string",defaultValue:"meta"},debugMode:{type:"boolean",defaultValue:false},editable:{type:"boolean",defaultValue:true},layoutBudget:{type:"int",defaultValue:0},inferenceStrategy:{type:"string",defaultValue:"RuleBased"}},aggregations:{_content:{type:"sap.ui.core.Control",multiple:false,visibility:"hidden"}},events:{beforeSubmit:{parameters:{payload:{type:"object"},addError:{type:"function"},preventDefault:{type:"function"}}},submit:{parameters:{payload:{type:"object"},payloadJson:{type:"string"}}},cancel:{},fieldChange:{parameters:{fieldPath:{type:"string"},value:{type:"any"},payload:{type:"object"},isValid:{type:"boolean"}}},validationStateChanged:{parameters:{isValid:{type:"boolean"}}},validationError:{parameters:{fieldPath:{type:"string"},message:{type:"string"}}},validationSuccess:{parameters:{fieldPath:{type:"string"}}},error:{parameters:{message:{type:"string"},exception:{type:"object"}}},beforeLayoutSectionChange:{parameters:{stepIndex:{type:"int"},payload:{type:"object"},preventDefault:{type:"function"},addError:{type:"function"},resumeNavigation:{type:"function"}}}}},initODataDelegate:function t(){if(!this.odataDelegate){if(this.getBindingInfo("dataJson")){return}const t=this.getBindingInfo("data");if(t&&t.path&&t.path!==""){return}const e=this.getBindingContext("odata")||this.getBindingContext();if(e){f.debug("[MetaUI DynamicHost]",`Context found for delegate initialization: ${e.getPath()}`,"DynamicHost");if(e&&e.requestObject&&typeof e.requestObject==="function"){f.debug("[MetaUI DynamicHost]",`Context supports requestObject/getObject. Instantiating ODataDelegate.`,"DynamicHost");this.odataDelegate=new h(this,e);this.odataDelegate.syncToEngine()}else{f.debug("[MetaUI DynamicHost]",`Context does NOT support requestObject/getObject! Keys: ${Object.keys(e)}`,"DynamicHost")}}}},setBindingContext:function e(i,n){t.prototype.setBindingContext.call(this,i,n);this.initODataDelegate();return this},bindElement:function e(i,n){t.prototype.bindElement.call(this,i,n);const a=typeof i==="object"?i.model:undefined;const o=this.getElementBinding(a);if(o){o.attachChange(()=>{this.initODataDelegate()})}return this},onBeforeRendering:function e(){f.debug("[MetaUI DynamicHost]",`onBeforeRendering called. _initializedInner: ${this._initializedInner}`,"DynamicHost");this.initODataDelegate();if(!this._initializedInner){let e=this.getProperty("schemaDefinition");if(typeof e==="string"&&(e.startsWith("http://")||e.startsWith("https://"))){const i=this;if(i._fetchingSchema)return;i._fetchingSchema=true;o.show(0);g.resolve(e).then(e=>{const i=p.getBuilderFor(e);const n=i?i.build(e,this.getProperty("schemaTarget")):e;t.prototype.setProperty.call(this,"schemaDefinition",n,true);if(n.definitions){t.prototype.setProperty.call(this,"schemaDefinitions",n.definitions,true)}const a=this;a._fetchingSchema=false;o.hide();this.invalidate()}).catch(e=>{const i=this;s.show("Failed to fetch remote schema");t.prototype.setProperty.call(this,"schemaDefinition",null,true);i._fetchingSchema=false;o.hide();this.invalidate()});return}let i=e;if(i&&typeof i==="string"&&i.trim().startsWith("{")){try{i=JSON.parse(i)}catch(t){}}if(i&&typeof i==="object"){const e=p.getBuilderFor(i);if(e){i=e.build(i,this.getProperty("schemaTarget"));t.prototype.setProperty.call(this,"schemaDefinition",i,true);if(i.definitions){t.prototype.setProperty.call(this,"schemaDefinitions",i.definitions,true)}}}const n=this.getProperty("dataJson");const a=this.getProperty("data");let l=!!i;if(l&&typeof i==="object"&&Object.keys(i).length===0){l=false}const c=!!n||!!a;if(c&&this.getProperty("inferenceStrategy")==="AI"){const e=this;if(e._fetchingSchema)return;e._fetchingSchema=true;let l=a;if(!l&&n){try{l=JSON.parse(n)}catch(t){const e="Ignored invalid dataJson parse: "+t.message;f.error("[DynamicHost]",e,"DynamicHost");r.error(e,{title:"Invalid JSON Data"})}}if(l){o.show(0);const e=y.getProxy();e.generateSchema(l,i||undefined).then(e=>{const i=this;t.prototype.setProperty.call(this,"schemaDefinition",e,true);i._fetchingSchema=false;o.hide();this.invalidate()}).catch(e=>{const i=this;f.warn("[MetaUI DynamicHost]","AI inference failed, falling back to RuleBased. Error: "+e.message,"DynamicHost");s.show("AI Inference failed, using fallback.");t.prototype.setProperty.call(this,"inferenceStrategy","RuleBased",true);i._fetchingSchema=false;o.hide();this.invalidate()});return}}f.debug("[MetaUI DynamicHost]",`Evaluating boot. hasSchema: ${l}, hasData: ${c}`,"DynamicHost");if(l||c){if(this.getProperty("debugMode")){f.debug("[MetaUI DynamicHost]",`Booting inner host. hasSchema: ${l}, hasData: ${c}`,"DynamicHost")}this._innerHost=new u;const e=this.getMetadata().getProperties();for(const i in e){if(i==="inferenceStrategy")continue;const e=t.prototype.getProperty.call(this,i);if(e!==null&&e!==undefined){if(i==="schemaDefinitions"){f.debug(`[MetaUI DynamicHost] Proxying schemaDefinitions: ${Object.keys(e)}`,"","DynamicHost")}this._innerHost.setProperty(i,e)}else if(i==="schemaDefinitions"){f.warn(`[MetaUI DynamicHost] Warning: schemaDefinitions is null/undefined in Wrapper. Defaulting to empty object in GeneratorHost.`,"","DynamicHost")}}this.setAggregation("_content",this._innerHost);const i=this.getMetadata().getEvents();for(const e in i){this._innerHost.attachEvent(e,i=>{if(e==="submit"||e==="fieldChange"){const n=i.getParameters();if(n.payload){const i=this.getProperty("liveUpdate")===true;if(e==="submit"||i){t.prototype.setProperty.call(this,"data",n.payload,true);const e=n.payloadJson||JSON.stringify(n.payload,null,2);t.prototype.setProperty.call(this,"dataJson",e,true)}}}this.fireEvent(e,i.getParameters())})}this._initializedInner=true}}},setProperty:function e(i,n,a){if(i==="data"||i==="dataJson"||i==="schemaDefinition"||i==="schemaDefinitions"){if(this.getProperty("debugMode")){f.debug("[MetaUI DynamicHost]",`Wrapper received setProperty: ${i}`,"DynamicHost")}}t.prototype.setProperty.call(this,i,n,a);if(this._innerHost&&i!=="inferenceStrategy"){this._innerHost.setProperty(i,n,a)}else if(i==="data"||i==="dataJson"||i==="schemaDefinition"||i==="schemaDefinitions"){if(this.getProperty("debugMode")){f.debug("[MetaUI DynamicHost]",`_innerHost not yet initialized when ${i} was set. Booting will happen on next render.`,"DynamicHost")}}return this},openInDialog:function t(e,i,n,a,o){if(!this._innerHost){this.onBeforeRendering()}this._innerHost?.openInDialog(e,i,n,a,o)},triggerSubmit:function t(){if(!this._innerHost){return false}return this._innerHost.triggerSubmit()},addCustomError:function t(e,i){const n=this._innerHost;if(n&&typeof n.addCustomError==="function"){n.addCustomError(e,i)}},clearCustomError:function t(e){const i=this._innerHost;if(i&&typeof i.clearCustomError==="function"){i.clearCustomError(e)}},getProperty:function e(i){if(i==="outputData"){i="data"}if(this._innerHost&&(i==="data"||i==="dataJson")){return this._innerHost.getProperty(i)}return t.prototype.getProperty.call(this,i)}});return m});
2
2
  //# sourceMappingURL=DynamicHost.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicHost.js","names":["GeneratorHost","_interopRequireDefault","__GeneratorHost","Logger","___utils_Logger","ODataDelegate","___host_delegates_ODataDelegate","SchemaBuilderRegistry","___core_SchemaBuilderRegistry","SchemaProvider","___services_SchemaProvider","AIConfig","___ai_AIConfig","DynamicHost","Control","extend","constructor","prototype","apply","this","arguments","odataDelegate","_innerHost","_initializedInner","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","schemaDefinitions","schemaTarget","pluginRegistry","schemaBuilderRegistry","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","layoutBudget","inferenceStrategy","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","initODataDelegate","_initODataDelegate","getBindingInfo","dataBinding","path","oContext","getBindingContext","debug","getPath","requestObject","syncToEngine","Object","keys","setBindingContext","_setBindingContext","sModelName","Control.prototype.setBindingContext.call","bindElement","_bindElement","vPath","mParameters","Control.prototype.bindElement.call","model","undefined","oBinding","getElementBinding","attachChange","onBeforeRendering","_onBeforeRendering","schemaRaw","getProperty","startsWith","self","_fetchingSchema","BusyIndicator","show","resolve","then","json","plugin","getBuilderFor","finalSchema","build","Control.prototype.setProperty.call","definitions","hide","invalidate","catch","err","MessageToast","schema","trim","JSON","parse","e","hasSchema","length","hasData","rawDataObj","msg","MessageBox","title","proxy","getProxy","generateSchema","generatedSchema","warn","props","getMetadata","getProperties","propName","val","Control.prototype.getProperty.call","setProperty","setAggregation","getEvents","eventName","attachEvent","oEvent","params","getParameters","isLive","str","stringify","fireEvent","_setProperty","propertyName","suppressInvalidate","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","triggerSubmit","_triggerSubmit","addCustomError","_addCustomError","inner","clearCustomError","_clearCustomError","_getProperty"],"sources":["DynamicHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport GeneratorHost from \"./host/GeneratorHost\";\nimport { Logger } from \"../utils/Logger\";\nimport { ODataDelegate } from \"./host/delegates/ODataDelegate\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport { SchemaBuilderRegistry } from \"../core/SchemaBuilderRegistry\";\nimport BusyIndicator from \"sap/ui/core/BusyIndicator\";\nimport MessageToast from \"sap/m/MessageToast\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport { SchemaProvider } from \"../services/SchemaProvider\";\nimport { AIConfig } from \"../ai/AIConfig\";\n\n/**\n * A transparent wrapper control (Facade) that automatically chooses between Explicit Schema Mode \n * and Inference Mode based on the presence of a 'schemaDefinition'.\n * \n * This maintains total architectural separation of the modes without forcing developers to \n * use different XML tags.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls\n */\nexport default class DynamicHost extends Control {\n private odataDelegate: ODataDelegate | null = null;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n schemaDefinitions: { type: \"object\", defaultValue: null },\n schemaTarget: { type: \"string\", defaultValue: null },\n pluginRegistry: { type: \"object\", defaultValue: null },\n schemaBuilderRegistry: { type: \"object\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true },\n layoutBudget: { type: \"int\", defaultValue: 0 },\n inferenceStrategy: { type: \"string\", defaultValue: \"RuleBased\" }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } },\n error: { parameters: { message: { type: \"string\" }, exception: { type: \"object\" } } }\n }\n };\n\n static renderer = {\n apiVersion: 2,\n render(rm: RenderManager, control: DynamicHost) {\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 * Internal reference to the generated inner host instance.\n * @private\n */\n private _innerHost: GeneratorHost | null = null;\n\n /**\n * Flag indicating if the inner host has been initialized.\n * @private\n */\n private _initializedInner: boolean = false;\n\n /**\n * Initializes the OData Delegate if an OData context is detected.\n * This allows DynamicHost to seamlessly synchronize metadata and properties from an OData model.\n * @private\n */\n private initODataDelegate(): void {\n if (!this.odataDelegate) {\n // Guard: If the user explicitly bound dataJson, do not steal the context.\n if (this.getBindingInfo(\"dataJson\")) {\n return;\n }\n\n // Guard: If the user explicitly bound 'data' to a specific property path, do not steal the context.\n const dataBinding = this.getBindingInfo(\"data\") as Record<string, unknown> | undefined;\n if (dataBinding && dataBinding.path && dataBinding.path !== \"\") {\n return;\n }\n\n const oContext = this.getBindingContext(\"odata\") || this.getBindingContext();\n if (oContext) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context found for delegate initialization: ${oContext.getPath()}`, \"DynamicHost\");\n if (oContext && (oContext as ODataV4Context).requestObject && typeof (oContext as ODataV4Context).requestObject === \"function\") {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context supports requestObject/getObject. Instantiating ODataDelegate.`, \"DynamicHost\");\n this.odataDelegate = new ODataDelegate(this, oContext as ODataV4Context);\n this.odataDelegate.syncToEngine();\n } else {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context does NOT support requestObject/getObject! Keys: ${Object.keys(oContext)}`, \"DynamicHost\");\n }\n }\n }\n }\n\n /**\n * Standard UI5 method override.\n * Sets the binding context for the control and attempts to initialize the OData delegate\n * if the context points to an OData model.\n * \n * @param {sap.ui.model.Context | null | undefined} oContext The binding context object\n * @param {string} [sModelName] Optional model name\n * @returns {this} The control instance for chaining\n */\n public setBindingContext(oContext: unknown, sModelName?: string): this {\n super.setBindingContext(oContext as sap.ui.model.Context, sModelName);\n this.initODataDelegate();\n return this;\n }\n\n /**\n * Standard UI5 method override.\n * Binds the element to the given path and attaches a change listener to re-evaluate\n * the OData delegate when the element binding resolves.\n * \n * @param {string | Record<string, unknown>} vPath The binding path or configuration object\n * @param {object} [mParameters] Optional mapping parameters\n * @returns {this} Reference to this instance for chaining\n */\n public bindElement(vPath: unknown, mParameters?: object): this {\n super.bindElement(vPath as string | { path: string }, mParameters);\n const sModelName = typeof vPath === \"object\" ? vPath.model : undefined;\n const oBinding = this.getElementBinding(sModelName);\n if (oBinding) {\n oBinding.attachChange(() => {\n this.initODataDelegate();\n });\n }\n return this;\n }\n\n /**\n * Standard UI5 Lifecycle Hook.\n * Evaluates the initial properties and spawns the GeneratorHost.\n * It handles the complex lifecycle task of copying all bindings, raw properties, and event listeners \n * down to the inner host perfectly transparently.\n */\n public onBeforeRendering(): void {\n Logger.debug(\"[MetaUI DynamicHost]\", `onBeforeRendering called. _initializedInner: ${this._initializedInner}`, \"DynamicHost\");\n\n this.initODataDelegate();\n\n if (!this._initializedInner) {\n let schemaRaw = this.getProperty(\"schemaDefinition\");\n\n if (typeof schemaRaw === \"string\" && (schemaRaw.startsWith(\"http://\") || schemaRaw.startsWith(\"https://\"))) {\n const self = this as unknown as { _fetchingSchema?: boolean };\n if (self._fetchingSchema) return; // Prevent re-entry\n self._fetchingSchema = true;\n \n BusyIndicator.show(0);\n SchemaProvider.resolve(schemaRaw)\n .then(json => {\n const plugin = SchemaBuilderRegistry.getBuilderFor(json);\n const finalSchema = plugin ? plugin.build(json, this.getProperty(\"schemaTarget\") as string | undefined) : json;\n super.setProperty(\"schemaDefinition\", finalSchema, true);\n if (finalSchema.definitions) {\n super.setProperty(\"schemaDefinitions\", finalSchema.definitions, true);\n }\n const self = this as unknown as { _fetchingSchema?: boolean };\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); // Force re-render with resolved schema\n })\n .catch(err => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n MessageToast.show(\"Failed to fetch remote schema\");\n super.setProperty(\"schemaDefinition\", null, true); // Fallback to full inference\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate();\n });\n return; // Abort this render cycle until fetch completes\n }\n\n // 2. Local Plugin Detection (Stringified JSON or Raw Object)\n let schema = schemaRaw;\n if (schema && typeof schema === \"string\" && (schema as string).trim().startsWith(\"{\")) {\n try {\n schema = JSON.parse(schema);\n } catch (e) {\n // Ignore, let standard validation catch it\n }\n }\n\n if (schema && typeof schema === \"object\") {\n const plugin = SchemaBuilderRegistry.getBuilderFor(schema);\n if (plugin) {\n schema = plugin.build(schema, this.getProperty(\"schemaTarget\") as string | undefined);\n // Silently update the wrapper property so the inner host gets the final parsed MetaUI format\n super.setProperty(\"schemaDefinition\", schema, true);\n if ((schema as Record<string, unknown>).definitions) {\n super.setProperty(\"schemaDefinitions\", (schema as Record<string, unknown>).definitions, true);\n }\n }\n }\n\n const dataJson = this.getProperty(\"dataJson\");\n const data = this.getProperty(\"data\");\n\n let hasSchema = !!schema;\n if (hasSchema && typeof schema === \"object\" && Object.keys(schema as Record<string, unknown>).length === 0) {\n hasSchema = false; // Treat empty object as no schema\n }\n\n const hasData = !!dataJson || !!data;\n\n // 3. AI Schema Inference Detection\n if (hasData && this.getProperty(\"inferenceStrategy\") === \"AI\") {\n const self = this as unknown as { _fetchingSchema?: boolean };\n if (self._fetchingSchema) return; // Prevent re-entry\n self._fetchingSchema = true;\n\n let rawDataObj = data;\n if (!rawDataObj && dataJson) {\n try { rawDataObj = JSON.parse(dataJson as string); } catch(e: unknown) { \n const msg = \"Ignored invalid dataJson parse: \" + (e as Error).message;\n Logger.error(\"[DynamicHost]\", msg, \"DynamicHost\"); \n MessageBox.error(msg, { title: \"Invalid JSON Data\" });\n }\n }\n\n if (rawDataObj) {\n BusyIndicator.show(0);\n const proxy = AIConfig.getProxy();\n \n proxy.generateSchema(rawDataObj, schema || undefined)\n .then((generatedSchema: unknown) => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n super.setProperty(\"schemaDefinition\", generatedSchema, true);\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); // Force re-render with the new schema\n })\n .catch((err: Error) => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n Logger.warn(\"[MetaUI DynamicHost]\", \"AI inference failed, falling back to RuleBased. Error: \" + err.message, \"DynamicHost\");\n MessageToast.show(\"AI Inference failed, using fallback.\");\n super.setProperty(\"inferenceStrategy\", \"RuleBased\", true); // Fallback to normal inference\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); \n });\n return; // Abort render cycle until AI is done\n }\n }\n\n Logger.debug(\"[MetaUI DynamicHost]\", `Evaluating boot. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n\n // Only boot if we have either a schema or some data to infer from\n if (hasSchema || hasData) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Booting inner host. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n }\n // The architectural Facade router logic:\n // We've simplified this! We no longer use HostFactory or separate subclasses.\n // GeneratorHost is fully capable of inferring the schema if none is provided.\n this._innerHost = new GeneratorHost();\n\n // 1. Forward all static values to the spawned host BEFORE mounting.\n // Since we no longer use bindProperty, it's perfectly safe to set raw properties before mounting.\n const props = this.getMetadata().getProperties();\n for (const propName in props) {\n if (propName === \"inferenceStrategy\") continue;\n const val = super.getProperty(propName);\n if (val !== null && val !== undefined) {\n if (propName === \"schemaDefinitions\") {\n Logger.debug(`[MetaUI DynamicHost] Proxying schemaDefinitions: ${Object.keys(val)}`, \"\", \"DynamicHost\");\n }\n this._innerHost.setProperty(propName, val);\n } else if (propName === \"schemaDefinitions\") {\n Logger.warn(`[MetaUI DynamicHost] Warning: schemaDefinitions is null/undefined in Wrapper. Defaulting to empty object in GeneratorHost.`, \"\", \"DynamicHost\");\n }\n }\n\n // 2. Mount so it inherits models and triggers lifecycle.\n this.setAggregation(\"_content\", this._innerHost);\n\n // 3. Forward all event subscriptions.\n // By proxying the events upwards, the developer can subscribe to `<meta:DynamicHost submit=\"...\">` \n // and perfectly receive the inner host's submission event.\n const events = this.getMetadata().getEvents();\n for (const eventName in events) {\n this._innerHost.attachEvent(eventName, (oEvent: sap.ui.base.Event) => {\n // Natively push updated payload out to any bound Fiori Element properties.\n // Using super.setProperty prevents an infinite loop back down to _innerHost.\n if (eventName === \"submit\" || eventName === \"fieldChange\") {\n const params = oEvent.getParameters();\n if (params.payload) {\n const isLive = this.getProperty(\"liveUpdate\") === true;\n if (eventName === \"submit\" || isLive) {\n super.setProperty(\"data\", params.payload, true);\n\n const str = params.payloadJson || JSON.stringify(params.payload, null, 2);\n super.setProperty(\"dataJson\", str, true);\n }\n }\n }\n this.fireEvent(eventName, oEvent.getParameters());\n });\n }\n\n this._initializedInner = true;\n }\n }\n }\n\n /**\n * Overrides standard UI5 setProperty to act as a transparent proxy.\n * When a property is updated on the wrapper (either programmatically or via a binding update),\n * it instantly mirrors that value down to the inner instantiated host.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaDefinitions\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Wrapper received setProperty: ${propertyName}`, \"DynamicHost\");\n }\n }\n super.setProperty(propertyName, value, suppressInvalidate);\n if (this._innerHost && propertyName !== \"inferenceStrategy\") {\n this._innerHost.setProperty(propertyName, value, suppressInvalidate);\n } else if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaDefinitions\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `_innerHost not yet initialized when ${propertyName} was set. Booting will happen on next render.`, \"DynamicHost\");\n }\n }\n return this;\n }\n\n\n\n\n\n /**\n * Programmatic API support. Routes dialog commands down to the spawned inner host.\n * If the inner host has not booted yet, it forces initialization immediately.\n * \n * @param {string} [title=\"Form\"] The title of the dialog\n * @param {string} [submitButtonText=\"OK\"] The text for the primary action button\n * @param {string} [cancelButtonText=\"Cancel\"] The text for the cancel button\n * @param {string} [dialogWidth=\"auto\"] The width of the dialog\n * @param {sap.ui.core.Control} [parentView] The parent view to attach the dialog to for model inheritance.\n */\n public openInDialog(title?: string, submitButtonText?: string, cancelButtonText?: string, dialogWidth?: string, parentView?: Control): void {\n if (!this._innerHost) {\n this.onBeforeRendering(); // Force init if they bypassed UI5 rendering\n }\n this._innerHost?.openInDialog(title, submitButtonText, cancelButtonText, dialogWidth, parentView);\n }\n\n /**\n * Proxies submission triggering down to the instantiated generator host.\n * Evaluates the internal Engine validation suite and returns true if structurally sound.\n * \n * @returns {boolean} True if the internal payload passes schema validation, false otherwise.\n */\n public triggerSubmit(): boolean {\n if (!this._innerHost) {\n return false;\n }\n return this._innerHost.triggerSubmit();\n }\n\n /**\n * Injects a custom error message onto a specific field.\n * Useful for injecting custom backend validation errors.\n * \n * @param {string} fieldPath The schema key path to target.\n * @param {string} message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n const inner = this._innerHost as unknown as { addCustomError?: (p: string, m: string) => void };\n if (inner && typeof inner.addCustomError === \"function\") {\n inner.addCustomError(fieldPath, message);\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n * \n * @param {string} fieldPath The schema key path to target.\n */\n public clearCustomError(fieldPath: string): void {\n const inner = this._innerHost as unknown as { clearCustomError?: (p: string) => void };\n if (inner && typeof inner.clearCustomError === \"function\") {\n inner.clearCustomError(fieldPath);\n }\n }\n\n /**\n * Overrides standard UI5 getProperty to transparently pull extracted data from the inner host.\n * Ensures that querying the DynamicHost facade for `data` always yields the freshest payload.\n * \n * @param {string} propertyName The name of the property to retrieve\n * @returns {unknown} The property value\n */\n public getProperty(propertyName: string): unknown {\n if (propertyName === \"outputData\") {\n propertyName = \"data\"; // Forward deprecated outputData to data\n }\n if (this._innerHost && (propertyName === \"data\" || propertyName === \"dataJson\")) {\n return this._innerHost.getProperty(propertyName);\n }\n return super.getProperty(propertyName);\n }\n}\n"],"mappings":"oYAEOA,EAAaC,EAAAC,GAAA,MACXC,EAAMC,EAAA,gBACNC,EAAaC,EAAA,uBAEbC,EAAqBC,EAAA,+BAIrBC,EAAcC,EAAA,wBACdC,EAAQC,EAAA,YAEjB,MASqBC,EAAoBC,EAAOC,OAAA,mDAAAC,YAAA,SAAAA,IAAAF,EAAAG,UAAAD,YAAAE,MAAAC,KAAAC,WAAAD,KACpCE,cAAsC,KAsE9CF,KAIQG,WAAmC,KAE3CH,KAIQI,kBAA6B,KAAK,EA3BnCC,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,GAjEYC,SAAW,CACvBC,WAAY,CACRC,iBAAkB,CAAEC,KAAM,MAAOC,aAAc,MAC/CC,kBAAmB,CAAEF,KAAM,SAAUC,aAAc,MACnDE,aAAc,CAAEH,KAAM,SAAUC,aAAc,MAC9CG,eAAgB,CAAEJ,KAAM,SAAUC,aAAc,MAChDI,sBAAuB,CAAEL,KAAM,SAAUC,aAAc,MACvDK,KAAM,CAAEN,KAAM,SAAUC,aA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AA6D,cAC7I,CACJ,CACA,OAAOjJ,IACX,EAgBOmJ,aAAY,SAAAC,EAAC5B,EAAgB6B,EAA2BC,EAA2BC,EAAsBC,GAC5G,IAAKxJ,KAAKG,WAAY,CAClBH,KAAKsF,mBACT,CACAtF,KAAKG,YAAYgJ,aAAa3B,EAAO6B,EAAkBC,EAAkBC,EAAaC,EAC1F,EAQOC,cAAa,SAAAC,IAChB,IAAK1J,KAAKG,WAAY,CAClB,OAAO,KACX,CACA,OAAOH,KAAKG,WAAWsJ,eAC3B,EASOE,eAAc,SAAAC,EAACzG,EAAmBI,GACrC,MAAMsG,EAAQ7J,KAAKG,WACnB,GAAI0J,UAAgBA,EAAMF,iBAAmB,WAAY,CACrDE,EAAMF,eAAexG,EAAWI,EACpC,CACJ,EAOOuG,iBAAgB,SAAAC,EAAC5G,GACpB,MAAM0G,EAAQ7J,KAAKG,WACnB,GAAI0J,UAAgBA,EAAMC,mBAAqB,WAAY,CACvDD,EAAMC,iBAAiB3G,EAC3B,CACJ,EASOsC,YAAW,SAAAuE,EAACf,GACf,GAAIA,IAAiB,aAAc,CAC/BA,EAAe,MACnB,CACA,GAAIjJ,KAAKG,aAAe8I,IAAiB,QAAUA,IAAiB,YAAa,CAC7E,OAAOjJ,KAAKG,WAAWsF,YAAYwD,EACvC,CACA,OAAAd,6BAAAnI,KAAyBiJ,EAC7B,IAAC,OAxagBvJ,CAAW","ignoreList":[]}
1
+ {"version":3,"file":"DynamicHost.js","names":["GeneratorHost","_interopRequireDefault","__GeneratorHost","Logger","___utils_Logger","ODataDelegate","___host_delegates_ODataDelegate","SchemaBuilderRegistry","___core_SchemaBuilderRegistry","SchemaProvider","___services_SchemaProvider","AIConfig","___ai_AIConfig","DynamicHost","Control","extend","constructor","prototype","apply","this","arguments","odataDelegate","_innerHost","_initializedInner","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","schemaDefinitions","schemaTarget","pluginRegistry","schemaBuilderRegistry","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","layoutBudget","inferenceStrategy","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","beforeLayoutSectionChange","stepIndex","resumeNavigation","initODataDelegate","_initODataDelegate","getBindingInfo","dataBinding","path","oContext","getBindingContext","debug","getPath","requestObject","syncToEngine","Object","keys","setBindingContext","_setBindingContext","sModelName","Control.prototype.setBindingContext.call","bindElement","_bindElement","vPath","mParameters","Control.prototype.bindElement.call","model","undefined","oBinding","getElementBinding","attachChange","onBeforeRendering","_onBeforeRendering","schemaRaw","getProperty","startsWith","self","_fetchingSchema","BusyIndicator","show","resolve","then","json","plugin","getBuilderFor","finalSchema","build","Control.prototype.setProperty.call","definitions","hide","invalidate","catch","err","MessageToast","schema","trim","JSON","parse","e","hasSchema","length","hasData","rawDataObj","msg","MessageBox","title","proxy","getProxy","generateSchema","generatedSchema","warn","props","getMetadata","getProperties","propName","val","Control.prototype.getProperty.call","setProperty","setAggregation","getEvents","eventName","attachEvent","oEvent","params","getParameters","isLive","str","stringify","fireEvent","_setProperty","propertyName","suppressInvalidate","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","triggerSubmit","_triggerSubmit","addCustomError","_addCustomError","inner","clearCustomError","_clearCustomError","_getProperty"],"sources":["DynamicHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport GeneratorHost from \"./host/GeneratorHost\";\nimport { Logger } from \"../utils/Logger\";\nimport { ODataDelegate } from \"./host/delegates/ODataDelegate\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport { SchemaBuilderRegistry } from \"../core/SchemaBuilderRegistry\";\nimport BusyIndicator from \"sap/ui/core/BusyIndicator\";\nimport MessageToast from \"sap/m/MessageToast\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport { SchemaProvider } from \"../services/SchemaProvider\";\nimport { AIConfig } from \"../ai/AIConfig\";\n\n/**\n * A transparent wrapper control (Facade) that automatically chooses between Explicit Schema Mode \n * and Inference Mode based on the presence of a 'schemaDefinition'.\n * \n * This maintains total architectural separation of the modes without forcing developers to \n * use different XML tags.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls\n */\nexport default class DynamicHost extends Control {\n private odataDelegate: ODataDelegate | null = null;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n schemaDefinitions: { type: \"object\", defaultValue: null },\n schemaTarget: { type: \"string\", defaultValue: null },\n pluginRegistry: { type: \"object\", defaultValue: null },\n schemaBuilderRegistry: { type: \"object\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true },\n layoutBudget: { type: \"int\", defaultValue: 0 },\n inferenceStrategy: { type: \"string\", defaultValue: \"RuleBased\" }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } },\n error: { parameters: { message: { type: \"string\" }, exception: { type: \"object\" } } },\n /**\n * Forwarded transparently from the inner GeneratorHost via the event proxy loop.\n * Fired by WizardLayout when the user navigates to a new Wizard step.\n * See GeneratorHost.metadata for full parameter documentation.\n */\n beforeLayoutSectionChange: {\n parameters: {\n stepIndex: { type: \"int\" },\n payload: { type: \"object\" },\n preventDefault: { type: \"function\" },\n addError: { type: \"function\" },\n resumeNavigation: { type: \"function\" }\n }\n }\n }\n };\n\n static renderer = {\n apiVersion: 2,\n render(rm: RenderManager, control: DynamicHost) {\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 * Internal reference to the generated inner host instance.\n * @private\n */\n private _innerHost: GeneratorHost | null = null;\n\n /**\n * Flag indicating if the inner host has been initialized.\n * @private\n */\n private _initializedInner: boolean = false;\n\n /**\n * Initializes the OData Delegate if an OData context is detected.\n * This allows DynamicHost to seamlessly synchronize metadata and properties from an OData model.\n * @private\n */\n private initODataDelegate(): void {\n if (!this.odataDelegate) {\n // Guard: If the user explicitly bound dataJson, do not steal the context.\n if (this.getBindingInfo(\"dataJson\")) {\n return;\n }\n\n // Guard: If the user explicitly bound 'data' to a specific property path, do not steal the context.\n const dataBinding = this.getBindingInfo(\"data\") as Record<string, unknown> | undefined;\n if (dataBinding && dataBinding.path && dataBinding.path !== \"\") {\n return;\n }\n\n const oContext = this.getBindingContext(\"odata\") || this.getBindingContext();\n if (oContext) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context found for delegate initialization: ${oContext.getPath()}`, \"DynamicHost\");\n if (oContext && (oContext as ODataV4Context).requestObject && typeof (oContext as ODataV4Context).requestObject === \"function\") {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context supports requestObject/getObject. Instantiating ODataDelegate.`, \"DynamicHost\");\n this.odataDelegate = new ODataDelegate(this, oContext as ODataV4Context);\n this.odataDelegate.syncToEngine();\n } else {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context does NOT support requestObject/getObject! Keys: ${Object.keys(oContext)}`, \"DynamicHost\");\n }\n }\n }\n }\n\n /**\n * Standard UI5 method override.\n * Sets the binding context for the control and attempts to initialize the OData delegate\n * if the context points to an OData model.\n * \n * @param {sap.ui.model.Context | null | undefined} oContext The binding context object\n * @param {string} [sModelName] Optional model name\n * @returns {this} The control instance for chaining\n */\n public setBindingContext(oContext: unknown, sModelName?: string): this {\n super.setBindingContext(oContext as sap.ui.model.Context, sModelName);\n this.initODataDelegate();\n return this;\n }\n\n /**\n * Standard UI5 method override.\n * Binds the element to the given path and attaches a change listener to re-evaluate\n * the OData delegate when the element binding resolves.\n * \n * @param {string | Record<string, unknown>} vPath The binding path or configuration object\n * @param {object} [mParameters] Optional mapping parameters\n * @returns {this} Reference to this instance for chaining\n */\n public bindElement(vPath: unknown, mParameters?: object): this {\n super.bindElement(vPath as string | { path: string }, mParameters);\n const sModelName = typeof vPath === \"object\" ? vPath.model : undefined;\n const oBinding = this.getElementBinding(sModelName);\n if (oBinding) {\n oBinding.attachChange(() => {\n this.initODataDelegate();\n });\n }\n return this;\n }\n\n /**\n * Standard UI5 Lifecycle Hook.\n * Evaluates the initial properties and spawns the GeneratorHost.\n * It handles the complex lifecycle task of copying all bindings, raw properties, and event listeners \n * down to the inner host perfectly transparently.\n */\n public onBeforeRendering(): void {\n Logger.debug(\"[MetaUI DynamicHost]\", `onBeforeRendering called. _initializedInner: ${this._initializedInner}`, \"DynamicHost\");\n\n this.initODataDelegate();\n\n if (!this._initializedInner) {\n let schemaRaw = this.getProperty(\"schemaDefinition\");\n\n if (typeof schemaRaw === \"string\" && (schemaRaw.startsWith(\"http://\") || schemaRaw.startsWith(\"https://\"))) {\n const self = this as unknown as { _fetchingSchema?: boolean };\n if (self._fetchingSchema) return; // Prevent re-entry\n self._fetchingSchema = true;\n \n BusyIndicator.show(0);\n SchemaProvider.resolve(schemaRaw)\n .then(json => {\n const plugin = SchemaBuilderRegistry.getBuilderFor(json);\n const finalSchema = plugin ? plugin.build(json, this.getProperty(\"schemaTarget\") as string | undefined) : json;\n super.setProperty(\"schemaDefinition\", finalSchema, true);\n if (finalSchema.definitions) {\n super.setProperty(\"schemaDefinitions\", finalSchema.definitions, true);\n }\n const self = this as unknown as { _fetchingSchema?: boolean };\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); // Force re-render with resolved schema\n })\n .catch(err => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n MessageToast.show(\"Failed to fetch remote schema\");\n super.setProperty(\"schemaDefinition\", null, true); // Fallback to full inference\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate();\n });\n return; // Abort this render cycle until fetch completes\n }\n\n // 2. Local Plugin Detection (Stringified JSON or Raw Object)\n let schema = schemaRaw;\n if (schema && typeof schema === \"string\" && (schema as string).trim().startsWith(\"{\")) {\n try {\n schema = JSON.parse(schema);\n } catch (e) {\n // Ignore, let standard validation catch it\n }\n }\n\n if (schema && typeof schema === \"object\") {\n const plugin = SchemaBuilderRegistry.getBuilderFor(schema);\n if (plugin) {\n schema = plugin.build(schema, this.getProperty(\"schemaTarget\") as string | undefined);\n // Silently update the wrapper property so the inner host gets the final parsed MetaUI format\n super.setProperty(\"schemaDefinition\", schema, true);\n if ((schema as Record<string, unknown>).definitions) {\n super.setProperty(\"schemaDefinitions\", (schema as Record<string, unknown>).definitions, true);\n }\n }\n }\n\n const dataJson = this.getProperty(\"dataJson\");\n const data = this.getProperty(\"data\");\n\n let hasSchema = !!schema;\n if (hasSchema && typeof schema === \"object\" && Object.keys(schema as Record<string, unknown>).length === 0) {\n hasSchema = false; // Treat empty object as no schema\n }\n\n const hasData = !!dataJson || !!data;\n\n // 3. AI Schema Inference Detection\n if (hasData && this.getProperty(\"inferenceStrategy\") === \"AI\") {\n const self = this as unknown as { _fetchingSchema?: boolean };\n if (self._fetchingSchema) return; // Prevent re-entry\n self._fetchingSchema = true;\n\n let rawDataObj = data;\n if (!rawDataObj && dataJson) {\n try { rawDataObj = JSON.parse(dataJson as string); } catch(e: unknown) { \n const msg = \"Ignored invalid dataJson parse: \" + (e as Error).message;\n Logger.error(\"[DynamicHost]\", msg, \"DynamicHost\"); \n MessageBox.error(msg, { title: \"Invalid JSON Data\" });\n }\n }\n\n if (rawDataObj) {\n BusyIndicator.show(0);\n const proxy = AIConfig.getProxy();\n \n proxy.generateSchema(rawDataObj, schema || undefined)\n .then((generatedSchema: unknown) => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n super.setProperty(\"schemaDefinition\", generatedSchema, true);\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); // Force re-render with the new schema\n })\n .catch((err: Error) => {\n const self = this as unknown as { _fetchingSchema?: boolean };\n Logger.warn(\"[MetaUI DynamicHost]\", \"AI inference failed, falling back to RuleBased. Error: \" + err.message, \"DynamicHost\");\n MessageToast.show(\"AI Inference failed, using fallback.\");\n super.setProperty(\"inferenceStrategy\", \"RuleBased\", true); // Fallback to normal inference\n self._fetchingSchema = false;\n BusyIndicator.hide();\n this.invalidate(); \n });\n return; // Abort render cycle until AI is done\n }\n }\n\n Logger.debug(\"[MetaUI DynamicHost]\", `Evaluating boot. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n\n // Only boot if we have either a schema or some data to infer from\n if (hasSchema || hasData) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Booting inner host. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n }\n // The architectural Facade router logic:\n // We've simplified this! We no longer use HostFactory or separate subclasses.\n // GeneratorHost is fully capable of inferring the schema if none is provided.\n this._innerHost = new GeneratorHost();\n\n // 1. Forward all static values to the spawned host BEFORE mounting.\n // Since we no longer use bindProperty, it's perfectly safe to set raw properties before mounting.\n const props = this.getMetadata().getProperties();\n for (const propName in props) {\n if (propName === \"inferenceStrategy\") continue;\n const val = super.getProperty(propName);\n if (val !== null && val !== undefined) {\n if (propName === \"schemaDefinitions\") {\n Logger.debug(`[MetaUI DynamicHost] Proxying schemaDefinitions: ${Object.keys(val)}`, \"\", \"DynamicHost\");\n }\n this._innerHost.setProperty(propName, val);\n } else if (propName === \"schemaDefinitions\") {\n Logger.warn(`[MetaUI DynamicHost] Warning: schemaDefinitions is null/undefined in Wrapper. Defaulting to empty object in GeneratorHost.`, \"\", \"DynamicHost\");\n }\n }\n\n // 2. Mount so it inherits models and triggers lifecycle.\n this.setAggregation(\"_content\", this._innerHost);\n\n // 3. Forward all event subscriptions.\n // By proxying the events upwards, the developer can subscribe to `<meta:DynamicHost submit=\"...\">` \n // and perfectly receive the inner host's submission event.\n const events = this.getMetadata().getEvents();\n for (const eventName in events) {\n this._innerHost.attachEvent(eventName, (oEvent: sap.ui.base.Event) => {\n // Natively push updated payload out to any bound Fiori Element properties.\n // Using super.setProperty prevents an infinite loop back down to _innerHost.\n if (eventName === \"submit\" || eventName === \"fieldChange\") {\n const params = oEvent.getParameters();\n if (params.payload) {\n const isLive = this.getProperty(\"liveUpdate\") === true;\n if (eventName === \"submit\" || isLive) {\n super.setProperty(\"data\", params.payload, true);\n\n const str = params.payloadJson || JSON.stringify(params.payload, null, 2);\n super.setProperty(\"dataJson\", str, true);\n }\n }\n }\n this.fireEvent(eventName, oEvent.getParameters());\n });\n }\n\n this._initializedInner = true;\n }\n }\n }\n\n /**\n * Overrides standard UI5 setProperty to act as a transparent proxy.\n * When a property is updated on the wrapper (either programmatically or via a binding update),\n * it instantly mirrors that value down to the inner instantiated host.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaDefinitions\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Wrapper received setProperty: ${propertyName}`, \"DynamicHost\");\n }\n }\n super.setProperty(propertyName, value, suppressInvalidate);\n if (this._innerHost && propertyName !== \"inferenceStrategy\") {\n this._innerHost.setProperty(propertyName, value, suppressInvalidate);\n } else if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaDefinitions\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `_innerHost not yet initialized when ${propertyName} was set. Booting will happen on next render.`, \"DynamicHost\");\n }\n }\n return this;\n }\n\n\n\n\n\n /**\n * Programmatic API support. Routes dialog commands down to the spawned inner host.\n * If the inner host has not booted yet, it forces initialization immediately.\n * \n * @param {string} [title=\"Form\"] The title of the dialog\n * @param {string} [submitButtonText=\"OK\"] The text for the primary action button\n * @param {string} [cancelButtonText=\"Cancel\"] The text for the cancel button\n * @param {string} [dialogWidth=\"auto\"] The width of the dialog\n * @param {sap.ui.core.Control} [parentView] The parent view to attach the dialog to for model inheritance.\n */\n public openInDialog(title?: string, submitButtonText?: string, cancelButtonText?: string, dialogWidth?: string, parentView?: Control): void {\n if (!this._innerHost) {\n this.onBeforeRendering(); // Force init if they bypassed UI5 rendering\n }\n this._innerHost?.openInDialog(title, submitButtonText, cancelButtonText, dialogWidth, parentView);\n }\n\n /**\n * Proxies submission triggering down to the instantiated generator host.\n * Evaluates the internal Engine validation suite and returns true if structurally sound.\n * \n * @returns {boolean} True if the internal payload passes schema validation, false otherwise.\n */\n public triggerSubmit(): boolean {\n if (!this._innerHost) {\n return false;\n }\n return this._innerHost.triggerSubmit();\n }\n\n /**\n * Injects a custom error message onto a specific field.\n * Useful for injecting custom backend validation errors.\n * \n * @param {string} fieldPath The schema key path to target.\n * @param {string} message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n const inner = this._innerHost as unknown as { addCustomError?: (p: string, m: string) => void };\n if (inner && typeof inner.addCustomError === \"function\") {\n inner.addCustomError(fieldPath, message);\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n * \n * @param {string} fieldPath The schema key path to target.\n */\n public clearCustomError(fieldPath: string): void {\n const inner = this._innerHost as unknown as { clearCustomError?: (p: string) => void };\n if (inner && typeof inner.clearCustomError === \"function\") {\n inner.clearCustomError(fieldPath);\n }\n }\n\n /**\n * Overrides standard UI5 getProperty to transparently pull extracted data from the inner host.\n * Ensures that querying the DynamicHost facade for `data` always yields the freshest payload.\n * \n * @param {string} propertyName The name of the property to retrieve\n * @returns {unknown} The property value\n */\n public getProperty(propertyName: string): unknown {\n if (propertyName === \"outputData\") {\n propertyName = \"data\"; // Forward deprecated outputData to data\n }\n if (this._innerHost && (propertyName === \"data\" || propertyName === \"dataJson\")) {\n return this._innerHost.getProperty(propertyName);\n }\n return super.getProperty(propertyName);\n }\n}\n"],"mappings":"oYAEOA,EAAaC,EAAAC,GAAA,MACXC,EAAMC,EAAA,gBACNC,EAAaC,EAAA,uBAEbC,EAAqBC,EAAA,+BAIrBC,EAAcC,EAAA,wBACdC,EAAQC,EAAA,YAEjB,MASqBC,EAAoBC,EAAOC,OAAA,mDAAAC,YAAA,SAAAA,IAAAF,EAAAG,UAAAD,YAAAE,MAAAC,KAAAC,WAAAD,KACpCE,cAAsC,KAoF9CF,KAIQG,WAAmC,KAE3CH,KAIQI,kBAA6B,KAAK,EA3BnCC,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,GA/EYC,SAAW,CACvBC,WAAY,CACRC,iBAAkB,CAAEC,KAAM,MAAOC,aAAc,MAC/CC,kBAAmB,CAAEF,KAAM,SAAUC,aAAc,MACnDE,aAAc,CAAEH,KAAM,SAAU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Changed: { parameters: { isValid: { type: "boolean" } } },
71
71
  validationError: { parameters: { fieldPath: { type: "string" }, message: { type: "string" } } },
72
72
  validationSuccess: { parameters: { fieldPath: { type: "string" } } },
73
- error: { parameters: { message: { type: "string" }, exception: { type: "object" } } }
73
+ error: { parameters: { message: { type: "string" }, exception: { type: "object" } } },
74
+ /**
75
+ * Forwarded transparently from the inner GeneratorHost via the event proxy loop.
76
+ * Fired by WizardLayout when the user navigates to a new Wizard step.
77
+ * See GeneratorHost.metadata for full parameter documentation.
78
+ */
79
+ beforeLayoutSectionChange: {
80
+ parameters: {
81
+ stepIndex: { type: "int" },
82
+ payload: { type: "object" },
83
+ preventDefault: { type: "function" },
84
+ addError: { type: "function" },
85
+ resumeNavigation: { type: "function" }
86
+ }
87
+ }
74
88
  }
75
89
  };
76
90
 
@@ -184,6 +184,40 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
184
184
  type: "object"
185
185
  }
186
186
  }
187
+ },
188
+ /**
189
+ * Fired by the WizardLayout immediately when the user presses the "Next Step" button,
190
+ * before the layout physically transitions to the next step. Provides a structured hook
191
+ * for consumers to perform per-step validation, including asynchronous backend checks,
192
+ * and optionally block or resume the navigation.
193
+ *
194
+ * Parameters:
195
+ * - `stepIndex` {int}: The 0-based index of the step the user is navigating AWAY FROM.
196
+ * - `payload` {object}: A live snapshot of the full form payload at transition time.
197
+ * - `preventDefault` {function}: Blocks navigation synchronously. Call this immediately if you need to wait for an async check.
198
+ * - `addError` {function(fieldPath: string, errorMessage: string)}: Blocks navigation
199
+ * and paints the specified field with a validation error state.
200
+ * - `resumeNavigation` {function}: Explicitly allows navigation after a prior `preventDefault()` call.
201
+ * Causes the wizard to advance to the next step immediately.
202
+ */
203
+ beforeLayoutSectionChange: {
204
+ parameters: {
205
+ stepIndex: {
206
+ type: "int"
207
+ },
208
+ payload: {
209
+ type: "object"
210
+ },
211
+ preventDefault: {
212
+ type: "function"
213
+ },
214
+ addError: {
215
+ type: "function"
216
+ },
217
+ resumeNavigation: {
218
+ type: "function"
219
+ }
220
+ }
187
221
  }
188
222
  }
189
223
  },