@siliconst/metaui 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +21 -34
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js +164 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts +82 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js +44 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts +24 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +59 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +24 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus-dbg.js +51 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts +31 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +60 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts +37 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +37 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +20 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js +56 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts +37 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.d.ts +29 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts +26 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +32 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +68 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js +39 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts +28 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +57 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts +20 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +91 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts +20 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js +33 -0
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js +34 -0
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library.d.ts +10 -0
- package/src/nz/co/siliconst/ui5/metaui/library.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/library.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/manifest.json +34 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js +60 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts +43 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js +43 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js +61 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js +67 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js +54 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js +54 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js.map +1 -0
- package/test-resources/App.js +11 -0
- package/test-resources/Main.controller.js +73 -0
- package/test-resources/Main.view.xml +42 -0
- package/test-resources/index.html +21 -0
- package/test-resources/mockData.json +27 -0
- package/test-resources/mockSchema.json +98 -0
- package/ui5.yaml +1 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISchema.d.ts","sourceRoot":"..\\..\\..\\..\\..\\..\\..\\..","sources":["src\\nz\\co\\siliconst\\ui5\\metaui\\interfaces\\ISchema.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,+CAA+C,CAAC;IAC/D;;;;OAIG;IAEH;;OAEG;IACH,KAAY,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;IAE9E;;OAEG;IACH,UAAiB,UAAU;QACvB,oDAAoD;QACpD,GAAG,EAAE,MAAM,CAAC;QACZ,4DAA4D;QAC5D,IAAI,EAAE,MAAM,CAAC;KAChB;IAED;;OAEG;IACH,UAAiB,cAAc;QAC3B,mEAAmE;QACnE,SAAS,EAAE,MAAM,CAAC;QAClB,2DAA2D;QAC3D,IAAI,EAAE,SAAS,CAAC;QAChB,2CAA2C;QAC3C,KAAK,EAAE,MAAM,CAAC;QACd,qFAAqF;QACrF,KAAK,EAAE,OAAO,CAAC;QACf,wEAAwE;QACxE,UAAU,EAAE,OAAO,CAAC;QACpB,iEAAiE;QACjE,UAAU,EAAE,OAAO,CAAC;QACpB,gEAAgE;QAChE,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,iEAAiE;QACjE,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,uDAAuD;QACvD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,yDAAyD;QACzD,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC;KAC5B;IAED;;OAEG;IACH,UAAiB,cAAc;QAC3B,yCAAyC;QACzC,SAAS,EAAE,MAAM,CAAC;QAClB,wCAAwC;QACxC,KAAK,EAAE,MAAM,CAAC;QACd,gEAAgE;QAChE,MAAM,EAAE,cAAc,EAAE,CAAC;KAC5B;IAED;;OAEG;IACH,UAAiB,OAAO;QACpB,qDAAqD;QACrD,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;QACjC,2EAA2E;QAC3E,UAAU,EAAE,cAAc,EAAE,CAAC;QAC7B,wDAAwD;QACxD,MAAM,EAAE,cAAc,EAAE,CAAC;KAC5B;CAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISchema.js","names":[],"sources":[],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
sap.ui.define(["./FormLayout", "./TableLayout"], function (___FormLayout, ___TableLayout) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file BaseLayout.ts
|
|
6
|
+
* @description Central layout factory that delegates to specific form or table layout engines.
|
|
7
|
+
* Implements ILayoutManager.
|
|
8
|
+
*/
|
|
9
|
+
const FormLayout = ___FormLayout["FormLayout"];
|
|
10
|
+
const TableLayout = ___TableLayout["TableLayout"];
|
|
11
|
+
/**
|
|
12
|
+
* The core layout manager that delegates structural grid rendering based on schema configurations.
|
|
13
|
+
*/
|
|
14
|
+
class BaseLayout {
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a responsive form layout container.
|
|
17
|
+
* @param schema The master schema containing rootFields to be mounted.
|
|
18
|
+
* @returns A populated UI5 container (sap.ui.layout.form.SimpleForm).
|
|
19
|
+
*/
|
|
20
|
+
renderForm(schema) {
|
|
21
|
+
return FormLayout.build(schema.rootFields);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Constructs a responsive table layout container.
|
|
26
|
+
* @param tableMeta The metadata defining the table columns.
|
|
27
|
+
* @returns A UI5 Table control (sap.m.Table).
|
|
28
|
+
*/
|
|
29
|
+
renderTable(tableMeta) {
|
|
30
|
+
return TableLayout.build(tableMeta);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
var __exports = {
|
|
34
|
+
__esModule: true
|
|
35
|
+
};
|
|
36
|
+
__exports.BaseLayout = BaseLayout;
|
|
37
|
+
return __exports;
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=BaseLayout-dbg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseLayout-dbg.js","names":["FormLayout","___FormLayout","TableLayout","___TableLayout","BaseLayout","renderForm","schema","build","rootFields","renderTable","tableMeta","__exports","__esModule"],"sources":["BaseLayout.ts"],"sourcesContent":["/**\r\n * @file BaseLayout.ts\r\n * @description Central layout factory that delegates to specific form or table layout engines.\r\n * Implements ILayoutManager.\r\n */\r\n\r\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\r\nimport { ISchema, ITableMetadata } from \"../interfaces/ISchema\";\r\nimport Control from \"sap/ui/core/Control\";\r\nimport { FormLayout } from \"./FormLayout\";\r\nimport { TableLayout } from \"./TableLayout\";\r\n\r\n/**\r\n * The core layout manager that delegates structural grid rendering based on schema configurations.\r\n */\r\nexport class BaseLayout implements ILayoutManager {\r\n /**\r\n * Constructs a responsive form layout container.\r\n * @param schema The master schema containing rootFields to be mounted.\r\n * @returns A populated UI5 container (sap.ui.layout.form.SimpleForm).\r\n */\r\n public renderForm(schema: ISchema): Control {\r\n return FormLayout.build(schema.rootFields);\r\n }\r\n\r\n /**\r\n * Constructs a responsive table layout container.\r\n * @param tableMeta The metadata defining the table columns.\r\n * @returns A UI5 Table control (sap.m.Table).\r\n */\r\n public renderTable(tableMeta: ITableMetadata): Control {\r\n return TableLayout.build(tableMeta);\r\n }\r\n}\r\n"],"mappings":";;;EAAA;AACA;AACA;AACA;AACA;EAJA,MASSA,UAAU,GAAAC,aAAA;EAAA,MACVC,WAAW,GAAAC,cAAA;EAEpB;AACA;AACA;EACO,MAAMC,UAAU,CAA2B;IAC9C;AACJ;AACA;AACA;AACA;IACWC,UAAUA,CAACC,MAAe,EAAW;MACxC,OAAON,UAAU,CAACO,KAAK,CAACD,MAAM,CAACE,UAAU,CAAC;IAC9C;;IAEA;AACJ;AACA;AACA;AACA;IACWC,WAAWA,CAACC,SAAyB,EAAW;MACnD,OAAOR,WAAW,CAACK,KAAK,CAACG,SAAS,CAAC;IACvC;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAP,UAAA,GAAAA,UAAA;EAAA,OAAAO,SAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare module "nz/co/siliconst/ui5/metaui/layouts/BaseLayout" {
|
|
2
|
+
/**
|
|
3
|
+
* @file BaseLayout.ts
|
|
4
|
+
* @description Central layout factory that delegates to specific form or table layout engines.
|
|
5
|
+
* Implements ILayoutManager.
|
|
6
|
+
*/
|
|
7
|
+
import { ILayoutManager } from "nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager";
|
|
8
|
+
import { ISchema, ITableMetadata } from "nz/co/siliconst/ui5/metaui/interfaces/ISchema";
|
|
9
|
+
import Control from "sap/ui/core/Control";
|
|
10
|
+
/**
|
|
11
|
+
* The core layout manager that delegates structural grid rendering based on schema configurations.
|
|
12
|
+
*/
|
|
13
|
+
export class BaseLayout implements ILayoutManager {
|
|
14
|
+
/**
|
|
15
|
+
* Constructs a responsive form layout container.
|
|
16
|
+
* @param schema The master schema containing rootFields to be mounted.
|
|
17
|
+
* @returns A populated UI5 container (sap.ui.layout.form.SimpleForm).
|
|
18
|
+
*/
|
|
19
|
+
renderForm(schema: ISchema): Control;
|
|
20
|
+
/**
|
|
21
|
+
* Constructs a responsive table layout container.
|
|
22
|
+
* @param tableMeta The metadata defining the table columns.
|
|
23
|
+
* @returns A UI5 Table control (sap.m.Table).
|
|
24
|
+
*/
|
|
25
|
+
renderTable(tableMeta: ITableMetadata): Control;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=BaseLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseLayout.d.ts","sourceRoot":"..\\..\\..\\..\\..\\..\\..\\..","sources":["src\\nz\\co\\siliconst\\ui5\\metaui\\layouts\\BaseLayout.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,+CAA+C,CAAC;IAC/D;;;;OAIG;IAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;IACtF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;IACxF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAI1C;;OAEG;IACH,MAAa,UAAW,YAAW,cAAc;QAC7C;;;;WAIG;QACI,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;QAI3C;;;;WAIG;QACI,WAAW,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO;KAGzD;CAEA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
sap.ui.define(["./FormLayout","./TableLayout"],function(e,r){"use strict";const t=e["FormLayout"];const u=r["TableLayout"];class o{renderForm(e){return t.build(e.rootFields)}renderTable(e){return u.build(e)}}var a={__esModule:true};a.BaseLayout=o;return a});
|
|
2
|
+
//# sourceMappingURL=BaseLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseLayout.js","names":["FormLayout","___FormLayout","TableLayout","___TableLayout","BaseLayout","renderForm","schema","build","rootFields","renderTable","tableMeta","__exports","__esModule"],"sources":["BaseLayout.ts"],"sourcesContent":["/**\r\n * @file BaseLayout.ts\r\n * @description Central layout factory that delegates to specific form or table layout engines.\r\n * Implements ILayoutManager.\r\n */\r\n\r\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\r\nimport { ISchema, ITableMetadata } from \"../interfaces/ISchema\";\r\nimport Control from \"sap/ui/core/Control\";\r\nimport { FormLayout } from \"./FormLayout\";\r\nimport { TableLayout } from \"./TableLayout\";\r\n\r\n/**\r\n * The core layout manager that delegates structural grid rendering based on schema configurations.\r\n */\r\nexport class BaseLayout implements ILayoutManager {\r\n /**\r\n * Constructs a responsive form layout container.\r\n * @param schema The master schema containing rootFields to be mounted.\r\n * @returns A populated UI5 container (sap.ui.layout.form.SimpleForm).\r\n */\r\n public renderForm(schema: ISchema): Control {\r\n return FormLayout.build(schema.rootFields);\r\n }\r\n\r\n /**\r\n * Constructs a responsive table layout container.\r\n * @param tableMeta The metadata defining the table columns.\r\n * @returns A UI5 Table control (sap.m.Table).\r\n */\r\n public renderTable(tableMeta: ITableMetadata): Control {\r\n return TableLayout.build(tableMeta);\r\n }\r\n}\r\n"],"mappings":"0EAAA,MASSA,EAAUC,EAAA,oBACVC,EAAWC,EAAA,eAKb,MAAMC,EAMFC,WAAWC,GACd,OAAON,EAAWO,MAAMD,EAAOE,WACnC,CAOOC,YAAYC,GACf,OAAOR,EAAYK,MAAMG,EAC7B,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAAP,aAAA,OAAAO,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
sap.ui.define(["sap/ui/layout/form/SimpleForm", "sap/m/Label", "../core/PluginRegistry"], function (SimpleForm, Label, ___core_PluginRegistry) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const PluginRegistry = ___core_PluginRegistry["PluginRegistry"];
|
|
5
|
+
/**
|
|
6
|
+
* Utility class strictly for constructing Form layouts without custom CSS.
|
|
7
|
+
*/
|
|
8
|
+
class FormLayout {
|
|
9
|
+
/**
|
|
10
|
+
* Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.
|
|
11
|
+
* @param fields The array of root fields to render as FormElements.
|
|
12
|
+
* @returns A fully populated sap.ui.layout.form.SimpleForm.
|
|
13
|
+
*/
|
|
14
|
+
static build(fields) {
|
|
15
|
+
const form = new SimpleForm({
|
|
16
|
+
editable: true,
|
|
17
|
+
layout: "ResponsiveGridLayout",
|
|
18
|
+
labelSpanXL: 4,
|
|
19
|
+
labelSpanL: 4,
|
|
20
|
+
labelSpanM: 4,
|
|
21
|
+
labelSpanS: 12,
|
|
22
|
+
adjustLabelSpan: false,
|
|
23
|
+
emptySpanXL: 0,
|
|
24
|
+
emptySpanL: 0,
|
|
25
|
+
emptySpanM: 0,
|
|
26
|
+
emptySpanS: 0,
|
|
27
|
+
columnsXL: 1,
|
|
28
|
+
columnsL: 1,
|
|
29
|
+
columnsM: 1,
|
|
30
|
+
singleContainerFullSize: false
|
|
31
|
+
});
|
|
32
|
+
const registry = PluginRegistry.getInstance();
|
|
33
|
+
fields.forEach(field => {
|
|
34
|
+
// Respect Fiori accessibility standards by enforcing the required flag on labels
|
|
35
|
+
const label = new Label({
|
|
36
|
+
text: field.label,
|
|
37
|
+
required: field.isRequired
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Instantiate the correct plugin for the data type
|
|
41
|
+
const plugin = registry.getPlugin(field.type);
|
|
42
|
+
|
|
43
|
+
// In the isolated state manager architecture, the binding path maps exactly to the fieldName.
|
|
44
|
+
const control = plugin.render(field, `/${field.fieldName}`);
|
|
45
|
+
form.addContent(label);
|
|
46
|
+
form.addContent(control);
|
|
47
|
+
});
|
|
48
|
+
return form;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
var __exports = {
|
|
52
|
+
__esModule: true
|
|
53
|
+
};
|
|
54
|
+
__exports.FormLayout = FormLayout;
|
|
55
|
+
return __exports;
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=FormLayout-dbg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormLayout-dbg.js","names":["PluginRegistry","___core_PluginRegistry","FormLayout","build","fields","form","SimpleForm","editable","layout","labelSpanXL","labelSpanL","labelSpanM","labelSpanS","adjustLabelSpan","emptySpanXL","emptySpanL","emptySpanM","emptySpanS","columnsXL","columnsL","columnsM","singleContainerFullSize","registry","getInstance","forEach","field","label","Label","text","required","isRequired","plugin","getPlugin","type","control","render","fieldName","addContent","__exports","__esModule"],"sources":["FormLayout.ts"],"sourcesContent":["/**\r\n * @file FormLayout.ts\r\n * @description Generates a fully responsive SAP Fiori Form layout (SimpleForm).\r\n */\r\n\r\nimport SimpleForm from \"sap/ui/layout/form/SimpleForm\";\r\nimport Label from \"sap/m/Label\";\r\nimport { IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport { PluginRegistry } from \"../core/PluginRegistry\";\r\n\r\n/**\r\n * Utility class strictly for constructing Form layouts without custom CSS.\r\n */\r\nexport class FormLayout {\r\n /**\r\n * Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.\r\n * @param fields The array of root fields to render as FormElements.\r\n * @returns A fully populated sap.ui.layout.form.SimpleForm.\r\n */\r\n public static build(fields: IFieldMetadata[]): SimpleForm {\r\n const form = new SimpleForm({\r\n editable: true,\r\n layout: \"ResponsiveGridLayout\",\r\n labelSpanXL: 4,\r\n labelSpanL: 4,\r\n labelSpanM: 4,\r\n labelSpanS: 12,\r\n adjustLabelSpan: false,\r\n emptySpanXL: 0,\r\n emptySpanL: 0,\r\n emptySpanM: 0,\r\n emptySpanS: 0,\r\n columnsXL: 1,\r\n columnsL: 1,\r\n columnsM: 1,\r\n singleContainerFullSize: false\r\n });\r\n\r\n const registry = PluginRegistry.getInstance();\r\n\r\n fields.forEach((field) => {\r\n // Respect Fiori accessibility standards by enforcing the required flag on labels\r\n const label = new Label({\r\n text: field.label,\r\n required: field.isRequired\r\n });\r\n\r\n // Instantiate the correct plugin for the data type\r\n const plugin = registry.getPlugin(field.type);\r\n \r\n // In the isolated state manager architecture, the binding path maps exactly to the fieldName.\r\n const control = plugin.render(field, `/${field.fieldName}`);\r\n\r\n form.addContent(label);\r\n form.addContent(control);\r\n });\r\n\r\n return form;\r\n }\r\n}\r\n"],"mappings":";;;QAQSA,cAAc,GAAAC,sBAAA;EAEvB;AACA;AACA;EACO,MAAMC,UAAU,CAAC;IACpB;AACJ;AACA;AACA;AACA;IACI,OAAcC,KAAKA,CAACC,MAAwB,EAAc;MACtD,MAAMC,IAAI,GAAG,IAAIC,UAAU,CAAC;QACxBC,QAAQ,EAAE,IAAI;QACdC,MAAM,EAAE,sBAAsB;QAC9BC,WAAW,EAAE,CAAC;QACdC,UAAU,EAAE,CAAC;QACbC,UAAU,EAAE,CAAC;QACbC,UAAU,EAAE,EAAE;QACdC,eAAe,EAAE,KAAK;QACtBC,WAAW,EAAE,CAAC;QACdC,UAAU,EAAE,CAAC;QACbC,UAAU,EAAE,CAAC;QACbC,UAAU,EAAE,CAAC;QACbC,SAAS,EAAE,CAAC;QACZC,QAAQ,EAAE,CAAC;QACXC,QAAQ,EAAE,CAAC;QACXC,uBAAuB,EAAE;MAC7B,CAAC,CAAC;MAEF,MAAMC,QAAQ,GAAGtB,cAAc,CAACuB,WAAW,CAAC,CAAC;MAE7CnB,MAAM,CAACoB,OAAO,CAAEC,KAAK,IAAK;QACtB;QACA,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAAC;UACpBC,IAAI,EAAEH,KAAK,CAACC,KAAK;UACjBG,QAAQ,EAAEJ,KAAK,CAACK;QACpB,CAAC,CAAC;;QAEF;QACA,MAAMC,MAAM,GAAGT,QAAQ,CAACU,SAAS,CAACP,KAAK,CAACQ,IAAI,CAAC;;QAE7C;QACA,MAAMC,OAAO,GAAGH,MAAM,CAACI,MAAM,CAACV,KAAK,EAAE,IAAIA,KAAK,CAACW,SAAS,EAAE,CAAC;QAE3D/B,IAAI,CAACgC,UAAU,CAACX,KAAK,CAAC;QACtBrB,IAAI,CAACgC,UAAU,CAACH,OAAO,CAAC;MAC5B,CAAC,CAAC;MAEF,OAAO7B,IAAI;IACf;EACJ;EAAC,IAAAiC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAApC,UAAA,GAAAA,UAAA;EAAA,OAAAoC,SAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare module "nz/co/siliconst/ui5/metaui/layouts/FormLayout" {
|
|
2
|
+
/**
|
|
3
|
+
* @file FormLayout.ts
|
|
4
|
+
* @description Generates a fully responsive SAP Fiori Form layout (SimpleForm).
|
|
5
|
+
*/
|
|
6
|
+
import SimpleForm from "sap/ui/layout/form/SimpleForm";
|
|
7
|
+
import { IFieldMetadata } from "nz/co/siliconst/ui5/metaui/interfaces/ISchema";
|
|
8
|
+
/**
|
|
9
|
+
* Utility class strictly for constructing Form layouts without custom CSS.
|
|
10
|
+
*/
|
|
11
|
+
export class FormLayout {
|
|
12
|
+
/**
|
|
13
|
+
* Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.
|
|
14
|
+
* @param fields The array of root fields to render as FormElements.
|
|
15
|
+
* @returns A fully populated sap.ui.layout.form.SimpleForm.
|
|
16
|
+
*/
|
|
17
|
+
static build(fields: IFieldMetadata[]): SimpleForm;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=FormLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormLayout.d.ts","sourceRoot":"..\\..\\..\\..\\..\\..\\..\\..","sources":["src\\nz\\co\\siliconst\\ui5\\metaui\\layouts\\FormLayout.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,+CAA+C,CAAC;IAC/D;;;OAGG;IAEH,OAAO,UAAU,MAAM,+BAA+B,CAAC;IAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;IAG/E;;OAEG;IACH,MAAa,UAAU;QACnB;;;;WAIG;eACW,KAAK,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU;KAwC5D;CAEA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
sap.ui.define(["sap/ui/layout/form/SimpleForm","sap/m/Label","../core/PluginRegistry"],function(e,n,t){"use strict";const a=t["PluginRegistry"];class l{static build(t){const l=new e({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});const s=a.getInstance();t.forEach(e=>{const t=new n({text:e.label,required:e.isRequired});const a=s.getPlugin(e.type);const o=a.render(e,`/${e.fieldName}`);l.addContent(t);l.addContent(o)});return l}}var s={__esModule:true};s.FormLayout=l;return s});
|
|
2
|
+
//# sourceMappingURL=FormLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormLayout.js","names":["PluginRegistry","___core_PluginRegistry","FormLayout","build","fields","form","SimpleForm","editable","layout","labelSpanXL","labelSpanL","labelSpanM","labelSpanS","adjustLabelSpan","emptySpanXL","emptySpanL","emptySpanM","emptySpanS","columnsXL","columnsL","columnsM","singleContainerFullSize","registry","getInstance","forEach","field","label","Label","text","required","isRequired","plugin","getPlugin","type","control","render","fieldName","addContent","__exports","__esModule"],"sources":["FormLayout.ts"],"sourcesContent":["/**\r\n * @file FormLayout.ts\r\n * @description Generates a fully responsive SAP Fiori Form layout (SimpleForm).\r\n */\r\n\r\nimport SimpleForm from \"sap/ui/layout/form/SimpleForm\";\r\nimport Label from \"sap/m/Label\";\r\nimport { IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport { PluginRegistry } from \"../core/PluginRegistry\";\r\n\r\n/**\r\n * Utility class strictly for constructing Form layouts without custom CSS.\r\n */\r\nexport class FormLayout {\r\n /**\r\n * Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.\r\n * @param fields The array of root fields to render as FormElements.\r\n * @returns A fully populated sap.ui.layout.form.SimpleForm.\r\n */\r\n public static build(fields: IFieldMetadata[]): SimpleForm {\r\n const form = new SimpleForm({\r\n editable: true,\r\n layout: \"ResponsiveGridLayout\",\r\n labelSpanXL: 4,\r\n labelSpanL: 4,\r\n labelSpanM: 4,\r\n labelSpanS: 12,\r\n adjustLabelSpan: false,\r\n emptySpanXL: 0,\r\n emptySpanL: 0,\r\n emptySpanM: 0,\r\n emptySpanS: 0,\r\n columnsXL: 1,\r\n columnsL: 1,\r\n columnsM: 1,\r\n singleContainerFullSize: false\r\n });\r\n\r\n const registry = PluginRegistry.getInstance();\r\n\r\n fields.forEach((field) => {\r\n // Respect Fiori accessibility standards by enforcing the required flag on labels\r\n const label = new Label({\r\n text: field.label,\r\n required: field.isRequired\r\n });\r\n\r\n // Instantiate the correct plugin for the data type\r\n const plugin = registry.getPlugin(field.type);\r\n \r\n // In the isolated state manager architecture, the binding path maps exactly to the fieldName.\r\n const control = plugin.render(field, `/${field.fieldName}`);\r\n\r\n form.addContent(label);\r\n form.addContent(control);\r\n });\r\n\r\n return form;\r\n }\r\n}\r\n"],"mappings":"0HAQSA,EAAcC,EAAA,kBAKhB,MAAMC,EAMT,YAAcC,CAAMC,GAChB,MAAMC,EAAO,IAAIC,EAAW,CACxBC,SAAU,KACVC,OAAQ,uBACRC,YAAa,EACbC,WAAY,EACZC,WAAY,EACZC,WAAY,GACZC,gBAAiB,MACjBC,YAAa,EACbC,WAAY,EACZC,WAAY,EACZC,WAAY,EACZC,UAAW,EACXC,SAAU,EACVC,SAAU,EACVC,wBAAyB,QAG7B,MAAMC,EAAWtB,EAAeuB,cAEhCnB,EAAOoB,QAASC,IAEZ,MAAMC,EAAQ,IAAIC,EAAM,CACpBC,KAAMH,EAAMC,MACZG,SAAUJ,EAAMK,aAIpB,MAAMC,EAAST,EAASU,UAAUP,EAAMQ,MAGxC,MAAMC,EAAUH,EAAOI,OAAOV,EAAO,IAAIA,EAAMW,aAE/C/B,EAAKgC,WAAWX,GAChBrB,EAAKgC,WAAWH,KAGpB,OAAO7B,CACX,EACH,IAAAiC,EAAA,CAAAC,WAAA,MAAAD,EAAApC,aAAA,OAAAoC,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
sap.ui.define(["sap/m/Table", "sap/m/Column", "sap/m/Text", "sap/m/ColumnListItem", "sap/m/Toolbar", "sap/m/Title", "sap/m/ToolbarSpacer", "sap/m/Button", "../core/PluginRegistry"], function (Table, Column, Text, ColumnListItem, Toolbar, Title, ToolbarSpacer, Button, ___core_PluginRegistry) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const PluginRegistry = ___core_PluginRegistry["PluginRegistry"];
|
|
5
|
+
/**
|
|
6
|
+
* Utility class strictly for constructing sap.m.Table structures with dynamic pop-in vectors.
|
|
7
|
+
*/
|
|
8
|
+
class TableLayout {
|
|
9
|
+
/**
|
|
10
|
+
* Builds a responsive Table, dynamically calculating column priorities.
|
|
11
|
+
* @param tableMeta The metadata defining the table's columns and nested fields.
|
|
12
|
+
* @returns A fully constructed sap.m.Table ready to be bound to a list array.
|
|
13
|
+
*/
|
|
14
|
+
static build(tableMeta) {
|
|
15
|
+
const table = new Table({
|
|
16
|
+
headerToolbar: new Toolbar({
|
|
17
|
+
content: [new Title({
|
|
18
|
+
text: tableMeta.label || tableMeta.tableName
|
|
19
|
+
}), new ToolbarSpacer(), new Button({
|
|
20
|
+
text: "Add Row",
|
|
21
|
+
icon: "sap-icon://add",
|
|
22
|
+
press: oEvent => {
|
|
23
|
+
const btn = oEvent.getSource();
|
|
24
|
+
const tbl = btn.getParent().getParent();
|
|
25
|
+
const model = tbl.getModel("meta");
|
|
26
|
+
const path = `/${tableMeta.tableName}`;
|
|
27
|
+
const data = model.getProperty(path) || [];
|
|
28
|
+
data.push({}); // append empty row
|
|
29
|
+
model.setProperty(path, data);
|
|
30
|
+
}
|
|
31
|
+
})]
|
|
32
|
+
}),
|
|
33
|
+
fixedLayout: false,
|
|
34
|
+
// Allows native UI5 column width calculations
|
|
35
|
+
mode: "Delete",
|
|
36
|
+
delete: oEvent => {
|
|
37
|
+
const item = oEvent.getParameter("listItem");
|
|
38
|
+
const path = item.getBindingContext("meta").getPath(); // e.g. "/Contacts/0"
|
|
39
|
+
const model = item.getModel("meta");
|
|
40
|
+
const parts = path.split("/");
|
|
41
|
+
const index = parseInt(parts.pop() || "0", 10);
|
|
42
|
+
const arrayPath = parts.join("/");
|
|
43
|
+
const data = model.getProperty(arrayPath);
|
|
44
|
+
data.splice(index, 1);
|
|
45
|
+
model.setProperty(arrayPath, data);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const templateCells = [];
|
|
49
|
+
const registry = PluginRegistry.getInstance();
|
|
50
|
+
tableMeta.fields.forEach(field => {
|
|
51
|
+
// Build the column header
|
|
52
|
+
const column = new Column({
|
|
53
|
+
header: new Text({
|
|
54
|
+
text: field.label
|
|
55
|
+
}),
|
|
56
|
+
// Fiori UX: High priority for primary keys so they don't pop-in too early
|
|
57
|
+
demandPopin: !field.isKey,
|
|
58
|
+
minScreenWidth: field.isKey ? "" : "Tablet",
|
|
59
|
+
popinDisplay: "Inline"
|
|
60
|
+
});
|
|
61
|
+
table.addColumn(column);
|
|
62
|
+
|
|
63
|
+
// Instantiate the cell template (plugin)
|
|
64
|
+
const plugin = registry.getPlugin(field.type);
|
|
65
|
+
|
|
66
|
+
// In table lists, the binding path is relative to the row's context context (e.g. "{fieldName}")
|
|
67
|
+
const control = plugin.render(field, field.fieldName);
|
|
68
|
+
templateCells.push(control);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// Create the row template and bind it to the table via the tableName array path
|
|
72
|
+
const rowTemplate = new ColumnListItem({
|
|
73
|
+
cells: templateCells
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// The absolute binding path from the StateManager for this table (using the named model 'meta')
|
|
77
|
+
table.bindItems({
|
|
78
|
+
path: `meta>/${tableMeta.tableName}`,
|
|
79
|
+
template: rowTemplate,
|
|
80
|
+
templateShareable: false
|
|
81
|
+
});
|
|
82
|
+
return table;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
var __exports = {
|
|
86
|
+
__esModule: true
|
|
87
|
+
};
|
|
88
|
+
__exports.TableLayout = TableLayout;
|
|
89
|
+
return __exports;
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=TableLayout-dbg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableLayout-dbg.js","names":["PluginRegistry","___core_PluginRegistry","TableLayout","build","tableMeta","table","Table","headerToolbar","Toolbar","content","Title","text","label","tableName","ToolbarSpacer","Button","icon","press","oEvent","btn","getSource","tbl","getParent","model","getModel","path","data","getProperty","push","setProperty","fixedLayout","mode","delete","item","getParameter","getBindingContext","getPath","parts","split","index","parseInt","pop","arrayPath","join","splice","templateCells","registry","getInstance","fields","forEach","field","column","Column","header","Text","demandPopin","isKey","minScreenWidth","popinDisplay","addColumn","plugin","getPlugin","type","control","render","fieldName","rowTemplate","ColumnListItem","cells","bindItems","template","templateShareable","__exports","__esModule"],"sources":["TableLayout.ts"],"sourcesContent":["/**\r\n * @file TableLayout.ts\r\n * @description Generates a responsive SAP Fiori Table layout.\r\n */\r\n\r\nimport Table from \"sap/m/Table\";\r\nimport Column from \"sap/m/Column\";\r\nimport Text from \"sap/m/Text\";\r\nimport ColumnListItem from \"sap/m/ColumnListItem\";\r\nimport Toolbar from \"sap/m/Toolbar\";\r\nimport Title from \"sap/m/Title\";\r\nimport ToolbarSpacer from \"sap/m/ToolbarSpacer\";\r\nimport Button from \"sap/m/Button\";\r\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\r\nimport { ITableMetadata, IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport { PluginRegistry } from \"../core/PluginRegistry\";\r\nimport Control from \"sap/ui/core/Control\";\r\n\r\n/**\r\n * Utility class strictly for constructing sap.m.Table structures with dynamic pop-in vectors.\r\n */\r\nexport class TableLayout {\r\n /**\r\n * Builds a responsive Table, dynamically calculating column priorities.\r\n * @param tableMeta The metadata defining the table's columns and nested fields.\r\n * @returns A fully constructed sap.m.Table ready to be bound to a list array.\r\n */\r\n public static build(tableMeta: ITableMetadata): Table {\r\n const table = new Table({\r\n headerToolbar: new Toolbar({\r\n content: [\r\n new Title({ text: tableMeta.label || tableMeta.tableName }),\r\n new ToolbarSpacer(),\r\n new Button({\r\n text: \"Add Row\",\r\n icon: \"sap-icon://add\",\r\n press: (oEvent: any) => {\r\n const btn = oEvent.getSource();\r\n const tbl = btn.getParent().getParent() as Table;\r\n const model = tbl.getModel(\"meta\") as JSONModel;\r\n const path = `/${tableMeta.tableName}`;\r\n const data = model.getProperty(path) || [];\r\n data.push({}); // append empty row\r\n model.setProperty(path, data);\r\n }\r\n })\r\n ]\r\n }),\r\n fixedLayout: false, // Allows native UI5 column width calculations\r\n mode: \"Delete\",\r\n delete: (oEvent: any) => {\r\n const item = oEvent.getParameter(\"listItem\");\r\n const path = item.getBindingContext(\"meta\").getPath(); // e.g. \"/Contacts/0\"\r\n const model = item.getModel(\"meta\") as JSONModel;\r\n \r\n const parts = path.split(\"/\");\r\n const index = parseInt(parts.pop() || \"0\", 10);\r\n const arrayPath = parts.join(\"/\");\r\n \r\n const data = model.getProperty(arrayPath);\r\n data.splice(index, 1);\r\n model.setProperty(arrayPath, data);\r\n }\r\n });\r\n\r\n const templateCells: Control[] = [];\r\n const registry = PluginRegistry.getInstance();\r\n\r\n tableMeta.fields.forEach((field: IFieldMetadata) => {\r\n // Build the column header\r\n const column = new Column({\r\n header: new Text({ text: field.label }),\r\n // Fiori UX: High priority for primary keys so they don't pop-in too early\r\n demandPopin: !field.isKey, \r\n minScreenWidth: field.isKey ? \"\" : \"Tablet\",\r\n popinDisplay: \"Inline\"\r\n });\r\n table.addColumn(column);\r\n\r\n // Instantiate the cell template (plugin)\r\n const plugin = registry.getPlugin(field.type);\r\n \r\n // In table lists, the binding path is relative to the row's context context (e.g. \"{fieldName}\")\r\n const control = plugin.render(field, field.fieldName);\r\n templateCells.push(control);\r\n });\r\n\r\n // Create the row template and bind it to the table via the tableName array path\r\n const rowTemplate = new ColumnListItem({\r\n cells: templateCells\r\n });\r\n\r\n // The absolute binding path from the StateManager for this table (using the named model 'meta')\r\n table.bindItems({\r\n path: `meta>/${tableMeta.tableName}`,\r\n template: rowTemplate,\r\n templateShareable: false\r\n });\r\n\r\n return table;\r\n }\r\n}\r\n"],"mappings":";;;QAeSA,cAAc,GAAAC,sBAAA;EAGvB;AACA;AACA;EACO,MAAMC,WAAW,CAAC;IACrB;AACJ;AACA;AACA;AACA;IACI,OAAcC,KAAKA,CAACC,SAAyB,EAAS;MAClD,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAAC;QACpBC,aAAa,EAAE,IAAIC,OAAO,CAAC;UACvBC,OAAO,EAAE,CACL,IAAIC,KAAK,CAAC;YAAEC,IAAI,EAAEP,SAAS,CAACQ,KAAK,IAAIR,SAAS,CAACS;UAAU,CAAC,CAAC,EAC3D,IAAIC,aAAa,CAAC,CAAC,EACnB,IAAIC,MAAM,CAAC;YACPJ,IAAI,EAAE,SAAS;YACfK,IAAI,EAAE,gBAAgB;YACtBC,KAAK,EAAGC,MAAW,IAAK;cACpB,MAAMC,GAAG,GAAGD,MAAM,CAACE,SAAS,CAAC,CAAC;cAC9B,MAAMC,GAAG,GAAGF,GAAG,CAACG,SAAS,CAAC,CAAC,CAACA,SAAS,CAAC,CAAU;cAChD,MAAMC,KAAK,GAAGF,GAAG,CAACG,QAAQ,CAAC,MAAM,CAAc;cAC/C,MAAMC,IAAI,GAAG,IAAIrB,SAAS,CAACS,SAAS,EAAE;cACtC,MAAMa,IAAI,GAAGH,KAAK,CAACI,WAAW,CAACF,IAAI,CAAC,IAAI,EAAE;cAC1CC,IAAI,CAACE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;cACfL,KAAK,CAACM,WAAW,CAACJ,IAAI,EAAEC,IAAI,CAAC;YACjC;UACJ,CAAC,CAAC;QAEV,CAAC,CAAC;QACFI,WAAW,EAAE,KAAK;QAAE;QACpBC,IAAI,EAAE,QAAQ;QACdC,MAAM,EAAGd,MAAW,IAAK;UACrB,MAAMe,IAAI,GAAGf,MAAM,CAACgB,YAAY,CAAC,UAAU,CAAC;UAC5C,MAAMT,IAAI,GAAGQ,IAAI,CAACE,iBAAiB,CAAC,MAAM,CAAC,CAACC,OAAO,CAAC,CAAC,CAAC,CAAC;UACvD,MAAMb,KAAK,GAAGU,IAAI,CAACT,QAAQ,CAAC,MAAM,CAAc;UAEhD,MAAMa,KAAK,GAAGZ,IAAI,CAACa,KAAK,CAAC,GAAG,CAAC;UAC7B,MAAMC,KAAK,GAAGC,QAAQ,CAACH,KAAK,CAACI,GAAG,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC;UAC9C,MAAMC,SAAS,GAAGL,KAAK,CAACM,IAAI,CAAC,GAAG,CAAC;UAEjC,MAAMjB,IAAI,GAAGH,KAAK,CAACI,WAAW,CAACe,SAAS,CAAC;UACzChB,IAAI,CAACkB,MAAM,CAACL,KAAK,EAAE,CAAC,CAAC;UACrBhB,KAAK,CAACM,WAAW,CAACa,SAAS,EAAEhB,IAAI,CAAC;QACtC;MACJ,CAAC,CAAC;MAEF,MAAMmB,aAAwB,GAAG,EAAE;MACnC,MAAMC,QAAQ,GAAG9C,cAAc,CAAC+C,WAAW,CAAC,CAAC;MAE7C3C,SAAS,CAAC4C,MAAM,CAACC,OAAO,CAAEC,KAAqB,IAAK;QAChD;QACA,MAAMC,MAAM,GAAG,IAAIC,MAAM,CAAC;UACtBC,MAAM,EAAE,IAAIC,IAAI,CAAC;YAAE3C,IAAI,EAAEuC,KAAK,CAACtC;UAAM,CAAC,CAAC;UACvC;UACA2C,WAAW,EAAE,CAACL,KAAK,CAACM,KAAK;UACzBC,cAAc,EAAEP,KAAK,CAACM,KAAK,GAAG,EAAE,GAAG,QAAQ;UAC3CE,YAAY,EAAE;QAClB,CAAC,CAAC;QACFrD,KAAK,CAACsD,SAAS,CAACR,MAAM,CAAC;;QAEvB;QACA,MAAMS,MAAM,GAAGd,QAAQ,CAACe,SAAS,CAACX,KAAK,CAACY,IAAI,CAAC;;QAE7C;QACA,MAAMC,OAAO,GAAGH,MAAM,CAACI,MAAM,CAACd,KAAK,EAAEA,KAAK,CAACe,SAAS,CAAC;QACrDpB,aAAa,CAACjB,IAAI,CAACmC,OAAO,CAAC;MAC/B,CAAC,CAAC;;MAEF;MACA,MAAMG,WAAW,GAAG,IAAIC,cAAc,CAAC;QACnCC,KAAK,EAAEvB;MACX,CAAC,CAAC;;MAEF;MACAxC,KAAK,CAACgE,SAAS,CAAC;QACZ5C,IAAI,EAAE,SAASrB,SAAS,CAACS,SAAS,EAAE;QACpCyD,QAAQ,EAAEJ,WAAW;QACrBK,iBAAiB,EAAE;MACvB,CAAC,CAAC;MAEF,OAAOlE,KAAK;IAChB;EACJ;EAAC,IAAAmE,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAtE,WAAA,GAAAA,WAAA;EAAA,OAAAsE,SAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare module "nz/co/siliconst/ui5/metaui/layouts/TableLayout" {
|
|
2
|
+
/**
|
|
3
|
+
* @file TableLayout.ts
|
|
4
|
+
* @description Generates a responsive SAP Fiori Table layout.
|
|
5
|
+
*/
|
|
6
|
+
import Table from "sap/m/Table";
|
|
7
|
+
import { ITableMetadata } from "nz/co/siliconst/ui5/metaui/interfaces/ISchema";
|
|
8
|
+
/**
|
|
9
|
+
* Utility class strictly for constructing sap.m.Table structures with dynamic pop-in vectors.
|
|
10
|
+
*/
|
|
11
|
+
export class TableLayout {
|
|
12
|
+
/**
|
|
13
|
+
* Builds a responsive Table, dynamically calculating column priorities.
|
|
14
|
+
* @param tableMeta The metadata defining the table's columns and nested fields.
|
|
15
|
+
* @returns A fully constructed sap.m.Table ready to be bound to a list array.
|
|
16
|
+
*/
|
|
17
|
+
static build(tableMeta: ITableMetadata): Table;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=TableLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableLayout.d.ts","sourceRoot":"..\\..\\..\\..\\..\\..\\..\\..","sources":["src\\nz\\co\\siliconst\\ui5\\metaui\\layouts\\TableLayout.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gDAAgD,CAAC;IAChE;;;OAGG;IAEH,OAAO,KAAK,MAAM,aAAa,CAAC;IAShC,OAAO,EAAE,cAAc,EAAkB,MAAM,+CAA+C,CAAC;IAI/F;;OAEG;IACH,MAAa,WAAW;QACpB;;;;WAIG;eACW,KAAK,CAAC,SAAS,EAAE,cAAc,GAAG,KAAK;KA0ExD;CAEA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
sap.ui.define(["sap/m/Table","sap/m/Column","sap/m/Text","sap/m/ColumnListItem","sap/m/Toolbar","sap/m/Title","sap/m/ToolbarSpacer","sap/m/Button","../core/PluginRegistry"],function(e,t,n,s,a,o,l,r,c){"use strict";const i=c["PluginRegistry"];class p{static build(c){const p=new e({headerToolbar:new a({content:[new o({text:c.label||c.tableName}),new l,new r({text:"Add Row",icon:"sap-icon://add",press:e=>{const t=e.getSource();const n=t.getParent().getParent();const s=n.getModel("meta");const a=`/${c.tableName}`;const o=s.getProperty(a)||[];o.push({});s.setProperty(a,o)}})]}),fixedLayout:false,mode:"Delete",delete:e=>{const t=e.getParameter("listItem");const n=t.getBindingContext("meta").getPath();const s=t.getModel("meta");const a=n.split("/");const o=parseInt(a.pop()||"0",10);const l=a.join("/");const r=s.getProperty(l);r.splice(o,1);s.setProperty(l,r)}});const m=[];const d=i.getInstance();c.fields.forEach(e=>{const s=new t({header:new n({text:e.label}),demandPopin:!e.isKey,minScreenWidth:e.isKey?"":"Tablet",popinDisplay:"Inline"});p.addColumn(s);const a=d.getPlugin(e.type);const o=a.render(e,e.fieldName);m.push(o)});const u=new s({cells:m});p.bindItems({path:`meta>/${c.tableName}`,template:u,templateShareable:false});return p}}var m={__esModule:true};m.TableLayout=p;return m});
|
|
2
|
+
//# sourceMappingURL=TableLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableLayout.js","names":["PluginRegistry","___core_PluginRegistry","TableLayout","build","tableMeta","table","Table","headerToolbar","Toolbar","content","Title","text","label","tableName","ToolbarSpacer","Button","icon","press","oEvent","btn","getSource","tbl","getParent","model","getModel","path","data","getProperty","push","setProperty","fixedLayout","mode","delete","item","getParameter","getBindingContext","getPath","parts","split","index","parseInt","pop","arrayPath","join","splice","templateCells","registry","getInstance","fields","forEach","field","column","Column","header","Text","demandPopin","isKey","minScreenWidth","popinDisplay","addColumn","plugin","getPlugin","type","control","render","fieldName","rowTemplate","ColumnListItem","cells","bindItems","template","templateShareable","__exports","__esModule"],"sources":["TableLayout.ts"],"sourcesContent":["/**\r\n * @file TableLayout.ts\r\n * @description Generates a responsive SAP Fiori Table layout.\r\n */\r\n\r\nimport Table from \"sap/m/Table\";\r\nimport Column from \"sap/m/Column\";\r\nimport Text from \"sap/m/Text\";\r\nimport ColumnListItem from \"sap/m/ColumnListItem\";\r\nimport Toolbar from \"sap/m/Toolbar\";\r\nimport Title from \"sap/m/Title\";\r\nimport ToolbarSpacer from \"sap/m/ToolbarSpacer\";\r\nimport Button from \"sap/m/Button\";\r\nimport JSONModel from \"sap/ui/model/json/JSONModel\";\r\nimport { ITableMetadata, IFieldMetadata } from \"../interfaces/ISchema\";\r\nimport { PluginRegistry } from \"../core/PluginRegistry\";\r\nimport Control from \"sap/ui/core/Control\";\r\n\r\n/**\r\n * Utility class strictly for constructing sap.m.Table structures with dynamic pop-in vectors.\r\n */\r\nexport class TableLayout {\r\n /**\r\n * Builds a responsive Table, dynamically calculating column priorities.\r\n * @param tableMeta The metadata defining the table's columns and nested fields.\r\n * @returns A fully constructed sap.m.Table ready to be bound to a list array.\r\n */\r\n public static build(tableMeta: ITableMetadata): Table {\r\n const table = new Table({\r\n headerToolbar: new Toolbar({\r\n content: [\r\n new Title({ text: tableMeta.label || tableMeta.tableName }),\r\n new ToolbarSpacer(),\r\n new Button({\r\n text: \"Add Row\",\r\n icon: \"sap-icon://add\",\r\n press: (oEvent: any) => {\r\n const btn = oEvent.getSource();\r\n const tbl = btn.getParent().getParent() as Table;\r\n const model = tbl.getModel(\"meta\") as JSONModel;\r\n const path = `/${tableMeta.tableName}`;\r\n const data = model.getProperty(path) || [];\r\n data.push({}); // append empty row\r\n model.setProperty(path, data);\r\n }\r\n })\r\n ]\r\n }),\r\n fixedLayout: false, // Allows native UI5 column width calculations\r\n mode: \"Delete\",\r\n delete: (oEvent: any) => {\r\n const item = oEvent.getParameter(\"listItem\");\r\n const path = item.getBindingContext(\"meta\").getPath(); // e.g. \"/Contacts/0\"\r\n const model = item.getModel(\"meta\") as JSONModel;\r\n \r\n const parts = path.split(\"/\");\r\n const index = parseInt(parts.pop() || \"0\", 10);\r\n const arrayPath = parts.join(\"/\");\r\n \r\n const data = model.getProperty(arrayPath);\r\n data.splice(index, 1);\r\n model.setProperty(arrayPath, data);\r\n }\r\n });\r\n\r\n const templateCells: Control[] = [];\r\n const registry = PluginRegistry.getInstance();\r\n\r\n tableMeta.fields.forEach((field: IFieldMetadata) => {\r\n // Build the column header\r\n const column = new Column({\r\n header: new Text({ text: field.label }),\r\n // Fiori UX: High priority for primary keys so they don't pop-in too early\r\n demandPopin: !field.isKey, \r\n minScreenWidth: field.isKey ? \"\" : \"Tablet\",\r\n popinDisplay: \"Inline\"\r\n });\r\n table.addColumn(column);\r\n\r\n // Instantiate the cell template (plugin)\r\n const plugin = registry.getPlugin(field.type);\r\n \r\n // In table lists, the binding path is relative to the row's context context (e.g. \"{fieldName}\")\r\n const control = plugin.render(field, field.fieldName);\r\n templateCells.push(control);\r\n });\r\n\r\n // Create the row template and bind it to the table via the tableName array path\r\n const rowTemplate = new ColumnListItem({\r\n cells: templateCells\r\n });\r\n\r\n // The absolute binding path from the StateManager for this table (using the named model 'meta')\r\n table.bindItems({\r\n path: `meta>/${tableMeta.tableName}`,\r\n template: rowTemplate,\r\n templateShareable: false\r\n });\r\n\r\n return table;\r\n }\r\n}\r\n"],"mappings":"4NAeSA,EAAcC,EAAA,kBAMhB,MAAMC,EAMT,YAAcC,CAAMC,GAChB,MAAMC,EAAQ,IAAIC,EAAM,CACpBC,cAAe,IAAIC,EAAQ,CACvBC,QAAS,CACL,IAAIC,EAAM,CAAEC,KAAMP,EAAUQ,OAASR,EAAUS,YAC/C,IAAIC,EACJ,IAAIC,EAAO,CACPJ,KAAM,UACNK,KAAM,iBACNC,MAAQC,IACJ,MAAMC,EAAMD,EAAOE,YACnB,MAAMC,EAAMF,EAAIG,YAAYA,YAC5B,MAAMC,EAAQF,EAAIG,SAAS,QAC3B,MAAMC,EAAO,IAAIrB,EAAUS,YAC3B,MAAMa,EAAOH,EAAMI,YAAYF,IAAS,GACxCC,EAAKE,KAAK,CAAC,GACXL,EAAMM,YAAYJ,EAAMC,SAKxCI,YAAa,MACbC,KAAM,SACNC,OAASd,IACL,MAAMe,EAAOf,EAAOgB,aAAa,YACjC,MAAMT,EAAOQ,EAAKE,kBAAkB,QAAQC,UAC5C,MAAMb,EAAQU,EAAKT,SAAS,QAE5B,MAAMa,EAAQZ,EAAKa,MAAM,KACzB,MAAMC,EAAQC,SAASH,EAAMI,OAAS,IAAK,IAC3C,MAAMC,EAAYL,EAAMM,KAAK,KAE7B,MAAMjB,EAAOH,EAAMI,YAAYe,GAC/BhB,EAAKkB,OAAOL,EAAO,GACnBhB,EAAMM,YAAYa,EAAWhB,MAIrC,MAAMmB,EAA2B,GACjC,MAAMC,EAAW9C,EAAe+C,cAEhC3C,EAAU4C,OAAOC,QAASC,IAEtB,MAAMC,EAAS,IAAIC,EAAO,CACtBC,OAAQ,IAAIC,EAAK,CAAE3C,KAAMuC,EAAMtC,QAE/B2C,aAAcL,EAAMM,MACpBC,eAAgBP,EAAMM,MAAQ,GAAK,SACnCE,aAAc,WAElBrD,EAAMsD,UAAUR,GAGhB,MAAMS,EAASd,EAASe,UAAUX,EAAMY,MAGxC,MAAMC,EAAUH,EAAOI,OAAOd,EAAOA,EAAMe,WAC3CpB,EAAcjB,KAAKmC,KAIvB,MAAMG,EAAc,IAAIC,EAAe,CACnCC,MAAOvB,IAIXxC,EAAMgE,UAAU,CACZ5C,KAAM,SAASrB,EAAUS,YACzByD,SAAUJ,EACVK,kBAAmB,QAGvB,OAAOlE,CACX,EACH,IAAAmE,EAAA,CAAAC,WAAA,MAAAD,EAAAtE,cAAA,OAAAsE,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
sap.ui.define(["sap/ui/core/Core", "./core/PluginRegistry", "./plugins/StringPlugin", "./plugins/NumberPlugin", "./plugins/BooleanPlugin", "./plugins/DropdownPlugin", "./plugins/DatePlugin"], function (Core, ___core_PluginRegistry, ___plugins_StringPlugin, ___plugins_NumberPlugin, ___plugins_BooleanPlugin, ___plugins_DropdownPlugin, ___plugins_DatePlugin) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const PluginRegistry = ___core_PluginRegistry["PluginRegistry"];
|
|
5
|
+
const StringPlugin = ___plugins_StringPlugin["StringPlugin"];
|
|
6
|
+
const NumberPlugin = ___plugins_NumberPlugin["NumberPlugin"];
|
|
7
|
+
const BooleanPlugin = ___plugins_BooleanPlugin["BooleanPlugin"];
|
|
8
|
+
const DropdownPlugin = ___plugins_DropdownPlugin["DropdownPlugin"];
|
|
9
|
+
const DatePlugin = ___plugins_DatePlugin["DatePlugin"]; // Delegate to standard library registration
|
|
10
|
+
Core.initLibrary({
|
|
11
|
+
name: "nz.co.siliconst.ui5.metaui",
|
|
12
|
+
version: "1.0.0",
|
|
13
|
+
dependencies: ["sap.ui.core", "sap.m", "sap.ui.layout", "sap.ui.table"],
|
|
14
|
+
controls: ["nz.co.siliconst.ui5.metaui.controls.GeneratorHost"],
|
|
15
|
+
elements: [],
|
|
16
|
+
interfaces: []
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Global Bootstrapper: Maps all standard primitive types to their respective plugins.
|
|
21
|
+
*/
|
|
22
|
+
const registry = PluginRegistry.getInstance();
|
|
23
|
+
registry.register("string", StringPlugin);
|
|
24
|
+
registry.register("number", NumberPlugin);
|
|
25
|
+
registry.register("boolean", BooleanPlugin);
|
|
26
|
+
registry.register("dropdown", DropdownPlugin);
|
|
27
|
+
registry.register("date", DatePlugin);
|
|
28
|
+
|
|
29
|
+
// Exporting window object safely for UI5 compatibility if needed
|
|
30
|
+
var __exports = window["nz"]["co"]["siliconst"]["ui5"]["metaui"];
|
|
31
|
+
return __exports;
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=library-dbg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-dbg.js","names":["PluginRegistry","___core_PluginRegistry","StringPlugin","___plugins_StringPlugin","NumberPlugin","___plugins_NumberPlugin","BooleanPlugin","___plugins_BooleanPlugin","DropdownPlugin","___plugins_DropdownPlugin","DatePlugin","___plugins_DatePlugin","Core","initLibrary","name","version","dependencies","controls","elements","interfaces","registry","getInstance","register","__exports","window"],"sources":["library.ts"],"sourcesContent":["/**\r\n * @file library.ts\r\n * @description Standard SAP UI5 library registration file. Exposes the MetaUI namespace \r\n * and automatically bootstraps the internal PluginRegistry.\r\n */\r\n\r\nimport Core from \"sap/ui/core/Core\";\r\nimport { PluginRegistry } from \"./core/PluginRegistry\";\r\nimport { StringPlugin } from \"./plugins/StringPlugin\";\r\nimport { NumberPlugin } from \"./plugins/NumberPlugin\";\r\nimport { BooleanPlugin } from \"./plugins/BooleanPlugin\";\r\nimport { DropdownPlugin } from \"./plugins/DropdownPlugin\";\r\nimport { DatePlugin } from \"./plugins/DatePlugin\";\r\n\r\n// Delegate to standard library registration\r\nCore.initLibrary({\r\n name: \"nz.co.siliconst.ui5.metaui\",\r\n version: \"1.0.0\",\r\n dependencies: [\r\n \"sap.ui.core\",\r\n \"sap.m\",\r\n \"sap.ui.layout\",\r\n \"sap.ui.table\"\r\n ],\r\n controls: [\r\n \"nz.co.siliconst.ui5.metaui.controls.GeneratorHost\"\r\n ],\r\n elements: [],\r\n interfaces: []\r\n});\r\n\r\n/**\r\n * Global Bootstrapper: Maps all standard primitive types to their respective plugins.\r\n */\r\nconst registry = PluginRegistry.getInstance();\r\nregistry.register(\"string\", StringPlugin);\r\nregistry.register(\"number\", NumberPlugin);\r\nregistry.register(\"boolean\", BooleanPlugin);\r\nregistry.register(\"dropdown\", DropdownPlugin);\r\nregistry.register(\"date\", DatePlugin);\r\n\r\n// Exporting window object safely for UI5 compatibility if needed\r\nexport default (window as any)[\"nz\"][\"co\"][\"siliconst\"][\"ui5\"][\"metaui\"];\r\n"],"mappings":";;;QAOSA,cAAc,GAAAC,sBAAA;EAAA,MACdC,YAAY,GAAAC,uBAAA;EAAA,MACZC,YAAY,GAAAC,uBAAA;EAAA,MACZC,aAAa,GAAAC,wBAAA;EAAA,MACbC,cAAc,GAAAC,yBAAA;EAAA,MACdC,UAAU,GAAAC,qBAAA,gBAEnB;EACAC,IAAI,CAACC,WAAW,CAAC;IACbC,IAAI,EAAE,4BAA4B;IAClCC,OAAO,EAAE,OAAO;IAChBC,YAAY,EAAE,CACV,aAAa,EACb,OAAO,EACP,eAAe,EACf,cAAc,CACjB;IACDC,QAAQ,EAAE,CACN,mDAAmD,CACtD;IACDC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EAChB,CAAC,CAAC;;EAEF;AACA;AACA;EACA,MAAMC,QAAQ,GAAGpB,cAAc,CAACqB,WAAW,CAAC,CAAC;EAC7CD,QAAQ,CAACE,QAAQ,CAAC,QAAQ,EAAEpB,YAAY,CAAC;EACzCkB,QAAQ,CAACE,QAAQ,CAAC,QAAQ,EAAElB,YAAY,CAAC;EACzCgB,QAAQ,CAACE,QAAQ,CAAC,SAAS,EAAEhB,aAAa,CAAC;EAC3Cc,QAAQ,CAACE,QAAQ,CAAC,UAAU,EAAEd,cAAc,CAAC;EAC7CY,QAAQ,CAACE,QAAQ,CAAC,MAAM,EAAEZ,UAAU,CAAC;;EAErC;EAAA,IAAAa,SAAA,GACgBC,MAAM,CAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;EAAA,OAAAD,SAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//@ui5-bundle nz/co/siliconst/ui5/metaui/library-preload.js
|
|
2
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/controls/GeneratorHost", ["sap/ui/core/Control","sap/m/Dialog","sap/m/Button","../core/SchemaNormalizer","../core/Engine","../core/StateManager","../layouts/BaseLayout"],function(t,e,n,i,a,o,s){"use strict";const r=i["SchemaNormalizer"];const c=a["Engine"];const l=o["StateManager"];const g=s["BaseLayout"];const h=t.extend("nz.co.siliconst.ui5.metaui.controls.GeneratorHost",{constructor:function e(){t.prototype.constructor.apply(this,arguments);this.stateManager=null;this.generatedContent=null},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:"object",defaultValue:null},initialData:{type:"object",defaultValue:{}}},aggregations:{_content:{type:"sap.ui.core.Control",multiple:false,visibility:"hidden"}},events:{submit:{parameters:{payload:{type:"object"}}},cancel:{}}},init:function e(){t.prototype.init.call(this)},onBeforeRendering:function t(){if(!this.generatedContent&&this.getProperty("schemaDefinition")){this.generate()}},triggerSubmit:function t(){if(this.stateManager){const t=this.stateManager.extractPayload();this.fireEvent("submit",{payload:t})}},generate:function t(){const e=this.getProperty("schemaDefinition");const n=this.getProperty("initialData");if(!e){throw new Error("[MetaUI] Cannot generate layout without a schemaDefinition.")}const i=r.normalize(e);this.stateManager=new l(n);this.setModel(this.stateManager.getModel(),"meta");const a=new c;const o=new g;this.generatedContent=a.build(i,o);this.setAggregation("_content",this.generatedContent)},openInDialog:function t(i="Dynamic Form",a="Save"){if(!this.generatedContent){this.generate()}const o=new e({title:i,contentWidth:"800px",content:[this],beginButton:new n({text:a,type:"Emphasized",press:()=>{if(this.stateManager){const t=this.stateManager.extractPayload();this.fireEvent("submit",{payload:t})}o.close()}}),endButton:new n({text:"Cancel",press:()=>{this.fireEvent("cancel");o.close()}}),afterClose:()=>{o.destroy()}});o.open()}});return h});
|
|
3
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/ConditionEngine", ["./EventBus"],function(e){"use strict";const i=e["EventBus"];class n{constructor(e){this.schema=e;this.initializeListeners()}initializeListeners(){i.getInstance().subscribe(this.handleEvent.bind(this))}handleEvent(e){}}var t={__esModule:true};t.ConditionEngine=n;return t});
|
|
4
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/Engine", ["./ConditionEngine","sap/m/VBox"],function(e,n){"use strict";const t=e["ConditionEngine"];class r{conditionEngine=null;build(e,r){this.conditionEngine=new t(e);if(e.mode==="form"){return r.renderForm(e)}else if(e.mode==="table"){if(!e.tables||e.tables.length===0){throw new Error("[MetaUI] Table mode requires at least one table definition.")}return r.renderTable(e.tables[0])}else if(e.mode==="mixed"){const t=new n({renderType:"Bare"});if(e.rootFields&&e.rootFields.length>0){t.addItem(r.renderForm(e))}if(e.tables&&e.tables.length>0){e.tables.forEach(e=>{t.addItem(r.renderTable(e))})}return t}throw new Error(`[MetaUI] Mode '${e.mode}' is not yet implemented or invalid.`)}}var i={__esModule:true};i.Engine=r;return i});
|
|
5
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/EventBus", [],function(){"use strict";class s{listeners=[];constructor(){}static getInstance(){if(!s.instance){s.instance=new s}return s.instance}publishFieldChange(s){this.listeners.forEach(e=>e(s))}subscribe(s){this.listeners.push(s)}}var e={__esModule:true};e.EventBus=s;return e});
|
|
6
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/PluginRegistry", [],function(){"use strict";class e{plugins=new Map;constructor(){}static getInstance(){if(!e.instance){e.instance=new e}return e.instance}register(e,t){this.plugins.set(e,t)}getPlugin(e){const t=this.plugins.get(e);if(!t){throw new Error(`[MetaUI] No plugin registered for FieldType: ${e}`)}return new t}}var t={__esModule:true};t.PluginRegistry=e;return t});
|
|
7
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/SchemaNormalizer", [],function(){"use strict";class e{static normalize(e){if(!e||typeof e!=="object"){throw new Error("[MetaUI] Invalid Schema Payload: Payload is not an object.")}if(!e.mode||!e.rootFields||!e.tables){throw new Error("[MetaUI] Invalid Schema Payload: Missing required structures (mode, rootFields, tables).")}return e}}var r={__esModule:true};r.SchemaNormalizer=e;return r});
|
|
8
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/core/StateManager", ["sap/ui/model/json/JSONModel"],function(e){"use strict";class t{constructor(t={}){const o=JSON.parse(JSON.stringify(t));this.model=new e(o);this.model.setDefaultBindingMode("TwoWay")}getModel(){return this.model}bindControl(e,t,o){e.bindProperty(t,{path:o,model:"meta"})}extractPayload(){const e=this.model.getData();return JSON.parse(JSON.stringify(e))}}var o={__esModule:true};o.StateManager=t;return o});
|
|
9
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/layouts/BaseLayout", ["./FormLayout","./TableLayout"],function(e,r){"use strict";const t=e["FormLayout"];const u=r["TableLayout"];class o{renderForm(e){return t.build(e.rootFields)}renderTable(e){return u.build(e)}}var a={__esModule:true};a.BaseLayout=o;return a});
|
|
10
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/layouts/FormLayout", ["sap/ui/layout/form/SimpleForm","sap/m/Label","../core/PluginRegistry"],function(e,n,t){"use strict";const a=t["PluginRegistry"];class l{static build(t){const l=new e({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});const s=a.getInstance();t.forEach(e=>{const t=new n({text:e.label,required:e.isRequired});const a=s.getPlugin(e.type);const o=a.render(e,`/${e.fieldName}`);l.addContent(t);l.addContent(o)});return l}}var s={__esModule:true};s.FormLayout=l;return s});
|
|
11
|
+
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/PluginRegistry"],function(e,t,n,s,a,o,l,r,c){"use strict";const i=c["PluginRegistry"];class p{static build(c){const p=new e({headerToolbar:new a({content:[new o({text:c.label||c.tableName}),new l,new r({text:"Add Row",icon:"sap-icon://add",press:e=>{const t=e.getSource();const n=t.getParent().getParent();const s=n.getModel("meta");const a=`/${c.tableName}`;const o=s.getProperty(a)||[];o.push({});s.setProperty(a,o)}})]}),fixedLayout:false,mode:"Delete",delete:e=>{const t=e.getParameter("listItem");const n=t.getBindingContext("meta").getPath();const s=t.getModel("meta");const a=n.split("/");const o=parseInt(a.pop()||"0",10);const l=a.join("/");const r=s.getProperty(l);r.splice(o,1);s.setProperty(l,r)}});const m=[];const d=i.getInstance();c.fields.forEach(e=>{const s=new t({header:new n({text:e.label}),demandPopin:!e.isKey,minScreenWidth:e.isKey?"":"Tablet",popinDisplay:"Inline"});p.addColumn(s);const a=d.getPlugin(e.type);const o=a.render(e,e.fieldName);m.push(o)});const u=new s({cells:m});p.bindItems({path:`meta>/${c.tableName}`,template:u,templateShareable:false});return p}}var m={__esModule:true};m.TableLayout=p;return m});
|
|
12
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/library", ["sap/ui/core/Core","./core/PluginRegistry","./plugins/StringPlugin","./plugins/NumberPlugin","./plugins/BooleanPlugin","./plugins/DropdownPlugin","./plugins/DatePlugin"],function(n,i,e,s,t,o,r){"use strict";const u=i["PluginRegistry"];const g=e["StringPlugin"];const l=s["NumberPlugin"];const a=t["BooleanPlugin"];const c=o["DropdownPlugin"];const p=r["DatePlugin"];n.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.GeneratorHost"],elements:[],interfaces:[]});const P=u.getInstance();P.register("string",g);P.register("number",l);P.register("boolean",a);P.register("dropdown",c);P.register("date",p);var d=window["nz"]["co"]["siliconst"]["ui5"]["metaui"];return d});
|
|
13
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/BasePlugin", ["../core/EventBus"],function(e){"use strict";const t=e["EventBus"];class a{control=null;metadata=null;onStateChange(e){this.metadata=e;this.applyState()}publishChange(e){if(this.metadata){t.getInstance().publishFieldChange({fieldName:this.metadata.fieldName,newValue:e})}}}var n={__esModule:true};n.BasePlugin=a;return n});
|
|
14
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin", ["./BasePlugin","sap/m/Switch"],function(t,e){"use strict";const a=t["BasePlugin"];class s extends a{render(t,a){this.metadata=t;this.control=new e({state:`{meta>${a}}`,enabled:!t.isReadOnly,change:t=>{const e=t.getParameter("state");this.publishChange(e);this.validate()}});return this.control}validate(){return true}applyState(){if(this.control&&this.metadata){const t=this.control;t.setEnabled(!this.metadata.isReadOnly)}}}var n={__esModule:true};n.BooleanPlugin=s;return n});
|
|
15
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/DatePlugin", ["./BasePlugin","sap/m/DatePicker"],function(t,e){"use strict";const a=t["BasePlugin"];class i extends a{render(t,a){this.metadata=t;this.control=new e({value:`{meta>${a}}`,valueFormat:"yyyy-MM-dd",displayFormat:"long",editable:!t.isReadOnly,required:t.isRequired,change:t=>{const e=t.getParameter("value");this.publishChange(e);this.validate()}});return this.control}validate(){if(!this.control||!this.metadata)return true;const t=this.control;const e=t.isValidValue();const a=t.getValue();if(this.metadata.isRequired&&(!a||a.trim()==="")){t.setValueState("Error");t.setValueStateText("A valid date is required.");return false}if(a&&!e){t.setValueState("Error");t.setValueStateText("Invalid date format.");return false}t.setValueState("None");return true}applyState(){if(this.control&&this.metadata){const t=this.control;t.setEditable(!this.metadata.isReadOnly);t.setRequired(this.metadata.isRequired)}}}var s={__esModule:true};s.DatePlugin=i;return s});
|
|
16
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin", ["./BasePlugin","sap/m/Select","sap/ui/core/Item"],function(e,t,a){"use strict";const s=e["BasePlugin"];class i extends s{render(e,s){this.metadata=e;const i=new t({selectedKey:`{meta>${s}}`,enabled:!e.isReadOnly,change:e=>{const t=e.getParameter("selectedItem");const a=t?t.getKey():"";this.publishChange(a);this.validate()}});if(e.valueHelp&&Array.isArray(e.valueHelp)){if(!e.isRequired){i.addItem(new a({key:"",text:"--- Select ---"}))}e.valueHelp.forEach(e=>{i.addItem(new a({key:e.key,text:e.text}))})}this.control=i;return this.control}validate(){if(!this.control||!this.metadata)return true;const e=this.control;const t=e.getSelectedKey();if(this.metadata.isRequired&&(!t||t.trim()==="")){e.setValueState("Error");e.setValueStateText("Selection is required.");return false}e.setValueState("None");return true}applyState(){if(this.control&&this.metadata){const e=this.control;e.setEnabled(!this.metadata.isReadOnly)}}}var r={__esModule:true};r.DropdownPlugin=i;return r});
|
|
17
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/NumberPlugin", ["./BasePlugin","sap/m/StepInput"],function(e,t){"use strict";const a=e["BasePlugin"];class i extends a{render(e,a){this.metadata=e;this.control=new t({value:`{meta>${a}}`,displayValuePrecision:e.scale||0,editable:!e.isReadOnly,required:e.isRequired,change:e=>{const t=e.getParameter("value");this.publishChange(t);this.validate()}});return this.control}validate(){if(!this.control||!this.metadata)return true;const e=this.control;const t=e.getValue();if(this.metadata.isRequired&&(t===null||t===undefined)){e.setValueState("Error");e.setValueStateText("This field is required.");return false}e.setValueState("None");return true}applyState(){if(this.control&&this.metadata){const e=this.control;e.setEditable(!this.metadata.isReadOnly);e.setRequired(this.metadata.isRequired)}}}var s={__esModule:true};s.NumberPlugin=i;return s});
|
|
18
|
+
sap.ui.predefine("nz/co/siliconst/ui5/metaui/plugins/StringPlugin", ["./BasePlugin","sap/m/Input"],function(t,e){"use strict";const a=t["BasePlugin"];class i extends a{render(t,a){this.metadata=t;this.control=new e({value:`{meta>${a}}`,maxLength:t.maxLength||0,editable:!t.isReadOnly,required:t.isRequired,change:t=>{const e=t.getParameter("value");this.publishChange(e);this.validate()}});return this.control}validate(){if(!this.control||!this.metadata)return true;const t=this.control;const e=t.getValue();if(this.metadata.isRequired&&(!e||e.trim()==="")){t.setValueState("Error");t.setValueStateText("This field is required.");return false}t.setValueState("None");return true}applyState(){if(this.control&&this.metadata){const t=this.control;t.setEditable(!this.metadata.isReadOnly);t.setRequired(this.metadata.isRequired)}}}var s={__esModule:true};s.StringPlugin=i;return s});
|
|
19
|
+
sap.ui.require.preload({
|
|
20
|
+
"nz/co/siliconst/ui5/metaui/interfaces/IEventBus.js":function(){
|
|
21
|
+
|
|
22
|
+
},
|
|
23
|
+
"nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.js":function(){
|
|
24
|
+
|
|
25
|
+
},
|
|
26
|
+
"nz/co/siliconst/ui5/metaui/interfaces/IPlugin.js":function(){
|
|
27
|
+
|
|
28
|
+
},
|
|
29
|
+
"nz/co/siliconst/ui5/metaui/interfaces/ISchema.js":function(){
|
|
30
|
+
|
|
31
|
+
},
|
|
32
|
+
"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,"content":{"controls":["nz.co.siliconst.ui5.metaui.controls.GeneratorHost"],"elements":[],"types":[],"interfaces":[]}}}}'
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=library-preload.js.map
|