@siliconst/metaui 1.4.9 → 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.
Files changed (46) hide show
  1. package/package.json +1 -1
  2. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +10 -0
  3. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js.map +1 -1
  4. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
  5. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
  6. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
  7. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +11 -0
  8. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +2 -0
  9. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
  10. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +2 -0
  11. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
  12. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
  13. package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +3 -0
  14. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +10 -0
  15. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -1
  16. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -1
  17. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +1 -1
  18. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -1
  19. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +10 -0
  20. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +6 -6
  21. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  22. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js +6 -0
  23. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js.map +1 -1
  24. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.d.ts.map +1 -1
  25. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js +1 -1
  26. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js.map +1 -1
  27. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.ts +6 -0
  28. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js +5 -2
  29. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js.map +1 -1
  30. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.d.ts.map +1 -1
  31. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js +1 -1
  32. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js.map +1 -1
  33. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.ts +5 -2
  34. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js +6 -0
  35. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js.map +1 -1
  36. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.d.ts.map +1 -1
  37. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js +1 -1
  38. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js.map +1 -1
  39. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.ts +6 -0
  40. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js +39 -3
  41. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js.map +1 -1
  42. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.d.ts +4 -0
  43. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.d.ts.map +1 -1
  44. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js +1 -1
  45. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js.map +1 -1
  46. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.ts +40 -2
@@ -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;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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AC;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,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B,GAAG,EAAE/E,eAAe,IAAI,MAAM,EAAE,IAAI,CAAC;YACrFgD,aAAa,CAAC0B,IAAI,CAACF,OAAO,CAAC;UAC/B,CAAC,CAAC,OAAOb,KAAK,EAAE;YACZ,MAAMsB,GAAG,GAAItB,KAAK,CAAWuB,OAAO;YACpCjG,MAAM,CAAC0E,KAAK,CAAC,6CAA6CoB,GAAG,EAAE,EAAEE,GAAG,EAAE,aAAa,CAAC;YACpFhG,MAAM,CAACkG,cAAc,CAAC,2CAA2CJ,GAAG,kBAAkBE,GAAG,EAAE,CAAC;YAC5FjC,aAAa,CAAC0B,IAAI,CAAC,IAAIX,IAAI,CAAC;cAAEvD,IAAI,EAAE;YAAQ,CAAC,CAAC,CAAC;UACnD;QACJ,CAAC,CAAC;MACN;MAIA,MAAM4E,WAAW,GAAG,IAAIC,cAAc,CAAC;QACnCC,KAAK,EAAEtC;MACX,CAAC,CAAC;MAEF9C,KAAK,CAACqF,SAAS,CAAC;QACZhE,IAAI,EAAEtB,UAAU;QAChBkB,KAAK,EAAEnB,eAAe;QACtBwF,QAAQ,EAAEJ,WAAW;QACrBK,iBAAiB,EAAE;MACvB,CAAC,CAAC;MAEF,OAAOvF,KAAK;IAChB;EACJ;EAAC,IAAAwF,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAvG,WAAA,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;KAuI/H;CAEA"}
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 d=c["Logger"];class u{render(l,c,u,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,...!u.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)}})]]}),fixedLayout:false,mode:!u.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)}});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){d.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=u.generateField(s,n,g||"meta",true);w.push(i)}}else{d.warn(`[MetaUI] Unsupported layout element type '${e.type}' in Table.`,"","TableLayout")}})}else{d.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=u.generateField(a,e,g||"meta",true);w.push(s)}catch(t){const a=t.message;d.error(`[MetaUI] Failed to render fallback column ${e}`,a,"TableLayout");d.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=u;return m});
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,EAAiBC,EAAmBC,EAAgBC,EAAuBC,EAAsB,KAC3G,GAAIJ,EAAOK,OAAS,UAAYL,EAAOM,QAAUN,EAAOM,MAAMC,WAAY,CACtE,MAAM,IAAIC,MAAM,uEACpB,CAEA,MAAMC,EAAaT,EAAOU,OAAS,QACnC,MAAMC,EAAkBV,EACxB,MAAMW,EAAaR,EAEnB,MAAMS,EAA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AOE,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,EAYFC,OAAOC,EAAiBC,EAAmBC,EAAgBC,EAAuBC,EAAsB,KAC3G,GAAIJ,EAAOK,OAAS,UAAYL,EAAOM,QAAUN,EAAOM,MAAMC,WAAY,CACtE,MAAM,IAAIC,MAAM,uEACpB,CAEA,MAAMC,EAAaT,EAAOU,OAAS,QACnC,MAAMC,EAAkBV,EACxB,MAAMW,EAAaR,EAEnB,MAAMS,E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oB,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
 
