@siliconst/metaui 1.4.13 → 1.4.14

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 (92) hide show
  1. package/package.json +1 -1
  2. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +50 -3
  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 +1 -1
  5. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
  6. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
  7. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
  8. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +57 -4
  9. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +44 -2
  10. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js.map +1 -1
  11. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts +4 -0
  12. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts.map +1 -1
  13. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
  14. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
  15. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +51 -4
  16. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js +16 -1
  17. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js.map +1 -1
  18. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts +6 -0
  19. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts.map +1 -1
  20. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js +1 -1
  21. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js.map +1 -1
  22. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.ts +16 -1
  23. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js.map +1 -1
  24. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js.map +1 -1
  25. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts +2 -2
  26. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry-dbg.js +47 -0
  27. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry-dbg.js.map +1 -0
  28. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.d.ts +23 -0
  29. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.d.ts.map +1 -0
  30. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.js +2 -0
  31. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.js.map +1 -0
  32. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.ts +45 -0
  33. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +17 -0
  34. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -1
  35. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +10 -1
  36. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -1
  37. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +1 -1
  38. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -1
  39. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts +19 -1
  40. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
  41. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +7 -0
  42. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
  43. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +9 -0
  44. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin-dbg.js +2 -0
  45. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin-dbg.js.map +1 -0
  46. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.d.ts +23 -0
  47. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.d.ts.map +1 -0
  48. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.js +2 -0
  49. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.js.map +1 -0
  50. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.ts +23 -0
  51. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +6 -1
  52. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -1
  53. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -1
  54. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +1 -1
  55. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -1
  56. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +6 -1
  57. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +14 -6
  58. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  59. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js +29 -17
  60. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js.map +1 -1
  61. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts.map +1 -1
  62. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js +1 -1
  63. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js.map +1 -1
  64. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.ts +32 -15
  65. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder-dbg.js +226 -0
  66. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder-dbg.js.map +1 -0
  67. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.d.ts +63 -0
  68. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.d.ts.map +1 -0
  69. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.js +2 -0
  70. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.js.map +1 -0
  71. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.ts +233 -0
  72. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver-dbg.js +43 -0
  73. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver-dbg.js.map +1 -0
  74. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.d.ts +15 -0
  75. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.d.ts.map +1 -0
  76. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.js +2 -0
  77. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.js.map +1 -0
  78. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.ts +37 -0
  79. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper-dbg.js +37 -0
  80. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper-dbg.js.map +1 -0
  81. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.d.ts +18 -0
  82. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.d.ts.map +1 -0
  83. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.js +2 -0
  84. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.js.map +1 -0
  85. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.ts +28 -0
  86. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper-dbg.js +84 -0
  87. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper-dbg.js.map +1 -0
  88. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.d.ts +27 -0
  89. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.d.ts.map +1 -0
  90. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.js +2 -0
  91. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.js.map +1 -0
  92. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.ts +80 -0
