@siliconst/metaui 1.0.2 → 1.2.0
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/README.md +134 -123
- package/package.json +3 -2
- package/src/nz/co/siliconst/ui5/metaui/.library +7 -7
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js +299 -163
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts +54 -6
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/GeneratorHost.ts +292 -162
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js +51 -43
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts +5 -0
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.ts +49 -40
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +81 -58
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +5 -12
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +82 -56
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus-dbg.js +65 -50
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts +9 -0
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/EventBus.ts +60 -45
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +72 -59
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts +6 -4
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts +71 -56
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +145 -36
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +13 -8
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts +157 -31
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js +55 -55
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +56 -56
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IEventBus.ts +29 -29
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts +6 -12
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager.ts +21 -26
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +3 -20
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +14 -33
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +33 -43
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +70 -70
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js +23 -38
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts +4 -17
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/BaseLayout.ts +22 -34
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +98 -56
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts +7 -7
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +97 -60
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +102 -90
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts +4 -8
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +119 -102
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js +43 -32
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js +22 -17
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.ts +55 -43
- package/src/nz/co/siliconst/ui5/metaui/manifest.json +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin-dbg.js +68 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.d.ts +15 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/ArrayPlugin.ts +71 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js +54 -59
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts +8 -27
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/BasePlugin.ts +56 -58
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js +41 -42
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/BooleanPlugin.ts +41 -42
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js +68 -60
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/DatePlugin.ts +69 -63
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin-dbg.js +68 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DateTimePlugin.ts +68 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js +66 -66
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/DropdownPlugin.ts +65 -65
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js +55 -53
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts +3 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/NumberPlugin.ts +56 -55
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js +56 -53
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/StringPlugin.ts +58 -55
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin-dbg.js +43 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/SwitchPlugin.ts +42 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin-dbg.js +58 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TextAreaPlugin.ts +58 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin-dbg.js +74 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.d.ts +18 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/TimePlugin.ts +71 -0
- package/ui5.yaml +3 -3
- package/test-resources/App.js +0 -11
- package/test-resources/Main.controller.js +0 -73
- package/test-resources/Main.view.xml +0 -42
- package/test-resources/index.html +0 -21
- package/test-resources/mockData.json +0 -27
- package/test-resources/mockSchema.json +0 -98
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file ISchema.ts
|
|
3
|
-
* @description
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @file ISchema.ts
|
|
3
|
+
* @description MetaUI v2 Core Schema Contract.
|
|
4
|
+
* Aligned with standard JSON-Schema syntax (properties, items) for native AI generation,
|
|
5
|
+
* with a proprietary 'ui' directive block for Fiori visual orchestration.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type FieldType = "string" | "number" | "boolean" | "date" | "dropdown" | "time" | "datetime" | "array" | "object";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Value help structure mapping SAP Key/Text pairs.
|
|
12
|
+
*/
|
|
13
|
+
export interface IValueHelp {
|
|
14
|
+
key: string;
|
|
15
|
+
text: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Visual orchestration directives to separate layout from data modeling.
|
|
20
|
+
*/
|
|
21
|
+
export interface IUIDirective {
|
|
22
|
+
label?: string;
|
|
23
|
+
isKey?: boolean;
|
|
24
|
+
readOnly?: boolean;
|
|
25
|
+
widget?: string;
|
|
26
|
+
group?: string;
|
|
27
|
+
visibleOn?: string;
|
|
28
|
+
enabledOn?: string;
|
|
29
|
+
format?: string;
|
|
30
|
+
rows?: number;
|
|
31
|
+
fullWidth?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Standard JSON-Schema property definition.
|
|
36
|
+
*/
|
|
37
|
+
export interface IPropertyMetadata {
|
|
38
|
+
type: FieldType;
|
|
39
|
+
|
|
40
|
+
// MetaUI specific orchestration
|
|
41
|
+
ui?: IUIDirective;
|
|
42
|
+
|
|
43
|
+
// Standard validations
|
|
44
|
+
required?: boolean;
|
|
45
|
+
maxLength?: number;
|
|
46
|
+
minimum?: number;
|
|
47
|
+
maximum?: number;
|
|
48
|
+
pattern?: string;
|
|
49
|
+
|
|
50
|
+
// Numeric specifics
|
|
51
|
+
precision?: number;
|
|
52
|
+
scale?: number;
|
|
53
|
+
|
|
54
|
+
// Value constraints
|
|
55
|
+
valueHelp?: IValueHelp[];
|
|
56
|
+
|
|
57
|
+
// Nested recursion for objects and arrays
|
|
58
|
+
properties?: Record<string, IPropertyMetadata>;
|
|
59
|
+
items?: IPropertyMetadata;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The master schema contract ingested by the Engine.
|
|
64
|
+
*/
|
|
65
|
+
export interface ISchema {
|
|
66
|
+
title?: string;
|
|
67
|
+
type?: "object" | "array"; // Implicit layout hinting
|
|
68
|
+
properties?: Record<string, IPropertyMetadata>;
|
|
69
|
+
items?: IPropertyMetadata;
|
|
70
|
+
}
|
|
@@ -1,39 +1,24 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
});
|
|
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
|
+
*/
|
|
8
|
+
const FormLayout = ___FormLayout["FormLayout"];
|
|
9
|
+
const TableLayout = ___TableLayout["TableLayout"];
|
|
10
|
+
class BaseLayout {
|
|
11
|
+
renderForm(properties, modelName = "meta", formTitle, trackPlugin) {
|
|
12
|
+
return FormLayout.build(properties, modelName, formTitle, trackPlugin);
|
|
13
|
+
}
|
|
14
|
+
renderTable(tableMeta, modelName = "meta", tableTitle, trackPlugin) {
|
|
15
|
+
return TableLayout.build(tableMeta, modelName, tableTitle, trackPlugin);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
var __exports = {
|
|
19
|
+
__esModule: true
|
|
20
|
+
};
|
|
21
|
+
__exports.BaseLayout = BaseLayout;
|
|
22
|
+
return __exports;
|
|
23
|
+
});
|
|
39
24
|
//# sourceMappingURL=BaseLayout-dbg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout-dbg.js","names":["FormLayout","___FormLayout","TableLayout","___TableLayout","BaseLayout","renderForm","
|
|
1
|
+
{"version":3,"file":"BaseLayout-dbg.js","names":["FormLayout","___FormLayout","TableLayout","___TableLayout","BaseLayout","renderForm","properties","modelName","formTitle","trackPlugin","build","renderTable","tableMeta","tableTitle","__exports","__esModule"],"sources":["BaseLayout.ts"],"sourcesContent":["/**\n * @file BaseLayout.ts\n * @description Central layout factory that delegates to specific form or table layout engines.\n */\n\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport Control from \"sap/ui/core/Control\";\nimport { FormLayout } from \"./FormLayout\";\nimport { TableLayout } from \"./TableLayout\";\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\n\nexport class BaseLayout implements ILayoutManager {\n public renderForm(properties: Record<string, IPropertyMetadata>, modelName: string = \"meta\", formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control {\n return FormLayout.build(properties, modelName, formTitle, trackPlugin);\n }\n\n public renderTable(tableMeta: IPropertyMetadata, modelName: string = \"meta\", tableTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control {\n return TableLayout.build(tableMeta, modelName, tableTitle, trackPlugin);\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAQSA,UAAU,GAAAC,aAAA;EAAA,MACVC,WAAW,GAAAC,cAAA;EAIb,MAAMC,UAAU,CAA2B;IACvCC,UAAUA,CAACC,UAA6C,EAAEC,SAAiB,GAAG,MAAM,EAAEC,SAAkB,EAAEC,WAAuC,EAAW;MAC/J,OAAOT,UAAU,CAACU,KAAK,CAACJ,UAAU,EAAEC,SAAS,EAAEC,SAAS,EAAEC,WAAW,CAAC;IAC1E;IAEOE,WAAWA,CAACC,SAA4B,EAAEL,SAAiB,GAAG,MAAM,EAAEM,UAAmB,EAAEJ,WAAuC,EAAW;MAChJ,OAAOP,WAAW,CAACQ,KAAK,CAACE,SAAS,EAAEL,SAAS,EAAEM,UAAU,EAAEJ,WAAW,CAAC;IAC3E;EACJ;EAAC,IAAAK,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAV,UAAA,GAAAA,UAAA;EAAA,OAAAU,SAAA;AAAA","ignoreList":[]}
|
|
@@ -2,27 +2,14 @@ declare module "nz/co/siliconst/ui5/metaui/layouts/BaseLayout" {
|
|
|
2
2
|
/**
|
|
3
3
|
* @file BaseLayout.ts
|
|
4
4
|
* @description Central layout factory that delegates to specific form or table layout engines.
|
|
5
|
-
* Implements ILayoutManager.
|
|
6
5
|
*/
|
|
7
6
|
import { ILayoutManager } from "nz/co/siliconst/ui5/metaui/interfaces/ILayoutManager";
|
|
8
|
-
import {
|
|
7
|
+
import { IPropertyMetadata } from "nz/co/siliconst/ui5/metaui/interfaces/ISchema";
|
|
9
8
|
import Control from "sap/ui/core/Control";
|
|
10
|
-
|
|
11
|
-
* The core layout manager that delegates structural grid rendering based on schema configurations.
|
|
12
|
-
*/
|
|
9
|
+
import { IPlugin } from "nz/co/siliconst/ui5/metaui/interfaces/IPlugin";
|
|
13
10
|
export class BaseLayout implements ILayoutManager {
|
|
14
|
-
|
|
15
|
-
|
|
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;
|
|
11
|
+
renderForm(properties: Record<string, IPropertyMetadata>, modelName?: string, formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control;
|
|
12
|
+
renderTable(tableMeta: IPropertyMetadata, modelName?: string, tableTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control;
|
|
26
13
|
}
|
|
27
14
|
}
|
|
28
15
|
//# sourceMappingURL=BaseLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.d.ts","sourceRoot":"
|
|
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;;;OAGG;IAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;IACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAClF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAI1C,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;IAExE,MAAa,UAAW,YAAW,cAAc;QACtC,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,SAAS,GAAE,MAAe,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO;QAI3J,WAAW,CAAC,SAAS,EAAE,iBAAiB,EAAE,SAAS,GAAE,MAAe,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO;KAGtJ;CAEA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
sap.ui.define(["./FormLayout","./TableLayout"],function(e,r){"use strict";const t=e["FormLayout"];const u=r["TableLayout"];class
|
|
1
|
+
sap.ui.define(["./FormLayout","./TableLayout"],function(e,r){"use strict";const t=e["FormLayout"];const u=r["TableLayout"];class a{renderForm(e,r="meta",u,a){return t.build(e,r,u,a)}renderTable(e,r="meta",t,a){return u.build(e,r,t,a)}}var o={__esModule:true};o.BaseLayout=a;return o});
|
|
2
2
|
//# sourceMappingURL=BaseLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.js","names":["FormLayout","___FormLayout","TableLayout","___TableLayout","BaseLayout","renderForm","
|
|
1
|
+
{"version":3,"file":"BaseLayout.js","names":["FormLayout","___FormLayout","TableLayout","___TableLayout","BaseLayout","renderForm","properties","modelName","formTitle","trackPlugin","build","renderTable","tableMeta","tableTitle","__exports","__esModule"],"sources":["BaseLayout.ts"],"sourcesContent":["/**\n * @file BaseLayout.ts\n * @description Central layout factory that delegates to specific form or table layout engines.\n */\n\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport Control from \"sap/ui/core/Control\";\nimport { FormLayout } from \"./FormLayout\";\nimport { TableLayout } from \"./TableLayout\";\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\n\nexport class BaseLayout implements ILayoutManager {\n public renderForm(properties: Record<string, IPropertyMetadata>, modelName: string = \"meta\", formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control {\n return FormLayout.build(properties, modelName, formTitle, trackPlugin);\n }\n\n public renderTable(tableMeta: IPropertyMetadata, modelName: string = \"meta\", tableTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control {\n return TableLayout.build(tableMeta, modelName, tableTitle, trackPlugin);\n }\n}\n"],"mappings":"0EAAA,MAQSA,EAAUC,EAAA,oBACVC,EAAWC,EAAA,eAIb,MAAMC,EACFC,WAAWC,EAA+CC,EAAoB,OAAQC,EAAoBC,GAC7G,OAAOT,EAAWU,MAAMJ,EAAYC,EAAWC,EAAWC,EAC9D,CAEOE,YAAYC,EAA8BL,EAAoB,OAAQM,EAAqBJ,GAC9F,OAAOP,EAAYQ,MAAME,EAAWL,EAAWM,EAAYJ,EAC/D,EACH,IAAAK,EAAA,CAAAC,WAAA,MAAAD,EAAAV,aAAA,OAAAU,CAAA","ignoreList":[]}
|
|
@@ -1,34 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file BaseLayout.ts
|
|
3
|
-
* @description Central layout factory that delegates to specific form or table layout engines.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return FormLayout.build(schema.rootFields);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Constructs a responsive table layout container.
|
|
28
|
-
* @param tableMeta The metadata defining the table columns.
|
|
29
|
-
* @returns A UI5 Table control (sap.m.Table).
|
|
30
|
-
*/
|
|
31
|
-
public renderTable(tableMeta: ITableMetadata): Control {
|
|
32
|
-
return TableLayout.build(tableMeta);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @file BaseLayout.ts
|
|
3
|
+
* @description Central layout factory that delegates to specific form or table layout engines.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ILayoutManager } from "../interfaces/ILayoutManager";
|
|
7
|
+
import { IPropertyMetadata } from "../interfaces/ISchema";
|
|
8
|
+
import Control from "sap/ui/core/Control";
|
|
9
|
+
import { FormLayout } from "./FormLayout";
|
|
10
|
+
import { TableLayout } from "./TableLayout";
|
|
11
|
+
|
|
12
|
+
import { IPlugin } from "../interfaces/IPlugin";
|
|
13
|
+
|
|
14
|
+
export class BaseLayout implements ILayoutManager {
|
|
15
|
+
public renderForm(properties: Record<string, IPropertyMetadata>, modelName: string = "meta", formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control {
|
|
16
|
+
return FormLayout.build(properties, modelName, formTitle, trackPlugin);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public renderTable(tableMeta: IPropertyMetadata, modelName: string = "meta", tableTitle?: string, trackPlugin?: (plugin: IPlugin) => void): Control {
|
|
20
|
+
return TableLayout.build(tableMeta, modelName, tableTitle, trackPlugin);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,57 +1,99 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
* @param
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
sap.ui.define(["sap/ui/layout/form/SimpleForm", "sap/m/Label", "sap/ui/core/Title", "../core/PluginRegistry"], function (SimpleForm, Label, Title, ___core_PluginRegistry) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const PluginRegistry = ___core_PluginRegistry["PluginRegistry"];
|
|
5
|
+
class FormLayout {
|
|
6
|
+
/**
|
|
7
|
+
* Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.
|
|
8
|
+
* @param properties The dictionary of fields to render.
|
|
9
|
+
* @param modelName The dynamic model name.
|
|
10
|
+
* @param formTitle Optional title for the form block.
|
|
11
|
+
* @param trackPlugin Optional callback to track instantiated plugins.
|
|
12
|
+
*/
|
|
13
|
+
static build(properties, modelName = "meta", formTitle, trackPlugin) {
|
|
14
|
+
const form = new SimpleForm({
|
|
15
|
+
editable: true,
|
|
16
|
+
title: formTitle,
|
|
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
|
+
|
|
34
|
+
// Group fields by their ui.group directive
|
|
35
|
+
const groups = {};
|
|
36
|
+
const DEFAULT_GROUP = "__DEFAULT__";
|
|
37
|
+
for (const key of Object.keys(properties)) {
|
|
38
|
+
const meta = properties[key];
|
|
39
|
+
const groupName = meta.ui?.group || DEFAULT_GROUP;
|
|
40
|
+
if (!groups[groupName]) groups[groupName] = [];
|
|
41
|
+
groups[groupName].push({
|
|
42
|
+
key,
|
|
43
|
+
meta
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Render groups
|
|
48
|
+
for (const groupName of Object.keys(groups)) {
|
|
49
|
+
if (groupName !== DEFAULT_GROUP) {
|
|
50
|
+
form.addContent(new Title({
|
|
51
|
+
text: groupName
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
groups[groupName].forEach(field => {
|
|
55
|
+
try {
|
|
56
|
+
const label = new Label({
|
|
57
|
+
text: field.meta.ui?.label || field.key,
|
|
58
|
+
required: field.meta.required
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Attach visibility condition to label and control container logic
|
|
62
|
+
if (field.meta.ui?.visibleOn) {
|
|
63
|
+
const expr = `{= ${field.meta.ui.visibleOn.replace(/\$root\./g, `${modelName}>/`).replace(/\./g, '/')} }`;
|
|
64
|
+
label.bindProperty("visible", {
|
|
65
|
+
parts: [{
|
|
66
|
+
path: "meta>/"
|
|
67
|
+
}],
|
|
68
|
+
formatter: () => false
|
|
69
|
+
}); // temporary, condition engine does this usually
|
|
70
|
+
}
|
|
71
|
+
const plugin = registry.getPlugin(field.meta.type, field.meta.ui?.widget);
|
|
72
|
+
if (trackPlugin) trackPlugin(plugin);
|
|
73
|
+
const control = plugin.render(field.meta, `/${field.key}`, modelName);
|
|
74
|
+
if (field.meta.ui?.fullWidth) {
|
|
75
|
+
sap.ui.require(["sap/ui/layout/GridData"], GridData => {
|
|
76
|
+
control.setLayoutData(new GridData({
|
|
77
|
+
span: "XL12 L12 M12 S12"
|
|
78
|
+
}));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
form.addContent(label);
|
|
82
|
+
form.addContent(control);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
sap.ui.require(["sap/base/Log"], Log => {
|
|
85
|
+
if (Log) Log.error(`[MetaUI] Failed to render field ${field.key}`, error.message, "FormLayout");
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return form;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
var __exports = {
|
|
94
|
+
__esModule: true
|
|
95
|
+
};
|
|
96
|
+
__exports.FormLayout = FormLayout;
|
|
97
|
+
return __exports;
|
|
98
|
+
});
|
|
57
99
|
//# sourceMappingURL=FormLayout-dbg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLayout-dbg.js","names":["PluginRegistry","___core_PluginRegistry","FormLayout","build","
|
|
1
|
+
{"version":3,"file":"FormLayout-dbg.js","names":["PluginRegistry","___core_PluginRegistry","FormLayout","build","properties","modelName","formTitle","trackPlugin","form","SimpleForm","editable","title","layout","labelSpanXL","labelSpanL","labelSpanM","labelSpanS","adjustLabelSpan","emptySpanXL","emptySpanL","emptySpanM","emptySpanS","columnsXL","columnsL","columnsM","singleContainerFullSize","registry","getInstance","groups","DEFAULT_GROUP","key","Object","keys","meta","groupName","ui","group","push","addContent","Title","text","forEach","field","label","Label","required","visibleOn","expr","replace","bindProperty","parts","path","formatter","plugin","getPlugin","type","widget","control","render","fullWidth","sap","require","GridData","setLayoutData","span","error","Log","message","__exports","__esModule"],"sources":["FormLayout.ts"],"sourcesContent":["/**\n * @file FormLayout.ts\n * @description Generates a fully responsive SAP Fiori Form layout (SimpleForm).\n */\n\nimport SimpleForm from \"sap/ui/layout/form/SimpleForm\";\nimport Label from \"sap/m/Label\";\nimport Title from \"sap/ui/core/Title\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { PluginRegistry } from \"../core/PluginRegistry\";\nimport { IPlugin } from \"../interfaces/IPlugin\";\n\nexport class FormLayout {\n /**\n * Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.\n * @param properties The dictionary of fields to render.\n * @param modelName The dynamic model name.\n * @param formTitle Optional title for the form block.\n * @param trackPlugin Optional callback to track instantiated plugins.\n */\n public static build(properties: Record<string, IPropertyMetadata>, modelName: string = \"meta\", formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): SimpleForm {\n const form = new SimpleForm({\n editable: true,\n title: formTitle,\n layout: \"ResponsiveGridLayout\",\n labelSpanXL: 4,\n labelSpanL: 4,\n labelSpanM: 4,\n labelSpanS: 12,\n adjustLabelSpan: false,\n emptySpanXL: 0,\n emptySpanL: 0,\n emptySpanM: 0,\n emptySpanS: 0,\n columnsXL: 1,\n columnsL: 1,\n columnsM: 1,\n singleContainerFullSize: false\n });\n\n const registry = PluginRegistry.getInstance();\n \n // Group fields by their ui.group directive\n const groups: Record<string, { key: string; meta: IPropertyMetadata }[]> = {};\n const DEFAULT_GROUP = \"__DEFAULT__\";\n \n for (const key of Object.keys(properties)) {\n const meta = properties[key];\n const groupName = meta.ui?.group || DEFAULT_GROUP;\n if (!groups[groupName]) groups[groupName] = [];\n groups[groupName].push({ key, meta });\n }\n\n // Render groups\n for (const groupName of Object.keys(groups)) {\n if (groupName !== DEFAULT_GROUP) {\n form.addContent(new Title({ text: groupName }));\n }\n \n groups[groupName].forEach((field) => {\n try {\n const label = new Label({\n text: field.meta.ui?.label || field.key,\n required: field.meta.required\n });\n\n // Attach visibility condition to label and control container logic\n if (field.meta.ui?.visibleOn) {\n const expr = `{= ${field.meta.ui.visibleOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n label.bindProperty(\"visible\", { parts: [{ path: \"meta>/\" }], formatter: () => false}); // temporary, condition engine does this usually\n }\n\n const plugin = registry.getPlugin(field.meta.type, field.meta.ui?.widget);\n if (trackPlugin) trackPlugin(plugin);\n const control = plugin.render(field.meta, `/${field.key}`, modelName);\n\n if (field.meta.ui?.fullWidth) {\n sap.ui.require([\"sap/ui/layout/GridData\"], (GridData: any) => {\n control.setLayoutData(new GridData({\n span: \"XL12 L12 M12 S12\"\n }));\n });\n }\n\n form.addContent(label);\n form.addContent(control);\n } catch (error) {\n sap.ui.require([\"sap/base/Log\"], (Log: any) => {\n if (Log) Log.error(`[MetaUI] Failed to render field ${field.key}`, (error as Error).message, \"FormLayout\");\n });\n }\n });\n }\n\n return form;\n }\n}\n"],"mappings":";;;QASSA,cAAc,GAAAC,sBAAA;EAGhB,MAAMC,UAAU,CAAC;IACpB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,OAAcC,K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,QAAa,IAAK;gBAC1DL,OAAO,CAACM,aAAa,CAAC,IAAID,QAAQ,CAAC;kBAC/BE,IAAI,EAAE;gBACV,CAAC,CAAC,CAAC;cACP,CAAC,CAAC;YACN;YAEAxD,IAAI,CAAC8B,UAAU,CAACK,KAAK,CAAC;YACtBnC,IAAI,CAAC8B,UAAU,CAACmB,OAAO,CAAC;UAC5B,CAAC,CAAC,OAAOQ,KAAK,EAAE;YACZL,GAAG,CAACzB,EAAE,CAAC0B,OAAO,CAAC,CAAC,cAAc,CAAC,EAAGK,GAAQ,IAAK;cAC3C,IAAIA,GAAG,EAAEA,GAAG,CAACD,KAAK,CAAC,mCAAmCvB,KAAK,CAACZ,GAAG,EAAE,EAAGmC,KAAK,CAAWE,OAAO,EAAE,YAAY,CAAC;YAC9G,CAAC,CAAC;UACN;QACJ,CAAC,CAAC;MACN;MAEA,OAAO3D,IAAI;IACf;EACJ;EAAC,IAAA4D,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAlE,UAAA,GAAAA,UAAA;EAAA,OAAAkE,SAAA;AAAA","ignoreList":[]}
|
|
@@ -4,17 +4,17 @@ declare module "nz/co/siliconst/ui5/metaui/layouts/FormLayout" {
|
|
|
4
4
|
* @description Generates a fully responsive SAP Fiori Form layout (SimpleForm).
|
|
5
5
|
*/
|
|
6
6
|
import SimpleForm from "sap/ui/layout/form/SimpleForm";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
* Utility class strictly for constructing Form layouts without custom CSS.
|
|
10
|
-
*/
|
|
7
|
+
import { IPropertyMetadata } from "nz/co/siliconst/ui5/metaui/interfaces/ISchema";
|
|
8
|
+
import { IPlugin } from "nz/co/siliconst/ui5/metaui/interfaces/IPlugin";
|
|
11
9
|
export class FormLayout {
|
|
12
10
|
/**
|
|
13
11
|
* Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.
|
|
14
|
-
* @param
|
|
15
|
-
* @
|
|
12
|
+
* @param properties The dictionary of fields to render.
|
|
13
|
+
* @param modelName The dynamic model name.
|
|
14
|
+
* @param formTitle Optional title for the form block.
|
|
15
|
+
* @param trackPlugin Optional callback to track instantiated plugins.
|
|
16
16
|
*/
|
|
17
|
-
static build(
|
|
17
|
+
static build(properties: Record<string, IPropertyMetadata>, modelName?: string, formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): SimpleForm;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=FormLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLayout.d.ts","sourceRoot":"
|
|
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;IAGvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAElF,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;IAExE,MAAa,UAAU;QACnB;;;;;;WAMG;eACW,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,SAAS,GAAE,MAAe,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,UAAU;KA4E1K;CAEA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
sap.ui.define(["sap/ui/layout/form/SimpleForm","sap/m/Label","../core/PluginRegistry"],function(e,n
|
|
1
|
+
sap.ui.define(["sap/ui/layout/form/SimpleForm","sap/m/Label","sap/ui/core/Title","../core/PluginRegistry"],function(e,t,a,n){"use strict";const i=n["PluginRegistry"];class s{static build(n,s="meta",o,r){const l=new e({editable:true,title:o,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 u=i.getInstance();const p={};const c="__DEFAULT__";for(const e of Object.keys(n)){const t=n[e];const a=t.ui?.group||c;if(!p[a])p[a]=[];p[a].push({key:e,meta:t})}for(const e of Object.keys(p)){if(e!==c){l.addContent(new a({text:e}))}p[e].forEach(e=>{try{const a=new t({text:e.meta.ui?.label||e.key,required:e.meta.required});if(e.meta.ui?.visibleOn){const t=`{= ${e.meta.ui.visibleOn.replace(/\$root\./g,`${s}>/`).replace(/\./g,"/")} }`;a.bindProperty("visible",{parts:[{path:"meta>/"}],formatter:()=>false})}const n=u.getPlugin(e.meta.type,e.meta.ui?.widget);if(r)r(n);const i=n.render(e.meta,`/${e.key}`,s);if(e.meta.ui?.fullWidth){sap.ui.require(["sap/ui/layout/GridData"],e=>{i.setLayoutData(new e({span:"XL12 L12 M12 S12"}))})}l.addContent(a);l.addContent(i)}catch(t){sap.ui.require(["sap/base/Log"],a=>{if(a)a.error(`[MetaUI] Failed to render field ${e.key}`,t.message,"FormLayout")})}})}return l}}var o={__esModule:true};o.FormLayout=s;return o});
|
|
2
2
|
//# sourceMappingURL=FormLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLayout.js","names":["PluginRegistry","___core_PluginRegistry","FormLayout","build","
|
|
1
|
+
{"version":3,"file":"FormLayout.js","names":["PluginRegistry","___core_PluginRegistry","FormLayout","build","properties","modelName","formTitle","trackPlugin","form","SimpleForm","editable","title","layout","labelSpanXL","labelSpanL","labelSpanM","labelSpanS","adjustLabelSpan","emptySpanXL","emptySpanL","emptySpanM","emptySpanS","columnsXL","columnsL","columnsM","singleContainerFullSize","registry","getInstance","groups","DEFAULT_GROUP","key","Object","keys","meta","groupName","ui","group","push","addContent","Title","text","forEach","field","label","Label","required","visibleOn","expr","replace","bindProperty","parts","path","formatter","plugin","getPlugin","type","widget","control","render","fullWidth","sap","require","GridData","setLayoutData","span","error","Log","message","__exports","__esModule"],"sources":["FormLayout.ts"],"sourcesContent":["/**\n * @file FormLayout.ts\n * @description Generates a fully responsive SAP Fiori Form layout (SimpleForm).\n */\n\nimport SimpleForm from \"sap/ui/layout/form/SimpleForm\";\nimport Label from \"sap/m/Label\";\nimport Title from \"sap/ui/core/Title\";\nimport { IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { PluginRegistry } from \"../core/PluginRegistry\";\nimport { IPlugin } from \"../interfaces/IPlugin\";\n\nexport class FormLayout {\n /**\n * Builds a SimpleForm with ResponsiveGridLayout, injecting the requested plugins.\n * @param properties The dictionary of fields to render.\n * @param modelName The dynamic model name.\n * @param formTitle Optional title for the form block.\n * @param trackPlugin Optional callback to track instantiated plugins.\n */\n public static build(properties: Record<string, IPropertyMetadata>, modelName: string = \"meta\", formTitle?: string, trackPlugin?: (plugin: IPlugin) => void): SimpleForm {\n const form = new SimpleForm({\n editable: true,\n title: formTitle,\n layout: \"ResponsiveGridLayout\",\n labelSpanXL: 4,\n labelSpanL: 4,\n labelSpanM: 4,\n labelSpanS: 12,\n adjustLabelSpan: false,\n emptySpanXL: 0,\n emptySpanL: 0,\n emptySpanM: 0,\n emptySpanS: 0,\n columnsXL: 1,\n columnsL: 1,\n columnsM: 1,\n singleContainerFullSize: false\n });\n\n const registry = PluginRegistry.getInstance();\n \n // Group fields by their ui.group directive\n const groups: Record<string, { key: string; meta: IPropertyMetadata }[]> = {};\n const DEFAULT_GROUP = \"__DEFAULT__\";\n \n for (const key of Object.keys(properties)) {\n const meta = properties[key];\n const groupName = meta.ui?.group || DEFAULT_GROUP;\n if (!groups[groupName]) groups[groupName] = [];\n groups[groupName].push({ key, meta });\n }\n\n // Render groups\n for (const groupName of Object.keys(groups)) {\n if (groupName !== DEFAULT_GROUP) {\n form.addContent(new Title({ text: groupName }));\n }\n \n groups[groupName].forEach((field) => {\n try {\n const label = new Label({\n text: field.meta.ui?.label || field.key,\n required: field.meta.required\n });\n\n // Attach visibility condition to label and control container logic\n if (field.meta.ui?.visibleOn) {\n const expr = `{= ${field.meta.ui.visibleOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n label.bindProperty(\"visible\", { parts: [{ path: \"meta>/\" }], formatter: () => false}); // temporary, condition engine does this usually\n }\n\n const plugin = registry.getPlugin(field.meta.type, field.meta.ui?.widget);\n if (trackPlugin) trackPlugin(plugin);\n const control = plugin.render(field.meta, `/${field.key}`, modelName);\n\n if (field.meta.ui?.fullWidth) {\n sap.ui.require([\"sap/ui/layout/GridData\"], (GridData: any) => {\n control.setLayoutData(new GridData({\n span: \"XL12 L12 M12 S12\"\n }));\n });\n }\n\n form.addContent(label);\n form.addContent(control);\n } catch (error) {\n sap.ui.require([\"sap/base/Log\"], (Log: any) => {\n if (Log) Log.error(`[MetaUI] Failed to render field ${field.key}`, (error as Error).message, \"FormLayout\");\n });\n }\n });\n }\n\n return form;\n }\n}\n"],"mappings":"gJASSA,EAAcC,EAAA,kBAGhB,MAAMC,EAQT,YAAcC,CAAMC,EAA+CC,EAAoB,OAAQC,EAAoBC,GAC/G,MAAMC,EAAO,IAAIC,EAAW,CACxBC,SAAU,KACVC,MAAOL,EACPM,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,EAAW1B,EAAe2B,cAGhC,MAAMC,EAAqE,CAAC,EAC5E,MAAMC,EAAgB,cAEtB,IAAK,MAAMC,KAAOC,OAAOC,KAAK5B,GAAa,CACvC,MAAM6B,EAAO7B,EAAW0B,GACxB,MAAMI,EAAYD,EAAKE,IAAIC,OAASP,EACpC,IAAKD,EAAOM,GAAYN,EAAOM,GAAa,GAC5CN,EAAOM,GAAWG,KAAK,CAAEP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