@@ -2,7 +2,7 @@
2
2
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/BaseHardwareControl", ["sap/ui/core/Control","./BaseHardwareControlRenderer"],function(e,t){"use strict";function a(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const n=a(t);const r=e.extend("nz.co.siliconst.ui5.metaui.controls.BaseHardwareControl",{renderer:n,metadata:{properties:{value:{type:"any",defaultValue:null},schemaMetadata:{type:"object",defaultValue:null},readOnly:{type:"boolean",defaultValue:false}},aggregations:{_content:{type:"sap.m.VBox",multiple:false,visibility:"hidden"}},events:{capture:{parameters:{value:{type:"any"}}}}},setValueAndFire:function e(t){this.setProperty("value",t,true);this.fireEvent("capture",{value:t})},renderContent:function e(t,a){}});return r});
3
3
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/BaseHardwareControlRenderer", [],function(){"use strict";var n={apiVersion:2,render:function(n,e){n.openStart("div",e);n.class("sapUiSmallMarginBottom");n.openEnd();const t=e.getAggregation("_content");if(t){n.renderControl(t)}if(typeof e.renderContent==="function"){e.renderContent(n,e)}n.close("div")}};return n});
4
4
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/CameraControl", ["./BaseHardwareControl","sap/m/Button","sap/m/VBox","sap/ui/core/HTML","sap/m/MessageToast","sap/m/Image","../utils/Logger"],function(e,t,i,s,a,r,n){"use strict";function o(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const l=o(e);const h=n["Logger"];class d extends l{static renderer="nz.co.siliconst.ui5.metaui.controls.BaseHardwareControlRenderer";static metadata={properties:{},events:{}};videoEl=null;mediaStream=null;init(){super.init();this.videoHtml=new s({content:"<video width='400' height='300' autoplay playsinline style='background-color: #000; display: none;'></video>",afterRendering:this.onVideoRendered.bind(this)}).addStyleClass("sapUiSmallMarginBottom");this.previewImage=new r({width:"400px",visible:false}).addStyleClass("sapUiSmallMarginBottom");this.startBtn=new t({icon:"sap-icon://video",text:"Start Camera",press:this.handleStartCameraPress.bind(this)});this.captureBtn=new t({icon:"sap-icon://camera",text:"Capture",visible:false,press:this.captureImage.bind(this)});this.retakeBtn=new t({icon:"sap-icon://undo",text:"Retake",visible:false,press:this.retakeImage.bind(this)});this.vBox=new i({items:[this.videoHtml,this.previewImage,this.startBtn,this.captureBtn,this.retakeBtn]});this.setAggregation("_content",this.vBox)}async onVideoRendered(){const e=this.videoHtml.getDomRef();if(!e)return;this.videoEl=e;const t=this.getValue();if(t&&typeof t==="string"&&t.startsWith("data:image")){this.showPreview(t)}else if(this.captureBtn.getVisible()&&this.videoHtml.getVisible()){this.startCamera()}}handleStartCameraPress(){this.startCamera();this.startBtn.setVisible(false);this.captureBtn.setVisible(true);if(this.videoEl){this.videoEl.style.display="block"}}async startCamera(){try{this.mediaStream=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});if(this.videoEl){this.videoEl.srcObject=this.mediaStream}}catch(e){h.error("Camera access denied or unavailable",e.message,"CameraControl");a.show("Camera access denied or unavailable.")}}stopCamera(){if(this.mediaStream){this.mediaStream.getTracks().forEach(e=>e.stop());this.mediaStream=null}}captureImage(){if(!this.videoEl)return;const e=document.createElement("canvas");e.width=this.videoEl.videoWidth||400;e.height=this.videoEl.videoHeight||300;const t=e.getContext("2d");if(t){t.drawImage(this.videoEl,0,0,e.width,e.height);const i=e.toDataURL("image/jpeg",.8);this.setValueAndFire(i);this.showPreview(i);a.show("Image captured successfully.")}}retakeImage(){this.setValueAndFire(null);this.previewImage.setVisible(false);this.videoHtml.setVisible(true);this.captureBtn.setVisible(true);this.retakeBtn.setVisible(false)}showPreview(e){this.stopCamera();this.videoHtml.setVisible(false);this.previewImage.setSrc(e);this.previewImage.setVisible(true);this.captureBtn.setVisible(false);this.retakeBtn.setVisible(true)}setValue(e){super.setValue(e);if(e&&typeof e==="string"&&e.startsWith("data:image")){this.showPreview(e)}else if(!e){if(this.previewImage.getVisible()){this.retakeImage()}}return this}exit(){this.stopCamera();super.exit()}}return d});
5
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/DynamicHost", ["sap/ui/core/Control","./host/GeneratorHost","../utils/Logger","./host/delegates/ODataDelegate"],function(t,e,n,i){"use strict";function a(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const o=a(e);const s=n["Logger"];const r=i["ODataDelegate"];const l=t.extend("nz.co.siliconst.ui5.metaui.controls.DynamicHost",{constructor:function e(){t.prototype.constructor.apply(this,arguments);this._innerHost=null;this.odataDelegate=null;this._initializedInner=false;this._innerHost=null;this._initializedInner=false},renderer:{apiVersion:2,render(t,e){t.openStart("div",e);t.style("width","100%");t.style("height","100%");t.openEnd();const n=e.getAggregation("_content");if(n){t.renderControl(n)}t.close("div")}},metadata:{properties:{schemaDefinition:{type:"any",defaultValue:null},data:{type:"object",defaultValue:null,bindable:"bindable"},dataJson:{type:"string",defaultValue:null,bindable:"bindable"},liveUpdate:{type:"boolean",defaultValue:false},isValid:{type:"boolean",defaultValue:true},useMessageManager:{type:"boolean",defaultValue:false},modelName:{type:"string",defaultValue:"meta"},debugMode:{type:"boolean",defaultValue:false},editable:{type:"boolean",defaultValue:true}},aggregations:{_content:{type:"sap.ui.core.Control",multiple:false,visibility:"hidden"}},events:{beforeSubmit:{parameters:{payload:{type:"object"},addError:{type:"function"},preventDefault:{type:"function"}}},submit:{parameters:{payload:{type:"object"},payloadJson:{type:"string"}}},cancel:{},fieldChange:{parameters:{fieldPath:{type:"string"},value:{type:"any"},payload:{type:"object"},isValid:{type:"boolean"}}},validationStateChanged:{parameters:{isValid:{type:"boolean"}}},validationError:{parameters:{fieldPath:{type:"string"},message:{type:"string"}}},validationSuccess:{parameters:{fieldPath:{type:"string"}}}}},initODataDelegate:function t(){if(!this.odataDelegate){const t=this.getBindingContext("odata")||this.getBindingContext();if(t){s.debug("[MetaUI DynamicHost]",`Context found for delegate initialization: ${t.getPath()}`,"DynamicHost");if(t&&t.requestObject&&typeof t.requestObject==="function"){s.debug("[MetaUI DynamicHost]",`Context supports requestObject/getObject. Instantiating ODataDelegate.`,"DynamicHost");this.odataDelegate=new r(this,t);this.odataDelegate.syncToEngine()}else{s.debug("[MetaUI DynamicHost]",`Context does NOT support requestObject/getObject! Keys: ${Object.keys(t)}`,"DynamicHost")}}}},setBindingContext:function e(n,i){t.prototype.setBindingContext.call(this,n,i);this.initODataDelegate();return this},bindElement:function e(n,i){t.prototype.bindElement.call(this,n,i);const a=typeof n==="object"?n.model:undefined;const o=this.getElementBinding(a);if(o){o.attachChange(()=>{this.initODataDelegate()})}return this},onBeforeRendering:function e(){s.debug("[MetaUI DynamicHost]",`onBeforeRendering called. _initializedInner: ${this._initializedInner}`,"DynamicHost");this.initODataDelegate();if(!this._initializedInner){const e=this.getProperty("schemaDefinition");const n=this.getProperty("dataJson");const i=this.getProperty("data");const a=!!e;const r=!!n||!!i;s.debug("[MetaUI DynamicHost]",`Evaluating boot. hasSchema: ${a}, hasData: ${r}`,"DynamicHost");if(a||r){if(this.getProperty("debugMode")){s.debug("[MetaUI DynamicHost]",`Booting inner host. hasSchema: ${a}, hasData: ${r}`,"DynamicHost")}this._innerHost=new o;const e=this.getMetadata().getProperties();for(const n in e){const e=t.prototype.getProperty.call(this,n);if(e!==null&&e!==undefined){this._innerHost.setProperty(n,e)}}this.setAggregation("_content",this._innerHost);const n=this.getMetadata().getEvents();for(const e in n){this._innerHost.attachEvent(e,n=>{if(e==="submit"||e==="fieldChange"){const i=n.getParameters();if(i.payload){t.prototype.setProperty.call(this,"data",i.payload,true);const e=i.payloadJson||JSON.stringify(i.payload,null,2);t.prototype.setProperty.call(this,"dataJson",e,true)}if(e==="fieldChange"&&this.odataDelegate){this.odataDelegate.handleFieldChange(i.fieldPath,i.value)}}this.fireEvent(e,n.getParameters())})}this._initializedInner=true}}},setProperty:function e(n,i,a){if(n==="data"||n==="dataJson"||n==="schemaDefinition"){if(this.getProperty("debugMode")){s.debug("[MetaUI DynamicHost]",`Wrapper received setProperty: ${n}`,"DynamicHost")}}t.prototype.setProperty.call(this,n,i,a);if(this._innerHost){this._innerHost.setProperty(n,i,a)}else if(n==="data"||n==="dataJson"||n==="schemaDefinition"){if(this.getProperty("debugMode")){s.debug("[MetaUI DynamicHost]",`_innerHost not yet initialized when ${n} was set. Booting will happen on next render.`,"DynamicHost")}}return this},openInDialog:function t(e,n,i){if(!this._innerHost){this.onBeforeRendering()}this._innerHost?.openInDialog(e,n,i)},triggerSubmit:function t(){if(!this._innerHost){return false}return this._innerHost.triggerSubmit()},getProperty:function e(n){if(n==="outputData"){n="data"}if(this._innerHost&&(n==="data"||n==="dataJson")){return this._innerHost.getProperty(n)}return t.prototype.getProperty.call(this,n)}});return l});
5
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/DynamicHost", ["sap/ui/core/Control","./host/GeneratorHost","../utils/Logger","./host/delegates/ODataDelegate"],function(t,e,n,i){"use strict";function a(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const o=a(e);const s=n["Logger"];const r=i["ODataDelegate"];const l=t.extend("nz.co.siliconst.ui5.metaui.controls.DynamicHost",{constructor:function e(){t.prototype.constructor.apply(this,arguments);this._innerHost=null;this.odataDelegate=null;this._initializedInner=false;this._innerHost=null;this._initializedInner=false},renderer:{apiVersion:2,render(t,e){t.openStart("div",e);t.style("width","100%");t.style("height","100%");t.openEnd();const n=e.getAggregation("_content");if(n){t.renderControl(n)}t.close("div")}},metadata:{properties:{schemaDefinition:{type:"any",defaultValue:null},data:{type:"object",defaultValue:null,bindable:"bindable"},dataJson:{type:"string",defaultValue:null,bindable:"bindable"},liveUpdate:{type:"boolean",defaultValue:false},isValid:{type:"boolean",defaultValue:true},useMessageManager:{type:"boolean",defaultValue:false},modelName:{type:"string",defaultValue:"meta"},debugMode:{type:"boolean",defaultValue:false},editable:{type:"boolean",defaultValue:true}},aggregations:{_content:{type:"sap.ui.core.Control",multiple:false,visibility:"hidden"}},events:{beforeSubmit:{parameters:{payload:{type:"object"},addError:{type:"function"},preventDefault:{type:"function"}}},submit:{parameters:{payload:{type:"object"},payloadJson:{type:"string"}}},cancel:{},fieldChange:{parameters:{fieldPath:{type:"string"},value:{type:"any"},payload:{type:"object"},isValid:{type:"boolean"}}},validationStateChanged:{parameters:{isValid:{type:"boolean"}}},validationError:{parameters:{fieldPath:{type:"string"},message:{type:"string"}}},validationSuccess:{parameters:{fieldPath:{type:"string"}}}}},initODataDelegate:function t(){if(!this.odataDelegate){if(this.getBindingInfo("dataJson")){return}const t=this.getBindingInfo("data");if(t&&t.path&&t.path!==""){return}const e=this.getBindingContext("odata")||this.getBindingContext();if(e){s.debug("[MetaUI DynamicHost]",`Context found for delegate initialization: ${e.getPath()}`,"DynamicHost");if(e&&e.requestObject&&typeof e.requestObject==="function"){s.debug("[MetaUI DynamicHost]",`Context supports requestObject/getObject. Instantiating ODataDelegate.`,"DynamicHost");this.odataDelegate=new r(this,e);this.odataDelegate.syncToEngine()}else{s.debug("[MetaUI DynamicHost]",`Context does NOT support requestObject/getObject! Keys: ${Object.keys(e)}`,"DynamicHost")}}}},setBindingContext:function e(n,i){t.prototype.setBindingContext.call(this,n,i);this.initODataDelegate();return this},bindElement:function e(n,i){t.prototype.bindElement.call(this,n,i);const a=typeof n==="object"?n.model:undefined;const o=this.getElementBinding(a);if(o){o.attachChange(()=>{this.initODataDelegate()})}return this},onBeforeRendering:function e(){s.debug("[MetaUI DynamicHost]",`onBeforeRendering called. _initializedInner: ${this._initializedInner}`,"DynamicHost");this.initODataDelegate();if(!this._initializedInner){const e=this.getProperty("schemaDefinition");const n=this.getProperty("dataJson");const i=this.getProperty("data");const a=!!e;const r=!!n||!!i;s.debug("[MetaUI DynamicHost]",`Evaluating boot. hasSchema: ${a}, hasData: ${r}`,"DynamicHost");if(a||r){if(this.getProperty("debugMode")){s.debug("[MetaUI DynamicHost]",`Booting inner host. hasSchema: ${a}, hasData: ${r}`,"DynamicHost")}this._innerHost=new o;const e=this.getMetadata().getProperties();for(const n in e){const e=t.prototype.getProperty.call(this,n);if(e!==null&&e!==undefined){this._innerHost.setProperty(n,e)}}this.setAggregation("_content",this._innerHost);const n=this.getMetadata().getEvents();for(const e in n){this._innerHost.attachEvent(e,n=>{if(e==="submit"||e==="fieldChange"){const i=n.getParameters();if(i.payload){t.prototype.setProperty.call(this,"data",i.payload,true);const e=i.payloadJson||JSON.stringify(i.payload,null,2);t.prototype.setProperty.call(this,"dataJson",e,true)}if(e==="fieldChange"&&this.odataDelegate){this.odataDelegate.handleFieldChange(i.fieldPath,i.value)}}this.fireEvent(e,n.getParameters())})}this._initializedInner=true}}},setProperty:function e(n,i,a){if(n==="data"||n==="dataJson"||n==="schemaDefinition"){if(this.getProperty("debugMode")){s.debug("[MetaUI DynamicHost]",`Wrapper received setProperty: ${n}`,"DynamicHost")}}t.prototype.setProperty.call(this,n,i,a);if(this._innerHost){this._innerHost.setProperty(n,i,a)}else if(n==="data"||n==="dataJson"||n==="schemaDefinition"){if(this.getProperty("debugMode")){s.debug("[MetaUI DynamicHost]",`_innerHost not yet initialized when ${n} was set. Booting will happen on next render.`,"DynamicHost")}}return this},openInDialog:function t(e,n,i){if(!this._innerHost){this.onBeforeRendering()}this._innerHost?.openInDialog(e,n,i)},triggerSubmit:function t(){if(!this._innerHost){return false}return this._innerHost.triggerSubmit()},getProperty:function e(n){if(n==="outputData"){n="data"}if(this._innerHost&&(n==="data"||n==="dataJson")){return this._innerHost.getProperty(n)}return t.prototype.getProperty.call(this,n)}});return l});
6
6
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/GeolocationControl", ["./BaseHardwareControl","./BaseHardwareControlRenderer","sap/m/Button","sap/m/Input","sap/m/VBox","sap/m/MessageToast"],function(t,e,o,i,n,s){"use strict";function a(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function r(t){return new Promise(function(e,o){sap.ui.require([t],function(o){if(!(o&&o.__esModule)){o=o===null||!(typeof o==="object"&&t.endsWith("/library"))?{default:o}:o;Object.defineProperty(o,"__esModule",{value:true})}e(o)},function(t){o(t)})})}const u=a(t);const l=a(e);class c extends u{static renderer=l;static metadata={aggregations:{_content:{type:"sap.m.VBox",multiple:false,visibility:"hidden"}}};init(){super.init();this.locationBtn=new o({icon:"sap-icon://map",text:"Get Location",press:this.getLocation.bind(this)});this.resultInput=new i({editable:false,visible:false});this.vBox=new n({items:[this.locationBtn,this.resultInput]});this.setAggregation("_content",this.vBox)}onBeforeRendering(){const t=this.getProperty("schemaMetadata");if(t&&t.ui&&t.ui.label){this.locationBtn.setText(t.ui.label)}const e=this.getProperty("readOnly");this.locationBtn.setEnabled(!e);const o=this.getProperty("value");if(o){this.resultInput.setValue(o);this.resultInput.setVisible(true)}}getLocation(){if(!navigator.geolocation){s.show("Geolocation is not supported by your browser");return}navigator.geolocation.getCurrentPosition(t=>{const e=`${t.coords.latitude}, ${t.coords.longitude}`;this.resultInput.setValue(e);this.resultInput.setVisible(true);this.setValueAndFire(e);s.show("Location acquired.")},t=>{r("../utils/Logger").then(({Logger:e})=>{e.error("[MetaUI] Geolocation failed or denied",t.message,"GeolocationControl")});s.show("Unable to retrieve your location")})}}return c});
7
7
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/RichTextControl", ["./BaseHardwareControl","./BaseHardwareControlRenderer","sap/m/VBox","sap/ui/richtexteditor/RichTextEditor"],function(t,e,i,r){"use strict";function n(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const o=n(t);const s=n(e);const h=o.extend("nz.co.siliconst.ui5.metaui.controls.RichTextControl",{metadata:{properties:{},events:{},aggregations:{_content:{type:"sap.m.VBox",multiple:false,visibility:"hidden"}}},renderer:s,init:function t(){o.prototype.init.call(this);this.richTextEditor=new r({width:"100%",height:"300px",showGroupFont:true,showGroupInsert:true,tooltip:"Rich Text Editor",change:t=>{const e=t.getParameter("newValue");this.setValueAndFire(e)}});this.vBox=new i({items:[this.richTextEditor]});this.setAggregation("_content",this.vBox)},onBeforeRendering:function t(){const e=this.getProperty("readOnly");this.richTextEditor.setEditable(!e);const i=this.getProperty("value");if(i!==undefined&&i!==null){if(this.richTextEditor.getValue()!==i){this.richTextEditor.setValue(i)}}},setValue:function t(e){this.setProperty("value",e,true);if(this.richTextEditor&&e!==undefined&&e!==null){if(this.richTextEditor.getValue()!==e){this.richTextEditor.setValue(e)}}return this}});return h});
8
8
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/SignatureControl", ["./BaseHardwareControl","sap/m/Button","sap/m/VBox","sap/ui/core/HTML","sap/m/MessageToast"],function(t,s,a,i,n){"use strict";function e(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const h=e(t);class r extends h{static renderer="nz.co.siliconst.ui5.metaui.controls.BaseHardwareControlRenderer";static metadata={properties:{},events:{}};isDrawing=false;canvasCtx=null;canvasEl=null;init(){super.init();this.canvasHtml=new i({content:"<canvas width='400' height='200' style='border: 1px solid #ccc; background-color: #fff; touch-action: none; cursor: crosshair;'></canvas>",afterRendering:this.onCanvasRendered.bind(this)}).addStyleClass("sapUiSmallMarginBottom");this.clearBtn=new s({icon:"sap-icon://sys-cancel",text:"Clear Signature",press:this.clearSignature.bind(this)});this.vBox=new a({items:[this.canvasHtml,this.clearBtn]});this.setAggregation("_content",this.vBox);this.boundStartDrawing=this.startDrawing.bind(this);this.boundDraw=this.draw.bind(this);this.boundStopDrawing=this.stopDrawing.bind(this);this.boundStartDrawingTouch=this.startDrawingTouch.bind(this);this.boundDrawTouch=this.drawTouch.bind(this)}onCanvasRendered(){const t=this.canvasHtml.getDomRef();if(!t)return;this.canvasEl=t;this.canvasCtx=this.canvasEl.getContext("2d");if(this.canvasCtx){this.canvasCtx.lineWidth=2;this.canvasCtx.lineCap="round";this.canvasCtx.strokeStyle="#000"}this.canvasEl.addEventListener("mousedown",this.boundStartDrawing);this.canvasEl.addEventListener("mousemove",this.boundDraw);this.canvasEl.addEventListener("mouseup",this.boundStopDrawing);this.canvasEl.addEventListener("mouseout",this.boundStopDrawing);this.canvasEl.addEventListener("touchstart",this.boundStartDrawingTouch,{passive:false});this.canvasEl.addEventListener("touchmove",this.boundDrawTouch,{passive:false});this.canvasEl.addEventListener("touchend",this.boundStopDrawing);const s=this.getValue();if(s&&typeof s==="string"&&s.startsWith("data:image")){this.loadImageOntoCanvas(s)}}loadImageOntoCanvas(t){const s=new window.Image;s.onload=()=>{if(this.canvasCtx&&this.canvasEl){this.canvasCtx.clearRect(0,0,this.canvasEl.width,this.canvasEl.height);this.canvasCtx.drawImage(s,0,0,this.canvasEl.width,this.canvasEl.height)}};s.src=t}getCoordinates(t){if(!this.canvasEl)return{x:0,y:0};const s=this.canvasEl.getBoundingClientRect();let a,i;if(t.type.startsWith("touch")){a=t.touches[0].clientX;i=t.touches[0].clientY}else{a=t.clientX;i=t.clientY}return{x:a-s.left,y:i-s.top}}startDrawing(t){this.isDrawing=true;this.draw(t)}startDrawingTouch(t){t.preventDefault();this.isDrawing=true;this.drawTouch(t)}draw(t){if(!this.isDrawing||!this.canvasCtx)return;const s=this.getCoordinates(t);this.canvasCtx.lineTo(s.x,s.y);this.canvasCtx.stroke();this.canvasCtx.beginPath();this.canvasCtx.moveTo(s.x,s.y)}drawTouch(t){if(!this.isDrawing||!this.canvasCtx)return;t.preventDefault();const s=this.getCoordinates(t);this.canvasCtx.lineTo(s.x,s.y);this.canvasCtx.stroke();this.canvasCtx.beginPath();this.canvasCtx.moveTo(s.x,s.y)}stopDrawing(){if(!this.isDrawing)return;this.isDrawing=false;if(this.canvasCtx){this.canvasCtx.beginPath();this.saveSignature()}}clearSignature(){if(this.canvasCtx&&this.canvasEl){this.canvasCtx.clearRect(0,0,this.canvasEl.width,this.canvasEl.height)}this.setValueAndFire(null);n.show("Signature cleared.")}saveSignature(){if(this.canvasEl){const t=this.canvasEl.toDataURL("image/png");this.setValueAndFire(t)}}setValue(t){super.setValue(t);if(t&&typeof t==="string"&&t.startsWith("data:image")){this.loadImageOntoCanvas(t)}else if(!t&&this.canvasCtx&&this.canvasEl){this.canvasCtx.clearRect(0,0,this.canvasEl.width,this.canvasEl.height)}return this}exit(){if(this.canvasEl){this.canvasEl.removeEventListener("mousedown",this.boundStartDrawing);this.canvasEl.removeEventListener("mousemove",this.boundDraw);this.canvasEl.removeEventListener("mouseup",this.boundStopDrawing);this.canvasEl.removeEventListener("mouseout",this.boundStopDrawing);this.canvasEl.removeEventListener("touchstart",this.boundStartDrawingTouch);this.canvasEl.removeEventListener("touchmove",this.boundDrawTouch);this.canvasEl.removeEventListener("touchend",this.boundStopDrawing)}this.canvasEl=null;this.canvasCtx=null;super.exit()}}return r});
@@ -23,18 +23,18 @@ sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/SchemaValidator", [],function(
23
23
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/StateManager", ["sap/ui/model/json/JSONModel","./PipelineManager","sap/ui/core/message/Message","sap/ui/core/library","sap/ui/core/Messaging"],function(e,t,s,a,i){"use strict";const r=t["GlobalPipeline"];class o{constructor(t={},s,a="meta"){this.activeModelName=a;this.schema=s;const i=JSON.parse(JSON.stringify(t));this.model=new e(i);this.model.setDefaultBindingMode("TwoWay");const r=this.model.setProperty.bind(this.model);this.model.setProperty=(e,t,s,a)=>{const i=r(e,t,s,a);this.validatePath(e,t);return i}}validatePath(e,t){const o=e.replace(/^\//,"");const n=this.findMetadataForPath(o);const d=i;const l=e.startsWith("/")?e:`/${e}`;const g=d.getMessageModel().getData();const h=g.filter(e=>{const t=e.getTarget()===l&&e.getMessageProcessor()&&e.getMessageProcessor().getId()===this.model.getId();return t});if(h.length>0){d.removeMessages(h)}if(!n)return;const c=[];const m={};if(n.required){c.push("required")}if(n.type==="string"&&n.maxLength){c.push("maxLength");m["maxLength"]={max:n.maxLength}}if(n.ui?.validators){for(const e of n.ui.validators){if(typeof e==="string"){c.push(e)}else if(e&&e.name){c.push(e.name);if(e.args!==undefined){m[e.name]=e.args}}}}if(c.length>0){const e=r.executeValidation(t,c,m);if(!e.isValid){const t=new s({message:e.errorMessage||"Invalid value.",type:a.MessageType.Error,target:l,processor:this.model});d.addMessages(t)}}}findMetadataForPath(e){if(!this.schema||!this.schema.properties)return undefined;return this.schema.properties[e]}getModel(){return this.model}bindControl(e,t,s){e.bindProperty(t,{path:s,model:"meta"})}extractPayload(){const e=this.model.getData();return JSON.parse(JSON.stringify(e))}destroy(){if(this.model){this.model.destroy()}}}var n={__esModule:true};n.StateManager=o;return n});
24
24
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/layouts/CompactLayout", ["sap/m/VBox","sap/m/Label","../core/SchemaNormalizer","../utils/Logger"],function(e,t,a,r){"use strict";const o=a["SchemaNormalizer"];const i=r["Logger"];class s{render(t,a,r,s){const n=new e({renderType:"Bare"});n.addStyleClass("sapUiTinyMargin");if(!t.uiLayout||!Array.isArray(t.uiLayout)){i.warn("[MetaUI] Missing 'uiLayout' array in schema. CompactLayout will not render any fields.");return n}const l=[];const p=e=>{if(e.type==="Group"){if(e.label){const t=new sap.m.Title({text:e.label,level:"H5"});t.addStyleClass("sapUiTinyMarginTop sapUiTinyMarginBottom");n.addItem(t)}if(e.elements&&Array.isArray(e.elements)){e.elements.forEach(p)}}else if(e.type==="Control"){if(!e.scope||!e.scope.startsWith("#/properties/")){i.error(`[MetaUI] Invalid scope '${e.scope}' in uiLayout Control.`,"","CompactLayout");return}const{meta:s,bindingPath:p,propKey:c}=o.resolveScope(t,e.scope);if(!s){i.error(`[MetaUI] Property '${c}' not found in schema definitions.`,"","CompactLayout");return}const y=s.items?.type==="object"||s.items?.properties;const u=!!s.ui?.widget;const d=s.type==="array"&&y&&!u;if(d){i.debug("[MetaUI CompactLayout]",`Routing property '${c}' to Table Sub-Layout.`,"CompactLayout");l.push({scope:p,meta:s,label:e.label})}else{i.debug("[MetaUI CompactLayout]",`Rendering scalar field '${p}'.`,"CompactLayout");this._renderScalarField(n,e,p,s,a,r)}}else{i.warn(`[MetaUI] Unsupported layout element type '${e.type}'.`,"","CompactLayout")}};t.uiLayout.forEach(p);l.forEach(e=>{try{const t={type:"array",title:e.label||e.meta.ui?.label||e.scope,items:e.meta.items||{type:"object",properties:{}},uiLayout:e.meta.items?.uiLayout};const o=r.generateLayout(t,a,`/${e.scope}`);if(o){o.addStyleClass("sapUiTinyMarginTop");n.addItem(o)}}catch(t){const a=t.message;i.error(`[MetaUI] Failed to render array field ${e.scope}`,a,"CompactLayout");i.showErrorPopup(`Failed to render array field '${e.scope}'.\n\nDetails: ${a}`)}});return n}_renderScalarField(a,r,o,s,n,l){try{const i=r.label||s.ui?.label||o;const p=new t({text:i,required:s.required});p.addStyleClass("sapUiTinyMarginTop");const c={...s};if(r.widget){c.ui={...s.ui,widget:r.widget}}const y=l.generateField(c,`/${o}`,n);y.addStyleClass("sapUiTinyMarginBottom");const u=new e({renderType:"Bare",items:[p,y]});a.addItem(u)}catch(e){const t=e.message;i.error(`[MetaUI] Failed to render field ${o}`,t,"CompactLayout");i.showErrorPopup(`Failed to render field '${o}'.\n\nDetails: ${t}`)}}}var n={__esModule:true};n.CompactLayout=s;return n});
25
25
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/layouts/FormLayout", ["sap/ui/layout/form/SimpleForm","sap/m/Label","sap/ui/core/Title","sap/m/VBox","../core/SchemaNormalizer","../utils/Logger"],function(e,t,a,r,o,i){"use strict";const n=o["SchemaNormalizer"];const s=i["Logger"];class l{render(t,o,i,l){const u=new r({renderType:"Bare"});const p=new e({editable:true,title:t.title,layout:"ResponsiveGridLayout",labelSpanXL:4,labelSpanL:4,labelSpanM:4,labelSpanS:12,adjustLabelSpan:false,emptySpanXL:0,emptySpanL:0,emptySpanM:0,emptySpanS:0,columnsXL:1,columnsL:1,columnsM:1,singleContainerFullSize:false});if(!t.uiLayout||!Array.isArray(t.uiLayout)){s.warn("[MetaUI] Missing 'uiLayout' array in schema. Form will not render any fields.");u.addItem(p);return u}const d=[];let y=false;const c=e=>{if(e.type==="Group"){if(e.label){p.addContent(new a({text:e.label}))}if(e.elements&&Array.isArray(e.elements)){e.elements.forEach(c)}}else if(e.type==="Control"){if(!e.scope||!e.scope.startsWith("#/properties/")){s.error(`[MetaUI] Invalid scope '${e.scope}' in uiLayout Control.`,"","FormLayout");return}const{meta:a,bindingPath:r,propKey:l}=n.resolveScope(t,e.scope);if(!a){s.error(`[MetaUI] Property '${l}' not found in schema definitions.`,"","FormLayout");return}const u=a.items?.type==="object"||a.items?.properties;const c=!!a.ui?.widget;const m=a.type==="array"&&u&&!c;if(m){s.debug("[MetaUI FormLayout]",`Routing property '${l}' to Table Sub-Layout.`,"FormLayout");d.push({scope:r,meta:a,label:e.label})}else{y=true;s.debug("[MetaUI FormLayout]",`Rendering scalar field '${r}'.`,"FormLayout");this._renderScalarField(p,e,r,a,o,i)}}else{s.warn(`[MetaUI] Unsupported layout element type '${e.type}'.`,"","FormLayout")}};t.uiLayout.forEach(c);if(y){u.addItem(p)}d.forEach(e=>{try{const t={type:"array",title:e.label||e.meta.ui?.label||e.scope,items:e.meta.items||{type:"object",properties:{}},uiLayout:e.meta.items?.uiLayout};const a=i.generateLayout(t,o,`/${e.scope}`);if(a){a.addStyleClass("sapUiSmallMarginTop");u.addItem(a)}}catch(t){const a=t.message;s.error(`[MetaUI] Failed to render array field ${e.scope}`,a,"FormLayout");s.showErrorPopup(`Failed to render array field '${e.scope}'.\n\nDetails: ${a}`)}});return u}_renderScalarField(e,a,r,o,i,n){try{const s=a.label||o.ui?.label||r;const l=new t({text:s,required:o.required});const u={...o};if(a.widget){u.ui={...o.ui,widget:a.widget}}const p=n.generateField(u,`/${r}`,i);if(u.ui?.fullWidth){sap.ui.require(["sap/ui/layout/GridData"],e=>{p.setLayoutData(new e({span:"XL12 L12 M12 S12"}))})}e.addContent(l);e.addContent(p)}catch(e){const t=e.message;s.error(`[MetaUI] Failed to render field ${r}`,t,"FormLayout");s.showErrorPopup(`Failed to render field '${r}'.\n\nDetails: ${t}`)}}}var u={__esModule:true};u.FormLayout=l;return u});
26
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/layouts/TableLayout", ["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 d=c["Logger"];class u{render(l,c,u,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,...!u.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)}})]]}),fixedLayout:false,mode:!u.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)}});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){d.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=u.generateField(s,n,g||"meta",true);w.push(i)}}else{d.warn(`[MetaUI] Unsupported layout element type '${e.type}' in Table.`,"","TableLayout")}})}else{d.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=u.generateField(a,e,g||"meta",true);w.push(s)}catch(t){const a=t.message;d.error(`[MetaUI] Failed to render fallback column ${e}`,a,"TableLayout");d.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=u;return m});
26
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/layouts/TableLayout", ["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});
27
27
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/layouts/WizardLayout", ["sap/m/Wizard","sap/m/WizardStep","sap/ui/layout/form/SimpleForm","sap/m/Label","../core/SchemaNormalizer","../utils/Logger"],function(e,t,a,r,n,i){"use strict";const o=n["SchemaNormalizer"];const s=i["Logger"];class l{render(r,n,i,o){const l=new e({renderMode:"Page",showNextButton:true,complete:function(){if(o)o()}});if(!r.uiLayout||!Array.isArray(r.uiLayout)){s.warn("[MetaUI] Missing 'uiLayout' array in wizard schema. Wizard will not render any steps.");return l}r.uiLayout.forEach(e=>{if(e.type==="Group"||e.type==="WizardStep"){const o=new t({title:e.label||"Step",validated:true});const s=new a({editable:true,layout:"ResponsiveGridLayout",labelSpanXL:4,labelSpanL:4,labelSpanM:4,labelSpanS:12,adjustLabelSpan:false,emptySpanXL:0,emptySpanL:0,emptySpanM:0,emptySpanS:0,columnsXL:1,columnsL:1,columnsM:1,singleContainerFullSize:false});if(e.elements&&Array.isArray(e.elements)){e.elements.forEach(e=>{this._renderElementInForm(s,e,r,n,i)})}o.addContent(s);l.addStep(o)}else{s.warn(`[MetaUI] Top-level element '${e.type}' inside WizardLayout must be 'Group' or 'WizardStep'.`,"","WizardLayout")}});return l}_renderElementInForm(e,t,a,n,i){if(t.type==="Control"){if(!t.scope||!t.scope.startsWith("#/properties/")){s.error(`[MetaUI] Invalid scope '${t.scope}' in uiLayout Control.`,"","WizardLayout");return}const{meta:l,bindingPath:u,propKey:d}=o.resolveScope(a,t.scope);if(!l){s.error(`[MetaUI] Property '${d}' not found in schema definitions.`,"","WizardLayout");return}try{const a=t.label||l.ui?.label||d;const o=new r({text:a,required:l.required});const s={...l};if(t.widget){s.ui={...l.ui,widget:t.widget}}const p=i.generateField(s,`/${u}`,n);if(s.ui?.fullWidth){sap.ui.require(["sap/ui/layout/GridData"],e=>{p.setLayoutData(new e({span:"XL12 L12 M12 S12"}))})}e.addContent(o);e.addContent(p)}catch(t){s.error(`[MetaUI] Failed to render Wizard field ${d}`,t.message,"WizardLayout");e.addContent(new r({text:d}))}}else{s.warn(`[MetaUI] Nested groups within Wizard steps are not fully supported in SimpleForm yet.`,"","WizardLayout")}}}var u={__esModule:true};u.WizardLayout=l;return u});
28
28
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/library", ["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(i,o,n,t,s,u,c,l,e,a,r,m,z,p){"use strict";i.initLibrary({name:"nz.co.siliconst.ui5.metaui",version:"1.0.0",dependencies:["sap.ui.core","sap.m","sap.ui.layout","sap.ui.table"],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"],elements:[],interfaces:[],noLibraryCSS:true});var g=window.nz.co.siliconst.ui5.metaui;return g});
29
29
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin", ["../controls/BasePlugin","sap/m/Button"],function(t,e){"use strict";const s=t["BasePlugin"];class i extends s{render(t,s,i="meta"){this.metadata=t;if(!this.isEditable){sap.ui.requireSync("sap/m/Text");const t=sap.ui.require("sap/m/Text");this.control=new t({visible:false});return this.control}this.control=new e({text:t.ui?.label||"Clear Data",type:"Reject",icon:"sap-icon://delete",press:t=>{const e=t.getSource();const s=e.getModel(i);if(s){s.setProperty("/",{})}}});return this.control}getValue(){return null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var a={__esModule:true};a.ClearFormActionPlugin=i;return a});
30
30
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin", ["../controls/BasePlugin","sap/m/Button","sap/ui/core/Core"],function(t,e,i){"use strict";const s=t["BasePlugin"];class a extends s{render(t,s,a="meta"){this.metadata=t;if(!this.isEditable){sap.ui.requireSync("sap/m/Text");const t=sap.ui.require("sap/m/Text");this.control=new t({visible:false});return this.control}this.control=new e({text:t.ui?.label||"Submit",type:"Emphasized",icon:"sap-icon://save",press:()=>{i.getEventBus().publish("MetaUI","TriggerSubmit",{})}});return this.control}getValue(){return null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var n={__esModule:true};n.SubmitFormActionPlugin=a;return n});
31
31
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin", ["../controls/BasePlugin","sap/m/Button","sap/m/library"],function(t,e,n){"use strict";const a=t["BasePlugin"];const s=n.URLHelper;class i extends a{render(t,n,a="meta"){this.metadata=t;this.control=new e({text:t.ui?.label||"Open Link",icon:"sap-icon://action",press:()=>{const e=t.ui?.args||"https://sap.com";s.redirect(e,true)}});return this.control}getValue(){return null}applyState(){if(this.control&&this.metadata){this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var r={__esModule:true};r.UrlNavigationActionPlugin=i;return r});
32
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin", ["./BasePlugin","sap/m/Button"],function(t,e){"use strict";const i=t["BasePlugin"];class s extends i{render(t,i,s="meta",a,n){this.onChange=n;this.metadata=t;const o=i.startsWith("/")?i.substring(1):i;const r={type:"array",title:t.ui?.label||o,items:t.items||{type:"object",properties:{}}};if(t.uiLayout){r.uiLayout=t.uiLayout}this.control=new e({id:this.generateStableId(a,i),text:!this.isEditable?"View Records":"Edit Records",icon:!this.isEditable?"sap-icon://display":"sap-icon://list",press:e=>{const a=e.getSource();const n=a.getModel(s);if(!n)return;const l=a.getBindingContext(s);let u=i;if(l&&!i.startsWith("/")){const t=l.getPath();u=t.endsWith("/")?t+i:t==="/"?"/"+i:t+"/"+i}const c=JSON.parse(JSON.stringify(n.getProperty(u)||[]));sap.ui.require(["nz/co/siliconst/ui5/metaui/controls/DynamicHost"],e=>{const i=new e({schemaDefinition:r,data:c,editable:this.isEditable});if(!!this.isEditable){i.attachSubmit(t=>{const e=t.getParameter("payload");n.setProperty(u,e)})}const s=t.ui?.dialogButtonText||(!this.isEditable?"Close":"OK");i.openInDialog(`Nested Records: ${t.ui?.label||o}`,s)})}});return this.control}getValue(){return null}applyState(){}}var a={__esModule:true};a.ArrayPlugin=s;return a});
32
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin", ["./BasePlugin","sap/m/Button"],function(t,e){"use strict";const i=t["BasePlugin"];class s extends i{render(t,i,s="meta",n,a){this.onChange=a;this.metadata=t;const o=i.startsWith("/")?i.substring(1):i;const r={type:"array",title:t.ui?.label||o,items:t.items||{type:"object",properties:{}}};if(t.uiLayout){r.uiLayout=t.uiLayout}this.control=new e({id:this.generateStableId(n,i),text:!this.isEditable?"View Records":"Edit Records",icon:!this.isEditable?"sap-icon://display":"sap-icon://list",press:e=>{const n=e.getSource();const a=n.getModel(s);if(!a)return;const l=n.getBindingContext(s);let u=i;if(l&&!i.startsWith("/")){const t=l.getPath();u=t.endsWith("/")?t+i:t==="/"?"/"+i:t+"/"+i}const c=JSON.parse(JSON.stringify(a.getProperty(u)||[]));sap.ui.require(["nz/co/siliconst/ui5/metaui/controls/DynamicHost"],e=>{const i=new e({schemaDefinition:r,data:c,editable:this.isEditable});if(!!this.isEditable){i.attachSubmit(t=>{const e=t.getParameter("payload");a.setProperty(u,e);if(this.onChange){this.onChange(true,o)}})}const s=t.ui?.dialogButtonText||(!this.isEditable?"Close":"OK");i.openInDialog(`Nested Records: ${t.ui?.label||o}`,s)})}});return this.control}getValue(){return null}applyState(){}}var n={__esModule:true};n.ArrayPlugin=s;return n});
33
33
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin", ["../controls/BasePlugin","sap/m/HBox","sap/m/Input","sap/ndc/BarcodeScannerButton","sap/m/Text"],function(t,e,i,n,s){"use strict";const a=t["BasePlugin"];class l extends a{render(t,a,l="meta",o,r){this.onChange=r;this.metadata=t;this.fieldKey=a.replace("/","");this.modelName=l;if(!this.isEditable){this.control=new s({id:this.generateStableId(o,a),text:`{${l}>${a}}`});this.applyCommonDirectives(this.control,t,l);return this.control}this.inputControl=new i({id:this.generateStableId(o,a+"-input"),value:`{${l}>${a}}`,editable:!t.ui?.readOnly,width:"100%",change:()=>{const t=this.validate();if(this.onChange){this.onChange(t.isValid,this.fieldKey)}}});const h=new n({id:this.generateStableId(o,a+"-btn"),scanSuccess:t=>{const e=t.getParameter("text");if(e){this.inputControl.setValue(e);const t=this.validate();if(this.onChange){this.onChange(t.isValid,this.fieldKey)}}}});this.control=new e({id:this.generateStableId(o,a),items:[this.inputControl,h],width:"100%"}).addStyleClass("sapUiSmallMarginBottom");this.applyCommonDirectives(this.control,t,l);return this.control}getValue(){return this.inputControl?this.inputControl.getValue():null}applyState(){if(this.inputControl&&this.metadata){if(!this.isEditable)return;this.inputControl.setEditable(!this.metadata.ui?.readOnly)}}}var o={__esModule:true};o.BarcodeScannerPlugin=l;return o});
34
34
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin", ["../../core/PipelineManager"],function(e){"use strict";const i=e["GlobalPipeline"];class t{control=null;metadata=null;fieldKey="";modelName="meta";isEditable=true;setEditable(e){this.isEditable=e}generateStableId(e,i){if(!e)return undefined;const t=i.replace(/^\//,"").replace(/\//g,"-");return`${e}--${t}`}validate(){if(!this.control||!this.metadata)return{isValid:true};if(typeof this.control.getVisible==="function"){if(!this.control.getVisible()){return{isValid:true}}}const e=[];const t={maxLength:this.metadata.maxLength};if(this.metadata.required){e.push("required")}if(this.metadata.maxLength)e.push("maxLength");if(this.metadata.ui?.validators){for(const i of this.metadata.ui.validators){if(typeof i==="string"){e.push(i)}else if(i&&i.name){e.push(i.name);if(i.args!==undefined){t[i.name]=i.args}}}}if(e.length===0){return{isValid:true,errorMessage:undefined,fieldKey:this.fieldKey}}const s=this.getValue();const a=i.executeValidation(s,e,t);return{isValid:a.isValid,errorMessage:a.errorMessage,fieldKey:this.fieldKey}}onStateChange(e){this.metadata=e;this.applyState()}applyCommonDirectives(e,i,t="meta"){if(i.ui?.readOnly!==undefined&&typeof e.setEditable==="function"){e.setEditable(!i.ui.readOnly)}if(i.ui?.visibleOn){const s=sap.ui.require("nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder")?.ExpressionBuilder;let a="";if(s){a=s.build(i.ui.visibleOn,this.fieldKey,t)}else{a=`{= ${i.ui.visibleOn.replace(/\$root\./g,`${t}>/`).replace(/\./g,"/")} }`}e.bindProperty("visible",{parts:[{path:"meta>/"}],formatter:()=>false});e.bindProperty("visible",a)}if(i.ui?.enabledOn&&typeof e.setEnabled==="function"){const s=sap.ui.require("nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder")?.ExpressionBuilder;let a="";if(s){a=s.build(i.ui.enabledOn,this.fieldKey,t)}else{a=`{= ${i.ui.enabledOn.replace(/\$root\./g,`${t}>/`).replace(/\./g,"/")} }`}e.bindProperty("enabled",a)}}destroy(){if(this.control&&typeof this.control.destroy==="function"){this.control.destroy();this.control=null}}}var s={__esModule:true};s.BasePlugin=t;return s});
35
35
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin", ["./BasePlugin","sap/m/CheckBox","sap/m/Text"],function(t,e,i){"use strict";const s=t["BasePlugin"];class a extends s{render(t,s,a="meta",n,o){this.onChange=o;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,s),text:{path:`${a}>${s}`,formatter:t=>t?"Yes":"No"}});this.applyCommonDirectives(this.control,t,a);return this.control}this.control=new e({id:this.generateStableId(n,s),selected:`{${a}>${s}}`,enabled:!t.ui?.readOnly,select:t=>{const e=t.getParameter("selected");const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){return this.control?this.control.getSelected():false}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var n={__esModule:true};n.BooleanPlugin=a;return n});
36
36
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin", ["../controls/BasePlugin","../../controls/CameraControl","sap/m/Image"],function(t,e,i){"use strict";function a(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const n=t["BasePlugin"];const s=a(e);class l extends n{render(t,e,a="meta",n,l){this.onChange=l;this.metadata=t;this.fieldKey=e.replace("/","");this.modelName=a;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,e),src:`{${a}>${e}}`,width:"400px",alt:t.ui?.label||"Image"});this.applyCommonDirectives(this.control,t,a);return this.control}this.control=new s({id:this.generateStableId(n,e),value:`{${a}>${e}}`,schemaMetadata:t,readOnly:!!t.ui?.readOnly});this.applyCommonDirectives(this.control,t,a);this.control.attachCapture(()=>{const t=this.validate();if(this.onChange){this.onChange(t.isValid,this.fieldKey)}});return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setProperty("readOnly",!!this.metadata.ui?.readOnly)}}}var r={__esModule:true};r.CameraPlugin=l;return r});
37
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin", ["./BasePlugin","sap/ui/codeeditor/CodeEditor"],function(t,e){"use strict";const i=t["BasePlugin"];class s extends i{detectLanguage(t){if(!t||typeof t!=="string")return"javascript";const e=t.trim();if(e==="")return"javascript";if(e.startsWith("{")||e.startsWith("[")){try{JSON.parse(e);return"json"}catch(t){}}if(/^\s*<[\s\S]*>\s*$/.test(e)){return"xml"}return"javascript"}adjustHeight(){if(!this.control)return;const t=this.control.getValue()||"";const e=t.split(/\r\n|\r|\n/).length;const i=Math.max(100,e*18+20);this.control.setHeight(i+"px")}render(t,i,s="meta",a,n){this.onChange=n;this.metadata=t;this.fieldKey=i.replace("/","");this.control=new e({id:this.generateStableId(a,i),value:`{${s}>${i}}`,type:t.ui?.args||"javascript",editable:!this.isEditable?false:!t.ui?.readOnly,height:"100px",width:"100%",change:()=>{const e=this.validate();if(this.onChange){this.onChange(e.isValid,this.fieldKey)}if(!t.ui?.args){const t=this.control.getValue();const e=this.detectLanguage(t);if(this.control.getType()!==e){this.control.setType(e)}}this.adjustHeight()}});this.control.attachEventOnce("modelContextChange",()=>{const e=this.control.getBinding("value");const i=()=>{if(this.control){const e=this.control.getValue();if(!t.ui?.args){this.control.setType(this.detectLanguage(e))}this.adjustHeight()}};if(e){e.attachChange(i)}i()});this.applyCommonDirectives(this.control,t,s);return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEditable(!this.metadata.ui?.readOnly)}}}var a={__esModule:true};a.CodeEditorPlugin=s;return a});
37
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin", ["./BasePlugin","sap/ui/codeeditor/CodeEditor"],function(t,e){"use strict";const i=t["BasePlugin"];class s extends i{detectLanguage(t){if(!t||typeof t!=="string")return"javascript";const e=t.trim();if(e==="")return"javascript";if(e.startsWith("{")||e.startsWith("[")){try{JSON.parse(e);return"json"}catch(t){}}if(/^\s*<[\s\S]*>\s*$/.test(e)){return"xml"}return"javascript"}adjustHeight(){if(!this.control)return;const t=this.control.getValue()||"";const e=t.split(/\r\n|\r|\n/).length;const i=Math.max(100,e*18+20);this.control.setHeight(i+"px")}render(t,i,s="meta",a,n){this.onChange=n;this.metadata=t;this.fieldKey=i.replace("/","");this.control=new e({id:this.generateStableId(a,i),value:`{${s}>${i}}`,type:t.ui?.args||"javascript",editable:!this.isEditable?false:!t.ui?.readOnly,height:"100px",width:"100%",change:()=>{const e=this.validate();if(this.onChange){this.onChange(e.isValid,this.fieldKey)}if(!t.ui?.args){const t=this.control.getValue();const e=this.detectLanguage(t);if(this.control.getType()!==e){this.control.setType(e)}}this.adjustHeight()}});this.control.attachEventOnce("modelContextChange",()=>{const e=this.control.getBinding("value");const i=()=>{if(this.control){const e=this.control.getValue();if(!t.ui?.args){this.control.setType(this.detectLanguage(e))}this.adjustHeight()}};if(e){e.attachChange(i)}i()});this.applyCommonDirectives(this.control,t,s);return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable){this.control.setEditable(false)}else{this.control.setEditable(!this.metadata.ui?.readOnly)}}}}var a={__esModule:true};a.CodeEditorPlugin=s;return a});
38
38
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin", ["./BasePlugin","sap/m/DatePicker","sap/m/Text"],function(t,e,a){"use strict";const i=t["BasePlugin"];class s extends i{render(t,i,s="meta",n,r){this.onChange=r;this.metadata=t;if(!this.isEditable){this.control=new a({id:this.generateStableId(n,i),text:{path:`${s}>${i}`,type:"sap.ui.model.type.Date",formatOptions:{source:{pattern:"yyyy-MM-dd"},pattern:"yyyy-MM-dd"}}});this.applyCommonDirectives(this.control,t,s);return this.control}this.control=new e({id:this.generateStableId(n,i),value:{path:`${s}>${i}`,type:"sap.ui.model.type.Date",formatOptions:{source:{pattern:"yyyy-MM-dd"},pattern:"yyyy-MM-dd"}},displayFormat:"long",editable:!t.ui?.readOnly,required:t.required,change:t=>{const e=t.getParameter("value");const a=this.validate();if(this.onChange){this.onChange(a.isValid,this.fieldKey)}}});return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var n={__esModule:true};n.DatePlugin=s;return n});
39
39
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin", ["./BasePlugin","sap/m/DateTimePicker","sap/m/Text"],function(t,e,i){"use strict";const a=t["BasePlugin"];class s extends a{render(t,a,s="meta",n,r){this.onChange=r;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,a),text:{path:`${s}>${a}`,type:"sap.ui.model.type.DateTime",formatOptions:{source:{pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"},pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"}}});this.applyCommonDirectives(this.control,t,s);return this.control}this.control=new e({id:this.generateStableId(n,a),value:{path:`${s}>${a}`,type:"sap.ui.model.type.DateTime",formatOptions:{source:{pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"},pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"}},editable:!t.ui?.readOnly,required:t.required,change:t=>{const e=t.getParameter("value");const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,s);return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var n={__esModule:true};n.DateTimePlugin=s;return n});
40
40
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin", ["./BasePlugin","sap/m/Select","sap/ui/core/Item","sap/m/Text"],function(e,t,n,i){"use strict";const a=e["BasePlugin"];class s extends a{render(e,a,s="meta",r,l){this.onChange=l;this.metadata=e;if(!this.isEditable){const t=e.valueHelp&&Array.isArray(e.valueHelp)?e.valueHelp:e.enum?e.enum.map(e=>({key:String(e),text:String(e)})):[];this.control=new i({id:this.generateStableId(r,a),text:{path:`${s}>${a}`,formatter:e=>{const n=t.find(t=>t.key===e);return n?n.text:e}}});this.applyCommonDirectives(this.control,e,s);return this.control}const o=new t({id:this.generateStableId(r,a),selectedKey:`{${s}>${a}}`,enabled:!e.ui?.readOnly,forceSelection:false,change:e=>{const t=e.getParameter("selectedItem");const n=t?t.getKey():"";const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});const c=e.valueHelp&&Array.isArray(e.valueHelp)?e.valueHelp:e.enum?e.enum.map(e=>({key:String(e),text:String(e)})):[];if(c.length>0){o.addItem(new n({key:"",text:"--- Select ---"}));c.forEach(e=>{o.addItem(new n({key:e.key,text:e.text}))})}this.control=o;this.applyCommonDirectives(this.control,e,s);return this.control}getValue(){return this.control?this.control.getSelectedKey():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const e=this.control;e.setEnabled(!this.metadata.ui?.readOnly)}}}var r={__esModule:true};r.DropdownPlugin=s;return r});
@@ -43,14 +43,14 @@ sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin"
43
43
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin", ["./BasePlugin","sap/m/MessageStrip"],function(e,t){"use strict";const s=e["BasePlugin"];class n extends s{render(e,s,n="meta",a,r){this.onChange=r;this.metadata=e;this.control=new t({id:this.generateStableId(a,s),text:`{${n}>${s}}`,type:"Information",showIcon:true,showCloseButton:false});return this.control}getValue(){return null}applyState(){}}var a={__esModule:true};a.MessageStripPlugin=n;return a});
44
44
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin", ["./BasePlugin","sap/m/MultiComboBox","sap/ui/core/Item","sap/m/Text"],function(t,e,i,s){"use strict";const n=t["BasePlugin"];class a extends n{render(t,n,a="meta",o,l){this.onChange=l;this.metadata=t;if(!this.isEditable){this.control=new s({id:this.generateStableId(o,n),text:{path:`${a}>${n}`,formatter:t=>Array.isArray(t)?t.join(", "):""}});this.applyCommonDirectives(this.control,t,a);return this.control}const r=new e({id:this.generateStableId(o,n),selectedKeys:`{${a}>${n}}`,enabled:!t.ui?.readOnly,placeholder:t.ui?.label||"Select items...",selectionChange:t=>{const e=this.control.getSelectedKeys();const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});if(t.enum){t.enum.forEach(t=>{r.addItem(new i({key:t.toString(),text:t.toString()}))})}this.control=r;this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){return this.control?this.control.getSelectedKeys():[]}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var o={__esModule:true};o.MultiSelectPlugin=a;return o});
45
45
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin", ["./BasePlugin","sap/m/StepInput","sap/m/Text"],function(t,e,i){"use strict";const a=t["BasePlugin"];class s extends a{render(t,a,s="meta",n,r){this.onChange=r;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,a),text:`{${s}>${a}}`});this.applyCommonDirectives(this.control,t,s);return this.control}this.control=new e({id:this.generateStableId(n,a),value:`{${s}>${a}}`,displayValuePrecision:t.scale||0,editable:!t.ui?.readOnly,required:t.required,change:t=>{const e=t.getParameter("value");const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,s);return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var n={__esModule:true};n.NumberPlugin=s;return n});
46
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin", ["./BasePlugin","sap/m/Button"],function(t,e){"use strict";const i=t["BasePlugin"];class s extends i{render(t,i,s="meta",a,n){this.onChange=n;this.metadata=t;const o=i.startsWith("/")?i.substring(1):i;const r={type:"object",title:t.ui?.label||o,properties:t.properties||{}};if(t.uiLayout){r.uiLayout=t.uiLayout}this.control=new e({id:this.generateStableId(a,i),text:!this.isEditable?"View Details":"Edit Details",icon:!this.isEditable?"sap-icon://display":"sap-icon://form",press:e=>{const a=e.getSource();const n=a.getModel(s);if(!n)return;const l=a.getBindingContext(s);let u=i;if(l&&!i.startsWith("/")){const t=l.getPath();u=t.endsWith("/")?t+i:t==="/"?"/"+i:t+"/"+i}const c=JSON.parse(JSON.stringify(n.getProperty(u)||{}));sap.ui.require(["nz/co/siliconst/ui5/metaui/controls/DynamicHost"],e=>{const i=new e({schemaDefinition:r,data:c,editable:this.isEditable});if(!!this.isEditable){i.attachSubmit(t=>{const e=t.getParameter("payload");n.setProperty(u,e)})}const s=t.ui?.dialogButtonText||(!this.isEditable?"Close":"OK");i.openInDialog(`Nested Details: ${t.ui?.label||o}`,s)})}});return this.control}validate(){return{isValid:true}}getValue(){return null}applyState(){}}var a={__esModule:true};a.ObjectPlugin=s;return a});
46
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin", ["./BasePlugin","sap/m/Button"],function(t,e){"use strict";const i=t["BasePlugin"];class s extends i{render(t,i,s="meta",a,n){this.onChange=n;this.metadata=t;const o=i.startsWith("/")?i.substring(1):i;const r={type:"object",title:t.ui?.label||o,properties:t.properties||{}};if(t.uiLayout){r.uiLayout=t.uiLayout}this.control=new e({id:this.generateStableId(a,i),text:!this.isEditable?"View Details":"Edit Details",icon:!this.isEditable?"sap-icon://display":"sap-icon://form",press:e=>{const a=e.getSource();const n=a.getModel(s);if(!n)return;const l=a.getBindingContext(s);let u=i;if(l&&!i.startsWith("/")){const t=l.getPath();u=t.endsWith("/")?t+i:t==="/"?"/"+i:t+"/"+i}const c=JSON.parse(JSON.stringify(n.getProperty(u)||{}));sap.ui.require(["nz/co/siliconst/ui5/metaui/controls/DynamicHost"],e=>{const i=new e({schemaDefinition:r,data:c,editable:this.isEditable});if(!!this.isEditable){i.attachSubmit(t=>{const e=t.getParameter("payload");n.setProperty(u,e);if(this.onChange){this.onChange(true,o)}})}const s=t.ui?.dialogButtonText||(!this.isEditable?"Close":"OK");i.openInDialog(`Nested Details: ${t.ui?.label||o}`,s)})}});return this.control}validate(){return{isValid:true}}getValue(){return null}applyState(){}}var a={__esModule:true};a.ObjectPlugin=s;return a});
47
47
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin", ["./BasePlugin","sap/m/RatingIndicator","sap/m/Text"],function(t,e,i){"use strict";const a=t["BasePlugin"];class n extends a{render(t,a,n="meta",s,r){this.onChange=r;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(s,a),text:`{${n}>${a}}`});this.applyCommonDirectives(this.control,t,n);return this.control}this.control=new e({id:this.generateStableId(s,a),value:`{${n}>${a}}`,enabled:!t.ui?.readOnly,maxValue:t.maximum!==undefined?t.maximum:5,change:t=>{const e=t.getParameter("value");const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,n);return this.control}getValue(){return this.control?this.control.getValue():0}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var s={__esModule:true};s.RatingIndicatorPlugin=n;return s});
48
48
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin", ["../controls/BasePlugin","../../controls/RichTextControl","sap/m/FormattedText"],function(t,e,i){"use strict";function n(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const a=t["BasePlugin"];const o=n(e);function s(t){return t!==null&&typeof t.getValue==="function"}class r extends a{render(t,e,n="meta",a,r){this.onChange=r;this.metadata=t;this.fieldKey=e.replace("/","");this.modelName=n;if(!this.isEditable){this.control=new i({id:this.generateStableId(a,e),htmlText:`{${n}>${e}}`});this.applyCommonDirectives(this.control,t,n);return this.control}this.control=new o({id:this.generateStableId(a,e),value:`{${n}>${e}}`,schemaMetadata:t,readOnly:!!t.ui?.readOnly});this.applyCommonDirectives(this.control,t,n);if(s(this.control)&&this.control.attachCapture){this.control.attachCapture(()=>{const t=this.validate();if(this.onChange){this.onChange(t.isValid,this.fieldKey)}})}return this.control}getValue(){if(s(this.control)){return this.control.getValue()}return null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setProperty("readOnly",!!this.metadata.ui?.readOnly)}}}var l={__esModule:true};l.RichTextPlugin=r;return l});
49
49
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin", ["../controls/BasePlugin","../../controls/SignatureControl","sap/m/Image"],function(t,e,i){"use strict";function a(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const n=t["BasePlugin"];const s=a(e);class l extends n{render(t,e,a="meta",n,l){this.onChange=l;this.metadata=t;this.fieldKey=e.replace("/","");this.modelName=a;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,e),src:`{${a}>${e}}`,width:"400px",alt:t.ui?.label||"Signature"});this.applyCommonDirectives(this.control,t,a);return this.control}this.control=new s({id:this.generateStableId(n,e),value:`{${a}>${e}}`,schemaMetadata:t,readOnly:!!t.ui?.readOnly});this.applyCommonDirectives(this.control,t,a);this.control.attachCapture(()=>{const t=this.validate();if(this.onChange){this.onChange(t.isValid,this.fieldKey)}});return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setProperty("readOnly",!!this.metadata.ui?.readOnly)}}}var r={__esModule:true};r.SignaturePlugin=l;return r});
50
50
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin", ["./BasePlugin","sap/m/Slider","sap/m/Text"],function(t,e,i){"use strict";const n=t["BasePlugin"];class a extends n{render(t,n,a="meta",s,l){this.onChange=l;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(s,n),text:`{${a}>${n}}`});this.applyCommonDirectives(this.control,t,a);return this.control}this.control=new e({id:this.generateStableId(s,n),value:`{${a}>${n}}`,enabled:!t.ui?.readOnly,min:t.minimum!==undefined?t.minimum:0,max:t.maximum!==undefined?t.maximum:100,step:t.multipleOf!==undefined?t.multipleOf:1,enableTickmarks:true,change:t=>{const e=t.getParameter("value");const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){return this.control?this.control.getValue():0}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var s={__esModule:true};s.SliderPlugin=a;return s});
51
51
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin", ["./BasePlugin","sap/m/Input","sap/m/Text"],function(t,e,i){"use strict";const a=t["BasePlugin"];class s extends a{render(t,a,s="meta",n,r){this.onChange=r;this.metadata=t;this.fieldKey=a.replace("/","");if(!this.isEditable){this.control=new i({id:this.generateStableId(n,a),text:`{${s}>${a}}`});this.applyCommonDirectives(this.control,t,s);return this.control}this.control=new e({id:this.generateStableId(n,a),value:`{${s}>${a}}`,maxLength:t.maxLength||0,required:!!t.required,showValueHelp:t.ui?.widget==="searchHelp",change:t=>{const e=t.getParameter("value");const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,s);return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable){return}const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var n={__esModule:true};n.StringPlugin=s;return n});
52
52
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin", ["./BasePlugin","sap/m/Switch","sap/m/Text"],function(t,e,i){"use strict";const s=t["BasePlugin"];class a extends s{render(t,s,a="meta",n,o){this.onChange=o;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,s),text:{path:`${a}>${s}`,formatter:t=>t?"Yes":"No"}});this.applyCommonDirectives(this.control,t,a);return this.control}this.control=new e({id:this.generateStableId(n,s),state:`{${a}>${s}}`,enabled:!t.ui?.readOnly,change:t=>{const e=t.getParameter("state");const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){return this.control?this.control.getState():false}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEnabled(!this.metadata.ui?.readOnly)}}}var n={__esModule:true};n.SwitchPlugin=a;return n});
53
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin", ["./BasePlugin","sap/m/TextArea","sap/m/Text"],function(t,e,i){"use strict";const a=t["BasePlugin"];class s extends a{render(t,a,s="meta",n,r){this.onChange=r;this.metadata=t;this.fieldKey=a.replace("/","");if(!this.isEditable){this.control=new i({id:this.generateStableId(n,a),text:`{${s}>${a}}`});this.applyCommonDirectives(this.control,t,s);return this.control}this.control=new e({id:this.generateStableId(n,a),value:`{${s}>${a}}`,maxLength:t.maxLength||0,required:!!t.required,rows:t.ui?.rows||4,change:t=>{const e=t.getParameter("value");const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,s);return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var n={__esModule:true};n.TextAreaPlugin=s;return n});
53
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin", ["./BasePlugin","sap/m/TextArea","sap/m/Text"],function(t,e,i){"use strict";const a=t["BasePlugin"];class n extends a{render(t,a,n="meta",s,h){this.onChange=h;this.metadata=t;this.fieldKey=a.replace("/","");if(!this.isEditable){this.control=new i({id:this.generateStableId(s,a),text:`{${n}>${a}}`});this.applyCommonDirectives(this.control,t,n);return this.control}this.control=new e({id:this.generateStableId(s,a),value:`{${n}>${a}}`,maxLength:t.maxLength||0,required:!!t.required,rows:3,growing:false,change:t=>{this.updateHeight(t.getSource());const e=this.validate();if(this.onChange){this.onChange(e.isValid,this.fieldKey)}},liveChange:t=>{this.updateHeight(t.getSource())}});this.control.attachEventOnce("modelContextChange",()=>{const t=this.control.getBinding("value");const e=()=>{if(this.control){this.updateHeight(this.control)}};if(t){t.attachChange(e)}e()});this.applyCommonDirectives(this.control,t,n);return this.control}updateHeight(t){const e=t.getValue()||"";const i=e.split(/\r\n|\r|\n/).length;const a=Math.ceil(e.length/80);const n=Math.max(i,a);t.setRows(Math.max(3,n+2))}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var s={__esModule:true};s.TextAreaPlugin=n;return s});
54
54
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin", ["./BasePlugin","sap/m/TimePicker","sap/m/Text"],function(t,e,i){"use strict";const s=t["BasePlugin"];class a extends s{render(t,s,a="meta",r,n){this.onChange=n;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(r,s),text:{path:`${a}>${s}`,type:"sap.ui.model.type.Time",formatOptions:{source:{pattern:"HH:mm:ss"},pattern:"HH:mm:ss"}}});this.applyCommonDirectives(this.control,t,a);return this.control}this.control=new e({id:this.generateStableId(r,s),value:{path:`${a}>${s}`,type:"sap.ui.model.type.Time",formatOptions:{source:{pattern:"HH:mm:ss"},pattern:"HH:mm:ss"}},displayFormat:"HH:mm:ss",editable:!t.ui?.readOnly,required:t.required,change:t=>{const e=t.getParameter("value");const i=this.validate();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var r={__esModule:true};r.TimePlugin=a;return r});
55
55
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin", ["../controls/BasePlugin","../../controls/VoiceInputControl","sap/m/Text"],function(t,e,i){"use strict";function n(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const a=t["BasePlugin"];const s=n(e);class r extends a{render(t,e,n="meta",a,r){this.onChange=r;this.metadata=t;this.fieldKey=e.replace("/","");this.modelName=n;if(!this.isEditable){this.control=new i({id:this.generateStableId(a,e),text:{path:`${n}>${e}`,formatter:t=>{if(!t||t==="undefined"||t==="null")return"";return t}}});this.applyCommonDirectives(this.control,t,n);return this.control}this.control=new s({id:this.generateStableId(a,e),value:`{${n}>${e}}`,schemaMetadata:t,readOnly:!!t.ui?.readOnly});this.applyCommonDirectives(this.control,t,n);this.control.attachCapture(()=>{const t=this.validate();if(this.onChange){this.onChange(t.isValid,this.fieldKey)}});return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setProperty("readOnly",!!this.metadata.ui?.readOnly)}}}var o={__esModule:true};o.VoiceInputPlugin=r;return o});
56
56
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin", ["../controls/BasePlugin","sap/m/Input","sap/ui/core/Item","../../utils/Logger"],function(e,t,s,a){"use strict";const r=e["BasePlugin"];const n=a["Logger"];class o extends r{render(e,s,a="meta"){this.metadata=e;const r=new t({value:`{${a}>${s}}`,enabled:!e.ui?.readOnly,placeholder:"Type to search...",showSuggestion:true,suggest:e=>{const t=e.getParameter("suggestValue");this.fetchSuggestions(r,t)},change:e=>{this.validate()}});this.control=r;return this.control}fetchSuggestions(e,t){const a=this.metadata?.valueHelp;if(!a||!a.url){n.error("LiveSearchPlugin requires a valid valueHelp configuration with a URL.","","LiveSearchPlugin");return}if(!t){e.removeAllSuggestionItems();return}e.setBusy(true);fetch(a.url).then(e=>e.json()).then(r=>{const n=a.keyPath||"key";const o=a.textPath||"text";e.removeAllSuggestionItems();const l=t.toLowerCase();const i=r.filter(e=>{const t=String(e[o]||e[n]).toLowerCase();return t.includes(l)});i.forEach(t=>{e.addSuggestionItem(new s({key:t[n],text:t[o]||t[n]}))})}).catch(e=>{n.error("Failed to load value help from "+a.url,e.message,"LiveSearchPlugin")}).finally(()=>{e.setBusy(false)})}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var l={__esModule:true};l.LiveSearchPlugin=o;return l});