@siliconst/metaui 1.4.10 → 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 +46 -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 +41 -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 +34 -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 +16 -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 +36 -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/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 +41 -40
- 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/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 +5 -1
- 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 +5 -1
- 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/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 +1 -1
- 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.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 +1 -1
- 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
|
@@ -34,6 +34,7 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
|
|
|
34
34
|
// Phase 1 Mappings
|
|
35
35
|
this.registerPluginPath("string", "fileUploader", "nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin");
|
|
36
36
|
this.registerPluginPath("array", "multiSelect", "nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin");
|
|
37
|
+
this.registerPluginPath("array", "multiInput", "nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin");
|
|
37
38
|
this.registerPluginPath("number", "slider", "nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin");
|
|
38
39
|
this.registerPluginPath("number", "rating", "nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin");
|
|
39
40
|
this.registerPluginPath("string", "messageStrip", "nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin");
|
|
@@ -118,7 +119,9 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
|
|
|
118
119
|
try {
|
|
119
120
|
pathsToLoad.add(this.getFieldPath(prop.type || "string", prop.ui?.widget));
|
|
120
121
|
} catch (e) {
|
|
121
|
-
|
|
122
|
+
const msg = `[MetaUI LazyLoad] Could not find mapped plugin for field ${key}: ${e.message}`;
|
|
123
|
+
Logger.error(msg);
|
|
124
|
+
throw new Error(msg);
|
|
122
125
|
}
|
|
123
126
|
if (prop.properties) scanProperties(prop.properties);
|
|
124
127
|
if (prop.items && prop.items.properties) scanProperties(prop.items.properties);
|
|
@@ -126,7 +129,9 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
|
|
|
126
129
|
try {
|
|
127
130
|
pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));
|
|
128
131
|
} catch (e) {
|
|
129
|
-
|
|
132
|
+
const msg = `[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}: ${e.message}`;
|
|
133
|
+
Logger.error(msg);
|
|
134
|
+
throw new Error(msg);
|
|
130
135
|
}
|
|
131
136
|
}
|
|
132
137
|
}
|
|
@@ -166,6 +171,10 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
|
|
|
166
171
|
});
|
|
167
172
|
await Promise.all(promises);
|
|
168
173
|
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Extracts a valid constructor from a dynamically required module.
|
|
177
|
+
*/
|
|
169
178
|
extractConstructor(Module) {
|
|
170
179
|
if (!Module) return null;
|
|
171
180
|
if (typeof Module === "function") return Module;
|
|
@@ -180,6 +189,10 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
|
|
|
180
189
|
}
|
|
181
190
|
return null;
|
|
182
191
|
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Instantiates the requested plugin for the given field type.
|
|
195
|
+
*/
|
|
183
196
|
getPlugin(type, widgetName) {
|
|
184
197
|
const path = this.getFieldPath(type, widgetName);
|
|
185
198
|
const Module = sap.ui.require(path);
|
|
@@ -189,6 +202,10 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
|
|
|
189
202
|
}
|
|
190
203
|
return new PluginClass();
|
|
191
204
|
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Instantiates the requested layout manager for the given strategy.
|
|
208
|
+
*/
|
|
192
209
|
getLayout(strategy) {
|
|
193
210
|
const path = this.getLayoutPath(strategy);
|
|
194
211
|
const Module = sap.ui.require(path);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginRegistry-dbg.js","names":["Logger","___utils_Logger","PluginRegistry","fieldIndex","actionIndex","layoutIndex","activePromises","constructor","registerPluginPath","undefined","registerLayoutPath","getInstance","instance","type","widgetName","path","key","registerActionPath","actionName","strategy","getFieldPath","Error","getLayoutPath","getPathsToLoad","schema","pathsToLoad","Set","layoutStrategy","add","scanProperties","props","prop","ui","widget","e","warn","properties","items","preloadDependencies","promises","Array","from","map","Promise","resolve","reject","sap","require","Module","err","error","all","extractConstructor","default","keys","Object","getPlugin","PluginClass","getLayout","LayoutClass","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\n * @file PluginRegistry.ts\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\n * NOW WITH UNIVERSAL LAZY LOADING.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { FieldType, ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\n\nexport class PluginRegistry {\n private static instance: PluginRegistry;\n \n private fieldIndex: Record<string, string> = {};\n private actionIndex: Record<string, string> = {};\n private layoutIndex: Record<string, string> = {};\n \n private activePromises: Record<string, Promise<unknown>> = {};\n\n private constructor() {\n // Core Mappings\n this.registerPluginPath(\"string\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin\");\n this.registerPluginPath(\"number\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"integer\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"date\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin\");\n this.registerPluginPath(\"boolean\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin\");\n this.registerPluginPath(\"array\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin\");\n this.registerPluginPath(\"object\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin\");\n\n // Widget Overrides\n this.registerPluginPath(\"string\", \"time\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin\");\n this.registerPluginPath(\"string\", \"datetime\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin\");\n this.registerPluginPath(\"boolean\", \"switch\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin\");\n this.registerPluginPath(\"string\", \"select\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin\");\n this.registerPluginPath(\"string\", \"textArea\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin\");\n this.registerPluginPath(\"string\", \"codeEditor\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin\");\n \n // Phase 1 Mappings\n this.registerPluginPath(\"string\", \"fileUploader\", \"nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin\");\n this.registerPluginPath(\"array\", \"multiSelect\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin\");\n this.registerPluginPath(\"number\", \"slider\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin\");\n this.registerPluginPath(\"number\", \"rating\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin\");\n this.registerPluginPath(\"string\", \"messageStrip\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin\");\n\n // Phase 5 Mappings (Hardware)\n this.registerPluginPath(\"string\", \"camera\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin\");\n this.registerPluginPath(\"string\", \"signature\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin\");\n this.registerPluginPath(\"object\", \"location\", \"nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin\");\n this.registerPluginPath(\"string\", \"scanner\", \"nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin\");\n this.registerPluginPath(\"string\", \"voiceInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin\");\n this.registerPluginPath(\"string\", \"richText\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin\");\n\n // Actions & Datasources\n this.registerPluginPath(\"string\", \"urlButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin\");\n this.registerPluginPath(\"string\", \"submitButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin\");\n this.registerPluginPath(\"string\", \"odataSelect\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin\");\n this.registerPluginPath(\"string\", \"remoteDropdown\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin\");\n this.registerPluginPath(\"string\", \"liveSearch\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin\");\n this.registerPluginPath(\"string\", \"remoteValueHelp\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin\");\n\n // Layouts\n this.registerLayoutPath(\"form\", \"nz/co/siliconst/ui5/metaui/layouts/FormLayout\");\n this.registerLayoutPath(\"table\", \"nz/co/siliconst/ui5/metaui/layouts/TableLayout\");\n this.registerLayoutPath(\"wizard\", \"nz/co/siliconst/ui5/metaui/layouts/WizardLayout\");\n this.registerLayoutPath(\"compact\", \"nz/co/siliconst/ui5/metaui/layouts/CompactLayout\");\n }\n\n public static getInstance(): PluginRegistry {\n if (!PluginRegistry.instance) {\n PluginRegistry.instance = new PluginRegistry();\n }\n return PluginRegistry.instance;\n }\n\n public registerPluginPath(type: FieldType, widgetName: string | undefined, path: string): void {\n const key = widgetName ? `${type}:${widgetName}` : type;\n this.fieldIndex[key] = path;\n }\n\n public registerActionPath(actionName: string, path: string): void {\n this.actionIndex[actionName] = path;\n }\n\n public registerLayoutPath(strategy: string, path: string): void {\n this.layoutIndex[strategy] = path;\n }\n\n private getFieldPath(type: FieldType, widgetName?: string): string {\n let path;\n if (widgetName) {\n path = this.fieldIndex[`${type}:${widgetName}`];\n }\n if (!path) {\n path = this.fieldIndex[type];\n }\n if (!path) {\n throw new Error(`No plugin path mapped for FieldType: ${type} (widget: ${widgetName})`);\n }\n return path;\n }\n\n private getLayoutPath(strategy: string): string {\n const path = this.layoutIndex[strategy];\n if (!path) {\n throw new Error(`No layout path mapped for strategy: ${strategy}`);\n }\n return path;\n }\n\n /**\n * Statically traverses the schema structure to identify all required plugins\n * and layouts without actually instantiating them.\n * \n * @param {ISchema} schema The root JSON schema payload to traverse\n * @returns {Set<string>} A distinct set of UI5 module paths required to render the schema\n */\n public getPathsToLoad(schema: ISchema): Set<string> {\n const pathsToLoad = new Set<string>();\n \n // 1. Gather layout strategy\n const strategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n pathsToLoad.add(this.getLayoutPath(strategy));\n\n // 2. Recursively gather field plugins\n const scanProperties = (props: Record<string, IPropertyMetadata>) => {\n for (const key in props) {\n const prop = props[key];\n try {\n pathsToLoad.add(this.getFieldPath(prop.type || \"string\", prop.ui?.widget));\n } catch (e) {\n Logger.warn(`[MetaUI LazyLoad] Could not find mapped plugin for field ${key}`);\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n if (prop.items && prop.items.type) {\n try {\n pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));\n } catch (e) {\n Logger.warn(`[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}`);\n }\n }\n }\n };\n\n if (schema.properties) {\n scanProperties(schema.properties);\n } else if (schema.items && schema.items.properties) {\n scanProperties(schema.items.properties);\n }\n\n return pathsToLoad;\n }\n\n /**\n * Defers the generation of the UI until all required UI5 modules have been\n * downloaded asynchronously. Maintains a cache of active promises to prevent\n * redundant network requests for the same module.\n * \n * @param {ISchema} schema The root JSON schema payload to parse\n * @returns {Promise<void>} Resolves when all dependencies are securely in the UI5 require cache\n */\n public async preloadDependencies(schema: ISchema): Promise<void> {\n const pathsToLoad = this.getPathsToLoad(schema);\n\n // 3. Batch execute sap.ui.require via Promises\n const promises = Array.from(pathsToLoad).map(path => {\n if (!this.activePromises[path]) {\n this.activePromises[path] = new Promise((resolve, reject) => {\n sap.ui.require([path], \n (Module: unknown) => resolve(Module), \n (err: unknown) => {\n Logger.error(`Failed to lazy load module: ${path}`);\n // CRITICAL: Delete from cache so future attempts can retry the network request\n delete this.activePromises[path];\n reject(err);\n }\n );\n });\n }\n return this.activePromises[path];\n });\n\n await Promise.all(promises);\n }\n\n private extractConstructor(Module: unknown): new () => IPlugin | ILayoutManager | null {\n if (!Module) return null;\n if (typeof Module === \"function\") return Module;\n if (Module.default && typeof Module.default === \"function\") return Module.default;\n \n // Handle namespace exports (e.g. { FormLayout: class... })\n const keys = Object.keys(Module);\n for (const key of keys) {\n if (typeof Module[key] === \"function\") {\n return Module[key];\n }\n }\n return null;\n }\n\n public getPlugin(type: FieldType, widgetName?: string): IPlugin {\n const path = this.getFieldPath(type, widgetName);\n const Module = sap.ui.require(path);\n const PluginClass = this.extractConstructor(Module);\n \n if (!PluginClass) {\n throw new Error(`[MetaUI Plugin Instantiation] Plugin ${path} was not preloaded or has no constructor!`);\n }\n \n return new PluginClass();\n }\n\n public getLayout(strategy: string): ILayoutManager {\n const path = this.getLayoutPath(strategy);\n const Module = sap.ui.require(path);\n const LayoutClass = this.extractConstructor(Module);\n \n if (!LayoutClass) {\n throw new Error(`[MetaUI Layout Instantiation] Layout ${path} was not preloaded or has no constructor!`);\n }\n \n return new LayoutClass();\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;AACA;AACA;EALA,MAUSA,MAAM,GAAAC,eAAA;EAGR,MAAMC,cAAc,CAAC;IAGhBC,UAAU,GAA2B,CAAC,CAAC;IACvCC,WAAW,GAA2B,CAAC,CAAC;IACxCC,WAAW,GAA2B,CAAC,CAAC;IAExCC,cAAc,GAAqC,CAAC,CAAC;IAErDC,WAAWA,CAAA,EAAG;MAClB;MACA,IAAI,CAACC,kBAAkB,CAAC,QAAQ,EAAEC,SAAS,EAAE,0DAA0D,CAAC;MACxG,IAAI,CAACD,kBAAkB,CAAC,QAAQ,EAAEC,SAAS,EAAE,0DAA0D,CAAC;MACxG,IAAI,CAACD,kBAAkB,CAAC,SAAS,EAAEC,SAAS,EAAE,0DAA0D,CAAC;MACzG,IAAI,CAACD,kBAAkB,CAAC,MAAM,EAAEC,SAAS,EAAE,wDAAwD,CAAC;MACpG,IAAI,CAACD,kBAAkB,CAAC,SAAS,EAAEC,SAAS,EAAE,2DAA2D,CAAC;MAC1G,IAAI,CAACD,kBAAkB,CAAC,OAAO,EAAEC,SAAS,EAAE,yDAAyD,CAAC;MACtG,IAAI,CAACD,kBAAkB,CAAC,QAAQ,EAAEC,SAAS,EAAE,0DAA0D,CAAC;;MAExG;MACA,IAAI,CAACD,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,wDAAwD,CAAC;MACnG,IAAI,CAACA,kBAAkB,CAAC,QAAQ,EAAE,UAAU,EAAE,4DAA4D,CAAC;MAC3G,IAAI,CAACA,kBAAkB,CAAC,SAAS,EAAE,QAAQ,EAAE,0DAA0D,CAAC;MACxG,IAAI,CAACA,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAA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CN,IAAI,2CAA2C,CAAC;MAC5G;MAEA,OAAO,IAAI0C,WAAW,CAAC,CAAC;IAC5B;IAEOC,SAASA,CAACvC,QAAgB,EAAkB;MAC/C,MAAMJ,IAAI,GAAG,IAAI,CAACO,aAAa,CAACH,QAAQ,CAAC;MACzC,MAAM6B,MAAM,GAAGF,GAAG,CAACd,EAAE,CAACe,OAAO,CAAChC,IAAI,CAAC;MACnC,MAAM4C,WAAW,GAAG,IAAI,CAACP,kBAAkB,CAACJ,MAAM,CAAC;MAEnD,IAAI,CAACW,WAAW,EAAE;QACd,MAAM,IAAItC,KAAK,CAAC,wCAAwCN,IAAI,2CAA2C,CAAC;MAC5G;MAEA,OAAO,IAAI4C,WAAW,CAAC,CAAC;IAC5B;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA1D,cAAA,GAAAA,cAAA;EAAA,OAAA0D,SAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"PluginRegistry-dbg.js","names":["Logger","___utils_Logger","PluginRegistry","fieldIndex","actionIndex","layoutIndex","activePromises","constructor","registerPluginPath","undefined","registerLayoutPath","getInstance","instance","type","widgetName","path","key","registerActionPath","actionName","strategy","getFieldPath","Error","getLayoutPath","getPathsToLoad","schema","pathsToLoad","Set","layoutStrategy","add","scanProperties","props","prop","ui","widget","e","msg","message","error","properties","items","preloadDependencies","promises","Array","from","map","Promise","resolve","reject","sap","require","Module","err","all","extractConstructor","default","keys","Object","getPlugin","PluginClass","getLayout","LayoutClass","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\n * @file PluginRegistry.ts\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\n * NOW WITH UNIVERSAL LAZY LOADING.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { FieldType, ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\n\nexport class PluginRegistry {\n private static instance: PluginRegistry;\n \n private fieldIndex: Record<string, string> = {};\n private actionIndex: Record<string, string> = {};\n private layoutIndex: Record<string, string> = {};\n \n private activePromises: Record<string, Promise<unknown>> = {};\n\n private constructor() {\n // Core Mappings\n this.registerPluginPath(\"string\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin\");\n this.registerPluginPath(\"number\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"integer\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"date\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin\");\n this.registerPluginPath(\"boolean\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin\");\n this.registerPluginPath(\"array\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin\");\n this.registerPluginPath(\"object\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin\");\n\n // Widget Overrides\n this.registerPluginPath(\"string\", \"time\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin\");\n this.registerPluginPath(\"string\", \"datetime\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin\");\n this.registerPluginPath(\"boolean\", \"switch\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin\");\n this.registerPluginPath(\"string\", \"select\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin\");\n this.registerPluginPath(\"string\", \"textArea\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin\");\n this.registerPluginPath(\"string\", \"codeEditor\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin\");\n \n // Phase 1 Mappings\n this.registerPluginPath(\"string\", \"fileUploader\", \"nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin\");\n this.registerPluginPath(\"array\", \"multiSelect\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin\");\n this.registerPluginPath(\"array\", \"multiInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin\");\n this.registerPluginPath(\"number\", \"slider\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin\");\n this.registerPluginPath(\"number\", \"rating\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin\");\n this.registerPluginPath(\"string\", \"messageStrip\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin\");\n\n // Phase 5 Mappings (Hardware)\n this.registerPluginPath(\"string\", \"camera\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin\");\n this.registerPluginPath(\"string\", \"signature\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin\");\n this.registerPluginPath(\"object\", \"location\", \"nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin\");\n this.registerPluginPath(\"string\", \"scanner\", \"nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin\");\n this.registerPluginPath(\"string\", \"voiceInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin\");\n this.registerPluginPath(\"string\", \"richText\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin\");\n\n // Actions & Datasources\n this.registerPluginPath(\"string\", \"urlButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin\");\n this.registerPluginPath(\"string\", \"submitButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin\");\n this.registerPluginPath(\"string\", \"odataSelect\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin\");\n this.registerPluginPath(\"string\", \"remoteDropdown\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin\");\n this.registerPluginPath(\"string\", \"liveSearch\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin\");\n this.registerPluginPath(\"string\", \"remoteValueHelp\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin\");\n\n // Layouts\n this.registerLayoutPath(\"form\", \"nz/co/siliconst/ui5/metaui/layouts/FormLayout\");\n this.registerLayoutPath(\"table\", \"nz/co/siliconst/ui5/metaui/layouts/TableLayout\");\n this.registerLayoutPath(\"wizard\", \"nz/co/siliconst/ui5/metaui/layouts/WizardLayout\");\n this.registerLayoutPath(\"compact\", \"nz/co/siliconst/ui5/metaui/layouts/CompactLayout\");\n }\n\n public static getInstance(): PluginRegistry {\n if (!PluginRegistry.instance) {\n PluginRegistry.instance = new PluginRegistry();\n }\n return PluginRegistry.instance;\n }\n\n public registerPluginPath(type: FieldType, widgetName: string | undefined, path: string): void {\n const key = widgetName ? `${type}:${widgetName}` : type;\n this.fieldIndex[key] = path;\n }\n\n public registerActionPath(actionName: string, path: string): void {\n this.actionIndex[actionName] = path;\n }\n\n public registerLayoutPath(strategy: string, path: string): void {\n this.layoutIndex[strategy] = path;\n }\n\n private getFieldPath(type: FieldType, widgetName?: string): string {\n let path;\n if (widgetName) {\n path = this.fieldIndex[`${type}:${widgetName}`];\n }\n if (!path) {\n path = this.fieldIndex[type];\n }\n if (!path) {\n throw new Error(`No plugin path mapped for FieldType: ${type} (widget: ${widgetName})`);\n }\n return path;\n }\n\n private getLayoutPath(strategy: string): string {\n const path = this.layoutIndex[strategy];\n if (!path) {\n throw new Error(`No layout path mapped for strategy: ${strategy}`);\n }\n return path;\n }\n\n /**\n * Statically traverses the schema structure to identify all required plugins\n * and layouts without actually instantiating them.\n * \n * @param {ISchema} schema The root JSON schema payload to traverse\n * @returns {Set<string>} A distinct set of UI5 module paths required to render the schema\n */\n public getPathsToLoad(schema: ISchema): Set<string> {\n const pathsToLoad = new Set<string>();\n \n // 1. Gather layout strategy\n const strategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n pathsToLoad.add(this.getLayoutPath(strategy));\n\n // 2. Recursively gather field plugins\n const scanProperties = (props: Record<string, IPropertyMetadata>) => {\n for (const key in props) {\n const prop = props[key];\n try {\n pathsToLoad.add(this.getFieldPath(prop.type || \"string\", prop.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for field ${key}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n if (prop.items && prop.items.type) {\n try {\n pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n }\n }\n };\n\n if (schema.properties) {\n scanProperties(schema.properties);\n } else if (schema.items && schema.items.properties) {\n scanProperties(schema.items.properties);\n }\n\n return pathsToLoad;\n }\n\n /**\n * Defers the generation of the UI until all required UI5 modules have been\n * downloaded asynchronously. Maintains a cache of active promises to prevent\n * redundant network requests for the same module.\n * \n * @param {ISchema} schema The root JSON schema payload to parse\n * @returns {Promise<void>} Resolves when all dependencies are securely in the UI5 require cache\n */\n public async preloadDependencies(schema: ISchema): Promise<void> {\n const pathsToLoad = this.getPathsToLoad(schema);\n\n // 3. Batch execute sap.ui.require via Promises\n const promises = Array.from(pathsToLoad).map(path => {\n if (!this.activePromises[path]) {\n this.activePromises[path] = new Promise((resolve, reject) => {\n sap.ui.require([path], \n (Module: unknown) => resolve(Module), \n (err: unknown) => {\n Logger.error(`Failed to lazy load module: ${path}`);\n // CRITICAL: Delete from cache so future attempts can retry the network request\n delete this.activePromises[path];\n reject(err);\n }\n );\n });\n }\n return this.activePromises[path];\n });\n\n await Promise.all(promises);\n }\n\n /**\n * Extracts a valid constructor from a dynamically required module.\n */\n private extractConstructor(Module: unknown): new () => IPlugin | ILayoutManager | null {\n if (!Module) return null;\n if (typeof Module === \"function\") return Module as any;\n if ((Module as any).default && typeof (Module as any).default === \"function\") return (Module as any).default;\n \n // Handle namespace exports (e.g. { FormLayout: class... })\n const keys = Object.keys(Module as object);\n for (const key of keys) {\n if (typeof (Module as any)[key] === \"function\") {\n return (Module as any)[key];\n }\n }\n return null;\n }\n\n /**\n * Instantiates the requested plugin for the given field type.\n */\n public getPlugin(type: FieldType, widgetName?: string): IPlugin {\n const path = this.getFieldPath(type, widgetName);\n const Module = sap.ui.require(path);\n const PluginClass = this.extractConstructor(Module);\n \n if (!PluginClass) {\n throw new Error(`[MetaUI Plugin Instantiation] Plugin ${path} was not preloaded or has no constructor!`);\n }\n \n return new PluginClass();\n }\n\n /**\n * Instantiates the requested layout manager for the given strategy.\n */\n public getLayout(strategy: string): ILayoutManager {\n const path = this.getLayoutPath(strategy);\n const Module = sap.ui.require(path);\n const LayoutClass = this.extractConstructor(Module);\n \n if (!LayoutClass) {\n throw new Error(`[MetaUI Layout Instantiation] Layout ${path} was not preloaded or has no constructor!`);\n }\n \n return new LayoutClass();\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;AACA;AACA;EALA,MAUSA,MAAM,GAAAC,eAAA;EAGR,MAAMC,cAAc,CAAC;IAGhBC,UAAU,GAA2B,CAAC,CAAC;IACvCC,WAAW,GAA2B,CAAC,CAAC;IACxCC,WAAW,GAA2B,CAAC,CAAC;IAExCC,cAAc,GAAqC,CAAC,CAAC;IAErDC,WAAWA,CAAA,EAAG;MAClB;MACA,IAAI,CAACC,kBAAkB,CAAC,QAAQ,EAAEC,SAAS,EAAE,0DAA0D,CAAC;MACxG,IAAI,CAACD,kBAAkB,CAAC,QAAQ,EAAEC,SAAS,EAAE,0DAA0D,CAAC;MACxG,IAAI,CAACD,kBAAkB,CAAC,SAAS,EAAEC,SAAS,EAAE,0DAA0D,CAAC;MACzG,IAAI,CAACD,kB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CAACU,WAAW,EAAE;QACd,MAAM,IAAIvC,KAAK,CAAC,wCAAwCN,IAAI,2CAA2C,CAAC;MAC5G;MAEA,OAAO,IAAI6C,WAAW,CAAC,CAAC;IAC5B;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA3D,cAAA,GAAAA,cAAA;EAAA,OAAA2D,SAAA;AAAA","ignoreList":[]}
|
|
@@ -38,8 +38,17 @@ declare module "nz/co/siliconst/ui5/metaui/core/PluginRegistry" {
|
|
|
38
38
|
* @returns {Promise<void>} Resolves when all dependencies are securely in the UI5 require cache
|
|
39
39
|
*/
|
|
40
40
|
preloadDependencies(schema: ISchema): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Extracts a valid constructor from a dynamically required module.
|
|
43
|
+
*/
|
|
41
44
|
private extractConstructor;
|
|
45
|
+
/**
|
|
46
|
+
* Instantiates the requested plugin for the given field type.
|
|
47
|
+
*/
|
|
42
48
|
getPlugin(type: FieldType, widgetName?: string): IPlugin;
|
|
49
|
+
/**
|
|
50
|
+
* Instantiates the requested layout manager for the given strategy.
|
|
51
|
+
*/
|
|
43
52
|
getLayout(strategy: string): ILayoutManager;
|
|
44
53
|
}
|
|
45
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginRegistry.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gDAAgD,CAAC;IAChE;;;;;OAKG;IAEH,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;IACxE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAqB,MAAM,+CAA+C,CAAC;IACtG,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;IAItF,MAAa,cAAc;QACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;QAExC,OAAO,CAAC,UAAU,CAA8B;QAChD,OAAO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,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO;QAY/D;;WAEG;QACI,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc;KAWrD;CAEA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
sap.ui.define(["../utils/Logger"],function(i){"use strict";const t=i["Logger"];class e{fieldIndex={};actionIndex={};layoutIndex={};activePromises={};constructor(){this.registerPluginPath("string",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin");this.registerPluginPath("number",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("integer",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("date",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin");this.registerPluginPath("boolean",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin");this.registerPluginPath("array",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin");this.registerPluginPath("object",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin");this.registerPluginPath("string","time","nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin");this.registerPluginPath("string","datetime","nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin");this.registerPluginPath("boolean","switch","nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin");this.registerPluginPath("string","select","nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin");this.registerPluginPath("string","textArea","nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin");this.registerPluginPath("string","codeEditor","nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin");this.registerPluginPath("string","fileUploader","nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin");this.registerPluginPath("array","multiSelect","nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin");this.registerPluginPath("number","slider","nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin");this.registerPluginPath("number","rating","nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin");this.registerPluginPath("string","messageStrip","nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin");this.registerPluginPath("string","camera","nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin");this.registerPluginPath("string","signature","nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin");this.registerPluginPath("object","location","nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin");this.registerPluginPath("string","scanner","nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin");this.registerPluginPath("string","voiceInput","nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin");this.registerPluginPath("string","richText","nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin");this.registerPluginPath("string","urlButton","nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin");this.registerPluginPath("string","submitButton","nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin");this.registerPluginPath("string","odataSelect","nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin");this.registerPluginPath("string","remoteDropdown","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin");this.registerPluginPath("string","liveSearch","nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin");this.registerPluginPath("string","remoteValueHelp","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin");this.registerLayoutPath("form","nz/co/siliconst/ui5/metaui/layouts/FormLayout");this.registerLayoutPath("table","nz/co/siliconst/ui5/metaui/layouts/TableLayout");this.registerLayoutPath("wizard","nz/co/siliconst/ui5/metaui/layouts/WizardLayout");this.registerLayoutPath("compact","nz/co/siliconst/ui5/metaui/layouts/CompactLayout")}static getInstance(){if(!e.instance){e.instance=new e}return e.instance}registerPluginPath(i,t,e){const n=t?`${i}:${t}`:i;this.fieldIndex[n]=e}registerActionPath(i,t){this.actionIndex[i]=t}registerLayoutPath(i,t){this.layoutIndex[i]=t}getFieldPath(i,t){let e;if(t){e=this.fieldIndex[`${i}:${t}`]}if(!e){e=this.fieldIndex[i]}if(!e){throw new Error(`No plugin path mapped for FieldType: ${i} (widget: ${t})`)}return e}getLayoutPath(i){const t=this.layoutIndex[i];if(!t){throw new Error(`No layout path mapped for strategy: ${i}`)}return t}getPathsToLoad(i){const e=new Set;const n=i.layoutStrategy||(i.type==="array"?"table":"form");e.add(this.getLayoutPath(n));const s=i=>{for(const n in i){const
|
|
1
|
+
sap.ui.define(["../utils/Logger"],function(i){"use strict";const t=i["Logger"];class e{fieldIndex={};actionIndex={};layoutIndex={};activePromises={};constructor(){this.registerPluginPath("string",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin");this.registerPluginPath("number",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("integer",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("date",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin");this.registerPluginPath("boolean",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin");this.registerPluginPath("array",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin");this.registerPluginPath("object",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin");this.registerPluginPath("string","time","nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin");this.registerPluginPath("string","datetime","nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin");this.registerPluginPath("boolean","switch","nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin");this.registerPluginPath("string","select","nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin");this.registerPluginPath("string","textArea","nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin");this.registerPluginPath("string","codeEditor","nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin");this.registerPluginPath("string","fileUploader","nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin");this.registerPluginPath("array","multiSelect","nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin");this.registerPluginPath("array","multiInput","nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin");this.registerPluginPath("number","slider","nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin");this.registerPluginPath("number","rating","nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin");this.registerPluginPath("string","messageStrip","nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin");this.registerPluginPath("string","camera","nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin");this.registerPluginPath("string","signature","nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin");this.registerPluginPath("object","location","nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin");this.registerPluginPath("string","scanner","nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin");this.registerPluginPath("string","voiceInput","nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin");this.registerPluginPath("string","richText","nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin");this.registerPluginPath("string","urlButton","nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin");this.registerPluginPath("string","submitButton","nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin");this.registerPluginPath("string","odataSelect","nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin");this.registerPluginPath("string","remoteDropdown","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin");this.registerPluginPath("string","liveSearch","nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin");this.registerPluginPath("string","remoteValueHelp","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin");this.registerLayoutPath("form","nz/co/siliconst/ui5/metaui/layouts/FormLayout");this.registerLayoutPath("table","nz/co/siliconst/ui5/metaui/layouts/TableLayout");this.registerLayoutPath("wizard","nz/co/siliconst/ui5/metaui/layouts/WizardLayout");this.registerLayoutPath("compact","nz/co/siliconst/ui5/metaui/layouts/CompactLayout")}static getInstance(){if(!e.instance){e.instance=new e}return e.instance}registerPluginPath(i,t,e){const n=t?`${i}:${t}`:i;this.fieldIndex[n]=e}registerActionPath(i,t){this.actionIndex[i]=t}registerLayoutPath(i,t){this.layoutIndex[i]=t}getFieldPath(i,t){let e;if(t){e=this.fieldIndex[`${i}:${t}`]}if(!e){e=this.fieldIndex[i]}if(!e){throw new Error(`No plugin path mapped for FieldType: ${i} (widget: ${t})`)}return e}getLayoutPath(i){const t=this.layoutIndex[i];if(!t){throw new Error(`No layout path mapped for strategy: ${i}`)}return t}getPathsToLoad(i){const e=new Set;const n=i.layoutStrategy||(i.type==="array"?"table":"form");e.add(this.getLayoutPath(n));const s=i=>{for(const n in i){const r=i[n];try{e.add(this.getFieldPath(r.type||"string",r.ui?.widget))}catch(i){const e=`[MetaUI LazyLoad] Could not find mapped plugin for field ${n}: ${i.message}`;t.error(e);throw new Error(e)}if(r.properties)s(r.properties);if(r.items&&r.items.properties)s(r.items.properties);if(r.items&&r.items.type){try{e.add(this.getFieldPath(r.items.type,r.items.ui?.widget))}catch(i){const e=`[MetaUI LazyLoad] Could not find mapped plugin for array item type ${r.items.type}: ${i.message}`;t.error(e);throw new Error(e)}}}};if(i.properties){s(i.properties)}else if(i.items&&i.items.properties){s(i.items.properties)}return e}async preloadDependencies(i){const e=this.getPathsToLoad(i);const n=Array.from(e).map(i=>{if(!this.activePromises[i]){this.activePromises[i]=new Promise((e,n)=>{sap.ui.require([i],i=>e(i),e=>{t.error(`Failed to lazy load module: ${i}`);delete this.activePromises[i];n(e)})})}return this.activePromises[i]});await Promise.all(n)}extractConstructor(i){if(!i)return null;if(typeof i==="function")return i;if(i.default&&typeof i.default==="function")return i.default;const t=Object.keys(i);for(const e of t){if(typeof i[e]==="function"){return i[e]}}return null}getPlugin(i,t){const e=this.getFieldPath(i,t);const n=sap.ui.require(e);const s=this.extractConstructor(n);if(!s){throw new Error(`[MetaUI Plugin Instantiation] Plugin ${e} was not preloaded or has no constructor!`)}return new s}getLayout(i){const t=this.getLayoutPath(i);const e=sap.ui.require(t);const n=this.extractConstructor(e);if(!n){throw new Error(`[MetaUI Layout Instantiation] Layout ${t} was not preloaded or has no constructor!`)}return new n}}var n={__esModule:true};n.PluginRegistry=e;return n});
|
|
2
2
|
//# sourceMappingURL=PluginRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginRegistry.js","names":["Logger","___utils_Logger","PluginRegistry","fieldIndex","actionIndex","layoutIndex","activePromises","constructor","this","registerPluginPath","undefined","registerLayoutPath","getInstance","instance","type","widgetName","path","key","registerActionPath","actionName","strategy","getFieldPath","Error","getLayoutPath","getPathsToLoad","schema","pathsToLoad","Set","layoutStrategy","add","scanProperties","props","prop","ui","widget","e","warn","properties","items","preloadDependencies","promises","Array","from","map","Promise","resolve","reject","sap","require","Module","err","error","all","extractConstructor","default","keys","Object","getPlugin","PluginClass","getLayout","LayoutClass","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\n * @file PluginRegistry.ts\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\n * NOW WITH UNIVERSAL LAZY LOADING.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { FieldType, ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\n\nexport class PluginRegistry {\n private static instance: PluginRegistry;\n \n private fieldIndex: Record<string, string> = {};\n private actionIndex: Record<string, string> = {};\n private layoutIndex: Record<string, string> = {};\n \n private activePromises: Record<string, Promise<unknown>> = {};\n\n private constructor() {\n // Core Mappings\n this.registerPluginPath(\"string\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin\");\n this.registerPluginPath(\"number\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"integer\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"date\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin\");\n this.registerPluginPath(\"boolean\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin\");\n this.registerPluginPath(\"array\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin\");\n this.registerPluginPath(\"object\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin\");\n\n // Widget Overrides\n this.registerPluginPath(\"string\", \"time\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin\");\n this.registerPluginPath(\"string\", \"datetime\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin\");\n this.registerPluginPath(\"boolean\", \"switch\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin\");\n this.registerPluginPath(\"string\", \"select\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin\");\n this.registerPluginPath(\"string\", \"textArea\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin\");\n this.registerPluginPath(\"string\", \"codeEditor\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin\");\n \n // Phase 1 Mappings\n this.registerPluginPath(\"string\", \"fileUploader\", \"nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin\");\n this.registerPluginPath(\"array\", \"multiSelect\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin\");\n this.registerPluginPath(\"number\", \"slider\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin\");\n this.registerPluginPath(\"number\", \"rating\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin\");\n this.registerPluginPath(\"string\", \"messageStrip\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin\");\n\n // Phase 5 Mappings (Hardware)\n this.registerPluginPath(\"string\", \"camera\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin\");\n this.registerPluginPath(\"string\", \"signature\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin\");\n this.registerPluginPath(\"object\", \"location\", \"nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin\");\n this.registerPluginPath(\"string\", \"scanner\", \"nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin\");\n this.registerPluginPath(\"string\", \"voiceInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin\");\n this.registerPluginPath(\"string\", \"richText\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin\");\n\n // Actions & Datasources\n this.registerPluginPath(\"string\", \"urlButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin\");\n this.registerPluginPath(\"string\", \"submitButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin\");\n this.registerPluginPath(\"string\", \"odataSelect\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin\");\n this.registerPluginPath(\"string\", \"remoteDropdown\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin\");\n this.registerPluginPath(\"string\", \"liveSearch\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin\");\n this.registerPluginPath(\"string\", \"remoteValueHelp\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin\");\n\n // Layouts\n this.registerLayoutPath(\"form\", \"nz/co/siliconst/ui5/metaui/layouts/FormLayout\");\n this.registerLayoutPath(\"table\", \"nz/co/siliconst/ui5/metaui/layouts/TableLayout\");\n this.registerLayoutPath(\"wizard\", \"nz/co/siliconst/ui5/metaui/layouts/WizardLayout\");\n this.registerLayoutPath(\"compact\", \"nz/co/siliconst/ui5/metaui/layouts/CompactLayout\");\n }\n\n public static getInstance(): PluginRegistry {\n if (!PluginRegistry.instance) {\n PluginRegistry.instance = new PluginRegistry();\n }\n return PluginRegistry.instance;\n }\n\n public registerPluginPath(type: FieldType, widgetName: string | undefined, path: string): void {\n const key = widgetName ? `${type}:${widgetName}` : type;\n this.fieldIndex[key] = path;\n }\n\n public registerActionPath(actionName: string, path: string): void {\n this.actionIndex[actionName] = path;\n }\n\n public registerLayoutPath(strategy: string, path: string): void {\n this.layoutIndex[strategy] = path;\n }\n\n private getFieldPath(type: FieldType, widgetName?: string): string {\n let path;\n if (widgetName) {\n path = this.fieldIndex[`${type}:${widgetName}`];\n }\n if (!path) {\n path = this.fieldIndex[type];\n }\n if (!path) {\n throw new Error(`No plugin path mapped for FieldType: ${type} (widget: ${widgetName})`);\n }\n return path;\n }\n\n private getLayoutPath(strategy: string): string {\n const path = this.layoutIndex[strategy];\n if (!path) {\n throw new Error(`No layout path mapped for strategy: ${strategy}`);\n }\n return path;\n }\n\n /**\n * Statically traverses the schema structure to identify all required plugins\n * and layouts without actually instantiating them.\n * \n * @param {ISchema} schema The root JSON schema payload to traverse\n * @returns {Set<string>} A distinct set of UI5 module paths required to render the schema\n */\n public getPathsToLoad(schema: ISchema): Set<string> {\n const pathsToLoad = new Set<string>();\n \n // 1. Gather layout strategy\n const strategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n pathsToLoad.add(this.getLayoutPath(strategy));\n\n // 2. Recursively gather field plugins\n const scanProperties = (props: Record<string, IPropertyMetadata>) => {\n for (const key in props) {\n const prop = props[key];\n try {\n pathsToLoad.add(this.getFieldPath(prop.type || \"string\", prop.ui?.widget));\n } catch (e) {\n Logger.warn(`[MetaUI LazyLoad] Could not find mapped plugin for field ${key}`);\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n if (prop.items && prop.items.type) {\n try {\n pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));\n } catch (e) {\n Logger.warn(`[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}`);\n }\n }\n }\n };\n\n if (schema.properties) {\n scanProperties(schema.properties);\n } else if (schema.items && schema.items.properties) {\n scanProperties(schema.items.properties);\n }\n\n return pathsToLoad;\n }\n\n /**\n * Defers the generation of the UI until all required UI5 modules have been\n * downloaded asynchronously. Maintains a cache of active promises to prevent\n * redundant network requests for the same module.\n * \n * @param {ISchema} schema The root JSON schema payload to parse\n * @returns {Promise<void>} Resolves when all dependencies are securely in the UI5 require cache\n */\n public async preloadDependencies(schema: ISchema): Promise<void> {\n const pathsToLoad = this.getPathsToLoad(schema);\n\n // 3. Batch execute sap.ui.require via Promises\n const promises = Array.from(pathsToLoad).map(path => {\n if (!this.activePromises[path]) {\n this.activePromises[path] = new Promise((resolve, reject) => {\n sap.ui.require([path], \n (Module: unknown) => resolve(Module), \n (err: unknown) => {\n Logger.error(`Failed to lazy load module: ${path}`);\n // CRITICAL: Delete from cache so future attempts can retry the network request\n delete this.activePromises[path];\n reject(err);\n }\n );\n });\n }\n return this.activePromises[path];\n });\n\n await Promise.all(promises);\n }\n\n private extractConstructor(Module: unknown): new () => IPlugin | ILayoutManager | null {\n if (!Module) return null;\n if (typeof Module === \"function\") return Module;\n if (Module.default && typeof Module.default === \"function\") return Module.default;\n \n // Handle namespace exports (e.g. { FormLayout: class... })\n const keys = Object.keys(Module);\n for (const key of keys) {\n if (typeof Module[key] === \"function\") {\n return Module[key];\n }\n }\n return null;\n }\n\n public getPlugin(type: FieldType, widgetName?: string): IPlugin {\n const path = this.getFieldPath(type, widgetName);\n const Module = sap.ui.require(path);\n const PluginClass = this.extractConstructor(Module);\n \n if (!PluginClass) {\n throw new Error(`[MetaUI Plugin Instantiation] Plugin ${path} was not preloaded or has no constructor!`);\n }\n \n return new PluginClass();\n }\n\n public getLayout(strategy: string): ILayoutManager {\n const path = this.getLayoutPath(strategy);\n const Module = sap.ui.require(path);\n const LayoutClass = this.extractConstructor(Module);\n \n if (!LayoutClass) {\n throw new Error(`[MetaUI Layout Instantiation] Layout ${path} was not preloaded or has no constructor!`);\n }\n \n return new LayoutClass();\n }\n}\n"],"mappings":"2DAAA,MAUSA,EAAMC,EAAA,UAGR,MAAMC,EAGDC,WAAqC,CAAC,EACtCC,YAAsC,CAAC,EACvCC,YAAsC,CAAC,EAEvCC,eAAmD,CAAC,EAEpDC,cAEJC,KAAKC,mBAAmB,SAAUC,UAAW,4DAC7CF,KAAKC,mBAAmB,SAAUC,UAAW,4DAC7CF,KAAKC,mBAAmB,UAAWC,UAAW,4DAC9CF,KAAKC,mBAAmB,OAAQC,UAAW,0DAC3CF,KAAKC,mBAAmB,UAAWC,UAAW,6DAC9CF,KAAKC,mBAAmB,QAASC,UAAW,2DAC5CF,KAAKC,mBAAmB,SAAUC,UAAW,4DAG7CF,KAAKC,mBAAmB,SAAU,OAAQ,0DAC1CD,KAAKC,mBAAmB,SAAU,WAAY,8DAC9CD,KAAKC,mBAAmB,UAAW,SAAU,4DAC7CD,KAAKC,mBAAmB,SAAU,SAAU,8DAC5CD,KAAKC,mBAAmB,SAAU,WAAY,8DAC9CD,KAAKC,mBAAmB,SAAU,aAAc,gEAGhDD,KAAKC,mBAAmB,SAAU,eAAgB,kEAClDD,KAAKC,mBAAmB,QAAS,cAAe,iEAChDD,KAAKC,mBAAmB,SAAU,SAAU,4DAC5CD,KAAKC,mBAAmB,SAAU,SAAU,qEAC5CD,KAAKC,mBAAmB,SAAU,eAAgB,kEAGlDD,KAAKC,mBAAmB,SAAU,SAAU,4DAC5CD,KAAKC,mBAAmB,SAAU,YAAa,+DAC/CD,KAAKC,mBAAmB,SAAU,WAAY,iEAC9CD,KAAKC,mBAAmB,SAAU,UAAW,oEAC7CD,KAAKC,mBAAmB,SAAU,aAAc,gEAChDD,KAAKC,mBAAmB,SAAU,WAAY,8DAG9CD,KAAKC,m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1E,MAAMC,EAAOC,OAAOD,KAAKN,GACzB,IAAK,MAAMhC,KAAOsC,EAAM,CACpB,UAAWN,EAAOhC,KAAS,WAAY,CACnC,OAAOgC,EAAOhC,EAClB,CACJ,CACA,OAAO,IACX,CAEOwC,UAAU3C,EAAiBC,GAC9B,MAAMC,EAAOR,KAAKa,aAAaP,EAAMC,GACrC,MAAMkC,EAASF,IAAId,GAAGe,QAAQhC,GAC9B,MAAM0C,EAAclD,KAAK6C,mBAAmBJ,GAE5C,IAAKS,EAAa,CACd,MAAM,IAAIpC,MAAM,wCAAwCN,6CAC5D,CAEA,OAAO,IAAI0C,CACf,CAEOC,UAAUvC,GACb,MAAMJ,EAAOR,KAAKe,cAAcH,GAChC,MAAM6B,EAASF,IAAId,GAAGe,QAAQhC,GAC9B,MAAM4C,EAAcpD,KAAK6C,mBAAmBJ,GAE5C,IAAKW,EAAa,CACd,MAAM,IAAItC,MAAM,wCAAwCN,6CAC5D,CAEA,OAAO,IAAI4C,CACf,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAA3D,iBAAA,OAAA2D,CAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"PluginRegistry.js","names":["Logger","___utils_Logger","PluginRegistry","fieldIndex","actionIndex","layoutIndex","activePromises","constructor","this","registerPluginPath","undefined","registerLayoutPath","getInstance","instance","type","widgetName","path","key","registerActionPath","actionName","strategy","getFieldPath","Error","getLayoutPath","getPathsToLoad","schema","pathsToLoad","Set","layoutStrategy","add","scanProperties","props","prop","ui","widget","e","msg","message","error","properties","items","preloadDependencies","promises","Array","from","map","Promise","resolve","reject","sap","require","Module","err","all","extractConstructor","default","keys","Object","getPlugin","PluginClass","getLayout","LayoutClass","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\n * @file PluginRegistry.ts\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\n * NOW WITH UNIVERSAL LAZY LOADING.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { FieldType, ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\n\nexport class PluginRegistry {\n private static instance: PluginRegistry;\n \n private fieldIndex: Record<string, string> = {};\n private actionIndex: Record<string, string> = {};\n private layoutIndex: Record<string, string> = {};\n \n private activePromises: Record<string, Promise<unknown>> = {};\n\n private constructor() {\n // Core Mappings\n this.registerPluginPath(\"string\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin\");\n this.registerPluginPath(\"number\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"integer\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"date\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin\");\n this.registerPluginPath(\"boolean\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin\");\n this.registerPluginPath(\"array\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin\");\n this.registerPluginPath(\"object\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin\");\n\n // Widget Overrides\n this.registerPluginPath(\"string\", \"time\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin\");\n this.registerPluginPath(\"string\", \"datetime\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin\");\n this.registerPluginPath(\"boolean\", \"switch\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin\");\n this.registerPluginPath(\"string\", \"select\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin\");\n this.registerPluginPath(\"string\", \"textArea\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin\");\n this.registerPluginPath(\"string\", \"codeEditor\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin\");\n \n // Phase 1 Mappings\n this.registerPluginPath(\"string\", \"fileUploader\", \"nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin\");\n this.registerPluginPath(\"array\", \"multiSelect\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin\");\n this.registerPluginPath(\"array\", \"multiInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin\");\n this.registerPluginPath(\"number\", \"slider\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin\");\n this.registerPluginPath(\"number\", \"rating\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin\");\n this.registerPluginPath(\"string\", \"messageStrip\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin\");\n\n // Phase 5 Mappings (Hardware)\n this.registerPluginPath(\"string\", \"camera\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin\");\n this.registerPluginPath(\"string\", \"signature\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin\");\n this.registerPluginPath(\"object\", \"location\", \"nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin\");\n this.registerPluginPath(\"string\", \"scanner\", \"nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin\");\n this.registerPluginPath(\"string\", \"voiceInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin\");\n this.registerPluginPath(\"string\", \"richText\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin\");\n\n // Actions & Datasources\n this.registerPluginPath(\"string\", \"urlButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin\");\n this.registerPluginPath(\"string\", \"submitButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin\");\n this.registerPluginPath(\"string\", \"odataSelect\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin\");\n this.registerPluginPath(\"string\", \"remoteDropdown\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin\");\n this.registerPluginPath(\"string\", \"liveSearch\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin\");\n this.registerPluginPath(\"string\", \"remoteValueHelp\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin\");\n\n // Layouts\n this.registerLayoutPath(\"form\", \"nz/co/siliconst/ui5/metaui/layouts/FormLayout\");\n this.registerLayoutPath(\"table\", \"nz/co/siliconst/ui5/metaui/layouts/TableLayout\");\n this.registerLayoutPath(\"wizard\", \"nz/co/siliconst/ui5/metaui/layouts/WizardLayout\");\n this.registerLayoutPath(\"compact\", \"nz/co/siliconst/ui5/metaui/layouts/CompactLayout\");\n }\n\n public static getInstance(): PluginRegistry {\n if (!PluginRegistry.instance) {\n PluginRegistry.instance = new PluginRegistry();\n }\n return PluginRegistry.instance;\n }\n\n public registerPluginPath(type: FieldType, widgetName: string | undefined, path: string): void {\n const key = widgetName ? `${type}:${widgetName}` : type;\n this.fieldIndex[key] = path;\n }\n\n public registerActionPath(actionName: string, path: string): void {\n this.actionIndex[actionName] = path;\n }\n\n public registerLayoutPath(strategy: string, path: string): void {\n this.layoutIndex[strategy] = path;\n }\n\n private getFieldPath(type: FieldType, widgetName?: string): string {\n let path;\n if (widgetName) {\n path = this.fieldIndex[`${type}:${widgetName}`];\n }\n if (!path) {\n path = this.fieldIndex[type];\n }\n if (!path) {\n throw new Error(`No plugin path mapped for FieldType: ${type} (widget: ${widgetName})`);\n }\n return path;\n }\n\n private getLayoutPath(strategy: string): string {\n const path = this.layoutIndex[strategy];\n if (!path) {\n throw new Error(`No layout path mapped for strategy: ${strategy}`);\n }\n return path;\n }\n\n /**\n * Statically traverses the schema structure to identify all required plugins\n * and layouts without actually instantiating them.\n * \n * @param {ISchema} schema The root JSON schema payload to traverse\n * @returns {Set<string>} A distinct set of UI5 module paths required to render the schema\n */\n public getPathsToLoad(schema: ISchema): Set<string> {\n const pathsToLoad = new Set<string>();\n \n // 1. Gather layout strategy\n const strategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n pathsToLoad.add(this.getLayoutPath(strategy));\n\n // 2. Recursively gather field plugins\n const scanProperties = (props: Record<string, IPropertyMetadata>) => {\n for (const key in props) {\n const prop = props[key];\n try {\n pathsToLoad.add(this.getFieldPath(prop.type || \"string\", prop.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for field ${key}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n if (prop.items && prop.items.type) {\n try {\n pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n }\n }\n };\n\n if (schema.properties) {\n scanProperties(schema.properties);\n } else if (schema.items && schema.items.properties) {\n scanProperties(schema.items.properties);\n }\n\n return pathsToLoad;\n }\n\n /**\n * Defers the generation of the UI until all required UI5 modules have been\n * downloaded asynchronously. Maintains a cache of active promises to prevent\n * redundant network requests for the same module.\n * \n * @param {ISchema} schema The root JSON schema payload to parse\n * @returns {Promise<void>} Resolves when all dependencies are securely in the UI5 require cache\n */\n public async preloadDependencies(schema: ISchema): Promise<void> {\n const pathsToLoad = this.getPathsToLoad(schema);\n\n // 3. Batch execute sap.ui.require via Promises\n const promises = Array.from(pathsToLoad).map(path => {\n if (!this.activePromises[path]) {\n this.activePromises[path] = new Promise((resolve, reject) => {\n sap.ui.require([path], \n (Module: unknown) => resolve(Module), \n (err: unknown) => {\n Logger.error(`Failed to lazy load module: ${path}`);\n // CRITICAL: Delete from cache so future attempts can retry the network request\n delete this.activePromises[path];\n reject(err);\n }\n );\n });\n }\n return this.activePromises[path];\n });\n\n await Promise.all(promises);\n }\n\n /**\n * Extracts a valid constructor from a dynamically required module.\n */\n private extractConstructor(Module: unknown): new () => IPlugin | ILayoutManager | null {\n if (!Module) return null;\n if (typeof Module === \"function\") return Module as any;\n if ((Module as any).default && typeof (Module as any).default === \"function\") return (Module as any).default;\n \n // Handle namespace exports (e.g. { FormLayout: class... })\n const keys = Object.keys(Module as object);\n for (const key of keys) {\n if (typeof (Module as any)[key] === \"function\") {\n return (Module as any)[key];\n }\n }\n return null;\n }\n\n /**\n * Instantiates the requested plugin for the given field type.\n */\n public getPlugin(type: FieldType, widgetName?: string): IPlugin {\n const path = this.getFieldPath(type, widgetName);\n const Module = sap.ui.require(path);\n const PluginClass = this.extractConstructor(Module);\n \n if (!PluginClass) {\n throw new Error(`[MetaUI Plugin Instantiation] Plugin ${path} was not preloaded or has no constructor!`);\n }\n \n return new PluginClass();\n }\n\n /**\n * Instantiates the requested layout manager for the given strategy.\n */\n public getLayout(strategy: string): ILayoutManager {\n const path = this.getLayoutPath(strategy);\n const Module = sap.ui.require(path);\n const LayoutClass = this.extractConstructor(Module);\n \n if (!LayoutClass) {\n throw new Error(`[MetaUI Layout Instantiation] Layout ${path} was not preloaded or has no constructor!`);\n }\n \n return new LayoutClass();\n }\n}\n"],"mappings":"2DAAA,MAUSA,EAAMC,EAAA,UAGR,MAAMC,EAGDC,WAAqC,CAAC,EACtCC,YAAsC,CAAC,EACvCC,YAAsC,CAAC,EAEvCC,eAAmD,CAAC,EAEpDC,cAEJC,KAAKC,mBAAmB,SAAUC,UAAW,4DAC7CF,KAAKC,mBAAmB,SAAUC,UAAW,4DAC7CF,KAAKC,mBAAmB,UAAWC,UAAW,4DAC9CF,KAAKC,mBAAmB,OAAQC,UAAW,0DAC3CF,KAAKC,mBAAmB,UAAWC,UAAW,6DAC9CF,KAAKC,mBAAmB,QAASC,UAAW,2DAC5CF,KAAKC,mBAAmB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,CAKOC,UAAUxC,GACb,MAAMJ,EAAOR,KAAKe,cAAcH,GAChC,MAAM+B,EAASF,IAAIhB,GAAGiB,QAAQlC,GAC9B,MAAM6C,EAAcrD,KAAK8C,mBAAmBH,GAE5C,IAAKU,EAAa,CACd,MAAM,IAAIvC,MAAM,wCAAwCN,6CAC5D,CAEA,OAAO,IAAI6C,CACf,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAA5D,iBAAA,OAAA4D,CAAA","ignoreList":[]}
|
|
@@ -41,6 +41,7 @@ export class PluginRegistry {
|
|
|
41
41
|
// Phase 1 Mappings
|
|
42
42
|
this.registerPluginPath("string", "fileUploader", "nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin");
|
|
43
43
|
this.registerPluginPath("array", "multiSelect", "nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin");
|
|
44
|
+
this.registerPluginPath("array", "multiInput", "nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin");
|
|
44
45
|
this.registerPluginPath("number", "slider", "nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin");
|
|
45
46
|
this.registerPluginPath("number", "rating", "nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin");
|
|
46
47
|
this.registerPluginPath("string", "messageStrip", "nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin");
|
|
@@ -131,7 +132,9 @@ export class PluginRegistry {
|
|
|
131
132
|
try {
|
|
132
133
|
pathsToLoad.add(this.getFieldPath(prop.type || "string", prop.ui?.widget));
|
|
133
134
|
} catch (e) {
|
|
134
|
-
|
|
135
|
+
const msg = `[MetaUI LazyLoad] Could not find mapped plugin for field ${key}: ${(e as Error).message}`;
|
|
136
|
+
Logger.error(msg);
|
|
137
|
+
throw new Error(msg);
|
|
135
138
|
}
|
|
136
139
|
if (prop.properties) scanProperties(prop.properties);
|
|
137
140
|
if (prop.items && prop.items.properties) scanProperties(prop.items.properties);
|
|
@@ -139,7 +142,9 @@ export class PluginRegistry {
|
|
|
139
142
|
try {
|
|
140
143
|
pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));
|
|
141
144
|
} catch (e) {
|
|
142
|
-
|
|
145
|
+
const msg = `[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}: ${(e as Error).message}`;
|
|
146
|
+
Logger.error(msg);
|
|
147
|
+
throw new Error(msg);
|
|
143
148
|
}
|
|
144
149
|
}
|
|
145
150
|
}
|
|
@@ -186,21 +191,27 @@ export class PluginRegistry {
|
|
|
186
191
|
await Promise.all(promises);
|
|
187
192
|
}
|
|
188
193
|
|
|
194
|
+
/**
|
|
195
|
+
* Extracts a valid constructor from a dynamically required module.
|
|
196
|
+
*/
|
|
189
197
|
private extractConstructor(Module: unknown): new () => IPlugin | ILayoutManager | null {
|
|
190
198
|
if (!Module) return null;
|
|
191
|
-
if (typeof Module === "function") return Module;
|
|
192
|
-
if (Module.default && typeof Module.default === "function") return Module.default;
|
|
199
|
+
if (typeof Module === "function") return Module as any;
|
|
200
|
+
if ((Module as any).default && typeof (Module as any).default === "function") return (Module as any).default;
|
|
193
201
|
|
|
194
202
|
// Handle namespace exports (e.g. { FormLayout: class... })
|
|
195
|
-
const keys = Object.keys(Module);
|
|
203
|
+
const keys = Object.keys(Module as object);
|
|
196
204
|
for (const key of keys) {
|
|
197
|
-
if (typeof Module[key] === "function") {
|
|
198
|
-
return Module[key];
|
|
205
|
+
if (typeof (Module as any)[key] === "function") {
|
|
206
|
+
return (Module as any)[key];
|
|
199
207
|
}
|
|
200
208
|
}
|
|
201
209
|
return null;
|
|
202
210
|
}
|
|
203
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Instantiates the requested plugin for the given field type.
|
|
214
|
+
*/
|
|
204
215
|
public getPlugin(type: FieldType, widgetName?: string): IPlugin {
|
|
205
216
|
const path = this.getFieldPath(type, widgetName);
|
|
206
217
|
const Module = sap.ui.require(path);
|
|
@@ -213,6 +224,9 @@ export class PluginRegistry {
|
|
|
213
224
|
return new PluginClass();
|
|
214
225
|
}
|
|
215
226
|
|
|
227
|
+
/**
|
|
228
|
+
* Instantiates the requested layout manager for the given strategy.
|
|
229
|
+
*/
|
|
216
230
|
public getLayout(strategy: string): ILayoutManager {
|
|
217
231
|
const path = this.getLayoutPath(strategy);
|
|
218
232
|
const Module = sap.ui.require(path);
|
|
@@ -51,7 +51,9 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
|
|
|
51
51
|
getStrict(key) {
|
|
52
52
|
const item = this.get(key);
|
|
53
53
|
if (!item) {
|
|
54
|
-
|
|
54
|
+
const msg = `[MetaUI] ${this.registryName}: Key '${key}' not found.`;
|
|
55
|
+
Logger.error(msg);
|
|
56
|
+
throw new Error(msg);
|
|
55
57
|
}
|
|
56
58
|
return item;
|
|
57
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Registry-dbg.js","names":["Logger","___utils_Logger","Registry","items","Map","constructor","registryName","register","key","item","has","warn","set","get","getStrict","Error","getKeys","Array","from","keys","clear","__exports","__esModule"],"sources":["Registry.ts"],"sourcesContent":["/**\n * @file Registry.ts\n * @description Universal generic registry pattern used across the MetaUI library \n * for registering and resolving decoupled plugins (Layouts, Controls, Validators, etc).\n */\n\nimport { Logger } from \"../utils/Logger\";\n\n/**\n * Universal generic registry pattern used across the MetaUI library \n * for registering and resolving decoupled plugins (Layouts, Controls, Validators, etc).\n * \n * @template T The type of item being stored in the registry.\n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Registry<T> {\n /** The internal map storing the registered items. */\n public readonly items = new Map<string, T>();\n\n constructor(public readonly registryName: string = \"Registry\") {}\n\n /**\n * Registers a new item (plugin/layout/validator) into the registry.\n * @param key The unique string identifier.\n * @param item The implementation class or instance.\n */\n public register(key: string, item: T): void {\n if (this.items.has(key)) {\n Logger.warn(`[MetaUI] ${this.registryName}: Overwriting existing key '${key}'.`);\n }\n this.items.set(key, item);\n }\n\n /**\n * Retrieves an item by its key.\n * @param key The unique string identifier.\n * @returns The registered item, or undefined if not found.\n */\n public get(key: string): T | undefined {\n return this.items.get(key);\n }\n\n /**\n * Retrieves an item by its key, throwing an error if it doesn't exist.\n * @param key The unique string identifier.\n * @returns The registered item.\n */\n public getStrict(key: string): T {\n const item = this.get(key);\n if (!item) {\n
|
|
1
|
+
{"version":3,"file":"Registry-dbg.js","names":["Logger","___utils_Logger","Registry","items","Map","constructor","registryName","register","key","item","has","warn","set","get","getStrict","msg","error","Error","getKeys","Array","from","keys","clear","__exports","__esModule"],"sources":["Registry.ts"],"sourcesContent":["/**\n * @file Registry.ts\n * @description Universal generic registry pattern used across the MetaUI library \n * for registering and resolving decoupled plugins (Layouts, Controls, Validators, etc).\n */\n\nimport { Logger } from \"../utils/Logger\";\n\n/**\n * Universal generic registry pattern used across the MetaUI library \n * for registering and resolving decoupled plugins (Layouts, Controls, Validators, etc).\n * \n * @template T The type of item being stored in the registry.\n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Registry<T> {\n /** The internal map storing the registered items. */\n public readonly items = new Map<string, T>();\n\n constructor(public readonly registryName: string = \"Registry\") {}\n\n /**\n * Registers a new item (plugin/layout/validator) into the registry.\n * @param key The unique string identifier.\n * @param item The implementation class or instance.\n */\n public register(key: string, item: T): void {\n if (this.items.has(key)) {\n Logger.warn(`[MetaUI] ${this.registryName}: Overwriting existing key '${key}'.`);\n }\n this.items.set(key, item);\n }\n\n /**\n * Retrieves an item by its key.\n * @param key The unique string identifier.\n * @returns The registered item, or undefined if not found.\n */\n public get(key: string): T | undefined {\n return this.items.get(key);\n }\n\n /**\n * Retrieves an item by its key, throwing an error if it doesn't exist.\n * @param key The unique string identifier.\n * @returns The registered item.\n */\n public getStrict(key: string): T {\n const item = this.get(key);\n if (!item) {\n const msg = `[MetaUI] ${this.registryName}: Key '${key}' not found.`;\n Logger.error(msg);\n throw new Error(msg);\n }\n return item;\n }\n\n /**\n * Returns an array of all registered keys.\n */\n public getKeys(): string[] {\n return Array.from(this.items.keys());\n }\n\n /**\n * Clears the entire registry.\n */\n public clear(): void {\n this.items.clear();\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;AACA;EAJA,MAMSA,MAAM,GAAAC,eAAA;EAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,QAAQ,CAAI;IACrB;IACgBC,KAAK,GAAG,IAAIC,GAAG,CAAY,CAAC;IAE5CC,WAAWA,CAAiBC,YAAoB,GAAG,UAAU,EAAE;MAAA,KAAnCA,YAAoB,GAApBA,YAAoB;IAAgB;;IAEhE;AACJ;AACA;AACA;AACA;IACWC,QAAQA,CAACC,GAAW,EAAEC,IAAO,EAAQ;MACxC,IAAI,IAAI,CAACN,KAAK,CAACO,GAAG,CAACF,GAAG,CAAC,EAAE;QACrBR,MAAM,CAACW,IAAI,CAAC,YAAY,IAAI,CAACL,YAAY,+BAA+BE,GAAG,IAAI,CAAC;MACpF;MACA,IAAI,CAACL,KAAK,CAACS,GAAG,CAACJ,GAAG,EAAEC,IAAI,CAAC;IAC7B;;IAEA;AACJ;AACA;AACA;AACA;IACWI,GAAGA,CAACL,GAAW,EAAiB;MACnC,OAAO,IAAI,CAACL,KAAK,CAACU,GAAG,CAACL,GAAG,CAAC;IAC9B;;IAEA;AACJ;AACA;AACA;AACA;IACWM,SAASA,CAACN,GAAW,EAAK;MAC7B,MAAMC,IAAI,GAAG,IAAI,CAACI,GAAG,CAACL,GAAG,CAAC;MAC1B,IAAI,CAACC,IAAI,EAAE;QACP,MAAMM,GAAG,GAAG,YAAY,IAAI,CAACT,YAAY,UAAUE,GAAG,cAAc;QACpER,MAAM,CAACgB,KAAK,CAACD,GAAG,CAAC;QACjB,MAAM,IAAIE,KAAK,CAACF,GAAG,CAAC;MACxB;MACA,OAAON,IAAI;IACf;;IAEA;AACJ;AACA;IACWS,OAAOA,CAAA,EAAa;MACvB,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACjB,KAAK,CAACkB,IAAI,CAAC,CAAC,CAAC;IACxC;;IAEA;AACJ;AACA;IACWC,KAAKA,CAAA,EAAS;MACjB,IAAI,CAACnB,KAAK,CAACmB,KAAK,CAAC,CAAC;IACtB;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAArB,QAAA,GAAAA,QAAA;EAAA,OAAAqB,SAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Registry.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/Registry.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,0CAA0C,CAAC;IAS1D;;;;;;;OAOG;IACH,MAAa,QAAQ,CAAC,CAAC;iBAIS,YAAY,EAAE,MAAM;QAHhD,qDAAqD;QACrD,SAAgB,KAAK,MAAwB;oBAEjB,YAAY,GAAE,MAAmB;QAE7D;;;;WAIG;QACI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;QAO3C;;;;WAIG;QACI,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;QAItC;;;;WAIG;QACI,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"Registry.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/Registry.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,0CAA0C,CAAC;IAS1D;;;;;;;OAOG;IACH,MAAa,QAAQ,CAAC,CAAC;iBAIS,YAAY,EAAE,MAAM;QAHhD,qDAAqD;QACrD,SAAgB,KAAK,MAAwB;oBAEjB,YAAY,GAAE,MAAmB;QAE7D;;;;WAIG;QACI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;QAO3C;;;;WAIG;QACI,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;QAItC;;;;WAIG;QACI,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC;QAUhC;;WAEG;QACI,OAAO,IAAI,MAAM,EAAE;QAI1B;;WAEG;QACI,KAAK,IAAI,IAAI;KAGvB;CAEA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
sap.ui.define(["../utils/Logger"],function(t){"use strict";const e=t["Logger"];class r{items=new Map;constructor(t="Registry"){this.registryName=t}register(t,r){if(this.items.has(t)){e.warn(`[MetaUI] ${this.registryName}: Overwriting existing key '${t}'.`)}this.items.set(t,r)}get(t){return this.items.get(t)}getStrict(t){const
|
|
1
|
+
sap.ui.define(["../utils/Logger"],function(t){"use strict";const e=t["Logger"];class r{items=new Map;constructor(t="Registry"){this.registryName=t}register(t,r){if(this.items.has(t)){e.warn(`[MetaUI] ${this.registryName}: Overwriting existing key '${t}'.`)}this.items.set(t,r)}get(t){return this.items.get(t)}getStrict(t){const r=this.get(t);if(!r){const r=`[MetaUI] ${this.registryName}: Key '${t}' not found.`;e.error(r);throw new Error(r)}return r}getKeys(){return Array.from(this.items.keys())}clear(){this.items.clear()}}var s={__esModule:true};s.Registry=r;return s});
|
|
2
2
|
//# sourceMappingURL=Registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Registry.js","names":["Logger","___utils_Logger","Registry","items","Map","constructor","registryName","this","register","key","item","has","warn","set","get","getStrict","Error","getKeys","Array","from","keys","clear","__exports","__esModule"],"sources":["Registry.ts"],"sourcesContent":["/**\n * @file Registry.ts\n * @description Universal generic registry pattern used across the MetaUI library \n * for registering and resolving decoupled plugins (Layouts, Controls, Validators, etc).\n */\n\nimport { Logger } from \"../utils/Logger\";\n\n/**\n * Universal generic registry pattern used across the MetaUI library \n * for registering and resolving decoupled plugins (Layouts, Controls, Validators, etc).\n * \n * @template T The type of item being stored in the registry.\n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Registry<T> {\n /** The internal map storing the registered items. */\n public readonly items = new Map<string, T>();\n\n constructor(public readonly registryName: string = \"Registry\") {}\n\n /**\n * Registers a new item (plugin/layout/validator) into the registry.\n * @param key The unique string identifier.\n * @param item The implementation class or instance.\n */\n public register(key: string, item: T): void {\n if (this.items.has(key)) {\n Logger.warn(`[MetaUI] ${this.registryName}: Overwriting existing key '${key}'.`);\n }\n this.items.set(key, item);\n }\n\n /**\n * Retrieves an item by its key.\n * @param key The unique string identifier.\n * @returns The registered item, or undefined if not found.\n */\n public get(key: string): T | undefined {\n return this.items.get(key);\n }\n\n /**\n * Retrieves an item by its key, throwing an error if it doesn't exist.\n * @param key The unique string identifier.\n * @returns The registered item.\n */\n public getStrict(key: string): T {\n const item = this.get(key);\n if (!item) {\n
|
|
1
|
+
{"version":3,"file":"Registry.js","names":["Logger","___utils_Logger","Registry","items","Map","constructor","registryName","this","register","key","item","has","warn","set","get","getStrict","msg","error","Error","getKeys","Array","from","keys","clear","__exports","__esModule"],"sources":["Registry.ts"],"sourcesContent":["/**\n * @file Registry.ts\n * @description Universal generic registry pattern used across the MetaUI library \n * for registering and resolving decoupled plugins (Layouts, Controls, Validators, etc).\n */\n\nimport { Logger } from \"../utils/Logger\";\n\n/**\n * Universal generic registry pattern used across the MetaUI library \n * for registering and resolving decoupled plugins (Layouts, Controls, Validators, etc).\n * \n * @template T The type of item being stored in the registry.\n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Registry<T> {\n /** The internal map storing the registered items. */\n public readonly items = new Map<string, T>();\n\n constructor(public readonly registryName: string = \"Registry\") {}\n\n /**\n * Registers a new item (plugin/layout/validator) into the registry.\n * @param key The unique string identifier.\n * @param item The implementation class or instance.\n */\n public register(key: string, item: T): void {\n if (this.items.has(key)) {\n Logger.warn(`[MetaUI] ${this.registryName}: Overwriting existing key '${key}'.`);\n }\n this.items.set(key, item);\n }\n\n /**\n * Retrieves an item by its key.\n * @param key The unique string identifier.\n * @returns The registered item, or undefined if not found.\n */\n public get(key: string): T | undefined {\n return this.items.get(key);\n }\n\n /**\n * Retrieves an item by its key, throwing an error if it doesn't exist.\n * @param key The unique string identifier.\n * @returns The registered item.\n */\n public getStrict(key: string): T {\n const item = this.get(key);\n if (!item) {\n const msg = `[MetaUI] ${this.registryName}: Key '${key}' not found.`;\n Logger.error(msg);\n throw new Error(msg);\n }\n return item;\n }\n\n /**\n * Returns an array of all registered keys.\n */\n public getKeys(): string[] {\n return Array.from(this.items.keys());\n }\n\n /**\n * Clears the entire registry.\n */\n public clear(): void {\n this.items.clear();\n }\n}\n"],"mappings":"2DAAA,MAMSA,EAAMC,EAAA,UAUR,MAAMC,EAEOC,MAAQ,IAAIC,IAE5BC,YAA4BC,EAAuB,YAAYC,KAAnCD,cAAoC,CAOzDE,SAASC,EAAaC,GACzB,GAAIH,KAAKJ,MAAMQ,IAAIF,GAAM,CACrBT,EAAOY,KAAK,YAAYL,KAAKD,2CAA2CG,MAC5E,CACAF,KAAKJ,MAAMU,IAAIJ,EAAKC,EACxB,CAOOI,IAAIL,GACP,OAAOF,KAAKJ,MAAMW,IAAIL,EAC1B,CAOOM,UAAUN,GACb,MAAMC,EAAOH,KAAKO,IAAIL,GACtB,IAAKC,EAAM,CACP,MAAMM,EAAM,YAAYT,KAAKD,sBAAsBG,gBACnDT,EAAOiB,MAAMD,GACb,MAAM,IAAIE,MAAMF,EACpB,CACA,OAAON,CACX,CAKOS,UACH,OAAOC,MAAMC,KAAKd,KAAKJ,MAAMmB,OACjC,CAKOC,QACHhB,KAAKJ,MAAMoB,OACf,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAAtB,WAAA,OAAAsB,CAAA","ignoreList":[]}
|
|
@@ -49,7 +49,9 @@ export class Registry<T> {
|
|
|
49
49
|
public getStrict(key: string): T {
|
|
50
50
|
const item = this.get(key);
|
|
51
51
|
if (!item) {
|
|
52
|
-
|
|
52
|
+
const msg = `[MetaUI] ${this.registryName}: Key '${key}' not found.`;
|
|
53
|
+
Logger.error(msg);
|
|
54
|
+
throw new Error(msg);
|
|
53
55
|
}
|
|
54
56
|
return item;
|
|
55
57
|
}
|