@siliconst/metaui 1.4.20 → 1.4.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants-dbg.js +51 -0
- package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.d.ts +41 -0
- package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/constants/MetaUIConstants.ts +44 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControl-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControl.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControl.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControlRenderer-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControlRenderer.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControlRenderer.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/BaseHardwareControlRenderer.ts +2 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl-dbg.js +2 -2
- package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/CameraControl.ts +3 -3
- package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +13 -4
- 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 +14 -2
- 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 +12 -12
- package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl-dbg.js +0 -9
- package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.d.ts +0 -9
- package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/GeolocationControl.ts +3 -9
- package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl-dbg.js +0 -11
- package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.d.ts +0 -11
- package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/RichTextControl.ts +2 -9
- package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl-dbg.js +2 -7
- package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.d.ts +0 -5
- package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/SignatureControl.ts +3 -7
- package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl-dbg.js +1 -6
- package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.d.ts +0 -5
- package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/VoiceInputControl.ts +9 -12
- package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +64 -15
- 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 +21 -0
- 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 +61 -17
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate-dbg.js +2 -2
- 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 +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 +3 -3
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate-dbg.js +13 -0
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.d.ts +5 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.ts +19 -5
- 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 +1 -1
- 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.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts +3 -3
- package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js.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 +4 -4
- package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +11 -8
- 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 +6 -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 +15 -11
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator-dbg.js +84 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.d.ts +16 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutMutator.ts +80 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer-dbg.js +137 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.d.ts +24 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/LayoutScorer.ts +141 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +29 -0
- 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 +2 -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 +32 -1
- package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +1 -1
- 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 +4 -4
- 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 +11 -11
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +4 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +5 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +5 -5
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +4 -4
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +7 -5
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +11 -7
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js +42 -36
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiParserFactory.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiRefResolver.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper-dbg.js +6 -3
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/OpenApiUIMapper.ts +7 -4
- package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/OpenApiHeuristicEngine-dbg.js +2 -2
- package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/OpenApiHeuristicEngine-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/OpenApiHeuristicEngine.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/OpenApiHeuristicEngine.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/heuristics/plugins/ProtobufVariantHeuristic.ts +3 -3
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi2Parser.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApi3Parser.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper.d.ts +4 -4
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/openapi/parsers/OpenApiPropertyMapper.ts +19 -19
- package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/actions/ClearFormActionPlugin.ts +2 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js +18 -15
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.ts +18 -18
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js +1 -1
- 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.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts +1 -6
- 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.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +2 -2
- 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.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 +2 -2
- 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 +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js +4 -4
- 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.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 +4 -4
- 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 +2 -2
- 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 +2 -2
- 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.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/EmailPlugin-dbg.js +48 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin.d.ts +11 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/EmailPlugin.ts +48 -0
- 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 +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js +2 -2
- 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 +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin-dbg.js +58 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin.d.ts +11 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/LinkPlugin.ts +57 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.ts +3 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js +3 -3
- 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 +4 -4
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js +5 -4
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.ts +7 -6
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin-dbg.js +49 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin.d.ts +11 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/PasswordPlugin.ts +49 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.ts +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin-dbg.js +3 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ReferencePlugin.ts +3 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js +2 -2
- 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 +2 -2
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js +2 -2
- 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 +2 -2
- 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/StepInputPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.ts +2 -2
- 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/TextAreaPlugin-dbg.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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.d.ts.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 +109 -108
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin.ts +64 -63
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin-dbg.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.d.ts +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin.ts +118 -117
- 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.d.ts.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 +105 -104
- package/src/nz/co/siliconst/ui5/metaui/utils/Logger-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/utils/Logger.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/utils/Logger.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/utils/Logger.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ODataDelegate-dbg.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","detectODataType","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","
|
|
1
|
+
{"version":3,"file":"ODataDelegate-dbg.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","detectODataType","attachEvent","onFieldChange","oEvent","params","getParameters","fieldPath","value","undefined","handleFieldChange","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","getProperty","debug","e","__exports","__esModule"],"sources":["ODataDelegate.ts"],"sourcesContent":["import DynamicHost from \"../../DynamicHost\";\nimport { Logger } from \"../../../utils/Logger\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport Context from \"sap/ui/model/Context\";\n\nimport Event from \"sap/ui/base/Event\";\n/**\n * Universal OData Delegate.\n * Natively detects and manages two-way synchronization for both OData V2 and V4 contexts\n * without requiring controller-level mappings.\n */\nexport class ODataDelegate {\n private host: DynamicHost;\n private context: ODataV4Context | Context;\n private odataType: \"V2\" | \"V4\" | null = null;\n private isSyncing: boolean = false;\n\n /**\n * Initializes a new instance of the ODataDelegate.\n * \n * @param {DynamicHost} host The parent MetaUI DynamicHost instance managing the UI generation.\n * @param {Context} context The active UI5 Model Context bound to the host.\n */\n constructor(host: DynamicHost, context: ODataV4Context | Context) {\n this.host = host;\n this.context = context;\n this.detectODataType();\n \n // Natively subscribe to the host's field changes to decouple from DynamicHost internals\n this.host.attachEvent(\"fieldChange\", this.onFieldChange, this);\n }\n\n /**\n * Event listener wrapper for field changes emitted by the host.\n */\n private onFieldChange(oEvent: Event): void {\n const params = oEvent.getParameters() as any;\n if (params.fieldPath && params.value !== undefined) {\n this.handleFieldChange(params.fieldPath, params.value);\n }\n }\n\n /**\n * Evaluates the underlying UI5 Model bound to the context to determine if it is an\n * OData V2 or OData V4 model. This determination drives the synchronization strategy.\n * \n * @private\n */\n private detectODataType(): void {\n const model = this.context.getModel();\n // sap.ui.model.odata.v4.ODataModel\n // sap.ui.model.odata.v2.ODataModel\n const sClassName = model.getMetadata().getName();\n if (sClassName.indexOf(\"v4\") > -1) {\n this.odataType = \"V4\";\n } else if (sClassName.indexOf(\"v2\") > -1 || sClassName.indexOf(\"ODataModel\") > -1) {\n this.odataType = \"V2\";\n }\n }\n\n /**\n * Extracts the full entity payload from the bound OData context and pushes it to the Engine.\n * V4 uses an asynchronous requestObject(), while V2 retrieves it synchronously.\n * \n * @public\n */\n public syncToEngine(): void {\n if (!this.odataType) return;\n\n if (this.odataType === \"V4\") {\n // V4 uses async requestObject()\n if (typeof (this.context as any).requestObject === \"function\") {\n (this.context as any).requestObject().then((oData: unknown) => {\n this.pushPayload(oData);\n }).catch((err: Error) => {\n Logger.error(\"[MetaUI]\", \"Failed to extract V4 Context payload: \" + err.message, \"ODataDelegate\");\n });\n }\n } else if (this.odataType === \"V2\") {\n // V2 uses sync getObject()\n const oData = this.context.getObject();\n if (oData) {\n this.pushPayload(oData);\n }\n }\n }\n\n /**\n * Cleans the raw OData payload by stripping framework metadata properties (keys starting with '@' or '__')\n * and pushes the sanitized business data into the MetaUI DynamicHost state manager.\n * \n * @param {unknown} oData The raw JSON object extracted from the OData model context.\n * @private\n */\n private pushPayload(oData: unknown): void {\n if (!oData) return;\n \n // Remove OData metadata properties before pushing to MetaUI\n const cleanData = { ...(oData as Record<string, unknown>) };\n for (const key of Object.keys(cleanData)) {\n if (key.startsWith(\"@\") || key.startsWith(\"__\")) {\n delete cleanData[key];\n }\n }\n\n this.isSyncing = true;\n this.host.setProperty(\"data\", cleanData);\n this.isSyncing = false;\n }\n\n /**\n * Intercepts a field change from the MetaUI Engine and translates it into an OData PATCH.\n */\n public handleFieldChange(fieldPath: string, value: unknown): void {\n if (this.isSyncing || !this.odataType) return;\n\n try {\n if (this.odataType === \"V4\") {\n // V4 sets property directly on context\n (this.context as any).setProperty(fieldPath, value);\n } else if (this.odataType === \"V2\") {\n // V2 sets property on model, specifying the context path\n const model = this.context.getModel();\n (model as any).setProperty(fieldPath, value, this.context);\n }\n if (this.host.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `ODataDelegate Patched ${fieldPath} = ${value} via ${this.odataType}`, \"ODataDelegate\");\n }\n } catch (e) {\n Logger.error(\"[MetaUI]\", `Failed to patch OData context: ${(e as Error).message}`, \"ODataDelegate\");\n }\n }\n}\n"],"mappings":";;;QACSA,MAAM,GAAAC,iBAAA;EAKf;AACA;AACA;AACA;AACA;EACO,MAAMC,aAAa,CAAC;IAGfC,SAAS,GAAuB,IAAI;IACpCC,SAAS,GAAY,KAAK;;IAElC;AACJ;AACA;AACA;AACA;AACA;IACIC,WAAWA,CAACC,IAAiB,EAAEC,OAAiC,EAAE;MAC9D,IAAI,CAACD,IAAI,GAAGA,IAAI;MAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;MACtB,IAAI,CAACC,eAAe,CAAC,CAAC;;MAEtB;MACA,IAAI,CAACF,IAAI,CAACG,WAAW,CAAC,aAAa,EAAE,IAAI,CAACC,aAAa,EAAE,IAAI,CAAC;IAClE;;IAEA;AACJ;AACA;IACYA,aAAaA,CAACC,MAAa,EAAQ;MACvC,MAAM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AACzB,SAAS,EAAEC,KAAK,EAAE,IAAI,CAACR,OAAO,CAAC;QAC9D;QACA,IAAI,IAAI,CAACD,IAAI,CAACkC,WAAW,CAAC,WAAW,CAAC,EAAE;UACpCxC,MAAM,CAACyC,KAAK,CAAC,UAAU,EAAE,yBAAyB3B,SAAS,MAAMC,KAAK,QAAQ,IAAI,CAACZ,SAAS,EAAE,EAAE,eAAe,CAAC;QACpH;MACJ,CAAC,CAAC,OAAOuC,CAAC,EAAE;QACR1C,MAAM,CAAC+B,KAAK,CAAC,UAAU,EAAE,kCAAmCW,CAAC,CAAWV,OAAO,EAAE,EAAE,eAAe,CAAC;MACvG;IACJ;EACJ;EAAC,IAAAW,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAzC,aAAA,GAAAA,aAAA;EAAA,OAAAyC,SAAA;AAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare module "nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate" {
|
|
2
|
-
import
|
|
2
|
+
import DynamicHost from "nz/co/siliconst/ui5/metaui/controls/DynamicHost";
|
|
3
3
|
import ODataV4Context from "sap/ui/model/odata/v4/Context";
|
|
4
4
|
import Context from "sap/ui/model/Context";
|
|
5
5
|
/**
|
|
@@ -19,6 +19,10 @@ declare module "nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate
|
|
|
19
19
|
* @param {Context} context The active UI5 Model Context bound to the host.
|
|
20
20
|
*/
|
|
21
21
|
constructor(host: DynamicHost, context: ODataV4Context | Context);
|
|
22
|
+
/**
|
|
23
|
+
* Event listener wrapper for field changes emitted by the host.
|
|
24
|
+
*/
|
|
25
|
+
private onFieldChange;
|
|
22
26
|
/**
|
|
23
27
|
* Evaluates the underlying UI5 Model bound to the context to determine if it is an
|
|
24
28
|
* OData V2 or OData V4 model. This determination drives the synchronization strategy.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ODataDelegate.d.ts","sourceRoot":"../../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,kEAAkE,CAAC;IAClF,OAAO,
|
|
1
|
+
{"version":3,"file":"ODataDelegate.d.ts","sourceRoot":"../../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ODataDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,kEAAkE,CAAC;IAClF,OAAO,WAAW,MAAM,iDAAiD,CAAC;IAE1E,OAAO,cAAc,MAAM,+BAA+B,CAAC;IAC3D,OAAO,OAAO,MAAM,sBAAsB,CAAC;IAG3C;;;;OAIG;IACH,MAAa,aAAa;QACtB,OAAO,CAAC,IAAI,CAAc;QAC1B,OAAO,CAAC,OAAO,CAA2B;QAC1C,OAAO,CAAC,SAAS,CAA4B;QAC7C,OAAO,CAAC,SAAS,CAAkB;QAEnC;;;;;WAKG;oBACS,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO;QAShE;;WAEG;QACH,OAAO,CAAC,aAAa;QAOrB;;;;;WAKG;QACH,OAAO,CAAC,eAAe;QAYvB;;;;;WAKG;QACI,YAAY,IAAI,IAAI;QAqB3B;;;;;;WAMG;QACH,OAAO,CAAC,WAAW;QAgBnB;;WAEG;QACI,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;KAmBpE;CAEA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
sap.ui.define(["../../../utils/Logger"],function(t){"use strict";const e=t["Logger"];class a{odataType=null;isSyncing=false;constructor(t,e){this.host=t;this.context=e;this.detectODataType()}detectODataType(){const t=this.context.getModel();const e=t.getMetadata().getName();if(e.indexOf("v4")>-1){this.odataType="V4"}else if(e.indexOf("v2")>-1||e.indexOf("ODataModel")>-1){this.odataType="V2"}}syncToEngine(){if(!this.odataType)return;if(this.odataType==="V4"){if(typeof this.context.requestObject==="function"){this.context.requestObject().then(t=>{this.pushPayload(t)}).catch(t=>{e.error("[MetaUI]","Failed to extract V4 Context payload: "+t.message,"ODataDelegate")})}}else if(this.odataType==="V2"){const t=this.context.getObject();if(t){this.pushPayload(t)}}}pushPayload(t){if(!t)return;const e={...t};for(const t of Object.keys(e)){if(t.startsWith("@")||t.startsWith("__")){delete e[t]}}this.isSyncing=true;this.host.setProperty("data",e);this.isSyncing=false}handleFieldChange(t,a){if(this.isSyncing||!this.odataType)return;try{if(this.odataType==="V4"){this.context.setProperty(t,a)}else if(this.odataType==="V2"){const e=this.context.getModel();e.setProperty(t,a,this.context)}if(this.host.getProperty("debugMode")){e.debug("[MetaUI]",`ODataDelegate Patched ${t} = ${a} via ${this.odataType}`,"ODataDelegate")}}catch(t){e.error("[MetaUI]",`Failed to patch OData context: ${t.message}`,"ODataDelegate")}}}var s={__esModule:true};s.ODataDelegate=a;return s});
|
|
1
|
+
sap.ui.define(["../../../utils/Logger"],function(t){"use strict";const e=t["Logger"];class a{odataType=null;isSyncing=false;constructor(t,e){this.host=t;this.context=e;this.detectODataType();this.host.attachEvent("fieldChange",this.onFieldChange,this)}onFieldChange(t){const e=t.getParameters();if(e.fieldPath&&e.value!==undefined){this.handleFieldChange(e.fieldPath,e.value)}}detectODataType(){const t=this.context.getModel();const e=t.getMetadata().getName();if(e.indexOf("v4")>-1){this.odataType="V4"}else if(e.indexOf("v2")>-1||e.indexOf("ODataModel")>-1){this.odataType="V2"}}syncToEngine(){if(!this.odataType)return;if(this.odataType==="V4"){if(typeof this.context.requestObject==="function"){this.context.requestObject().then(t=>{this.pushPayload(t)}).catch(t=>{e.error("[MetaUI]","Failed to extract V4 Context payload: "+t.message,"ODataDelegate")})}}else if(this.odataType==="V2"){const t=this.context.getObject();if(t){this.pushPayload(t)}}}pushPayload(t){if(!t)return;const e={...t};for(const t of Object.keys(e)){if(t.startsWith("@")||t.startsWith("__")){delete e[t]}}this.isSyncing=true;this.host.setProperty("data",e);this.isSyncing=false}handleFieldChange(t,a){if(this.isSyncing||!this.odataType)return;try{if(this.odataType==="V4"){this.context.setProperty(t,a)}else if(this.odataType==="V2"){const e=this.context.getModel();e.setProperty(t,a,this.context)}if(this.host.getProperty("debugMode")){e.debug("[MetaUI]",`ODataDelegate Patched ${t} = ${a} via ${this.odataType}`,"ODataDelegate")}}catch(t){e.error("[MetaUI]",`Failed to patch OData context: ${t.message}`,"ODataDelegate")}}}var s={__esModule:true};s.ODataDelegate=a;return s});
|
|
2
2
|
//# sourceMappingURL=ODataDelegate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ODataDelegate.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","this","detectODataType","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","
|
|
1
|
+
{"version":3,"file":"ODataDelegate.js","names":["Logger","_____utils_Logger","ODataDelegate","odataType","isSyncing","constructor","host","context","this","detectODataType","attachEvent","onFieldChange","oEvent","params","getParameters","fieldPath","value","undefined","handleFieldChange","model","getModel","sClassName","getMetadata","getName","indexOf","syncToEngine","requestObject","then","oData","pushPayload","catch","err","error","message","getObject","cleanData","key","Object","keys","startsWith","setProperty","getProperty","debug","e","__exports","__esModule"],"sources":["ODataDelegate.ts"],"sourcesContent":["import DynamicHost from \"../../DynamicHost\";\nimport { Logger } from \"../../../utils/Logger\";\nimport ODataV4Context from \"sap/ui/model/odata/v4/Context\";\nimport Context from \"sap/ui/model/Context\";\n\nimport Event from \"sap/ui/base/Event\";\n/**\n * Universal OData Delegate.\n * Natively detects and manages two-way synchronization for both OData V2 and V4 contexts\n * without requiring controller-level mappings.\n */\nexport class ODataDelegate {\n private host: DynamicHost;\n private context: ODataV4Context | Context;\n private odataType: \"V2\" | \"V4\" | null = null;\n private isSyncing: boolean = false;\n\n /**\n * Initializes a new instance of the ODataDelegate.\n * \n * @param {DynamicHost} host The parent MetaUI DynamicHost instance managing the UI generation.\n * @param {Context} context The active UI5 Model Context bound to the host.\n */\n constructor(host: DynamicHost, context: ODataV4Context | Context) {\n this.host = host;\n this.context = context;\n this.detectODataType();\n \n // Natively subscribe to the host's field changes to decouple from DynamicHost internals\n this.host.attachEvent(\"fieldChange\", this.onFieldChange, this);\n }\n\n /**\n * Event listener wrapper for field changes emitted by the host.\n */\n private onFieldChange(oEvent: Event): void {\n const params = oEvent.getParameters() as any;\n if (params.fieldPath && params.value !== undefined) {\n this.handleFieldChange(params.fieldPath, params.value);\n }\n }\n\n /**\n * Evaluates the underlying UI5 Model bound to the context to determine if it is an\n * OData V2 or OData V4 model. This determination drives the synchronization strategy.\n * \n * @private\n */\n private detectODataType(): void {\n const model = this.context.getModel();\n // sap.ui.model.odata.v4.ODataModel\n // sap.ui.model.odata.v2.ODataModel\n const sClassName = model.getMetadata().getName();\n if (sClassName.indexOf(\"v4\") > -1) {\n this.odataType = \"V4\";\n } else if (sClassName.indexOf(\"v2\") > -1 || sClassName.indexOf(\"ODataModel\") > -1) {\n this.odataType = \"V2\";\n }\n }\n\n /**\n * Extracts the full entity payload from the bound OData context and pushes it to the Engine.\n * V4 uses an asynchronous requestObject(), while V2 retrieves it synchronously.\n * \n * @public\n */\n public syncToEngine(): void {\n if (!this.odataType) return;\n\n if (this.odataType === \"V4\") {\n // V4 uses async requestObject()\n if (typeof (this.context as any).requestObject === \"function\") {\n (this.context as any).requestObject().then((oData: unknown) => {\n this.pushPayload(oData);\n }).catch((err: Error) => {\n Logger.error(\"[MetaUI]\", \"Failed to extract V4 Context payload: \" + err.message, \"ODataDelegate\");\n });\n }\n } else if (this.odataType === \"V2\") {\n // V2 uses sync getObject()\n const oData = this.context.getObject();\n if (oData) {\n this.pushPayload(oData);\n }\n }\n }\n\n /**\n * Cleans the raw OData payload by stripping framework metadata properties (keys starting with '@' or '__')\n * and pushes the sanitized business data into the MetaUI DynamicHost state manager.\n * \n * @param {unknown} oData The raw JSON object extracted from the OData model context.\n * @private\n */\n private pushPayload(oData: unknown): void {\n if (!oData) return;\n \n // Remove OData metadata properties before pushing to MetaUI\n const cleanData = { ...(oData as Record<string, unknown>) };\n for (const key of Object.keys(cleanData)) {\n if (key.startsWith(\"@\") || key.startsWith(\"__\")) {\n delete cleanData[key];\n }\n }\n\n this.isSyncing = true;\n this.host.setProperty(\"data\", cleanData);\n this.isSyncing = false;\n }\n\n /**\n * Intercepts a field change from the MetaUI Engine and translates it into an OData PATCH.\n */\n public handleFieldChange(fieldPath: string, value: unknown): void {\n if (this.isSyncing || !this.odataType) return;\n\n try {\n if (this.odataType === \"V4\") {\n // V4 sets property directly on context\n (this.context as any).setProperty(fieldPath, value);\n } else if (this.odataType === \"V2\") {\n // V2 sets property on model, specifying the context path\n const model = this.context.getModel();\n (model as any).setProperty(fieldPath, value, this.context);\n }\n if (this.host.getProperty(\"debugMode\")) {\n Logger.debug(\"[MetaUI]\", `ODataDelegate Patched ${fieldPath} = ${value} via ${this.odataType}`, \"ODataDelegate\");\n }\n } catch (e) {\n Logger.error(\"[MetaUI]\", `Failed to patch OData context: ${(e as Error).message}`, \"ODataDelegate\");\n }\n }\n}\n"],"mappings":"uEACSA,EAAMC,EAAA,UAUR,MAAMC,EAGDC,UAAgC,KAChCC,UAAqB,MAQ7BC,YAAYC,EAAmBC,GAC3BC,KAAKF,KAAOA,EACZE,KAAKD,QAAUA,EACfC,KAAKC,kBAGLD,KAAKF,KAAKI,YAAY,cAAeF,KAAKG,cAAeH,KAC7D,CAKQG,cAAcC,GAClB,MAAMC,EAASD,EAAOE,gBACtB,GAAID,EAAOE,WAAaF,EAAOG,QAAUC,UAAW,CAChDT,KAAKU,kBAAkBL,EAAOE,UAAWF,EAAOG,MACpD,CACJ,CAQQP,kBACJ,MAAMU,EAAQX,KAAKD,QAAQa,WAG3B,MAAMC,EAAaF,EAAMG,cAAcC,UACvC,GAAIF,EAAWG,QAAQ,OAAS,EAAG,CAC/BhB,KAA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CAAmCW,EAAYV,UAAW,gBACvF,CACJ,EACH,IAAAW,EAAA,CAAAC,WAAA,MAAAD,EAAA1C,gBAAA,OAAA0C,CAAA","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import DynamicHost from "../../DynamicHost";
|
|
2
2
|
import { Logger } from "../../../utils/Logger";
|
|
3
3
|
import ODataV4Context from "sap/ui/model/odata/v4/Context";
|
|
4
4
|
import Context from "sap/ui/model/Context";
|
|
5
5
|
|
|
6
|
+
import Event from "sap/ui/base/Event";
|
|
6
7
|
/**
|
|
7
8
|
* Universal OData Delegate.
|
|
8
9
|
* Natively detects and manages two-way synchronization for both OData V2 and V4 contexts
|
|
@@ -24,6 +25,19 @@ export class ODataDelegate {
|
|
|
24
25
|
this.host = host;
|
|
25
26
|
this.context = context;
|
|
26
27
|
this.detectODataType();
|
|
28
|
+
|
|
29
|
+
// Natively subscribe to the host's field changes to decouple from DynamicHost internals
|
|
30
|
+
this.host.attachEvent("fieldChange", this.onFieldChange, this);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Event listener wrapper for field changes emitted by the host.
|
|
35
|
+
*/
|
|
36
|
+
private onFieldChange(oEvent: Event): void {
|
|
37
|
+
const params = oEvent.getParameters() as any;
|
|
38
|
+
if (params.fieldPath && params.value !== undefined) {
|
|
39
|
+
this.handleFieldChange(params.fieldPath, params.value);
|
|
40
|
+
}
|
|
27
41
|
}
|
|
28
42
|
|
|
29
43
|
/**
|
|
@@ -55,8 +69,8 @@ export class ODataDelegate {
|
|
|
55
69
|
|
|
56
70
|
if (this.odataType === "V4") {
|
|
57
71
|
// V4 uses async requestObject()
|
|
58
|
-
if (typeof this.context.requestObject === "function") {
|
|
59
|
-
this.context.requestObject().then((oData: unknown) => {
|
|
72
|
+
if (typeof (this.context as any).requestObject === "function") {
|
|
73
|
+
(this.context as any).requestObject().then((oData: unknown) => {
|
|
60
74
|
this.pushPayload(oData);
|
|
61
75
|
}).catch((err: Error) => {
|
|
62
76
|
Logger.error("[MetaUI]", "Failed to extract V4 Context payload: " + err.message, "ODataDelegate");
|
|
@@ -103,11 +117,11 @@ export class ODataDelegate {
|
|
|
103
117
|
try {
|
|
104
118
|
if (this.odataType === "V4") {
|
|
105
119
|
// V4 sets property directly on context
|
|
106
|
-
this.context.setProperty(fieldPath, value);
|
|
120
|
+
(this.context as any).setProperty(fieldPath, value);
|
|
107
121
|
} else if (this.odataType === "V2") {
|
|
108
122
|
// V2 sets property on model, specifying the context path
|
|
109
123
|
const model = this.context.getModel();
|
|
110
|
-
model.setProperty(fieldPath, value, this.context);
|
|
124
|
+
(model as any).setProperty(fieldPath, value, this.context);
|
|
111
125
|
}
|
|
112
126
|
if (this.host.getProperty("debugMode")) {
|
|
113
127
|
Logger.debug("[MetaUI]", `ODataDelegate Patched ${fieldPath} = ${value} via ${this.odataType}`, "ODataDelegate");
|
package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationDelegate-dbg.js","names":["Logger","_____utils_Logger","ValidationDelegate","constructor","host","registerObject","control","unregisterObject","removeAllMessages","stateManager","getStateManager","getProperty","messageManager","Messaging","messages","getMessageModel","getData","messagesToRemove","filter","m","getMessageProcessor","getId","getModel","length","removeMessages","pushMessage","path","text","targetPath","replace","displayText","warn","addMessages","Message","message","type","coreLibrary","MessageType","Error","target","processor","addCustomError","fieldPath","code","clearCustomError","processorId","getTarget","getCode","mountCrashBoundary","error","errorPage","IllustratedMessage","title","description","setAggregation","__exports","__esModule"],"sources":["ValidationDelegate.ts"],"sourcesContent":["import IllustratedMessage from \"sap/m/IllustratedMessage\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport Control from \"sap/ui/core/Control\";\nimport { StateManager } from \"../../../core/StateManager\";\nimport { Logger } from \"../../../utils/Logger\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\n\nexport interface IHostValidation {\n getProperty(name: string): unknown;\n setAggregation(aggregationName: string, object: sap.ui.core.Control, suppressInvalidate?: boolean): this;\n getStateManager(): StateManager | null;\n}\n\n/**\n * Handles Fiori MessageManager integration and provides a standardized Error Boundary UI fallback.\n */\nexport class ValidationDelegate {\n private host: IHostValidation;\n\n /**\n * Initializes the ValidationDelegate for registering controls to the global MessageManager.\n * @param host The parent host interface.\n */\n constructor(host: IHostValidation) {\n this.host = host;\n }\n\n /**\n * Registers a control and all its children with the global MessageManager.\n * (Deprecated: Native registration causes UI5 to aggressively clear custom schema validation messages \n * on every keystroke. MetaUI handles valueState manually via plugins).\n */\n public registerObject(control: Control): void {\n // Do nothing to prevent UI5 from hijacking valueState and clearing our manual messages\n }\n\n /**\n * Unregisters a control from the global MessageManager.\n */\n public unregisterObject(control: Control): void {\n // Do nothing\n }\n\n public removeAllMessages(): void {\n const stateManager = this.host.getStateManager();\n if (stateManager && this.host.getProperty(\"useMessageManager\")) {\n const messageManager = Messaging;\n const messages = messageManager.getMessageModel().getData();\n const messagesToRemove = messages.filter((m: sap.ui.core.message.Message) =>\n m.getMessageProcessor() && m.getMessageProcessor().getId() === stateManager.getModel().getId()\n );\n if (messagesToRemove && messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n }\n }\n\n /**\n * Pushes a validation message to the console, and optionally to the MessageManager.\n */\n public pushMessage(path: string, text: string): void {\n const targetPath = path ? `/${path.replace(/^\\//, \"\")}` : \"\";\n const displayText = path ? `Field '${path}': ${text}` : text;\n\n if (path) {\n Logger.warn(`[MetaUI Validation Error] ${displayText}`);\n } else {\n Logger.warn(`[MetaUI Validation Error] Global - ${text}`);\n }\n\n if (this.host.getProperty(\"useMessageManager\") === true) {\n const messageManager = Messaging;\n const stateManager = this.host.getStateManager();\n messageManager.addMessages(new Message({\n message: displayText,\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: stateManager?.getModel()\n }));\n }\n }\n\n /**\n * Imperatively invalidates a field and highlights it with an error message.\n * Uses a specific 'CustomError' code to distinguish it from internal schema validations.\n * \n * @param fieldPath The internal JSON path of the field to highlight.\n * @param message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n Messaging.addMessages(new Message({\n message: message,\n type: coreLibrary.MessageType.Error,\n target: `/${fieldPath.replace(/^\\//, \"\")}`,\n processor: stateManager.getModel(),\n code: \"CustomError\"\n }));\n }\n\n /**\n * Reverts a custom error state on a field, safely ignoring native schema validations.\n * \n * @param fieldPath The internal JSON path of the field to clear.\n */\n public clearCustomError(fieldPath: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n const target = `/${fieldPath.replace(/^\\//, \"\")}`;\n const processorId = stateManager.getModel().getId();\n const messages = Messaging.getMessageModel().getData() as sap.ui.core.message.Message[];\n\n const messagesToRemove = messages.filter(m =>\n m.getTarget() === target &&\n m.getCode() === \"CustomError\" &&\n m.getMessageProcessor()?.getId() === processorId\n );\n\n if (messagesToRemove.length > 0) {\n Messaging.removeMessages(messagesToRemove);\n }\n }\n\n /**\n * Triggers a visual Error Page (Crash Boundary) when generation catastrophically fails.\n */\n public mountCrashBoundary(error: Error): void {\n Logger.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", error.message, \"ValidationDelegate\");\n\n const errorPage = new IllustratedMessage({\n title: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\"\n });\n\n this.host.setAggregation(\"_content\", errorPage);\n }\n}\n"],"mappings":";;;QAISA,MAAM,GAAAC,iBAAA;EAUf;AACA;AACA;EACO,MAAMC,kBAAkB,CAAC;IAG5B;AACJ;AACA;AACA;IACIC,WAAWA,CAACC,IAAqB,EA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egate-dbg.js","names":["Logger","_____utils_Logger","ValidationDelegate","constructor","host","registerObject","control","unregisterObject","removeAllMessages","stateManager","getStateManager","getProperty","messageManager","Messaging","messages","getMessageModel","getData","messagesToRemove","filter","m","getMessageProcessor","getId","getModel","length","removeMessages","pushMessage","path","text","targetPath","replace","displayText","warn","addMessages","Message","message","type","coreLibrary","MessageType","Error","target","processor","addCustomError","fieldPath","code","clearCustomError","processorId","getTarget","getCode","mountCrashBoundary","error","errorPage","IllustratedMessage","title","description","setAggregation","__exports","__esModule"],"sources":["ValidationDelegate.ts"],"sourcesContent":["import IllustratedMessage from \"sap/m/IllustratedMessage\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport Control from \"sap/ui/core/Control\";\nimport { StateManager } from \"../../../core/StateManager\";\nimport { Logger } from \"../../../utils/Logger\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\n\nexport interface IHostValidation {\n getProperty(name: string): unknown;\n setAggregation(aggregationName: string, object: Control, suppressInvalidate?: boolean): this;\n getStateManager(): StateManager | null;\n}\n\n/**\n * Handles Fiori MessageManager integration and provides a standardized Error Boundary UI fallback.\n */\nexport class ValidationDelegate {\n private host: IHostValidation;\n\n /**\n * Initializes the ValidationDelegate for registering controls to the global MessageManager.\n * @param host The parent host interface.\n */\n constructor(host: IHostValidation) {\n this.host = host;\n }\n\n /**\n * Registers a control and all its children with the global MessageManager.\n * (Deprecated: Native registration causes UI5 to aggressively clear custom schema validation messages \n * on every keystroke. MetaUI handles valueState manually via plugins).\n */\n public registerObject(control: Control): void {\n // Do nothing to prevent UI5 from hijacking valueState and clearing our manual messages\n }\n\n /**\n * Unregisters a control from the global MessageManager.\n */\n public unregisterObject(control: Control): void {\n // Do nothing\n }\n\n public removeAllMessages(): void {\n const stateManager = this.host.getStateManager();\n if (stateManager && this.host.getProperty(\"useMessageManager\")) {\n const messageManager = Messaging;\n const messages = messageManager.getMessageModel().getData();\n const messagesToRemove = messages.filter((m: Message) =>\n m.getMessageProcessor() && m.getMessageProcessor().getId() === stateManager.getModel().getId()\n );\n if (messagesToRemove && messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n }\n }\n\n /**\n * Pushes a validation message to the console, and optionally to the MessageManager.\n */\n public pushMessage(path: string, text: string): void {\n const targetPath = path ? `/${path.replace(/^\\//, \"\")}` : \"\";\n const displayText = path ? `Field '${path}': ${text}` : text;\n\n if (path) {\n Logger.warn(`[MetaUI Validation Error] ${displayText}`);\n } else {\n Logger.warn(`[MetaUI Validation Error] Global - ${text}`);\n }\n\n if (this.host.getProperty(\"useMessageManager\") === true) {\n const messageManager = Messaging;\n const stateManager = this.host.getStateManager();\n messageManager.addMessages(new Message({\n message: displayText,\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: stateManager?.getModel()\n }));\n }\n }\n\n /**\n * Imperatively invalidates a field and highlights it with an error message.\n * Uses a specific 'CustomError' code to distinguish it from internal schema validations.\n * \n * @param fieldPath The internal JSON path of the field to highlight.\n * @param message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n Messaging.addMessages(new Message({\n message: message,\n type: coreLibrary.MessageType.Error,\n target: `/${fieldPath.replace(/^\\//, \"\")}`,\n processor: stateManager.getModel(),\n code: \"CustomError\"\n }));\n }\n\n /**\n * Reverts a custom error state on a field, safely ignoring native schema validations.\n * \n * @param fieldPath The internal JSON path of the field to clear.\n */\n public clearCustomError(fieldPath: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n const target = `/${fieldPath.replace(/^\\//, \"\")}`;\n const processorId = stateManager.getModel().getId();\n const messages = Messaging.getMessageModel().getData() as Message[];\n\n const messagesToRemove = messages.filter(m =>\n m.getTarget() === target &&\n m.getCode() === \"CustomError\" &&\n m.getMessageProcessor()?.getId() === processorId\n );\n\n if (messagesToRemove.length > 0) {\n Messaging.removeMessages(messagesToRemove);\n }\n }\n\n /**\n * Triggers a visual Error Page (Crash Boundary) when generation catastrophically fails.\n */\n public mountCrashBoundary(error: Error): void {\n Logger.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", error.message, \"ValidationDelegate\");\n\n const errorPage = new IllustratedMessage({\n title: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\"\n });\n\n this.host.setAggregation(\"_content\", errorPage);\n }\n}\n"],"mappings":";;;QAISA,MAAM,GAAAC,iBAAA;EAUf;AACA;AACA;EACO,MAAMC,kBAAkB,CAAC;IAG5B;AACJ;AACA;AACA;IACIC,WAAWA,CAACC,IAAqB,EAAE;MAC/B,IAAI,CAACA,IAAI,GAAGA,IAAI;IACpB;;IAEA;AACJ;AACA;AACA;AACA;IACWC,cAAcA,CAACC,OAAgB,EAAQ;MAC1C;IAAA;;IAGJ;AACJ;AACA;IACWC,gBAAgBA,CAACD,OAAgB,EAAQ;MAC5C;IAAA;IAGGE,iBAAiBA,CAAA,EAAS;MAC7B,MAAMC,YAAY,GAAG,IAAI,CAACL,IAAI,CAACM,eAAe,CAAC,CAAC;MAChD,IAAID,YAAY,IAAI,IAAI,CAACL,IAAI,CAACO,WAAW,CAAC,mBAAmB,CAAC,EAAE;QAC5D,MAAMC,cAAc,GAAGC,SAAS;QAChC,MAAMC,QAAQ,GAAGF,cAAc,CAACG,eAAe,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;QAC3D,MAAMC,gBAAgB,GAAGH,QAAQ,CAACI,MAAM,CAAEC,CAAU,IAChDA,CAAC,CAACC,mBAAmB,CAAC,CAAC,IAAID,CAAC,CAACC,mBAAmB,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,KAAKZ,YAAY,CAACa,QAAQ,CAAC,CAAC,CAACD,KAAK,CAAC,CACjG,CAAC;QACD,I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AC9C;IACJ;;IAEA;AACJ;AACA;IACW+B,kBAAkBA,CAACC,KAAY,EAAQ;MAC1CjD,MAAM,CAACiD,KAAK,CAAC,wEAAwE,EAAEA,KAAK,CAACf,OAAO,EAAE,oBAAoB,CAAC;MAE3H,MAAMgB,SAAS,GAAG,IAAIC,kBAAkB,CAAC;QACrCC,KAAK,EAAE,sBAAsB;QAC7BC,WAAW,EAAE;MACjB,CAAC,CAAC;MAEF,IAAI,CAACjD,IAAI,CAACkD,cAAc,CAAC,UAAU,EAAEJ,SAAS,CAAC;IACnD;EACJ;EAAC,IAAAK,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAArD,kBAAA,GAAAA,kBAAA;EAAA,OAAAqD,SAAA;AAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@ declare module "nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDel
|
|
|
3
3
|
import { StateManager } from "nz/co/siliconst/ui5/metaui/core/StateManager";
|
|
4
4
|
export interface IHostValidation {
|
|
5
5
|
getProperty(name: string): unknown;
|
|
6
|
-
setAggregation(aggregationName: string, object:
|
|
6
|
+
setAggregation(aggregationName: string, object: Control, suppressInvalidate?: boolean): this;
|
|
7
7
|
getStateManager(): StateManager | null;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationDelegate.d.ts","sourceRoot":"../../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,uEAAuE,CAAC;IAGvF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;IAK5E,UAAiB,eAAe;QAC5B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACnC,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"ValidationDelegate.d.ts","sourceRoot":"../../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,uEAAuE,CAAC;IAGvF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;IAK5E,UAAiB,eAAe;QAC5B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACnC,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAC7F,eAAe,IAAI,YAAY,GAAG,IAAI,CAAC;KAC1C;IAED;;OAEG;IACH,MAAa,kBAAkB;QAC3B,OAAO,CAAC,IAAI,CAAkB;QAE9B;;;WAGG;oBACS,IAAI,EAAE,eAAe;QAIjC;;;;WAIG;QACI,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;QAI7C;;WAEG;QACI,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;QAIxC,iBAAiB,IAAI,IAAI;QAchC;;WAEG;QACI,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;QAsBpD;;;;;;WAMG;QACI,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;QAmB/D;;;;WAIG;QACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;QAyBhD;;WAEG;QACI,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;KAUhD;CAEA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationDelegate.js","names":["Logger","_____utils_Logger","ValidationDelegate","constructor","host","this","registerObject","control","unregisterObject","removeAllMessages","stateManager","getStateManager","getProperty","messageManager","Messaging","messages","getMessageModel","getData","messagesToRemove","filter","m","getMessageProcessor","getId","getModel","length","removeMessages","pushMessage","path","text","targetPath","replace","displayText","warn","addMessages","Message","message","type","coreLibrary","MessageType","Error","target","processor","addCustomError","fieldPath","code","clearCustomError","processorId","getTarget","getCode","mountCrashBoundary","error","errorPage","IllustratedMessage","title","description","setAggregation","__exports","__esModule"],"sources":["ValidationDelegate.ts"],"sourcesContent":["import IllustratedMessage from \"sap/m/IllustratedMessage\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport Control from \"sap/ui/core/Control\";\nimport { StateManager } from \"../../../core/StateManager\";\nimport { Logger } from \"../../../utils/Logger\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\n\nexport interface IHostValidation {\n getProperty(name: string): unknown;\n setAggregation(aggregationName: string, object:
|
|
1
|
+
{"version":3,"file":"ValidationDelegate.js","names":["Logger","_____utils_Logger","ValidationDelegate","constructor","host","this","registerObject","control","unregisterObject","removeAllMessages","stateManager","getStateManager","getProperty","messageManager","Messaging","messages","getMessageModel","getData","messagesToRemove","filter","m","getMessageProcessor","getId","getModel","length","removeMessages","pushMessage","path","text","targetPath","replace","displayText","warn","addMessages","Message","message","type","coreLibrary","MessageType","Error","target","processor","addCustomError","fieldPath","code","clearCustomError","processorId","getTarget","getCode","mountCrashBoundary","error","errorPage","IllustratedMessage","title","description","setAggregation","__exports","__esModule"],"sources":["ValidationDelegate.ts"],"sourcesContent":["import IllustratedMessage from \"sap/m/IllustratedMessage\";\nimport Messaging from \"sap/ui/core/Messaging\";\nimport Control from \"sap/ui/core/Control\";\nimport { StateManager } from \"../../../core/StateManager\";\nimport { Logger } from \"../../../utils/Logger\";\nimport Message from \"sap/ui/core/message/Message\";\nimport coreLibrary from \"sap/ui/core/library\";\n\nexport interface IHostValidation {\n getProperty(name: string): unknown;\n setAggregation(aggregationName: string, object: Control, suppressInvalidate?: boolean): this;\n getStateManager(): StateManager | null;\n}\n\n/**\n * Handles Fiori MessageManager integration and provides a standardized Error Boundary UI fallback.\n */\nexport class ValidationDelegate {\n private host: IHostValidation;\n\n /**\n * Initializes the ValidationDelegate for registering controls to the global MessageManager.\n * @param host The parent host interface.\n */\n constructor(host: IHostValidation) {\n this.host = host;\n }\n\n /**\n * Registers a control and all its children with the global MessageManager.\n * (Deprecated: Native registration causes UI5 to aggressively clear custom schema validation messages \n * on every keystroke. MetaUI handles valueState manually via plugins).\n */\n public registerObject(control: Control): void {\n // Do nothing to prevent UI5 from hijacking valueState and clearing our manual messages\n }\n\n /**\n * Unregisters a control from the global MessageManager.\n */\n public unregisterObject(control: Control): void {\n // Do nothing\n }\n\n public removeAllMessages(): void {\n const stateManager = this.host.getStateManager();\n if (stateManager && this.host.getProperty(\"useMessageManager\")) {\n const messageManager = Messaging;\n const messages = messageManager.getMessageModel().getData();\n const messagesToRemove = messages.filter((m: Message) =>\n m.getMessageProcessor() && m.getMessageProcessor().getId() === stateManager.getModel().getId()\n );\n if (messagesToRemove && messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n }\n }\n\n /**\n * Pushes a validation message to the console, and optionally to the MessageManager.\n */\n public pushMessage(path: string, text: string): void {\n const targetPath = path ? `/${path.replace(/^\\//, \"\")}` : \"\";\n const displayText = path ? `Field '${path}': ${text}` : text;\n\n if (path) {\n Logger.warn(`[MetaUI Validation Error] ${displayText}`);\n } else {\n Logger.warn(`[MetaUI Validation Error] Global - ${text}`);\n }\n\n if (this.host.getProperty(\"useMessageManager\") === true) {\n const messageManager = Messaging;\n const stateManager = this.host.getStateManager();\n messageManager.addMessages(new Message({\n message: displayText,\n type: coreLibrary.MessageType.Error,\n target: targetPath,\n processor: stateManager?.getModel()\n }));\n }\n }\n\n /**\n * Imperatively invalidates a field and highlights it with an error message.\n * Uses a specific 'CustomError' code to distinguish it from internal schema validations.\n * \n * @param fieldPath The internal JSON path of the field to highlight.\n * @param message The custom error message to display.\n */\n public addCustomError(fieldPath: string, message: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n Messaging.addMessages(new Message({\n message: message,\n type: coreLibrary.MessageType.Error,\n target: `/${fieldPath.replace(/^\\//, \"\")}`,\n processor: stateManager.getModel(),\n code: \"CustomError\"\n }));\n }\n\n /**\n * Reverts a custom error state on a field, safely ignoring native schema validations.\n * \n * @param fieldPath The internal JSON path of the field to clear.\n */\n public clearCustomError(fieldPath: string): void {\n if (this.host.getProperty(\"useMessageManager\") !== true) {\n return;\n }\n\n const stateManager = this.host.getStateManager();\n if (!stateManager) {\n return;\n }\n\n const target = `/${fieldPath.replace(/^\\//, \"\")}`;\n const processorId = stateManager.getModel().getId();\n const messages = Messaging.getMessageModel().getData() as Message[];\n\n const messagesToRemove = messages.filter(m =>\n m.getTarget() === target &&\n m.getCode() === \"CustomError\" &&\n m.getMessageProcessor()?.getId() === processorId\n );\n\n if (messagesToRemove.length > 0) {\n Messaging.removeMessages(messagesToRemove);\n }\n }\n\n /**\n * Triggers a visual Error Page (Crash Boundary) when generation catastrophically fails.\n */\n public mountCrashBoundary(error: Error): void {\n Logger.error(\"[MetaUI] Engine failed to generate layout. Preventing Launchpad crash.\", error.message, \"ValidationDelegate\");\n\n const errorPage = new IllustratedMessage({\n title: \"UI Generation Failed\",\n description: \"The dynamic schema could not be rendered. Please check the Fiori console for diagnostic logs.\"\n });\n\n this.host.setAggregation(\"_content\", errorPage);\n }\n}\n"],"mappings":"sLAISA,EAAMC,EAAA,UAaR,MAAMC,EAOTC,YAAYC,GACRC,KAAKD,KAAOA,CAChB,CAOOE,eAAeC,GAClB,CAMGC,iBAAiBD,GACpB,CAGGE,oBACH,MAAMC,EAAeL,KAAKD,KAAKO,kBAC/B,GAAID,GAAgBL,KAAKD,KAAKQ,YAAY,qBAAsB,CAC5D,MAAMC,EAAiBC,EACvB,MAAMC,EAAWF,EAAeG,kBAAkBC,UAClD,MAAMC,EAAmBH,EAASI,OAAQC,GACtCA,EAAEC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C,GACrCA,EAAE2B,cAAgBP,GAClBpB,EAAE4B,YAAc,eAChB5B,EAAEC,uBAAuBC,UAAYwB,GAGzC,GAAI5B,EAAiBM,OAAS,EAAG,CAC7BV,EAAUW,eAAeP,EAC7B,CACJ,CAKO+B,mBAAmBC,GACtBlD,EAAOkD,MAAM,yEAA0EA,EAAMf,QAAS,sBAEtG,MAAMgB,EAAY,IAAIC,EAAmB,CACrCC,MAAO,uBACPC,YAAa,kGAGjBjD,KAAKD,KAAKmD,eAAe,WAAYJ,EACzC,EACH,IAAAK,EAAA,CAAAC,WAAA,MAAAD,EAAAtD,qBAAA,OAAAsD,CAAA","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ import coreLibrary from "sap/ui/core/library";
|
|
|
8
8
|
|
|
9
9
|
export interface IHostValidation {
|
|
10
10
|
getProperty(name: string): unknown;
|
|
11
|
-
setAggregation(aggregationName: string, object:
|
|
11
|
+
setAggregation(aggregationName: string, object: Control, suppressInvalidate?: boolean): this;
|
|
12
12
|
getStateManager(): StateManager | null;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -47,7 +47,7 @@ export class ValidationDelegate {
|
|
|
47
47
|
if (stateManager && this.host.getProperty("useMessageManager")) {
|
|
48
48
|
const messageManager = Messaging;
|
|
49
49
|
const messages = messageManager.getMessageModel().getData();
|
|
50
|
-
const messagesToRemove = messages.filter((m:
|
|
50
|
+
const messagesToRemove = messages.filter((m: Message) =>
|
|
51
51
|
m.getMessageProcessor() && m.getMessageProcessor().getId() === stateManager.getModel().getId()
|
|
52
52
|
);
|
|
53
53
|
if (messagesToRemove && messagesToRemove.length > 0) {
|
|
@@ -124,7 +124,7 @@ export class ValidationDelegate {
|
|
|
124
124
|
|
|
125
125
|
const target = `/${fieldPath.replace(/^\//, "")}`;
|
|
126
126
|
const processorId = stateManager.getModel().getId();
|
|
127
|
-
const messages = Messaging.getMessageModel().getData() as
|
|
127
|
+
const messages = Messaging.getMessageModel().getData() as Message[];
|
|
128
128
|
|
|
129
129
|
const messagesToRemove = messages.filter(m =>
|
|
130
130
|
m.getTarget() === target &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionEngine-dbg.js","names":["Registry","___Registry","OperatorRegistry","register","a","b","ConditionEngine","constructor","schema","plugins","Map","handleEvent","fieldKey","isValid","registerPlugin","bindingPath","plugin","set","destroy","clear","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\n * @file ConditionEngine.ts\n * @description Evaluates dynamic rules to alter the schema in real-time.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { ISchema } from \"../interfaces/ISchema\";\nimport { Registry } from \"./Registry\";\n\nexport type ConditionOperator = (a: unknown, b: unknown) => boolean;\n\nexport const OperatorRegistry = new Registry<ConditionOperator>(\"Operators\");\n\n// Register basic default operators\nOperatorRegistry.register(\"==\", (a, b) => a == b);\nOperatorRegistry.register(\"===\", (a, b) => a === b);\nOperatorRegistry.register(\"!=\", (a, b) => a != b);\nOperatorRegistry.register(\"!==\", (a, b) => a !== b);\nOperatorRegistry.register(\">\", (a, b) => a > b);\nOperatorRegistry.register(\"<\", (a, b) => a < b);\nOperatorRegistry.register(\">=\", (a, b) => a >= b);\nOperatorRegistry.register(\"<=\", (a, b) => a <= b);\n\n/**\n * Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).\n * It delegates actual evaluations to the configurable `OperatorRegistry`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class ConditionEngine {\n /** The active form schema being evaluated. */\n private schema: ISchema;\n /**\n * Initializes the ConditionEngine with the active schema.\n * @param schema The current UI layout schema.\n */\n constructor(schema: ISchema) {\n this.schema = schema;\n }\n\n\n\n /** Internal map tracking active plugins against their binding paths for real-time state updates. */\n private plugins: Map<string, IPlugin> = new Map();\n\n /**\n * Internal handler to evaluate business rules when a field is updated.\n * @param fieldKey The key of the field that was changed\n * @param isValid Whether the field is currently valid\n */\n public handleEvent(fieldKey: string, isValid: boolean): void {\n // Evaluate conditions via registered operators if a rule system is added later\n }\n\n /**\n * Registers a rendered plugin so the condition engine can push dynamic state updates to it.\n * \n * @param bindingPath The JSON path representing the field within the payload.\n * @param plugin The instantiated plugin handling the field.\n */\n public registerPlugin(bindingPath: string, plugin: IPlugin): void {\n this.plugins.set(bindingPath, plugin);\n }\n\n /**\n * Cleans up listeners to prevent memory leaks on destruction.\n */\n public destroy(): void {\n this.plugins.clear();\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAOSA,QAAQ,GAAAC,WAAA;EAIV,MAAMC,gBAAgB,GAAG,IAAIF,QAAQ,CAAoB,WAAW,CAAC;;EAE5E;EACAE,gBAAgB,CAACC,QAAQ,CAAC,IAAI,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,IAAIC,CAAC,CAAC;EACjDH,gBAAgB,CAACC,QAAQ,CAAC,KAAK,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,KAAKC,CAAC,CAAC;EACnDH,gBAAgB,CAACC,QAAQ,CAAC,IAAI,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,IAAIC,CAAC,CAAC;EACjDH,gBAAgB,CAACC,QAAQ,CAAC,KAAK,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,KAAKC,CAAC,CAAC;EACnDH,gBAAgB,CAACC,QAAQ,CAAC,GAAG,EAAE,CAACC,CAAC,EAAEC,CAAC,
|
|
1
|
+
{"version":3,"file":"ConditionEngine-dbg.js","names":["Registry","___Registry","OperatorRegistry","register","a","b","ConditionEngine","constructor","schema","plugins","Map","handleEvent","fieldKey","isValid","registerPlugin","bindingPath","plugin","set","destroy","clear","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\n * @file ConditionEngine.ts\n * @description Evaluates dynamic rules to alter the schema in real-time.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { ISchema } from \"../interfaces/ISchema\";\nimport { Registry } from \"./Registry\";\n\nexport type ConditionOperator = (a: unknown, b: unknown) => boolean;\n\nexport const OperatorRegistry = new Registry<ConditionOperator>(\"Operators\");\n\n// Register basic default operators\nOperatorRegistry.register(\"==\", (a, b) => a == b);\nOperatorRegistry.register(\"===\", (a, b) => a === b);\nOperatorRegistry.register(\"!=\", (a, b) => a != b);\nOperatorRegistry.register(\"!==\", (a, b) => a !== b);\nOperatorRegistry.register(\">\", (a, b) => (a as any) > (b as any));\nOperatorRegistry.register(\"<\", (a, b) => (a as any) < (b as any));\nOperatorRegistry.register(\">=\", (a, b) => (a as any) >= (b as any));\nOperatorRegistry.register(\"<=\", (a, b) => (a as any) <= (b as any));\n\n/**\n * Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).\n * It delegates actual evaluations to the configurable `OperatorRegistry`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class ConditionEngine {\n /** The active form schema being evaluated. */\n private schema: ISchema;\n /**\n * Initializes the ConditionEngine with the active schema.\n * @param schema The current UI layout schema.\n */\n constructor(schema: ISchema) {\n this.schema = schema;\n }\n\n\n\n /** Internal map tracking active plugins against their binding paths for real-time state updates. */\n private plugins: Map<string, IPlugin> = new Map();\n\n /**\n * Internal handler to evaluate business rules when a field is updated.\n * @param fieldKey The key of the field that was changed\n * @param isValid Whether the field is currently valid\n */\n public handleEvent(fieldKey: string, isValid: boolean): void {\n // Evaluate conditions via registered operators if a rule system is added later\n }\n\n /**\n * Registers a rendered plugin so the condition engine can push dynamic state updates to it.\n * \n * @param bindingPath The JSON path representing the field within the payload.\n * @param plugin The instantiated plugin handling the field.\n */\n public registerPlugin(bindingPath: string, plugin: IPlugin): void {\n this.plugins.set(bindingPath, plugin);\n }\n\n /**\n * Cleans up listeners to prevent memory leaks on destruction.\n */\n public destroy(): void {\n this.plugins.clear();\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAOSA,QAAQ,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;AACJ;AACA;AACA;AACA;AACA;IACWC,cAAcA,CAACC,WAAmB,EAAEC,MAAe,EAAQ;MAC9D,IAAI,CAACP,OAAO,CAACQ,GAAG,CAACF,WAAW,EAAEC,MAAM,CAAC;IACzC;;IAEA;AACJ;AACA;IACWE,OAAOA,CAAA,EAAS;MACnB,IAAI,CAACT,OAAO,CAACU,KAAK,CAAC,CAAC;IACxB;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAlB,gBAAA,GAAAA,gBAAA;EAAAkB,SAAA,CAAAd,eAAA,GAAAA,eAAA;EAAA,OAAAc,SAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionEngine.js","names":["Registry","___Registry","OperatorRegistry","register","a","b","ConditionEngine","constructor","schema","this","plugins","Map","handleEvent","fieldKey","isValid","registerPlugin","bindingPath","plugin","set","destroy","clear","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\n * @file ConditionEngine.ts\n * @description Evaluates dynamic rules to alter the schema in real-time.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { ISchema } from \"../interfaces/ISchema\";\nimport { Registry } from \"./Registry\";\n\nexport type ConditionOperator = (a: unknown, b: unknown) => boolean;\n\nexport const OperatorRegistry = new Registry<ConditionOperator>(\"Operators\");\n\n// Register basic default operators\nOperatorRegistry.register(\"==\", (a, b) => a == b);\nOperatorRegistry.register(\"===\", (a, b) => a === b);\nOperatorRegistry.register(\"!=\", (a, b) => a != b);\nOperatorRegistry.register(\"!==\", (a, b) => a !== b);\nOperatorRegistry.register(\">\", (a, b) => a > b);\nOperatorRegistry.register(\"<\", (a, b) => a < b);\nOperatorRegistry.register(\">=\", (a, b) => a >= b);\nOperatorRegistry.register(\"<=\", (a, b) => a <= b);\n\n/**\n * Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).\n * It delegates actual evaluations to the configurable `OperatorRegistry`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class ConditionEngine {\n /** The active form schema being evaluated. */\n private schema: ISchema;\n /**\n * Initializes the ConditionEngine with the active schema.\n * @param schema The current UI layout schema.\n */\n constructor(schema: ISchema) {\n this.schema = schema;\n }\n\n\n\n /** Internal map tracking active plugins against their binding paths for real-time state updates. */\n private plugins: Map<string, IPlugin> = new Map();\n\n /**\n * Internal handler to evaluate business rules when a field is updated.\n * @param fieldKey The key of the field that was changed\n * @param isValid Whether the field is currently valid\n */\n public handleEvent(fieldKey: string, isValid: boolean): void {\n // Evaluate conditions via registered operators if a rule system is added later\n }\n\n /**\n * Registers a rendered plugin so the condition engine can push dynamic state updates to it.\n * \n * @param bindingPath The JSON path representing the field within the payload.\n * @param plugin The instantiated plugin handling the field.\n */\n public registerPlugin(bindingPath: string, plugin: IPlugin): void {\n this.plugins.set(bindingPath, plugin);\n }\n\n /**\n * Cleans up listeners to prevent memory leaks on destruction.\n */\n public destroy(): void {\n this.plugins.clear();\n }\n}\n"],"mappings":"sDAAA,MAOSA,EAAQC,EAAA,YAIV,MAAMC,EAAmB,IAAIF,EAA4B,aAGhEE,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GAC/CH,EAAiBC,SAAS,MAAO,CAACC,EAAGC,IAAMD,IAAMC,GACjDH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GAC/CH,EAAiBC,SAAS,MAAO,CAACC,EAAGC,IAAMD,IAAMC,GACjDH,EAAiBC,SAAS,IAAK,CAACC,EAAGC,
|
|
1
|
+
{"version":3,"file":"ConditionEngine.js","names":["Registry","___Registry","OperatorRegistry","register","a","b","ConditionEngine","constructor","schema","this","plugins","Map","handleEvent","fieldKey","isValid","registerPlugin","bindingPath","plugin","set","destroy","clear","__exports","__esModule"],"sources":["ConditionEngine.ts"],"sourcesContent":["/**\n * @file ConditionEngine.ts\n * @description Evaluates dynamic rules to alter the schema in real-time.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { ISchema } from \"../interfaces/ISchema\";\nimport { Registry } from \"./Registry\";\n\nexport type ConditionOperator = (a: unknown, b: unknown) => boolean;\n\nexport const OperatorRegistry = new Registry<ConditionOperator>(\"Operators\");\n\n// Register basic default operators\nOperatorRegistry.register(\"==\", (a, b) => a == b);\nOperatorRegistry.register(\"===\", (a, b) => a === b);\nOperatorRegistry.register(\"!=\", (a, b) => a != b);\nOperatorRegistry.register(\"!==\", (a, b) => a !== b);\nOperatorRegistry.register(\">\", (a, b) => (a as any) > (b as any));\nOperatorRegistry.register(\"<\", (a, b) => (a as any) < (b as any));\nOperatorRegistry.register(\">=\", (a, b) => (a as any) >= (b as any));\nOperatorRegistry.register(\"<=\", (a, b) => (a as any) <= (b as any));\n\n/**\n * Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).\n * It delegates actual evaluations to the configurable `OperatorRegistry`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class ConditionEngine {\n /** The active form schema being evaluated. */\n private schema: ISchema;\n /**\n * Initializes the ConditionEngine with the active schema.\n * @param schema The current UI layout schema.\n */\n constructor(schema: ISchema) {\n this.schema = schema;\n }\n\n\n\n /** Internal map tracking active plugins against their binding paths for real-time state updates. */\n private plugins: Map<string, IPlugin> = new Map();\n\n /**\n * Internal handler to evaluate business rules when a field is updated.\n * @param fieldKey The key of the field that was changed\n * @param isValid Whether the field is currently valid\n */\n public handleEvent(fieldKey: string, isValid: boolean): void {\n // Evaluate conditions via registered operators if a rule system is added later\n }\n\n /**\n * Registers a rendered plugin so the condition engine can push dynamic state updates to it.\n * \n * @param bindingPath The JSON path representing the field within the payload.\n * @param plugin The instantiated plugin handling the field.\n */\n public registerPlugin(bindingPath: string, plugin: IPlugin): void {\n this.plugins.set(bindingPath, plugin);\n }\n\n /**\n * Cleans up listeners to prevent memory leaks on destruction.\n */\n public destroy(): void {\n this.plugins.clear();\n }\n}\n"],"mappings":"sDAAA,MAOSA,EAAQC,EAAA,YAIV,MAAMC,EAAmB,IAAIF,EAA4B,aAGhEE,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GAC/CH,EAAiBC,SAAS,MAAO,CAACC,EAAGC,IAAMD,IAAMC,GACjDH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAMD,GAAKC,GAC/CH,EAAiBC,SAAS,MAAO,CAACC,EAAGC,IAAMD,IAAMC,GACjDH,EAAiBC,SAAS,IAAK,CAACC,EAAGC,IAAOD,EAAaC,GACvDH,EAAiBC,SAAS,IAAK,CAACC,EAAGC,IAAOD,EAAaC,GACvDH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAOD,GAAcC,GACzDH,EAAiBC,SAAS,KAAM,CAACC,EAAGC,IAAOD,GAAcC,GASlD,MAAMC,EAOTC,YAAYC,GACRC,KAAKD,OAASA,CAClB,CAKQE,QAAgC,IAAIC,IAOrCC,YAAYC,EAAkBC,GACjC,CASGC,eAAeC,EAAqBC,GACvCR,KAAKC,QAAQQ,IAAIF,EAAaC,EAClC,CAKOE,UACHV,KAAKC,QAAQU,OACjB,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAAnB,mBAAAmB,EAAAf,kBAAA,OAAAe,CAAA","ignoreList":[]}
|
|
@@ -16,10 +16,10 @@ OperatorRegistry.register("==", (a, b) => a == b);
|
|
|
16
16
|
OperatorRegistry.register("===", (a, b) => a === b);
|
|
17
17
|
OperatorRegistry.register("!=", (a, b) => a != b);
|
|
18
18
|
OperatorRegistry.register("!==", (a, b) => a !== b);
|
|
19
|
-
OperatorRegistry.register(">", (a, b) => a > b);
|
|
20
|
-
OperatorRegistry.register("<", (a, b) => a < b);
|
|
21
|
-
OperatorRegistry.register(">=", (a, b) => a >= b);
|
|
22
|
-
OperatorRegistry.register("<=", (a, b) => a <= b);
|
|
19
|
+
OperatorRegistry.register(">", (a, b) => (a as any) > (b as any));
|
|
20
|
+
OperatorRegistry.register("<", (a, b) => (a as any) < (b as any));
|
|
21
|
+
OperatorRegistry.register(">=", (a, b) => (a as any) >= (b as any));
|
|
22
|
+
OperatorRegistry.register("<=", (a, b) => (a as any) <= (b as any));
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Engine that listens to the EventBus and evaluates cross-field dependencies (e.g. visibleOn, enabledOn).
|
|
@@ -41,14 +41,18 @@ sap.ui.define(["./ConditionEngine", "./PluginRegistry", "sap/m/Text", "../utils/
|
|
|
41
41
|
/** Tracks whether the engine should delegate visual state to the global MessageManager. */
|
|
42
42
|
useMessageManager = false;
|
|
43
43
|
|
|
44
|
+
/** The injected PluginRegistry instance */
|
|
45
|
+
|
|
44
46
|
/**
|
|
45
47
|
* Initializes a new Engine instance.
|
|
46
48
|
* @param editable Whether the engine should render form fields as editable or read-only.
|
|
47
49
|
* @param useMessageManager Whether to delegate visual state to UI5 MessageManager.
|
|
50
|
+
* @param pluginRegistry Optional injected plugin registry. Defaults to singleton.
|
|
48
51
|
*/
|
|
49
|
-
constructor(editable = true, useMessageManager = false) {
|
|
52
|
+
constructor(editable = true, useMessageManager = false, pluginRegistry) {
|
|
50
53
|
this.isEditable = editable;
|
|
51
54
|
this.useMessageManager = useMessageManager;
|
|
55
|
+
this.pluginRegistry = pluginRegistry || PluginRegistry.getInstance();
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
/**
|
|
@@ -76,12 +80,8 @@ sap.ui.define(["./ConditionEngine", "./PluginRegistry", "sap/m/Text", "../utils/
|
|
|
76
80
|
}
|
|
77
81
|
};
|
|
78
82
|
try {
|
|
79
|
-
// Intercept and synthesize a default layout if the developer/backend failed to provide one
|
|
80
|
-
if (DefaultLayoutGenerator.ensureLayout(schema)) {
|
|
81
|
-
Logger.warn("[MetaUI Engine] Missing 'uiLayout' array in schema. Synthesized a default layout mapping to prevent a blank render.");
|
|
82
|
-
}
|
|
83
83
|
const layoutStrategy = schema.layoutStrategy || (schema.type === "array" ? "table" : "form");
|
|
84
|
-
const layoutManager =
|
|
84
|
+
const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);
|
|
85
85
|
return layoutManager.render(schema, modelName, this, onSubmit);
|
|
86
86
|
} catch (error) {
|
|
87
87
|
this.hasPartialRenderingErrors = true;
|
|
@@ -105,7 +105,7 @@ sap.ui.define(["./ConditionEngine", "./PluginRegistry", "sap/m/Text", "../utils/
|
|
|
105
105
|
*/
|
|
106
106
|
generateField(fieldMeta, bindingPath, modelName, isTemplate = false) {
|
|
107
107
|
try {
|
|
108
|
-
const plugin =
|
|
108
|
+
const plugin = this.pluginRegistry.getPlugin(fieldMeta.type || "string", fieldMeta.ui?.widget);
|
|
109
109
|
if (typeof plugin.setEditable === "function") {
|
|
110
110
|
plugin.setEditable(this.isEditable);
|
|
111
111
|
}
|
|
@@ -146,8 +146,11 @@ sap.ui.define(["./ConditionEngine", "./PluginRegistry", "sap/m/Text", "../utils/
|
|
|
146
146
|
*/
|
|
147
147
|
generateLayout(schema, modelName, bindingPath) {
|
|
148
148
|
try {
|
|
149
|
+
if (DefaultLayoutGenerator.ensureLayout(schema)) {
|
|
150
|
+
Logger.warn(`[MetaUI Engine] Missing 'uiLayout' array in sub-schema for ${bindingPath}. Synthesized a default layout mapping.`);
|
|
151
|
+
}
|
|
149
152
|
const layoutStrategy = schema.layoutStrategy || (schema.type === "array" ? "table" : "form");
|
|
150
|
-
const layoutManager =
|
|
153
|
+
const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);
|
|
151
154
|
return layoutManager.render(schema, modelName, this, undefined, bindingPath);
|
|
152
155
|
} catch (error) {
|
|
153
156
|
this.hasPartialRenderingErrors = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Engine-dbg.js","names":["ConditionEngine","___ConditionEngine","PluginRegistry","___PluginRegistry","Logger","___utils_Logger","DefaultLayoutGenerator","___DefaultLayoutGenerator","Engine","conditionEngine","activePlugins","isEditable","hasPartialRenderingErrors","useMessageManager","constructor","editable","build","schema","model","modelName","onSubmit","engineScopeId","onChange","activeModel","isValid","fieldKey","errorMessage","controlId","handleEvent","ensureLayout","warn","layoutStrategy","type","layoutManager","getInstance","getLayout","render","error","msg","message","showErrorPopup","Text","text","generateField","fieldMeta","bindingPath","isTemplate","plugin","getPlugin","ui","widget","setEditable","setUseMessageManager","push","path","scopeId","undefined","control","registerPlugin","generateLayout","validateAll","applyVisualState","errors","item","result","validate","setVisualValidationState","replace","name","getPluginByPath","cleanPath","startsWith","match","find","p","destroy","messageManager","Messaging","existingMessages","getMessageModel","getData","messagesToRemove","targetPath","matched","filter","getTarget","getMessageProcessor","getId","length","removeMessages","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\n * @file Engine.ts\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry (v2).\n */\n\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPlugin, IPluginValidationResult } from \"../interfaces/IPlugin\";\nimport { ConditionEngine } from \"./ConditionEngine\";\nimport { PluginRegistry } from \"./PluginRegistry\";\nimport Control from \"sap/ui/core/Control\";\nimport VBox from \"sap/m/VBox\";\nimport Text from \"sap/m/Text\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n/**\n * The Engine is responsible for translating a normalized schema into a physical UI5 layout.\n * It delegates layout generation to the configured `LayoutManager` and field generation to the `PluginRegistry`.\n * It strictly routes execution flow and tracks active plugins for validation.\n * It embodies the \"Plugin-First Philosophy\" by routing all complex field and layout rendering\n * through discrete, decoupled plugins rather than handling native overrides.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Engine {\n /** Handles dynamic conditional logic across the active form. */\n private conditionEngine: ConditionEngine | null = null;\n\n /** Array of all instantiated plugins generated during the current build. */\n private activePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Deterministic scope ID injected by the host control to prevent clone collisions. */\n public engineScopeId?: string;\n\n private activeModel?: sap.ui.model.Model;\n\n /** Reference to the GeneratorHost that instantiated this engine, for retrieving global definitions. */\n public host?: unknown;\n\n /** Callback to notify the host that an internal field changed. */\n public onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** Tracks whether the entire engine is running in Editable mode. */\n public readonly isEditable: boolean = true;\n\n /** Tracks if any fields or sub-layouts failed to render, requiring a warning strip. */\n public hasPartialRenderingErrors: boolean = false;\n\n /** Tracks whether the engine should delegate visual state to the global MessageManager. */\n public readonly useMessageManager: boolean = false;\n\n /**\n * Initializes a new Engine instance.\n * @param editable Whether the engine should render form fields as editable or read-only.\n * @param useMessageManager Whether to delegate visual state to UI5 MessageManager.\n */\n constructor(editable: boolean = true, useMessageManager: boolean = false) {\n this.isEditable = editable;\n this.useMessageManager = useMessageManager;\n }\n\n /**\n * Bootstraps the layout generation process by resolving the correct layout strategy.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param model The active StateManager JSONModel instance.\n * @param modelName The UI5 model alias used for isolation.\n * @param onSubmit Callback fired when form is submitted.\n * @param engineScopeId Deterministic scope ID for this engine instance.\n * @param onChange Callback fired when field values change.\n * @returns The generated root UI5 Control container.\n */\n public build(schema: ISchema, model: sap.ui.model.Model, modelName: string = \"meta\", onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control {\n this.conditionEngine = new ConditionEngine(schema);\n this.activePlugins = [];\n this.activeModel = model;\n this.engineScopeId = engineScopeId;\n this.onChange = (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => {\n if (this.conditionEngine && fieldKey) {\n this.conditionEngine.handleEvent(fieldKey, isValid);\n }\n if (onChange) {\n onChange(isValid, fieldKey, errorMessage, controlId);\n }\n };\n\n try {\n // Intercept and synthesize a default layout if the developer/backend failed to provide one\n if (DefaultLayoutGenerator.ensureLayout(schema)) {\n Logger.warn(\"[MetaUI Engine] Missing 'uiLayout' array in schema. Synthesized a default layout mapping to prevent a blank render.\");\n }\n\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = PluginRegistry.getInstance().getLayout(layoutStrategy);\n\n return layoutManager.render(schema, modelName, this, onSubmit);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(\"[MetaUI Engine] Critical error during layout generation\", msg);\n Logger.showErrorPopup(`Engine failed to generate the layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Layout Error\" });\n }\n }\n\n /**\n * Instantiates the correct plugin for a specific field based on type and widget hints,\n * and tracks the plugin for global validation.\n * \n * @param fieldMeta The metadata schema specific to the field.\n * @param bindingPath The JSON path representing the field within the payload.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @returns The generated UI5 Control for the field.\n */\n public generateField(fieldMeta: IPropertyMetadata, bindingPath: string, modelName: string, isTemplate: boolean = false): Control {\n try {\n const plugin = PluginRegistry.getInstance().getPlugin(fieldMeta.type || \"string\", fieldMeta.ui?.widget);\n if (typeof plugin.setEditable === \"function\") {\n plugin.setEditable(this.isEditable);\n }\n\n if (typeof plugin.setUseMessageManager === \"function\") {\n plugin.setUseMessageManager(this.useMessageManager);\n }\n\n if (!isTemplate) {\n this.activePlugins.push({ plugin, path: bindingPath });\n }\n const scopeId = isTemplate ? undefined : this.engineScopeId;\n const control = plugin.render(fieldMeta, bindingPath, modelName, scopeId, this.onChange, this.activeModel);\n\n if (this.conditionEngine) {\n this.conditionEngine.registerPlugin(bindingPath, plugin);\n }\n\n return control;\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Failed to generate field at ${bindingPath}`, msg);\n Logger.showErrorPopup(`Failed to generate field '${bindingPath}'.\\n\\nDetails: ${msg}`);\n return new Text({ text: `[Error generating field ${bindingPath}]` });\n }\n }\n\n /**\n * Generates a sub-layout (like an embedded table or nested form) without \n * destroying the current Engine state or Condition tracking.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param modelName The UI5 JSONModel name used for data binding (defaults to \"meta\").\n * @param bindingPath Optional path to bind the sub-layout to a specific array/object property.\n * @returns The generated root UI5 Control container.\n */\n public generateLayout(schema: ISchema, modelName: string, bindingPath?: string): Control {\n try {\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = PluginRegistry.getInstance().getLayout(layoutStrategy);\n return layoutManager.render(schema, modelName, this, undefined, bindingPath);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Critical error generating sub-layout for ${bindingPath}`, msg);\n Logger.showErrorPopup(`Engine failed to generate a sub-layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Sub-Layout Error\" });\n }\n }\n\n /**\n * Iterates through all active plugins and triggers their internal validation pipelines.\n * \n * @param applyVisualState If true, explicitly instructs the plugin to natively paint its own ValueState.\n * @returns {IPluginValidationResult[]} Array of validation error objects. Empty array if valid.\n */\n public validateAll(applyVisualState: boolean = false): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n for (const item of this.activePlugins) {\n try {\n const result = item.plugin.validate();\n if (applyVisualState && typeof item.plugin.setVisualValidationState === \"function\") {\n item.plugin.setVisualValidationState(result.isValid, result.errorMessage);\n }\n\n if (!result.isValid) {\n // Ensure the path is bound to the error so GeneratorHost knows where to target it\n result.fieldKey = result.fieldKey || item.path.replace(/^\\//, \"\");\n errors.push(result);\n // Add console log to find which plugin fails silently\n Logger.error(\"[MetaUI Validation] Plugin failed validation silently:\", item.path || item.plugin.constructor.name);\n }\n } catch (error) {\n Logger.error(`[MetaUI Engine] Error validating plugin at ${item.path}`, (error as Error).message);\n }\n }\n return errors;\n }\n\n /**\n * Retrieves an active plugin instance by its absolute binding path.\n * Useful for programmatic field manipulation (e.g., custom error injection).\n * \n * @param path The binding path (e.g. \"/General/CustomerName\").\n * @returns {IPlugin | undefined} The plugin instance, or undefined if not found.\n */\n public getPluginByPath(path: string): import(\"../interfaces/IPlugin\").IPlugin | undefined {\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n const match = this.activePlugins.find(p => p.path === cleanPath || p.path === `/${cleanPath}`);\n return match ? match.plugin : undefined;\n }\n\n /**\n * Cleans up internal state and destroys the condition engine to prevent memory leaks.\n */\n public destroy(): void {\n if (this.conditionEngine) {\n this.conditionEngine.destroy();\n this.conditionEngine = null;\n }\n\n // ------------------------------------------------------------------------\n // Ghost Error Prevention\n // Flush MessageManager for active plugins before destroying their controls\n // ------------------------------------------------------------------------\n const messageManager = Messaging;\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove: unknown[] = [];\n\n for (const item of this.activePlugins) {\n if (this.activeModel) {\n const targetPath = `/${item.path.replace(/^\\//, \"\")}`;\n const matched = (existingMessages as { getTarget: () => string, getMessageProcessor: () => { getId: () => string } }[]).filter(msg =>\n msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.activeModel!.getId()\n );\n messagesToRemove.push(...matched);\n }\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n\n this.activePlugins = [];\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAQSA,eAAe,GAAAC,kBAAA;EAAA,MACfC,cAAc,GAAAC,iBAAA;EAAA,MAIdC,MAAM,GAAAC,eAAA;EAAA,MACNC,sBAAsB,GAAAC,yBAAA;EAI/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,MAAM,CAAC;IAChB;IACQC,eAAe,GAA2B,IAAI;;IAEtD;IACQC,aAAa,GAAwC,EAAE;;IAE/D;;IAKA;;IAGA;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ACDN,gBAAgB,CAAC5B,IAAI,CAAC,GAAG8B,OAAO,CAAC;QACrC;QACA,IAAI,OAAOpB,IAAI,CAAChB,MAAM,CAAC4B,OAAO,KAAK,UAAU,EAAE;UAC3CZ,IAAI,CAAChB,MAAM,CAAC4B,OAAO,CAAC,CAAC;QACzB;MACJ;MAEA,IAAIM,gBAAgB,CAACO,MAAM,GAAG,CAAC,EAAE;QAC7BZ,cAAc,CAACa,cAAc,CAACR,gBAAgB,CAAC;MACnD;MAEA,IAAI,CAACvE,aAAa,GAAG,EAAE;IAC3B;EACJ;EAAC,IAAAgF,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAlF,MAAA,GAAAA,MAAA;EAAA,OAAAkF,SAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Engine-dbg.js","names":["ConditionEngine","___ConditionEngine","PluginRegistry","___PluginRegistry","Logger","___utils_Logger","DefaultLayoutGenerator","___DefaultLayoutGenerator","Engine","conditionEngine","activePlugins","isEditable","hasPartialRenderingErrors","useMessageManager","constructor","editable","pluginRegistry","getInstance","build","schema","model","modelName","onSubmit","engineScopeId","onChange","activeModel","isValid","fieldKey","errorMessage","controlId","handleEvent","layoutStrategy","type","layoutManager","getLayout","render","error","msg","message","showErrorPopup","Text","text","generateField","fieldMeta","bindingPath","isTemplate","plugin","getPlugin","ui","widget","setEditable","setUseMessageManager","push","path","scopeId","undefined","control","registerPlugin","generateLayout","ensureLayout","warn","validateAll","applyVisualState","errors","item","result","validate","setVisualValidationState","replace","name","getPluginByPath","cleanPath","startsWith","match","find","p","destroy","messageManager","Messaging","existingMessages","getMessageModel","getData","messagesToRemove","targetPath","matched","filter","getTarget","getMessageProcessor","getId","length","removeMessages","__exports","__esModule"],"sources":["Engine.ts"],"sourcesContent":["/**\n * @file Engine.ts\n * @description The central orchestrator that routes data between the Layout Factory and Plugin Registry (v2).\n */\n\nimport { ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { IPlugin, IPluginValidationResult } from \"../interfaces/IPlugin\";\nimport { ConditionEngine } from \"./ConditionEngine\";\nimport { PluginRegistry } from \"./PluginRegistry\";\nimport Control from \"sap/ui/core/Control\";\nimport VBox from \"sap/m/VBox\";\nimport Text from \"sap/m/Text\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\nimport Core from \"sap/ui/core/Core\";\nimport Messaging from \"sap/ui/core/Messaging\";\n\n/**\n * The Engine is responsible for translating a normalized schema into a physical UI5 layout.\n * It delegates layout generation to the configured `LayoutManager` and field generation to the `PluginRegistry`.\n * It strictly routes execution flow and tracks active plugins for validation.\n * It embodies the \"Plugin-First Philosophy\" by routing all complex field and layout rendering\n * through discrete, decoupled plugins rather than handling native overrides.\n * \n * @namespace nz.co.siliconst.ui5.metaui.core\n * @public\n */\nexport class Engine {\n /** Handles dynamic conditional logic across the active form. */\n private conditionEngine: ConditionEngine | null = null;\n\n /** Array of all instantiated plugins generated during the current build. */\n private activePlugins: { plugin: IPlugin, path: string }[] = [];\n\n /** Deterministic scope ID injected by the host control to prevent clone collisions. */\n public engineScopeId?: string;\n\n private activeModel?: any;\n\n /** Reference to the GeneratorHost that instantiated this engine, for retrieving global definitions. */\n public host?: unknown;\n\n /** Callback to notify the host that an internal field changed. */\n public onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** Tracks whether the entire engine is running in Editable mode. */\n public readonly isEditable: boolean = true;\n\n /** Tracks if any fields or sub-layouts failed to render, requiring a warning strip. */\n public hasPartialRenderingErrors: boolean = false;\n\n /** Tracks whether the engine should delegate visual state to the global MessageManager. */\n public readonly useMessageManager: boolean = false;\n\n /** The injected PluginRegistry instance */\n public readonly pluginRegistry: PluginRegistry;\n\n /**\n * Initializes a new Engine instance.\n * @param editable Whether the engine should render form fields as editable or read-only.\n * @param useMessageManager Whether to delegate visual state to UI5 MessageManager.\n * @param pluginRegistry Optional injected plugin registry. Defaults to singleton.\n */\n constructor(editable: boolean = true, useMessageManager: boolean = false, pluginRegistry?: PluginRegistry) {\n this.isEditable = editable;\n this.useMessageManager = useMessageManager;\n this.pluginRegistry = pluginRegistry || PluginRegistry.getInstance();\n }\n\n /**\n * Bootstraps the layout generation process by resolving the correct layout strategy.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param model The active StateManager JSONModel instance.\n * @param modelName The UI5 model alias used for isolation.\n * @param onSubmit Callback fired when form is submitted.\n * @param engineScopeId Deterministic scope ID for this engine instance.\n * @param onChange Callback fired when field values change.\n * @returns The generated root UI5 Control container.\n */\n public build(schema: ISchema, model: any, modelName: string = \"meta\", onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control {\n this.conditionEngine = new ConditionEngine(schema);\n this.activePlugins = [];\n this.activeModel = model;\n this.engineScopeId = engineScopeId;\n this.onChange = (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => {\n if (this.conditionEngine && fieldKey) {\n this.conditionEngine.handleEvent(fieldKey, isValid);\n }\n if (onChange) {\n onChange(isValid, fieldKey, errorMessage, controlId);\n }\n };\n\n try {\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n\n return layoutManager.render(schema, modelName, this, onSubmit);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(\"[MetaUI Engine] Critical error during layout generation\", msg);\n Logger.showErrorPopup(`Engine failed to generate the layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Layout Error\" });\n }\n }\n\n /**\n * Instantiates the correct plugin for a specific field based on type and widget hints,\n * and tracks the plugin for global validation.\n * \n * @param fieldMeta The metadata schema specific to the field.\n * @param bindingPath The JSON path representing the field within the payload.\n * @param modelName The UI5 JSONModel name used for data binding.\n * @returns The generated UI5 Control for the field.\n */\n public generateField(fieldMeta: IPropertyMetadata, bindingPath: string, modelName: string, isTemplate: boolean = false): Control {\n try {\n const plugin = this.pluginRegistry.getPlugin(fieldMeta.type || \"string\", fieldMeta.ui?.widget);\n if (typeof plugin.setEditable === \"function\") {\n plugin.setEditable(this.isEditable);\n }\n\n if (typeof plugin.setUseMessageManager === \"function\") {\n plugin.setUseMessageManager(this.useMessageManager);\n }\n\n if (!isTemplate) {\n this.activePlugins.push({ plugin, path: bindingPath });\n }\n const scopeId = isTemplate ? undefined : this.engineScopeId;\n const control = plugin.render(fieldMeta, bindingPath, modelName, scopeId, this.onChange, this.activeModel);\n\n if (this.conditionEngine) {\n this.conditionEngine.registerPlugin(bindingPath, plugin);\n }\n\n return control;\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Failed to generate field at ${bindingPath}`, msg);\n Logger.showErrorPopup(`Failed to generate field '${bindingPath}'.\\n\\nDetails: ${msg}`);\n return new Text({ text: `[Error generating field ${bindingPath}]` });\n }\n }\n\n /**\n * Generates a sub-layout (like an embedded table or nested form) without \n * destroying the current Engine state or Condition tracking.\n * \n * @param schema The normalized JSON schema representing the view.\n * @param modelName The UI5 JSONModel name used for data binding (defaults to \"meta\").\n * @param bindingPath Optional path to bind the sub-layout to a specific array/object property.\n * @returns The generated root UI5 Control container.\n */\n public generateLayout(schema: ISchema, modelName: string, bindingPath?: string): Control {\n try {\n if (DefaultLayoutGenerator.ensureLayout(schema)) {\n Logger.warn(`[MetaUI Engine] Missing 'uiLayout' array in sub-schema for ${bindingPath}. Synthesized a default layout mapping.`);\n }\n\n const layoutStrategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n const layoutManager = this.pluginRegistry.getLayout(layoutStrategy);\n return layoutManager.render(schema, modelName, this, undefined, bindingPath);\n } catch (error) {\n this.hasPartialRenderingErrors = true;\n const msg = (error as Error).message;\n Logger.error(`[MetaUI Engine] Critical error generating sub-layout for ${bindingPath}`, msg);\n Logger.showErrorPopup(`Engine failed to generate a sub-layout.\\n\\nDetails: ${msg}`);\n return new Text({ text: \"Critical Sub-Layout Error\" });\n }\n }\n\n /**\n * Iterates through all active plugins and triggers their internal validation pipelines.\n * \n * @param applyVisualState If true, explicitly instructs the plugin to natively paint its own ValueState.\n * @returns {IPluginValidationResult[]} Array of validation error objects. Empty array if valid.\n */\n public validateAll(applyVisualState: boolean = false): IPluginValidationResult[] {\n const errors: IPluginValidationResult[] = [];\n for (const item of this.activePlugins) {\n try {\n const result = item.plugin.validate();\n if (applyVisualState && typeof item.plugin.setVisualValidationState === \"function\") {\n item.plugin.setVisualValidationState(result.isValid, result.errorMessage);\n }\n\n if (!result.isValid) {\n // Ensure the path is bound to the error so GeneratorHost knows where to target it\n result.fieldKey = result.fieldKey || item.path.replace(/^\\//, \"\");\n errors.push(result);\n // Add console log to find which plugin fails silently\n Logger.error(\"[MetaUI Validation] Plugin failed validation silently:\", item.path || item.plugin.constructor.name);\n }\n } catch (error) {\n Logger.error(`[MetaUI Engine] Error validating plugin at ${item.path}`, (error as Error).message);\n }\n }\n return errors;\n }\n\n /**\n * Retrieves an active plugin instance by its absolute binding path.\n * Useful for programmatic field manipulation (e.g., custom error injection).\n * \n * @param path The binding path (e.g. \"/General/CustomerName\").\n * @returns {IPlugin | undefined} The plugin instance, or undefined if not found.\n */\n public getPluginByPath(path: string): import(\"../interfaces/IPlugin\").IPlugin | undefined {\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n const match = this.activePlugins.find(p => p.path === cleanPath || p.path === `/${cleanPath}`);\n return match ? match.plugin : undefined;\n }\n\n /**\n * Cleans up internal state and destroys the condition engine to prevent memory leaks.\n */\n public destroy(): void {\n if (this.conditionEngine) {\n this.conditionEngine.destroy();\n this.conditionEngine = null;\n }\n\n // ------------------------------------------------------------------------\n // Ghost Error Prevention\n // Flush MessageManager for active plugins before destroying their controls\n // ------------------------------------------------------------------------\n const messageManager = Messaging;\n const existingMessages = messageManager.getMessageModel().getData();\n const messagesToRemove: unknown[] = [];\n\n for (const item of this.activePlugins) {\n if (this.activeModel) {\n const targetPath = `/${item.path.replace(/^\\//, \"\")}`;\n const matched = (existingMessages as { getTarget: () => string, getMessageProcessor: () => { getId: () => string } }[]).filter(msg =>\n msg.getTarget() === targetPath && msg.getMessageProcessor() && msg.getMessageProcessor().getId() === this.activeModel!.getId()\n );\n messagesToRemove.push(...matched);\n }\n if (typeof item.plugin.destroy === \"function\") {\n item.plugin.destroy();\n }\n }\n\n if (messagesToRemove.length > 0) {\n messageManager.removeMessages(messagesToRemove);\n }\n\n this.activePlugins = [];\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAQSA,eAAe,GAAAC,kBAAA;EAAA,MACfC,cAAc,GAAAC,iBAAA;EAAA,MAIdC,MAAM,GAAAC,eAAA;EAAA,MACNC,sBAAsB,GAAAC,yBAAA;EAI/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,MAAM,CAAC;IAChB;IACQC,eAAe,GAA2B,IAAI;;IAEtD;IACQC,aAAa,GAAwC,EAAE;;IAE/D;;IAKA;;IAGA;;IAGA;IACgBC,UAAU,GAAY,IAAI;;IAE1C;IACOC,yBAAyB,GAAY,KAAK;;IAEjD;IACgBC,iBAAiB,GAAY,KAAK;;IAElD;;IAGA;AACJ;AACA;AACA;AACA;AACA;IACIC,WAAWA,CAACC,QAAiB,GAAG,IAAI,EAAEF,iBAA0B,GAAG,KAAK,EAAEG,cAA+B,EAAE;MACvG,IAAI,CAACL,UAAU,GAAGI,QAAQ;MAC1B,IAAI,CAACF,iBAAiB,GAAGA,iBAAiB;MAC1C,IAAI,CAACG,cAAc,GAAGA,cAAc,IAAId,cAAc,CAACe,WAAW,CAAC,CAAC;IACxE;;IAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACWC,KAAKA,CAACC,MAAe,EAAEC,KAAU,EA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GAAAA,MAAA;EAAA,OAAAmF,SAAA;AAAA","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ declare module "nz/co/siliconst/ui5/metaui/core/Engine" {
|
|
|
5
5
|
*/
|
|
6
6
|
import { ISchema, IPropertyMetadata } from "nz/co/siliconst/ui5/metaui/interfaces/ISchema";
|
|
7
7
|
import { IPluginValidationResult } from "nz/co/siliconst/ui5/metaui/interfaces/IPlugin";
|
|
8
|
+
import { PluginRegistry } from "nz/co/siliconst/ui5/metaui/core/PluginRegistry";
|
|
8
9
|
import Control from "sap/ui/core/Control";
|
|
9
10
|
/**
|
|
10
11
|
* The Engine is responsible for translating a normalized schema into a physical UI5 layout.
|
|
@@ -34,12 +35,15 @@ declare module "nz/co/siliconst/ui5/metaui/core/Engine" {
|
|
|
34
35
|
hasPartialRenderingErrors: boolean;
|
|
35
36
|
/** Tracks whether the engine should delegate visual state to the global MessageManager. */
|
|
36
37
|
readonly useMessageManager: boolean;
|
|
38
|
+
/** The injected PluginRegistry instance */
|
|
39
|
+
readonly pluginRegistry: PluginRegistry;
|
|
37
40
|
/**
|
|
38
41
|
* Initializes a new Engine instance.
|
|
39
42
|
* @param editable Whether the engine should render form fields as editable or read-only.
|
|
40
43
|
* @param useMessageManager Whether to delegate visual state to UI5 MessageManager.
|
|
44
|
+
* @param pluginRegistry Optional injected plugin registry. Defaults to singleton.
|
|
41
45
|
*/
|
|
42
|
-
constructor(editable?: boolean, useMessageManager?: boolean);
|
|
46
|
+
constructor(editable?: boolean, useMessageManager?: boolean, pluginRegistry?: PluginRegistry);
|
|
43
47
|
/**
|
|
44
48
|
* Bootstraps the layout generation process by resolving the correct layout strategy.
|
|
45
49
|
*
|
|
@@ -51,7 +55,7 @@ declare module "nz/co/siliconst/ui5/metaui/core/Engine" {
|
|
|
51
55
|
* @param onChange Callback fired when field values change.
|
|
52
56
|
* @returns The generated root UI5 Control container.
|
|
53
57
|
*/
|
|
54
|
-
build(schema: ISchema, model:
|
|
58
|
+
build(schema: ISchema, model: any, modelName?: string, onSubmit?: () => void, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void): Control;
|
|
55
59
|
/**
|
|
56
60
|
* Instantiates the correct plugin for a specific field based on type and widget hints,
|
|
57
61
|
* and tracks the plugin for global validation.
|