@siliconst/metaui 1.4.8 → 1.4.10
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 +13 -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.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 +14 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +2 -0
- 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.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +3 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +10 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +10 -0
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js +2 -2
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js +10 -9
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.d.ts +13 -0
- package/src/nz/co/siliconst/ui5/metaui/library.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.ts +19 -1
- package/src/nz/co/siliconst/ui5/metaui/manifest.json +2 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js +11 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.ts +10 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +14 -3
- 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.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 +14 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js +5 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.ts +5 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js +11 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.ts +10 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js +39 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.d.ts +4 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.ts +40 -2
- package/src/nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder-dbg.js +50 -0
- package/src/nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder.d.ts +19 -0
- package/src/nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder.ts +43 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Engine.js","names":["ConditionEngine","___ConditionEngine","PluginRegistry","___PluginRegistry","Logger","___utils_Logger","DefaultLayoutGenerator","___DefaultLayoutGenerator","Engine","conditionEngine","activePlugins","isEditable","constructor","editable","this","build","schema","model","modelName","onSubmit","engineScopeId","onChange","activeModel","isValid","fieldKey","errorMessage","controlId","handleEvent","ensureLayout","warn","layoutStrategy","type","layoutManager","getInstance","getLayout","render","error","msg","message","showErrorPopup","Text","text","generateField","fieldMeta","bindingPath","isTemplate","plugin","getPlugin","ui","widget","setEditable","push","path","scopeId","undefined","control","registerPlugin","generateLayout","validateAll","errors","item","result","validate","replace","name","destroy","messageManager","Messaging","existingMessages","getMessageModel","getData","messagesToRemove","targetPath","matched","filter","getTarget","getMessageProcessor","getId","length","removeMessages","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\n * @file Engine.ts\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry (v2).\n */\n\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPlugin, IPluginValidationResult } from \"../interfaces/IPlugin\";\nimport { ConditionEngine } from \"./ConditionEngine\";\nimport { PluginRegistry } from \"./PluginRegistry\";\nimport Control from \"sap/ui/core/Control\";\nimport VBox from \"sap/m/VBox\";\nimport Text from \"sap/m/Text\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n/**\n * The Engine is responsible for translating a normalized schema into a physical UI5 layout.\n * It delegates layout generation to the configured `LayoutManager` and field generation to the `PluginRegistry`.\n * It strictly routes execution flow and tracks active plugins for validation.\n * It embodies the \"Plugin-First Philosophy\" by routing all complex field and layout rendering\n * through discrete, decoupled plugins rather than handling native overrides.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Engine {\n /** Handles dynamic conditional logic across the active form. */\n private conditionEngine: ConditionEngine | null = null;\n\n /** Array of all instantiated plugins generated during the current build. */\n private activePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Deterministic scope ID injected by the host control to prevent clone collisions. */\n public engineScopeId?: string;\n\n private activeModel?: sap.ui.model.Model;\n\n /** Tracks whether the entire engine is running in Editable mode. */\n public readonly isEditable: boolean = true;\n\n /**\n * Initializes a new Engine instance.\n * @param editable Whether the engine should render form fields as editable or read-only.\n */\n constructor(editable: boolean = true) {\n this.isEditable = editable;\n }\n\n /**\n * Bootstraps the layout generation process by resolving the correct layout strategy.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param model The active StateManager JSONModel instance.\n * @param modelName The UI5 model alias used for isolation.\n * @param onSubmit Callback fired when form is submitted.\n * @param engineScopeId Deterministic scope ID for this engine instance.\n * @param onChange Callback fired when field values change.\n * @returns The generated root UI5 Control container.\n */\n public build(schema: ISchema, model: sap.ui.model.Model, modelName: string = \"meta\", onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control {\n this.conditionEngine = new ConditionEngine(schema);\n this.activePlugins = [];\n this.activeModel = model;\n this.engineScopeId = engineScopeId;\n this.onChange = (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => {\n if (this.conditionEngine && fieldKey) {\n this.conditionEngine.handleEvent(fieldKey, isValid);\n }\n if (onChange) {\n onChange(isValid, fieldKey, errorMessage, controlId);\n }\n };\n\n try {\n // Intercept and synthesize a default layout if the developer/backend failed to provide one\n if (DefaultLayoutGenerator.ensureLayout(schema)) {\n Logger.warn(\"[MetaUI Engine] Missing 'uiLayout' array in schema. Synthesized a default layout mapping to prevent a blank render.\");\n }\n\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = PluginRegistry.getInstance().getLayout(layoutStrategy);\n\n return layoutManager.render(schema, modelName, this, onSubmit);\n } catch (error) {\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 = PluginRegistry.getInstance().getPlugin(fieldMeta.type || \"string\", fieldMeta.ui?.widget);\n plugin.setEditable(this.isEditable);\n\n if (!isTemplate) {\n this.activePlugins.push({ plugin, path: bindingPath });\n }\n const scopeId = isTemplate ? undefined : this.engineScopeId;\n const control = plugin.render(fieldMeta, bindingPath, modelName, scopeId, this.onChange);\n\n if (this.conditionEngine) {\n this.conditionEngine.registerPlugin(bindingPath, plugin);\n }\n\n return control;\n } catch (error) {\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Failed to generate field at ${bindingPath}`, msg);\n Logger.showErrorPopup(`Failed to generate field '${bindingPath}'.\\n\\nDetails: ${msg}`);\n return new Text({ text: `[Error generating field ${bindingPath}]` });\n }\n }\n\n /**\n * Generates a sub-layout (like an embedded table or nested form) without \n * destroying the current Engine state or Condition tracking.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param modelName The UI5 JSONModel name used for data binding (defaults to \"meta\").\n * @param bindingPath Optional path to bind the sub-layout to a specific array/object property.\n * @returns The generated root UI5 Control container.\n */\n public generateLayout(schema: ISchema, modelName: string, bindingPath?: string): Control {\n try {\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = PluginRegistry.getInstance().getLayout(layoutStrategy);\n return layoutManager.render(schema, modelName, this, undefined, bindingPath);\n } catch (error) {\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 * @returns {IPluginValidationResult[]} Array of validation error objects. Empty array if valid.\n */\n public validateAll(): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n for (const item of this.activePlugins) {\n try {\n const result = item.plugin.validate();\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 const msg = (error as Error).message;\n Logger.error(`[MetaUI Validation] Exception during plugin validation at path ${item.path}`, msg);\n errors.push({ isValid: false, errorMessage: `Validation crashed: ${msg}`, fieldKey: item.path.replace(/^\\//, \"\") });\n }\n }\n return errors;\n }\n\n /**\n * Cleans up internal state and destroys the condition engine to prevent memory leaks.\n */\n public destroy(): void {\n if (this.conditionEngine) {\n this.conditionEngine.destroy();\n this.conditionEngine = null;\n }\n\n // ------------------------------------------------------------------------\n // Ghost Error Prevention\n // Flush MessageManager for active plugins before destroying their controls\n // ------------------------------------------------------------------------\n const messageManager = Messaging;\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove: sap.ui.core.message.Message[] = [];\n\n for (const item of this.activePlugins) {\n if (this.activeModel) {\n const targetPath = `/${item.path.replace(/^\\//, \"\")}`;\n const matched = existingMessages.filter((msg: sap.ui.core.message.Message) =>\n msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.activeModel.getId()\n );\n messagesToRemove.push(...matched);\n }\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n\n this.activePlugins = [];\n }\n}\n"],"mappings":"4KAAA,MAQSA,EAAeC,EAAA,yBACfC,EAAcC,EAAA,wBAIdC,EAAMC,EAAA,gBACNC,EAAsBC,EAAA,0BAcxB,MAAMC,EAEDC,gBAA0C,KAG1CC,cAAqD,GAQ7CC,WAAsB,KAMtCC,YAAYC,EAAoB,MAC5BC,KAAKH,WAAaE,CACtB,CAaOE,MAAMC,EAAiBC,EAA2BC,EAAoB,OAAQC,EAAuBC,EAAwBC,GAChIP,KAAKL,gBAAkB,IAAIT,EAAgBgB,GAC3CF,KAAKJ,cAAgB,GACrBI,KAAKQ,YAAcL,EACnBH,KAAKM,cAAgBA,EACrBN,KAAKO,SAAW,CAACE,EAAkBC,EAAmBC,EAAuBC,KACzE,GAAIZ,KAAKL,iBAAmBe,EAAU,CAClCV,KAAKL,gBAAgBkB,YAAYH,EAAUD,EAC/C,CACA,GAAIF,EAAU,CACVA,EAASE,EAASC,EAAUC,EAAcC,EAC9C,GAGJ,IAEI,GAAIpB,EAAuBsB,aAAaZ,GAAS,CAC7CZ,EAAOyB,KAAK,sHAChB,CAEA,MAAMC,EAAiBd,EAAOc,iBAAmBd,EAAOe,OAAS,QAAU,QAAU,QACrF,MAAMC,EAAgB9B,EAAe+B,cAAcC,UAAUJ,GAE7D,OAAOE,EAAcG,OAAOnB,EAAQE,EAAWJ,KAAMK,EACzD,CAAE,MAAOiB,GACL,MAAMC,EAAOD,EAAgBE,QAC7BlC,EAAOgC,MAAM,0DAA2DC,GACxEjC,EAAOmC,eAAe,qDAAqDF,KAC3E,OAAO,IAAIG,EAA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,EAAOrC,UAAYoC,EAAKR,KAAKW,QAAQ,MAAO,IAC9DJ,EAAOR,KAAKU,GAEZzD,EAAOgC,MAAM,yDAA0DwB,EAAKR,MAAQQ,EAAKd,OAAOlC,YAAYoD,KAChH,CACJ,CAAE,MAAO5B,GACL,MAAMC,EAAOD,EAAgBE,QAC7BlC,EAAOgC,MAAM,kEAAkEwB,EAAKR,OAAQf,GAC5FsB,EAAOR,KAAK,CAAE5B,QAAS,MAAOE,aAAc,uBAAuBY,IAAOb,SAAUoC,EAAKR,KAAKW,QAAQ,MAAO,KACjH,CACJ,CACA,OAAOJ,CACX,CAKOM,UACH,GAAInD,KAAKL,gBAAiB,CACtBK,KAAKL,gBAAgBwD,UACrBnD,KAAKL,gBAAkB,IAC3B,CAMA,MAAMyD,EAAiBC,EACvB,MAAMC,EAAmBF,EAAeG,kBAAkBC,UAC1D,MAAMC,EAAkD,GAExD,IAAK,MAAMX,KAAQ9C,KAAKJ,cAAe,CACnC,GAAII,KAAKQ,YAAa,CAClB,MAAMkD,EAAa,IAAIZ,EAAKR,KAAKW,QAAQ,MAAO,MAChD,MAAMU,EAAUL,EAAiBM,OAAQrC,GACrCA,EAAIsC,cAAgBH,GAAcnC,EAAIuC,uBAAyBvC,EAAIuC,sBAAsBC,UAAY/D,KAAKQ,YAAYuD,SAE1HN,EAAiBpB,QAAQsB,EAC7B,CACA,UAAWb,EAAKd,OAAOmB,UAAY,WAAY,CAC3CL,EAAKd,OAAOmB,SAChB,CACJ,CAEA,GAAIM,EAAiBO,OAAS,EAAG,CAC7BZ,EAAea,eAAeR,EAClC,CAEAzD,KAAKJ,cAAgB,EACzB,EACH,IAAAsE,EAAA,CAAAC,WAAA,MAAAD,EAAAxE,SAAA,OAAAwE,CAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Engine.js","names":["ConditionEngine","___ConditionEngine","PluginRegistry","___PluginRegistry","Logger","___utils_Logger","DefaultLayoutGenerator","___DefaultLayoutGenerator","Engine","conditionEngine","activePlugins","isEditable","constructor","editable","this","build","schema","model","modelName","onSubmit","engineScopeId","onChange","activeModel","isValid","fieldKey","errorMessage","controlId","handleEvent","ensureLayout","warn","layoutStrategy","type","layoutManager","getInstance","getLayout","render","error","msg","message","showErrorPopup","Text","text","generateField","fieldMeta","bindingPath","isTemplate","plugin","getPlugin","ui","widget","setEditable","push","path","scopeId","undefined","control","registerPlugin","generateLayout","validateAll","errors","item","result","validate","replace","name","destroy","messageManager","Messaging","existingMessages","getMessageModel","getData","messagesToRemove","targetPath","matched","filter","getTarget","getMessageProcessor","getId","length","removeMessages","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\n * @file Engine.ts\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry (v2).\n */\n\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPlugin, IPluginValidationResult } from \"../interfaces/IPlugin\";\nimport { ConditionEngine } from \"./ConditionEngine\";\nimport { PluginRegistry } from \"./PluginRegistry\";\nimport Control from \"sap/ui/core/Control\";\nimport VBox from \"sap/m/VBox\";\nimport Text from \"sap/m/Text\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n/**\n * The Engine is responsible for translating a normalized schema into a physical UI5 layout.\n * It delegates layout generation to the configured `LayoutManager` and field generation to the `PluginRegistry`.\n * It strictly routes execution flow and tracks active plugins for validation.\n * It embodies the \"Plugin-First Philosophy\" by routing all complex field and layout rendering\n * through discrete, decoupled plugins rather than handling native overrides.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Engine {\n /** Handles dynamic conditional logic across the active form. */\n private conditionEngine: ConditionEngine | null = null;\n\n /** Array of all instantiated plugins generated during the current build. */\n private activePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Deterministic scope ID injected by the host control to prevent clone collisions. */\n public engineScopeId?: string;\n\n private activeModel?: sap.ui.model.Model;\n\n /** 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 /**\n * Initializes a new Engine instance.\n * @param editable Whether the engine should render form fields as editable or read-only.\n */\n constructor(editable: boolean = true) {\n this.isEditable = editable;\n }\n\n /**\n * Bootstraps the layout generation process by resolving the correct layout strategy.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param model The active StateManager JSONModel instance.\n * @param modelName The UI5 model alias used for isolation.\n * @param onSubmit Callback fired when form is submitted.\n * @param engineScopeId Deterministic scope ID for this engine instance.\n * @param onChange Callback fired when field values change.\n * @returns The generated root UI5 Control container.\n */\n public build(schema: ISchema, model: sap.ui.model.Model, modelName: string = \"meta\", onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control {\n this.conditionEngine = new ConditionEngine(schema);\n this.activePlugins = [];\n this.activeModel = model;\n this.engineScopeId = engineScopeId;\n this.onChange = (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => {\n if (this.conditionEngine && fieldKey) {\n this.conditionEngine.handleEvent(fieldKey, isValid);\n }\n if (onChange) {\n onChange(isValid, fieldKey, errorMessage, controlId);\n }\n };\n\n try {\n // Intercept and synthesize a default layout if the developer/backend failed to provide one\n if (DefaultLayoutGenerator.ensureLayout(schema)) {\n Logger.warn(\"[MetaUI Engine] Missing 'uiLayout' array in schema. Synthesized a default layout mapping to prevent a blank render.\");\n }\n\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = PluginRegistry.getInstance().getLayout(layoutStrategy);\n\n return layoutManager.render(schema, modelName, this, onSubmit);\n } catch (error) {\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 = PluginRegistry.getInstance().getPlugin(fieldMeta.type || \"string\", fieldMeta.ui?.widget);\n plugin.setEditable(this.isEditable);\n\n if (!isTemplate) {\n this.activePlugins.push({ plugin, path: bindingPath });\n }\n const scopeId = isTemplate ? undefined : this.engineScopeId;\n const control = plugin.render(fieldMeta, bindingPath, modelName, scopeId, this.onChange);\n\n if (this.conditionEngine) {\n this.conditionEngine.registerPlugin(bindingPath, plugin);\n }\n\n return control;\n } catch (error) {\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Failed to generate field at ${bindingPath}`, msg);\n Logger.showErrorPopup(`Failed to generate field '${bindingPath}'.\\n\\nDetails: ${msg}`);\n return new Text({ text: `[Error generating field ${bindingPath}]` });\n }\n }\n\n /**\n * Generates a sub-layout (like an embedded table or nested form) without \n * destroying the current Engine state or Condition tracking.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param modelName The UI5 JSONModel name used for data binding (defaults to \"meta\").\n * @param bindingPath Optional path to bind the sub-layout to a specific array/object property.\n * @returns The generated root UI5 Control container.\n */\n public generateLayout(schema: ISchema, modelName: string, bindingPath?: string): Control {\n try {\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = PluginRegistry.getInstance().getLayout(layoutStrategy);\n return layoutManager.render(schema, modelName, this, undefined, bindingPath);\n } catch (error) {\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 * @returns {IPluginValidationResult[]} Array of validation error objects. Empty array if valid.\n */\n public validateAll(): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n for (const item of this.activePlugins) {\n try {\n const result = item.plugin.validate();\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 const msg = (error as Error).message;\n Logger.error(`[MetaUI Validation] Exception during plugin validation at path ${item.path}`, msg);\n errors.push({ isValid: false, errorMessage: `Validation crashed: ${msg}`, fieldKey: item.path.replace(/^\\//, \"\") });\n }\n }\n return errors;\n }\n\n /**\n * Cleans up internal state and destroys the condition engine to prevent memory leaks.\n */\n public destroy(): void {\n if (this.conditionEngine) {\n this.conditionEngine.destroy();\n this.conditionEngine = null;\n }\n\n // ------------------------------------------------------------------------\n // Ghost Error Prevention\n // Flush MessageManager for active plugins before destroying their controls\n // ------------------------------------------------------------------------\n const messageManager = Messaging;\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove: sap.ui.core.message.Message[] = [];\n\n for (const item of this.activePlugins) {\n if (this.activeModel) {\n const targetPath = `/${item.path.replace(/^\\//, \"\")}`;\n const matched = existingMessages.filter((msg: sap.ui.core.message.Message) =>\n msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.activeModel.getId()\n );\n messagesToRemove.push(...matched);\n }\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesTo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R,OAAQf,GAC5FsB,EAAOR,KAAK,CAAE5B,QAAS,MAAOE,aAAc,uBAAuBY,IAAOb,SAAUoC,EAAKR,KAAKW,QAAQ,MAAO,KACjH,CACJ,CACA,OAAOJ,CACX,CAKOM,UACH,GAAInD,KAAKL,gBAAiB,CACtBK,KAAKL,gBAAgBwD,UACrBnD,KAAKL,gBAAkB,IAC3B,CAMA,MAAMyD,EAAiBC,EACvB,MAAMC,EAAmBF,EAAeG,kBAAkBC,UAC1D,MAAMC,EAAkD,GAExD,IAAK,MAAMX,KAAQ9C,KAAKJ,cAAe,CACnC,GAAII,KAAKQ,YAAa,CAClB,MAAMkD,EAAa,IAAIZ,EAAKR,KAAKW,QAAQ,MAAO,MAChD,MAAMU,EAAUL,EAAiBM,OAAQrC,GACrCA,EAAIsC,cAAgBH,GAAcnC,EAAIuC,uBAAyBvC,EAAIuC,sBAAsBC,UAAY/D,KAAKQ,YAAYuD,SAE1HN,EAAiBpB,QAAQsB,EAC7B,CACA,UAAWb,EAAKd,OAAOmB,UAAY,WAAY,CAC3CL,EAAKd,OAAOmB,SAChB,CACJ,CAEA,GAAIM,EAAiBO,OAAS,EAAG,CAC7BZ,EAAea,eAAeR,EAClC,CAEAzD,KAAKJ,cAAgB,EACzB,EACH,IAAAsE,EAAA,CAAAC,WAAA,MAAAD,EAAAxE,SAAA,OAAAwE,CAAA","ignoreList":[]}
|
|
@@ -38,6 +38,9 @@ export class Engine {
|
|
|
38
38
|
|
|
39
39
|
private activeModel?: sap.ui.model.Model;
|
|
40
40
|
|
|
41
|
+
/** Callback to notify the host that an internal field changed. */
|
|
42
|
+
public onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;
|
|
43
|
+
|
|
41
44
|
/** Tracks whether the entire engine is running in Editable mode. */
|
|
42
45
|
public readonly isEditable: boolean = true;
|
|
43
46
|
|
|
@@ -47,6 +47,11 @@ sap.ui.define(["sap/m/Table", "sap/m/Column", "sap/m/Text", "sap/m/ColumnListIte
|
|
|
47
47
|
const data = Array.isArray(rawData) ? rawData : [];
|
|
48
48
|
const newData = [...data, {}];
|
|
49
49
|
model.setProperty(info.path, newData);
|
|
50
|
+
|
|
51
|
+
// CRITICAL: Notify the engine so it extracts payload and triggers liveUpdate
|
|
52
|
+
if (engine.onChange) {
|
|
53
|
+
engine.onChange(true, actualPath.replace(/^\//, ""));
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
56
|
})])]
|
|
52
57
|
}),
|
|
@@ -65,6 +70,11 @@ sap.ui.define(["sap/m/Table", "sap/m/Column", "sap/m/Text", "sap/m/ColumnListIte
|
|
|
65
70
|
const newData = [...data];
|
|
66
71
|
newData.splice(index, 1);
|
|
67
72
|
model.setProperty(arrayPath, newData);
|
|
73
|
+
|
|
74
|
+
// CRITICAL: Notify the engine so it extracts payload and triggers liveUpdate
|
|
75
|
+
if (engine.onChange) {
|
|
76
|
+
engine.onChange(true, actualPath.replace(/^\//, ""));
|
|
77
|
+
}
|
|
68
78
|
}
|
|
69
79
|
});
|
|
70
80
|
const templateCells = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableLayout-dbg.js","names":["SchemaNormalizer","___core_SchemaNormalizer","Logger","___utils_Logger","TableLayout","render","schema","modelName","engine","onSubmit","bindingPath","type","items","properties","Error","tableTitle","title","actualModelName","actualPath","table","Table","headerToolbar","Toolbar","content","Title","text","ToolbarSpacer","isEditable","Button","icon","press","oEvent","btn","getSource","tbl","getParent","model","getModel","info","getBindingInfo","path","rawData","getProperty","data","Array","isArray","newData","setProperty","fixedLayout","mode","delete","item","getParameter","getBindingContext","getPath","splitPaths","split","index","parseInt","pop","arrayPath","join","splice","templateCells","props","layoutElements","uiLayout","forEach","element","scope","meta","fieldMeta","propKey","resolveScope","error","addColumn","Column","header","Text","label","ui","demandPopin","isKey","minScreenWidth","popinDisplay","effectiveMeta","widget","control","generateField","push","warn","debug","Object","keys","key","column","msg","message","showErrorPopup","rowTemplate","ColumnListItem","cells","bindItems","template","templateShareable","__exports","__esModule"],"sources":["TableLayout.ts"],"sourcesContent":["/**\n * @file TableLayout.ts\n * @description Generates a responsive SAP Fiori Table layout for v2 schema.\n */\n\nimport Table from \"sap/m/Table\";\nimport Column from \"sap/m/Column\";\nimport Text from \"sap/m/Text\";\nimport ColumnListItem from \"sap/m/ColumnListItem\";\nimport Toolbar from \"sap/m/Toolbar\";\nimport Title from \"sap/m/Title\";\nimport ToolbarSpacer from \"sap/m/ToolbarSpacer\";\nimport Button from \"sap/m/Button\";\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport Control from \"sap/ui/core/Control\";\nimport { IPropertyMetadata, ISchema, ILayoutElement } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Engine } from \"../core/Engine\";\nimport { SchemaNormalizer } from \"../core/SchemaNormalizer\";\nimport { Logger } from \"../utils/Logger\";\n\n/**\n * Layout Manager responsible for generating a responsive SAP Fiori Table.\n * It is automatically utilized by the Engine when the schema root or property is of type 'array'.\n * Includes built-in support for adding and deleting rows via dynamic data binding manipulation.\n * \n * @namespace nz.co.siliconst.ui5.metaui.layouts\n * @public\n */\nexport class TableLayout implements ILayoutManager {\n /**\n * Renders the JSON Schema array properties into a UI5 Table.\n * \n * @param schema The active JSON schema array definition.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @param engine The central orchestrator for delegating column plugin generation.\n * @param onSubmit Optional submit hook.\n * @param bindingPath The JSON path representing the array within the payload.\n * @returns {Control} The generated sap.m.Table control.\n * @throws {Error} If the provided schema is not of type 'array'.\n */\n public render(schema: ISchema, modelName: string, engine: Engine, onSubmit?: () => void, bindingPath: string = \"/\"): Control {\n if (schema.type !== \"array\" || !schema.items || !schema.items.properties) {\n throw new Error(\"[MetaUI] TableLayout requires an array schema with items.properties.\");\n }\n\n const tableTitle = schema.title || \"Table\";\n const actualModelName = modelName;\n const actualPath = bindingPath;\n\n const table = new Table({\n headerToolbar: new Toolbar({\n content: [\n new Title({ text: tableTitle }),\n new ToolbarSpacer(),\n ...(!engine.isEditable ? [] : [\n new Button({\n text: \"Add Row\",\n icon: \"sap-icon://add\",\n press: (oEvent: sap.ui.base.Event) => {\n const btn = oEvent.getSource();\n const tbl = btn.getParent().getParent() as Table;\n const model = tbl.getModel(actualModelName) as JSONModel;\n const info = tbl.getBindingInfo(\"items\");\n if (!info || !info.path) return;\n\n const rawData = model.getProperty(info.path);\n const data = Array.isArray(rawData) ? rawData : [];\n const newData = [...data, {}];\n model.setProperty(info.path, newData);\n }\n })\n ])\n ]\n }),\n fixedLayout: false,\n mode: !engine.isEditable ? \"None\" : \"Delete\",\n delete: (oEvent: sap.ui.base.Event) => {\n const item = oEvent.getParameter(\"listItem\");\n const path = item.getBindingContext(actualModelName).getPath();\n const model = item.getModel(actualModelName) as JSONModel;\n\n const splitPaths = path.split(\"/\");\n const index = parseInt(splitPaths.pop() || \"0\", 10);\n let arrayPath = splitPaths.join(\"/\");\n if (arrayPath === \"\") arrayPath = \"/\";\n\n const rawData = model.getProperty(arrayPath);\n const data = Array.isArray(rawData) ? rawData : [];\n const newData = [...data];\n newData.splice(index, 1);\n model.setProperty(arrayPath, newData);\n }\n });\n\n const templateCells: Control[] = [];\n const props = schema.items.properties;\n const layoutElements = schema.uiLayout;\n\n if (layoutElements && Array.isArray(layoutElements)) {\n // Only render columns defined in uiLayout\n layoutElements.forEach((element: ILayoutElement) => {\n if (element.type === \"Control\" && element.scope) {\n const { meta: fieldMeta, bindingPath, propKey } = SchemaNormalizer.resolveScope(\n { type: \"object\", properties: props } as ISchema, \n element.scope\n );\n \n if (!fieldMeta) {\n Logger.error(`[MetaUI] Property '${propKey}' not found in schema definitions for Table.`, \"\", \"TableLayout\");\n } else {\n // The architectural boundary: Table Layout orchestrates the columns and aggregation binding,\n // but delegates the actual cell rendering to the Engine's Field Plugins.\n table.addColumn(new Column({\n header: new Text({ text: element.label || fieldMeta.ui?.label || propKey }),\n demandPopin: !fieldMeta.ui?.isKey,\n minScreenWidth: fieldMeta.ui?.isKey ? \"\" : \"Tablet\",\n popinDisplay: \"Inline\"\n }));\n\n const effectiveMeta = { ...fieldMeta };\n if (element.widget) {\n effectiveMeta.ui = { ...fieldMeta.ui, widget: element.widget };\n }\n\n // We pass the activeModel as actualModelName down. But the path must be relative to the \n // table row binding context, so we just use the bindingPath (e.g. \"id\" or \"header/id\")\n const control = engine.generateField(effectiveMeta, bindingPath, actualModelName || \"meta\", true);\n templateCells.push(control);\n }\n } else {\n Logger.warn(`[MetaUI] Unsupported layout element type '${element.type}' in Table.`, \"\", \"TableLayout\");\n }\n });\n } else {\n Logger.debug(\"[MetaUI TableLayout]\", \"No uiLayout provided. Falling back to rendering all properties as columns.\", \"TableLayout\");\n // Fallback: If no uiLayout is provided, render all properties as columns\n Object.keys(props).forEach((key) => {\n try {\n const fieldMeta = props[key];\n const isKey = !!fieldMeta.ui?.isKey;\n\n const column = new Column({\n header: new Text({ text: fieldMeta.ui?.label || key }),\n demandPopin: !isKey,\n minScreenWidth: isKey ? \"\" : \"Tablet\",\n popinDisplay: \"Inline\"\n });\n table.addColumn(column);\n\n const control = engine.generateField(fieldMeta, key, actualModelName || \"meta\", true);\n templateCells.push(control);\n } catch (error) {\n const msg = (error as Error).message;\n Logger.error(`[MetaUI] Failed to render fallback column ${key}`, msg, \"TableLayout\");\n Logger.showErrorPopup(`Failed to render fallback table column '${key}'.\\n\\nDetails: ${msg}`);\n templateCells.push(new Text({ text: \"Error\" }));\n }\n });\n }\n\n\n\n const rowTemplate = new ColumnListItem({\n cells: templateCells\n });\n\n table.bindItems({\n path: actualPath,\n model: actualModelName,\n template: rowTemplate,\n templateShareable: false\n });\n\n return table;\n }\n}\n"],"mappings":";;;QAkBSA,gBAAgB,GAAAC,wBAAA;EAAA,MAChBC,MAAM,GAAAC,eAAA;EAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,WAAW,CAA2B;IAC/C;AACJ;AACA;AACA;AACA;AACA;AACA;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,KAAK,CAAWuB,OAAO;YACpC/F,MAAM,CAACwE,KAAK,CAAC,6CAA6CoB,GAAG,EAAE,EAAEE,GAAG,EAAE,aAAa,CAAC;YACpF9F,MAAM,CAACgG,cAAc,CAAC,2CAA2CJ,GAAG,kBAAkBE,GAAG,EAAE,CAAC;YAC5FjC,aAAa,CAAC0B,IAAI,CAAC,IAAIX,IAAI,CAAC;cAAErD,IAAI,EAAE;YAAQ,CAAC,CAAC,CAAC;UACnD;QACJ,CAAC,CAAC;MACN;MAIA,MAAM0E,WAAW,GAAG,IAAIC,cAAc,CAAC;QACnCC,KAAK,EAAEtC;MACX,CAAC,CAAC;MAEF5C,KAAK,CAACmF,SAAS,CAAC;QACZ9D,IAAI,EAAEtB,UAAU;QAChBkB,KAAK,EAAEnB,eAAe;QACtBsF,QAAQ,EAAEJ,WAAW;QACrBK,iBAAiB,EAAE;MACvB,CAAC,CAAC;MAEF,OAAOrF,KAAK;IAChB;EACJ;EAAC,IAAAsF,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAArG,WAAA,GAAAA,WAAA;EAAA,OAAAqG,SAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"TableLayout-dbg.js","names":["SchemaNormalizer","___core_SchemaNormalizer","Logger","___utils_Logger","TableLayout","render","schema","modelName","engine","onSubmit","bindingPath","type","items","properties","Error","tableTitle","title","actualModelName","actualPath","table","Table","headerToolbar","Toolbar","content","Title","text","ToolbarSpacer","isEditable","Button","icon","press","oEvent","btn","getSource","tbl","getParent","model","getModel","info","getBindingInfo","path","rawData","getProperty","data","Array","isArray","newData","setProperty","onChange","replace","fixedLayout","mode","delete","item","getParameter","getBindingContext","getPath","splitPaths","split","index","parseInt","pop","arrayPath","join","splice","templateCells","props","layoutElements","uiLayout","forEach","element","scope","meta","fieldMeta","propKey","resolveScope","error","addColumn","Column","header","Text","label","ui","demandPopin","isKey","minScreenWidth","popinDisplay","effectiveMeta","widget","control","generateField","push","warn","debug","Object","keys","key","column","msg","message","showErrorPopup","rowTemplate","ColumnListItem","cells","bindItems","template","templateShareable","__exports","__esModule"],"sources":["TableLayout.ts"],"sourcesContent":["/**\n * @file TableLayout.ts\n * @description Generates a responsive SAP Fiori Table layout for v2 schema.\n */\n\nimport Table from \"sap/m/Table\";\nimport Column from \"sap/m/Column\";\nimport Text from \"sap/m/Text\";\nimport ColumnListItem from \"sap/m/ColumnListItem\";\nimport Toolbar from \"sap/m/Toolbar\";\nimport Title from \"sap/m/Title\";\nimport ToolbarSpacer from \"sap/m/ToolbarSpacer\";\nimport Button from \"sap/m/Button\";\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport Control from \"sap/ui/core/Control\";\nimport { IPropertyMetadata, ISchema, ILayoutElement } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Engine } from \"../core/Engine\";\nimport { SchemaNormalizer } from \"../core/SchemaNormalizer\";\nimport { Logger } from \"../utils/Logger\";\n\n/**\n * Layout Manager responsible for generating a responsive SAP Fiori Table.\n * It is automatically utilized by the Engine when the schema root or property is of type 'array'.\n * Includes built-in support for adding and deleting rows via dynamic data binding manipulation.\n * \n * @namespace nz.co.siliconst.ui5.metaui.layouts\n * @public\n */\nexport class TableLayout implements ILayoutManager {\n /**\n * Renders the JSON Schema array properties into a UI5 Table.\n * \n * @param schema The active JSON schema array definition.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @param engine The central orchestrator for delegating column plugin generation.\n * @param onSubmit Optional submit hook.\n * @param bindingPath The JSON path representing the array within the payload.\n * @returns {Control} The generated sap.m.Table control.\n * @throws {Error} If the provided schema is not of type 'array'.\n */\n public render(schema: ISchema, modelName: string, engine: Engine, onSubmit?: () => void, bindingPath: string = \"/\"): Control {\n if (schema.type !== \"array\" || !schema.items || !schema.items.properties) {\n throw new Error(\"[MetaUI] TableLayout requires an array schema with items.properties.\");\n }\n\n const tableTitle = schema.title || \"Table\";\n const actualModelName = modelName;\n const actualPath = bindingPath;\n\n const table = new Table({\n headerToolbar: new Toolbar({\n content: [\n new Title({ text: tableTitle }),\n new ToolbarSpacer(),\n ...(!engine.isEditable ? [] : [\n new Button({\n text: \"Add Row\",\n icon: \"sap-icon://add\",\n press: (oEvent: sap.ui.base.Event) => {\n const btn = oEvent.getSource();\n const tbl = btn.getParent().getParent() as Table;\n const model = tbl.getModel(actualModelName) as JSONModel;\n const info = tbl.getBindingInfo(\"items\");\n if (!info || !info.path) return;\n\n const rawData = model.getProperty(info.path);\n const data = Array.isArray(rawData) ? rawData : [];\n const newData = [...data, {}];\n model.setProperty(info.path, newData);\n\n // CRITICAL: Notify the engine so it extracts payload and triggers liveUpdate\n if (engine.onChange) {\n engine.onChange(true, actualPath.replace(/^\\//, \"\"));\n }\n }\n })\n ])\n ]\n }),\n fixedLayout: false,\n mode: !engine.isEditable ? \"None\" : \"Delete\",\n delete: (oEvent: sap.ui.base.Event) => {\n const item = oEvent.getParameter(\"listItem\");\n const path = item.getBindingContext(actualModelName).getPath();\n const model = item.getModel(actualModelName) as JSONModel;\n\n const splitPaths = path.split(\"/\");\n const index = parseInt(splitPaths.pop() || \"0\", 10);\n let arrayPath = splitPaths.join(\"/\");\n if (arrayPath === \"\") arrayPath = \"/\";\n\n const rawData = model.getProperty(arrayPath);\n const data = Array.isArray(rawData) ? rawData : [];\n const newData = [...data];\n newData.splice(index, 1);\n model.setProperty(arrayPath, newData);\n\n // CRITICAL: Notify the engine so it extracts payload and triggers liveUpdate\n if (engine.onChange) {\n engine.onChange(true, actualPath.replace(/^\\//, \"\"));\n }\n }\n });\n\n const templateCells: Control[] = [];\n const props = schema.items.properties;\n const layoutElements = schema.uiLayout;\n\n if (layoutElements && Array.isArray(layoutElements)) {\n // Only render columns defined in uiLayout\n layoutElements.forEach((element: ILayoutElement) => {\n if (element.type === \"Control\" && element.scope) {\n const { meta: fieldMeta, bindingPath, propKey } = SchemaNormalizer.resolveScope(\n { type: \"object\", properties: props } as ISchema, \n element.scope\n );\n \n if (!fieldMeta) {\n Logger.error(`[MetaUI] Property '${propKey}' not found in schema definitions for Table.`, \"\", \"TableLayout\");\n } else {\n // The architectural boundary: Table Layout orchestrates the columns and aggregation binding,\n // but delegates the actual cell rendering to the Engine's Field Plugins.\n table.addColumn(new Column({\n header: new Text({ text: element.label || fieldMeta.ui?.label || propKey }),\n demandPopin: !fieldMeta.ui?.isKey,\n minScreenWidth: fieldMeta.ui?.isKey ? \"\" : \"Tablet\",\n popinDisplay: \"Inline\"\n }));\n\n const effectiveMeta = { ...fieldMeta };\n if (element.widget) {\n effectiveMeta.ui = { ...fieldMeta.ui, widget: element.widget };\n }\n\n // We pass the activeModel as actualModelName down. But the path must be relative to the \n // table row binding context, so we just use the bindingPath (e.g. \"id\" or \"header/id\")\n const control = engine.generateField(effectiveMeta, bindingPath, actualModelName || \"meta\", true);\n templateCells.push(control);\n }\n } else {\n Logger.warn(`[MetaUI] Unsupported layout element type '${element.type}' in Table.`, \"\", \"TableLayout\");\n }\n });\n } else {\n Logger.debug(\"[MetaUI TableLayout]\", \"No uiLayout provided. Falling back to rendering all properties as columns.\", \"TableLayout\");\n // Fallback: If no uiLayout is provided, render all properties as columns\n Object.keys(props).forEach((key) => {\n try {\n const fieldMeta = props[key];\n const isKey = !!fieldMeta.ui?.isKey;\n\n const column = new Column({\n header: new Text({ text: fieldMeta.ui?.label || key }),\n demandPopin: !isKey,\n minScreenWidth: isKey ? \"\" : \"Tablet\",\n popinDisplay: \"Inline\"\n });\n table.addColumn(column);\n\n const control = engine.generateField(fieldMeta, key, actualModelName || \"meta\", true);\n templateCells.push(control);\n } catch (error) {\n const msg = (error as Error).message;\n Logger.error(`[MetaUI] Failed to render fallback column ${key}`, msg, \"TableLayout\");\n Logger.showErrorPopup(`Failed to render fallback table column '${key}'.\\n\\nDetails: ${msg}`);\n templateCells.push(new Text({ text: \"Error\" }));\n }\n });\n }\n\n\n\n const rowTemplate = new ColumnListItem({\n cells: templateCells\n });\n\n table.bindItems({\n path: actualPath,\n model: actualModelName,\n template: rowTemplate,\n templateShareable: false\n });\n\n return table;\n }\n}\n"],"mappings":";;;QAkBSA,gBAAgB,GAAAC,wBAAA;EAAA,MAChBC,MAAM,GAAAC,eAAA;EAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,WAAW,CAA2B;IAC/C;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACWC,MAAMA,CAACC,MAAe,EAAEC,SAAiB,EAAEC,MAAc,EAAEC,QAAqB,EAAEC,WAAmB,GAAG,GAAG,EAAW;MACzH,IAAIJ,MAAM,CAACK,IAAI,KAAK,OAAO,IAAI,CAACL,MAAM,CAACM,KAAK,IAAI,CAACN,MAAM,CAACM,KAAK,CAACC,UAAU,EAAE;QACtE,MAAM,IAAIC,KAAK,CAAC,sEAAsE,CAAC;MAC3F;MAEA,MAAMC,UAAU,GAAGT,MAAM,CAACU,KAAK,IAAI,OAAO;MAC1C,MAAMC,eAAe,GAAGV,SAAS;MACjC,MAAMW,UAAU,GAAGR,WAAW;MAE9B,MAAMS,KAAK,GAAG,IAAIC,KAAK,CAAC;QACpBC,aAAa,EAAE,IAAIC,OAAO,CAAC;UACvBC,OAAO,EAAE,CACL,IAAIC,KAAK,CAAC;YAAEC,IAAI,EAAEV;UAAW,CAAC,CAAC,EAC/B,IAAIW,aAAa,CAAC,CAAC,EACnB,IAAI,CAAClB,MAAM,CAACmB,UAAU,GAAG,EAAE,GAAG,CAC1B,IAAIC,MAAM,CAAC;YACPH,IAAI,EAAE,SAAS;YACfI,IAAI,EAAE,gBAAgB;YACtBC,KAAK,EAAGC,MAAyB,IAAK;cAClC,MAAMC,GAAG,GAAGD,MAAM,CAACE,SAAS,CAAC,CAAC;cAC9B,MAAMC,GAAG,GAAGF,GAAG,CAACG,SAAS,CAAC,CAAC,CAACA,SAAS,CAAC,CAAU;cAChD,MAAMC,KAAK,GAAGF,GAAG,CAACG,QAAQ,CAACpB,eAAe,CAAc;cACxD,MAAM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GAAAA,WAAA;EAAA,OAAAuG,SAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableLayout.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gDAAgD,CAAC;IAehE,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,EAAqB,OAAO,EAAkB,MAAM,+CAA+C,CAAC;IAC3G,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;IACtF,OAAO,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;IAIhE;;;;;;;OAOG;IACH,MAAa,WAAY,YAAW,cAAc;QAC9C;;;;;;;;;;WAUG;QACI,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,EAAE,WAAW,GAAE,MAAY,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"TableLayout.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gDAAgD,CAAC;IAehE,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,EAAqB,OAAO,EAAkB,MAAM,+CAA+C,CAAC;IAC3G,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;IACtF,OAAO,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;IAIhE;;;;;;;OAOG;IACH,MAAa,WAAY,YAAW,cAAc;QAC9C;;;;;;;;;;WAUG;QACI,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,EAAE,WAAW,GAAE,MAAY,GAAG,OAAO;KAiJ/H;CAEA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
sap.ui.define(["sap/m/Table","sap/m/Column","sap/m/Text","sap/m/ColumnListItem","sap/m/Toolbar","sap/m/Title","sap/m/ToolbarSpacer","sap/m/Button","../core/SchemaNormalizer","../utils/Logger"],function(e,t,o,a,n,r,s,i,l,c){"use strict";const p=l["SchemaNormalizer"];const
|
|
1
|
+
sap.ui.define(["sap/m/Table","sap/m/Column","sap/m/Text","sap/m/ColumnListItem","sap/m/Toolbar","sap/m/Title","sap/m/ToolbarSpacer","sap/m/Button","../core/SchemaNormalizer","../utils/Logger"],function(e,t,o,a,n,r,s,i,l,c){"use strict";const p=l["SchemaNormalizer"];const u=c["Logger"];class d{render(l,c,d,m,y="/"){if(l.type!=="array"||!l.items||!l.items.properties){throw new Error("[MetaUI] TableLayout requires an array schema with items.properties.")}const b=l.title||"Table";const g=c;const h=y;const f=new e({headerToolbar:new n({content:[new r({text:b}),new s,...!d.isEditable?[]:[new i({text:"Add Row",icon:"sap-icon://add",press:e=>{const t=e.getSource();const o=t.getParent().getParent();const a=o.getModel(g);const n=o.getBindingInfo("items");if(!n||!n.path)return;const r=a.getProperty(n.path);const s=Array.isArray(r)?r:[];const i=[...s,{}];a.setProperty(n.path,i);if(d.onChange){d.onChange(true,h.replace(/^\//,""))}}})]]}),fixedLayout:false,mode:!d.isEditable?"None":"Delete",delete:e=>{const t=e.getParameter("listItem");const o=t.getBindingContext(g).getPath();const a=t.getModel(g);const n=o.split("/");const r=parseInt(n.pop()||"0",10);let s=n.join("/");if(s==="")s="/";const i=a.getProperty(s);const l=Array.isArray(i)?i:[];const c=[...l];c.splice(r,1);a.setProperty(s,c);if(d.onChange){d.onChange(true,h.replace(/^\//,""))}}});const w=[];const T=l.items.properties;const L=l.uiLayout;if(L&&Array.isArray(L)){L.forEach(e=>{if(e.type==="Control"&&e.scope){const{meta:a,bindingPath:n,propKey:r}=p.resolveScope({type:"object",properties:T},e.scope);if(!a){u.error(`[MetaUI] Property '${r}' not found in schema definitions for Table.`,"","TableLayout")}else{f.addColumn(new t({header:new o({text:e.label||a.ui?.label||r}),demandPopin:!a.ui?.isKey,minScreenWidth:a.ui?.isKey?"":"Tablet",popinDisplay:"Inline"}));const s={...a};if(e.widget){s.ui={...a.ui,widget:e.widget}}const i=d.generateField(s,n,g||"meta",true);w.push(i)}}else{u.warn(`[MetaUI] Unsupported layout element type '${e.type}' in Table.`,"","TableLayout")}})}else{u.debug("[MetaUI TableLayout]","No uiLayout provided. Falling back to rendering all properties as columns.","TableLayout");Object.keys(T).forEach(e=>{try{const a=T[e];const n=!!a.ui?.isKey;const r=new t({header:new o({text:a.ui?.label||e}),demandPopin:!n,minScreenWidth:n?"":"Tablet",popinDisplay:"Inline"});f.addColumn(r);const s=d.generateField(a,e,g||"meta",true);w.push(s)}catch(t){const a=t.message;u.error(`[MetaUI] Failed to render fallback column ${e}`,a,"TableLayout");u.showErrorPopup(`Failed to render fallback table column '${e}'.\n\nDetails: ${a}`);w.push(new o({text:"Error"}))}})}const P=new a({cells:w});f.bindItems({path:h,model:g,template:P,templateShareable:false});return f}}var m={__esModule:true};m.TableLayout=d;return m});
|
|
2
2
|
//# sourceMappingURL=TableLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableLayout.js","names":["SchemaNormalizer","___core_SchemaNormalizer","Logger","___utils_Logger","TableLayout","render","schema","modelName","engine","onSubmit","bindingPath","type","items","properties","Error","tableTitle","title","actualModelName","actualPath","table","Table","headerToolbar","Toolbar","content","Title","text","ToolbarSpacer","isEditable","Button","icon","press","oEvent","btn","getSource","tbl","getParent","model","getModel","info","getBindingInfo","path","rawData","getProperty","data","Array","isArray","newData","setProperty","fixedLayout","mode","delete","item","getParameter","getBindingContext","getPath","splitPaths","split","index","parseInt","pop","arrayPath","join","splice","templateCells","props","layoutElements","uiLayout","forEach","element","scope","meta","fieldMeta","propKey","resolveScope","error","addColumn","Column","header","Text","label","ui","demandPopin","isKey","minScreenWidth","popinDisplay","effectiveMeta","widget","control","generateField","push","warn","debug","Object","keys","key","column","msg","message","showErrorPopup","rowTemplate","ColumnListItem","cells","bindItems","template","templateShareable","__exports","__esModule"],"sources":["TableLayout.ts"],"sourcesContent":["/**\n * @file TableLayout.ts\n * @description Generates a responsive SAP Fiori Table layout for v2 schema.\n */\n\nimport Table from \"sap/m/Table\";\nimport Column from \"sap/m/Column\";\nimport Text from \"sap/m/Text\";\nimport ColumnListItem from \"sap/m/ColumnListItem\";\nimport Toolbar from \"sap/m/Toolbar\";\nimport Title from \"sap/m/Title\";\nimport ToolbarSpacer from \"sap/m/ToolbarSpacer\";\nimport Button from \"sap/m/Button\";\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport Control from \"sap/ui/core/Control\";\nimport { IPropertyMetadata, ISchema, ILayoutElement } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Engine } from \"../core/Engine\";\nimport { SchemaNormalizer } from \"../core/SchemaNormalizer\";\nimport { Logger } from \"../utils/Logger\";\n\n/**\n * Layout Manager responsible for generating a responsive SAP Fiori Table.\n * It is automatically utilized by the Engine when the schema root or property is of type 'array'.\n * Includes built-in support for adding and deleting rows via dynamic data binding manipulation.\n * \n * @namespace nz.co.siliconst.ui5.metaui.layouts\n * @public\n */\nexport class TableLayout implements ILayoutManager {\n /**\n * Renders the JSON Schema array properties into a UI5 Table.\n * \n * @param schema The active JSON schema array definition.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @param engine The central orchestrator for delegating column plugin generation.\n * @param onSubmit Optional submit hook.\n * @param bindingPath The JSON path representing the array within the payload.\n * @returns {Control} The generated sap.m.Table control.\n * @throws {Error} If the provided schema is not of type 'array'.\n */\n public render(schema: ISchema, modelName: string, engine: Engine, onSubmit?: () => void, bindingPath: string = \"/\"): Control {\n if (schema.type !== \"array\" || !schema.items || !schema.items.properties) {\n throw new Error(\"[MetaUI] TableLayout requires an array schema with items.properties.\");\n }\n\n const tableTitle = schema.title || \"Table\";\n const actualModelName = modelName;\n const actualPath = bindingPath;\n\n const table = new Table({\n headerToolbar: new Toolbar({\n content: [\n new Title({ text: tableTitle }),\n new ToolbarSpacer(),\n ...(!engine.isEditable ? [] : [\n new Button({\n text: \"Add Row\",\n icon: \"sap-icon://add\",\n press: (oEvent: sap.ui.base.Event) => {\n const btn = oEvent.getSource();\n const tbl = btn.getParent().getParent() as Table;\n const model = tbl.getModel(actualModelName) as JSONModel;\n const info = tbl.getBindingInfo(\"items\");\n if (!info || !info.path) return;\n\n const rawData = model.getProperty(info.path);\n const data = Array.isArray(rawData) ? rawData : [];\n const newData = [...data, {}];\n model.setProperty(info.path, newData);\n }\n })\n ])\n ]\n }),\n fixedLayout: false,\n mode: !engine.isEditable ? \"None\" : \"Delete\",\n delete: (oEvent: sap.ui.base.Event) => {\n const item = oEvent.getParameter(\"listItem\");\n const path = item.getBindingContext(actualModelName).getPath();\n const model = item.getModel(actualModelName) as JSONModel;\n\n const splitPaths = path.split(\"/\");\n const index = parseInt(splitPaths.pop() || \"0\", 10);\n let arrayPath = splitPaths.join(\"/\");\n if (arrayPath === \"\") arrayPath = \"/\";\n\n const rawData = model.getProperty(arrayPath);\n const data = Array.isArray(rawData) ? rawData : [];\n const newData = [...data];\n newData.splice(index, 1);\n model.setProperty(arrayPath, newData);\n }\n });\n\n const templateCells: Control[] = [];\n const props = schema.items.properties;\n const layoutElements = schema.uiLayout;\n\n if (layoutElements && Array.isArray(layoutElements)) {\n // Only render columns defined in uiLayout\n layoutElements.forEach((element: ILayoutElement) => {\n if (element.type === \"Control\" && element.scope) {\n const { meta: fieldMeta, bindingPath, propKey } = SchemaNormalizer.resolveScope(\n { type: \"object\", properties: props } as ISchema, \n element.scope\n );\n \n if (!fieldMeta) {\n Logger.error(`[MetaUI] Property '${propKey}' not found in schema definitions for Table.`, \"\", \"TableLayout\");\n } else {\n // The architectural boundary: Table Layout orchestrates the columns and aggregation binding,\n // but delegates the actual cell rendering to the Engine's Field Plugins.\n table.addColumn(new Column({\n header: new Text({ text: element.label || fieldMeta.ui?.label || propKey }),\n demandPopin: !fieldMeta.ui?.isKey,\n minScreenWidth: fieldMeta.ui?.isKey ? \"\" : \"Tablet\",\n popinDisplay: \"Inline\"\n }));\n\n const effectiveMeta = { ...fieldMeta };\n if (element.widget) {\n effectiveMeta.ui = { ...fieldMeta.ui, widget: element.widget };\n }\n\n // We pass the activeModel as actualModelName down. But the path must be relative to the \n // table row binding context, so we just use the bindingPath (e.g. \"id\" or \"header/id\")\n const control = engine.generateField(effectiveMeta, bindingPath, actualModelName || \"meta\", true);\n templateCells.push(control);\n }\n } else {\n Logger.warn(`[MetaUI] Unsupported layout element type '${element.type}' in Table.`, \"\", \"TableLayout\");\n }\n });\n } else {\n Logger.debug(\"[MetaUI TableLayout]\", \"No uiLayout provided. Falling back to rendering all properties as columns.\", \"TableLayout\");\n // Fallback: If no uiLayout is provided, render all properties as columns\n Object.keys(props).forEach((key) => {\n try {\n const fieldMeta = props[key];\n const isKey = !!fieldMeta.ui?.isKey;\n\n const column = new Column({\n header: new Text({ text: fieldMeta.ui?.label || key }),\n demandPopin: !isKey,\n minScreenWidth: isKey ? \"\" : \"Tablet\",\n popinDisplay: \"Inline\"\n });\n table.addColumn(column);\n\n const control = engine.generateField(fieldMeta, key, actualModelName || \"meta\", true);\n templateCells.push(control);\n } catch (error) {\n const msg = (error as Error).message;\n Logger.error(`[MetaUI] Failed to render fallback column ${key}`, msg, \"TableLayout\");\n Logger.showErrorPopup(`Failed to render fallback table column '${key}'.\\n\\nDetails: ${msg}`);\n templateCells.push(new Text({ text: \"Error\" }));\n }\n });\n }\n\n\n\n const rowTemplate = new ColumnListItem({\n cells: templateCells\n });\n\n table.bindItems({\n path: actualPath,\n model: actualModelName,\n template: rowTemplate,\n templateShareable: false\n });\n\n return table;\n }\n}\n"],"mappings":"kPAkBSA,EAAgBC,EAAA,0BAChBC,EAAMC,EAAA,UAUR,MAAMC,EAYFC,OAAOC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BD,EAAQ,GAAK,SAC7BE,aAAc,WAElBjE,EAAMwD,UAAUoB,GAEhB,MAAMR,EAAU/E,EAAOgF,cAAcjB,EAAWuB,EAAK7E,GAAmB,OAAQ,MAChF8C,EAAc0B,KAAKF,EACvB,CAAE,MAAOb,GACL,MAAMsB,EAAOtB,EAAgBuB,QAC7B/F,EAAOwE,MAAM,6CAA6CoB,IAAOE,EAAK,eACtE9F,EAAOgG,eAAe,2CAA2CJ,mBAAqBE,KACtFjC,EAAc0B,KAAK,IAAIX,EAAK,CAAErD,KAAM,UACxC,GAER,CAIA,MAAM0E,EAAc,IAAIC,EAAe,CACnCC,MAAOtC,IAGX5C,EAAMmF,UAAU,CACZ9D,KAAMtB,EACNkB,MAAOnB,EACPsF,SAAUJ,EACVK,kBAAmB,QAGvB,OAAOrF,CACX,EACH,IAAAsF,EAAA,CAAAC,WAAA,MAAAD,EAAArG,cAAA,OAAAqG,CAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"TableLayout.js","names":["SchemaNormalizer","___core_SchemaNormalizer","Logger","___utils_Logger","TableLayout","render","schema","modelName","engine","onSubmit","bindingPath","type","items","properties","Error","tableTitle","title","actualModelName","actualPath","table","Table","headerToolbar","Toolbar","content","Title","text","ToolbarSpacer","isEditable","Button","icon","press","oEvent","btn","getSource","tbl","getParent","model","getModel","info","getBindingInfo","path","rawData","getProperty","data","Array","isArray","newData","setProperty","onChange","replace","fixedLayout","mode","delete","item","getParameter","getBindingContext","getPath","splitPaths","split","index","parseInt","pop","arrayPath","join","splice","templateCells","props","layoutElements","uiLayout","forEach","element","scope","meta","fieldMeta","propKey","resolveScope","error","addColumn","Column","header","Text","label","ui","demandPopin","isKey","minScreenWidth","popinDisplay","effectiveMeta","widget","control","generateField","push","warn","debug","Object","keys","key","column","msg","message","showErrorPopup","rowTemplate","ColumnListItem","cells","bindItems","template","templateShareable","__exports","__esModule"],"sources":["TableLayout.ts"],"sourcesContent":["/**\n * @file TableLayout.ts\n * @description Generates a responsive SAP Fiori Table layout for v2 schema.\n */\n\nimport Table from \"sap/m/Table\";\nimport Column from \"sap/m/Column\";\nimport Text from \"sap/m/Text\";\nimport ColumnListItem from \"sap/m/ColumnListItem\";\nimport Toolbar from \"sap/m/Toolbar\";\nimport Title from \"sap/m/Title\";\nimport ToolbarSpacer from \"sap/m/ToolbarSpacer\";\nimport Button from \"sap/m/Button\";\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\nimport Control from \"sap/ui/core/Control\";\nimport { IPropertyMetadata, ISchema, ILayoutElement } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Engine } from \"../core/Engine\";\nimport { SchemaNormalizer } from \"../core/SchemaNormalizer\";\nimport { Logger } from \"../utils/Logger\";\n\n/**\n * Layout Manager responsible for generating a responsive SAP Fiori Table.\n * It is automatically utilized by the Engine when the schema root or property is of type 'array'.\n * Includes built-in support for adding and deleting rows via dynamic data binding manipulation.\n * \n * @namespace nz.co.siliconst.ui5.metaui.layouts\n * @public\n */\nexport class TableLayout implements ILayoutManager {\n /**\n * Renders the JSON Schema array properties into a UI5 Table.\n * \n * @param schema The active JSON schema array definition.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @param engine The central orchestrator for delegating column plugin generation.\n * @param onSubmit Optional submit hook.\n * @param bindingPath The JSON path representing the array within the payload.\n * @returns {Control} The generated sap.m.Table control.\n * @throws {Error} If the provided schema is not of type 'array'.\n */\n public render(schema: ISchema, modelName: string, engine: Engine, onSubmit?: () => void, bindingPath: string = \"/\"): Control {\n if (schema.type !== \"array\" || !schema.items || !schema.items.properties) {\n throw new Error(\"[MetaUI] TableLayout requires an array schema with items.properties.\");\n }\n\n const tableTitle = schema.title || \"Table\";\n const actualModelName = modelName;\n const actualPath = bindingPath;\n\n const table = new Table({\n headerToolbar: new Toolbar({\n content: [\n new Title({ text: tableTitle }),\n new ToolbarSpacer(),\n ...(!engine.isEditable ? [] : [\n new Button({\n text: \"Add Row\",\n icon: \"sap-icon://add\",\n press: (oEvent: sap.ui.base.Event) => {\n const btn = oEvent.getSource();\n const tbl = btn.getParent().getParent() as Table;\n const model = tbl.getModel(actualModelName) as JSONModel;\n const info = tbl.getBindingInfo(\"items\");\n if (!info || !info.path) return;\n\n const rawData = model.getProperty(info.path);\n const data = Array.isArray(rawData) ? rawData : [];\n const newData = [...data, {}];\n model.setProperty(info.path, newData);\n\n // CRITICAL: Notify the engine so it extracts payload and triggers liveUpdate\n if (engine.onChange) {\n engine.onChange(true, actualPath.replace(/^\\//, \"\"));\n }\n }\n })\n ])\n ]\n }),\n fixedLayout: false,\n mode: !engine.isEditable ? \"None\" : \"Delete\",\n delete: (oEvent: sap.ui.base.Event) => {\n const item = oEvent.getParameter(\"listItem\");\n const path = item.getBindingContext(actualModelName).getPath();\n const model = item.getModel(actualModelName) as JSONModel;\n\n const splitPaths = path.split(\"/\");\n const index = parseInt(splitPaths.pop() || \"0\", 10);\n let arrayPath = splitPaths.join(\"/\");\n if (arrayPath === \"\") arrayPath = \"/\";\n\n const rawData = model.getProperty(arrayPath);\n const data = Array.isArray(rawData) ? rawData : [];\n const newData = [...data];\n newData.splice(index, 1);\n model.setProperty(arrayPath, newData);\n\n // CRITICAL: Notify the engine so it extracts payload and triggers liveUpdate\n if (engine.onChange) {\n engine.onChange(true, actualPath.replace(/^\\//, \"\"));\n }\n }\n });\n\n const templateCells: Control[] = [];\n const props = schema.items.properties;\n const layoutElements = schema.uiLayout;\n\n if (layoutElements && Array.isArray(layoutElements)) {\n // Only render columns defined in uiLayout\n layoutElements.forEach((element: ILayoutElement) => {\n if (element.type === \"Control\" && element.scope) {\n const { meta: fieldMeta, bindingPath, propKey } = SchemaNormalizer.resolveScope(\n { type: \"object\", properties: props } as ISchema, \n element.scope\n );\n \n if (!fieldMeta) {\n Logger.error(`[MetaUI] Property '${propKey}' not found in schema definitions for Table.`, \"\", \"TableLayout\");\n } else {\n // The architectural boundary: Table Layout orchestrates the columns and aggregation binding,\n // but delegates the actual cell rendering to the Engine's Field Plugins.\n table.addColumn(new Column({\n header: new Text({ text: element.label || fieldMeta.ui?.label || propKey }),\n demandPopin: !fieldMeta.ui?.isKey,\n minScreenWidth: fieldMeta.ui?.isKey ? \"\" : \"Tablet\",\n popinDisplay: \"Inline\"\n }));\n\n const effectiveMeta = { ...fieldMeta };\n if (element.widget) {\n effectiveMeta.ui = { ...fieldMeta.ui, widget: element.widget };\n }\n\n // We pass the activeModel as actualModelName down. But the path must be relative to the \n // table row binding context, so we just use the bindingPath (e.g. \"id\" or \"header/id\")\n const control = engine.generateField(effectiveMeta, bindingPath, actualModelName || \"meta\", true);\n templateCells.push(control);\n }\n } else {\n Logger.warn(`[MetaUI] Unsupported layout element type '${element.type}' in Table.`, \"\", \"TableLayout\");\n }\n });\n } else {\n Logger.debug(\"[MetaUI TableLayout]\", \"No uiLayout provided. Falling back to rendering all properties as columns.\", \"TableLayout\");\n // Fallback: If no uiLayout is provided, render all properties as columns\n Object.keys(props).forEach((key) => {\n try {\n const fieldMeta = props[key];\n const isKey = !!fieldMeta.ui?.isKey;\n\n const column = new Column({\n header: new Text({ text: fieldMeta.ui?.label || key }),\n demandPopin: !isKey,\n minScreenWidth: isKey ? \"\" : \"Tablet\",\n popinDisplay: \"Inline\"\n });\n table.addColumn(column);\n\n const control = engine.generateField(fieldMeta, key, actualModelName || \"meta\", true);\n templateCells.push(control);\n } catch (error) {\n const msg = (error as Error).message;\n Logger.error(`[MetaUI] Failed to render fallback column ${key}`, msg, \"TableLayout\");\n Logger.showErrorPopup(`Failed to render fallback table column '${key}'.\\n\\nDetails: ${msg}`);\n templateCells.push(new Text({ text: \"Error\" }));\n }\n });\n }\n\n\n\n const rowTemplate = new ColumnListItem({\n cells: templateCells\n });\n\n table.bindItems({\n path: actualPath,\n model: actualModelName,\n template: rowTemplate,\n templateShareable: false\n });\n\n return table;\n }\n}\n"],"mappings":"kPAkBSA,EAAgBC,EAAA,0BAChBC,EAAMC,EAAA,UAUR,MAAMC,EAY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IACxB,IACI,MAAMvB,EAAYP,EAAM8B,GACxB,MAAMZ,IAAUX,EAAUS,IAAIE,MAE9B,MAAMa,EAAS,IAAInB,EAAO,CACtBC,OAAQ,IAAIC,EAAK,CAAEvD,KAAMgD,EAAUS,IAAID,OAASe,IAChDb,aAAcC,EACdC,eAAgBD,EAAQ,GAAK,SAC7BE,aAAc,WAElBnE,EAAM0D,UAAUoB,GAEhB,MAAMR,EAAUjF,EAAOkF,cAAcjB,EAAWuB,EAAK/E,GAAmB,OAAQ,MAChFgD,EAAc0B,KAAKF,EACvB,CAAE,MAAOb,GACL,MAAMsB,EAAOtB,EAAgBuB,QAC7BjG,EAAO0E,MAAM,6CAA6CoB,IAAOE,EAAK,eACtEhG,EAAOkG,eAAe,2CAA2CJ,mBAAqBE,KACtFjC,EAAc0B,KAAK,IAAIX,EAAK,CAAEvD,KAAM,UACxC,GAER,CAIA,MAAM4E,EAAc,IAAIC,EAAe,CACnCC,MAAOtC,IAGX9C,EAAMqF,UAAU,CACZhE,KAAMtB,EACNkB,MAAOnB,EACPwF,SAAUJ,EACVK,kBAAmB,QAGvB,OAAOvF,CACX,EACH,IAAAwF,EAAA,CAAAC,WAAA,MAAAD,EAAAvG,cAAA,OAAAuG,CAAA","ignoreList":[]}
|
|
@@ -68,6 +68,11 @@ export class TableLayout implements ILayoutManager {
|
|
|
68
68
|
const data = Array.isArray(rawData) ? rawData : [];
|
|
69
69
|
const newData = [...data, {}];
|
|
70
70
|
model.setProperty(info.path, newData);
|
|
71
|
+
|
|
72
|
+
// CRITICAL: Notify the engine so it extracts payload and triggers liveUpdate
|
|
73
|
+
if (engine.onChange) {
|
|
74
|
+
engine.onChange(true, actualPath.replace(/^\//, ""));
|
|
75
|
+
}
|
|
71
76
|
}
|
|
72
77
|
})
|
|
73
78
|
])
|
|
@@ -90,6 +95,11 @@ export class TableLayout implements ILayoutManager {
|
|
|
90
95
|
const newData = [...data];
|
|
91
96
|
newData.splice(index, 1);
|
|
92
97
|
model.setProperty(arrayPath, newData);
|
|
98
|
+
|
|
99
|
+
// CRITICAL: Notify the engine so it extracts payload and triggers liveUpdate
|
|
100
|
+
if (engine.onChange) {
|
|
101
|
+
engine.onChange(true, actualPath.replace(/^\//, ""));
|
|
102
|
+
}
|
|
93
103
|
}
|
|
94
104
|
});
|
|
95
105
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sap.ui.define(["sap/ui/core/Core"], function (Core) {
|
|
1
|
+
sap.ui.define(["sap/ui/core/Core", "nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin", "nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin", "nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin", "nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin", "nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin", "nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin", "nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin", "nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator", "nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder", "nz/co/siliconst/ui5/metaui/layouts/FormLayout", "nz/co/siliconst/ui5/metaui/layouts/TableLayout", "nz/co/siliconst/ui5/metaui/layouts/WizardLayout", "nz/co/siliconst/ui5/metaui/layouts/CompactLayout"], function (Core, __nz_co_siliconst_ui5_metaui_plugins_controls_StringPlugin, __nz_co_siliconst_ui5_metaui_plugins_controls_NumberPlugin, __nz_co_siliconst_ui5_metaui_plugins_controls_BooleanPlugin, __nz_co_siliconst_ui5_metaui_plugins_controls_ObjectPlugin, __nz_co_siliconst_ui5_metaui_plugins_controls_ArrayPlugin, __nz_co_siliconst_ui5_metaui_plugins_controls_DropdownPlugin, __nz_co_siliconst_ui5_metaui_plugins_controls_DatePlugin, __nz_co_siliconst_ui5_metaui_core_DefaultLayoutGenerator, __nz_co_siliconst_ui5_metaui_utils_ExpressionBuilder, __nz_co_siliconst_ui5_metaui_layouts_FormLayout, __nz_co_siliconst_ui5_metaui_layouts_TableLayout, __nz_co_siliconst_ui5_metaui_layouts_WizardLayout, __nz_co_siliconst_ui5_metaui_layouts_CompactLayout) {
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
// Delegate to standard library registration
|
|
@@ -6,7 +6,7 @@ sap.ui.define(["sap/ui/core/Core"], function (Core) {
|
|
|
6
6
|
name: "nz.co.siliconst.ui5.metaui",
|
|
7
7
|
version: "1.0.0",
|
|
8
8
|
dependencies: ["sap.ui.core", "sap.m", "sap.ui.layout", "sap.ui.table"],
|
|
9
|
-
controls: ["nz.co.siliconst.ui5.metaui.controls.GeneratorHost", "nz.co.siliconst.ui5.metaui.controls.BaseHardwareControl", "nz.co.siliconst.ui5.metaui.controls.CameraControl", "nz.co.siliconst.ui5.metaui.controls.BarcodeScannerControl", "nz.co.siliconst.ui5.metaui.controls.SignatureControl", "nz.co.siliconst.ui5.metaui.controls.VoiceInputControl", "nz.co.siliconst.ui5.metaui.controls.GeolocationControl", "nz.co.siliconst.ui5.metaui.controls.RichTextControl"],
|
|
9
|
+
controls: ["nz.co.siliconst.ui5.metaui.controls.DynamicHost", "nz.co.siliconst.ui5.metaui.controls.host.GeneratorHost", "nz.co.siliconst.ui5.metaui.controls.BaseHardwareControl", "nz.co.siliconst.ui5.metaui.controls.CameraControl", "nz.co.siliconst.ui5.metaui.controls.BarcodeScannerControl", "nz.co.siliconst.ui5.metaui.controls.SignatureControl", "nz.co.siliconst.ui5.metaui.controls.VoiceInputControl", "nz.co.siliconst.ui5.metaui.controls.GeolocationControl", "nz.co.siliconst.ui5.metaui.controls.RichTextControl"],
|
|
10
10
|
elements: [],
|
|
11
11
|
interfaces: [],
|
|
12
12
|
noLibraryCSS: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library-dbg.js","names":["Core","initLibrary","name","version","dependencies","controls","elements","interfaces","noLibraryCSS","__exports","window","nz","co","siliconst","ui5","metaui"],"sources":["library.ts"],"sourcesContent":["/**\n * @file library.ts\n * @description Standard SAP UI5 library registration file. Exposes the MetaUI namespace \n * and automatically bootstraps the internal PluginRegistry.\n */\n\nimport Core from \"sap/ui/core/Core\";\n\n// Delegate to standard library registration\nCore.initLibrary({\n name: \"nz.co.siliconst.ui5.metaui\",\n version: \"1.0.0\",\n dependencies: [\n \"sap.ui.core\",\n \"sap.m\",\n \"sap.ui.layout\",\n \"sap.ui.table\"\n ],\n controls: [\n \"nz.co.siliconst.ui5.metaui.controls.GeneratorHost\",\n \"nz.co.siliconst.ui5.metaui.controls.BaseHardwareControl\",\n \"nz.co.siliconst.ui5.metaui.controls.CameraControl\",\n \"nz.co.siliconst.ui5.metaui.controls.BarcodeScannerControl\",\n \"nz.co.siliconst.ui5.metaui.controls.SignatureControl\",\n \"nz.co.siliconst.ui5.metaui.controls.VoiceInputControl\",\n \"nz.co.siliconst.ui5.metaui.controls.GeolocationControl\",\n \"nz.co.siliconst.ui5.metaui.controls.RichTextControl\"\n ],\n elements: [],\n interfaces: [],\n noLibraryCSS: true\n});\n\n// Exporting window object safely for UI5 compatibility if needed\ndeclare global {\n interface Window {\n nz: {\n co: {\n siliconst: {\n ui5: {\n metaui: Record<string, unknown>;\n };\n };\n };\n };\n }\n}\n\nexport default window.nz.co.siliconst.ui5.metaui;\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"library-dbg.js","names":["Core","initLibrary","name","version","dependencies","controls","elements","interfaces","noLibraryCSS","__exports","window","nz","co","siliconst","ui5","metaui"],"sources":["library.ts"],"sourcesContent":["/**\n * @file library.ts\n * @description Standard SAP UI5 library registration file. Exposes the MetaUI namespace \n * and automatically bootstraps the internal PluginRegistry.\n */\n\nimport Core from \"sap/ui/core/Core\";\n\n// Explicitly import core plugins to bundle them into library-preload.js\nimport \"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin\";\nimport \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\";\nimport \"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin\";\nimport \"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin\";\nimport \"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin\";\nimport \"nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin\";\nimport \"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin\";\nimport \"nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator\";\nimport \"nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder\";\n\n// Explicitly import core Layouts\nimport \"nz/co/siliconst/ui5/metaui/layouts/FormLayout\";\nimport \"nz/co/siliconst/ui5/metaui/layouts/TableLayout\";\nimport \"nz/co/siliconst/ui5/metaui/layouts/WizardLayout\";\nimport \"nz/co/siliconst/ui5/metaui/layouts/CompactLayout\";\n\n// Delegate to standard library registration\nCore.initLibrary({\n name: \"nz.co.siliconst.ui5.metaui\",\n version: \"1.0.0\",\n dependencies: [\n \"sap.ui.core\",\n \"sap.m\",\n \"sap.ui.layout\",\n \"sap.ui.table\"\n ],\n controls: [\n \"nz.co.siliconst.ui5.metaui.controls.DynamicHost\",\n \"nz.co.siliconst.ui5.metaui.controls.host.GeneratorHost\",\n \"nz.co.siliconst.ui5.metaui.controls.BaseHardwareControl\",\n \"nz.co.siliconst.ui5.metaui.controls.CameraControl\",\n \"nz.co.siliconst.ui5.metaui.controls.BarcodeScannerControl\",\n \"nz.co.siliconst.ui5.metaui.controls.SignatureControl\",\n \"nz.co.siliconst.ui5.metaui.controls.VoiceInputControl\",\n \"nz.co.siliconst.ui5.metaui.controls.GeolocationControl\",\n \"nz.co.siliconst.ui5.metaui.controls.RichTextControl\"\n ],\n elements: [],\n interfaces: [],\n noLibraryCSS: true\n});\n\n// Exporting window object safely for UI5 compatibility if needed\ndeclare global {\n interface Window {\n nz: {\n co: {\n siliconst: {\n ui5: {\n metaui: Record<string, unknown>;\n };\n };\n };\n };\n }\n}\n\nexport default window.nz.co.siliconst.ui5.metaui;\n"],"mappings":";;;EAyBA;EACAA,IAAI,CAACC,WAAW,CAAC;IACbC,IAAI,EAAE,4BAA4B;IAClCC,OAAO,EAAE,OAAO;IAChBC,YAAY,EAAE,CACV,aAAa,EACb,OAAO,EACP,eAAe,EACf,cAAc,CACjB;IACDC,QAAQ,EAAE,CACN,iDAAiD,EACjD,wDAAwD,EACxD,yDAAyD,EACzD,mDAAmD,EACnD,2DAA2D,EAC3D,sDAAsD,EACtD,uDAAuD,EACvD,wDAAwD,EACxD,qDAAqD,CACxD;IACDC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,YAAY,EAAE;EAClB,CAAC,CAAC;;EAEF;EAAA,IAAAC,SAAA,GAeeC,MAAM,CAACC,EAAE,CAACC,EAAE,CAACC,SAAS,CAACC,GAAG,CAACC,MAAM;EAAA,OAAAN,SAAA;AAAA","ignoreList":[]}
|