@siliconst/metaui 1.4.9 → 1.4.13
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 +4 -178
- package/package.json +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +56 -8
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts +27 -3
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +52 -9
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +132 -18
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts +14 -9
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +117 -18
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate-dbg.js +1 -3
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.ts +1 -3
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js +9 -6
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.ts +9 -6
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js +56 -49
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.d.ts +9 -4
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts +67 -50
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js +0 -2
- 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 +0 -2
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts.map +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 +0 -3
- package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator-dbg.js +4 -6
- package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.ts +4 -4
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +36 -9
- 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 +18 -2
- 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 +39 -5
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +19 -2
- 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 +9 -0
- 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 +21 -7
- package/src/nz/co/siliconst/ui5/metaui/core/Registry-dbg.js +3 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Registry-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Registry.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Registry.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Registry.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/Registry.ts +3 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +54 -34
- 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 +3 -1
- 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 +55 -34
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator-dbg.js +7 -6
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.ts +7 -6
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js +40 -11
- 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 +6 -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 +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 +39 -13
- 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 +13 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +15 -0
- 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 +1 -0
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +10 -0
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +10 -0
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js +44 -43
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.d.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/library.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js +6 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.ts +6 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +77 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts +17 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +67 -7
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js +10 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.ts +10 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js +130 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts +39 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.ts +127 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js +6 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.ts +6 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js +40 -4
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.d.ts +4 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.ts +41 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.ts +3 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin-dbg.js +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.ts +4 -4
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin-dbg.js +3 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.ts +4 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin-dbg.js +3 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.ts +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicHost.js","names":["GeneratorHost","_interopRequireDefault","__GeneratorHost","Logger","___utils_Logger","ODataDelegate","___host_delegates_ODataDelegate","DynamicHost","Control","extend","constructor","prototype","apply","this","arguments","_innerHost","odataDelegate","_initializedInner","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","initODataDelegate","_initODataDelegate","oContext","getBindingContext","debug","getPath","requestObject","syncToEngine","Object","keys","setBindingContext","_setBindingContext","sModelName","Control.prototype.setBindingContext.call","bindElement","_bindElement","vPath","mParameters","Control.prototype.bindElement.call","model","undefined","oBinding","getElementBinding","attachChange","onBeforeRendering","_onBeforeRendering","schema","getProperty","hasSchema","hasData","props","getMetadata","getProperties","propName","val","Control.prototype.getProperty.call","setProperty","setAggregation","getEvents","eventName","attachEvent","oEvent","params","getParameters","Control.prototype.setProperty.call","str","JSON","stringify","handleFieldChange","fireEvent","_setProperty","propertyName","suppressInvalidate","openInDialog","_openInDialog","title","submitButtonText","cancelButtonText","triggerSubmit","_triggerSubmit","_getProperty"],"sources":["DynamicHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport GeneratorHost from \"./host/GeneratorHost\";\nimport { Logger } from \"../utils/Logger\";\nimport { ODataDelegate } from \"./host/delegates/ODataDelegate\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\n\n/**\n * A transparent wrapper control (Facade) that automatically chooses between Explicit Schema Mode \n * and Inference Mode based on the presence of a 'schemaDefinition'.\n * \n * This maintains total architectural separation of the modes without forcing developers to \n * use different XML tags.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls\n */\nexport default class DynamicHost extends Control {\n private _innerHost: GeneratorHost | null = null;\n private odataDelegate: ODataDelegate | null = null;\n private _initializedInner: boolean = false;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } }\n }\n };\n\n static renderer = {\n apiVersion: 2,\n render(rm: RenderManager, control: DynamicHost) {\n rm.openStart(\"div\", control);\n rm.style(\"width\", \"100%\");\n rm.style(\"height\", \"100%\");\n rm.openEnd();\n\n const content = control.getAggregation(\"_content\") as Control;\n if (content) {\n rm.renderControl(content);\n }\n\n rm.close(\"div\");\n }\n };\n\n /**\n * Internal reference to the generated inner host instance.\n * @private\n */\n private _innerHost: GeneratorHost | null = null;\n \n /**\n * Flag indicating if the inner host has been initialized.\n * @private\n */\n private _initializedInner: boolean = false;\n\n /**\n * Initializes the OData Delegate if an OData context is detected.\n * This allows DynamicHost to seamlessly synchronize metadata and properties from an OData model.\n * @private\n */\n private initODataDelegate(): void {\n if (!this.odataDelegate) {\n const oContext = this.getBindingContext(\"odata\") || this.getBindingContext();\n if (oContext) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context found for delegate initialization: ${oContext.getPath()}`, \"DynamicHost\");\n if (oContext && (oContext as ODataV4Context).requestObject && typeof (oContext as ODataV4Context).requestObject === \"function\") {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context supports requestObject/getObject. Instantiating ODataDelegate.`, \"DynamicHost\");\n this.odataDelegate = new ODataDelegate(this, oContext as ODataV4Context);\n this.odataDelegate.syncToEngine();\n } else {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context does NOT support requestObject/getObject! Keys: ${Object.keys(oContext)}`, \"DynamicHost\");\n }\n }\n }\n }\n\n /**\n * Standard UI5 method override.\n * Sets the binding context for the control and attempts to initialize the OData delegate\n * if the context points to an OData model.\n * \n * @param {sap.ui.model.Context | null | undefined} oContext The binding context object\n * @param {string} [sModelName] Optional model name\n * @returns {this} The control instance for chaining\n */\n public setBindingContext(oContext: sap.ui.model.Context | null | undefined, sModelName?: string): this {\n super.setBindingContext(oContext, sModelName);\n this.initODataDelegate();\n return this;\n }\n\n /**\n * Standard UI5 method override.\n * Binds the element to the given path and attaches a change listener to re-evaluate\n * the OData delegate when the element binding resolves.\n * \n * @param {string | Record<string, unknown>} vPath The binding path or configuration object\n * @param {object} [mParameters] Optional mapping parameters\n * @returns {this} Reference to this instance for chaining\n */\n public bindElement(vPath: string | Record<string, unknown>, mParameters?: object): this {\n super.bindElement(vPath, mParameters);\n const sModelName = typeof vPath === \"object\" ? vPath.model : undefined;\n const oBinding = this.getElementBinding(sModelName);\n if (oBinding) {\n oBinding.attachChange(() => {\n this.initODataDelegate();\n });\n }\n return this;\n }\n\n /**\n * Standard UI5 Lifecycle Hook.\n * Evaluates the initial properties and spawns the GeneratorHost.\n * It handles the complex lifecycle task of copying all bindings, raw properties, and event listeners \n * down to the inner host perfectly transparently.\n */\n public onBeforeRendering(): void {\n Logger.debug(\"[MetaUI DynamicHost]\", `onBeforeRendering called. _initializedInner: ${this._initializedInner}`, \"DynamicHost\");\n\n this.initODataDelegate();\n\n if (!this._initializedInner) {\n const schema = this.getProperty(\"schemaDefinition\");\n const dataJson = this.getProperty(\"dataJson\");\n const data = this.getProperty(\"data\");\n\n const hasSchema = !!schema;\n const hasData = !!dataJson || !!data;\n\n Logger.debug(\"[MetaUI DynamicHost]\", `Evaluating boot. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n\n // Only boot if we have either a schema or some data to infer from\n if (hasSchema || hasData) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Booting inner host. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n }\n // The architectural Facade router logic:\n // We've simplified this! We no longer use HostFactory or separate subclasses.\n // GeneratorHost is fully capable of inferring the schema if none is provided.\n this._innerHost = new GeneratorHost();\n\n // 1. Forward all static values to the spawned host BEFORE mounting.\n // Since we no longer use bindProperty, it's perfectly safe to set raw properties before mounting.\n const props = this.getMetadata().getProperties();\n for (const propName in props) {\n const val = super.getProperty(propName);\n if (val !== null && val !== undefined) {\n this._innerHost.setProperty(propName, val);\n }\n }\n\n // 2. Mount so it inherits models and triggers lifecycle.\n this.setAggregation(\"_content\", this._innerHost);\n\n // 3. Forward all event subscriptions.\n // By proxying the events upwards, the developer can subscribe to `<meta:DynamicHost submit=\"...\">` \n // and perfectly receive the inner host's submission event.\n const events = this.getMetadata().getEvents();\n for (const eventName in events) {\n this._innerHost.attachEvent(eventName, (oEvent: sap.ui.base.Event) => {\n // Natively push updated payload out to any bound Fiori Element properties.\n // Using super.setProperty prevents an infinite loop back down to _innerHost.\n if (eventName === \"submit\" || eventName === \"fieldChange\") {\n const params = oEvent.getParameters();\n if (params.payload) {\n super.setProperty(\"data\", params.payload, true);\n\n const str = params.payloadJson || JSON.stringify(params.payload, null, 2);\n super.setProperty(\"dataJson\", str, true);\n }\n if (eventName === \"fieldChange\" && this.odataDelegate) {\n this.odataDelegate.handleFieldChange(params.fieldPath, params.value);\n }\n }\n this.fireEvent(eventName, oEvent.getParameters());\n });\n }\n\n this._initializedInner = true;\n }\n }\n }\n\n /**\n * Overrides standard UI5 setProperty to act as a transparent proxy.\n * When a property is updated on the wrapper (either programmatically or via a binding update),\n * it instantly mirrors that value down to the inner instantiated host.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Wrapper received setProperty: ${propertyName}`, \"DynamicHost\");\n }\n }\n super.setProperty(propertyName, value, suppressInvalidate);\n if (this._innerHost) {\n this._innerHost.setProperty(propertyName, value, suppressInvalidate);\n } else if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `_innerHost not yet initialized when ${propertyName} was set. Booting will happen on next render.`, \"DynamicHost\");\n }\n }\n return this;\n }\n\n\n\n\n\n /**\n * Programmatic API support. Routes dialog commands down to the spawned inner host.\n * If the inner host has not booted yet, it forces initialization immediately.\n * \n * @param {string} [title=\"Form\"] The title of the dialog\n * @param {string} [submitButtonText=\"OK\"] The text for the primary action button\n * @param {string} [cancelButtonText=\"Cancel\"] The text for the cancel button\n */\n public openInDialog(title?: string, submitButtonText?: string, cancelButtonText?: string): void {\n if (!this._innerHost) {\n this.onBeforeRendering(); // Force init if they bypassed UI5 rendering\n }\n this._innerHost?.openInDialog(title, submitButtonText, cancelButtonText);\n }\n\n /**\n * Proxies submission triggering down to the instantiated generator host.\n * Evaluates the internal Engine validation suite and returns true if structurally sound.\n * \n * @returns {boolean} True if the internal payload passes schema validation, false otherwise.\n */\n public triggerSubmit(): boolean {\n if (!this._innerHost) {\n return false;\n }\n return this._innerHost.triggerSubmit();\n }\n\n /**\n * Overrides standard UI5 getProperty to transparently pull extracted data from the inner host.\n * Ensures that querying the DynamicHost facade for `data` always yields the freshest payload.\n * \n * @param {string} propertyName The name of the property to retrieve\n * @returns {unknown} The property value\n */\n public getProperty(propertyName: string): unknown {\n if (propertyName === \"outputData\") {\n propertyName = \"data\"; // Forward deprecated outputData to data\n }\n if (this._innerHost && (propertyName === \"data\" || propertyName === \"dataJson\")) {\n return this._innerHost.getProperty(propertyName);\n }\n return super.getProperty(propertyName);\n }\n}\n"],"mappings":"sOAEOA,EAAaC,EAAAC,GAAA,MACXC,EAAMC,EAAA,gBACNC,EAAaC,EAAA,iBAGtB,MASqBC,EAAoBC,EAAOC,OAAA,mDAAAC,YAAA,SAAAA,IAAAF,EAAAG,UAAAD,YAAAE,MAAAC,KAAAC,WAAAD,KACpCE,WAAmC,KAAIF,KACvCG,cAAsC,KAAIH,KAC1CI,kBAA6B,MA+DrCJ,KAIQE,WAAmC,KAE3CF,KAIQI,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C,GAAIvG,KAAKE,WAAY,CACjBF,KAAKE,WAAWqF,YAAYe,EAAcxD,EAAOyD,EACrD,MAAO,GAAID,IAAiB,QAAUA,IAAiB,YAAcA,IAAiB,mBAAoB,CACtG,GAAItG,KAAK8E,YAAY,aAAc,CAC/BxF,EAAOiE,MAAM,uBAAwB,uCAAuC+C,iDAA6D,cAC7I,CACJ,CACA,OAAOtG,IACX,EAcOwG,aAAY,SAAAC,EAACC,EAAgBC,EAA2BC,GAC3D,IAAK5G,KAAKE,WAAY,CAClBF,KAAK2E,mBACT,CACA3E,KAAKE,YAAYsG,aAAaE,EAAOC,EAAkBC,EAC3D,EAQOC,cAAa,SAAAC,IAChB,IAAK9G,KAAKE,WAAY,CAClB,OAAO,KACX,CACA,OAAOF,KAAKE,WAAW2G,eAC3B,EASO/B,YAAW,SAAAiC,EAACT,GACf,GAAIA,IAAiB,aAAc,CAC/BA,EAAe,MACnB,CACA,GAAItG,KAAKE,aAAeoG,IAAiB,QAAUA,IAAiB,YAAa,CAC7E,OAAOtG,KAAKE,WAAW4E,YAAYwB,EACvC,CACA,OAAAhB,6BAAAtF,KAAyBsG,EAC7B,IAAC,OArRgB5G,CAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"DynamicHost.js","names":["GeneratorHost","_interopRequireDefault","__GeneratorHost","Logger","___utils_Logger","ODataDelegate","___host_delegates_ODataDelegate","DynamicHost","Control","extend","constructor","prototype","apply","this","arguments","odataDelegate","_innerHost","_initializedInner","renderer","apiVersion","render","rm","control","openStart","style","openEnd","content","getAggregation","renderControl","close","metadata","properties","schemaDefinition","type","defaultValue","data","bindable","dataJson","liveUpdate","isValid","useMessageManager","modelName","debugMode","editable","aggregations","_content","multiple","visibility","events","beforeSubmit","parameters","payload","addError","preventDefault","submit","payloadJson","cancel","fieldChange","fieldPath","value","validationStateChanged","validationError","message","validationSuccess","error","exception","initODataDelegate","_initODataDelegate","getBindingInfo","dataBinding","path","oContext","getBindingContext","debug","getPath","requestObject","syncToEngine","Object","keys","setBindingContext","_setBindingContext","sModelName","Control.prototype.setBindingContext.call","bindElement","_bindElement","vPath","mParameters","Control.prototype.bindElement.call","model","undefined","oBinding","getElementBinding","attachChange","onBeforeRendering","_onBeforeRendering","schema","getProperty","hasSchema","length","hasData","props","getMetadata","getProperties","propName","val","Control.prototype.getProperty.call","setProperty","setAggregation","getEvents","eventName","attachEvent","oEvent","params","getParameters","isLive","Control.prototype.setProperty.call","str","JSON","stringify","handleFieldChange","fireEvent","_setProperty","propertyName","suppressInvalidate","openInDialog","_openInDialog","title","submitButtonText","cancelButtonText","dialogWidth","parentView","triggerSubmit","_triggerSubmit","addCustomError","_addCustomError","clearCustomError","_clearCustomError","_getProperty"],"sources":["DynamicHost.ts"],"sourcesContent":["import Control from \"sap/ui/core/Control\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport GeneratorHost from \"./host/GeneratorHost\";\nimport { Logger } from \"../utils/Logger\";\nimport { ODataDelegate } from \"./host/delegates/ODataDelegate\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\n\n/**\n * A transparent wrapper control (Facade) that automatically chooses between Explicit Schema Mode \n * and Inference Mode based on the presence of a 'schemaDefinition'.\n * \n * This maintains total architectural separation of the modes without forcing developers to \n * use different XML tags.\n * \n * @namespace nz.co.siliconst.ui5.metaui.controls\n */\nexport default class DynamicHost extends Control {\n private odataDelegate: ODataDelegate | null = null;\n\n static readonly metadata = {\n properties: {\n schemaDefinition: { type: \"any\", defaultValue: null },\n data: { type: \"object\", defaultValue: null, bindable: \"bindable\" },\n dataJson: { type: \"string\", defaultValue: null, bindable: \"bindable\" },\n liveUpdate: { type: \"boolean\", defaultValue: false },\n isValid: { type: \"boolean\", defaultValue: true },\n useMessageManager: { type: \"boolean\", defaultValue: false },\n modelName: { type: \"string\", defaultValue: \"meta\" },\n debugMode: { type: \"boolean\", defaultValue: false },\n editable: { type: \"boolean\", defaultValue: true }\n },\n aggregations: {\n _content: { type: \"sap.ui.core.Control\", multiple: false, visibility: \"hidden\" }\n },\n events: {\n beforeSubmit: {\n parameters: {\n payload: { type: \"object\" },\n addError: { type: \"function\" },\n preventDefault: { type: \"function\" }\n }\n },\n submit: {\n parameters: {\n payload: { type: \"object\" },\n payloadJson: { type: \"string\" }\n }\n },\n cancel: {},\n fieldChange: {\n parameters: {\n fieldPath: { type: \"string\" },\n value: { type: \"any\" },\n payload: { type: \"object\" },\n isValid: { type: \"boolean\" }\n }\n },\n validationStateChanged: { parameters: { isValid: { type: \"boolean\" } } },\n validationError: { parameters: { fieldPath: { type: \"string\" }, message: { type: \"string\" } } },\n validationSuccess: { parameters: { fieldPath: { type: \"string\" } } },\n error: { parameters: { message: { type: \"string\" }, exception: { type: \"object\" } } }\n }\n };\n\n static renderer = {\n apiVersion: 2,\n render(rm: RenderManager, control: DynamicHost) {\n rm.openStart(\"div\", control);\n rm.style(\"width\", \"100%\");\n rm.style(\"height\", \"100%\");\n rm.openEnd();\n\n const content = control.getAggregation(\"_content\") as Control;\n if (content) {\n rm.renderControl(content);\n }\n\n rm.close(\"div\");\n }\n };\n\n /**\n * Internal reference to the generated inner host instance.\n * @private\n */\n private _innerHost: GeneratorHost | null = null;\n \n /**\n * Flag indicating if the inner host has been initialized.\n * @private\n */\n private _initializedInner: boolean = false;\n\n /**\n * Initializes the OData Delegate if an OData context is detected.\n * This allows DynamicHost to seamlessly synchronize metadata and properties from an OData model.\n * @private\n */\n private initODataDelegate(): void {\n if (!this.odataDelegate) {\n // Guard: If the user explicitly bound dataJson, do not steal the context.\n if (this.getBindingInfo(\"dataJson\")) {\n return;\n }\n\n // Guard: If the user explicitly bound 'data' to a specific property path, do not steal the context.\n const dataBinding = this.getBindingInfo(\"data\") as any;\n if (dataBinding && dataBinding.path && dataBinding.path !== \"\") {\n return;\n }\n\n const oContext = this.getBindingContext(\"odata\") || this.getBindingContext();\n if (oContext) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context found for delegate initialization: ${oContext.getPath()}`, \"DynamicHost\");\n if (oContext && (oContext as ODataV4Context).requestObject && typeof (oContext as ODataV4Context).requestObject === \"function\") {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context supports requestObject/getObject. Instantiating ODataDelegate.`, \"DynamicHost\");\n this.odataDelegate = new ODataDelegate(this, oContext as ODataV4Context);\n this.odataDelegate.syncToEngine();\n } else {\n Logger.debug(\"[MetaUI DynamicHost]\", `Context does NOT support requestObject/getObject! Keys: ${Object.keys(oContext)}`, \"DynamicHost\");\n }\n }\n }\n }\n\n /**\n * Standard UI5 method override.\n * Sets the binding context for the control and attempts to initialize the OData delegate\n * if the context points to an OData model.\n * \n * @param {sap.ui.model.Context | null | undefined} oContext The binding context object\n * @param {string} [sModelName] Optional model name\n * @returns {this} The control instance for chaining\n */\n public setBindingContext(oContext: sap.ui.model.Context | null | undefined, sModelName?: string): this {\n super.setBindingContext(oContext, sModelName);\n this.initODataDelegate();\n return this;\n }\n\n /**\n * Standard UI5 method override.\n * Binds the element to the given path and attaches a change listener to re-evaluate\n * the OData delegate when the element binding resolves.\n * \n * @param {string | Record<string, unknown>} vPath The binding path or configuration object\n * @param {object} [mParameters] Optional mapping parameters\n * @returns {this} Reference to this instance for chaining\n */\n public bindElement(vPath: string | Record<string, unknown>, mParameters?: object): this {\n super.bindElement(vPath, mParameters);\n const sModelName = typeof vPath === \"object\" ? vPath.model : undefined;\n const oBinding = this.getElementBinding(sModelName);\n if (oBinding) {\n oBinding.attachChange(() => {\n this.initODataDelegate();\n });\n }\n return this;\n }\n\n /**\n * Standard UI5 Lifecycle Hook.\n * Evaluates the initial properties and spawns the GeneratorHost.\n * It handles the complex lifecycle task of copying all bindings, raw properties, and event listeners \n * down to the inner host perfectly transparently.\n */\n public onBeforeRendering(): void {\n Logger.debug(\"[MetaUI DynamicHost]\", `onBeforeRendering called. _initializedInner: ${this._initializedInner}`, \"DynamicHost\");\n\n this.initODataDelegate();\n\n if (!this._initializedInner) {\n const schema = this.getProperty(\"schemaDefinition\");\n const dataJson = this.getProperty(\"dataJson\");\n const data = this.getProperty(\"data\");\n\n let hasSchema = !!schema;\n if (hasSchema && typeof schema === \"object\" && Object.keys(schema).length === 0) {\n hasSchema = false; // Treat empty object as no schema\n }\n \n const hasData = !!dataJson || !!data;\n\n Logger.debug(\"[MetaUI DynamicHost]\", `Evaluating boot. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n\n // Only boot if we have either a schema or some data to infer from\n if (hasSchema || hasData) {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Booting inner host. hasSchema: ${hasSchema}, hasData: ${hasData}`, \"DynamicHost\");\n }\n // The architectural Facade router logic:\n // We've simplified this! We no longer use HostFactory or separate subclasses.\n // GeneratorHost is fully capable of inferring the schema if none is provided.\n this._innerHost = new GeneratorHost();\n\n // 1. Forward all static values to the spawned host BEFORE mounting.\n // Since we no longer use bindProperty, it's perfectly safe to set raw properties before mounting.\n const props = this.getMetadata().getProperties();\n for (const propName in props) {\n const val = super.getProperty(propName);\n if (val !== null && val !== undefined) {\n this._innerHost.setProperty(propName, val);\n }\n }\n\n // 2. Mount so it inherits models and triggers lifecycle.\n this.setAggregation(\"_content\", this._innerHost);\n\n // 3. Forward all event subscriptions.\n // By proxying the events upwards, the developer can subscribe to `<meta:DynamicHost submit=\"...\">` \n // and perfectly receive the inner host's submission event.\n const events = this.getMetadata().getEvents();\n for (const eventName in events) {\n this._innerHost.attachEvent(eventName, (oEvent: sap.ui.base.Event) => {\n // Natively push updated payload out to any bound Fiori Element properties.\n // Using super.setProperty prevents an infinite loop back down to _innerHost.\n if (eventName === \"submit\" || eventName === \"fieldChange\") {\n const params = oEvent.getParameters();\n if (params.payload) {\n const isLive = this.getProperty(\"liveUpdate\") === true;\n if (eventName === \"submit\" || isLive) {\n super.setProperty(\"data\", params.payload, true);\n\n const str = params.payloadJson || JSON.stringify(params.payload, null, 2);\n super.setProperty(\"dataJson\", str, true);\n }\n }\n if (eventName === \"fieldChange\" && this.odataDelegate) {\n this.odataDelegate.handleFieldChange(params.fieldPath, params.value);\n }\n }\n this.fireEvent(eventName, oEvent.getParameters());\n });\n }\n\n this._initializedInner = true;\n }\n }\n }\n\n /**\n * Overrides standard UI5 setProperty to act as a transparent proxy.\n * When a property is updated on the wrapper (either programmatically or via a binding update),\n * it instantly mirrors that value down to the inner instantiated host.\n */\n public setProperty(propertyName: string, value: unknown, suppressInvalidate?: boolean): this {\n if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `Wrapper received setProperty: ${propertyName}`, \"DynamicHost\");\n }\n }\n super.setProperty(propertyName, value, suppressInvalidate);\n if (this._innerHost) {\n this._innerHost.setProperty(propertyName, value, suppressInvalidate);\n } else if (propertyName === \"data\" || propertyName === \"dataJson\" || propertyName === \"schemaDefinition\") {\n if (this.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI DynamicHost]\", `_innerHost not yet initialized when ${propertyName} was set. Booting will happen on next render.`, \"DynamicHost\");\n }\n }\n return this;\n }\n\n\n\n\n\n /**\n * Programmatic API support. Routes dialog commands down to the spawned inner host.\n * If the inner host has not booted yet, it forces initialization immediately.\n * \n * @param {string} [title=\"Form\"] The title of the dialog\n * @param {string} [submitButtonText=\"OK\"] The text for the primary action button\n * @param {string} [cancelButtonText=\"Cancel\"] The text for the cancel button\n * @param {string} [dialogWidth=\"800px\"] The width of the dialog\n * @param {sap.ui.core.Control} [parentView] The parent view to attach the dialog to for model inheritance.\n */\n public openInDialog(title?: string, submitButtonText?: string, cancelButtonText?: string, dialogWidth?: string, parentView?: Control): void {\n if (!this._innerHost) {\n this.onBeforeRendering(); // Force init if they bypassed UI5 rendering\n }\n this._innerHost?.openInDialog(title, submitButtonText, cancelButtonText, dialogWidth, parentView);\n }\n\n /**\n * Proxies submission triggering down to the instantiated generator host.\n * Evaluates the internal Engine validation suite and returns true if structurally sound.\n * \n * @returns {boolean} True if the internal payload passes schema validation, false otherwise.\n */\n public triggerSubmit(): boolean {\n if (!this._innerHost) {\n return false;\n }\n return this._innerHost.triggerSubmit();\n }\n\n /**\n * Injects a custom error message onto a specific field.\n * Useful for injecting custom backend validation errors.\n * \n * @param {string} fieldPath The schema key path to target.\n * @param {string} message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n if (this._innerHost && typeof (this._innerHost as any).addCustomError === \"function\") {\n (this._innerHost as any).addCustomError(fieldPath, message);\n }\n }\n\n /**\n * Clears a custom error message from a specific field.\n * \n * @param {string} fieldPath The schema key path to target.\n */\n public clearCustomError(fieldPath: string): void {\n if (this._innerHost && typeof (this._innerHost as any).clearCustomError === \"function\") {\n (this._innerHost as any).clearCustomError(fieldPath);\n }\n }\n\n /**\n * Overrides standard UI5 getProperty to transparently pull extracted data from the inner host.\n * Ensures that querying the DynamicHost facade for `data` always yields the freshest payload.\n * \n * @param {string} propertyName The name of the property to retrieve\n * @returns {unknown} The property value\n */\n public getProperty(propertyName: string): unknown {\n if (propertyName === \"outputData\") {\n propertyName = \"data\"; // Forward deprecated outputData to data\n }\n if (this._innerHost && (propertyName === \"data\" || propertyName === \"dataJson\")) {\n return this._innerHost.getProperty(propertyName);\n }\n return super.getProperty(propertyName);\n }\n}\n"],"mappings":"sOAEOA,EAAaC,EAAAC,GAAA,MACXC,EAAMC,EAAA,gBACNC,EAAaC,EAAA,iBAGtB,MASqBC,EAAoBC,EAAOC,OAAA,mDAAAC,YAAA,SAAAA,IAAAF,EAAAG,UAAAD,YAAAE,MAAAC,KAAAC,WAAAD,KACpCE,cAAsC,KAgE9CF,KAIQG,WAAmC,KAE3CH,KAIQI,kBAA6B,KAAK,EA3BnCC,SAAW,CACdC,WAAY,EACZC,OAAOC,EAAmBC,GACtBD,EAAGE,UAAU,MAAOD,GACpBD,EAAGG,MAAM,QAAS,QAClBH,EAAGG,MAAM,SAAU,QACnBH,EAAGI,UAEH,MAAMC,EAAUJ,EAAQ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ACA,OAAAjB,6BAAA5F,KAAyB6G,EAC7B,IAAC,OAhUgBnH,CAAW","ignoreList":[]}
|
|
@@ -15,9 +15,7 @@ import ODataV4Context from "sap/ui/model/odata/v4/Context";
|
|
|
15
15
|
* @namespace nz.co.siliconst.ui5.metaui.controls
|
|
16
16
|
*/
|
|
17
17
|
export default class DynamicHost extends Control {
|
|
18
|
-
private _innerHost: GeneratorHost | null = null;
|
|
19
18
|
private odataDelegate: ODataDelegate | null = null;
|
|
20
|
-
private _initializedInner: boolean = false;
|
|
21
19
|
|
|
22
20
|
static readonly metadata = {
|
|
23
21
|
properties: {
|
|
@@ -59,7 +57,8 @@ export default class DynamicHost extends Control {
|
|
|
59
57
|
},
|
|
60
58
|
validationStateChanged: { parameters: { isValid: { type: "boolean" } } },
|
|
61
59
|
validationError: { parameters: { fieldPath: { type: "string" }, message: { type: "string" } } },
|
|
62
|
-
validationSuccess: { parameters: { fieldPath: { type: "string" } } }
|
|
60
|
+
validationSuccess: { parameters: { fieldPath: { type: "string" } } },
|
|
61
|
+
error: { parameters: { message: { type: "string" }, exception: { type: "object" } } }
|
|
63
62
|
}
|
|
64
63
|
};
|
|
65
64
|
|
|
@@ -99,6 +98,17 @@ export default class DynamicHost extends Control {
|
|
|
99
98
|
*/
|
|
100
99
|
private initODataDelegate(): void {
|
|
101
100
|
if (!this.odataDelegate) {
|
|
101
|
+
// Guard: If the user explicitly bound dataJson, do not steal the context.
|
|
102
|
+
if (this.getBindingInfo("dataJson")) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Guard: If the user explicitly bound 'data' to a specific property path, do not steal the context.
|
|
107
|
+
const dataBinding = this.getBindingInfo("data") as any;
|
|
108
|
+
if (dataBinding && dataBinding.path && dataBinding.path !== "") {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
102
112
|
const oContext = this.getBindingContext("odata") || this.getBindingContext();
|
|
103
113
|
if (oContext) {
|
|
104
114
|
Logger.debug("[MetaUI DynamicHost]", `Context found for delegate initialization: ${oContext.getPath()}`, "DynamicHost");
|
|
@@ -165,7 +175,11 @@ export default class DynamicHost extends Control {
|
|
|
165
175
|
const dataJson = this.getProperty("dataJson");
|
|
166
176
|
const data = this.getProperty("data");
|
|
167
177
|
|
|
168
|
-
|
|
178
|
+
let hasSchema = !!schema;
|
|
179
|
+
if (hasSchema && typeof schema === "object" && Object.keys(schema).length === 0) {
|
|
180
|
+
hasSchema = false; // Treat empty object as no schema
|
|
181
|
+
}
|
|
182
|
+
|
|
169
183
|
const hasData = !!dataJson || !!data;
|
|
170
184
|
|
|
171
185
|
Logger.debug("[MetaUI DynamicHost]", `Evaluating boot. hasSchema: ${hasSchema}, hasData: ${hasData}`, "DynamicHost");
|
|
@@ -204,10 +218,13 @@ export default class DynamicHost extends Control {
|
|
|
204
218
|
if (eventName === "submit" || eventName === "fieldChange") {
|
|
205
219
|
const params = oEvent.getParameters();
|
|
206
220
|
if (params.payload) {
|
|
207
|
-
|
|
221
|
+
const isLive = this.getProperty("liveUpdate") === true;
|
|
222
|
+
if (eventName === "submit" || isLive) {
|
|
223
|
+
super.setProperty("data", params.payload, true);
|
|
208
224
|
|
|
209
|
-
|
|
210
|
-
|
|
225
|
+
const str = params.payloadJson || JSON.stringify(params.payload, null, 2);
|
|
226
|
+
super.setProperty("dataJson", str, true);
|
|
227
|
+
}
|
|
211
228
|
}
|
|
212
229
|
if (eventName === "fieldChange" && this.odataDelegate) {
|
|
213
230
|
this.odataDelegate.handleFieldChange(params.fieldPath, params.value);
|
|
@@ -255,12 +272,14 @@ export default class DynamicHost extends Control {
|
|
|
255
272
|
* @param {string} [title="Form"] The title of the dialog
|
|
256
273
|
* @param {string} [submitButtonText="OK"] The text for the primary action button
|
|
257
274
|
* @param {string} [cancelButtonText="Cancel"] The text for the cancel button
|
|
275
|
+
* @param {string} [dialogWidth="800px"] The width of the dialog
|
|
276
|
+
* @param {sap.ui.core.Control} [parentView] The parent view to attach the dialog to for model inheritance.
|
|
258
277
|
*/
|
|
259
|
-
public openInDialog(title?: string, submitButtonText?: string, cancelButtonText?: string): void {
|
|
278
|
+
public openInDialog(title?: string, submitButtonText?: string, cancelButtonText?: string, dialogWidth?: string, parentView?: Control): void {
|
|
260
279
|
if (!this._innerHost) {
|
|
261
280
|
this.onBeforeRendering(); // Force init if they bypassed UI5 rendering
|
|
262
281
|
}
|
|
263
|
-
this._innerHost?.openInDialog(title, submitButtonText, cancelButtonText);
|
|
282
|
+
this._innerHost?.openInDialog(title, submitButtonText, cancelButtonText, dialogWidth, parentView);
|
|
264
283
|
}
|
|
265
284
|
|
|
266
285
|
/**
|
|
@@ -276,6 +295,30 @@ export default class DynamicHost extends Control {
|
|
|
276
295
|
return this._innerHost.triggerSubmit();
|
|
277
296
|
}
|
|
278
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Injects a custom error message onto a specific field.
|
|
300
|
+
* Useful for injecting custom backend validation errors.
|
|
301
|
+
*
|
|
302
|
+
* @param {string} fieldPath The schema key path to target.
|
|
303
|
+
* @param {string} message The custom error message to display.
|
|
304
|
+
*/
|
|
305
|
+
public addCustomError(fieldPath: string, message: string): void {
|
|
306
|
+
if (this._innerHost && typeof (this._innerHost as any).addCustomError === "function") {
|
|
307
|
+
(this._innerHost as any).addCustomError(fieldPath, message);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Clears a custom error message from a specific field.
|
|
313
|
+
*
|
|
314
|
+
* @param {string} fieldPath The schema key path to target.
|
|
315
|
+
*/
|
|
316
|
+
public clearCustomError(fieldPath: string): void {
|
|
317
|
+
if (this._innerHost && typeof (this._innerHost as any).clearCustomError === "function") {
|
|
318
|
+
(this._innerHost as any).clearCustomError(fieldPath);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
279
322
|
/**
|
|
280
323
|
* Overrides standard UI5 getProperty to transparently pull extracted data from the inner host.
|
|
281
324
|
* Ensures that querying the DynamicHost facade for `data` always yields the freshest payload.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNormalizer", "../../core/SchemaValidator", "../../core/Engine", "../../core/StateManager", "./delegates/DataSyncDelegate", "./delegates/ValidationDelegate", "./delegates/DialogDelegate", "sap/m/MessageBox", "../../core/PluginRegistry"], function (Control, ____utils_Logger, ____core_SchemaNormalizer, ____core_SchemaValidator, ____core_Engine, ____core_StateManager, ___delegates_DataSyncDelegate, ___delegates_ValidationDelegate, ___delegates_DialogDelegate, MessageBox, ____core_PluginRegistry) {
|
|
1
|
+
sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNormalizer", "../../core/SchemaValidator", "../../core/Engine", "../../core/StateManager", "./delegates/DataSyncDelegate", "./delegates/ValidationDelegate", "./delegates/DialogDelegate", "sap/m/MessageBox", "sap/m/MessageStrip", "sap/m/VBox", "../../core/PluginRegistry"], function (Control, ____utils_Logger, ____core_SchemaNormalizer, ____core_SchemaValidator, ____core_Engine, ____core_StateManager, ___delegates_DataSyncDelegate, ___delegates_ValidationDelegate, ___delegates_DialogDelegate, MessageBox, MessageStrip, VBox, ____core_PluginRegistry) {
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
const Logger = ____utils_Logger["Logger"];
|
|
@@ -146,6 +146,16 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
146
146
|
type: "string"
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
+
},
|
|
150
|
+
error: {
|
|
151
|
+
parameters: {
|
|
152
|
+
message: {
|
|
153
|
+
type: "string"
|
|
154
|
+
},
|
|
155
|
+
exception: {
|
|
156
|
+
type: "object"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
149
159
|
}
|
|
150
160
|
}
|
|
151
161
|
},
|
|
@@ -161,10 +171,10 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
161
171
|
/** Cached schema for intelligent diffing during inference mode hot-swaps */
|
|
162
172
|
this.parsedSchema = null;
|
|
163
173
|
/**
|
|
164
|
-
* Internal reference to the active
|
|
165
|
-
* Prevents
|
|
174
|
+
* Internal reference to the active generate promise.
|
|
175
|
+
* Prevents concurrent redundant layouts from being generated when properties are set rapidly or DialogDelegate triggers it.
|
|
166
176
|
*/
|
|
167
|
-
this.
|
|
177
|
+
this._generatePromise = null;
|
|
168
178
|
},
|
|
169
179
|
/**
|
|
170
180
|
* Initializes the control and instantiates the composition delegates.
|
|
@@ -188,6 +198,16 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
188
198
|
Logger.setDebugMode(enabled);
|
|
189
199
|
return this;
|
|
190
200
|
},
|
|
201
|
+
/**
|
|
202
|
+
* Intercepts property updates to dynamically forward them to active delegates/managers.
|
|
203
|
+
*/
|
|
204
|
+
setProperty: function _setProperty(propertyName, value, suppressInvalidate) {
|
|
205
|
+
Control.prototype.setProperty.call(this, propertyName, value, suppressInvalidate);
|
|
206
|
+
if (propertyName === "useMessageManager" && this.stateManager) {
|
|
207
|
+
this.stateManager.setUseMessageManager(value === true);
|
|
208
|
+
}
|
|
209
|
+
return this;
|
|
210
|
+
},
|
|
191
211
|
/**
|
|
192
212
|
* Returns the active state manager instance managing the JSON payload.
|
|
193
213
|
*/
|
|
@@ -270,8 +290,13 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
270
290
|
const hasData = !!this.getProperty("dataJson") || !!this.getProperty("data");
|
|
271
291
|
if (hasSchema || hasData) {
|
|
272
292
|
this.generate();
|
|
273
|
-
} else
|
|
274
|
-
|
|
293
|
+
} else {
|
|
294
|
+
const msg = "GeneratorHost skipped rendering. Neither 'schemaDefinition' nor 'data' was provided.";
|
|
295
|
+
Logger.error("[MetaUI]", msg, "GeneratorHost");
|
|
296
|
+
this.fireEvent("error", {
|
|
297
|
+
message: msg
|
|
298
|
+
});
|
|
299
|
+
throw new Error(msg); // Eradicate silent errors
|
|
275
300
|
}
|
|
276
301
|
}
|
|
277
302
|
},
|
|
@@ -284,7 +309,10 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
284
309
|
if (this.stateManager && this.engine) {
|
|
285
310
|
let isPrevented = false;
|
|
286
311
|
this.validationDelegate.removeAllMessages();
|
|
287
|
-
|
|
312
|
+
|
|
313
|
+
// Only apply local fallback visual states if the global MessageManager is explicitly disabled
|
|
314
|
+
const applyVisualFallback = this.getProperty("useMessageManager") !== true;
|
|
315
|
+
const errors = this.engine.validateAll(applyVisualFallback);
|
|
288
316
|
if (errors.length > 0) {
|
|
289
317
|
this.validationDelegate.pushMessage("", "One or more fields failed schema validation. Please review the highlighted fields.");
|
|
290
318
|
for (const err of errors) {
|
|
@@ -304,6 +332,12 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
304
332
|
addError: (propertyPath, errorMessage) => {
|
|
305
333
|
isPrevented = true;
|
|
306
334
|
this.validationDelegate.pushMessage(propertyPath, errorMessage);
|
|
335
|
+
if (applyVisualFallback && this.engine) {
|
|
336
|
+
const plugin = this.engine.getPluginByPath(propertyPath);
|
|
337
|
+
if (plugin && typeof plugin.setVisualValidationState === "function") {
|
|
338
|
+
plugin.setVisualValidationState(false, errorMessage);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
307
341
|
}
|
|
308
342
|
});
|
|
309
343
|
if (isPrevented) {
|
|
@@ -323,12 +357,25 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
323
357
|
*/
|
|
324
358
|
addCustomError: function _addCustomError(fieldPath, message) {
|
|
325
359
|
this.validationDelegate.addCustomError(fieldPath, message);
|
|
360
|
+
if (this.getProperty("useMessageManager") !== true && this.engine) {
|
|
361
|
+
const plugin = this.engine.getPluginByPath(fieldPath);
|
|
362
|
+
if (plugin && typeof plugin.setVisualValidationState === "function") {
|
|
363
|
+
plugin.setVisualValidationState(false, message);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
326
366
|
},
|
|
327
367
|
/**
|
|
328
368
|
* Clears a custom error message from a specific field.
|
|
329
369
|
*/
|
|
330
370
|
clearCustomError: function _clearCustomError(fieldPath) {
|
|
331
371
|
this.validationDelegate.clearCustomError(fieldPath);
|
|
372
|
+
if (this.getProperty("useMessageManager") !== true && this.engine) {
|
|
373
|
+
const plugin = this.engine.getPluginByPath(fieldPath);
|
|
374
|
+
if (plugin && typeof plugin.setVisualValidationState === "function") {
|
|
375
|
+
const schemaValid = plugin.validate();
|
|
376
|
+
plugin.setVisualValidationState(schemaValid.isValid, schemaValid.errorMessage);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
332
379
|
},
|
|
333
380
|
/**
|
|
334
381
|
* Toggles busy state on the host control.
|
|
@@ -341,7 +388,7 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
341
388
|
* Intercepts property changes. Hot-swaps data gracefully if it's an inputData change,
|
|
342
389
|
* or forces a full UI teardown if it's a structural property change (like schemaDefinition).
|
|
343
390
|
*/
|
|
344
|
-
setProperty: function
|
|
391
|
+
setProperty: function _setProperty2(propertyName, value, suppressInvalidate) {
|
|
345
392
|
if (propertyName === "dataJson" || propertyName === "data") {
|
|
346
393
|
this.dataSyncDelegate.handleInputDataHotSwap(propertyName, value, suppressInvalidate);
|
|
347
394
|
return this;
|
|
@@ -368,13 +415,20 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
368
415
|
* @returns Promise that resolves when the layout is successfully built and mounted.
|
|
369
416
|
*/
|
|
370
417
|
generate: async function _generate() {
|
|
371
|
-
|
|
418
|
+
if (this._generatePromise) {
|
|
419
|
+
return this._generatePromise;
|
|
420
|
+
}
|
|
421
|
+
this._generatePromise = Promise.resolve().then(async () => {
|
|
372
422
|
try {
|
|
373
423
|
await this._doGenerate();
|
|
374
424
|
} catch (e) {
|
|
375
425
|
Logger.error("[MetaUI]", "Error in deferred generate: " + e, "GeneratorHost");
|
|
426
|
+
throw e; // Ensure it bubbles up to awaiters
|
|
427
|
+
} finally {
|
|
428
|
+
this._generatePromise = null;
|
|
376
429
|
}
|
|
377
430
|
});
|
|
431
|
+
return this._generatePromise;
|
|
378
432
|
},
|
|
379
433
|
/**
|
|
380
434
|
* The underlying synchronous generator orchestration method.
|
|
@@ -400,25 +454,49 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
400
454
|
this.stateManager = null;
|
|
401
455
|
}
|
|
402
456
|
const rawSchema = this.getProperty("schemaDefinition");
|
|
457
|
+
const isSchemaEmpty = !rawSchema || typeof rawSchema === "object" && Object.keys(rawSchema).length === 0;
|
|
403
458
|
let inputData = this.getProperty("data");
|
|
404
459
|
const inputDataJson = this.getProperty("dataJson");
|
|
405
460
|
if (inputDataJson) {
|
|
406
461
|
try {
|
|
407
462
|
inputData = JSON.parse(inputDataJson);
|
|
408
463
|
} catch (e) {
|
|
409
|
-
|
|
464
|
+
const msg = "Failed to parse inputDataJson string: " + e.message;
|
|
465
|
+
Logger.error("[MetaUI]", msg, "GeneratorHost");
|
|
466
|
+
this.fireEvent("error", {
|
|
467
|
+
message: msg,
|
|
468
|
+
exception: e
|
|
469
|
+
});
|
|
470
|
+
throw new Error(msg); // Critical error instead of silent fallback
|
|
410
471
|
}
|
|
411
472
|
} else if (typeof inputData === "string") {
|
|
412
473
|
try {
|
|
413
474
|
inputData = JSON.parse(inputData);
|
|
414
475
|
} catch (e) {
|
|
415
|
-
|
|
476
|
+
const msg = "Failed to parse inputData string: " + e.message;
|
|
477
|
+
Logger.error("[MetaUI]", msg, "GeneratorHost");
|
|
478
|
+
this.fireEvent("error", {
|
|
479
|
+
message: msg,
|
|
480
|
+
exception: e
|
|
481
|
+
});
|
|
482
|
+
throw new Error(msg); // Critical error instead of silent fallback
|
|
416
483
|
}
|
|
417
484
|
}
|
|
418
485
|
|
|
419
486
|
// The internal payload represents the user's latest un-extracted edits. It must take priority.
|
|
420
|
-
const finalData = internalPayload || inputData
|
|
421
|
-
|
|
487
|
+
const finalData = internalPayload || inputData;
|
|
488
|
+
if (!finalData || Object.keys(finalData).length === 0) {
|
|
489
|
+
if (isSchemaEmpty) {
|
|
490
|
+
const msg = "No payload provided and no explicit schema defined. Cannot infer UI.";
|
|
491
|
+
Logger.error("[MetaUI]", msg, "GeneratorHost");
|
|
492
|
+
this.fireEvent("error", {
|
|
493
|
+
message: msg
|
|
494
|
+
});
|
|
495
|
+
throw new Error(msg);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
const schemaToNormalize = isSchemaEmpty ? null : rawSchema;
|
|
499
|
+
const normalizedSchema = SchemaNormalizer.normalize(schemaToNormalize, finalData);
|
|
422
500
|
|
|
423
501
|
// Cache the parsed/inferred schema so DataSyncDelegate can diff against it later
|
|
424
502
|
this.parsedSchema = normalizedSchema;
|
|
@@ -445,25 +523,61 @@ sap.ui.define(["sap/ui/core/Control", "../../utils/Logger", "../../core/SchemaNo
|
|
|
445
523
|
}
|
|
446
524
|
this.activeModelName = "metaUI_" + this.getId();
|
|
447
525
|
this.stateManager = new StateManager(finalData, normalizedSchema, this.activeModelName);
|
|
526
|
+
this.stateManager.setUseMessageManager(this.getProperty("useMessageManager") === true);
|
|
448
527
|
this.setModel(this.stateManager.getModel(), this.activeModelName);
|
|
449
|
-
|
|
528
|
+
if (!this.engine) {
|
|
529
|
+
const isEditable = this.getProperty("editable") !== false;
|
|
530
|
+
const useMessageManager = this.getProperty("useMessageManager") === true;
|
|
531
|
+
this.engine = new Engine(isEditable, useMessageManager);
|
|
532
|
+
}
|
|
450
533
|
this.generatedContent = this.engine.build(normalizedSchema, this.stateManager.getModel(), this.activeModelName, this.triggerSubmit.bind(this), this.getId(), this.onInternalFieldChange.bind(this));
|
|
451
|
-
|
|
534
|
+
let contentContainer = this.generatedContent;
|
|
535
|
+
const hasProperties = normalizedSchema && Object.keys(normalizedSchema).length > 0;
|
|
536
|
+
if (!hasProperties) {
|
|
537
|
+
const strip = new MessageStrip({
|
|
538
|
+
text: "Warning: The generated UI is blank. Reason: The schema (or inferred schema) contains no valid properties to render.",
|
|
539
|
+
type: "Warning",
|
|
540
|
+
showIcon: true,
|
|
541
|
+
showCloseButton: false
|
|
542
|
+
});
|
|
543
|
+
strip.addStyleClass("sapUiSmallMarginBottom");
|
|
544
|
+
contentContainer = new VBox({
|
|
545
|
+
items: [strip, this.generatedContent]
|
|
546
|
+
});
|
|
547
|
+
} else if (this.engine.hasPartialRenderingErrors) {
|
|
548
|
+
const strip = new MessageStrip({
|
|
549
|
+
text: "Layout partially rendered. Some fields failed to generate due to configuration errors.",
|
|
550
|
+
type: "Warning",
|
|
551
|
+
showIcon: true,
|
|
552
|
+
showCloseButton: true
|
|
553
|
+
});
|
|
554
|
+
strip.addStyleClass("sapUiSmallMarginBottom");
|
|
555
|
+
contentContainer = new VBox({
|
|
556
|
+
items: [strip, this.generatedContent]
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
this.setAggregation("_content", contentContainer);
|
|
452
560
|
this.validationDelegate.registerObject(this.generatedContent);
|
|
453
561
|
const payload = this.stateManager.extractPayload();
|
|
454
562
|
this.dataSyncDelegate.pushToBindings(payload);
|
|
455
563
|
} catch (error) {
|
|
456
564
|
this.setBusy(false);
|
|
457
|
-
|
|
565
|
+
const msg = "Fatal crash during layout generation: " + error.message;
|
|
566
|
+
Logger.error("[MetaUI]", msg, "GeneratorHost");
|
|
567
|
+
this.fireEvent("error", {
|
|
568
|
+
message: msg,
|
|
569
|
+
exception: error
|
|
570
|
+
});
|
|
458
571
|
this.validationDelegate.mountCrashBoundary(error);
|
|
572
|
+
throw error; // Completely eliminate silent error swallowing
|
|
459
573
|
}
|
|
460
574
|
},
|
|
461
575
|
/**
|
|
462
576
|
* Programmatic API. Re-parents the generated content into a dialog and opens it.
|
|
463
577
|
*/
|
|
464
|
-
openInDialog: function _openInDialog(title = "Form", submitButtonText = "OK") {
|
|
578
|
+
openInDialog: function _openInDialog(title = "Form", submitButtonText = "OK", cancelButtonText = "Cancel", dialogWidth = "800px", parentView) {
|
|
465
579
|
const isGenerated = !!this.generatedContent;
|
|
466
|
-
this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated);
|
|
580
|
+
this.dialogDelegate.openInDialog(title, submitButtonText, isGenerated, cancelButtonText, dialogWidth, parentView);
|
|
467
581
|
}
|
|
468
582
|
});
|
|
469
583
|
return GeneratorHost;
|