@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.
- package/package.json +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +24 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts +24 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +15 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +34 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts +34 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +25 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +31 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +38 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine-dbg.js +15 -96
- package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.d.ts +1 -6
- package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PolicyEngine.ts +20 -100
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +2 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +2 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout-dbg.js +327 -67
- package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.d.ts +57 -15
- package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.ts +375 -65
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js +7 -7
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +10 -15
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts +4 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +10 -15
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js +11 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.ts +10 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorHost.js","names":["Logger","____utils_Logger","SchemaNormalizer","____core_SchemaNormalizer","SchemaValidator","____core_SchemaValidator","Engine","____core_Engine","StateManager","____core_StateManager","PolicyEngine","____core_PolicyEngine","DataSyncDelegate","___delegates_DataSyncDelegate","ValidationDelegate","___delegates_ValidationDelegate","DialogDelegate","___delegates_DialogDelegate","PluginRegistry","____core_PluginRegistry","LayoutScorer","____core_LayoutScorer","LayoutMutator","____core_LayoutMutator","DefaultLayoutGenerator","____core_DefaultLayoutGenerator","GeneratorHost","Control","extend","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","engineScopeId","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","this","stateManager","generatedContent","engine","policyEngine","policyDebounceTimer","activeModelName","parsedSchema","_generatePromise","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","getStateManager","_getStateManager","getSchemaDefinition","_getSchemaDefinition","refPath","defs","getProperty","undefined","key","startsWith","substring","tearDownGeneratedLayout","_tearDownGeneratedLayout","unregisterObject","destroy","_onInternalFieldChange","fieldKey","errorMessage","controlId","extractPayload","debug","pushToBindings","currentValidity","fireEvent","clearTimeout","setTimeout","evaluatePolicies","_evaluatePolicies","deltas","evaluate","delta","plugin","getPluginByPath","target","property","applyVisibility","reportPolicyError","applyRequired","applyEditable","exit","_exit","getModel","getParsedSchema","_getParsedSchema","onBeforeRendering","_onBeforeRendering","hasSchema","hasData","generate","msg","Error","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","errors","validateAll","length","pushMessage","err","fieldLabel","JSON","stringify","propertyPath","setVisualValidationState","addCustomError","_addCustomError","clearCustomError","_clearCustomError","schemaValid","validate","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty","propertyName","suppressInvalidate","setUseMessageManager","handleInputDataHotSwap","currentVal","Control.prototype.setProperty.call","setBaseProperty","_setBaseProperty","async","_generate","Promise","resolve","then","_doGenerate","e","internalPayload","rawSchema","parse","isSchemaEmpty","Object","keys","inputData","inputDataJson","dataParseError","finalData","schemaToNormalize","normalizedSchema","normalize","uiPolicies","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","rawDefinitions","parsedRawSchema","trim","definitions","assign","normalizedDefinitions","warn","budget","ensureLayout","apply","activePluginRegistry","getInstance","pathsToLoad","getPathsToLoad","needsNetworkLoad","Array","from","some","path","sap","ui","require","preloadDependencies","injectSchemaDefaults","getId","setModel","isEditable","host","build","contentContainer","hasProperties","strip","MessageStrip","text","showIcon","showCloseButton","addStyleClass","VBox","items","insertItem","insertContent","hasPartialRenderingErrors","setAggregation","registerObject","calculateAndApplyOptimalWidth","mountCrashBoundary","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","isGenerated"],"sources":["GeneratorHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport { Logger } from \"../../utils/Logger\";\nimport { SchemaNormalizer } from \"../../core/SchemaNormalizer\";\nimport { SchemaValidator } from \"../../core/SchemaValidator\";\nimport { Engine } from \"../../core/Engine\";\nimport { StateManager } from \"../../core/StateManager\";\nimport { PolicyEngine } from \"../../core/PolicyEngine\";\nimport { DataSyncDelegate } from \"./delegates/DataSyncDelegate\";\nimport { ValidationDelegate } from \"./delegates/ValidationDelegate\";\nimport { DialogDelegate } from \"./delegates/DialogDelegate\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport MessageStrip from \"sap/m/MessageStrip\";\nimport VBox from \"sap/m/VBox\";\nimport { PluginRegistry } from \"../../core/PluginRegistry\";\nimport { LayoutScorer } from \"../../core/LayoutScorer\";\nimport { LayoutMutator } from \"../../core/LayoutMutator\";\nimport { DefaultLayoutGenerator } from \"../../core/DefaultLayoutGenerator\";\nimport type { ISchema } from \"../../interfaces/ISchema\";\n\n/**\n * Base wrapper element for embedding the dynamic form natively via Explicit Schemas.\n * \n * This class serves as the core rendering engine for standard MetaUI implementations.\n * It manages the lifecycle of the Engine, StateManager, and the delegation of \n * data synchronization, validation, and dialog interactions.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls.host\n */\nexport default class GeneratorHost extends Control {\n\n protected stateManager: StateManager | null = null;\n protected generatedContent: Control | null = null;\n /** The embedded engine responsible for rendering the UI controls */\n protected engine: Engine | null = null;\n \n /** \n * The Policy-Based Rules Engine.\n * Continuously evaluates declarative cross-field rules and pushes visual/structural mutations down into the plugins.\n */\n protected policyEngine: PolicyEngine | null = null;\n \n private policyDebounceTimer: any = null;\n protected activeModelName: string = \"\";\n\n protected dataSyncDelegate!: DataSyncDelegate;\n protected validationDelegate!: ValidationDelegate;\n protected dialogDelegate!: DialogDelegate;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n schemaDefinitions: { type: \"object\", defaultValue: {} },\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 engineScopeId: { type: \"string\", defaultValue: null }\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: GeneratorHost) {\n rm.openStart(\"div\", control);\n rm.style(\"width\", \"100%\");\n rm.style(\"height\", \"100%\");\n rm.openEnd();\n\n const content = control.getAggregation(\"_content\") as Control;\n if (content) {\n rm.renderControl(content);\n }\n\n rm.close(\"div\");\n }\n };\n\n /**\n * Standard UI5 Constructor.\n */\n constructor(idOrSettings?: string | object, settings?: object) {\n super(idOrSettings as string, settings);\n }\n\n /**\n * Initializes the control and instantiates the composition delegates.\n * Delegates must be initialized here rather than in the constructor so they are \n * available before `applySettings` runs during UI5's control lifecycle.\n */\n public init(): void {\n super.init();\n\n // Initialize Composition Delegates\n this.dataSyncDelegate = new DataSyncDelegate(this);\n this.validationDelegate = new ValidationDelegate(this);\n this.dialogDelegate = new DialogDelegate(this as any);\n\n this.onInternalFieldChange = this.onInternalFieldChange.bind(this);\n }\n\n /**\n * Enables or disables debug mode.\n */\n public setDebugMode(enabled: boolean): this {\n this.setProperty(\"debugMode\", enabled, true);\n Logger.setDebugMode(enabled);\n return this;\n }\n\n\n /**\n * Returns the active state manager instance managing the JSON payload.\n */\n public getStateManager(): StateManager | null {\n return this.stateManager;\n }\n\n /**\n * Resolves a reference pointer against the global schema definitions dictionary.\n * @param refPath The string reference path (e.g., \"#/definitions/User\")\n * @returns The resolved ISchema or undefined\n */\n public getSchemaDefinition(refPath: string): ISchema | undefined {\n const defs = this.getProperty(\"schemaDefinitions\") as Record<string, ISchema>;\n if (!defs || !refPath) return undefined;\n let key = refPath;\n if (key.startsWith(\"#/definitions/\")) {\n key = key.substring(14);\n } else if (key.startsWith(\"#/components/schemas/\")) {\n key = key.substring(21);\n }\n return defs[key];\n }\n\n /**\n * Safely destroys the currently generated UI tree and cleans up references.\n * This is called before every regeneration to prevent memory leaks.\n */\n public tearDownGeneratedLayout(): void {\n if (this.generatedContent) {\n this.validationDelegate.unregisterObject(this.generatedContent);\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /**\n * Internal event handler triggered by the Engine when a field value changes.\n * Coordinates LiveUpdate syncs, validation state tracking, and bubbling the change upwards.\n */\n protected onInternalFieldChange(isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string): void {\n const payload = this.stateManager ? this.stateManager.extractPayload() : {};\n\n if (this.getProperty(\"liveUpdate\") === true) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"liveUpdate is enabled, pushing outbound payload.\", \"GeneratorHost\");\n }\n this.dataSyncDelegate.pushToBindings(payload);\n }\n\n const currentValidity = this.getProperty(\"isValid\") as boolean;\n if (isValid !== currentValidity) {\n this.setProperty(\"isValid\", isValid, true);\n this.fireEvent(\"validationStateChanged\", { isValid });\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `Validation state shifted to: ${isValid}`, \"GeneratorHost\");\n }\n }\n\n this.fireEvent(\"fieldChange\", {\n fieldPath: fieldKey || \"\",\n value: undefined,\n payload: payload,\n isValid: isValid\n });\n\n // Trigger PBRE Live Evaluation\n if (this.policyEngine && fieldKey) {\n if (this.policyDebounceTimer) clearTimeout(this.policyDebounceTimer);\n this.policyDebounceTimer = setTimeout(() => {\n this.evaluatePolicies();\n }, 200);\n }\n }\n\n /**\n * Executes the PBRE policy evaluations and orchestrates the delta updates to the UI plugins.\n * Acts as the bridge between the headless PolicyEngine calculations and the physical UI5 plugins.\n * \n * @param changedPath The specific JSON path that triggered the evaluation (used for incremental sweeps).\n * If undefined, a full engine sweep is performed (e.g. during initial render or manual submit).\n */\n private evaluatePolicies(): void {\n if (!this.policyEngine || !this.stateManager || !this.engine) return;\n const payload = this.stateManager.extractPayload();\n const deltas = this.policyEngine.evaluate(payload);\n for (const delta of deltas) {\n const plugin = this.engine.getPluginByPath(delta.target);\n if (plugin) {\n // Systemic Failsafe: State Pruning on Hide/Disable\n if ((delta.property === \"visibility\" || delta.property === \"editable\") && delta.value === false) {\n this.stateManager.setProperty(delta.target, undefined); \n }\n\n switch (delta.property) {\n case \"visibility\": \n if (plugin.applyVisibility) plugin.applyVisibility(delta.value);\n break;\n case \"validity\":\n if (delta.value) {\n this.engine.reportPolicyError(delta.target, null);\n } else {\n this.engine.reportPolicyError(delta.target, delta.errorMessage || \"Validation failed by policy\");\n }\n break;\n case \"required\":\n if (plugin.applyRequired) plugin.applyRequired(delta.value);\n break;\n case \"editable\":\n if (plugin.applyEditable) plugin.applyEditable(delta.value);\n break;\n }\n }\n }\n }\n\n /**\n * Standard UI5 Exit Hook. Ensures complete teardown of the engine and state manager.\n */\n public exit(): void {\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n if (this.generatedContent) {\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /** Cached schema for intelligent diffing during inference mode hot-swaps */\n protected parsedSchema: Record<string, unknown> | null = null;\n\n /**\n * Exposes the parsed schema to the DataSyncDelegate for diffing.\n */\n public getParsedSchema(): Record<string, unknown> | null {\n return this.parsedSchema;\n }\n\n /**\n * Standard UI5 Rendering Hook.\n * Evaluates whether it possesses a schema or data. If so, triggers the internal engine generation.\n */\n public onBeforeRendering(): void {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI GeneratorHost]\", `onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty(\"schemaDefinition\")}, data exists = ${!!this.getProperty(\"data\")}, dataJson exists = ${!!this.getProperty(\"dataJson\")}`, \"GeneratorHost\");\n }\n\n if (!this.generatedContent) {\n const hasSchema = !!this.getProperty(\"schemaDefinition\");\n const hasData = !!this.getProperty(\"dataJson\") || !!this.getProperty(\"data\");\n\n if (hasSchema || hasData) {\n this.generate();\n } else {\n const msg = \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg); // Eradicate silent errors\n }\n }\n }\n\n /**\n * Public API method to manually trigger form submission.\n * Executes all structural validations, clears old messages, and pushes payload to bindings.\n * @returns boolean True if submission succeeded, false if validation failed.\n */\n public triggerSubmit(): boolean {\n if (this.stateManager && this.engine) {\n let isPrevented = false;\n\n this.validationDelegate.removeAllMessages();\n\n // Run PBRE Full Sweep before validation to ensure visibility states are perfect\n if (this.policyEngine) {\n this.evaluatePolicies();\n }\n\n // PBRE Architecture Rule 12: Controls are deliberately isolated from UI5's native \n // MessageManager auto-sync. We must explicitly instruct plugins to paint their \n // visual red borders (ValueState) manually during a full form submission sweep.\n const errors = this.engine.validateAll(true);\n if (errors.length > 0) {\n if (this.getProperty(\"useMessageManager\") === true) {\n this.validationDelegate.pushMessage(\"\", \"One or more fields failed schema validation. Please review the highlighted fields.\");\n }\n for (const err of errors) {\n if (err.fieldKey && err.errorMessage) {\n this.validationDelegate.pushMessage(err.fieldKey, err.errorMessage, err.fieldLabel);\n }\n }\n return false;\n }\n\n const payload = this.stateManager.extractPayload();\n const payloadJson = JSON.stringify(payload);\n\n this.fireEvent(\"beforeSubmit\", {\n payload,\n preventDefault: () => { isPrevented = true; },\n addError: (propertyPath: string, errorMessage: string) => {\n isPrevented = true;\n if (this.getProperty(\"useMessageManager\") === true) {\n this.validationDelegate.pushMessage(propertyPath, errorMessage);\n }\n if (this.engine) {\n const plugin = this.engine.getPluginByPath(propertyPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, errorMessage);\n }\n }\n }\n });\n\n if (isPrevented) {\n return false;\n }\n\n this.dataSyncDelegate.pushToBindings(payload);\n this.fireEvent(\"submit\", { payload, payloadJson });\n return true;\n }\n return false;\n }\n\n /**\n * Injects a custom error message onto a specific field.\n */\n public addCustomError(fieldPath: string, message: string): void {\n this.validationDelegate.addCustomError(fieldPath, message);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, message);\n }\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n */\n public clearCustomError(fieldPath: string): void {\n this.validationDelegate.clearCustomError(fieldPath);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n const schemaValid = plugin.validate();\n plugin.setVisualValidationState(schemaValid.isValid, schemaValid.errorMessage);\n }\n }\n }\n\n /**\n * Toggles busy state on the host control.\n */\n public setBusy(isBusy: boolean): this {\n super.setBusy(isBusy);\n return this;\n }\n\n /**\n * Intercepts property changes. Hot-swaps data gracefully if it's an inputData change,\n * or forces a full UI teardown if it's a structural property change (like schemaDefinition).\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"useMessageManager\" && this.stateManager) {\n this.stateManager.setUseMessageManager(value === true);\n }\n\n if (propertyName === \"dataJson\" || propertyName === \"data\") {\n this.dataSyncDelegate.handleInputDataHotSwap(propertyName, value, suppressInvalidate);\n return this;\n }\n\n if (propertyName === \"editable\" || propertyName === \"debugMode\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaTarget\") {\n const currentVal = this.getProperty(propertyName);\n if (currentVal !== value) {\n super.setProperty(propertyName, value, suppressInvalidate);\n this.tearDownGeneratedLayout();\n }\n return this;\n }\n\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Bypasses the interceptor to write directly to the base UI5 control.\n */\n public setBaseProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Internal reference to the active generate promise.\n * Prevents concurrent redundant layouts from being generated when properties are set rapidly or DialogDelegate triggers it.\n */\n private _generatePromise: Promise<void> | null = null;\n\n /**\n * The core rendering pipeline entry point.\n * Uses Promise resolution to debounce concurrent or rapid consecutive calls natively without arbitrary timeouts.\n * @returns Promise that resolves when the layout is successfully built and mounted.\n */\n public async generate(): Promise<void> {\n if (this._generatePromise) {\n return this._generatePromise;\n }\n this._generatePromise = Promise.resolve().then(async () => {\n try {\n await this._doGenerate();\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Error in deferred generate: \" + e, \"GeneratorHost\");\n throw e; // Ensure it bubbles up to awaiters\n } finally {\n this._generatePromise = null;\n }\n });\n return this._generatePromise;\n }\n\n /**\n * The underlying synchronous generator orchestration method.\n * Normalizes the schema, sets up the state manager, loads missing plugins over the network,\n * orchestrates the Engine build, and mounts the generated UI components into the internal tree.\n */\n private async _doGenerate(): Promise<void> {\n try {\n this.tearDownGeneratedLayout();\n\n // CRITICAL FIX: Extract the unsaved internal payload BEFORE destroying the state manager\n // Otherwise, toggling editable (or other structural properties) will wipe user inputs!\n let internalPayload = null;\n if (this.stateManager) {\n internalPayload = this.stateManager.extractPayload();\n }\n\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n let rawSchema = this.getProperty(\"schemaDefinition\");\n if (rawSchema && typeof rawSchema === \"object\") {\n rawSchema = JSON.parse(JSON.stringify(rawSchema));\n }\n const isSchemaEmpty = !rawSchema || (typeof rawSchema === \"object\" && Object.keys(rawSchema).length === 0);\n\n let inputData = this.getProperty(\"data\");\n const inputDataJson = this.getProperty(\"dataJson\");\n\n let dataParseError = \"\";\n\n if (inputDataJson) {\n try {\n inputData = JSON.parse(inputDataJson as string);\n } catch (e) {\n dataParseError = \"Failed to parse inputDataJson string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", dataParseError, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: dataParseError, exception: e });\n inputData = {}; // Fallback to empty object to allow schema to render\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n dataParseError = \"Failed to parse inputData string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", dataParseError, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: dataParseError, exception: e });\n inputData = {}; // Fallback to empty object to allow schema to render\n }\n }\n\n // The internal payload represents the user's latest un-extracted edits. It must take priority, unless an external data-swap failed.\n const finalData = dataParseError ? inputData : (internalPayload || inputData);\n\n if (!finalData || Object.keys(finalData).length === 0) {\n if (isSchemaEmpty) {\n const msg = \"No payload provided and no explicit schema defined. Cannot infer UI.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg);\n }\n }\n\n const schemaToNormalize = isSchemaEmpty ? null : rawSchema;\n const normalizedSchema = SchemaNormalizer.normalize(schemaToNormalize, finalData);\n\n // Cache the parsed/inferred schema so DataSyncDelegate can diff against it later\n this.parsedSchema = normalizedSchema as Record<string, unknown>;\n\n if (normalizedSchema) {\n if (normalizedSchema.uiPolicies && normalizedSchema.uiPolicies.length > 0) {\n this.policyEngine = new PolicyEngine(normalizedSchema.uiPolicies);\n } else {\n this.policyEngine = null;\n }\n\n const schemaErrors = SchemaValidator.validateSchemaStructure(normalizedSchema);\n if (schemaErrors.length > 0) {\n const errorMsg = \"Schema Structural Errors Found:\\n- \" + schemaErrors.join(\"\\n- \");\n // Let's log it out loudly regardless of debug mode, so developers can see why it didn't render\n Logger.error(\"[MetaUI]\", errorMsg, \"GeneratorHost\");\n if (this.getProperty(\"debugMode\")) {\n MessageBox.error(errorMsg, { title: \"MetaUI Schema Error\" });\n return;\n }\n }\n }\n\n const rawDefinitions = this.getProperty(\"schemaDefinitions\") as Record<string, any> || {};\n \n // Extract any definitions embedded inside the root schema definition\n let parsedRawSchema = rawSchema;\n if (typeof rawSchema === \"string\" && rawSchema.trim() !== \"\") {\n try {\n parsedRawSchema = JSON.parse(rawSchema);\n } catch (e) {\n // Ignore parse errors here; SchemaNormalizer will throw loudly later if invalid.\n }\n }\n\n if (parsedRawSchema && typeof parsedRawSchema === \"object\" && (parsedRawSchema as any).definitions) {\n Object.assign(rawDefinitions, (parsedRawSchema as any).definitions);\n this.setProperty(\"schemaDefinitions\", rawDefinitions, true);\n }\n\n let normalizedDefinitions: Record<string, ISchema> | undefined;\n if (Object.keys(rawDefinitions).length > 0) {\n normalizedDefinitions = {};\n for (const key in rawDefinitions) {\n try {\n normalizedDefinitions[key] = SchemaNormalizer.normalize(rawDefinitions[key]) as ISchema;\n } catch (e) {\n Logger.warn(`[MetaUI] Failed to normalize schema definition '${key}'`, \"\", \"GeneratorHost\");\n }\n }\n }\n\n const budget = this.getProperty(\"layoutBudget\") as number;\n\n // Ensure we have a uiLayout synthesized before applying scoring and mutation \n // (crucial for inferred/swagger schemas)\n if (DefaultLayoutGenerator.ensureLayout(normalizedSchema as ISchema)) {\n Logger.warn(\"[MetaUI GeneratorHost] Missing 'uiLayout' array in schema. Synthesized a default layout mapping to prevent a blank render.\");\n }\n\n LayoutScorer.apply(normalizedSchema as ISchema, budget, normalizedDefinitions);\n LayoutMutator.apply(normalizedSchema as ISchema);\n\n const activePluginRegistry = this.getProperty(\"pluginRegistry\") || PluginRegistry.getInstance();\n \n const pathsToLoad = activePluginRegistry.getPathsToLoad(normalizedSchema as ISchema);\n const needsNetworkLoad = Array.from(pathsToLoad).some((path: any) => !sap.ui.require(path));\n\n if (needsNetworkLoad) {\n this.setBusy(true);\n await activePluginRegistry.preloadDependencies(normalizedSchema as ISchema);\n this.setBusy(false);\n }\n\n // Inject defaults into empty payload values\n if (normalizedSchema && finalData) {\n this.dataSyncDelegate.injectSchemaDefaults(normalizedSchema, finalData);\n }\n\n this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.stateManager.setUseMessageManager(this.getProperty(\"useMessageManager\") === true);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n if (!this.engine) {\n const isEditable = this.getProperty(\"editable\") !== false;\n const useMessageManager = this.getProperty(\"useMessageManager\") === true;\n const activePluginRegistry = this.getProperty(\"pluginRegistry\") || PluginRegistry.getInstance();\n this.engine = new Engine(isEditable, useMessageManager, activePluginRegistry);\n this.engine.host = this;\n }\n\n this.generatedContent = this.engine.build(\n normalizedSchema,\n this.stateManager.getModel(),\n this.activeModelName,\n this.triggerSubmit.bind(this),\n this.getId(),\n this.onInternalFieldChange.bind(this)\n );\n\n // Defect #15: PBRE Initialization Blackout - Force headless evaluation of initial visibility state\n if (this.policyEngine) {\n this.evaluatePolicies();\n }\n\n let contentContainer = this.generatedContent;\n\n const hasProperties = normalizedSchema && Object.keys(normalizedSchema).length > 0;\n\n if (!hasProperties) {\n const strip = new MessageStrip({\n text: \"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMargin\");\n contentContainer = new VBox({\n items: [strip]\n });\n } else if (dataParseError) {\n const strip = new MessageStrip({\n text: \"Data Error: \" + dataParseError + \". The form has been rendered with a blank dataset.\",\n type: \"Error\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMargin\");\n \n if (typeof (contentContainer as any).insertItem === \"function\") {\n (contentContainer as any).insertItem(strip, 0);\n } else if (typeof (contentContainer as any).insertContent === \"function\") {\n (contentContainer as any).insertContent(strip, 0);\n } else {\n contentContainer = new VBox({\n items: [strip, this.generatedContent!]\n });\n }\n } else if (this.engine.hasPartialRenderingErrors) {\n const strip = new MessageStrip({\n text: \"Layout partially rendered. Some fields failed to generate due to configuration errors.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n }\n\n this.setAggregation(\"_content\", contentContainer);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n // Retroactively expand the dialog if the heuristic determines it needs more space\n this.dialogDelegate.calculateAndApplyOptimalWidth(this.parsedSchema);\n\n } catch (error) {\n this.setBusy(false);\n const msg = \"Fatal crash during layout generation: \" + (error as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: error });\n this.validationDelegate.mountCrashBoundary(error as Error);\n throw error; // Completely eliminate silent error swallowing\n }\n }\n\n\n\n /**\n * Programmatic API. Re-parents the generated content into a dialog and opens it.\n */\n public openInDialog(title: string = \"Form\", submitButtonText: string = \"OK\", cancelButtonText: string = \"Cancel\", dialogWidth: string = \"auto\", parentView?: Control): void {\n const isGenerated = !!this.generatedContent;\n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated, cancelButtonText, dialogWidth, parentView);\n }\n}\n"],"mappings":"ogBAESA,EAAMC,EAAA,gBACNC,EAAgBC,EAAA,0BAChBC,EAAeC,EAAA,yBACfC,EAAMC,EAAA,gBACNC,EAAYC,EAAA,sBACZC,EAAYC,EAAA,sBACZC,EAAgBC,EAAA,0BAChBC,EAAkBC,EAAA,4BAClBC,EAAcC,EAAA,wBAIdC,EAAcC,EAAA,wBACdC,EAAYC,EAAA,sBACZC,EAAaC,EAAA,uBACbC,EAAsBC,EAAA,0BAG/B,MASqBC,EAAsBC,EAAOC,OAAA,0DAuEvCC,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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E,kBAE5C,MAAMtB,EAAUoB,KAAKC,aAAauC,iBAClCxC,KAAKY,iBAAiB8B,eAAe9D,GAGrCoB,KAAKc,eAAekK,8BAA8BhL,KAAKO,aAE3D,CAAE,MAAOd,GACLO,KAAK4F,QAAQ,OACb,MAAMtB,EAAM,yCAA4C7E,EAAgBF,QACxE/E,EAAOiF,MAAM,WAAY6E,EAAK,iBAC9BtE,KAAK4C,UAAU,QAAS,CAAErD,QAAS+E,EAAK5E,UAAWD,IACnDO,KAAKa,mBAAmBoK,mBAAmBxL,GAC3C,MAAMA,CACV,CACJ,EAOOyL,aAAY,SAAAC,EAAChD,EAAgB,OAAQiD,EAA2B,KAAMC,EAA2B,SAAUC,EAAsB,OAAQC,GAC5I,MAAMC,IAAgBxL,KAAKE,iBAC3BF,KAAKc,eAAeoK,aAAa/C,EAAOiD,EAAkBI,EAAaH,EAAkBC,EAAaC,EAC1G,IAAC,OA3rBgBrP,CAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"GeneratorHost.js","names":["Logger","____utils_Logger","SchemaNormalizer","____core_SchemaNormalizer","SchemaValidator","____core_SchemaValidator","Engine","____core_Engine","StateManager","____core_StateManager","PolicyEngine","____core_PolicyEngine","DataSyncDelegate","___delegates_DataSyncDelegate","ValidationDelegate","___delegates_ValidationDelegate","DialogDelegate","___delegates_DialogDelegate","PluginRegistry","____core_PluginRegistry","LayoutScorer","____core_LayoutScorer","LayoutMutator","____core_LayoutMutator","DefaultLayoutGenerator","____core_DefaultLayoutGenerator","GeneratorHost","Control","extend","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","engineScopeId","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","constructor","_constructor","idOrSettings","settings","Control.prototype.constructor.call","this","stateManager","generatedContent","engine","policyEngine","policyDebounceTimer","activeModelName","parsedSchema","_generatePromise","init","_init","Control.prototype.init.call","dataSyncDelegate","validationDelegate","dialogDelegate","onInternalFieldChange","bind","setDebugMode","_setDebugMode","enabled","setProperty","getStateManager","_getStateManager","getSchemaDefinition","_getSchemaDefinition","refPath","defs","getProperty","undefined","key","startsWith","substring","tearDownGeneratedLayout","_tearDownGeneratedLayout","unregisterObject","destroy","_onInternalFieldChange","fieldKey","errorMessage","controlId","extractPayload","debug","pushToBindings","currentValidity","fireEvent","clearTimeout","setTimeout","evaluatePolicies","_evaluatePolicies","deltas","evaluate","delta","plugin","getPluginByPath","target","property","applyVisibility","reportPolicyError","applyRequired","applyEditable","exit","_exit","getModel","getParsedSchema","_getParsedSchema","onBeforeRendering","_onBeforeRendering","hasSchema","hasData","generate","msg","Error","triggerSubmit","_triggerSubmit","isPrevented","removeAllMessages","errors","validateAll","length","pushMessage","err","fieldLabel","JSON","stringify","propertyPath","setVisualValidationState","addCustomError","_addCustomError","clearCustomError","_clearCustomError","schemaValid","validate","setBusy","_setBusy","isBusy","Control.prototype.setBusy.call","_setProperty","propertyName","suppressInvalidate","setUseMessageManager","handleInputDataHotSwap","currentVal","Control.prototype.setProperty.call","setBaseProperty","_setBaseProperty","async","_generate","Promise","resolve","then","_doGenerate","e","internalPayload","rawSchema","parse","isSchemaEmpty","Object","keys","inputData","inputDataJson","dataParseError","finalData","schemaToNormalize","normalizedSchema","normalize","uiPolicies","schemaErrors","validateSchemaStructure","errorMsg","join","MessageBox","title","rawDefinitions","parsedRawSchema","trim","definitions","assign","normalizedDefinitions","warn","budget","ensureLayout","apply","activePluginRegistry","getInstance","pathsToLoad","getPathsToLoad","needsNetworkLoad","Array","from","some","path","sap","ui","require","preloadDependencies","injectSchemaDefaults","getId","setModel","isEditable","host","build","contentContainer","hasProperties","strip","MessageStrip","text","showIcon","showCloseButton","addStyleClass","VBox","items","insertItem","insertContent","hasPartialRenderingErrors","setAggregation","registerObject","calculateAndApplyOptimalWidth","mountCrashBoundary","openInDialog","_openInDialog","submitButtonText","cancelButtonText","dialogWidth","parentView","isGenerated"],"sources":["GeneratorHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport { Logger } from \"../../utils/Logger\";\nimport { SchemaNormalizer } from \"../../core/SchemaNormalizer\";\nimport { SchemaValidator } from \"../../core/SchemaValidator\";\nimport { Engine } from \"../../core/Engine\";\nimport { StateManager } from \"../../core/StateManager\";\nimport { PolicyEngine } from \"../../core/PolicyEngine\";\nimport { DataSyncDelegate } from \"./delegates/DataSyncDelegate\";\nimport { ValidationDelegate } from \"./delegates/ValidationDelegate\";\nimport { DialogDelegate } from \"./delegates/DialogDelegate\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport MessageStrip from \"sap/m/MessageStrip\";\nimport VBox from \"sap/m/VBox\";\nimport { PluginRegistry } from \"../../core/PluginRegistry\";\nimport { LayoutScorer } from \"../../core/LayoutScorer\";\nimport { LayoutMutator } from \"../../core/LayoutMutator\";\nimport { DefaultLayoutGenerator } from \"../../core/DefaultLayoutGenerator\";\nimport type { ISchema } from \"../../interfaces/ISchema\";\n\n/**\n * Base wrapper element for embedding the dynamic form natively via Explicit Schemas.\n * \n * This class serves as the core rendering engine for standard MetaUI implementations.\n * It manages the lifecycle of the Engine, StateManager, and the delegation of \n * data synchronization, validation, and dialog interactions.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls.host\n */\nexport default class GeneratorHost extends Control {\n\n protected stateManager: StateManager | null = null;\n protected generatedContent: Control | null = null;\n /** The embedded engine responsible for rendering the UI controls */\n protected engine: Engine | null = null;\n \n /** \n * The Policy-Based Rules Engine.\n * Continuously evaluates declarative cross-field rules and pushes visual/structural mutations down into the plugins.\n */\n protected policyEngine: PolicyEngine | null = null;\n \n private policyDebounceTimer: any = null;\n protected activeModelName: string = \"\";\n\n protected dataSyncDelegate!: DataSyncDelegate;\n protected validationDelegate!: ValidationDelegate;\n protected dialogDelegate!: DialogDelegate;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n schemaDefinitions: { type: \"object\", defaultValue: {} },\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 engineScopeId: { type: \"string\", defaultValue: null }\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 * Fired by the WizardLayout immediately when the user presses the \"Next Step\" button,\n * before the layout physically transitions to the next step. Provides a structured hook\n * for consumers to perform per-step validation, including asynchronous backend checks,\n * and optionally block or resume the navigation.\n * \n * Parameters:\n * - `stepIndex` {int}: The 0-based index of the step the user is navigating AWAY FROM.\n * - `payload` {object}: A live snapshot of the full form payload at transition time.\n * - `preventDefault` {function}: Blocks navigation synchronously. Call this immediately if you need to wait for an async check.\n * - `addError` {function(fieldPath: string, errorMessage: string)}: Blocks navigation\n * and paints the specified field with a validation error state.\n * - `resumeNavigation` {function}: Explicitly allows navigation after a prior `preventDefault()` call.\n * Causes the wizard to advance to the next step immediately.\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: GeneratorHost) {\n rm.openStart(\"div\", control);\n rm.style(\"width\", \"100%\");\n rm.style(\"height\", \"100%\");\n rm.openEnd();\n\n const content = control.getAggregation(\"_content\") as Control;\n if (content) {\n rm.renderControl(content);\n }\n\n rm.close(\"div\");\n }\n };\n\n /**\n * Standard UI5 Constructor.\n */\n constructor(idOrSettings?: string | object, settings?: object) {\n super(idOrSettings as string, settings);\n }\n\n /**\n * Initializes the control and instantiates the composition delegates.\n * Delegates must be initialized here rather than in the constructor so they are \n * available before `applySettings` runs during UI5's control lifecycle.\n */\n public init(): void {\n super.init();\n\n // Initialize Composition Delegates\n this.dataSyncDelegate = new DataSyncDelegate(this);\n this.validationDelegate = new ValidationDelegate(this);\n this.dialogDelegate = new DialogDelegate(this as any);\n\n this.onInternalFieldChange = this.onInternalFieldChange.bind(this);\n }\n\n /**\n * Enables or disables debug mode.\n */\n public setDebugMode(enabled: boolean): this {\n this.setProperty(\"debugMode\", enabled, true);\n Logger.setDebugMode(enabled);\n return this;\n }\n\n\n /**\n * Returns the active state manager instance managing the JSON payload.\n */\n public getStateManager(): StateManager | null {\n return this.stateManager;\n }\n\n /**\n * Resolves a reference pointer against the global schema definitions dictionary.\n * @param refPath The string reference path (e.g., \"#/definitions/User\")\n * @returns The resolved ISchema or undefined\n */\n public getSchemaDefinition(refPath: string): ISchema | undefined {\n const defs = this.getProperty(\"schemaDefinitions\") as Record<string, ISchema>;\n if (!defs || !refPath) return undefined;\n let key = refPath;\n if (key.startsWith(\"#/definitions/\")) {\n key = key.substring(14);\n } else if (key.startsWith(\"#/components/schemas/\")) {\n key = key.substring(21);\n }\n return defs[key];\n }\n\n /**\n * Safely destroys the currently generated UI tree and cleans up references.\n * This is called before every regeneration to prevent memory leaks.\n */\n public tearDownGeneratedLayout(): void {\n if (this.generatedContent) {\n this.validationDelegate.unregisterObject(this.generatedContent);\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /**\n * Internal event handler triggered by the Engine when a field value changes.\n * Coordinates LiveUpdate syncs, validation state tracking, and bubbling the change upwards.\n */\n protected onInternalFieldChange(isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string): void {\n const payload = this.stateManager ? this.stateManager.extractPayload() : {};\n\n if (this.getProperty(\"liveUpdate\") === true) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", \"liveUpdate is enabled, pushing outbound payload.\", \"GeneratorHost\");\n }\n this.dataSyncDelegate.pushToBindings(payload);\n }\n\n const currentValidity = this.getProperty(\"isValid\") as boolean;\n if (isValid !== currentValidity) {\n this.setProperty(\"isValid\", isValid, true);\n this.fireEvent(\"validationStateChanged\", { isValid });\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `Validation state shifted to: ${isValid}`, \"GeneratorHost\");\n }\n }\n\n this.fireEvent(\"fieldChange\", {\n fieldPath: fieldKey || \"\",\n value: undefined,\n payload: payload,\n isValid: isValid\n });\n\n // Trigger PBRE Live Evaluation\n if (this.policyEngine && fieldKey) {\n if (this.policyDebounceTimer) clearTimeout(this.policyDebounceTimer);\n this.policyDebounceTimer = setTimeout(() => {\n this.evaluatePolicies();\n }, 200);\n }\n }\n\n /**\n * Executes the PBRE policy evaluations and orchestrates the delta updates to the UI plugins.\n * Acts as the bridge between the headless PolicyEngine calculations and the physical UI5 plugins.\n * \n * @param changedPath The specific JSON path that triggered the evaluation (used for incremental sweeps).\n * If undefined, a full engine sweep is performed (e.g. during initial render or manual submit).\n */\n private evaluatePolicies(): void {\n if (!this.policyEngine || !this.stateManager || !this.engine) return;\n const payload = this.stateManager.extractPayload();\n const deltas = this.policyEngine.evaluate(payload);\n for (const delta of deltas) {\n const plugin = this.engine.getPluginByPath(delta.target);\n if (plugin) {\n // Systemic Failsafe: State Pruning on Hide/Disable\n if ((delta.property === \"visibility\" || delta.property === \"editable\") && delta.value === false) {\n this.stateManager.setProperty(delta.target, undefined); \n }\n\n switch (delta.property) {\n case \"visibility\": \n if (plugin.applyVisibility) plugin.applyVisibility(delta.value);\n break;\n case \"validity\":\n if (delta.value) {\n this.engine.reportPolicyError(delta.target, null);\n } else {\n this.engine.reportPolicyError(delta.target, delta.errorMessage || \"Validation failed by policy\");\n }\n break;\n case \"required\":\n if (plugin.applyRequired) plugin.applyRequired(delta.value);\n break;\n case \"editable\":\n if (plugin.applyEditable) plugin.applyEditable(delta.value);\n break;\n }\n }\n }\n }\n\n /**\n * Standard UI5 Exit Hook. Ensures complete teardown of the engine and state manager.\n */\n public exit(): void {\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n if (this.generatedContent) {\n this.generatedContent.destroy();\n this.generatedContent = null;\n }\n }\n\n /** Cached schema for intelligent diffing during inference mode hot-swaps */\n protected parsedSchema: Record<string, unknown> | null = null;\n\n /**\n * Exposes the parsed schema to the DataSyncDelegate for diffing.\n */\n public getParsedSchema(): Record<string, unknown> | null {\n return this.parsedSchema;\n }\n\n /**\n * Standard UI5 Rendering Hook.\n * Evaluates whether it possesses a schema or data. If so, triggers the internal engine generation.\n */\n public onBeforeRendering(): void {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI GeneratorHost]\", `onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty(\"schemaDefinition\")}, data exists = ${!!this.getProperty(\"data\")}, dataJson exists = ${!!this.getProperty(\"dataJson\")}`, \"GeneratorHost\");\n }\n\n if (!this.generatedContent) {\n const hasSchema = !!this.getProperty(\"schemaDefinition\");\n const hasData = !!this.getProperty(\"dataJson\") || !!this.getProperty(\"data\");\n\n if (hasSchema || hasData) {\n this.generate();\n } else {\n const msg = \"GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg); // Eradicate silent errors\n }\n }\n }\n\n /**\n * Public API method to manually trigger form submission.\n * Executes all structural validations, clears old messages, and pushes payload to bindings.\n * @returns boolean True if submission succeeded, false if validation failed.\n */\n public triggerSubmit(): boolean {\n if (this.stateManager && this.engine) {\n let isPrevented = false;\n\n this.validationDelegate.removeAllMessages();\n\n // Run PBRE Full Sweep before validation to ensure visibility states are perfect\n if (this.policyEngine) {\n this.evaluatePolicies();\n }\n\n // PBRE Architecture Rule 12: Controls are deliberately isolated from UI5's native \n // MessageManager auto-sync. We must explicitly instruct plugins to paint their \n // visual red borders (ValueState) manually during a full form submission sweep.\n const errors = this.engine.validateAll(true);\n if (errors.length > 0) {\n if (this.getProperty(\"useMessageManager\") === true) {\n this.validationDelegate.pushMessage(\"\", \"One or more fields failed schema validation. Please review the highlighted fields.\");\n }\n for (const err of errors) {\n if (err.fieldKey && err.errorMessage) {\n this.validationDelegate.pushMessage(err.fieldKey, err.errorMessage, err.fieldLabel);\n }\n }\n return false;\n }\n\n const payload = this.stateManager.extractPayload();\n const payloadJson = JSON.stringify(payload);\n\n this.fireEvent(\"beforeSubmit\", {\n payload,\n preventDefault: () => { isPrevented = true; },\n addError: (propertyPath: string, errorMessage: string) => {\n isPrevented = true;\n if (this.getProperty(\"useMessageManager\") === true) {\n this.validationDelegate.pushMessage(propertyPath, errorMessage);\n }\n if (this.engine) {\n const plugin = this.engine.getPluginByPath(propertyPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, errorMessage);\n }\n }\n }\n });\n\n if (isPrevented) {\n return false;\n }\n\n this.dataSyncDelegate.pushToBindings(payload);\n this.fireEvent(\"submit\", { payload, payloadJson });\n return true;\n }\n return false;\n }\n\n /**\n * Injects a custom error message onto a specific field.\n */\n public addCustomError(fieldPath: string, message: string): void {\n this.validationDelegate.addCustomError(fieldPath, message);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(false, message);\n }\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n */\n public clearCustomError(fieldPath: string): void {\n this.validationDelegate.clearCustomError(fieldPath);\n if (this.getProperty(\"useMessageManager\") !== true && this.engine) {\n const plugin = this.engine.getPluginByPath(fieldPath);\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n const schemaValid = plugin.validate();\n plugin.setVisualValidationState(schemaValid.isValid, schemaValid.errorMessage);\n }\n }\n }\n\n /**\n * Toggles busy state on the host control.\n */\n public setBusy(isBusy: boolean): this {\n super.setBusy(isBusy);\n return this;\n }\n\n /**\n * Intercepts property changes. Hot-swaps data gracefully if it's an inputData change,\n * or forces a full UI teardown if it's a structural property change (like schemaDefinition).\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"useMessageManager\" && this.stateManager) {\n this.stateManager.setUseMessageManager(value === true);\n }\n\n if (propertyName === \"dataJson\" || propertyName === \"data\") {\n this.dataSyncDelegate.handleInputDataHotSwap(propertyName, value, suppressInvalidate);\n return this;\n }\n\n if (propertyName === \"editable\" || propertyName === \"debugMode\" || propertyName === \"schemaDefinition\" || propertyName === \"schemaTarget\") {\n const currentVal = this.getProperty(propertyName);\n if (currentVal !== value) {\n super.setProperty(propertyName, value, suppressInvalidate);\n this.tearDownGeneratedLayout();\n }\n return this;\n }\n\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Bypasses the interceptor to write directly to the base UI5 control.\n */\n public setBaseProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n return super.setProperty(propertyName, value, suppressInvalidate);\n }\n\n /**\n * Internal reference to the active generate promise.\n * Prevents concurrent redundant layouts from being generated when properties are set rapidly or DialogDelegate triggers it.\n */\n private _generatePromise: Promise<void> | null = null;\n\n /**\n * The core rendering pipeline entry point.\n * Uses Promise resolution to debounce concurrent or rapid consecutive calls natively without arbitrary timeouts.\n * @returns Promise that resolves when the layout is successfully built and mounted.\n */\n public async generate(): Promise<void> {\n if (this._generatePromise) {\n return this._generatePromise;\n }\n this._generatePromise = Promise.resolve().then(async () => {\n try {\n await this._doGenerate();\n } catch (e) {\n Logger.error(\"[MetaUI]\", \"Error in deferred generate: \" + e, \"GeneratorHost\");\n throw e; // Ensure it bubbles up to awaiters\n } finally {\n this._generatePromise = null;\n }\n });\n return this._generatePromise;\n }\n\n /**\n * The underlying synchronous generator orchestration method.\n * Normalizes the schema, sets up the state manager, loads missing plugins over the network,\n * orchestrates the Engine build, and mounts the generated UI components into the internal tree.\n */\n private async _doGenerate(): Promise<void> {\n try {\n this.tearDownGeneratedLayout();\n\n // CRITICAL FIX: Extract the unsaved internal payload BEFORE destroying the state manager\n // Otherwise, toggling editable (or other structural properties) will wipe user inputs!\n let internalPayload = null;\n if (this.stateManager) {\n internalPayload = this.stateManager.extractPayload();\n }\n\n if (this.engine) {\n this.engine.destroy();\n this.engine = null;\n }\n if (this.stateManager) {\n this.stateManager.getModel().destroy();\n this.stateManager = null;\n }\n\n let rawSchema = this.getProperty(\"schemaDefinition\");\n if (rawSchema && typeof rawSchema === \"object\") {\n rawSchema = JSON.parse(JSON.stringify(rawSchema));\n }\n const isSchemaEmpty = !rawSchema || (typeof rawSchema === \"object\" && Object.keys(rawSchema).length === 0);\n\n let inputData = this.getProperty(\"data\");\n const inputDataJson = this.getProperty(\"dataJson\");\n\n let dataParseError = \"\";\n\n if (inputDataJson) {\n try {\n inputData = JSON.parse(inputDataJson as string);\n } catch (e) {\n dataParseError = \"Failed to parse inputDataJson string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", dataParseError, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: dataParseError, exception: e });\n inputData = {}; // Fallback to empty object to allow schema to render\n }\n } else if (typeof inputData === \"string\") {\n try {\n inputData = JSON.parse(inputData);\n } catch (e) {\n dataParseError = \"Failed to parse inputData string: \" + (e as Error).message;\n Logger.error(\"[MetaUI]\", dataParseError, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: dataParseError, exception: e });\n inputData = {}; // Fallback to empty object to allow schema to render\n }\n }\n\n // The internal payload represents the user's latest un-extracted edits. It must take priority, unless an external data-swap failed.\n const finalData = dataParseError ? inputData : (internalPayload || inputData);\n\n if (!finalData || Object.keys(finalData).length === 0) {\n if (isSchemaEmpty) {\n const msg = \"No payload provided and no explicit schema defined. Cannot infer UI.\";\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg });\n throw new Error(msg);\n }\n }\n\n const schemaToNormalize = isSchemaEmpty ? null : rawSchema;\n const normalizedSchema = SchemaNormalizer.normalize(schemaToNormalize, finalData);\n\n // Cache the parsed/inferred schema so DataSyncDelegate can diff against it later\n this.parsedSchema = normalizedSchema as Record<string, unknown>;\n\n if (normalizedSchema) {\n if (normalizedSchema.uiPolicies && normalizedSchema.uiPolicies.length > 0) {\n this.policyEngine = new PolicyEngine(normalizedSchema.uiPolicies);\n } else {\n this.policyEngine = null;\n }\n\n const schemaErrors = SchemaValidator.validateSchemaStructure(normalizedSchema);\n if (schemaErrors.length > 0) {\n const errorMsg = \"Schema Structural Errors Found:\\n- \" + schemaErrors.join(\"\\n- \");\n // Let's log it out loudly regardless of debug mode, so developers can see why it didn't render\n Logger.error(\"[MetaUI]\", errorMsg, \"GeneratorHost\");\n if (this.getProperty(\"debugMode\")) {\n MessageBox.error(errorMsg, { title: \"MetaUI Schema Error\" });\n return;\n }\n }\n }\n\n const rawDefinitions = this.getProperty(\"schemaDefinitions\") as Record<string, any> || {};\n \n // Extract any definitions embedded inside the root schema definition\n let parsedRawSchema = rawSchema;\n if (typeof rawSchema === \"string\" && rawSchema.trim() !== \"\") {\n try {\n parsedRawSchema = JSON.parse(rawSchema);\n } catch (e) {\n // Ignore parse errors here; SchemaNormalizer will throw loudly later if invalid.\n }\n }\n\n if (parsedRawSchema && typeof parsedRawSchema === \"object\" && (parsedRawSchema as any).definitions) {\n Object.assign(rawDefinitions, (parsedRawSchema as any).definitions);\n this.setProperty(\"schemaDefinitions\", rawDefinitions, true);\n }\n\n let normalizedDefinitions: Record<string, ISchema> | undefined;\n if (Object.keys(rawDefinitions).length > 0) {\n normalizedDefinitions = {};\n for (const key in rawDefinitions) {\n try {\n normalizedDefinitions[key] = SchemaNormalizer.normalize(rawDefinitions[key]) as ISchema;\n } catch (e) {\n Logger.warn(`[MetaUI] Failed to normalize schema definition '${key}'`, \"\", \"GeneratorHost\");\n }\n }\n }\n\n const budget = this.getProperty(\"layoutBudget\") as number;\n\n // Ensure we have a uiLayout synthesized before applying scoring and mutation \n // (crucial for inferred/swagger schemas)\n if (DefaultLayoutGenerator.ensureLayout(normalizedSchema as ISchema)) {\n Logger.warn(\"[MetaUI GeneratorHost] Missing 'uiLayout' array in schema. Synthesized a default layout mapping to prevent a blank render.\");\n }\n\n LayoutScorer.apply(normalizedSchema as ISchema, budget, normalizedDefinitions);\n LayoutMutator.apply(normalizedSchema as ISchema);\n\n const activePluginRegistry = this.getProperty(\"pluginRegistry\") || PluginRegistry.getInstance();\n \n const pathsToLoad = activePluginRegistry.getPathsToLoad(normalizedSchema as ISchema);\n const needsNetworkLoad = Array.from(pathsToLoad).some((path: any) => !sap.ui.require(path));\n\n if (needsNetworkLoad) {\n this.setBusy(true);\n await activePluginRegistry.preloadDependencies(normalizedSchema as ISchema);\n this.setBusy(false);\n }\n\n // Inject defaults into empty payload values\n if (normalizedSchema && finalData) {\n this.dataSyncDelegate.injectSchemaDefaults(normalizedSchema, finalData);\n }\n\n this.activeModelName = \"metaUI_\" + this.getId();\n this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);\n this.stateManager.setUseMessageManager(this.getProperty(\"useMessageManager\") === true);\n this.setModel(this.stateManager.getModel(), this.activeModelName);\n\n if (!this.engine) {\n const isEditable = this.getProperty(\"editable\") !== false;\n const useMessageManager = this.getProperty(\"useMessageManager\") === true;\n const activePluginRegistry = this.getProperty(\"pluginRegistry\") || PluginRegistry.getInstance();\n this.engine = new Engine(isEditable, useMessageManager, activePluginRegistry);\n this.engine.host = this;\n }\n\n this.generatedContent = this.engine.build(\n normalizedSchema,\n this.stateManager.getModel(),\n this.activeModelName,\n this.triggerSubmit.bind(this),\n this.getId(),\n this.onInternalFieldChange.bind(this)\n );\n\n // Defect #15: PBRE Initialization Blackout - Force headless evaluation of initial visibility state\n if (this.policyEngine) {\n this.evaluatePolicies();\n }\n\n let contentContainer = this.generatedContent;\n\n const hasProperties = normalizedSchema && Object.keys(normalizedSchema).length > 0;\n\n if (!hasProperties) {\n const strip = new MessageStrip({\n text: \"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMargin\");\n contentContainer = new VBox({\n items: [strip]\n });\n } else if (dataParseError) {\n const strip = new MessageStrip({\n text: \"Data Error: \" + dataParseError + \". The form has been rendered with a blank dataset.\",\n type: \"Error\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMargin\");\n \n if (typeof (contentContainer as any).insertItem === \"function\") {\n (contentContainer as any).insertItem(strip, 0);\n } else if (typeof (contentContainer as any).insertContent === \"function\") {\n (contentContainer as any).insertContent(strip, 0);\n } else {\n contentContainer = new VBox({\n items: [strip, this.generatedContent!]\n });\n }\n } else if (this.engine.hasPartialRenderingErrors) {\n const strip = new MessageStrip({\n text: \"Layout partially rendered. Some fields failed to generate due to configuration errors.\",\n type: \"Warning\",\n showIcon: true,\n showCloseButton: true\n });\n strip.addStyleClass(\"sapUiSmallMarginBottom\");\n contentContainer = new VBox({\n items: [strip, this.generatedContent]\n });\n }\n\n this.setAggregation(\"_content\", contentContainer);\n this.validationDelegate.registerObject(this.generatedContent);\n\n const payload = this.stateManager.extractPayload();\n this.dataSyncDelegate.pushToBindings(payload);\n\n // Retroactively expand the dialog if the heuristic determines it needs more space\n this.dialogDelegate.calculateAndApplyOptimalWidth(this.parsedSchema);\n\n } catch (error) {\n this.setBusy(false);\n const msg = \"Fatal crash during layout generation: \" + (error as Error).message;\n Logger.error(\"[MetaUI]\", msg, \"GeneratorHost\");\n this.fireEvent(\"error\", { message: msg, exception: error });\n this.validationDelegate.mountCrashBoundary(error as Error);\n throw error; // Completely eliminate silent error swallowing\n }\n }\n\n\n\n /**\n * Programmatic API. Re-parents the generated content into a dialog and opens it.\n */\n public openInDialog(title: string = \"Form\", submitButtonText: string = \"OK\", cancelButtonText: string = \"Cancel\", dialogWidth: string = \"auto\", parentView?: Control): void {\n const isGenerated = !!this.generatedContent;\n this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated, cancelButtonText, dialogWidth, parentView);\n }\n}\n"],"mappings":"ogBAESA,EAAMC,EAAA,gBACNC,EAAgBC,EAAA,0BAChBC,EAAeC,EAAA,yBACfC,EAAMC,EAAA,gBACNC,EAAYC,EAAA,sBACZC,EAAYC,EAAA,sBACZC,EAAgBC,EAAA,0BAChBC,EAAkBC,EAAA,4BAClBC,EAAcC,EAAA,wBAIdC,EAAcC,EAAA,wBACdC,EAAYC,EAAA,sBACZC,EAAaC,EAAA,uBACbC,EAAsBC,EAAA,0BAG/B,MASqBC,EAAsBC,EAAOC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D,MAAO,UAAYF,EAAyBW,gBAAkB,WAAY,CACrEX,EAAyBW,cAAcT,EAAO,EACnD,KAAO,CACHF,EAAmB,IAAIQ,EAAK,CACxBC,MAAO,CAACP,EAAOnK,KAAKE,mBAE5B,CACJ,MAAO,GAAIF,KAAKG,OAAO0K,0BAA2B,CAC9C,MAAMV,EAAQ,IAAIC,EAAa,CAC3BC,KAAM,yFACNpN,KAAM,UACNqN,SAAU,KACVC,gBAAiB,OAErBJ,EAAMK,cAAc,0BACpBP,EAAmB,IAAIQ,EAAK,CACxBC,MAAO,CAACP,EAAOnK,KAAKE,mBAE5B,CAEAF,KAAK8K,eAAe,WAAYb,GAChCjK,KAAKa,mBAAmBkK,eAAe/K,KAAKE,kBAE5C,MAAMzB,EAAUuB,KAAKC,aAAauC,iBAClCxC,KAAKY,iBAAiB8B,eAAejE,GAGrCuB,KAAKc,eAAekK,8BAA8BhL,KAAKO,aAE3D,CAAE,MAAOjB,GACLU,KAAK4F,QAAQ,OACb,MAAMtB,EAAM,yCAA4ChF,EAAgBF,QACxE/E,EAAOiF,MAAM,WAAYgF,EAAK,iBAC9BtE,KAAK4C,UAAU,QAAS,CAAExD,QAASkF,EAAK/E,UAAWD,IACnDU,KAAKa,mBAAmBoK,mBAAmB3L,GAC3C,MAAMA,CACV,CACJ,EAOO4L,aAAY,SAAAC,EAAChD,EAAgB,OAAQiD,EAA2B,KAAMC,EAA2B,SAAUC,EAAsB,OAAQC,GAC5I,MAAMC,IAAgBxL,KAAKE,iBAC3BF,KAAKc,eAAeoK,aAAa/C,EAAOiD,EAAkBI,EAAaH,EAAkBC,EAAaC,EAC1G,IAAC,OAntBgBxP,CAAa","ignoreList":[]}
|
|
@@ -94,7 +94,31 @@ export default class GeneratorHost extends Control {
|
|
|
94
94
|
validationStateChanged: { parameters: { isValid: { type: "boolean" } } },
|
|
95
95
|
validationError: { parameters: { fieldPath: { type: "string" }, message: { type: "string" } } },
|
|
96
96
|
validationSuccess: { parameters: { fieldPath: { type: "string" } } },
|
|
97
|
-
error: { parameters: { message: { type: "string" }, exception: { type: "object" } } }
|
|
97
|
+
error: { parameters: { message: { type: "string" }, exception: { type: "object" } } },
|
|
98
|
+
/**
|
|
99
|
+
* Fired by the WizardLayout immediately when the user presses the "Next Step" button,
|
|
100
|
+
* before the layout physically transitions to the next step. Provides a structured hook
|
|
101
|
+
* for consumers to perform per-step validation, including asynchronous backend checks,
|
|
102
|
+
* and optionally block or resume the navigation.
|
|
103
|
+
*
|
|
104
|
+
* Parameters:
|
|
105
|
+
* - `stepIndex` {int}: The 0-based index of the step the user is navigating AWAY FROM.
|
|
106
|
+
* - `payload` {object}: A live snapshot of the full form payload at transition time.
|
|
107
|
+
* - `preventDefault` {function}: Blocks navigation synchronously. Call this immediately if you need to wait for an async check.
|
|
108
|
+
* - `addError` {function(fieldPath: string, errorMessage: string)}: Blocks navigation
|
|
109
|
+
* and paints the specified field with a validation error state.
|
|
110
|
+
* - `resumeNavigation` {function}: Explicitly allows navigation after a prior `preventDefault()` call.
|
|
111
|
+
* Causes the wizard to advance to the next step immediately.
|
|
112
|
+
*/
|
|
113
|
+
beforeLayoutSectionChange: {
|
|
114
|
+
parameters: {
|
|
115
|
+
stepIndex: { type: "int" },
|
|
116
|
+
payload: { type: "object" },
|
|
117
|
+
preventDefault: { type: "function" },
|
|
118
|
+
addError: { type: "function" },
|
|
119
|
+
resumeNavigation: { type: "function" }
|
|
120
|
+
}
|
|
121
|
+
}
|
|
98
122
|
}
|
|
99
123
|
};
|
|
100
124
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sap.ui.define(["./PluginRegistry", "sap/m/Text", "../utils/Logger", "./DefaultLayoutGenerator", "./PipelineManager"], function (___PluginRegistry, Text, ___utils_Logger, ___DefaultLayoutGenerator, ___PipelineManager) {
|
|
1
|
+
sap.ui.define(["./PluginRegistry", "sap/m/Text", "../utils/Logger", "./DefaultLayoutGenerator", "sap/ui/core/Messaging", "sap/ui/core/message/Message", "sap/ui/core/library", "./PipelineManager"], function (___PluginRegistry, Text, ___utils_Logger, ___DefaultLayoutGenerator, Messaging, Message, coreLibrary, ___PipelineManager) {
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -31,6 +31,9 @@ sap.ui.define(["./PluginRegistry", "sap/m/Text", "../utils/Logger", "./DefaultLa
|
|
|
31
31
|
/** Ledger tracking local vs cross-field errors to prevent visual race conditions. */
|
|
32
32
|
validationLedger = new Map();
|
|
33
33
|
|
|
34
|
+
/** Tracks active MessageManager messages created by this engine instance. */
|
|
35
|
+
activeMessages = new Map();
|
|
36
|
+
|
|
34
37
|
/** Reference to the GeneratorHost that instantiated this engine, for retrieving global definitions. */
|
|
35
38
|
|
|
36
39
|
/** Callback to notify the host that an internal field changed. */
|
|
@@ -350,6 +353,29 @@ sap.ui.define(["./PluginRegistry", "sap/m/Text", "../utils/Logger", "./DefaultLa
|
|
|
350
353
|
// Un-tracked template clones (Table Layout rows)
|
|
351
354
|
this.setNativeControlError(cleanPath, isError ? errorMessage || undefined : undefined);
|
|
352
355
|
}
|
|
356
|
+
if (this.useMessageManager) {
|
|
357
|
+
const currentMsg = this.activeMessages.get(cleanPath);
|
|
358
|
+
if (currentMsg) {
|
|
359
|
+
Messaging.removeMessages(currentMsg);
|
|
360
|
+
this.activeMessages.delete(cleanPath);
|
|
361
|
+
}
|
|
362
|
+
if (isError) {
|
|
363
|
+
const targetPath = `/${cleanPath}`;
|
|
364
|
+
const processorModel = this.host && typeof this.host.getStateManager === "function" ? this.host.getStateManager()?.getModel() : undefined;
|
|
365
|
+
const fieldLabel = typeof plugin?.getFieldLabel === "function" ? plugin.getFieldLabel() : undefined;
|
|
366
|
+
const displayLabel = fieldLabel || cleanPath;
|
|
367
|
+
const displayText = `Field '${displayLabel}': ${errorMessage || "Validation Error"}`;
|
|
368
|
+
const newMsg = new Message({
|
|
369
|
+
message: displayText,
|
|
370
|
+
additionalText: displayLabel !== targetPath ? displayLabel : undefined,
|
|
371
|
+
type: coreLibrary.MessageType.Error,
|
|
372
|
+
target: targetPath,
|
|
373
|
+
processor: processorModel
|
|
374
|
+
});
|
|
375
|
+
Messaging.addMessages(newMsg);
|
|
376
|
+
this.activeMessages.set(cleanPath, newMsg);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
353
379
|
}
|
|
354
380
|
setNativeControlError(targetPath, errorMessage) {
|
|
355
381
|
if (this.host && this.host.generatedContent) {
|
|
@@ -409,7 +435,11 @@ sap.ui.define(["./PluginRegistry", "sap/m/Text", "../utils/Logger", "./DefaultLa
|
|
|
409
435
|
item.plugin.destroy();
|
|
410
436
|
}
|
|
411
437
|
}
|
|
438
|
+
if (this.useMessageManager && this.activeMessages.size > 0) {
|
|
439
|
+
Messaging.removeMessages(Array.from(this.activeMessages.values()));
|
|
440
|
+
}
|
|
412
441
|
this.validationLedger.clear();
|
|
442
|
+
this.activeMessages.clear();
|
|
413
443
|
this.activePlugins = [];
|
|
414
444
|
this.templatePlugins = [];
|
|
415
445
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Engine-dbg.js","names":["PluginRegistry","___PluginRegistry","Logger","___utils_Logger","DefaultLayoutGenerator","___DefaultLayoutGenerator","GlobalPipeline","___PipelineManager","Engine","activePlugins","templatePlugins","validationLedger","Map","isEditable","hasPartialRenderingErrors","useMessageManager","constructor","editable","pluginRegistry","getInstance","build","schema","model","modelName","onSubmit","engineScopeId","onChange","activeModel","isValid","fieldKey","errorMessage","controlId","reportSchemaError","layoutStrategy","type","layoutManager","getLayout","render","error","msg","message","showErrorPopup","Text","text","generateField","fieldMeta","bindingPath","isTemplate","plugin","getPlugin","ui","widget","setEditable","setUseMessageManager","push","path","scopeId","undefined","control","generateLayout","ensureLayout","warn","validateAll","applyVisualState","errors","item","result","validate","replace","name","host","getStateManager","stateManager","payload","extractPayload","getSchema","getParsedSchema","arrayErrors","validatePayloadArrays","forEach","err","filter","e","onArrayMutated","arrayPath","clearArrayMessages","currentPath","properties","key","Object","keys","propSchema","childPath","items","Array","isArray","index","itemPath","propMeta","propPath","val","validatorsToRun","argsMap","required","maxLength","minLength","pattern","regex","minimum","maximum","min","max","format","length","res","executeValidation","fieldLabel","label","getPluginByPath","cleanPath","match","find","p","fieldPath","has","set","schemaError","policyError","get","resolveVisualState","reportPolicyError","ledgerEntry","isError","setVisualValidationState","setNativeControlError","targetPath","generatedContent","rootControl","traverseAndSetError","bindingInfos","getBindingInfo","info","parts","boundPath","endsWith","context","getBindingContext","activeModelName","fullPath","getPath","cleanedFullPath","setValueState","setValueStateText","getAggregation","getMetadata","aggs","getAggregations","aggName","child","c","destroy","clear","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\n * @file Engine.ts\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry (v2).\n */\n\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPlugin, IPluginValidationResult } from \"../interfaces/IPlugin\";\n\nimport { PluginRegistry } from \"./PluginRegistry\";\nimport Control from \"sap/ui/core/Control\";\nimport VBox from \"sap/m/VBox\";\nimport Text from \"sap/m/Text\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport { GlobalPipeline } from \"./PipelineManager\";\n\n/**\n * The Engine is responsible for translating a normalized schema into a physical UI5 layout.\n * It delegates layout generation to the configured `LayoutManager` and field generation to the `PluginRegistry`.\n * It strictly routes execution flow and tracks active plugins for validation.\n * It embodies the \"Plugin-First Philosophy\" by routing all complex field and layout rendering\n * through discrete, decoupled plugins rather than handling native overrides.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Engine {\n\n\n /** Array of all instantiated plugins generated during the current build. */\n private activePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Array of template plugins generated for table rows to prevent memory leaks during destruction. */\n private templatePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Deterministic scope ID injected by the host control to prevent clone collisions. */\n public engineScopeId?: string;\n\n private activeModel?: unknown;\n\n /** Ledger tracking local vs cross-field errors to prevent visual race conditions. */\n private validationLedger: Map<string, { schemaError: string | null, policyError: string | null }> = new Map();\n\n /** Reference to the GeneratorHost that instantiated this engine, for retrieving global definitions. */\n public host?: unknown;\n\n /** Callback to notify the host that an internal field changed. */\n public onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** Tracks whether the entire engine is running in Editable mode. */\n public readonly isEditable: boolean = true;\n\n /** Tracks if any fields or sub-layouts failed to render, requiring a warning strip. */\n public hasPartialRenderingErrors: boolean = false;\n\n /** Tracks whether the engine should delegate visual state to the global MessageManager. */\n public readonly useMessageManager: boolean = false;\n\n /** The injected PluginRegistry instance */\n public readonly pluginRegistry: PluginRegistry;\n\n /**\n * Initializes a new Engine instance.\n * @param editable Whether the engine should render form fields as editable or read-only.\n * @param useMessageManager Whether to delegate visual state to UI5 MessageManager.\n * @param pluginRegistry Optional injected plugin registry. Defaults to singleton.\n */\n constructor(editable: boolean = true, useMessageManager: boolean = false, pluginRegistry?: PluginRegistry) {\n this.isEditable = editable;\n this.useMessageManager = useMessageManager;\n this.pluginRegistry = pluginRegistry || PluginRegistry.getInstance();\n }\n\n /**\n * Bootstraps the layout generation process by resolving the correct layout strategy.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param model The active StateManager JSONModel instance.\n * @param modelName The UI5 model alias used for isolation.\n * @param onSubmit Callback fired when form is submitted.\n * @param engineScopeId Deterministic scope ID for this engine instance.\n * @param onChange Callback fired when field values change.\n * @returns The generated root UI5 Control container.\n */\n public build(schema: ISchema, model: unknown, modelName: string = \"meta\", onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control {\n\n this.activePlugins = [];\n this.activeModel = model;\n this.engineScopeId = engineScopeId;\n this.onChange = (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => {\n if (fieldKey) {\n this.reportSchemaError(fieldKey, isValid ? null : errorMessage || \"Invalid input\");\n }\n\n if (onChange) {\n onChange(isValid, fieldKey, errorMessage, controlId);\n }\n };\n\n try {\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n\n return layoutManager.render(schema, modelName, this, onSubmit);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(\"[MetaUI Engine] Critical error during layout generation\", msg);\n Logger.showErrorPopup(`Engine failed to generate the layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Layout Error\" });\n }\n }\n\n /**\n * Instantiates the correct plugin for a specific field based on type and widget hints,\n * and tracks the plugin for global validation.\n * \n * @param fieldMeta The metadata schema specific to the field.\n * @param bindingPath The JSON path representing the field within the payload.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @returns The generated UI5 Control for the field.\n */\n public generateField(fieldMeta: IPropertyMetadata, bindingPath: string, modelName: string, isTemplate: boolean = false): Control {\n try {\n const plugin = this.pluginRegistry.getPlugin(fieldMeta.type || \"string\", fieldMeta.ui?.widget);\n if (typeof plugin.setEditable === \"function\") {\n plugin.setEditable(this.isEditable);\n }\n\n if (typeof plugin.setUseMessageManager === \"function\") {\n plugin.setUseMessageManager(this.useMessageManager);\n }\n\n if (!isTemplate) {\n this.activePlugins.push({ plugin, path: bindingPath });\n } else {\n this.templatePlugins.push({ plugin, path: bindingPath });\n }\n const scopeId = isTemplate ? undefined : this.engineScopeId;\n const control = plugin.render(fieldMeta, bindingPath, modelName, scopeId, this.onChange, this.activeModel);\n\n\n\n return control;\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Failed to generate field at ${bindingPath}`, msg);\n Logger.showErrorPopup(`Failed to generate field '${bindingPath}'.\\n\\nDetails: ${msg}`);\n return new Text({ text: `[Error generating field ${bindingPath}]` });\n }\n }\n\n /**\n * Generates a sub-layout (like an embedded table or nested form) without \n * destroying the current Engine state or Condition tracking.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param modelName The UI5 JSONModel name used for data binding (defaults to \"meta\").\n * @param bindingPath Optional path to bind the sub-layout to a specific array/object property.\n * @returns The generated root UI5 Control container.\n */\n public generateLayout(schema: ISchema, modelName: string, bindingPath?: string): Control {\n try {\n if (DefaultLayoutGenerator.ensureLayout(schema)) {\n Logger.warn(`[MetaUI Engine] Missing 'uiLayout' array in sub-schema for ${bindingPath}. Synthesized a default layout mapping.`);\n }\n\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n return layoutManager.render(schema, modelName, this, undefined, bindingPath);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Critical error generating sub-layout for ${bindingPath}`, msg);\n Logger.showErrorPopup(`Engine failed to generate a sub-layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Sub-Layout Error\" });\n }\n }\n\n /**\n * Iterates through all active plugins and triggers their internal validation pipelines.\n * \n * @param applyVisualState If true, explicitly instructs the plugin to natively paint its own ValueState.\n * @returns {IPluginValidationResult[]} Array of validation error objects. Empty array if valid.\n */\n public validateAll(applyVisualState: boolean = false): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n for (const item of this.activePlugins) {\n try {\n const result = item.plugin.validate();\n if (applyVisualState) {\n this.reportSchemaError(item.path, result.isValid ? null : result.errorMessage || \"Invalid input\");\n }\n\n if (!result.isValid) {\n // Ensure the path is bound to the error so GeneratorHost knows where to target it\n result.fieldKey = result.fieldKey || item.path.replace(/^\\//, \"\");\n errors.push(result);\n // Add console log to find which plugin fails silently\n Logger.error(\"[MetaUI Validation] Plugin failed validation silently:\", item.path || item.plugin.constructor.name);\n }\n } catch (error) {\n Logger.error(`[MetaUI Engine] Error validating plugin at ${item.path}`, (error as Error).message);\n }\n }\n\n // 2. Recursively validate arrays via StateManager payload traversing for Table layout rows\n if (this.host && typeof (this.host as any).getStateManager === \"function\") {\n const stateManager = (this.host as any).getStateManager();\n if (stateManager) {\n const payload = stateManager.extractPayload();\n const schema = stateManager.getSchema ? stateManager.getSchema() : (this.host as any).getParsedSchema?.();\n if (payload && schema) {\n const arrayErrors = this.validatePayloadArrays(schema, payload, \"\");\n if (applyVisualState) {\n arrayErrors.forEach(err => {\n if (err.fieldKey) {\n this.reportSchemaError(err.fieldKey, err.isValid ? null : err.errorMessage || \"Invalid input\");\n }\n });\n }\n errors.push(...arrayErrors.filter(e => !e.isValid));\n }\n }\n }\n\n return errors;\n }\n\n public onArrayMutated(arrayPath: string): void {\n if (this.host && typeof (this.host as any).getStateManager === \"function\") {\n const stateManager = (this.host as any).getStateManager();\n if (stateManager && typeof stateManager.clearArrayMessages === \"function\") {\n stateManager.clearArrayMessages(arrayPath);\n }\n }\n }\n\n private validatePayloadArrays(schema: any, payload: any, currentPath: string): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n if (!schema || !payload || typeof payload !== \"object\") return errors;\n\n if (schema.type === \"object\" && schema.properties) {\n for (const key of Object.keys(schema.properties)) {\n const propSchema = schema.properties[key];\n if (payload[key] !== undefined) {\n const childPath = currentPath ? `${currentPath}/${key}` : key;\n errors.push(...this.validatePayloadArrays(propSchema, payload[key], childPath));\n }\n }\n } else if (schema.type === \"array\" && schema.items && Array.isArray(payload)) {\n payload.forEach((item, index) => {\n const itemPath = currentPath ? `${currentPath}/${index}` : `${index}`;\n if (schema.items.type === \"object\" && schema.items.properties) {\n for (const key of Object.keys(schema.items.properties)) {\n const propMeta = schema.items.properties[key];\n const propPath = `${itemPath}/${key}`;\n const val = item ? item[key] : undefined;\n \n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {};\n\n if (propMeta.required) validatorsToRun.push(\"required\");\n if (propMeta.maxLength !== undefined) {\n validatorsToRun.push(\"maxLength\");\n argsMap[\"maxLength\"] = propMeta.maxLength;\n }\n if (propMeta.minLength !== undefined) {\n validatorsToRun.push(\"minLength\");\n argsMap[\"minLength\"] = propMeta.minLength;\n }\n if (propMeta.pattern !== undefined) {\n validatorsToRun.push(\"pattern\");\n argsMap[\"pattern\"] = { regex: propMeta.pattern };\n }\n if (propMeta.minimum !== undefined || propMeta.maximum !== undefined) {\n validatorsToRun.push(\"range\");\n argsMap[\"range\"] = { min: propMeta.minimum, max: propMeta.maximum };\n }\n const format = propMeta.ui?.format;\n if (format === \"email\" || format === \"url\" || format === \"iban\") {\n validatorsToRun.push(format);\n }\n \n if (validatorsToRun.length > 0) {\n const res = GlobalPipeline.executeValidation(val, validatorsToRun, argsMap);\n if (!res.isValid) {\n errors.push({\n isValid: false,\n errorMessage: res.errorMessage,\n fieldKey: propPath,\n fieldLabel: propMeta.ui?.label || key\n });\n } else {\n errors.push({ isValid: true, fieldKey: propPath }); // Push successful state to clear old errors\n }\n }\n }\n }\n });\n }\n return errors;\n }\n\n /**\n * Retrieves an active plugin instance by its absolute binding path.\n * Useful for programmatic field manipulation (e.g., custom error injection).\n * \n * @param path The binding path (e.g. \"/General/CustomerName\").\n * @returns {IPlugin | undefined} The plugin instance, or undefined if not found.\n */\n public getPluginByPath(path: string): import(\"../interfaces/IPlugin\").IPlugin | undefined {\n const cleanPath = path.replace(/^\\//, \"\");\n const match = this.activePlugins.find(p => p.path.replace(/^\\//, \"\") === cleanPath);\n return match ? match.plugin : undefined;\n }\n\n /**\n * Reports a localized schema validation error to the coordinator ledger.\n */\n public reportSchemaError(fieldPath: string, errorMessage: string | null): void {\n const cleanPath = fieldPath.replace(/^\\//, \"\");\n if (!this.validationLedger.has(cleanPath)) {\n this.validationLedger.set(cleanPath, { schemaError: null, policyError: null });\n }\n this.validationLedger.get(cleanPath)!.schemaError = errorMessage;\n this.resolveVisualState(cleanPath);\n }\n\n /**\n * Reports a cross-field policy error to the coordinator ledger.\n */\n public reportPolicyError(fieldPath: string, errorMessage: string | null): void {\n const cleanPath = fieldPath.replace(/^\\//, \"\");\n if (!this.validationLedger.has(cleanPath)) {\n this.validationLedger.set(cleanPath, { schemaError: null, policyError: null });\n }\n this.validationLedger.get(cleanPath)!.policyError = errorMessage;\n this.resolveVisualState(cleanPath);\n }\n\n /**\n * Computes the final visual state by checking both engines and applies it to the plugin.\n */\n private resolveVisualState(cleanPath: string): void {\n const plugin = this.getPluginByPath(cleanPath);\n const ledgerEntry = this.validationLedger.get(cleanPath);\n if (!ledgerEntry) return;\n\n const isError = ledgerEntry.policyError !== null || ledgerEntry.schemaError !== null;\n const errorMessage = ledgerEntry.policyError || ledgerEntry.schemaError;\n\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(!isError, isError ? errorMessage || undefined : undefined);\n } else {\n // Un-tracked template clones (Table Layout rows)\n this.setNativeControlError(cleanPath, isError ? errorMessage || undefined : undefined);\n }\n }\n\n private setNativeControlError(targetPath: string, errorMessage?: string): void {\n if (this.host && (this.host as any).generatedContent) {\n const rootControl = (this.host as any).generatedContent;\n this.traverseAndSetError(rootControl, targetPath, errorMessage);\n }\n }\n\n private traverseAndSetError(control: any, targetPath: string, errorMessage?: string): void {\n if (!control) return;\n \n const bindingInfos = [control.getBindingInfo(\"value\"), control.getBindingInfo(\"selectedKey\"), control.getBindingInfo(\"dateValue\"), control.getBindingInfo(\"selected\")];\n for (const info of bindingInfos) {\n if (info && info.parts && info.parts.length > 0) {\n const boundPath = info.parts[0].path;\n // UI5 relative bindings drop the leading slash in the context, but retain it in the path\n if (boundPath === targetPath || targetPath.endsWith(boundPath)) {\n // Ensure we match the exact row context path\n const context = control.getBindingContext((this.host as any).activeModelName);\n if (context) {\n const fullPath = context.getPath() + \"/\" + boundPath;\n const cleanedFullPath = fullPath.replace(/^\\//, \"\");\n if (cleanedFullPath === targetPath) {\n if (typeof control.setValueState === \"function\") {\n control.setValueState(errorMessage ? \"Error\" : \"None\");\n if (typeof control.setValueStateText === \"function\") {\n control.setValueStateText(errorMessage || \"\");\n }\n }\n }\n }\n }\n }\n }\n \n if (typeof control.getAggregation === \"function\" && typeof control.getMetadata === \"function\") {\n const aggs = control.getMetadata().getAggregations();\n for (const aggName in aggs) {\n const child = control.getAggregation(aggName);\n if (Array.isArray(child)) {\n child.forEach(c => this.traverseAndSetError(c, targetPath, errorMessage));\n } else if (child) {\n this.traverseAndSetError(child, targetPath, errorMessage);\n }\n }\n }\n }\n\n /**\n * Cleans up internal state and destroys the condition engine to prevent memory leaks.\n */\n public destroy(): void {\n\n\n for (const item of this.activePlugins) {\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n for (const item of this.templatePlugins) {\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n this.validationLedger.clear();\n this.activePlugins = [];\n this.templatePlugins = [];\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MASSA,cAAc,GAAAC,iBAAA;EAAA,MAIdC,MAAM,GAAAC,eAAA;EAAA,MACNC,sBAAsB,GAAAC,yBAAA;EAAA,MAGtBC,cAAc,GAAAC,kBAAA;EAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,MAAM,CAAC;IAGhB;IACQC,aAAa,GAAwC,EAAE;;IAE/D;IACQC,eAAe,GAAwC,EAAE;;IAEjE;;IAKA;IACQC,gBAAgB,GAA4E,IAAIC,GAAG,CAAC,CAAC;;IAE7G;;IAGA;;IAGA;IACgBC,UAAU,GAAY,IAAI;;IAE1C;IACOC,yBAAyB,GAAY,KAAK;;IAEjD;IACgBC,iBAAiB,GAAY,KAAK;;IAElD;;IAGA;AACJ;AACA;AACA;AACA;AACA;IACIC,WAAWA,CAACC,QAAiB,GAAG,IAAI,EAAEF,iBAA0B,GAAG,KAAK,EAAEG,cA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D,IAAI,CAACjB,MAAM,CAACgH,OAAO,KAAK,UAAU,EAAE;UAC3C/F,IAAI,CAACjB,MAAM,CAACgH,OAAO,CAAC,CAAC;QACzB;MACJ;MAEA,KAAK,MAAM/F,IAAI,IAAI,IAAI,CAACvD,eAAe,EAAE;QACrC,IAAI,OAAOuD,IAAI,CAACjB,MAAM,CAACgH,OAAO,KAAK,UAAU,EAAE;UAC3C/F,IAAI,CAACjB,MAAM,CAACgH,OAAO,CAAC,CAAC;QACzB;MACJ;MAEA,IAAI,CAACrJ,gBAAgB,CAACsJ,KAAK,CAAC,CAAC;MAC7B,IAAI,CAACxJ,aAAa,GAAG,EAAE;MACvB,IAAI,CAACC,eAAe,GAAG,EAAE;IAC7B;EACJ;EAAC,IAAAwJ,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA1J,MAAA,GAAAA,MAAA;EAAA,OAAA0J,SAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Engine-dbg.js","names":["PluginRegistry","___PluginRegistry","Logger","___utils_Logger","DefaultLayoutGenerator","___DefaultLayoutGenerator","GlobalPipeline","___PipelineManager","Engine","activePlugins","templatePlugins","validationLedger","Map","activeMessages","isEditable","hasPartialRenderingErrors","useMessageManager","constructor","editable","pluginRegistry","getInstance","build","schema","model","modelName","onSubmit","engineScopeId","onChange","activeModel","isValid","fieldKey","errorMessage","controlId","reportSchemaError","layoutStrategy","type","layoutManager","getLayout","render","error","msg","message","showErrorPopup","Text","text","generateField","fieldMeta","bindingPath","isTemplate","plugin","getPlugin","ui","widget","setEditable","setUseMessageManager","push","path","scopeId","undefined","control","generateLayout","ensureLayout","warn","validateAll","applyVisualState","errors","item","result","validate","replace","name","host","getStateManager","stateManager","payload","extractPayload","getSchema","getParsedSchema","arrayErrors","validatePayloadArrays","forEach","err","filter","e","onArrayMutated","arrayPath","clearArrayMessages","currentPath","properties","key","Object","keys","propSchema","childPath","items","Array","isArray","index","itemPath","propMeta","propPath","val","validatorsToRun","argsMap","required","maxLength","minLength","pattern","regex","minimum","maximum","min","max","format","length","res","executeValidation","fieldLabel","label","getPluginByPath","cleanPath","match","find","p","fieldPath","has","set","schemaError","policyError","get","resolveVisualState","reportPolicyError","ledgerEntry","isError","setVisualValidationState","setNativeControlError","currentMsg","Messaging","removeMessages","delete","targetPath","processorModel","getModel","getFieldLabel","displayLabel","displayText","newMsg","Message","additionalText","coreLibrary","MessageType","Error","target","processor","addMessages","generatedContent","rootControl","traverseAndSetError","bindingInfos","getBindingInfo","info","parts","boundPath","endsWith","context","getBindingContext","activeModelName","fullPath","getPath","cleanedFullPath","setValueState","setValueStateText","getAggregation","getMetadata","aggs","getAggregations","aggName","child","c","destroy","size","from","values","clear","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\n * @file Engine.ts\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry (v2).\n */\n\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPlugin, IPluginValidationResult } from \"../interfaces/IPlugin\";\n\nimport { PluginRegistry } from \"./PluginRegistry\";\nimport Control from \"sap/ui/core/Control\";\nimport VBox from \"sap/m/VBox\";\nimport Text from \"sap/m/Text\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\nimport { GlobalPipeline } from \"./PipelineManager\";\n\n/**\n * The Engine is responsible for translating a normalized schema into a physical UI5 layout.\n * It delegates layout generation to the configured `LayoutManager` and field generation to the `PluginRegistry`.\n * It strictly routes execution flow and tracks active plugins for validation.\n * It embodies the \"Plugin-First Philosophy\" by routing all complex field and layout rendering\n * through discrete, decoupled plugins rather than handling native overrides.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Engine {\n\n\n /** Array of all instantiated plugins generated during the current build. */\n private activePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Array of template plugins generated for table rows to prevent memory leaks during destruction. */\n private templatePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Deterministic scope ID injected by the host control to prevent clone collisions. */\n public engineScopeId?: string;\n\n private activeModel?: unknown;\n\n /** Ledger tracking local vs cross-field errors to prevent visual race conditions. */\n private validationLedger: Map<string, { schemaError: string | null, policyError: string | null }> = new Map();\n\n /** Tracks active MessageManager messages created by this engine instance. */\n private activeMessages: Map<string, Message> = new Map();\n\n /** Reference to the GeneratorHost that instantiated this engine, for retrieving global definitions. */\n public host?: unknown;\n\n /** Callback to notify the host that an internal field changed. */\n public onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** Tracks whether the entire engine is running in Editable mode. */\n public readonly isEditable: boolean = true;\n\n /** Tracks if any fields or sub-layouts failed to render, requiring a warning strip. */\n public hasPartialRenderingErrors: boolean = false;\n\n /** Tracks whether the engine should delegate visual state to the global MessageManager. */\n public readonly useMessageManager: boolean = false;\n\n /** The injected PluginRegistry instance */\n public readonly pluginRegistry: PluginRegistry;\n\n /**\n * Initializes a new Engine instance.\n * @param editable Whether the engine should render form fields as editable or read-only.\n * @param useMessageManager Whether to delegate visual state to UI5 MessageManager.\n * @param pluginRegistry Optional injected plugin registry. Defaults to singleton.\n */\n constructor(editable: boolean = true, useMessageManager: boolean = false, pluginRegistry?: PluginRegistry) {\n this.isEditable = editable;\n this.useMessageManager = useMessageManager;\n this.pluginRegistry = pluginRegistry || PluginRegistry.getInstance();\n }\n\n /**\n * Bootstraps the layout generation process by resolving the correct layout strategy.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param model The active StateManager JSONModel instance.\n * @param modelName The UI5 model alias used for isolation.\n * @param onSubmit Callback fired when form is submitted.\n * @param engineScopeId Deterministic scope ID for this engine instance.\n * @param onChange Callback fired when field values change.\n * @returns The generated root UI5 Control container.\n */\n public build(schema: ISchema, model: unknown, modelName: string = \"meta\", onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control {\n\n this.activePlugins = [];\n this.activeModel = model;\n this.engineScopeId = engineScopeId;\n this.onChange = (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => {\n if (fieldKey) {\n this.reportSchemaError(fieldKey, isValid ? null : errorMessage || \"Invalid input\");\n }\n\n if (onChange) {\n onChange(isValid, fieldKey, errorMessage, controlId);\n }\n };\n\n try {\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n\n return layoutManager.render(schema, modelName, this, onSubmit);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(\"[MetaUI Engine] Critical error during layout generation\", msg);\n Logger.showErrorPopup(`Engine failed to generate the layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Layout Error\" });\n }\n }\n\n /**\n * Instantiates the correct plugin for a specific field based on type and widget hints,\n * and tracks the plugin for global validation.\n * \n * @param fieldMeta The metadata schema specific to the field.\n * @param bindingPath The JSON path representing the field within the payload.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @returns The generated UI5 Control for the field.\n */\n public generateField(fieldMeta: IPropertyMetadata, bindingPath: string, modelName: string, isTemplate: boolean = false): Control {\n try {\n const plugin = this.pluginRegistry.getPlugin(fieldMeta.type || \"string\", fieldMeta.ui?.widget);\n if (typeof plugin.setEditable === \"function\") {\n plugin.setEditable(this.isEditable);\n }\n\n if (typeof plugin.setUseMessageManager === \"function\") {\n plugin.setUseMessageManager(this.useMessageManager);\n }\n\n if (!isTemplate) {\n this.activePlugins.push({ plugin, path: bindingPath });\n } else {\n this.templatePlugins.push({ plugin, path: bindingPath });\n }\n const scopeId = isTemplate ? undefined : this.engineScopeId;\n const control = plugin.render(fieldMeta, bindingPath, modelName, scopeId, this.onChange, this.activeModel);\n\n\n\n return control;\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Failed to generate field at ${bindingPath}`, msg);\n Logger.showErrorPopup(`Failed to generate field '${bindingPath}'.\\n\\nDetails: ${msg}`);\n return new Text({ text: `[Error generating field ${bindingPath}]` });\n }\n }\n\n /**\n * Generates a sub-layout (like an embedded table or nested form) without \n * destroying the current Engine state or Condition tracking.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param modelName The UI5 JSONModel name used for data binding (defaults to \"meta\").\n * @param bindingPath Optional path to bind the sub-layout to a specific array/object property.\n * @returns The generated root UI5 Control container.\n */\n public generateLayout(schema: ISchema, modelName: string, bindingPath?: string): Control {\n try {\n if (DefaultLayoutGenerator.ensureLayout(schema)) {\n Logger.warn(`[MetaUI Engine] Missing 'uiLayout' array in sub-schema for ${bindingPath}. Synthesized a default layout mapping.`);\n }\n\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n return layoutManager.render(schema, modelName, this, undefined, bindingPath);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Critical error generating sub-layout for ${bindingPath}`, msg);\n Logger.showErrorPopup(`Engine failed to generate a sub-layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Sub-Layout Error\" });\n }\n }\n\n /**\n * Iterates through all active plugins and triggers their internal validation pipelines.\n * \n * @param applyVisualState If true, explicitly instructs the plugin to natively paint its own ValueState.\n * @returns {IPluginValidationResult[]} Array of validation error objects. Empty array if valid.\n */\n public validateAll(applyVisualState: boolean = false): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n for (const item of this.activePlugins) {\n try {\n const result = item.plugin.validate();\n if (applyVisualState) {\n this.reportSchemaError(item.path, result.isValid ? null : result.errorMessage || \"Invalid input\");\n }\n\n if (!result.isValid) {\n // Ensure the path is bound to the error so GeneratorHost knows where to target it\n result.fieldKey = result.fieldKey || item.path.replace(/^\\//, \"\");\n errors.push(result);\n // Add console log to find which plugin fails silently\n Logger.error(\"[MetaUI Validation] Plugin failed validation silently:\", item.path || item.plugin.constructor.name);\n }\n } catch (error) {\n Logger.error(`[MetaUI Engine] Error validating plugin at ${item.path}`, (error as Error).message);\n }\n }\n\n // 2. Recursively validate arrays via StateManager payload traversing for Table layout rows\n if (this.host && typeof (this.host as any).getStateManager === \"function\") {\n const stateManager = (this.host as any).getStateManager();\n if (stateManager) {\n const payload = stateManager.extractPayload();\n const schema = stateManager.getSchema ? stateManager.getSchema() : (this.host as any).getParsedSchema?.();\n if (payload && schema) {\n const arrayErrors = this.validatePayloadArrays(schema, payload, \"\");\n if (applyVisualState) {\n arrayErrors.forEach(err => {\n if (err.fieldKey) {\n this.reportSchemaError(err.fieldKey, err.isValid ? null : err.errorMessage || \"Invalid input\");\n }\n });\n }\n errors.push(...arrayErrors.filter(e => !e.isValid));\n }\n }\n }\n\n return errors;\n }\n\n public onArrayMutated(arrayPath: string): void {\n if (this.host && typeof (this.host as any).getStateManager === \"function\") {\n const stateManager = (this.host as any).getStateManager();\n if (stateManager && typeof stateManager.clearArrayMessages === \"function\") {\n stateManager.clearArrayMessages(arrayPath);\n }\n }\n }\n\n private validatePayloadArrays(schema: any, payload: any, currentPath: string): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n if (!schema || !payload || typeof payload !== \"object\") return errors;\n\n if (schema.type === \"object\" && schema.properties) {\n for (const key of Object.keys(schema.properties)) {\n const propSchema = schema.properties[key];\n if (payload[key] !== undefined) {\n const childPath = currentPath ? `${currentPath}/${key}` : key;\n errors.push(...this.validatePayloadArrays(propSchema, payload[key], childPath));\n }\n }\n } else if (schema.type === \"array\" && schema.items && Array.isArray(payload)) {\n payload.forEach((item, index) => {\n const itemPath = currentPath ? `${currentPath}/${index}` : `${index}`;\n if (schema.items.type === \"object\" && schema.items.properties) {\n for (const key of Object.keys(schema.items.properties)) {\n const propMeta = schema.items.properties[key];\n const propPath = `${itemPath}/${key}`;\n const val = item ? item[key] : undefined;\n \n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {};\n\n if (propMeta.required) validatorsToRun.push(\"required\");\n if (propMeta.maxLength !== undefined) {\n validatorsToRun.push(\"maxLength\");\n argsMap[\"maxLength\"] = propMeta.maxLength;\n }\n if (propMeta.minLength !== undefined) {\n validatorsToRun.push(\"minLength\");\n argsMap[\"minLength\"] = propMeta.minLength;\n }\n if (propMeta.pattern !== undefined) {\n validatorsToRun.push(\"pattern\");\n argsMap[\"pattern\"] = { regex: propMeta.pattern };\n }\n if (propMeta.minimum !== undefined || propMeta.maximum !== undefined) {\n validatorsToRun.push(\"range\");\n argsMap[\"range\"] = { min: propMeta.minimum, max: propMeta.maximum };\n }\n const format = propMeta.ui?.format;\n if (format === \"email\" || format === \"url\" || format === \"iban\") {\n validatorsToRun.push(format);\n }\n \n if (validatorsToRun.length > 0) {\n const res = GlobalPipeline.executeValidation(val, validatorsToRun, argsMap);\n if (!res.isValid) {\n errors.push({\n isValid: false,\n errorMessage: res.errorMessage,\n fieldKey: propPath,\n fieldLabel: propMeta.ui?.label || key\n });\n } else {\n errors.push({ isValid: true, fieldKey: propPath }); // Push successful state to clear old errors\n }\n }\n }\n }\n });\n }\n return errors;\n }\n\n /**\n * Retrieves an active plugin instance by its absolute binding path.\n * Useful for programmatic field manipulation (e.g., custom error injection).\n * \n * @param path The binding path (e.g. \"/General/CustomerName\").\n * @returns {IPlugin | undefined} The plugin instance, or undefined if not found.\n */\n public getPluginByPath(path: string): import(\"../interfaces/IPlugin\").IPlugin | undefined {\n const cleanPath = path.replace(/^\\//, \"\");\n const match = this.activePlugins.find(p => p.path.replace(/^\\//, \"\") === cleanPath);\n return match ? match.plugin : undefined;\n }\n\n /**\n * Reports a localized schema validation error to the coordinator ledger.\n */\n public reportSchemaError(fieldPath: string, errorMessage: string | null): void {\n const cleanPath = fieldPath.replace(/^\\//, \"\");\n if (!this.validationLedger.has(cleanPath)) {\n this.validationLedger.set(cleanPath, { schemaError: null, policyError: null });\n }\n this.validationLedger.get(cleanPath)!.schemaError = errorMessage;\n this.resolveVisualState(cleanPath);\n }\n\n /**\n * Reports a cross-field policy error to the coordinator ledger.\n */\n public reportPolicyError(fieldPath: string, errorMessage: string | null): void {\n const cleanPath = fieldPath.replace(/^\\//, \"\");\n if (!this.validationLedger.has(cleanPath)) {\n this.validationLedger.set(cleanPath, { schemaError: null, policyError: null });\n }\n this.validationLedger.get(cleanPath)!.policyError = errorMessage;\n this.resolveVisualState(cleanPath);\n }\n\n /**\n * Computes the final visual state by checking both engines and applies it to the plugin.\n */\n private resolveVisualState(cleanPath: string): void {\n const plugin = this.getPluginByPath(cleanPath);\n const ledgerEntry = this.validationLedger.get(cleanPath);\n if (!ledgerEntry) return;\n\n const isError = ledgerEntry.policyError !== null || ledgerEntry.schemaError !== null;\n const errorMessage = ledgerEntry.policyError || ledgerEntry.schemaError;\n\n if (plugin && typeof plugin.setVisualValidationState === \"function\") {\n plugin.setVisualValidationState(!isError, isError ? errorMessage || undefined : undefined);\n } else {\n // Un-tracked template clones (Table Layout rows)\n this.setNativeControlError(cleanPath, isError ? errorMessage || undefined : undefined);\n }\n\n if (this.useMessageManager) {\n const currentMsg = this.activeMessages.get(cleanPath);\n if (currentMsg) {\n Messaging.removeMessages(currentMsg);\n this.activeMessages.delete(cleanPath);\n }\n if (isError) {\n const targetPath = `/${cleanPath}`;\n const processorModel = this.host && typeof (this.host as any).getStateManager === \"function\" \n ? (this.host as any).getStateManager()?.getModel() \n : undefined;\n \n const fieldLabel = typeof plugin?.getFieldLabel === \"function\" ? plugin.getFieldLabel() : undefined;\n const displayLabel = fieldLabel || cleanPath;\n const displayText = `Field '${displayLabel}': ${errorMessage || \"Validation Error\"}`;\n \n const newMsg = new Message({\n message: displayText,\n additionalText: displayLabel !== targetPath ? displayLabel : undefined,\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: processorModel\n });\n Messaging.addMessages(newMsg);\n this.activeMessages.set(cleanPath, newMsg);\n }\n }\n }\n\n private setNativeControlError(targetPath: string, errorMessage?: string): void {\n if (this.host && (this.host as any).generatedContent) {\n const rootControl = (this.host as any).generatedContent;\n this.traverseAndSetError(rootControl, targetPath, errorMessage);\n }\n }\n\n private traverseAndSetError(control: any, targetPath: string, errorMessage?: string): void {\n if (!control) return;\n \n const bindingInfos = [control.getBindingInfo(\"value\"), control.getBindingInfo(\"selectedKey\"), control.getBindingInfo(\"dateValue\"), control.getBindingInfo(\"selected\")];\n for (const info of bindingInfos) {\n if (info && info.parts && info.parts.length > 0) {\n const boundPath = info.parts[0].path;\n // UI5 relative bindings drop the leading slash in the context, but retain it in the path\n if (boundPath === targetPath || targetPath.endsWith(boundPath)) {\n // Ensure we match the exact row context path\n const context = control.getBindingContext((this.host as any).activeModelName);\n if (context) {\n const fullPath = context.getPath() + \"/\" + boundPath;\n const cleanedFullPath = fullPath.replace(/^\\//, \"\");\n if (cleanedFullPath === targetPath) {\n if (typeof control.setValueState === \"function\") {\n control.setValueState(errorMessage ? \"Error\" : \"None\");\n if (typeof control.setValueStateText === \"function\") {\n control.setValueStateText(errorMessage || \"\");\n }\n }\n }\n }\n }\n }\n }\n \n if (typeof control.getAggregation === \"function\" && typeof control.getMetadata === \"function\") {\n const aggs = control.getMetadata().getAggregations();\n for (const aggName in aggs) {\n const child = control.getAggregation(aggName);\n if (Array.isArray(child)) {\n child.forEach(c => this.traverseAndSetError(c, targetPath, errorMessage));\n } else if (child) {\n this.traverseAndSetError(child, targetPath, errorMessage);\n }\n }\n }\n }\n\n /**\n * Cleans up internal state and destroys the condition engine to prevent memory leaks.\n */\n public destroy(): void {\n\n\n for (const item of this.activePlugins) {\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n for (const item of this.templatePlugins) {\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n if (this.useMessageManager && this.activeMessages.size > 0) {\n Messaging.removeMessages(Array.from(this.activeMessages.values()));\n }\n\n this.validationLedger.clear();\n this.activeMessages.clear();\n this.activePlugins = [];\n this.templatePlugins = [];\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MASSA,cAAc,GAAAC,iBAAA;EAAA,MAIdC,MAAM,GAAAC,eAAA;EAAA,MACNC,sBAAsB,GAAAC,yBAAA;EAAA,MAKtBC,cAAc,GAAAC,kBAAA;EAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,MAAM,CAAC;IAGhB;IACQC,aAAa,GAAwC,EAAE;;IAE/D;IACQC,eAAe,GAAwC,EAAE;;IAEjE;;IAKA;IACQC,gBAAgB,GAA4E,IAAIC,GAAG,CAAC,CAAC;;IAE7G;IACQC,cAAc,GAAyB,IAAID,GAAG,CAAC,CAAC;;IAExD;;IAGA;;IAGA;IACgBE,UAAU,GAAY,IAAI;;IAE1C;IACOC,yBAAyB,GAAY,KAAK;;IAEjD;IACgBC,iBAAiB,GAAY,KAAK;;IAElD;;IAGA;AACJ;AACA;AACA;AACA;AACA;IACIC,WAAWA,CAACC,QAAiB,GAAG,IAAI,EAAEF,iBAA0B,GAAG,KAAK,EAAEG,cAA+B,EAAE;MACvG,IAAI,CAACL,UAAU,GAAGI,QAAQ;MAC1B,IAAI,CAACF,iBAAiB,GAAGA,iBAAiB;MAC1C,IAAI,CAACG,cAAc,GAAGA,cAAc,IAAInB,cAAc,CAACoB,WAAW,CAAC,CAAC;IACxE;;IAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACWC,KAAKA,CAACC,MAAe,EAAEC,KAAc,EAAEC,SAAiB,GAAG,MAAM,EAAEC,QAAqB,EAAEC,aAAsB,EAAEC,QAAmG,EAAW;MAEnO,IAAI,CAAClB,aAAa,GAAG,EAAE;MACvB,IAAI,CAACmB,WA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c,CAACyK,MAAM,CAAC,CAAC,CAAC,CAAC;MACtE;MAEA,IAAI,CAAC3K,gBAAgB,CAAC4K,KAAK,CAAC,CAAC;MAC7B,IAAI,CAAC1K,cAAc,CAAC0K,KAAK,CAAC,CAAC;MAC3B,IAAI,CAAC9K,aAAa,GAAG,EAAE;MACvB,IAAI,CAACC,eAAe,GAAG,EAAE;IAC7B;EACJ;EAAC,IAAA8K,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAhL,MAAA,GAAAA,MAAA;EAAA,OAAAgL,SAAA;AAAA","ignoreList":[]}
|
|
@@ -27,6 +27,8 @@ declare module "nz/co/siliconst/ui5/metaui/core/Engine" {
|
|
|
27
27
|
private activeModel?;
|
|
28
28
|
/** Ledger tracking local vs cross-field errors to prevent visual race conditions. */
|
|
29
29
|
private validationLedger;
|
|
30
|
+
/** Tracks active MessageManager messages created by this engine instance. */
|
|
31
|
+
private activeMessages;
|
|
30
32
|
/** Reference to the GeneratorHost that instantiated this engine, for retrieving global definitions. */
|
|
31
33
|
host?: unknown;
|
|
32
34
|
/** Callback to notify the host that an internal field changed. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Engine.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/Engine.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,wCAAwC,CAAC;IACxD;;;OAGG;IAEH,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAE3F,OAAO,EAAW,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;IAEjG,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;IAChF,OAAO,OAAO,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Engine.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/Engine.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,wCAAwC,CAAC;IACxD;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