@@ -2,14 +2,14 @@
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.odataDelegate=null;this._innerHost=null;this._initializedInner=false},renderer:{apiVersion:2,render(t,e){t.openStart("div",e);t.style("width","100%");t.style("height","100%");t.openEnd();const 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"}}},error:{parameters:{message:{type:"string"},exception:{type:"object"}}}}},initODataDelegate:function t(){if(!this.odataDelegate){if(this.getBindingInfo("dataJson")){return}const t=this.getBindingInfo("data");if(t&&t.path&&t.path!==""){return}const e=this.getBindingContext("odata")||this.getBindingContext();if(e){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");let a=!!e;if(a&&typeof e==="object"&&Object.keys(e).length===0){a=false}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){const n=this.getProperty("liveUpdate")===true;if(e==="submit"||n){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,a,o){if(!this._innerHost){this.onBeforeRendering()}this._innerHost?.openInDialog(e,n,i,a,o)},triggerSubmit:function t(){if(!this._innerHost){return false}return this._innerHost.triggerSubmit()},addCustomError:function t(e,n){if(this._innerHost&&typeof this._innerHost.addCustomError==="function"){this._innerHost.addCustomError(e,n)}},clearCustomError:function t(e){if(this._innerHost&&typeof this._innerHost.clearCustomError==="function"){this._innerHost.clearCustomError(e)}},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","../core/SchemaBuilderRegistry"],function(t,e,i,n,a){"use strict";function o(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const s=o(e);const r=i["Logger"];const l=n["ODataDelegate"];const d=a["SchemaBuilderRegistry"];const c=t.extend("nz.co.siliconst.ui5.metaui.controls.DynamicHost",{constructor:function e(){t.prototype.constructor.apply(this,arguments);this.odataDelegate=null;this._innerHost=null;this._initializedInner=false},renderer:{apiVersion:2,render(t,e){t.openStart("div",e);t.style("width","100%");t.style("height","100%");t.openEnd();const i=e.getAggregation("_content");if(i){t.renderControl(i)}t.close("div")}},metadata:{properties:{schemaDefinition:{type:"any",defaultValue:null},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"}}},error:{parameters:{message:{type:"string"},exception:{type:"object"}}}}},initODataDelegate:function t(){if(!this.odataDelegate){if(this.getBindingInfo("dataJson")){return}const t=this.getBindingInfo("data");if(t&&t.path&&t.path!==""){return}const e=this.getBindingContext("odata")||this.getBindingContext();if(e){r.debug("[MetaUI DynamicHost]",`Context found for delegate initialization: ${e.getPath()}`,"DynamicHost");if(e&&e.requestObject&&typeof e.requestObject==="function"){r.debug("[MetaUI DynamicHost]",`Context supports requestObject/getObject. Instantiating ODataDelegate.`,"DynamicHost");this.odataDelegate=new l(this,e);this.odataDelegate.syncToEngine()}else{r.debug("[MetaUI DynamicHost]",`Context does NOT support requestObject/getObject! Keys: ${Object.keys(e)}`,"DynamicHost")}}}},setBindingContext:function e(i,n){t.prototype.setBindingContext.call(this,i,n);this.initODataDelegate();return this},bindElement:function e(i,n){t.prototype.bindElement.call(this,i,n);const a=typeof i==="object"?i.model:undefined;const o=this.getElementBinding(a);if(o){o.attachChange(()=>{this.initODataDelegate()})}return this},onBeforeRendering:function e(){r.debug("[MetaUI DynamicHost]",`onBeforeRendering called. _initializedInner: ${this._initializedInner}`,"DynamicHost");this.initODataDelegate();if(!this._initializedInner){let e=this.getProperty("schemaDefinition");if(typeof e==="string"&&(e.startsWith("http://")||e.startsWith("https://"))){if(this._fetchingSchema)return;this._fetchingSchema=true;sap.ui.require(["sap/ui/core/BusyIndicator","sap/m/MessageToast"],(i,n)=>{i.show(0);fetch(e).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.json()}).then(e=>{const n=d.getBuilderFor(e);const a=n?n.build(e):e;t.prototype.setProperty.call(this,"schemaDefinition",a,true);this._fetchingSchema=false;i.hide();this.invalidate()}).catch(e=>{r.warn("[MetaUI DynamicHost]","Failed to fetch remote schema: "+e,"DynamicHost");if(n)n.show("Failed to fetch remote schema");t.prototype.setProperty.call(this,"schemaDefinition",null,true);this._fetchingSchema=false;i.hide();this.invalidate()})});return}let i=e;if(i&&typeof i==="string"&&i.trim().startsWith("{")){try{i=JSON.parse(i)}catch(t){}}if(i&&typeof i==="object"){const e=d.getBuilderFor(i);if(e){i=e.build(i);t.prototype.setProperty.call(this,"schemaDefinition",i,true)}}const n=this.getProperty("dataJson");const a=this.getProperty("data");let o=!!i;if(o&&typeof i==="object"&&Object.keys(i).length===0){o=false}const l=!!n||!!a;r.debug("[MetaUI DynamicHost]",`Evaluating boot. hasSchema: ${o}, hasData: ${l}`,"DynamicHost");if(o||l){if(this.getProperty("debugMode")){r.debug("[MetaUI DynamicHost]",`Booting inner host. hasSchema: ${o}, hasData: ${l}`,"DynamicHost")}this._innerHost=new s;const e=this.getMetadata().getProperties();for(const i in e){const e=t.prototype.getProperty.call(this,i);if(e!==null&&e!==undefined){this._innerHost.setProperty(i,e)}}this.setAggregation("_content",this._innerHost);const i=this.getMetadata().getEvents();for(const e in i){this._innerHost.attachEvent(e,i=>{if(e==="submit"||e==="fieldChange"){const n=i.getParameters();if(n.payload){const i=this.getProperty("liveUpdate")===true;if(e==="submit"||i){t.prototype.setProperty.call(this,"data",n.payload,true);const e=n.payloadJson||JSON.stringify(n.payload,null,2);t.prototype.setProperty.call(this,"dataJson",e,true)}}if(e==="fieldChange"&&this.odataDelegate){this.odataDelegate.handleFieldChange(n.fieldPath,n.value)}}this.fireEvent(e,i.getParameters())})}this._initializedInner=true}}},setProperty:function e(i,n,a){if(i==="data"||i==="dataJson"||i==="schemaDefinition"){if(this.getProperty("debugMode")){r.debug("[MetaUI DynamicHost]",`Wrapper received setProperty: ${i}`,"DynamicHost")}}t.prototype.setProperty.call(this,i,n,a);if(this._innerHost){this._innerHost.setProperty(i,n,a)}else if(i==="data"||i==="dataJson"||i==="schemaDefinition"){if(this.getProperty("debugMode")){r.debug("[MetaUI DynamicHost]",`_innerHost not yet initialized when ${i} was set. Booting will happen on next render.`,"DynamicHost")}}return this},openInDialog:function t(e,i,n,a,o){if(!this._innerHost){this.onBeforeRendering()}this._innerHost?.openInDialog(e,i,n,a,o)},triggerSubmit:function t(){if(!this._innerHost){return false}return this._innerHost.triggerSubmit()},addCustomError:function t(e,i){if(this._innerHost&&typeof this._innerHost.addCustomError==="function"){this._innerHost.addCustomError(e,i)}},clearCustomError:function t(e){if(this._innerHost&&typeof this._innerHost.clearCustomError==="function"){this._innerHost.clearCustomError(e)}},getProperty:function e(i){if(i==="outputData"){i="data"}if(this._innerHost&&(i==="data"||i==="dataJson")){return this._innerHost.getProperty(i)}return t.prototype.getProperty.call(this,i)}});return c});
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});
9
9
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/VoiceInputControl", ["./BaseHardwareControl","sap/m/Button","sap/m/VBox","sap/m/TextArea","sap/m/MessageToast","sap/m/HBox","../utils/Logger"],function(t,e,i,s,n,o,r){"use strict";function a(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const c=a(t);const h=r["Logger"];class l extends c{static renderer="nz.co.siliconst.ui5.metaui.controls.BaseHardwareControlRenderer";static metadata={properties:{},events:{}};recognition=null;isRecording=false;init(){super.init();this.textArea=new s({rows:3,width:"100%",placeholder:"Dictated text will appear here...",liveChange:t=>{this.setValueAndFire(t.getParameter("value"))}});this.startBtn=new e({icon:"sap-icon://microphone",text:"Start Dictation",type:"Emphasized",press:this.toggleDictation.bind(this)});const t=new o({items:[this.startBtn]}).addStyleClass("sapUiSmallMarginTop");this.vBox=new i({items:[this.textArea,t]});this.setAggregation("_content",this.vBox);this.initSpeechRecognition()}toggleDictation(){if(this.isRecording){this.stopDictation()}else{this.startDictation()}}initSpeechRecognition(){const t=window.SpeechRecognition||window.webkitSpeechRecognition;if(t){this.recognition=new t;this.recognition.continuous=true;this.recognition.interimResults=true;this.recognition.onresult=t=>{let e="";let i="";for(let s=t.resultIndex;s<t.results.length;++s){if(t.results[s].isFinal){e+=t.results[s][0].transcript}else{i+=t.results[s][0].transcript}}const s=this.getValue()||"";const n=s?s+" "+e:e;if(e){this.textArea.setValue(n);this.setValueAndFire(n)}else if(i){this.textArea.setValue(s?s+" "+i:i)}};this.recognition.onstart=()=>{this.isRecording=true;this.startBtn.setIcon("sap-icon://stop");this.startBtn.setText("Stop Recording");this.startBtn.setType("Reject");n.show("Listening... Please speak now.")};this.recognition.onerror=t=>{h.error("Speech recognition error",t.error,"VoiceInputControl");sap.ui.require(["sap/m/MessageBox"],e=>{e.error("Microphone Error: "+t.error+"\n\nPlease ensure you have a working microphone attached and have not blocked access in your browser settings.")});this.stopDictation()};this.recognition.onend=()=>{this.stopDictation()}}else{h.warn("Web Speech API not supported in this browser.","","VoiceInputControl");this.startBtn.setEnabled(false);this.startBtn.setTooltip("Speech Recognition is not supported in this browser.")}}startDictation(){if(!this.recognition)return;try{this.recognition.start();n.show("Requesting microphone access...");this.startBtn.setIcon("sap-icon://stop");this.startBtn.setText("Requesting mic...");this.startBtn.setType("Reject")}catch(t){const e=t;h.error("Failed to start speech recognition",e.message||String(e),"VoiceInputControl");sap.ui.require(["sap/m/MessageBox"],t=>{t.error("Failed to start dictation. Please ensure you have a working microphone and have granted browser permissions.\n\nDetails: "+(e.message||String(e)))});this.stopDictation()}}stopDictation(){if(!this.recognition)return;try{this.recognition.stop()}catch(t){h.warn("Failed to gracefully stop speech recognition.",String(t),"VoiceInputControl")}this.isRecording=false;this.startBtn.setIcon("sap-icon://microphone");this.startBtn.setText("Start Dictation");this.startBtn.setType("Emphasized")}onBeforeRendering(){const t=this.getProperty("readOnly");this.textArea.setEditable(!t);this.startBtn.setEnabled(!t&&!!this.recognition);const e=this.getProperty("value");if(e!==undefined&&e!==null){if(!this.isRecording){this.textArea.setValue(e)}}}exit(){this.stopDictation();if(this.recognition){this.recognition.onstart=null;this.recognition.onresult=null;this.recognition.onerror=null;this.recognition.onend=null;this.recognition=null}super.exit()}}return l});
10
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost", ["sap/ui/core/Control","../../utils/Logger","../../core/SchemaNormalizer","../../core/SchemaValidator","../../core/Engine","../../core/StateManager","./delegates/DataSyncDelegate","./delegates/ValidationDelegate","./delegates/DialogDelegate","sap/m/MessageBox","sap/m/MessageStrip","sap/m/VBox","../../core/PluginRegistry"],function(e,t,a,n,i,s,r,o,l,g,d,h,u){"use strict";const c=t["Logger"];const p=a["SchemaNormalizer"];const f=n["SchemaValidator"];const y=i["Engine"];const m=s["StateManager"];const M=r["DataSyncDelegate"];const b=o["ValidationDelegate"];const P=l["DialogDelegate"];const v=u["PluginRegistry"];const D=e.extend("nz.co.siliconst.ui5.metaui.controls.host.GeneratorHost",{renderer:{apiVersion:2,render(e,t){e.openStart("div",t);e.style("width","100%");e.style("height","100%");e.openEnd();const a=t.getAggregation("_content");if(a){e.renderControl(a)}e.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"}}},error:{parameters:{message:{type:"string"},exception:{type:"object"}}}}},constructor:function t(a,n){e.prototype.constructor.call(this,a,n);this.stateManager=null;this.generatedContent=null;this.engine=null;this.activeModelName="";this.parsedSchema=null;this._generatePromise=null},init:function t(){e.prototype.init.call(this);this.dataSyncDelegate=new M(this);this.validationDelegate=new b(this);this.dialogDelegate=new P(this);this.onInternalFieldChange=this.onInternalFieldChange.bind(this)},setDebugMode:function e(t){this.setProperty("debugMode",t,true);c.setDebugMode(t);return this},setProperty:function t(a,n,i){e.prototype.setProperty.call(this,a,n,i);if(a==="useMessageManager"&&this.stateManager){this.stateManager.setUseMessageManager(n===true)}return this},getStateManager:function e(){return this.stateManager},tearDownGeneratedLayout:function e(){if(this.generatedContent){this.validationDelegate.unregisterObject(this.generatedContent);this.generatedContent.destroy();this.generatedContent=null}},onInternalFieldChange:function e(t,a,n,i){const s=this.stateManager?this.stateManager.extractPayload():{};if(this.getProperty("liveUpdate")===true){if(this.getProperty("debugMode")){c.debug("[MetaUI]","liveUpdate is enabled, pushing outbound payload.","GeneratorHost")}this.dataSyncDelegate.pushToBindings(s)}const r=this.getProperty("isValid");if(t!==r){this.setProperty("isValid",t,true);this.fireEvent("validationStateChanged",{isValid:t});if(this.getProperty("debugMode")){c.debug("[MetaUI]",`Validation state shifted to: ${t}`,"GeneratorHost")}}this.fireEvent("fieldChange",{fieldPath:a||"",value:undefined,payload:s,isValid:t})},exit:function e(){if(this.engine){this.engine.destroy();this.engine=null}if(this.stateManager){this.stateManager.getModel().destroy();this.stateManager=null}if(this.generatedContent){this.generatedContent.destroy();this.generatedContent=null}},getParsedSchema:function e(){return this.parsedSchema},onBeforeRendering:function e(){if(this.getProperty("debugMode")){c.debug("[MetaUI GeneratorHost]",`onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty("schemaDefinition")}, data exists = ${!!this.getProperty("data")}, dataJson exists = ${!!this.getProperty("dataJson")}`,"GeneratorHost")}if(!this.generatedContent){const e=!!this.getProperty("schemaDefinition");const t=!!this.getProperty("dataJson")||!!this.getProperty("data");if(e||t){this.generate()}else{const e="GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.";c.error("[MetaUI]",e,"GeneratorHost");this.fireEvent("error",{message:e});throw new Error(e)}}},triggerSubmit:function e(){if(this.stateManager&&this.engine){let e=false;this.validationDelegate.removeAllMessages();const t=this.getProperty("useMessageManager")!==true;const a=this.engine.validateAll(t);if(a.length>0){this.validationDelegate.pushMessage("","One or more fields failed schema validation. Please review the highlighted fields.");for(const e of a){if(e.fieldKey&&e.errorMessage){this.validationDelegate.pushMessage(e.fieldKey,e.errorMessage)}}return false}const n=this.stateManager.extractPayload();const i=JSON.stringify(n);this.fireEvent("beforeSubmit",{payload:n,preventDefault:()=>{e=true},addError:(a,n)=>{e=true;this.validationDelegate.pushMessage(a,n);if(t&&this.engine){const e=this.engine.getPluginByPath(a);if(e&&typeof e.setVisualValidationState==="function"){e.setVisualValidationState(false,n)}}}});if(e){return false}this.dataSyncDelegate.pushToBindings(n);this.fireEvent("submit",{payload:n,payloadJson:i});return true}return false},addCustomError:function e(t,a){this.validationDelegate.addCustomError(t,a);if(this.getProperty("useMessageManager")!==true&&this.engine){const e=this.engine.getPluginByPath(t);if(e&&typeof e.setVisualValidationState==="function"){e.setVisualValidationState(false,a)}}},clearCustomError:function e(t){this.validationDelegate.clearCustomError(t);if(this.getProperty("useMessageManager")!==true&&this.engine){const e=this.engine.getPluginByPath(t);if(e&&typeof e.setVisualValidationState==="function"){const t=e.validate();e.setVisualValidationState(t.isValid,t.errorMessage)}}},setBusy:function t(a){e.prototype.setBusy.call(this,a);return this},setProperty:function t(a,n,i){if(a==="dataJson"||a==="data"){this.dataSyncDelegate.handleInputDataHotSwap(a,n,i);return this}if(a==="editable"||a==="debugMode"||a==="schemaDefinition"){const t=this.getProperty(a);if(t!==n){e.prototype.setProperty.call(this,a,n,i);this.tearDownGeneratedLayout()}return this}return e.prototype.setProperty.call(this,a,n,i)},setBaseProperty:function t(a,n,i){return e.prototype.setProperty.call(this,a,n,i)},generate:async function e(){if(this._generatePromise){return this._generatePromise}this._generatePromise=Promise.resolve().then(async()=>{try{await this._doGenerate()}catch(e){c.error("[MetaUI]","Error in deferred generate: "+e,"GeneratorHost");throw e}finally{this._generatePromise=null}});return this._generatePromise},_doGenerate:async function e(){try{this.tearDownGeneratedLayout();let e=null;if(this.stateManager){e=this.stateManager.extractPayload()}if(this.engine){this.engine.destroy();this.engine=null}if(this.stateManager){this.stateManager.getModel().destroy();this.stateManager=null}const t=this.getProperty("schemaDefinition");const a=!t||typeof t==="object"&&Object.keys(t).length===0;let n=this.getProperty("data");const i=this.getProperty("dataJson");if(i){try{n=JSON.parse(i)}catch(e){const t="Failed to parse inputDataJson string: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});throw new Error(t)}}else if(typeof n==="string"){try{n=JSON.parse(n)}catch(e){const t="Failed to parse inputData string: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});throw new Error(t)}}const s=e||n;if(!s||Object.keys(s).length===0){if(a){const e="No payload provided and no explicit schema defined. Cannot infer UI.";c.error("[MetaUI]",e,"GeneratorHost");this.fireEvent("error",{message:e});throw new Error(e)}}const r=a?null:t;const o=p.normalize(r,s);this.parsedSchema=o;if(o){const e=f.validateSchemaStructure(o);if(e.length>0){const t="Schema Structural Errors Found:\n- "+e.join("\n- ");c.error("[MetaUI]",t,"GeneratorHost");if(this.getProperty("debugMode")){g.error(t,{title:"MetaUI Schema Error"});return}}}const l=v.getInstance().getPathsToLoad(o);const u=Array.from(l).some(e=>!sap.ui.require(e));if(u){this.setBusy(true);await v.getInstance().preloadDependencies(o);this.setBusy(false)}this.activeModelName="metaUI_"+this.getId();this.stateManager=new m(s,o,this.activeModelName);this.stateManager.setUseMessageManager(this.getProperty("useMessageManager")===true);this.setModel(this.stateManager.getModel(),this.activeModelName);if(!this.engine){const e=this.getProperty("editable")!==false;const t=this.getProperty("useMessageManager")===true;this.engine=new y(e,t)}this.generatedContent=this.engine.build(o,this.stateManager.getModel(),this.activeModelName,this.triggerSubmit.bind(this),this.getId(),this.onInternalFieldChange.bind(this));let M=this.generatedContent;const b=o&&Object.keys(o).length>0;if(!b){const e=new d({text:"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.",type:"Warning",showIcon:true,showCloseButton:false});e.addStyleClass("sapUiSmallMarginBottom");M=new h({items:[e,this.generatedContent]})}else if(this.engine.hasPartialRenderingErrors){const e=new d({text:"Layout partially rendered. Some fields failed to generate due to configuration errors.",type:"Warning",showIcon:true,showCloseButton:true});e.addStyleClass("sapUiSmallMarginBottom");M=new h({items:[e,this.generatedContent]})}this.setAggregation("_content",M);this.validationDelegate.registerObject(this.generatedContent);const P=this.stateManager.extractPayload();this.dataSyncDelegate.pushToBindings(P)}catch(e){this.setBusy(false);const t="Fatal crash during layout generation: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});this.validationDelegate.mountCrashBoundary(e);throw e}},openInDialog:function e(t="Form",a="OK",n="Cancel",i="800px",s){const r=!!this.generatedContent;this.dialogDelegate.openInDialog(t,a,r,n,i,s)}});return D});
10
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost", ["sap/ui/core/Control","../../utils/Logger","../../core/SchemaNormalizer","../../core/SchemaValidator","../../core/Engine","../../core/StateManager","./delegates/DataSyncDelegate","./delegates/ValidationDelegate","./delegates/DialogDelegate","sap/m/MessageBox","sap/m/MessageStrip","sap/m/VBox","../../core/PluginRegistry"],function(e,t,a,i,n,s,r,o,l,g,d,h,u){"use strict";const c=t["Logger"];const p=a["SchemaNormalizer"];const f=i["SchemaValidator"];const y=n["Engine"];const m=s["StateManager"];const M=r["DataSyncDelegate"];const b=o["ValidationDelegate"];const P=l["DialogDelegate"];const D=u["PluginRegistry"];const v=e.extend("nz.co.siliconst.ui5.metaui.controls.host.GeneratorHost",{renderer:{apiVersion:2,render(e,t){e.openStart("div",t);e.style("width","100%");e.style("height","100%");e.openEnd();const a=t.getAggregation("_content");if(a){e.renderControl(a)}e.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"}}},error:{parameters:{message:{type:"string"},exception:{type:"object"}}}}},constructor:function t(a,i){e.prototype.constructor.call(this,a,i);this.stateManager=null;this.generatedContent=null;this.engine=null;this.activeModelName="";this.parsedSchema=null;this._generatePromise=null},init:function t(){e.prototype.init.call(this);this.dataSyncDelegate=new M(this);this.validationDelegate=new b(this);this.dialogDelegate=new P(this);this.onInternalFieldChange=this.onInternalFieldChange.bind(this)},setDebugMode:function e(t){this.setProperty("debugMode",t,true);c.setDebugMode(t);return this},setProperty:function t(a,i,n){e.prototype.setProperty.call(this,a,i,n);if(a==="useMessageManager"&&this.stateManager){this.stateManager.setUseMessageManager(i===true)}return this},getStateManager:function e(){return this.stateManager},tearDownGeneratedLayout:function e(){if(this.generatedContent){this.validationDelegate.unregisterObject(this.generatedContent);this.generatedContent.destroy();this.generatedContent=null}},onInternalFieldChange:function e(t,a,i,n){const s=this.stateManager?this.stateManager.extractPayload():{};if(this.getProperty("liveUpdate")===true){if(this.getProperty("debugMode")){c.debug("[MetaUI]","liveUpdate is enabled, pushing outbound payload.","GeneratorHost")}this.dataSyncDelegate.pushToBindings(s)}const r=this.getProperty("isValid");if(t!==r){this.setProperty("isValid",t,true);this.fireEvent("validationStateChanged",{isValid:t});if(this.getProperty("debugMode")){c.debug("[MetaUI]",`Validation state shifted to: ${t}`,"GeneratorHost")}}this.fireEvent("fieldChange",{fieldPath:a||"",value:undefined,payload:s,isValid:t})},exit:function e(){if(this.engine){this.engine.destroy();this.engine=null}if(this.stateManager){this.stateManager.getModel().destroy();this.stateManager=null}if(this.generatedContent){this.generatedContent.destroy();this.generatedContent=null}},getParsedSchema:function e(){return this.parsedSchema},onBeforeRendering:function e(){if(this.getProperty("debugMode")){c.debug("[MetaUI GeneratorHost]",`onBeforeRendering called. Engine boot state: schemaDefinition exists = ${!!this.getProperty("schemaDefinition")}, data exists = ${!!this.getProperty("data")}, dataJson exists = ${!!this.getProperty("dataJson")}`,"GeneratorHost")}if(!this.generatedContent){const e=!!this.getProperty("schemaDefinition");const t=!!this.getProperty("dataJson")||!!this.getProperty("data");if(e||t){this.generate()}else{const e="GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.";c.error("[MetaUI]",e,"GeneratorHost");this.fireEvent("error",{message:e});throw new Error(e)}}},triggerSubmit:function e(){if(this.stateManager&&this.engine){let e=false;this.validationDelegate.removeAllMessages();const t=this.getProperty("useMessageManager")!==true;const a=this.engine.validateAll(t);if(a.length>0){this.validationDelegate.pushMessage("","One or more fields failed schema validation. Please review the highlighted fields.");for(const e of a){if(e.fieldKey&&e.errorMessage){this.validationDelegate.pushMessage(e.fieldKey,e.errorMessage)}}return false}const i=this.stateManager.extractPayload();const n=JSON.stringify(i);this.fireEvent("beforeSubmit",{payload:i,preventDefault:()=>{e=true},addError:(a,i)=>{e=true;this.validationDelegate.pushMessage(a,i);if(t&&this.engine){const e=this.engine.getPluginByPath(a);if(e&&typeof e.setVisualValidationState==="function"){e.setVisualValidationState(false,i)}}}});if(e){return false}this.dataSyncDelegate.pushToBindings(i);this.fireEvent("submit",{payload:i,payloadJson:n});return true}return false},addCustomError:function e(t,a){this.validationDelegate.addCustomError(t,a);if(this.getProperty("useMessageManager")!==true&&this.engine){const e=this.engine.getPluginByPath(t);if(e&&typeof e.setVisualValidationState==="function"){e.setVisualValidationState(false,a)}}},clearCustomError:function e(t){this.validationDelegate.clearCustomError(t);if(this.getProperty("useMessageManager")!==true&&this.engine){const e=this.engine.getPluginByPath(t);if(e&&typeof e.setVisualValidationState==="function"){const t=e.validate();e.setVisualValidationState(t.isValid,t.errorMessage)}}},setBusy:function t(a){e.prototype.setBusy.call(this,a);return this},setProperty:function t(a,i,n){if(a==="dataJson"||a==="data"){this.dataSyncDelegate.handleInputDataHotSwap(a,i,n);return this}if(a==="editable"||a==="debugMode"||a==="schemaDefinition"){const t=this.getProperty(a);if(t!==i){e.prototype.setProperty.call(this,a,i,n);this.tearDownGeneratedLayout()}return this}return e.prototype.setProperty.call(this,a,i,n)},setBaseProperty:function t(a,i,n){return e.prototype.setProperty.call(this,a,i,n)},generate:async function e(){if(this._generatePromise){return this._generatePromise}this._generatePromise=Promise.resolve().then(async()=>{try{await this._doGenerate()}catch(e){c.error("[MetaUI]","Error in deferred generate: "+e,"GeneratorHost");throw e}finally{this._generatePromise=null}});return this._generatePromise},_doGenerate:async function e(){try{this.tearDownGeneratedLayout();let e=null;if(this.stateManager){e=this.stateManager.extractPayload()}if(this.engine){this.engine.destroy();this.engine=null}if(this.stateManager){this.stateManager.getModel().destroy();this.stateManager=null}const t=this.getProperty("schemaDefinition");const a=!t||typeof t==="object"&&Object.keys(t).length===0;let i=this.getProperty("data");const n=this.getProperty("dataJson");if(n){try{i=JSON.parse(n)}catch(e){const t="Failed to parse inputDataJson string: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});throw new Error(t)}}else if(typeof i==="string"){try{i=JSON.parse(i)}catch(e){const t="Failed to parse inputData string: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});throw new Error(t)}}const s=e||i;if(!s||Object.keys(s).length===0){if(a){const e="No payload provided and no explicit schema defined. Cannot infer UI.";c.error("[MetaUI]",e,"GeneratorHost");this.fireEvent("error",{message:e});throw new Error(e)}}const r=a?null:t;const o=p.normalize(r,s);this.parsedSchema=o;if(o){const e=f.validateSchemaStructure(o);if(e.length>0){const t="Schema Structural Errors Found:\n- "+e.join("\n- ");c.error("[MetaUI]",t,"GeneratorHost");if(this.getProperty("debugMode")){g.error(t,{title:"MetaUI Schema Error"});return}}}const l=D.getInstance().getPathsToLoad(o);const u=Array.from(l).some(e=>!sap.ui.require(e));if(u){this.setBusy(true);await D.getInstance().preloadDependencies(o);this.setBusy(false)}this.activeModelName="metaUI_"+this.getId();this.stateManager=new m(s,o,this.activeModelName);this.stateManager.setUseMessageManager(this.getProperty("useMessageManager")===true);this.setModel(this.stateManager.getModel(),this.activeModelName);if(!this.engine){const e=this.getProperty("editable")!==false;const t=this.getProperty("useMessageManager")===true;this.engine=new y(e,t)}this.generatedContent=this.engine.build(o,this.stateManager.getModel(),this.activeModelName,this.triggerSubmit.bind(this),this.getId(),this.onInternalFieldChange.bind(this));let M=this.generatedContent;const b=o&&Object.keys(o).length>0;if(!b){const e=new d({text:"Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.",type:"Warning",showIcon:true,showCloseButton:false});e.addStyleClass("sapUiSmallMarginBottom");M=new h({items:[e,this.generatedContent]})}else if(this.engine.hasPartialRenderingErrors){const e=new d({text:"Layout partially rendered. Some fields failed to generate due to configuration errors.",type:"Warning",showIcon:true,showCloseButton:true});e.addStyleClass("sapUiSmallMarginBottom");M=new h({items:[e,this.generatedContent]})}this.setAggregation("_content",M);this.validationDelegate.registerObject(this.generatedContent);const P=this.stateManager.extractPayload();this.dataSyncDelegate.pushToBindings(P);const v=this.calculateOptimalDialogWidth(this.parsedSchema);this.dialogDelegate.updateDialogWidthDynamically(v)}catch(e){this.setBusy(false);const t="Fatal crash during layout generation: "+e.message;c.error("[MetaUI]",t,"GeneratorHost");this.fireEvent("error",{message:t,exception:e});this.validationDelegate.mountCrashBoundary(e);throw e}},calculateOptimalDialogWidth:function e(t){if(!t)return"auto";let a=false;const i=e=>{if(a)return;for(const t in e){const n=e[t];if(n.type==="array"){a=true;return}if(n.ui?.fullWidth===true){a=true;return}if(n.ui?.widget==="codeEditor"||n.ui?.widget==="textArea"||n.ui?.widget==="richText"){a=true;return}if(n.properties)i(n.properties);if(n.items&&n.items.properties)i(n.items.properties)}};if(t.type==="array")return"80vw";if(t.properties){i(t.properties)}return a?"80vw":"auto"},openInDialog:function e(t="Form",a="OK",i="Cancel",n="auto",s){const r=!!this.generatedContent;let o=n;if(o==="auto"&&this.parsedSchema){o=this.calculateOptimalDialogWidth(this.parsedSchema)}this.dialogDelegate.openInDialog(t,a,r,i,o,s)}});return v});
11
11
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate", ["sap/base/util/deepEqual","sap/base/util/extend","../../../utils/Logger","../../../core/SchemaNormalizer"],function(t,e,s,a){"use strict";const o=s["Logger"];const r=a["SchemaNormalizer"];class i{_lastPushedPayloadJson=null;_lastPushedPayloadObj=null;_lastReceivedInputObj=null;constructor(t){this.host=t}pushToBindings(e){const s=JSON.stringify(e,null,2);this._lastPushedPayloadJson=s;this._lastPushedPayloadObj=t({},e)?null:JSON.parse(JSON.stringify(e));this.host.setProperty("data",e,true);this.host.setProperty("dataJson",s,true)}handleInputDataHotSwap(s,a,i){let h=null;if(typeof a==="string"){try{h=JSON.parse(a)}catch(t){this.host.setBaseProperty(s,a,true);return}}else{h=a}if(h===null){this.host.setBaseProperty(s,a,true);return}if(this._lastReceivedInputObj&&t(h,this._lastReceivedInputObj)){if(this.host.getProperty("debugMode")){o.debug("[MetaUI]",`Dropped stale data injection for ${s}`,"DataSyncDelegate")}this.host.setBaseProperty(s,a,i);return}if(this._lastPushedPayloadObj&&t(h,this._lastPushedPayloadObj)){if(this.host.getProperty("debugMode")){o.debug("[MetaUI]",`Dropped echo for ${s}`,"DataSyncDelegate")}this.host.setBaseProperty(s,a,i);return}this._lastReceivedInputObj=e(true,{},h);if(this.host.getProperty("debugMode")){o.debug("[MetaUI]",`Accepted external injection for ${s}`,"DataSyncDelegate")}this.host.setBaseProperty(s,a,true);const n=this.host.getStateManager();if(!n){this.host.invalidate();return}try{n.getModel().setData(h,false);if(!this.host.getProperty("schemaDefinition")&&typeof this.host.getParsedSchema==="function"){const e=r.inferSchemaFromData(h);const s=this.host.getParsedSchema();if(!t(e,s)){this.host.tearDownGeneratedLayout();this.host.invalidate()}}}catch(t){const e=`Failed to hot-swap ${s}: `+t.message;o.error("[MetaUI]",e,"DataSyncDelegate");throw new Error(e)}}}var h={__esModule:true};h.DataSyncDelegate=i;return h});
12
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate", ["sap/m/Dialog","sap/m/Button","../../../utils/Logger"],function(e,t,o){"use strict";const s=o["Logger"];class n{constructor(e){this.host=e}openInDialog(o="Form",n="OK",i,r="Cancel",a="800px",c){const l=new e({title:o,contentWidth:a,content:[this.host],beginButton:new t({text:n,type:"Emphasized",press:()=>{try{const e=this.host.triggerSubmit();if(e){l.close()}}catch(e){s.error("[MetaUI] Catastrophic error during validation/submit pipeline",e.message,"DialogDelegate");this.host.fireEvent("validationError",{fieldPath:"root",message:e.message})}}}),endButton:new t({text:r,press:()=>{this.host.fireEvent("cancel");l.close()}}),afterClose:()=>{l.destroy()}});if(c&&typeof c.addDependent==="function"){c.addDependent(l)}l.open()}}var i={__esModule:true};i.DialogDelegate=n;return i});
12
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate", ["sap/m/Dialog","sap/m/Button","../../../utils/Logger"],function(t,e,i){"use strict";const o=i["Logger"];class s{activeDialog=null;requestedWidth="auto";constructor(t){this.host=t}openInDialog(i="Form",s="OK",a,n="Cancel",r="auto",l){this.requestedWidth=r;const h=new t({title:i,contentWidth:r,content:[this.host],beginButton:new e({text:s,type:"Emphasized",press:()=>{try{const t=this.host.triggerSubmit();if(t){h.close()}}catch(t){o.error("[MetaUI] Catastrophic error during validation/submit pipeline",t.message,"DialogDelegate");this.host.fireEvent("validationError",{fieldPath:"root",message:t.message})}}}),endButton:new e({text:n,press:()=>{this.host.fireEvent("cancel");h.close()}}),afterClose:()=>{this.activeDialog=null;h.destroy()}});this.activeDialog=h;if(l&&typeof l.addDependent==="function"){l.addDependent(h)}h.open()}updateDialogWidthDynamically(t){if(this.activeDialog&&this.requestedWidth==="auto"&&t!=="auto"){this.activeDialog.setContentWidth(t)}}}var a={__esModule:true};a.DialogDelegate=s;return a});
13
13
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate", ["../../../utils/Logger"],function(t){"use strict";const e=t["Logger"];class a{odataType=null;isSyncing=false;constructor(t,e){this.host=t;this.context=e;this.detectODataType()}detectODataType(){const t=this.context.getModel();const e=t.getMetadata().getName();if(e.indexOf("v4")>-1){this.odataType="V4"}else if(e.indexOf("v2")>-1||e.indexOf("ODataModel")>-1){this.odataType="V2"}}syncToEngine(){if(!this.odataType)return;if(this.odataType==="V4"){if(typeof this.context.requestObject==="function"){this.context.requestObject().then(t=>{this.pushPayload(t)}).catch(t=>{e.error("[MetaUI]","Failed to extract V4 Context payload: "+t.message,"ODataDelegate")})}}else if(this.odataType==="V2"){const t=this.context.getObject();if(t){this.pushPayload(t)}}}pushPayload(t){if(!t)return;const e={...t};for(const t of Object.keys(e)){if(t.startsWith("@")||t.startsWith("__")){delete e[t]}}this.isSyncing=true;this.host.setProperty("data",e);this.isSyncing=false}handleFieldChange(t,a){if(this.isSyncing||!this.odataType)return;try{if(this.odataType==="V4"){this.context.setProperty(t,a)}else if(this.odataType==="V2"){const e=this.context.getModel();e.setProperty(t,a,this.context)}if(this.host.getProperty("debugMode")){e.debug("[MetaUI]",`ODataDelegate Patched ${t} = ${a} via ${this.odataType}`,"ODataDelegate")}}catch(t){e.error("[MetaUI]",`Failed to patch OData context: ${t.message}`,"ODataDelegate")}}}var s={__esModule:true};s.ODataDelegate=a;return s});
14
14
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate", ["sap/m/IllustratedMessage","sap/ui/core/Messaging","../../../utils/Logger","sap/ui/core/message/Message","sap/ui/core/library"],function(e,t,s,r,a){"use strict";const o=s["Logger"];class g{constructor(e){this.host=e}registerObject(e){}unregisterObject(e){}removeAllMessages(){const e=this.host.getStateManager();if(e&&this.host.getProperty("useMessageManager")){const s=t;const r=s.getMessageModel().getData();const a=r.filter(t=>t.getMessageProcessor()&&t.getMessageProcessor().getId()===e.getModel().getId());if(a&&a.length>0){s.removeMessages(a)}}}pushMessage(e,s){const g=e?`/${e.replace(/^\//,"")}`:"";const n=e?`Field '${e}': ${s}`:s;if(e){o.warn(`[MetaUI Validation Error] ${n}`)}else{o.warn(`[MetaUI Validation Error] Global - ${s}`)}if(this.host.getProperty("useMessageManager")===true){const e=t;const s=this.host.getStateManager();e.addMessages(new r({message:n,type:a.MessageType.Error,target:g,processor:s?.getModel()}))}}addCustomError(e,s){if(this.host.getProperty("useMessageManager")!==true){return}const o=this.host.getStateManager();if(!o){return}t.addMessages(new r({message:s,type:a.MessageType.Error,target:`/${e.replace(/^\//,"")}`,processor:o.getModel(),code:"CustomError"}))}clearCustomError(e){if(this.host.getProperty("useMessageManager")!==true){return}const s=this.host.getStateManager();if(!s){return}const r=`/${e.replace(/^\//,"")}`;const a=s.getModel().getId();const o=t.getMessageModel().getData();const g=o.filter(e=>e.getTarget()===r&&e.getCode()==="CustomError"&&e.getMessageProcessor()?.getId()===a);if(g.length>0){t.removeMessages(g)}}mountCrashBoundary(t){o.error("[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.",t.message,"ValidationDelegate");const s=new e({title:"UI Generation Failed",description:"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs."});this.host.setAggregation("_content",s)}}var n={__esModule:true};n.ValidationDelegate=g;return n});
15
15
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/ConditionEngine", ["./Registry"],function(e){"use strict";const r=e["Registry"];const s=new r("Operators");s.register("==",(e,r)=>e==r);s.register("===",(e,r)=>e===r);s.register("!=",(e,r)=>e!=r);s.register("!==",(e,r)=>e!==r);s.register(">",(e,r)=>e>r);s.register("<",(e,r)=>e<r);s.register(">=",(e,r)=>e>=r);s.register("<=",(e,r)=>e<=r);class t{constructor(e){this.schema=e}plugins=new Map;handleEvent(e,r){}registerPlugin(e,r){this.plugins.set(e,r)}destroy(){this.plugins.clear()}}var i={__esModule:true};i.OperatorRegistry=s;i.ConditionEngine=t;return i});
@@ -18,11 +18,12 @@ sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/Engine", ["./ConditionEngine",
18
18
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/PipelineManager", ["./Registry","../plugins/validators/PatternValidatorPlugin","../plugins/validators/MinLengthValidatorPlugin","../plugins/validators/RangeValidatorPlugin","../plugins/validators/UrlValidatorPlugin","../plugins/validators/IbanValidatorPlugin","../plugins/validators/EmailValidatorPlugin","../plugins/formatters/DateFormatterPlugin","../plugins/formatters/PhoneFormatterPlugin","../plugins/formatters/TextCaseFormatterPlugin","../utils/Logger"],function(e,t,r,i,a,s,n,l,o,g,u){"use strict";const d=e["Registry"];const c=t["PatternValidatorPlugin"];const P=r["MinLengthValidatorPlugin"];const f=i["RangeValidatorPlugin"];const h=a["UrlValidatorPlugin"];const m=s["IbanValidatorPlugin"];const v=n["EmailValidatorPlugin"];const V=l["DateFormatterPlugin"];const p=o["PhoneFormatterPlugin"];const w=g["TextCaseFormatterPlugin"];const M=u["Logger"];class x{validate(e,t){if(e===null||e===undefined||e===""){return{isValid:false,errorMessage:"This field is required."}}return{isValid:true}}}class y{validate(e,t){if(typeof e==="string"&&t&&typeof t==="number"){if(e.length>t){return{isValid:false,errorMessage:`Maximum length is ${t} characters.`}}}return{isValid:true}}}class F{formatters=new d("Formatters");parsers=new d("Parsers");validators=new d("Validators");constructor(){this.validators.register("required",new x);this.validators.register("maxLength",new y);this.validators.register("pattern",new c);this.validators.register("minLength",new P);this.validators.register("range",new f);this.validators.register("url",new h);this.validators.register("iban",new m);this.validators.register("email",new v);this.formatters.register("date",new V);this.formatters.register("phone",new p);this.formatters.register("textCase",new w)}executeValidation(e,t,r){for(const i of t){const t=this.validators.get(i);if(t){const a=r?r[i]:undefined;try{const r=t.validate(e,a);if(!r.isValid){return r}}catch(e){const t=e.message;M.error(`[MetaUI] PipelineManager: Validator '${i}' crashed during execution.`,t);return{isValid:false,errorMessage:`System validation error: ${t}`}}}else{M.warn(`[MetaUI] PipelineManager: Requested validator '${i}' not found in registry.`)}}return{isValid:true}}}const L=new F;var b={__esModule:true};b.PipelineManager=F;b.GlobalPipeline=L;return b});
19
19
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/PluginRegistry", ["../utils/Logger"],function(i){"use strict";const t=i["Logger"];class e{fieldIndex={};actionIndex={};layoutIndex={};activePromises={};constructor(){this.registerPluginPath("string",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin");this.registerPluginPath("number",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("integer",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("date",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin");this.registerPluginPath("boolean",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin");this.registerPluginPath("array",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin");this.registerPluginPath("object",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin");this.registerPluginPath("string","time","nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin");this.registerPluginPath("string","datetime","nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin");this.registerPluginPath("boolean","switch","nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin");this.registerPluginPath("string","select","nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin");this.registerPluginPath("string","textArea","nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin");this.registerPluginPath("string","codeEditor","nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin");this.registerPluginPath("string","fileUploader","nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin");this.registerPluginPath("array","multiSelect","nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin");this.registerPluginPath("array","multiInput","nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin");this.registerPluginPath("number","slider","nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin");this.registerPluginPath("number","rating","nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin");this.registerPluginPath("string","messageStrip","nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin");this.registerPluginPath("string","camera","nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin");this.registerPluginPath("string","signature","nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin");this.registerPluginPath("object","location","nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin");this.registerPluginPath("string","scanner","nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin");this.registerPluginPath("string","voiceInput","nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin");this.registerPluginPath("string","richText","nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin");this.registerPluginPath("string","urlButton","nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin");this.registerPluginPath("string","submitButton","nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin");this.registerPluginPath("string","odataSelect","nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin");this.registerPluginPath("string","remoteDropdown","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin");this.registerPluginPath("string","liveSearch","nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin");this.registerPluginPath("string","remoteValueHelp","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin");this.registerLayoutPath("form","nz/co/siliconst/ui5/metaui/layouts/FormLayout");this.registerLayoutPath("table","nz/co/siliconst/ui5/metaui/layouts/TableLayout");this.registerLayoutPath("wizard","nz/co/siliconst/ui5/metaui/layouts/WizardLayout");this.registerLayoutPath("compact","nz/co/siliconst/ui5/metaui/layouts/CompactLayout")}static getInstance(){if(!e.instance){e.instance=new e}return e.instance}registerPluginPath(i,t,e){const n=t?`${i}:${t}`:i;this.fieldIndex[n]=e}registerActionPath(i,t){this.actionIndex[i]=t}registerLayoutPath(i,t){this.layoutIndex[i]=t}getFieldPath(i,t){let e;if(t){e=this.fieldIndex[`${i}:${t}`]}if(!e){e=this.fieldIndex[i]}if(!e){throw new Error(`No plugin path mapped for FieldType: ${i} (widget: ${t})`)}return e}getLayoutPath(i){const t=this.layoutIndex[i];if(!t){throw new Error(`No layout path mapped for strategy: ${i}`)}return t}getPathsToLoad(i){const e=new Set;const n=i.layoutStrategy||(i.type==="array"?"table":"form");e.add(this.getLayoutPath(n));const s=i=>{for(const n in i){const r=i[n];try{e.add(this.getFieldPath(r.type||"string",r.ui?.widget))}catch(i){const e=`[MetaUI LazyLoad] Could not find mapped plugin for field ${n}: ${i.message}`;t.error(e);throw new Error(e)}if(r.properties)s(r.properties);if(r.items&&r.items.properties)s(r.items.properties);if(r.items&&r.items.type){try{e.add(this.getFieldPath(r.items.type,r.items.ui?.widget))}catch(i){const e=`[MetaUI LazyLoad] Could not find mapped plugin for array item type ${r.items.type}: ${i.message}`;t.error(e);throw new Error(e)}}}};if(i.properties){s(i.properties)}else if(i.items&&i.items.properties){s(i.items.properties)}return e}async preloadDependencies(i){const e=this.getPathsToLoad(i);const n=Array.from(e).map(i=>{if(!this.activePromises[i]){this.activePromises[i]=new Promise((e,n)=>{sap.ui.require([i],i=>e(i),e=>{t.error(`Failed to lazy load module: ${i}`);delete this.activePromises[i];n(e)})})}return this.activePromises[i]});await Promise.all(n)}extractConstructor(i){if(!i)return null;if(typeof i==="function")return i;if(i.default&&typeof i.default==="function")return i.default;const t=Object.keys(i);for(const e of t){if(typeof i[e]==="function"){return i[e]}}return null}getPlugin(i,t){const e=this.getFieldPath(i,t);const n=sap.ui.require(e);const s=this.extractConstructor(n);if(!s){throw new Error(`[MetaUI Plugin Instantiation] Plugin ${e} was not preloaded or has no constructor!`)}return new s}getLayout(i){const t=this.getLayoutPath(i);const e=sap.ui.require(t);const n=this.extractConstructor(e);if(!n){throw new Error(`[MetaUI Layout Instantiation] Layout ${t} was not preloaded or has no constructor!`)}return new n}}var n={__esModule:true};n.PluginRegistry=e;return n});
20
20
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/Registry", ["../utils/Logger"],function(t){"use strict";const e=t["Logger"];class r{items=new Map;constructor(t="Registry"){this.registryName=t}register(t,r){if(this.items.has(t)){e.warn(`[MetaUI] ${this.registryName}: Overwriting existing key '${t}'.`)}this.items.set(t,r)}get(t){return this.items.get(t)}getStrict(t){const r=this.get(t);if(!r){const r=`[MetaUI] ${this.registryName}: Key '${t}' not found.`;e.error(r);throw new Error(r)}return r}getKeys(){return Array.from(this.items.keys())}clear(){this.items.clear()}}var s={__esModule:true};s.Registry=r;return s});
21
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/SchemaNormalizer", ["../utils/Logger"],function(e){"use strict";const t=e["Logger"];class r{static normalize(e,r){let i=e;if(typeof i==="string"){if(!i.trim()){i=null}else{try{i=JSON.parse(i)}catch(e){const r="Failed to parse schema string: "+e.message;t.error("[MetaUI SchemaNormalizer]",r);throw new Error(r)}}}if(!i||typeof i!=="object"||Array.isArray(i)){return this.inferSchemaFromData(r)}try{const e={title:i.title,type:i.type||(i.items?"array":"object"),layoutStrategy:i.layoutStrategy,uiLayout:i.uiLayout,additionalProperties:i.additionalProperties};let t=i.properties||{};if(i.additionalProperties===true&&r){const e=this.inferSchemaFromData(r);if(e.type==="object"&&e.properties){t=this.deepMergeProperties(e.properties,t)}else if(e.type==="array"&&e.items&&e.items.properties){}}if(e.type==="object"){const r=Array.isArray(i.required)?i.required:[];e.properties=this.normalizeProperties(t,r)}else if(e.type==="array"){e.items=this.normalizePropertyMetadata(i.items||{type:"object",properties:{}},"items",false)}return e}catch(e){const r="Critical error normalizing schema object: "+e.message;t.error("[MetaUI SchemaNormalizer]",r);throw new Error(r)}}static deepMergeProperties(e,t){const r={...e};for(const e of Object.keys(t)){const i=t[e];const a=r[e];if(a&&typeof a==="object"&&!Array.isArray(a)&&i&&typeof i==="object"&&!Array.isArray(i)){r[e]=this.deepMergeProperties(a,i)}else{r[e]=i}}return r}static normalizeProperties(e,t=[]){const r={};for(const i of Object.keys(e)){const a=t.includes(i);r[i]=this.normalizePropertyMetadata(e[i],i,a)}return r}static normalizePropertyMetadata(e,t,r=false){const i={type:e.type||"string",ui:{label:e.ui?.label||this.generateLabel(t),isKey:!!e.ui?.isKey,readOnly:!!e.ui?.readOnly,widget:e.ui?.widget||(e.valueHelp||e.enum?"select":undefined),visibleOn:e.ui?.visibleOn,enabledOn:e.ui?.enabledOn,format:e.ui?.format,validators:e.ui?.validators,formatter:e.ui?.formatter,args:e.ui?.args,rows:e.ui?.rows,fullWidth:e.ui?.fullWidth,dialogButtonText:e.ui?.dialogButtonText},required:r||!!e.required,maxLength:e.maxLength,minLength:e.minLength,minimum:e.minimum,maximum:e.maximum,pattern:e.pattern,precision:e.precision,scale:e.scale,multipleOf:e.multipleOf,valueHelp:e.valueHelp,enum:e.enum};if(i.type==="object"&&e.properties){const t=Array.isArray(e.required)?e.required:[];i.properties=this.normalizeProperties(e.properties,t);i.uiLayout=e.uiLayout}else if(i.type==="array"&&e.items){i.items=this.normalizePropertyMetadata(e.items,"items",false);i.uiLayout=e.uiLayout}return i}static generateLabel(e){if(!e)return"";let t=e.replace(/([A-Z])/g," $1").replace(/_/g," ");return t.split(" ").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ").trim()}static inferSchemaFromData(e){const t={type:"object",properties:{},layoutStrategy:"compact",title:""};if(!e||typeof e!=="object"){return t}if(Array.isArray(e)){t.type="array";if(e.length>0&&typeof e[0]!=="object"){t.layoutStrategy="compact";t.items={type:typeof e[0]}}else{t.layoutStrategy="table";t.items={type:"object",layoutStrategy:"compact",properties:e.length>0?this.inferPropertiesFromObject(e[0]):{}}}}else{t.type="object";t.properties=this.inferPropertiesFromObject(e)}return t}static inferPropertiesFromObject(e){const t={};if(!e||typeof e!=="object")return t;for(const r of Object.keys(e)){const i=e[r];if(i===null||i===undefined)continue;let a="string";let o;let s;if(typeof i==="number")a="number";else if(typeof i==="boolean")a="boolean";else if(Array.isArray(i)){a="array";if(i.length>0&&typeof i[0]!=="object"){o={type:typeof i[0]}}else{o={type:"object",properties:i.length>0?this.inferPropertiesFromObject(i[0]):{}}}}else if(typeof i==="object"){a="object";s=this.inferPropertiesFromObject(i)}t[r]={type:a,items:o,properties:s,ui:{label:this.generateLabel(r),isKey:false,readOnly:false,widget:a==="array"&&o?.type!=="object"?"multiInput":undefined}}}return t}static resolveScope(e,r){if(!r||!r.startsWith("#/properties/")){return{meta:undefined,bindingPath:r||"",propKey:r||""}}const i=r.replace("#/properties/","").split("/properties/");let a=e.properties;let o;t.debug("[MetaUI SchemaNormalizer]",`Resolving scope '${r}' with segments: ${JSON.stringify(i)}`,"SchemaNormalizer");t.debug("[MetaUI SchemaNormalizer]",`Root schema keys: ${Object.keys(e.properties||{})}`,"SchemaNormalizer");for(let e=0;e<i.length;e++){const r=i[e];if(!a){t.debug("[MetaUI SchemaNormalizer]",`current is undefined at segment '${r}'`,"SchemaNormalizer");o=undefined;break}o=a[r];t.debug("[MetaUI SchemaNormalizer]",`Segment '${r}' resolved to meta: ${!!o}. Available keys in current: ${Object.keys(a)}`,"SchemaNormalizer");if(e<i.length-1){a=o?.properties}}const s=i.join("/");const n=r.replace("#/properties/","");return{meta:o,bindingPath:s,propKey:n}}}var i={__esModule:true};i.SchemaNormalizer=r;return i});
21
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry", ["./SchemaNormalizer","../swagger/SwaggerBuilder","../utils/Logger"],function(e,r,i){"use strict";const t=e["SchemaNormalizer"];const s=r["SwaggerBuilder"];const u=i["Logger"];class n{static _plugins=[new s,new t];static register(e){this._plugins.push(e)}static getBuilderFor(e){if(!e||typeof e!=="object"){return null}for(const r of this._plugins){if(r.canHandle(e)){return r}}u.warn("[SchemaBuilderRegistry]","No suitable Schema Builder plugin found for the provided payload.");return null}}var a={__esModule:true};a.SchemaBuilderRegistry=n;return a});
22
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/SchemaNormalizer", ["../utils/Logger"],function(e){"use strict";const t=e["Logger"];class r{canHandle(e){if(e.openapi||e.swagger)return false;return true}build(e){return r.normalize(e)}static normalize(e,r){let i=e;if(typeof i==="string"){if(!i.trim()){i=null}else{try{i=JSON.parse(i)}catch(e){const r="Failed to parse schema string: "+e.message;t.error("[MetaUI SchemaNormalizer]",r);throw new Error(r)}}}if(!i||typeof i!=="object"||Array.isArray(i)){return this.inferSchemaFromData(r)}try{const e={title:i.title,type:i.type||(i.items?"array":"object"),layoutStrategy:i.layoutStrategy,uiLayout:i.uiLayout,additionalProperties:i.additionalProperties};let t=i.properties||{};if(i.additionalProperties===true&&r){const e=this.inferSchemaFromData(r);if(e.type==="object"&&e.properties){t=this.deepMergeProperties(e.properties,t)}else if(e.type==="array"&&e.items&&e.items.properties){}}if(e.type==="object"){const r=Array.isArray(i.required)?i.required:[];e.properties=this.normalizeProperties(t,r)}else if(e.type==="array"){e.items=this.normalizePropertyMetadata(i.items||{type:"object",properties:{}},"items",false)}return e}catch(e){const r="Critical error normalizing schema object: "+e.message;t.error("[MetaUI SchemaNormalizer]",r);throw new Error(r)}}static deepMergeProperties(e,t){const r={...e};for(const e of Object.keys(t)){const i=t[e];const a=r[e];if(a&&typeof a==="object"&&!Array.isArray(a)&&i&&typeof i==="object"&&!Array.isArray(i)){r[e]=this.deepMergeProperties(a,i)}else{r[e]=i}}return r}static normalizeProperties(e,t=[]){const r={};for(const i of Object.keys(e)){const a=t.includes(i);r[i]=this.normalizePropertyMetadata(e[i],i,a)}return r}static normalizePropertyMetadata(e,t,r=false){const i={type:e.type||"string",ui:{label:e.ui?.label||this.generateLabel(t),isKey:!!e.ui?.isKey,readOnly:!!e.ui?.readOnly,widget:e.ui?.widget||(e.valueHelp||e.enum?"select":undefined),visibleOn:e.ui?.visibleOn,enabledOn:e.ui?.enabledOn,format:e.ui?.format,validators:e.ui?.validators,formatter:e.ui?.formatter,args:e.ui?.args,rows:e.ui?.rows,fullWidth:e.ui?.fullWidth,dialogButtonText:e.ui?.dialogButtonText},required:r||!!e.required,maxLength:e.maxLength,minLength:e.minLength,minimum:e.minimum,maximum:e.maximum,pattern:e.pattern,precision:e.precision,scale:e.scale,multipleOf:e.multipleOf,valueHelp:e.valueHelp,enum:e.enum};if(i.type==="object"&&e.properties){const t=Array.isArray(e.required)?e.required:[];i.properties=this.normalizeProperties(e.properties,t);i.uiLayout=e.uiLayout}else if(i.type==="array"&&e.items){i.items=this.normalizePropertyMetadata(e.items,"items",false);i.uiLayout=e.uiLayout}return i}static generateLabel(e){if(!e)return"";let t=e.replace(/([A-Z])/g," $1").replace(/_/g," ");return t.split(" ").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ").trim()}static inferSchemaFromData(e){const t={type:"object",properties:{},layoutStrategy:"compact",title:""};if(!e||typeof e!=="object"){return t}if(Array.isArray(e)){t.type="array";if(e.length>0&&typeof e[0]!=="object"){t.layoutStrategy="compact";t.items={type:typeof e[0]}}else{t.layoutStrategy="table";t.items={type:"object",layoutStrategy:"compact",properties:e.length>0?this.inferPropertiesFromObject(e[0]):{}}}}else{t.type="object";t.properties=this.inferPropertiesFromObject(e)}return t}static inferPropertiesFromObject(e){const t={};if(!e||typeof e!=="object")return t;for(const r of Object.keys(e)){const i=e[r];if(i===null||i===undefined)continue;let a="string";let o;let s;if(typeof i==="number")a="number";else if(typeof i==="boolean")a="boolean";else if(Array.isArray(i)){a="array";if(i.length>0&&typeof i[0]!=="object"){o={type:typeof i[0]}}else{o={type:"object",properties:i.length>0?this.inferPropertiesFromObject(i[0]):{}}}}else if(typeof i==="object"){a="object";s=this.inferPropertiesFromObject(i)}t[r]={type:a,items:o,properties:s,ui:{label:this.generateLabel(r),isKey:false,readOnly:false,widget:a==="array"&&o?.type!=="object"?"multiInput":undefined}}}return t}static resolveScope(e,r){if(!r||!r.startsWith("#/properties/")){return{meta:undefined,bindingPath:r||"",propKey:r||""}}const i=r.replace("#/properties/","").split("/properties/");let a=e.properties;let o;t.debug("[MetaUI SchemaNormalizer]",`Resolving scope '${r}' with segments: ${JSON.stringify(i)}`,"SchemaNormalizer");t.debug("[MetaUI SchemaNormalizer]",`Root schema keys: ${Object.keys(e.properties||{})}`,"SchemaNormalizer");for(let e=0;e<i.length;e++){const r=i[e];if(!a){t.debug("[MetaUI SchemaNormalizer]",`current is undefined at segment '${r}'`,"SchemaNormalizer");o=undefined;break}o=a[r];t.debug("[MetaUI SchemaNormalizer]",`Segment '${r}' resolved to meta: ${!!o}. Available keys in current: ${Object.keys(a)}`,"SchemaNormalizer");if(e<i.length-1){a=o?.properties}}const s=i.join("/");const n=r.replace("#/properties/","");return{meta:o,bindingPath:s,propKey:n}}}var i={__esModule:true};i.SchemaNormalizer=r;return i});
22
23
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/SchemaValidator", [],function(){"use strict";class e{static validateSchemaStructure(e){const t=[];if(!e||typeof e!=="object"){return["Root schema must be an object."]}const o=e;if(o.type!=="object"&&o.type!=="array"){t.push(`Root schema must have type 'object' or 'array'. Found: '${o.type}'`)}if(o.type==="object"&&!o.properties){t.push("Object schema is missing the 'properties' node.")}if(o.properties){for(const e of Object.keys(o.properties)){const s=o.properties[e];if(!s||typeof s!=="object"){t.push(`Property '${e}' must be an object.`);continue}if(!s.type){t.push(`Property '${e}' is missing 'type'.`)}else{const o=["string","number","boolean","date","object","array"];if(!o.includes(s.type)){t.push(`Property '${e}' has invalid type '${s.type}'. Allowed: ${o.join(", ")}`)}}}}return t}}var t={__esModule:true};t.SchemaValidator=e;return t});
23
24
  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,s,t,a,i){"use strict";const n=s["GlobalPipeline"];class r{schema=null;_useMessageManager=false;constructor(s={},t,a="meta"){this.activeModelName=a;this.schema=t;const i=JSON.parse(JSON.stringify(s));this.model=new e(i);this.model.setDefaultBindingMode("TwoWay");const n=this.model.setProperty.bind(this.model);this.model.setProperty=(e,s,t,a)=>{const i=n(e,s,t,a);this.validatePath(e,s);return i}}setUseMessageManager(e){this._useMessageManager=e}validatePath(e,s){const r=e.replace(/^\//,"");const o=this.findMetadataForPath(r);const g=i;const d=e.startsWith("/")?e:`/${e}`;if(this._useMessageManager){const e=g.getMessageModel().getData();const s=e.filter(e=>{const s=e.getTarget()===d&&e.getMessageProcessor()&&e.getMessageProcessor().getId()===this.model.getId();return s});if(s.length>0){g.removeMessages(s)}}if(!o)return;const m=[];const h={};if(o.required){m.push("required")}if(o.type==="string"&&o.maxLength){m.push("maxLength");h["maxLength"]=o.maxLength}if(o.minLength){m.push("minLength");h["minLength"]=o.minLength}if(o.pattern){m.push("pattern");h["pattern"]=o.pattern}if(o.minimum!==undefined||o.maximum!==undefined){m.push("range");h["range"]={min:o.minimum,max:o.maximum}}const u=o.ui?.format;if(u==="email"||u==="url"||u==="iban"){m.push(u)}if(o.ui?.validators){for(const e of o.ui.validators){if(typeof e==="string"){m.push(e)}else if(e&&e.name){m.push(e.name);if(e.args!==undefined){h[e.name]=e.args}}}}if(m.length>0){const e=n.executeValidation(s,m,h);if(!e.isValid&&this._useMessageManager){const s=new t({message:e.errorMessage||"Invalid value.",type:a.MessageType.Error,target:d,processor:this.model});g.addMessages(s)}}}findMetadataForPath(e){if(!this.schema||!this.schema.properties)return undefined;return this.schema.properties[e]}getModel(){return this.model}bindControl(e,s,t){e.bindProperty(s,{path:t,model:"meta"})}extractPayload(){const e=this.model.getData();return JSON.parse(JSON.stringify(e))}destroy(){if(this.model){this.model.destroy()}}}var o={__esModule:true};o.StateManager=r;return o});
24
25
  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
- 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/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 c=false;const y=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(y)}}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 y=!!a.ui?.widget;const m=a.type==="array"&&u&&!y;if(m){s.debug("[MetaUI FormLayout]",`Routing property '${l}' to Table Sub-Layout.`,"FormLayout");d.push({scope:r,meta:a,label:e.label})}else{c=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(y);if(c){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);const d=u.ui?.widget;const c=d==="codeEditor"||d==="textArea"||d==="richText";const y=u.ui?.fullWidth!==undefined?u.ui?.fullWidth:c;if(y){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
27
  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
28
  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
29
  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/MultiInputPlugin","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,g){"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 y=window.nz.co.siliconst.ui5.metaui;return y});
@@ -41,7 +42,7 @@ sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin", [
41
42
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin", ["./BasePlugin","sap/ui/unified/FileUploader","sap/m/Link"],function(t,e,i){"use strict";const a=t["BasePlugin"];class n extends a{render(t,a,n="meta",l,s){this.onChange=s;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(l,a),text:`{${n}>${a}}`,href:`{${n}>${a}}`,target:"_blank"});this.applyCommonDirectives(this.control,t,n);return this.control}this.control=new e({id:this.generateStableId(l,a),value:`{${n}>${a}}`,enabled:!t.ui?.readOnly,placeholder:t.ui?.label||"Choose a file...",width:"100%",change:t=>{const e=t.getParameter("newValue");const i=this.validateAndApplyVisualState();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():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var l={__esModule:true};l.FileUploaderPlugin=n;return l});
42
43
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin", ["../controls/BasePlugin","../../controls/GeolocationControl","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 l=n(e);class o extends a{render(t,e,n="meta",a,o){this.onChange=o;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=>t&&t.lat!==undefined&&t.lng!==undefined?`Lat: ${t.lat}, Lng: ${t.lng}`:""}});this.applyCommonDirectives(this.control,t,n);return this.control}this.control=new l({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.validateAndApplyVisualState();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 s={__esModule:true};s.GeolocationPlugin=o;return s});
43
44
  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
- sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin", ["./BasePlugin","sap/m/MultiInput","sap/m/Token","sap/m/Text"],function(t,e,n,s){"use strict";const i=t["BasePlugin"];class a extends i{render(t,i,a="meta",o,r){this.onChange=r;this.metadata=t;if(!this.isEditable){this.control=new s({id:this.generateStableId(o,i),text:{path:`${a}>${i}`,formatter:t=>Array.isArray(t)?t.join(", "):""}});this.applyCommonDirectives(this.control,t,a);return this.control}const l=new e({id:this.generateStableId(o,i),enabled:!t.ui?.readOnly,placeholder:t.ui?.label||"Type and press Enter...",showValueHelp:false,tokenUpdate:t=>{const e=t.getParameters();const n=e.type;const s=l.getModel(a);const o=s.getProperty(i);const r=Array.isArray(o)?[...o]:[];if(n==="added"){const t=e.addedTokens;t.forEach(t=>r.push(t.getText()))}else if(n==="removed"){const t=e.removedTokens;t.forEach(t=>{const e=t.getText();const n=r.indexOf(e);if(n>-1){r.splice(n,1)}})}s.setProperty(i,r);const d=this.validateAndApplyVisualState();if(this.onChange){this.onChange(d.isValid,this.fieldKey)}}});l.addValidator(t=>new n({key:t.text,text:t.text}));l.bindAggregation("tokens",{path:`${a}>${i}`,factory:(t,e)=>{const s=e.getObject()||"";return new n(t,{key:s,text:s})}});this.control=l;this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){if(!this.control)return[];const t=this.control.getTokens();return t.map(t=>t.getText())}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var o={__esModule:true};o.MultiInputPlugin=a;return o});
45
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin", ["./BasePlugin","sap/m/MultiInput","sap/m/Token","sap/m/Text"],function(t,e,s,n){"use strict";const i=t["BasePlugin"];class a extends i{render(t,i,a="meta",r,o){this.onChange=o;this.metadata=t;if(!this.isEditable){this.control=new n({id:this.generateStableId(r,i),text:{path:`${a}>${i}`,formatter:t=>Array.isArray(t)?t.join(", "):""}});this.applyCommonDirectives(this.control,t,a);return this.control}const l=new e({id:this.generateStableId(r,i),enabled:!t.ui?.readOnly,placeholder:t.ui?.label||"Type and press Enter...",showValueHelp:false,tokenUpdate:t=>{const e=t.getParameters();const s=e.type;if(s==="removed"){const t=l.getModel(a);const s=t.getProperty(i);const n=Array.isArray(s)?[...s]:[];const r=e.removedTokens;r.forEach(t=>{const e=t.getText();const s=n.indexOf(e);if(s>-1){n.splice(s,1)}});t.setProperty(i,n);const o=this.validateAndApplyVisualState();if(this.onChange){this.onChange(o.isValid,this.fieldKey)}}}});l.addValidator(t=>{const e=t.text?.trim();if(e){const t=l.getModel(a);const s=t.getProperty(i);const n=Array.isArray(s)?[...s]:[];n.push(e);t.setProperty(i,n);l.setValue("");const r=this.validateAndApplyVisualState();if(this.onChange){this.onChange(r.isValid,this.fieldKey)}}return null});l.bindAggregation("tokens",{path:`${a}>${i}`,factory:(t,e)=>{const n=e.getObject()||"";return new s(t,{key:n,text:n})}});this.control=l;this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){if(!this.control)return[];const t=this.control.getTokens();return t.map(t=>t.getText())}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var r={__esModule:true};r.MultiInputPlugin=a;return r});
45
46
  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.validateAndApplyVisualState();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});
46
47
  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!==undefined?t.scale:t.type==="integer"?0:3,editable:!t.ui?.readOnly,required:t.required,change:t=>{const e=t.getParameter("value");const i=this.validateAndApplyVisualState();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});
47
48
  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});
@@ -68,6 +69,10 @@ sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidat
68
69
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin", [],function(){"use strict";class e{validate(e,r){if(!e)return{isValid:true};if(typeof r!=="string"){return{isValid:true}}try{const t=new RegExp(r);if(typeof e!=="string"||!t.test(e)){return{isValid:false,errorMessage:`Input does not match the required pattern.`}}}catch(e){return{isValid:false,errorMessage:`Schema configuration error: Invalid regex pattern.`}}return{isValid:true}}}var r={__esModule:true};r.PatternValidatorPlugin=e;return r});
69
70
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin", [],function(){"use strict";class e{validate(e,r){if(e===null||e===undefined)return{isValid:true};if(typeof e!=="number")return{isValid:true};const t=r;const u=t?.min;const n=t?.max;if(u!==undefined&&typeof u==="number"&&e<u){return{isValid:false,errorMessage:`Value must be greater than or equal to ${u}.`}}if(n!==undefined&&typeof n==="number"&&e>n){return{isValid:false,errorMessage:`Value must be less than or equal to ${n}.`}}return{isValid:true}}}var r={__esModule:true};r.RangeValidatorPlugin=e;return r});
70
71
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin", [],function(){"use strict";class r{validate(r,t){if(!r)return{isValid:true};if(typeof r!=="string")return{isValid:true};try{const t=new URL(r);if(t.protocol!=="http:"&&t.protocol!=="https:"){return{isValid:false,errorMessage:"URL must use http or https protocol."}}}catch(r){return{isValid:false,errorMessage:"Please enter a valid URL."}}return{isValid:true}}}var t={__esModule:true};t.UrlValidatorPlugin=r;return t});
72
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder", ["../utils/Logger","./SwaggerTypeMapper","./SwaggerUIMapper","./SwaggerRefResolver"],function(e,t,i,r){"use strict";const a=e["Logger"];const n=t["SwaggerTypeMapper"];const s=i["SwaggerUIMapper"];const o=r["SwaggerRefResolver"];class f{canHandle(e){return!!(e&&(e.openapi||e.swagger))}build(e){return f.build(e)}static async fetchAndBuild(e,t){try{const i=await fetch(e);if(!i.ok){throw new Error(`HTTP error! status: ${i.status}`)}const r=await i.json();return this.build(r,t)}catch(e){const t="Failed to fetch Swagger JSON from URL: "+e.message;a.error("[MetaUI SwaggerBuilder]",t);throw new Error(t)}}static build(e,t){if(!e||typeof e!=="object"){throw new Error("[MetaUI SwaggerBuilder] Invalid Swagger root object provided.")}let i=e;if(!t){if(e.components&&e.components.schemas){const i=Object.keys(e.components.schemas);if(i.length>0)t=i[0]}else if(e.definitions){const i=Object.keys(e.definitions);if(i.length>0)t=i[0]}}if(t){let r=false;if(e.components&&e.components.schemas&&e.components.schemas[t]){i=e.components.schemas[t];r=true}else if(e.definitions&&e.definitions[t]){i=e.definitions[t];r=true}if(!r){throw new Error(`[MetaUI SwaggerBuilder] Could not find target definition '${t}' in components/schemas or definitions.`)}}const r={title:i.title||e.info?.title||t,type:i.type==="array"?"array":"object",layoutStrategy:i.type==="array"?"table":"form"};if(i.additionalProperties===true){r.additionalProperties=true}if(r.type==="object"){const t=Array.isArray(i.required)?i.required:[];r.properties=this.mapProperties(i.properties||{},t,e)}else if(r.type==="array"&&i.items){r.items=this.mapPropertyMetadata(i.items,"items",false,e)}return r}static mapProperties(e,t,i){const r={};for(const a of Object.keys(e)){const n=t.includes(a);let s=e[a];if(s.$ref){const e=o.resolve(s.$ref,i);if(e){s={...e,...s}}}r[a]=this.mapPropertyMetadata(s,a,n,i)}return r}static mapPropertyMetadata(e,t,i,r){let a=e;if(a.$ref){const e=o.resolve(a.$ref,r);if(e){a={...e,...a}}}if(Array.isArray(a.allOf)){let e={...a};delete e.allOf;for(const t of a.allOf){let i=t;if(t.$ref){i=o.resolve(t.$ref,r)||{}}e={...e,...i}}a=e}const f=n.mapType(a.type);const l={type:f,required:i};const u=s.build(a,t);if(Object.keys(u).length>0){l.ui=u}if(typeof a.maxLength==="number")l.maxLength=a.maxLength;if(typeof a.minLength==="number")l.minLength=a.minLength;if(typeof a.maximum==="number")l.maximum=a.maximum;if(typeof a.minimum==="number")l.minimum=a.minimum;if(typeof a.pattern==="string")l.pattern=a.pattern;if(typeof a.multipleOf==="number")l.multipleOf=a.multipleOf;if(a.default!==undefined)l.default=a.default;if(typeof a.nullable==="boolean")l.nullable=a.nullable;if(typeof a.writeOnly==="boolean")l.writeOnly=a.writeOnly;if(a.example!==undefined)l.example=a.example;if(typeof a.deprecated==="boolean")l.deprecated=a.deprecated;if(a.exclusiveMinimum!==undefined)l.exclusiveMinimum=a.exclusiveMinimum;if(a.exclusiveMaximum!==undefined)l.exclusiveMaximum=a.exclusiveMaximum;if(Array.isArray(a.enum)){l.enum=a.enum;if(!l.ui)l.ui={};if(!l.ui.widget){if(f==="array"){l.ui.widget="multiSelect"}else{l.ui.widget="select"}}}if(f==="object"){if(a.properties){const e=Array.isArray(a.required)?a.required:[];l.properties=this.mapProperties(a.properties,e,r)}if(a.additionalProperties===true){l.additionalProperties=true}}else if(f==="array"&&a.items){l.items=this.mapPropertyMetadata(a.items,"items",false,r)}return l}}var l={__esModule:true};l.SwaggerBuilder=f;return l});
73
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver", ["../utils/Logger"],function(e){"use strict";const r=e["Logger"];class t{static resolve(e,t){if(!e||!e.startsWith("#/")){r.debug(`[MetaUI SwaggerBuilder] Ignoring non-local or empty $ref: ${e}`,"SwaggerBuilder");return null}const l=e.substring(2).split("/");let o=t;for(const t of l){if(o&&typeof o==="object"&&t in o){o=o[t]}else{r.error(`[MetaUI SwaggerBuilder] Failed to resolve local $ref: ${e}`,null,"SwaggerBuilder");return null}}return o}}var l={__esModule:true};l.SwaggerRefResolver=t;return l});
74
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper", [],function(){"use strict";class e{static mapType(e){const r={string:"string",number:"number",integer:"integer",boolean:"boolean",array:"array",object:"object",date:"date"};return r[e]||"object"}}var r={__esModule:true};r.SwaggerTypeMapper=e;return r});
75
+ sap.ui.predefine("nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper", [],function(){"use strict";class e{static build(e,a){const t={};if(e.title){t.label=e.title}else if(e.description){t.label=e.description}else{t.label=this.generateLabel(a)}if(e.readOnly===true){t.readOnly=true}if(e.format){switch(e.format){case"date-time":t.widget="datetime";break;case"date":t.widget="date";break;case"password":t.format="password";break;case"email":t.format="email";break;case"uri":t.format="url";break;case"uuid":case"ipv4":case"ipv6":case"hostname":if(!t.validators)t.validators=[];t.validators.push(e.format);break}}return t}static generateLabel(e){if(!e)return"";let a=e.replace(/([A-Z])/g," $1").replace(/_/g," ");return a.split(" ").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ").trim()}}var a={__esModule:true};a.SwaggerUIMapper=e;return a});
71
76
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder", [],function(){"use strict";class e{static build(e,t,r="meta"){if(!e)return"{= true }";let n=e;n=n.replace(/\$root\.([a-zA-Z0-9_.]+)/g,(e,t)=>`\${${r}>/${t.replace(/\./g,"/")}}`);n=n.replace(/(?<!['"\${a-zA-Z0-9_.>/-])([a-zA-Z_][a-zA-Z0-9_.]+)(?!['"a-zA-Z0-9_.(])/g,(e,n)=>{const s=["true","false","null","undefined","Math","String","Number","Array","Object"];if(s.includes(n))return n;let u=t.startsWith("/")?t.substring(1):t;const a=u.split("/");a.pop();const i=a.length>0?a.join("/")+"/":"";return`\${${r}>/${i}${n.replace(/\./g,"/")}}`});return`{= ${n} }`}}var t={__esModule:true};t.ExpressionBuilder=e;return t});
72
77
  sap.ui.predefine("nz/co/siliconst/ui5/metaui/utils/Logger", [],function(){"use strict";class e{static debugMode=false;static logInstance=null;static setDebugMode(e){this.debugMode=e;if(e&&!this.logInstance){sap.ui.require(["sap/base/Log"],e=>{this.logInstance=e})}}static isDebugMode(){return this.debugMode}static debug(e,t,s){if(!this.debugMode)return;if(this.logInstance){this.logInstance.debug(e,t,s||"MetaUI")}else{console.debug(`[MetaUI] ${e}`,t||"")}}static info(e,t,s){if(!this.debugMode)return;if(this.logInstance){this.logInstance.info(e,t,s||"MetaUI")}else{console.info(`[MetaUI] ${e}`,t||"")}}static warn(e,t,s){if(!this.debugMode)return;if(this.logInstance){this.logInstance.warning(e,t,s||"MetaUI")}else{console.warn(`[MetaUI] ${e}`,t||"")}}static error(e,t,s){if(this.logInstance){this.logInstance.error(e,t,s||"MetaUI")}else{console.error(`[MetaUI Error] ${e}`,t||"")}}static showErrorPopup(e,t){if(!this.debugMode)return;sap.ui.require(["sap/m/MessageBox"],s=>{s.error(e,{title:t||"MetaUI Error"})})}}var t={__esModule:true};t.Logger=e;return t});
73
78
  sap.ui.require.preload({
@@ -82,6 +87,9 @@ sap.ui.require.preload({
82
87
  },
83
88
  "nz/co/siliconst/ui5/metaui/interfaces/ISchema.js":function(){
84
89
 
90
+ },
91
+ "nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.js":function(){
92
+
85
93
  },
86
94
  "nz/co/siliconst/ui5/metaui/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"nz.co.siliconst.ui5.metaui","type":"library","embeds":[],"applicationVersion":{"version":"1.0.0"},"title":"MetaUI Engine","resources":"resources.json","offline":true},"sap.ui":{"technology":"UI5","supportedThemes":[]},"sap.ui5":{"dependencies":{"libs":{}},"library":{"i18n":false,"css":false,"content":{"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":[],"types":[],"interfaces":[]}}}}'
87
95
  });